Class v1.DeliveryServiceClient (0.1.0)

The Last Mile Delivery service. v1

Package

@googlemaps/fleetengine-delivery

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of DeliveryServiceClient.

Parameters
Name Description
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new DeliveryServiceClient({fallback: true}, gax); ```

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

auth

auth: gax.GoogleAuth;

deliveryServiceStub

deliveryServiceStub?: Promise<{
        [name: string]: Function;
    }>;

descriptors

descriptors: Descriptors;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

static get servicePath(): string;

The DNS address for this API service.

universeDomain

get universeDomain(): string;

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

batchCreateTasks(request, options)

batchCreateTasks(request?: protos.maps.fleetengine.delivery.v1.IBatchCreateTasksRequest, options?: CallOptions): Promise<[
        protos.maps.fleetengine.delivery.v1.IBatchCreateTasksResponse,
        protos.maps.fleetengine.delivery.v1.IBatchCreateTasksRequest | undefined,
        {} | undefined
    ]>;

Creates and returns a batch of new Task objects.

Parameters
Name Description
request IBatchCreateTasksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.maps.fleetengine.delivery.v1.IBatchCreateTasksResponse, protos.maps.fleetengine.delivery.v1.IBatchCreateTasksRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing BatchCreateTasksResponse. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. The standard Delivery API request header.
   *  Note: If you set this field, then the header field in the
   *  `CreateTaskRequest` messages must either be empty, or it must match this
   *  field.
   */
  // const header = {}
  /**
   *  Required. The parent resource shared by all tasks. This value must be in
   *  the format `providers/{provider}`. The `provider` must be the Google Cloud
   *  Project ID. For example, `sample-cloud-project`. The parent field in the
   *  `CreateTaskRequest` messages must either  be empty, or it must match this
   *  field.
   */
  // const parent = 'abc123'
  /**
   *  Required. The request message that specifies the resources to create.
   *  Note: You can create a maximum of 500 tasks in a batch.
   */
  // const requests = [1,2,3,4]

  // Imports the Delivery library
  const {DeliveryServiceClient} = require('@googlemaps/fleetengine-delivery').v1;

  // Instantiates a client
  const deliveryClient = new DeliveryServiceClient();

  async function callBatchCreateTasks() {
    // Construct request
    const request = {
      parent,
      requests,
    };

    // Run request
    const response = await deliveryClient.batchCreateTasks(request);
    console.log(response);
  }

  callBatchCreateTasks();

batchCreateTasks(request, options, callback)

batchCreateTasks(request: protos.maps.fleetengine.delivery.v1.IBatchCreateTasksRequest, options: CallOptions, callback: Callback<protos.maps.fleetengine.delivery.v1.IBatchCreateTasksResponse, protos.maps.fleetengine.delivery.v1.IBatchCreateTasksRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IBatchCreateTasksRequest
options CallOptions
callback Callback<protos.maps.fleetengine.delivery.v1.IBatchCreateTasksResponse, protos.maps.fleetengine.delivery.v1.IBatchCreateTasksRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

batchCreateTasks(request, callback)

batchCreateTasks(request: protos.maps.fleetengine.delivery.v1.IBatchCreateTasksRequest, callback: Callback<protos.maps.fleetengine.delivery.v1.IBatchCreateTasksResponse, protos.maps.fleetengine.delivery.v1.IBatchCreateTasksRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IBatchCreateTasksRequest
callback Callback<protos.maps.fleetengine.delivery.v1.IBatchCreateTasksResponse, protos.maps.fleetengine.delivery.v1.IBatchCreateTasksRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
Type Description
Promise<void>

{Promise} A promise that resolves when the client is closed.

createDeliveryVehicle(request, options)

createDeliveryVehicle(request?: protos.maps.fleetengine.delivery.v1.ICreateDeliveryVehicleRequest, options?: CallOptions): Promise<[
        protos.maps.fleetengine.delivery.v1.IDeliveryVehicle,
        (protos.maps.fleetengine.delivery.v1.ICreateDeliveryVehicleRequest | undefined),
        {} | undefined
    ]>;

Creates and returns a new DeliveryVehicle.

Parameters
Name Description
request ICreateDeliveryVehicleRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.maps.fleetengine.delivery.v1.IDeliveryVehicle, (protos.maps.fleetengine.delivery.v1.ICreateDeliveryVehicleRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. The standard Delivery API request header.
   */
  // const header = {}
  /**
   *  Required. Must be in the format `providers/{provider}`. The provider must
   *  be the Google Cloud Project ID. For example, `sample-cloud-project`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The Delivery Vehicle ID must be unique and subject to the
   *  following restrictions:
   *  * Must be a valid Unicode string.
   *  * Limited to a maximum length of 64 characters.
   *  * Normalized according to Unicode Normalization Form C 
   *  (http://www.unicode.org/reports/tr15/).
   *  * May not contain any of the following ASCII characters: '/', ':', '?',
   *  ',', or '#'.
   */
  // const deliveryVehicleId = 'abc123'
  /**
   *  Required. The `DeliveryVehicle` entity to create. When creating a new
   *  delivery vehicle, you may set the following optional fields:
   *  * last_location
   *  * attributes
   *  Note: The DeliveryVehicle's `name` field is ignored. All other
   *  DeliveryVehicle fields must not be set; otherwise, an error is returned.
   */
  // const deliveryVehicle = {}

  // Imports the Delivery library
  const {DeliveryServiceClient} = require('@googlemaps/fleetengine-delivery').v1;

  // Instantiates a client
  const deliveryClient = new DeliveryServiceClient();

  async function callCreateDeliveryVehicle() {
    // Construct request
    const request = {
      parent,
      deliveryVehicleId,
      deliveryVehicle,
    };

    // Run request
    const response = await deliveryClient.createDeliveryVehicle(request);
    console.log(response);
  }

  callCreateDeliveryVehicle();

createDeliveryVehicle(request, options, callback)

createDeliveryVehicle(request: protos.maps.fleetengine.delivery.v1.ICreateDeliveryVehicleRequest, options: CallOptions, callback: Callback<protos.maps.fleetengine.delivery.v1.IDeliveryVehicle, protos.maps.fleetengine.delivery.v1.ICreateDeliveryVehicleRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateDeliveryVehicleRequest
options CallOptions
callback Callback<protos.maps.fleetengine.delivery.v1.IDeliveryVehicle, protos.maps.fleetengine.delivery.v1.ICreateDeliveryVehicleRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createDeliveryVehicle(request, callback)

createDeliveryVehicle(request: protos.maps.fleetengine.delivery.v1.ICreateDeliveryVehicleRequest, callback: Callback<protos.maps.fleetengine.delivery.v1.IDeliveryVehicle, protos.maps.fleetengine.delivery.v1.ICreateDeliveryVehicleRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateDeliveryVehicleRequest
callback Callback<protos.maps.fleetengine.delivery.v1.IDeliveryVehicle, protos.maps.fleetengine.delivery.v1.ICreateDeliveryVehicleRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createTask(request, options)

createTask(request?: protos.maps.fleetengine.delivery.v1.ICreateTaskRequest, options?: CallOptions): Promise<[
        protos.maps.fleetengine.delivery.v1.ITask,
        protos.maps.fleetengine.delivery.v1.ICreateTaskRequest | undefined,
        {} | undefined
    ]>;

Creates and returns a new Task object.

Parameters
Name Description
request ICreateTaskRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.maps.fleetengine.delivery.v1.ITask, protos.maps.fleetengine.delivery.v1.ICreateTaskRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. The standard Delivery API request header.
   */
  // const header = {}
  /**
   *  Required. Must be in the format `providers/{provider}`. The `provider` must
   *  be the Google Cloud Project ID. For example, `sample-cloud-project`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The Task ID must be unique, but it should be not a shipment
   *  tracking ID. To store a shipment tracking ID, use the `tracking_id` field.
   *  Note that multiple tasks can have the same `tracking_id`. Task IDs are
   *  subject to the following restrictions:
   *  * Must be a valid Unicode string.
   *  * Limited to a maximum length of 64 characters.
   *  * Normalized according to Unicode Normalization Form C 
   *  (http://www.unicode.org/reports/tr15/).
   *  * May not contain any of the following ASCII characters: '/', ':', '?',
   *  ',', or '#'.
   */
  // const taskId = 'abc123'
  /**
   *  Required. The Task entity to create.
   *  When creating a Task, the following fields are required:
   *  * `type`
   *  * `state` (must be set to `OPEN`)
   *  * `tracking_id` (must not be set for `UNAVAILABLE` or `SCHEDULED_STOP`
   *  tasks, but required for all other task types)
   *  * `planned_location` (optional for `UNAVAILABLE` tasks)
   *  * `task_duration`
   *  Note: The Task's `name` field is ignored. All other Task fields must not be
   *  set; otherwise, an error is returned.
   */
  // const task = {}

  // Imports the Delivery library
  const {DeliveryServiceClient} = require('@googlemaps/fleetengine-delivery').v1;

  // Instantiates a client
  const deliveryClient = new DeliveryServiceClient();

  async function callCreateTask() {
    // Construct request
    const request = {
      parent,
      taskId,
      task,
    };

    // Run request
    const response = await deliveryClient.createTask(request);
    console.log(response);
  }

  callCreateTask();

createTask(request, options, callback)

createTask(request: protos.maps.fleetengine.delivery.v1.ICreateTaskRequest, options: CallOptions, callback: Callback<protos.maps.fleetengine.delivery.v1.ITask, protos.maps.fleetengine.delivery.v1.ICreateTaskRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateTaskRequest
options CallOptions
callback Callback<protos.maps.fleetengine.delivery.v1.ITask, protos.maps.fleetengine.delivery.v1.ICreateTaskRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createTask(request, callback)

createTask(request: protos.maps.fleetengine.delivery.v1.ICreateTaskRequest, callback: Callback<protos.maps.fleetengine.delivery.v1.ITask, protos.maps.fleetengine.delivery.v1.ICreateTaskRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateTaskRequest
callback Callback<protos.maps.fleetengine.delivery.v1.ITask, protos.maps.fleetengine.delivery.v1.ICreateTaskRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deliveryVehiclePath(provider, vehicle)

deliveryVehiclePath(provider: string, vehicle: string): string;

Return a fully-qualified deliveryVehicle resource name string.

Parameters
Name Description
provider string
vehicle string
Returns
Type Description
string

{string} Resource name string.

getDeliveryVehicle(request, options)

getDeliveryVehicle(request?: protos.maps.fleetengine.delivery.v1.IGetDeliveryVehicleRequest, options?: CallOptions): Promise<[
        protos.maps.fleetengine.delivery.v1.IDeliveryVehicle,
        (protos.maps.fleetengine.delivery.v1.IGetDeliveryVehicleRequest | undefined),
        {} | undefined
    ]>;

Returns the specified DeliveryVehicle instance.

Parameters
Name Description
request IGetDeliveryVehicleRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.maps.fleetengine.delivery.v1.IDeliveryVehicle, (protos.maps.fleetengine.delivery.v1.IGetDeliveryVehicleRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. The standard Delivery API request header.
   */
  // const header = {}
  /**
   *  Required. Must be in the format
   *  `providers/{provider}/deliveryVehicles/{delivery_vehicle}`.
   *  The `provider` must be the Google Cloud Project ID. For example,
   *  `sample-cloud-project`.
   */
  // const name = 'abc123'

  // Imports the Delivery library
  const {DeliveryServiceClient} = require('@googlemaps/fleetengine-delivery').v1;

  // Instantiates a client
  const deliveryClient = new DeliveryServiceClient();

  async function callGetDeliveryVehicle() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await deliveryClient.getDeliveryVehicle(request);
    console.log(response);
  }

  callGetDeliveryVehicle();

getDeliveryVehicle(request, options, callback)

getDeliveryVehicle(request: protos.maps.fleetengine.delivery.v1.IGetDeliveryVehicleRequest, options: CallOptions, callback: Callback<protos.maps.fleetengine.delivery.v1.IDeliveryVehicle, protos.maps.fleetengine.delivery.v1.IGetDeliveryVehicleRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetDeliveryVehicleRequest
options CallOptions
callback Callback<protos.maps.fleetengine.delivery.v1.IDeliveryVehicle, protos.maps.fleetengine.delivery.v1.IGetDeliveryVehicleRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getDeliveryVehicle(request, callback)

getDeliveryVehicle(request: protos.maps.fleetengine.delivery.v1.IGetDeliveryVehicleRequest, callback: Callback<protos.maps.fleetengine.delivery.v1.IDeliveryVehicle, protos.maps.fleetengine.delivery.v1.IGetDeliveryVehicleRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetDeliveryVehicleRequest
callback Callback<protos.maps.fleetengine.delivery.v1.IDeliveryVehicle, protos.maps.fleetengine.delivery.v1.IGetDeliveryVehicleRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getProjectId()

getProjectId(): Promise<string>;
Returns
Type Description
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
Name Description
callback Callback<string, undefined, undefined>
Returns
Type Description
void

getTask(request, options)

getTask(request?: protos.maps.fleetengine.delivery.v1.IGetTaskRequest, options?: CallOptions): Promise<[
        protos.maps.fleetengine.delivery.v1.ITask,
        protos.maps.fleetengine.delivery.v1.IGetTaskRequest | undefined,
        {} | undefined
    ]>;

Gets information about a Task.

Parameters
Name Description
request IGetTaskRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.maps.fleetengine.delivery.v1.ITask, protos.maps.fleetengine.delivery.v1.IGetTaskRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. The standard Delivery API request header.
   */
  // const header = {}
  /**
   *  Required. Must be in the format `providers/{provider}/tasks/{task}`. The
   *  `provider` must be the Google Cloud Project ID. For example,
   *  `sample-cloud-project`.
   */
  // const name = 'abc123'

  // Imports the Delivery library
  const {DeliveryServiceClient} = require('@googlemaps/fleetengine-delivery').v1;

  // Instantiates a client
  const deliveryClient = new DeliveryServiceClient();

  async function callGetTask() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await deliveryClient.getTask(request);
    console.log(response);
  }

  callGetTask();

getTask(request, options, callback)

getTask(request: protos.maps.fleetengine.delivery.v1.IGetTaskRequest, options: CallOptions, callback: Callback<protos.maps.fleetengine.delivery.v1.ITask, protos.maps.fleetengine.delivery.v1.IGetTaskRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetTaskRequest
options CallOptions
callback Callback<protos.maps.fleetengine.delivery.v1.ITask, protos.maps.fleetengine.delivery.v1.IGetTaskRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getTask(request, callback)

getTask(request: protos.maps.fleetengine.delivery.v1.IGetTaskRequest, callback: Callback<protos.maps.fleetengine.delivery.v1.ITask, protos.maps.fleetengine.delivery.v1.IGetTaskRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetTaskRequest
callback Callback<protos.maps.fleetengine.delivery.v1.ITask, protos.maps.fleetengine.delivery.v1.IGetTaskRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getTaskTrackingInfo(request, options)

getTaskTrackingInfo(request?: protos.maps.fleetengine.delivery.v1.IGetTaskTrackingInfoRequest, options?: CallOptions): Promise<[
        protos.maps.fleetengine.delivery.v1.ITaskTrackingInfo,
        (protos.maps.fleetengine.delivery.v1.IGetTaskTrackingInfoRequest | undefined),
        {} | undefined
    ]>;

Returns the specified TaskTrackingInfo instance.

Parameters
Name Description
request IGetTaskTrackingInfoRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.maps.fleetengine.delivery.v1.ITaskTrackingInfo, (protos.maps.fleetengine.delivery.v1.IGetTaskTrackingInfoRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing TaskTrackingInfo. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. The standard Delivery API request header.
   */
  // const header = {}
  /**
   *  Required. Must be in the format
   *  `providers/{provider}/taskTrackingInfo/{tracking_id}`. The `provider`
   *  must be the Google Cloud Project ID, and the `tracking_id` must be the
   *  tracking ID associated with the task. An example name can be
   *  `providers/sample-cloud-project/taskTrackingInfo/sample-tracking-id`.
   */
  // const name = 'abc123'

  // Imports the Delivery library
  const {DeliveryServiceClient} = require('@googlemaps/fleetengine-delivery').v1;

  // Instantiates a client
  const deliveryClient = new DeliveryServiceClient();

  async function callGetTaskTrackingInfo() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await deliveryClient.getTaskTrackingInfo(request);
    console.log(response);
  }

  callGetTaskTrackingInfo();

getTaskTrackingInfo(request, options, callback)

getTaskTrackingInfo(request: protos.maps.fleetengine.delivery.v1.IGetTaskTrackingInfoRequest, options: CallOptions, callback: Callback<protos.maps.fleetengine.delivery.v1.ITaskTrackingInfo, protos.maps.fleetengine.delivery.v1.IGetTaskTrackingInfoRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetTaskTrackingInfoRequest
options CallOptions
callback Callback<protos.maps.fleetengine.delivery.v1.ITaskTrackingInfo, protos.maps.fleetengine.delivery.v1.IGetTaskTrackingInfoRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getTaskTrackingInfo(request, callback)

getTaskTrackingInfo(request: protos.maps.fleetengine.delivery.v1.IGetTaskTrackingInfoRequest, callback: Callback<protos.maps.fleetengine.delivery.v1.ITaskTrackingInfo, protos.maps.fleetengine.delivery.v1.IGetTaskTrackingInfoRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetTaskTrackingInfoRequest
callback Callback<protos.maps.fleetengine.delivery.v1.ITaskTrackingInfo, protos.maps.fleetengine.delivery.v1.IGetTaskTrackingInfoRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
Type Description
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

listDeliveryVehicles(request, options)

listDeliveryVehicles(request?: protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesRequest, options?: CallOptions): Promise<[
        protos.maps.fleetengine.delivery.v1.IDeliveryVehicle[],
        protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesRequest | null,
        protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesResponse
    ]>;

Gets all DeliveryVehicles that meet the specified filtering criteria.

Parameters
Name Description
request IListDeliveryVehiclesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.maps.fleetengine.delivery.v1.IDeliveryVehicle[], protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesRequest | null, protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listDeliveryVehiclesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listDeliveryVehicles(request, options, callback)

listDeliveryVehicles(request: protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesRequest, options: CallOptions, callback: PaginationCallback<protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesRequest, protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesResponse | null | undefined, protos.maps.fleetengine.delivery.v1.IDeliveryVehicle>): void;
Parameters
Name Description
request IListDeliveryVehiclesRequest
options CallOptions
callback PaginationCallback<protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesRequest, protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesResponse | null | undefined, protos.maps.fleetengine.delivery.v1.IDeliveryVehicle>
Returns
Type Description
void

listDeliveryVehicles(request, callback)

listDeliveryVehicles(request: protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesRequest, callback: PaginationCallback<protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesRequest, protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesResponse | null | undefined, protos.maps.fleetengine.delivery.v1.IDeliveryVehicle>): void;
Parameters
Name Description
request IListDeliveryVehiclesRequest
callback PaginationCallback<protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesRequest, protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesResponse | null | undefined, protos.maps.fleetengine.delivery.v1.IDeliveryVehicle>
Returns
Type Description
void

listDeliveryVehiclesAsync(request, options)

listDeliveryVehiclesAsync(request?: protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesRequest, options?: CallOptions): AsyncIterable<protos.maps.fleetengine.delivery.v1.IDeliveryVehicle>;

Equivalent to listDeliveryVehicles, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
Name Description
request IListDeliveryVehiclesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.maps.fleetengine.delivery.v1.IDeliveryVehicle>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. The standard Delivery API request header.
   */
  // const header = {}
  /**
   *  Required. Must be in the format `providers/{provider}`.
   *  The `provider` must be the Google Cloud Project ID.
   *  For example, `sample-cloud-project`.
   */
  // const parent = 'abc123'
  /**
   *  Optional. The maximum number of vehicles to return. The service may return
   *  fewer than this number. If you don't specify this number, then the server
   *  determines the number of results to return.
   */
  // const pageSize = 1234
  /**
   *  Optional. A page token, received from a previous `ListDeliveryVehicles`
   *  call. You must provide this in order to retrieve the subsequent page.
   *  When paginating, all other parameters provided to `ListDeliveryVehicles`
   *  must match the call that provided the page token.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. A filter query to apply when listing delivery vehicles. See
   *  http://aip.dev/160 for examples of the filter syntax. If you don't specify
   *  a value, or if you specify an empty string for the filter, then all
   *  delivery vehicles are returned.
   *  Note that the only queries supported for `ListDeliveryVehicles` are
   *  on vehicle attributes (for example, `attributes.

