# Google Maps FleetEngine Delivery V1 Client - Class DeliveryServiceClient (0.5.3)

0.5.3 (latest) 0.5.2 0.4.1 0.3.1 0.2.0 0.1.8 Reference documentation and code samples for the Google Maps FleetEngine Delivery V1 Client class DeliveryServiceClient.

Service Description: The Last Mile Delivery service.

This class provides the ability to make remote calls to the backing service through method
calls that map to API methods.

Many parameters require resource names to be formatted in a particular way. To
assist with these names, this class includes a format method for each type of
name, and additionally a parseName method to extract the individual identifiers
contained within formatted names that are returned by the API.

## Namespace

Google \\ Maps \\ FleetEngine \\ Delivery \\ V1 \\ Client

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `options` | `array|https://docs.cloud.google.com/php/docs/reference/gax/latest/Options.ClientOptions.html` Optional. Options for configuring the service API wrapper. |
| `↳ apiEndpoint` | `string` The address of the API remote host. May optionally include the port, formatted as " |
| `↳ credentials` | `https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html|https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html` This option should only be used with a pre-constructed [Google\\Auth\\FetchAuthTokenInterface](https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html) or [Google\\ApiCore\\CredentialsWrapper](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html) object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. **Important** : If you are providing a path to a credentials file, or a decoded credentials file as a PHP array, this usage is now DEPRECATED. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. It is recommended to create the credentials explicitly `use Google\Auth\Credentials\ServiceAccountCredentials; use Google\Maps\FleetEngine\Delivery\V1\DeliveryServiceClient; $creds = new ServiceAccountCredentials($scopes, $json); $options = new DeliveryServiceClient(['credentials' => $creds]);` <https://cloud.google.com/docs/authentication/external/externally-sourced-credentials> |
| `↳ credentialsConfig` | `array` Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see [Google\\ApiCore\\CredentialsWrapper::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html#_Google_ApiCore_CredentialsWrapper__build__) . |
| `↳ disableRetries` | `bool` Determines whether or not retries defined by the client configuration should be disabled. Defaults to `false`. |
| `↳ clientConfig` | `string|array` Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder. |
| `↳ transport` | `string|https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html` The transport used for executing network requests. May be either the string `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. *Advanced usage* : Additionally, it is possible to pass in an already instantiated [Google\\ApiCore\\Transport\\TransportInterface](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html) object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored. |
| `↳ transportConfig` | `array` Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = \[ 'grpc' =\> \[...\], 'rest' =\> \[...\], \]; See the [Google\\ApiCore\\Transport\\GrpcTransport::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.GrpcTransport.html#_Google_ApiCore_Transport_GrpcTransport__build__) and [Google\\ApiCore\\Transport\\RestTransport::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.RestTransport.html#_Google_ApiCore_Transport_RestTransport__build__) methods for the supported options. |
| `↳ clientCertSource` | `callable` A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS. |
| `↳ logger` | `false|Psr\Log\LoggerInterface` A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag |
| `↳ universeDomain` | `string` The service domain for the client. Defaults to 'googleapis.com'. |

### batchCreateTasks

Creates and returns a batch of new `Task` objects.

The async variant is [DeliveryServiceClient::batchCreateTasksAsync()](https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Client.DeliveryServiceClient#_Google_Maps_FleetEngine_Delivery_V1_Client_DeliveryServiceClient__batchCreateTasksAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.BatchCreateTasksRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.BatchCreateTasksResponse` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Maps\FleetEngine\Delivery\V1\BatchCreateTasksRequest;
    use Google\Maps\FleetEngine\Delivery\V1\BatchCreateTasksResponse;
    use Google\Maps\FleetEngine\Delivery\V1\Client\DeliveryServiceClient;
    use Google\Maps\FleetEngine\Delivery\V1\CreateTaskRequest;
    use Google\Maps\FleetEngine\Delivery\V1\Task;
    use Google\Maps\FleetEngine\Delivery\V1\Task\State;
    use Google\Maps\FleetEngine\Delivery\V1\Task\Type;
    use Google\Protobuf\Duration;

    /**
     * @param string $formattedParent   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. Please see
     *                                  {@see DeliveryServiceClient::providerName()} for help formatting this field.
     * @param string $requestsParent    Must be in the format `providers/{provider}`. The `provider` must
     *                                  be the Google Cloud Project ID. For example, `sample-cloud-project`.
     * @param string $requestsTaskId    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 '#'.
     * @param int    $requestsTaskType  Immutable. Defines the type of the Task. For example, a break or
     *                                  shipment.
     * @param int    $requestsTaskState The current execution state of the Task.
     */
    function batch_create_tasks_sample(
        string $formattedParent,
        string $requestsParent,
        string $requestsTaskId,
        int $requestsTaskType,
        int $requestsTaskState
    ): void {
        // Create a client.
        $deliveryServiceClient = new DeliveryServiceClient();

        // Prepare the request message.
        $requestsTaskTaskDuration = new Duration();
        $requestsTask = (new Task())
            ->setType($requestsTaskType)
            ->setState($requestsTaskState)
            ->setTaskDuration($requestsTaskTaskDuration);
        $createTaskRequest = (new CreateTaskRequest())
            ->setParent($requestsParent)
            ->setTaskId($requestsTaskId)
            ->setTask($requestsTask);
        $requests = [$createTaskRequest,];
        $request = (new BatchCreateTasksRequest())
            ->setParent($formattedParent)
            ->setRequests($requests);

        // Call the API and handle any network failures.
        try {
            /** @var BatchCreateTasksResponse $response */
            $response = $deliveryServiceClient->batchCreateTasks($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = DeliveryServiceClient::providerName('[PROVIDER]');
        $requestsParent = '[PARENT]';
        $requestsTaskId = '[TASK_ID]';
        $requestsTaskType = Type::TYPE_UNSPECIFIED;
        $requestsTaskState = State::STATE_UNSPECIFIED;

        batch_create_tasks_sample(
            $formattedParent,
            $requestsParent,
            $requestsTaskId,
            $requestsTaskType,
            $requestsTaskState
        );
    }

### createDeliveryVehicle

Creates and returns a new `DeliveryVehicle`.

The async variant is [DeliveryServiceClient::createDeliveryVehicleAsync()](https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Client.DeliveryServiceClient#_Google_Maps_FleetEngine_Delivery_V1_Client_DeliveryServiceClient__createDeliveryVehicleAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.CreateDeliveryVehicleRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.DeliveryVehicle` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Maps\FleetEngine\Delivery\V1\Client\DeliveryServiceClient;
    use Google\Maps\FleetEngine\Delivery\V1\CreateDeliveryVehicleRequest;
    use Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle;

    /**
     * @param string $parent            Must be in the format `providers/{provider}`. The provider must
     *                                  be the Google Cloud Project ID. For example, `sample-cloud-project`.
     * @param string $deliveryVehicleId 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 '#'.
     */
    function create_delivery_vehicle_sample(string $parent, string $deliveryVehicleId): void
    {
        // Create a client.
        $deliveryServiceClient = new DeliveryServiceClient();

        // Prepare the request message.
        $deliveryVehicle = new DeliveryVehicle();
        $request = (new CreateDeliveryVehicleRequest())
            ->setParent($parent)
            ->setDeliveryVehicleId($deliveryVehicleId)
            ->setDeliveryVehicle($deliveryVehicle);

        // Call the API and handle any network failures.
        try {
            /** @var DeliveryVehicle $response */
            $response = $deliveryServiceClient->createDeliveryVehicle($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $parent = '[PARENT]';
        $deliveryVehicleId = '[DELIVERY_VEHICLE_ID]';

        create_delivery_vehicle_sample($parent, $deliveryVehicleId);
    }

### createTask

Creates and returns a new `Task` object.

The async variant is [DeliveryServiceClient::createTaskAsync()](https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Client.DeliveryServiceClient#_Google_Maps_FleetEngine_Delivery_V1_Client_DeliveryServiceClient__createTaskAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.CreateTaskRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Task` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Maps\FleetEngine\Delivery\V1\Client\DeliveryServiceClient;
    use Google\Maps\FleetEngine\Delivery\V1\CreateTaskRequest;
    use Google\Maps\FleetEngine\Delivery\V1\Task;
    use Google\Maps\FleetEngine\Delivery\V1\Task\State;
    use Google\Maps\FleetEngine\Delivery\V1\Task\Type;
    use Google\Protobuf\Duration;

    /**
     * @param string $parent    Must be in the format `providers/{provider}`. The `provider` must
     *                          be the Google Cloud Project ID. For example, `sample-cloud-project`.
     * @param string $taskId    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 '#'.
     * @param int    $taskType  Immutable. Defines the type of the Task. For example, a break or
     *                          shipment.
     * @param int    $taskState The current execution state of the Task.
     */
    function create_task_sample(string $parent, string $taskId, int $taskType, int $taskState): void
    {
        // Create a client.
        $deliveryServiceClient = new DeliveryServiceClient();

        // Prepare the request message.
        $taskTaskDuration = new Duration();
        $task = (new Task())
            ->setType($taskType)
            ->setState($taskState)
            ->setTaskDuration($taskTaskDuration);
        $request = (new CreateTaskRequest())
            ->setParent($parent)
            ->setTaskId($taskId)
            ->setTask($task);

        // Call the API and handle any network failures.
        try {
            /** @var Task $response */
            $response = $deliveryServiceClient->createTask($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $parent = '[PARENT]';
        $taskId = '[TASK_ID]';
        $taskType = Type::TYPE_UNSPECIFIED;
        $taskState = State::STATE_UNSPECIFIED;

        create_task_sample($parent, $taskId, $taskType, $taskState);
    }

### deleteDeliveryVehicle

Deletes a DeliveryVehicle from the Fleet Engine.

Returns FAILED_PRECONDITION if the DeliveryVehicle has OPEN Tasks
assigned to it.

The async variant is [DeliveryServiceClient::deleteDeliveryVehicleAsync()](https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Client.DeliveryServiceClient#_Google_Maps_FleetEngine_Delivery_V1_Client_DeliveryServiceClient__deleteDeliveryVehicleAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.DeleteDeliveryVehicleRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Maps\FleetEngine\Delivery\V1\Client\DeliveryServiceClient;
    use Google\Maps\FleetEngine\Delivery\V1\DeleteDeliveryVehicleRequest;

    /**
     * @param string $formattedName Must be in the format
     *                              `providers/{provider}/deliveryVehicles/{delivery_vehicle}`.
     *                              The `provider` must be the Google Cloud Project ID. For example,
     *                              `sample-cloud-project`. Please see
     *                              {@see DeliveryServiceClient::deliveryVehicleName()} for help formatting this field.
     */
    function delete_delivery_vehicle_sample(string $formattedName): void
    {
        // Create a client.
        $deliveryServiceClient = new DeliveryServiceClient();

        // Prepare the request message.
        $request = (new DeleteDeliveryVehicleRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            $deliveryServiceClient->deleteDeliveryVehicle($request);
            printf('Call completed successfully.' . PHP_EOL);
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = DeliveryServiceClient::deliveryVehicleName('[PROVIDER]', '[VEHICLE]');

        delete_delivery_vehicle_sample($formattedName);
    }

### deleteTask

Deletes a single Task.

Returns FAILED_PRECONDITION if the Task is OPEN and assigned to a
DeliveryVehicle.

The async variant is [DeliveryServiceClient::deleteTaskAsync()](https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Client.DeliveryServiceClient#_Google_Maps_FleetEngine_Delivery_V1_Client_DeliveryServiceClient__deleteTaskAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.DeleteTaskRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Maps\FleetEngine\Delivery\V1\Client\DeliveryServiceClient;
    use Google\Maps\FleetEngine\Delivery\V1\DeleteTaskRequest;

    /**
     * @param string $formattedName Must be in the format `providers/{provider}/tasks/{task}`. The
     *                              `provider` must be the Google Cloud Project ID. For example,
     *                              `sample-cloud-project`. Please see
     *                              {@see DeliveryServiceClient::taskName()} for help formatting this field.
     */
    function delete_task_sample(string $formattedName): void
    {
        // Create a client.
        $deliveryServiceClient = new DeliveryServiceClient();

        // Prepare the request message.
        $request = (new DeleteTaskRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            $deliveryServiceClient->deleteTask($request);
            printf('Call completed successfully.' . PHP_EOL);
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = DeliveryServiceClient::taskName('[PROVIDER]', '[TASK]');

        delete_task_sample($formattedName);
    }

### getDeliveryVehicle

Returns the specified `DeliveryVehicle` instance.

The async variant is [DeliveryServiceClient::getDeliveryVehicleAsync()](https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Client.DeliveryServiceClient#_Google_Maps_FleetEngine_Delivery_V1_Client_DeliveryServiceClient__getDeliveryVehicleAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.GetDeliveryVehicleRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.DeliveryVehicle` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Maps\FleetEngine\Delivery\V1\Client\DeliveryServiceClient;
    use Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle;
    use Google\Maps\FleetEngine\Delivery\V1\GetDeliveryVehicleRequest;

    /**
     * @param string $formattedName Must be in the format
     *                              `providers/{provider}/deliveryVehicles/{delivery_vehicle}`.
     *                              The `provider` must be the Google Cloud Project ID. For example,
     *                              `sample-cloud-project`. Please see
     *                              {@see DeliveryServiceClient::deliveryVehicleName()} for help formatting this field.
     */
    function get_delivery_vehicle_sample(string $formattedName): void
    {
        // Create a client.
        $deliveryServiceClient = new DeliveryServiceClient();

        // Prepare the request message.
        $request = (new GetDeliveryVehicleRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            /** @var DeliveryVehicle $response */
            $response = $deliveryServiceClient->getDeliveryVehicle($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = DeliveryServiceClient::deliveryVehicleName('[PROVIDER]', '[VEHICLE]');

        get_delivery_vehicle_sample($formattedName);
    }

### getTask

Gets information about a `Task`.

The async variant is [DeliveryServiceClient::getTaskAsync()](https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Client.DeliveryServiceClient#_Google_Maps_FleetEngine_Delivery_V1_Client_DeliveryServiceClient__getTaskAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.GetTaskRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Task` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Maps\FleetEngine\Delivery\V1\Client\DeliveryServiceClient;
    use Google\Maps\FleetEngine\Delivery\V1\GetTaskRequest;
    use Google\Maps\FleetEngine\Delivery\V1\Task;

    /**
     * @param string $formattedName Must be in the format `providers/{provider}/tasks/{task}`. The
     *                              `provider` must be the Google Cloud Project ID. For example,
     *                              `sample-cloud-project`. Please see
     *                              {@see DeliveryServiceClient::taskName()} for help formatting this field.
     */
    function get_task_sample(string $formattedName): void
    {
        // Create a client.
        $deliveryServiceClient = new DeliveryServiceClient();

        // Prepare the request message.
        $request = (new GetTaskRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            /** @var Task $response */
            $response = $deliveryServiceClient->getTask($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = DeliveryServiceClient::taskName('[PROVIDER]', '[TASK]');

        get_task_sample($formattedName);
    }

### getTaskTrackingInfo

Returns the specified `TaskTrackingInfo` instance.

The async variant is [DeliveryServiceClient::getTaskTrackingInfoAsync()](https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Client.DeliveryServiceClient#_Google_Maps_FleetEngine_Delivery_V1_Client_DeliveryServiceClient__getTaskTrackingInfoAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.GetTaskTrackingInfoRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.TaskTrackingInfo` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Maps\FleetEngine\Delivery\V1\Client\DeliveryServiceClient;
    use Google\Maps\FleetEngine\Delivery\V1\GetTaskTrackingInfoRequest;
    use Google\Maps\FleetEngine\Delivery\V1\TaskTrackingInfo;

    /**
     * @param string $formattedName 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`. Please see
     *                              {@see DeliveryServiceClient::taskTrackingInfoName()} for help formatting this field.
     */
    function get_task_tracking_info_sample(string $formattedName): void
    {
        // Create a client.
        $deliveryServiceClient = new DeliveryServiceClient();

        // Prepare the request message.
        $request = (new GetTaskTrackingInfoRequest())
            ->setName($formattedName);

        // Call the API and handle any network failures.
        try {
            /** @var TaskTrackingInfo $response */
            $response = $deliveryServiceClient->getTaskTrackingInfo($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedName = DeliveryServiceClient::taskTrackingInfoName('[PROVIDER]', '[TRACKING]');

        get_task_tracking_info_sample($formattedName);
    }

### listDeliveryVehicles

Gets all `DeliveryVehicle`s that meet the specified filtering criteria.

The async variant is [DeliveryServiceClient::listDeliveryVehiclesAsync()](https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Client.DeliveryServiceClient#_Google_Maps_FleetEngine_Delivery_V1_Client_DeliveryServiceClient__listDeliveryVehiclesAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.ListDeliveryVehiclesRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Maps\FleetEngine\Delivery\V1\Client\DeliveryServiceClient;
    use Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle;
    use Google\Maps\FleetEngine\Delivery\V1\ListDeliveryVehiclesRequest;

    /**
     * @param string $formattedParent Must be in the format `providers/{provider}`.
     *                                The `provider` must be the Google Cloud Project ID.
     *                                For example, `sample-cloud-project`. Please see
     *                                {@see DeliveryServiceClient::providerName()} for help formatting this field.
     */
    function list_delivery_vehicles_sample(string $formattedParent): void
    {
        // Create a client.
        $deliveryServiceClient = new DeliveryServiceClient();

        // Prepare the request message.
        $request = (new ListDeliveryVehiclesRequest())
            ->setParent($formattedParent);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $deliveryServiceClient->listDeliveryVehicles($request);

            /** @var DeliveryVehicle $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = DeliveryServiceClient::providerName('[PROVIDER]');

        list_delivery_vehicles_sample($formattedParent);
    }

### listTasks

Gets all `Task`s that meet the specified filtering criteria.

The async variant is [DeliveryServiceClient::listTasksAsync()](https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Client.DeliveryServiceClient#_Google_Maps_FleetEngine_Delivery_V1_Client_DeliveryServiceClient__listTasksAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.ListTasksRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Maps\FleetEngine\Delivery\V1\Client\DeliveryServiceClient;
    use Google\Maps\FleetEngine\Delivery\V1\ListTasksRequest;
    use Google\Maps\FleetEngine\Delivery\V1\Task;

    /**
     * @param string $formattedParent Must be in the format `providers/{provider}`.
     *                                The `provider` must be the Google Cloud Project ID. For example,
     *                                `sample-cloud-project`. Please see
     *                                {@see DeliveryServiceClient::providerName()} for help formatting this field.
     */
    function list_tasks_sample(string $formattedParent): void
    {
        // Create a client.
        $deliveryServiceClient = new DeliveryServiceClient();

        // Prepare the request message.
        $request = (new ListTasksRequest())
            ->setParent($formattedParent);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $deliveryServiceClient->listTasks($request);

            /** @var Task $element */
            foreach ($response as $element) {
                printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
            }
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $formattedParent = DeliveryServiceClient::providerName('[PROVIDER]');

        list_tasks_sample($formattedParent);
    }

### updateDeliveryVehicle

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`,
but it must contain all of the `VehicleJourneySegment`s to be persisted on
the `DeliveryVehicle`. The `task_id`s are retrieved from
`remaining_vehicle_journey_segments`, and their corresponding `Tasks` are
assigned to the `DeliveryVehicle` if they have not yet been assigned.

The async variant is [DeliveryServiceClient::updateDeliveryVehicleAsync()](https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Client.DeliveryServiceClient#_Google_Maps_FleetEngine_Delivery_V1_Client_DeliveryServiceClient__updateDeliveryVehicleAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.UpdateDeliveryVehicleRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.DeliveryVehicle` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Maps\FleetEngine\Delivery\V1\Client\DeliveryServiceClient;
    use Google\Maps\FleetEngine\Delivery\V1\DeliveryVehicle;
    use Google\Maps\FleetEngine\Delivery\V1\UpdateDeliveryVehicleRequest;
    use Google\Protobuf\FieldMask;

    /**
     * This sample 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.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function update_delivery_vehicle_sample(): void
    {
        // Create a client.
        $deliveryServiceClient = new DeliveryServiceClient();

        // Prepare the request message.
        $deliveryVehicle = new DeliveryVehicle();
        $updateMask = new FieldMask();
        $request = (new UpdateDeliveryVehicleRequest())
            ->setDeliveryVehicle($deliveryVehicle)
            ->setUpdateMask($updateMask);

        // Call the API and handle any network failures.
        try {
            /** @var DeliveryVehicle $response */
            $response = $deliveryServiceClient->updateDeliveryVehicle($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

### updateTask

Updates `Task` data.

The async variant is [DeliveryServiceClient::updateTaskAsync()](https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Client.DeliveryServiceClient#_Google_Maps_FleetEngine_Delivery_V1_Client_DeliveryServiceClient__updateTaskAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.UpdateTaskRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Task` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Maps\FleetEngine\Delivery\V1\Client\DeliveryServiceClient;
    use Google\Maps\FleetEngine\Delivery\V1\Task;
    use Google\Maps\FleetEngine\Delivery\V1\Task\State;
    use Google\Maps\FleetEngine\Delivery\V1\Task\Type;
    use Google\Maps\FleetEngine\Delivery\V1\UpdateTaskRequest;
    use Google\Protobuf\Duration;
    use Google\Protobuf\FieldMask;

    /**
     * @param int $taskType  Immutable. Defines the type of the Task. For example, a break or
     *                       shipment.
     * @param int $taskState The current execution state of the Task.
     */
    function update_task_sample(int $taskType, int $taskState): void
    {
        // Create a client.
        $deliveryServiceClient = new DeliveryServiceClient();

        // Prepare the request message.
        $taskTaskDuration = new Duration();
        $task = (new Task())
            ->setType($taskType)
            ->setState($taskState)
            ->setTaskDuration($taskTaskDuration);
        $updateMask = new FieldMask();
        $request = (new UpdateTaskRequest())
            ->setTask($task)
            ->setUpdateMask($updateMask);

        // Call the API and handle any network failures.
        try {
            /** @var Task $response */
            $response = $deliveryServiceClient->updateTask($request);
            printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
        } catch (ApiException $ex) {
            printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
        }
    }

    /**
     * Helper to execute the sample.
     *
     * This sample 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.
     *  - It may require specifying regional endpoints when creating the service client,
     *    please see the apiEndpoint client configuration option for more details.
     */
    function callSample(): void
    {
        $taskType = Type::TYPE_UNSPECIFIED;
        $taskState = State::STATE_UNSPECIFIED;

        update_task_sample($taskType, $taskState);
    }

### batchCreateTasksAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.BatchCreateTasksRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.BatchCreateTasksResponse>` |   |

### createDeliveryVehicleAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.CreateDeliveryVehicleRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.DeliveryVehicle>` |   |

### createTaskAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.CreateTaskRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Task>` |   |

### deleteDeliveryVehicleAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.DeleteDeliveryVehicleRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<void>` |   |

### deleteTaskAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.DeleteTaskRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<void>` |   |

### getDeliveryVehicleAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.GetDeliveryVehicleRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.DeliveryVehicle>` |   |

### getTaskAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.GetTaskRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Task>` |   |

### getTaskTrackingInfoAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.GetTaskTrackingInfoRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.TaskTrackingInfo>` |   |

### listDeliveryVehiclesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.ListDeliveryVehiclesRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listTasksAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.ListTasksRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### updateDeliveryVehicleAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.UpdateDeliveryVehicleRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.DeliveryVehicle>` |   |

### updateTaskAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.UpdateTaskRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/maps-fleetengine-delivery/latest/V1.Task>` |   |

### static::deliveryVehicleName

Formats a string containing the fully-qualified path to represent a
delivery_vehicle resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `provider` | `string` |
| `vehicle` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted delivery_vehicle resource. |

### static::providerName

Formats a string containing the fully-qualified path to represent a provider
resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `provider` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted provider resource. |

### static::taskName

Formats a string containing the fully-qualified path to represent a task
resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `provider` | `string` |
| `task` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted task resource. |

### static::taskTrackingInfoName

Formats a string containing the fully-qualified path to represent a
task_tracking_info resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `provider` | `string` |
| `tracking` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted task_tracking_info resource. |

### static::parseName

Parses a formatted name string and returns an associative array of the components in the name.

The following name formats are supported:
Template: Pattern

- deliveryVehicle: providers/{provider}/deliveryVehicles/{vehicle}
- provider: providers/{provider}
- task: providers/{provider}/tasks/{task}
- taskTrackingInfo: providers/{provider}/taskTrackingInfo/{tracking}

The optional $template argument can be supplied to specify a particular pattern,
and must match one of the templates listed above. If no $template argument is
provided, or if the $template argument does not match one of the templates
listed, then parseName will check each of the supported templates, and return
the first match.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `formattedName` | `string` The formatted name string |
| `template` | `?string` Optional name of template to match |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `array` | An associative array from name component IDs to component values. |