listDeliveryVehiclesStream(request, options)

listDeliveryVehiclesStream(request?: protos.maps.fleetengine.delivery.v1.IListDeliveryVehiclesRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
Name Description
request IListDeliveryVehiclesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listDeliveryVehiclesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listTasks(request, options)

listTasks(request?: protos.maps.fleetengine.delivery.v1.IListTasksRequest, options?: CallOptions): Promise<[
        protos.maps.fleetengine.delivery.v1.ITask[],
        protos.maps.fleetengine.delivery.v1.IListTasksRequest | null,
        protos.maps.fleetengine.delivery.v1.IListTasksResponse
    ]>;

Gets all Tasks that meet the specified filtering criteria.

Parameters
Name Description
request IListTasksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.maps.fleetengine.delivery.v1.ITask[], protos.maps.fleetengine.delivery.v1.IListTasksRequest | null, protos.maps.fleetengine.delivery.v1.IListTasksResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using listTasksAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listTasks(request, options, callback)

listTasks(request: protos.maps.fleetengine.delivery.v1.IListTasksRequest, options: CallOptions, callback: PaginationCallback<protos.maps.fleetengine.delivery.v1.IListTasksRequest, protos.maps.fleetengine.delivery.v1.IListTasksResponse | null | undefined, protos.maps.fleetengine.delivery.v1.ITask>): void;
Parameters
Name Description
request IListTasksRequest
options CallOptions
callback PaginationCallback<protos.maps.fleetengine.delivery.v1.IListTasksRequest, protos.maps.fleetengine.delivery.v1.IListTasksResponse | null | undefined, protos.maps.fleetengine.delivery.v1.ITask>
Returns
Type Description
void

listTasks(request, callback)

listTasks(request: protos.maps.fleetengine.delivery.v1.IListTasksRequest, callback: PaginationCallback<protos.maps.fleetengine.delivery.v1.IListTasksRequest, protos.maps.fleetengine.delivery.v1.IListTasksResponse | null | undefined, protos.maps.fleetengine.delivery.v1.ITask>): void;
Parameters
Name Description
request IListTasksRequest
callback PaginationCallback<protos.maps.fleetengine.delivery.v1.IListTasksRequest, protos.maps.fleetengine.delivery.v1.IListTasksResponse | null | undefined, protos.maps.fleetengine.delivery.v1.ITask>
Returns
Type Description
void

listTasksAsync(request, options)

listTasksAsync(request?: protos.maps.fleetengine.delivery.v1.IListTasksRequest, options?: CallOptions): AsyncIterable<protos.maps.fleetengine.delivery.v1.ITask>;

Equivalent to listTasks, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
Name Description
request IListTasksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.maps.fleetengine.delivery.v1.ITask>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. The standard Delivery API request header.
   */
  // const header = {}
  /**
   *  Required. Must be in the format `providers/{provider}`.
   *  The `provider` must be the Google Cloud Project ID. For example,
   *  `sample-cloud-project`.
   */
  // const parent = 'abc123'
  /**
   *  Optional. The maximum number of Tasks to return. The service may return
   *  fewer than this value. If you don't specify this value, then the server
   *  determines the number of results to return.
   */
  // const pageSize = 1234
  /**
   *  Optional. A page token received from a previous `ListTasks` call.
   *  You can provide this to retrieve the subsequent page.
   *  When paginating, all other parameters provided to `ListTasks` must match
   *  the call that provided the page token.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. A filter query to apply when listing Tasks. See
   *  http://aip.dev/160 for examples of filter syntax. If you don't specify a
   *  value, or if you filter on an empty string, then all Tasks are returned.
   *  For information about the Task properties that you can filter on, see Task
   *  list (/maps/documentation/transportation-logistics/last-mile-fleet-solution/fleet-performance/fleet-engine/deliveries_api#list_tasks).
   */
  // const filter = 'abc123'

  // Imports the Delivery library
  const {DeliveryServiceClient} = require('@googlemaps/fleetengine-delivery').v1;

  // Instantiates a client
  const deliveryClient = new DeliveryServiceClient();

  async function callListTasks() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = deliveryClient.listTasksAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListTasks();

listTasksStream(request, options)

listTasksStream(request?: protos.maps.fleetengine.delivery.v1.IListTasksRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
Name Description
request IListTasksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using listTasksAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

matchProviderFromDeliveryVehicleName(deliveryVehicleName)

matchProviderFromDeliveryVehicleName(deliveryVehicleName: string): string | number;

Parse the provider from DeliveryVehicle resource.

Parameter
Name Description
deliveryVehicleName string

A fully-qualified path representing DeliveryVehicle resource.

Returns
Type Description
string | number

{string} A string representing the provider.

matchProviderFromProviderName(providerName)

matchProviderFromProviderName(providerName: string): string | number;

Parse the provider from Provider resource.

Parameter
Name Description
providerName string

A fully-qualified path representing Provider resource.

Returns
Type Description
string | number

{string} A string representing the provider.

matchProviderFromTaskName(taskName)

matchProviderFromTaskName(taskName: string): string | number;

Parse the provider from Task resource.

Parameter
Name Description
taskName string

A fully-qualified path representing Task resource.

Returns
Type Description
string | number

{string} A string representing the provider.

matchProviderFromTaskTrackingInfoName(taskTrackingInfoName)

matchProviderFromTaskTrackingInfoName(taskTrackingInfoName: string): string | number;

Parse the provider from TaskTrackingInfo resource.

Parameter
Name Description
taskTrackingInfoName string

A fully-qualified path representing TaskTrackingInfo resource.

Returns
Type Description
string | number

{string} A string representing the provider.

matchTaskFromTaskName(taskName)

matchTaskFromTaskName(taskName: string): string | number;

Parse the task from Task resource.

Parameter
Name Description
taskName string

A fully-qualified path representing Task resource.

Returns
Type Description
string | number

{string} A string representing the task.

matchTrackingFromTaskTrackingInfoName(taskTrackingInfoName)

matchTrackingFromTaskTrackingInfoName(taskTrackingInfoName: string): string | number;

Parse the tracking from TaskTrackingInfo resource.

Parameter
Name Description
taskTrackingInfoName string

A fully-qualified path representing TaskTrackingInfo resource.

Returns
Type Description
string | number

{string} A string representing the tracking.

matchVehicleFromDeliveryVehicleName(deliveryVehicleName)

matchVehicleFromDeliveryVehicleName(deliveryVehicleName: string): string | number;

Parse the vehicle from DeliveryVehicle resource.

Parameter
Name Description
deliveryVehicleName string

A fully-qualified path representing DeliveryVehicle resource.

Returns
Type Description
string | number

{string} A string representing the vehicle.

providerPath(provider)

providerPath(provider: string): string;

Return a fully-qualified provider resource name string.

Parameter
Name Description
provider string
Returns
Type Description
string

{string} Resource name string.

searchTasks(request, options)

searchTasks(request?: protos.maps.fleetengine.delivery.v1.ISearchTasksRequest, options?: CallOptions): Promise<[
        protos.maps.fleetengine.delivery.v1.ITask[],
        protos.maps.fleetengine.delivery.v1.ISearchTasksRequest | null,
        protos.maps.fleetengine.delivery.v1.ISearchTasksResponse
    ]>;

Deprecated: Use GetTaskTrackingInfo instead.

Parameters
Name Description
request ISearchTasksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.maps.fleetengine.delivery.v1.ITask[], protos.maps.fleetengine.delivery.v1.ISearchTasksRequest | null, protos.maps.fleetengine.delivery.v1.ISearchTasksResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using searchTasksAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

searchTasks(request, options, callback)

searchTasks(request: protos.maps.fleetengine.delivery.v1.ISearchTasksRequest, options: CallOptions, callback: PaginationCallback<protos.maps.fleetengine.delivery.v1.ISearchTasksRequest, protos.maps.fleetengine.delivery.v1.ISearchTasksResponse | null | undefined, protos.maps.fleetengine.delivery.v1.ITask>): void;
Parameters
Name Description
request ISearchTasksRequest
options CallOptions
callback PaginationCallback<protos.maps.fleetengine.delivery.v1.ISearchTasksRequest, protos.maps.fleetengine.delivery.v1.ISearchTasksResponse | null | undefined, protos.maps.fleetengine.delivery.v1.ITask>
Returns
Type Description
void

searchTasks(request, callback)

searchTasks(request: protos.maps.fleetengine.delivery.v1.ISearchTasksRequest, callback: PaginationCallback<protos.maps.fleetengine.delivery.v1.ISearchTasksRequest, protos.maps.fleetengine.delivery.v1.ISearchTasksResponse | null | undefined, protos.maps.fleetengine.delivery.v1.ITask>): void;
Parameters
Name Description
request ISearchTasksRequest
callback PaginationCallback<protos.maps.fleetengine.delivery.v1.ISearchTasksRequest, protos.maps.fleetengine.delivery.v1.ISearchTasksResponse | null | undefined, protos.maps.fleetengine.delivery.v1.ITask>
Returns
Type Description
void

searchTasksAsync(request, options)

searchTasksAsync(request?: protos.maps.fleetengine.delivery.v1.ISearchTasksRequest, options?: CallOptions): AsyncIterable<protos.maps.fleetengine.delivery.v1.ITask>;

Equivalent to searchTasks, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
Name Description
request ISearchTasksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.maps.fleetengine.delivery.v1.ITask>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. The standard Delivery API request header.
   */
  // const header = {}
  /**
   *  Required. Must be in the format `providers/{provider}`.
   *  The provider must be the Google Cloud Project ID. For example,
   *  `sample-cloud-project`.
   */
  // const parent = 'abc123'
  /**
   *  Required. The identifier of the set of related Tasks being requested.
   *  Tracking IDs are subject to the following restrictions:
   *  * Must be a valid Unicode string.
   *  * Limited to a maximum length of 64 characters.
   *  * Normalized according to Unicode Normalization Form C 
   *  (http://www.unicode.org/reports/tr15/).
   *  * May not contain any of the following ASCII characters: '/', ':', '?',
   *  ',', or '#'.
   */
  // const trackingId = 'abc123'
  /**
   *  Optional. The maximum number of Tasks to return. The service may return
   *  fewer than this value. If you don't specify this value, then the server
   *  determines the number of results to return.
   */
  // const pageSize = 1234
  /**
   *  Optional. A page token, received from a previous `SearchTasks` call. You
   *  must provide this value to retrieve the subsequent page.
   *  When paginating, all other parameters provided to `SearchTasks` must match
   *  the call that provided the page token.
   */
  // const pageToken = 'abc123'

  // Imports the Delivery library
  const {DeliveryServiceClient} = require('@googlemaps/fleetengine-delivery').v1;

  // Instantiates a client
  const deliveryClient = new DeliveryServiceClient();

  async function callSearchTasks() {
    // Construct request
    const request = {
      parent,
      trackingId,
    };

    // Run request
    const iterable = deliveryClient.searchTasksAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callSearchTasks();

searchTasksStream(request, options)

searchTasksStream(request?: protos.maps.fleetengine.delivery.v1.ISearchTasksRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
Name Description
request ISearchTasksRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using searchTasksAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

taskPath(provider, task)

taskPath(provider: string, task: string): string;

Return a fully-qualified task resource name string.

Parameters
Name Description
provider string
task string
Returns
Type Description
string

{string} Resource name string.

taskTrackingInfoPath(provider, tracking)

taskTrackingInfoPath(provider: string, tracking: string): string;

Return a fully-qualified taskTrackingInfo resource name string.

Parameters
Name Description
provider string
tracking string
Returns
Type Description
string

{string} Resource name string.

updateDeliveryVehicle(request, options)

updateDeliveryVehicle(request?: protos.maps.fleetengine.delivery.v1.IUpdateDeliveryVehicleRequest, options?: CallOptions): Promise<[
        protos.maps.fleetengine.delivery.v1.IDeliveryVehicle,
        (protos.maps.fleetengine.delivery.v1.IUpdateDeliveryVehicleRequest | undefined),
        {} | undefined
    ]>;

Writes updated DeliveryVehicle data to Fleet Engine, and assigns Tasks to the DeliveryVehicle. You cannot update the name of the DeliveryVehicle. You *can* update remaining_vehicle_journey_segments though, but it must contain all of the VehicleJourneySegments currently on the DeliveryVehicle. The task_ids are retrieved from remaining_vehicle_journey_segments, and their corresponding Tasks are assigned to the DeliveryVehicle if they have not yet been assigned.

Parameters
Name Description
request IUpdateDeliveryVehicleRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.maps.fleetengine.delivery.v1.IDeliveryVehicle, (protos.maps.fleetengine.delivery.v1.IUpdateDeliveryVehicleRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. The standard Delivery API request header.
   */
  // const header = {}
  /**
   *  Required. The `DeliveryVehicle` entity update to apply.
   *  Note: You cannot update the name of the `DeliveryVehicle`.
   */
  // const deliveryVehicle = {}
  /**
   *  Required. A field mask that indicates which `DeliveryVehicle` fields to
   *  update. Note that the update_mask must contain at least one field.
   *  This is a comma-separated list of fully qualified names of fields. Example:
   *  `"remaining_vehicle_journey_segments"`.
   */
  // const updateMask = {}

  // Imports the Delivery library
  const {DeliveryServiceClient} = require('@googlemaps/fleetengine-delivery').v1;

  // Instantiates a client
  const deliveryClient = new DeliveryServiceClient();

  async function callUpdateDeliveryVehicle() {
    // Construct request
    const request = {
      deliveryVehicle,
      updateMask,
    };

    // Run request
    const response = await deliveryClient.updateDeliveryVehicle(request);
    console.log(response);
  }

  callUpdateDeliveryVehicle();

updateDeliveryVehicle(request, options, callback)

updateDeliveryVehicle(request: protos.maps.fleetengine.delivery.v1.IUpdateDeliveryVehicleRequest, options: CallOptions, callback: Callback<protos.maps.fleetengine.delivery.v1.IDeliveryVehicle, protos.maps.fleetengine.delivery.v1.IUpdateDeliveryVehicleRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateDeliveryVehicleRequest
options CallOptions
callback Callback<protos.maps.fleetengine.delivery.v1.IDeliveryVehicle, protos.maps.fleetengine.delivery.v1.IUpdateDeliveryVehicleRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateDeliveryVehicle(request, callback)

updateDeliveryVehicle(request: protos.maps.fleetengine.delivery.v1.IUpdateDeliveryVehicleRequest, callback: Callback<protos.maps.fleetengine.delivery.v1.IDeliveryVehicle, protos.maps.fleetengine.delivery.v1.IUpdateDeliveryVehicleRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateDeliveryVehicleRequest
callback Callback<protos.maps.fleetengine.delivery.v1.IDeliveryVehicle, protos.maps.fleetengine.delivery.v1.IUpdateDeliveryVehicleRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateTask(request, options)

updateTask(request?: protos.maps.fleetengine.delivery.v1.IUpdateTaskRequest, options?: CallOptions): Promise<[
        protos.maps.fleetengine.delivery.v1.ITask,
        protos.maps.fleetengine.delivery.v1.IUpdateTaskRequest | undefined,
        {} | undefined
    ]>;

Updates Task data.

Parameters
Name Description
request IUpdateTaskRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.maps.fleetengine.delivery.v1.ITask, protos.maps.fleetengine.delivery.v1.IUpdateTaskRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. The standard Delivery API request header.
   */
  // const header = {}
  /**
   *  Required. The Task associated with the update.
   *  The following fields are maintained by Fleet Engine. Do not update
   *  them using `Task.update`.
   *    * `last_location`.
   *    * `last_location_snappable`.
   *    * `name`.
   *    * `remaining_vehicle_journey_segments`.
   *    * `task_outcome_location_source`.
   *  Note: You cannot change the value of `task_outcome` once you set it.
   *  If the Task has been assigned to a delivery vehicle, then don't set the
   *  Task state to CLOSED using `Task.update`. Instead, remove the `VehicleStop`
   *  that contains the Task from the delivery vehicle, which automatically sets
   *  the Task state to CLOSED.
   */
  // const task = {}
  /**
   *  Required. The field mask that indicates which Task fields to update.
   *  Note: The `update_mask` must contain at least one field.
   *  This is a comma-separated list of fully qualified names of fields. Example:
   *  `"task_outcome,task_outcome_time,task_outcome_location"`.
   */
  // const updateMask = {}

  // Imports the Delivery library
  const {DeliveryServiceClient} = require('@googlemaps/fleetengine-delivery').v1;

  // Instantiates a client
  const deliveryClient = new DeliveryServiceClient();

  async function callUpdateTask() {
    // Construct request
    const request = {
      task,
      updateMask,
    };

    // Run request
    const response = await deliveryClient.updateTask(request);
    console.log(response);
  }

  callUpdateTask();

updateTask(request, options, callback)

updateTask(request: protos.maps.fleetengine.delivery.v1.IUpdateTaskRequest, options: CallOptions, callback: Callback<protos.maps.fleetengine.delivery.v1.ITask, protos.maps.fleetengine.delivery.v1.IUpdateTaskRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateTaskRequest
options CallOptions
callback Callback<protos.maps.fleetengine.delivery.v1.ITask, protos.maps.fleetengine.delivery.v1.IUpdateTaskRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateTask(request, callback)

updateTask(request: protos.maps.fleetengine.delivery.v1.IUpdateTaskRequest, callback: Callback<protos.maps.fleetengine.delivery.v1.ITask, protos.maps.fleetengine.delivery.v1.IUpdateTaskRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateTaskRequest
callback Callback<protos.maps.fleetengine.delivery.v1.ITask, protos.maps.fleetengine.delivery.v1.IUpdateTaskRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void