diff --git a/generation_config.yaml b/generation_config.yaml
index 643965133ad3..7c7e0b1e3e34 100644
--- a/generation_config.yaml
+++ b/generation_config.yaml
@@ -1293,6 +1293,25 @@ libraries:
GAPICs:
- proto_path: google/maps/fleetengine/v1
requires_billing: true
+- api_shortname: maps-fleetengine-delivery
+ name_pretty: Last Mile Fleet Solution Delivery API
+ product_documentation:
+ https://developers.google.com/maps/documentation/transportation-logistics/mobility
+ api_description: Enables Fleet Engine for access to the On Demand Rides and Deliveries
+ and Last Mile Fleet Solution APIs. Customer's use of Google Maps Content in the
+ Cloud Logging Services is subject to the Google Maps Platform Terms of Service
+ located at https://cloud.google.com/maps-platform/terms.
+ client_documentation:
+ https://cloud.google.com/java/docs/reference/google-maps-fleetengine-delivery/latest/overview
+ release_level: preview
+ distribution_name: com.google.maps:google-maps-fleetengine-delivery
+ api_id: maps-fleetengine-delivery.googleapis.com
+ library_type: GAPIC_AUTO
+ group_id: com.google.maps
+ cloud_api: false
+ GAPICs:
+ - proto_path: google/maps/fleetengine/delivery/v1
+ requires_billing: true
- api_shortname: maps-mapsplatformdatasets
name_pretty: Maps Platform Datasets API
product_documentation: https://developers.google.com/maps/documentation
diff --git a/java-maps-fleetengine-delivery/.OwlBot-hermetic.yaml b/java-maps-fleetengine-delivery/.OwlBot-hermetic.yaml
new file mode 100644
index 000000000000..309a1cfd5d27
--- /dev/null
+++ b/java-maps-fleetengine-delivery/.OwlBot-hermetic.yaml
@@ -0,0 +1,35 @@
+# Copyright 2024 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+deep-remove-regex:
+- "/java-maps-fleetengine-delivery/grpc-google-.*/src"
+- "/java-maps-fleetengine-delivery/proto-google-.*/src"
+- "/java-maps-fleetengine-delivery/google-.*/src"
+- "/java-maps-fleetengine-delivery/samples/snippets/generated"
+
+deep-preserve-regex:
+- "/java-maps-fleetengine-delivery/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
+
+deep-copy-regex:
+- source: "/google/maps/fleetengine/delivery/(v.*)/.*-java/proto-google-.*/src"
+ dest: "/owl-bot-staging/java-maps-fleetengine-delivery/$1/proto-google-maps-fleetengine-delivery-$1/src"
+- source: "/google/maps/fleetengine/delivery/(v.*)/.*-java/grpc-google-.*/src"
+ dest: "/owl-bot-staging/java-maps-fleetengine-delivery/$1/grpc-google-maps-fleetengine-delivery-$1/src"
+- source: "/google/maps/fleetengine/delivery/(v.*)/.*-java/gapic-google-.*/src"
+ dest: "/owl-bot-staging/java-maps-fleetengine-delivery/$1/google-maps-fleetengine-delivery/src"
+- source: "/google/maps/fleetengine/delivery/(v.*)/.*-java/samples/snippets/generated"
+ dest: "/owl-bot-staging/java-maps-fleetengine-delivery/$1/samples/snippets/generated"
+
+api-name: maps-fleetengine-delivery
\ No newline at end of file
diff --git a/java-maps-fleetengine-delivery/.repo-metadata.json b/java-maps-fleetengine-delivery/.repo-metadata.json
new file mode 100644
index 000000000000..958756142d93
--- /dev/null
+++ b/java-maps-fleetengine-delivery/.repo-metadata.json
@@ -0,0 +1,16 @@
+{
+ "api_shortname": "maps-fleetengine-delivery",
+ "name_pretty": "Last Mile Fleet Solution Delivery API",
+ "product_documentation": "https://developers.google.com/maps/documentation/transportation-logistics/mobility",
+ "api_description": "Enables Fleet Engine for access to the On Demand Rides and Deliveries and Last Mile Fleet Solution APIs. Customer's use of Google Maps Content in the Cloud Logging Services is subject to the Google Maps Platform Terms of Service located at https://cloud.google.com/maps-platform/terms.",
+ "client_documentation": "https://cloud.google.com/java/docs/reference/google-maps-fleetengine-delivery/latest/overview",
+ "release_level": "preview",
+ "transport": "both",
+ "language": "java",
+ "repo": "googleapis/google-cloud-java",
+ "repo_short": "java-maps-fleetengine-delivery",
+ "distribution_name": "com.google.maps:google-maps-fleetengine-delivery",
+ "api_id": "maps-fleetengine-delivery.googleapis.com",
+ "library_type": "GAPIC_AUTO",
+ "requires_billing": true
+}
\ No newline at end of file
diff --git a/java-maps-fleetengine-delivery/README.md b/java-maps-fleetengine-delivery/README.md
new file mode 100644
index 000000000000..b959e36add39
--- /dev/null
+++ b/java-maps-fleetengine-delivery/README.md
@@ -0,0 +1,224 @@
+# Google Last Mile Fleet Solution Delivery API Client for Java
+
+Java idiomatic client for [Last Mile Fleet Solution Delivery API][product-docs].
+
+[![Maven][maven-version-image]][maven-version-link]
+![Stability][stability-image]
+
+- [Product Documentation][product-docs]
+- [Client Library Documentation][javadocs]
+
+> Note: This client is a work-in-progress, and may occasionally
+> make backwards-incompatible changes.
+
+
+## Quickstart
+
+
+If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
+
+```xml
+
This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * String parent = "parent-995424086"; + * DeliveryVehicle deliveryVehicle = DeliveryVehicle.newBuilder().build(); + * String deliveryVehicleId = "deliveryVehicleId-861424685"; + * DeliveryVehicle response = + * deliveryServiceClient.createDeliveryVehicle(parent, deliveryVehicle, deliveryVehicleId); + * } + * }+ * + *
Note: close() needs to be called on the DeliveryServiceClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *
Method | + *Description | + *Method Variants | + *
---|---|---|
CreateDeliveryVehicle |
+ * Creates and returns a new `DeliveryVehicle`. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetDeliveryVehicle |
+ * Returns the specified `DeliveryVehicle` instance. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
BatchCreateTasks |
+ * Creates and returns a batch of new `Task` objects. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateTask |
+ * Creates and returns a new `Task` object. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetTask |
+ * Gets information about a `Task`. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateTask |
+ * Updates `Task` data. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListTasks |
+ * Gets all `Task`s that meet the specified filtering criteria. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetTaskTrackingInfo |
+ * Returns the specified `TaskTrackingInfo` instance. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListDeliveryVehicles |
+ * Gets all `DeliveryVehicle`s that meet the specified filtering criteria. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
See the individual methods for example code. + * + *
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 parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of DeliveryServiceSettings to + * create(). For example: + * + *
To customize credentials: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * DeliveryServiceSettings deliveryServiceSettings = + * DeliveryServiceSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * DeliveryServiceClient deliveryServiceClient = + * DeliveryServiceClient.create(deliveryServiceSettings); + * }+ * + *
To customize the endpoint: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * DeliveryServiceSettings deliveryServiceSettings = + * DeliveryServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + * DeliveryServiceClient deliveryServiceClient = + * DeliveryServiceClient.create(deliveryServiceSettings); + * }+ * + *
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * DeliveryServiceSettings deliveryServiceSettings = + * DeliveryServiceSettings.newHttpJsonBuilder().build(); + * DeliveryServiceClient deliveryServiceClient = + * DeliveryServiceClient.create(deliveryServiceSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class DeliveryServiceClient implements BackgroundResource { + private final DeliveryServiceSettings settings; + private final DeliveryServiceStub stub; + + /** Constructs an instance of DeliveryServiceClient with default settings. */ + public static final DeliveryServiceClient create() throws IOException { + return create(DeliveryServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of DeliveryServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final DeliveryServiceClient create(DeliveryServiceSettings settings) + throws IOException { + return new DeliveryServiceClient(settings); + } + + /** + * Constructs an instance of DeliveryServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(DeliveryServiceSettings). + */ + public static final DeliveryServiceClient create(DeliveryServiceStub stub) { + return new DeliveryServiceClient(stub); + } + + /** + * Constructs an instance of DeliveryServiceClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected DeliveryServiceClient(DeliveryServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((DeliveryServiceStubSettings) settings.getStubSettings()).createStub(); + } + + protected DeliveryServiceClient(DeliveryServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final DeliveryServiceSettings getSettings() { + return settings; + } + + public DeliveryServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates and returns a new `DeliveryVehicle`. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * String parent = "parent-995424086"; + * DeliveryVehicle deliveryVehicle = DeliveryVehicle.newBuilder().build(); + * String deliveryVehicleId = "deliveryVehicleId-861424685"; + * DeliveryVehicle response = + * deliveryServiceClient.createDeliveryVehicle(parent, deliveryVehicle, deliveryVehicleId); + * } + * }+ * + * @param parent Required. Must be in the format `providers/{provider}`. The provider must be the + * Google Cloud Project ID. For example, `sample-cloud-project`. + * @param deliveryVehicle Required. The `DeliveryVehicle` entity to create. When creating a new + * delivery vehicle, you may set the following optional fields: + *
Note: The DeliveryVehicle's `name` field is ignored. All other DeliveryVehicle fields + * must not be set; otherwise, an error is returned. + * @param deliveryVehicleId Required. The Delivery Vehicle ID must be unique and subject to the + * following restrictions: + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * CreateDeliveryVehicleRequest request = + * CreateDeliveryVehicleRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setParent("parent-995424086") + * .setDeliveryVehicleId("deliveryVehicleId-861424685") + * .setDeliveryVehicle(DeliveryVehicle.newBuilder().build()) + * .build(); + * DeliveryVehicle response = deliveryServiceClient.createDeliveryVehicle(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DeliveryVehicle createDeliveryVehicle(CreateDeliveryVehicleRequest request) { + return createDeliveryVehicleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates and returns a new `DeliveryVehicle`. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * CreateDeliveryVehicleRequest request = + * CreateDeliveryVehicleRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setParent("parent-995424086") + * .setDeliveryVehicleId("deliveryVehicleId-861424685") + * .setDeliveryVehicle(DeliveryVehicle.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * deliveryServiceClient.createDeliveryVehicleCallable().futureCall(request); + * // Do something. + * DeliveryVehicle response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * DeliveryVehicleName name = DeliveryVehicleName.of("[PROVIDER]", "[VEHICLE]"); + * DeliveryVehicle response = deliveryServiceClient.getDeliveryVehicle(name); + * } + * }+ * + * @param name 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`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DeliveryVehicle getDeliveryVehicle(DeliveryVehicleName name) { + GetDeliveryVehicleRequest request = + GetDeliveryVehicleRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getDeliveryVehicle(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the specified `DeliveryVehicle` instance. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * String name = DeliveryVehicleName.of("[PROVIDER]", "[VEHICLE]").toString(); + * DeliveryVehicle response = deliveryServiceClient.getDeliveryVehicle(name); + * } + * }+ * + * @param name 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`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DeliveryVehicle getDeliveryVehicle(String name) { + GetDeliveryVehicleRequest request = + GetDeliveryVehicleRequest.newBuilder().setName(name).build(); + return getDeliveryVehicle(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the specified `DeliveryVehicle` instance. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * GetDeliveryVehicleRequest request = + * GetDeliveryVehicleRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setName(DeliveryVehicleName.of("[PROVIDER]", "[VEHICLE]").toString()) + * .build(); + * DeliveryVehicle response = deliveryServiceClient.getDeliveryVehicle(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DeliveryVehicle getDeliveryVehicle(GetDeliveryVehicleRequest request) { + return getDeliveryVehicleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the specified `DeliveryVehicle` instance. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * GetDeliveryVehicleRequest request = + * GetDeliveryVehicleRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setName(DeliveryVehicleName.of("[PROVIDER]", "[VEHICLE]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * deliveryServiceClient.getDeliveryVehicleCallable().futureCall(request); + * // Do something. + * DeliveryVehicle response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * DeliveryVehicle deliveryVehicle = DeliveryVehicle.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * DeliveryVehicle response = + * deliveryServiceClient.updateDeliveryVehicle(deliveryVehicle, updateMask); + * } + * }+ * + * @param deliveryVehicle Required. The `DeliveryVehicle` entity update to apply. Note: You cannot + * update the name of the `DeliveryVehicle`. + * @param updateMask 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"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DeliveryVehicle updateDeliveryVehicle( + DeliveryVehicle deliveryVehicle, FieldMask updateMask) { + UpdateDeliveryVehicleRequest request = + UpdateDeliveryVehicleRequest.newBuilder() + .setDeliveryVehicle(deliveryVehicle) + .setUpdateMask(updateMask) + .build(); + return updateDeliveryVehicle(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * UpdateDeliveryVehicleRequest request = + * UpdateDeliveryVehicleRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setDeliveryVehicle(DeliveryVehicle.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * DeliveryVehicle response = deliveryServiceClient.updateDeliveryVehicle(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final DeliveryVehicle updateDeliveryVehicle(UpdateDeliveryVehicleRequest request) { + return updateDeliveryVehicleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * UpdateDeliveryVehicleRequest request = + * UpdateDeliveryVehicleRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setDeliveryVehicle(DeliveryVehicle.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * deliveryServiceClient.updateDeliveryVehicleCallable().futureCall(request); + * // Do something. + * DeliveryVehicle response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * BatchCreateTasksRequest request = + * BatchCreateTasksRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setParent(ProviderName.of("[PROVIDER]").toString()) + * .addAllRequests(new ArrayList+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BatchCreateTasksResponse batchCreateTasks(BatchCreateTasksRequest request) { + return batchCreateTasksCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates and returns a batch of new `Task` objects. + * + *()) + * .build(); + * BatchCreateTasksResponse response = deliveryServiceClient.batchCreateTasks(request); + * } + * }
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * BatchCreateTasksRequest request = + * BatchCreateTasksRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setParent(ProviderName.of("[PROVIDER]").toString()) + * .addAllRequests(new ArrayList+ */ + public final UnaryCallable()) + * .build(); + * ApiFuture future = + * deliveryServiceClient.batchCreateTasksCallable().futureCall(request); + * // Do something. + * BatchCreateTasksResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * String parent = "parent-995424086"; + * Task task = Task.newBuilder().build(); + * String taskId = "taskId-880873088"; + * Task response = deliveryServiceClient.createTask(parent, task, taskId); + * } + * }+ * + * @param parent Required. Must be in the format `providers/{provider}`. The `provider` must be + * the Google Cloud Project ID. For example, `sample-cloud-project`. + * @param task Required. The Task entity to create. When creating a Task, the following fields are + * required: + *
Note: The Task's `name` field is ignored. All other Task fields must not be set; + * otherwise, an error is returned. + * @param taskId 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: + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * CreateTaskRequest request = + * CreateTaskRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setParent("parent-995424086") + * .setTaskId("taskId-880873088") + * .setTask(Task.newBuilder().build()) + * .build(); + * Task response = deliveryServiceClient.createTask(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Task createTask(CreateTaskRequest request) { + return createTaskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates and returns a new `Task` object. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * CreateTaskRequest request = + * CreateTaskRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setParent("parent-995424086") + * .setTaskId("taskId-880873088") + * .setTask(Task.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = deliveryServiceClient.createTaskCallable().futureCall(request); + * // Do something. + * Task response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * TaskName name = TaskName.of("[PROVIDER]", "[TASK]"); + * Task response = deliveryServiceClient.getTask(name); + * } + * }+ * + * @param name Required. Must be in the format `providers/{provider}/tasks/{task}`. The `provider` + * must be the Google Cloud Project ID. For example, `sample-cloud-project`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Task getTask(TaskName name) { + GetTaskRequest request = + GetTaskRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getTask(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a `Task`. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * String name = TaskName.of("[PROVIDER]", "[TASK]").toString(); + * Task response = deliveryServiceClient.getTask(name); + * } + * }+ * + * @param name Required. Must be in the format `providers/{provider}/tasks/{task}`. The `provider` + * must be the Google Cloud Project ID. For example, `sample-cloud-project`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Task getTask(String name) { + GetTaskRequest request = GetTaskRequest.newBuilder().setName(name).build(); + return getTask(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a `Task`. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * GetTaskRequest request = + * GetTaskRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setName(TaskName.of("[PROVIDER]", "[TASK]").toString()) + * .build(); + * Task response = deliveryServiceClient.getTask(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Task getTask(GetTaskRequest request) { + return getTaskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a `Task`. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * GetTaskRequest request = + * GetTaskRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setName(TaskName.of("[PROVIDER]", "[TASK]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = deliveryServiceClient.getTaskCallable().futureCall(request); + * // Do something. + * Task response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * Task task = Task.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Task response = deliveryServiceClient.updateTask(task, updateMask); + * } + * }+ * + * @param task 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. + * @param updateMask 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"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Task updateTask(Task task, FieldMask updateMask) { + UpdateTaskRequest request = + UpdateTaskRequest.newBuilder().setTask(task).setUpdateMask(updateMask).build(); + return updateTask(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates `Task` data. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * UpdateTaskRequest request = + * UpdateTaskRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setTask(Task.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Task response = deliveryServiceClient.updateTask(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Task updateTask(UpdateTaskRequest request) { + return updateTaskCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates `Task` data. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * UpdateTaskRequest request = + * UpdateTaskRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setTask(Task.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = deliveryServiceClient.updateTaskCallable().futureCall(request); + * // Do something. + * Task response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * ProviderName parent = ProviderName.of("[PROVIDER]"); + * for (Task element : deliveryServiceClient.listTasks(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. Must be in the format `providers/{provider}`. The `provider` must be + * the Google Cloud Project ID. For example, `sample-cloud-project`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTasksPagedResponse listTasks(ProviderName parent) { + ListTasksRequest request = + ListTasksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listTasks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets all `Task`s that meet the specified filtering criteria. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * String parent = ProviderName.of("[PROVIDER]").toString(); + * for (Task element : deliveryServiceClient.listTasks(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. Must be in the format `providers/{provider}`. The `provider` must be + * the Google Cloud Project ID. For example, `sample-cloud-project`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTasksPagedResponse listTasks(String parent) { + ListTasksRequest request = ListTasksRequest.newBuilder().setParent(parent).build(); + return listTasks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets all `Task`s that meet the specified filtering criteria. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * ListTasksRequest request = + * ListTasksRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setParent(ProviderName.of("[PROVIDER]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .build(); + * for (Task element : deliveryServiceClient.listTasks(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListTasksPagedResponse listTasks(ListTasksRequest request) { + return listTasksPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets all `Task`s that meet the specified filtering criteria. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * ListTasksRequest request = + * ListTasksRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setParent(ProviderName.of("[PROVIDER]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = deliveryServiceClient.listTasksPagedCallable().futureCall(request); + * // Do something. + * for (Task element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * ListTasksRequest request = + * ListTasksRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setParent(ProviderName.of("[PROVIDER]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .build(); + * while (true) { + * ListTasksResponse response = deliveryServiceClient.listTasksCallable().call(request); + * for (Task element : response.getTasksList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * TaskTrackingInfoName name = TaskTrackingInfoName.of("[PROVIDER]", "[TRACKING]"); + * TaskTrackingInfo response = deliveryServiceClient.getTaskTrackingInfo(name); + * } + * }+ * + * @param name 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`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TaskTrackingInfo getTaskTrackingInfo(TaskTrackingInfoName name) { + GetTaskTrackingInfoRequest request = + GetTaskTrackingInfoRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getTaskTrackingInfo(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the specified `TaskTrackingInfo` instance. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * String name = TaskTrackingInfoName.of("[PROVIDER]", "[TRACKING]").toString(); + * TaskTrackingInfo response = deliveryServiceClient.getTaskTrackingInfo(name); + * } + * }+ * + * @param name 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`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TaskTrackingInfo getTaskTrackingInfo(String name) { + GetTaskTrackingInfoRequest request = + GetTaskTrackingInfoRequest.newBuilder().setName(name).build(); + return getTaskTrackingInfo(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the specified `TaskTrackingInfo` instance. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * GetTaskTrackingInfoRequest request = + * GetTaskTrackingInfoRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setName(TaskTrackingInfoName.of("[PROVIDER]", "[TRACKING]").toString()) + * .build(); + * TaskTrackingInfo response = deliveryServiceClient.getTaskTrackingInfo(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TaskTrackingInfo getTaskTrackingInfo(GetTaskTrackingInfoRequest request) { + return getTaskTrackingInfoCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns the specified `TaskTrackingInfo` instance. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * GetTaskTrackingInfoRequest request = + * GetTaskTrackingInfoRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setName(TaskTrackingInfoName.of("[PROVIDER]", "[TRACKING]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * deliveryServiceClient.getTaskTrackingInfoCallable().futureCall(request); + * // Do something. + * TaskTrackingInfo response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * ProviderName parent = ProviderName.of("[PROVIDER]"); + * for (DeliveryVehicle element : + * deliveryServiceClient.listDeliveryVehicles(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. Must be in the format `providers/{provider}`. The `provider` must be + * the Google Cloud Project ID. For example, `sample-cloud-project`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDeliveryVehiclesPagedResponse listDeliveryVehicles(ProviderName parent) { + ListDeliveryVehiclesRequest request = + ListDeliveryVehiclesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listDeliveryVehicles(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets all `DeliveryVehicle`s that meet the specified filtering criteria. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * String parent = ProviderName.of("[PROVIDER]").toString(); + * for (DeliveryVehicle element : + * deliveryServiceClient.listDeliveryVehicles(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. Must be in the format `providers/{provider}`. The `provider` must be + * the Google Cloud Project ID. For example, `sample-cloud-project`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDeliveryVehiclesPagedResponse listDeliveryVehicles(String parent) { + ListDeliveryVehiclesRequest request = + ListDeliveryVehiclesRequest.newBuilder().setParent(parent).build(); + return listDeliveryVehicles(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets all `DeliveryVehicle`s that meet the specified filtering criteria. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * ListDeliveryVehiclesRequest request = + * ListDeliveryVehiclesRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setParent(ProviderName.of("[PROVIDER]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setViewport(Viewport.newBuilder().build()) + * .build(); + * for (DeliveryVehicle element : + * deliveryServiceClient.listDeliveryVehicles(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListDeliveryVehiclesPagedResponse listDeliveryVehicles( + ListDeliveryVehiclesRequest request) { + return listDeliveryVehiclesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets all `DeliveryVehicle`s that meet the specified filtering criteria. + * + *
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * ListDeliveryVehiclesRequest request = + * ListDeliveryVehiclesRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setParent(ProviderName.of("[PROVIDER]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setViewport(Viewport.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * deliveryServiceClient.listDeliveryVehiclesPagedCallable().futureCall(request); + * // Do something. + * for (DeliveryVehicle element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) { + * ListDeliveryVehiclesRequest request = + * ListDeliveryVehiclesRequest.newBuilder() + * .setHeader(DeliveryRequestHeader.newBuilder().build()) + * .setParent(ProviderName.of("[PROVIDER]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setViewport(Viewport.newBuilder().build()) + * .build(); + * while (true) { + * ListDeliveryVehiclesResponse response = + * deliveryServiceClient.listDeliveryVehiclesCallable().call(request); + * for (DeliveryVehicle element : response.getDeliveryVehiclesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
The default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createDeliveryVehicle: + * + *
{@code + * // 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. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * DeliveryServiceSettings.Builder deliveryServiceSettingsBuilder = + * DeliveryServiceSettings.newBuilder(); + * deliveryServiceSettingsBuilder + * .createDeliveryVehicleSettings() + * .setRetrySettings( + * deliveryServiceSettingsBuilder + * .createDeliveryVehicleSettings() + * .getRetrySettings() + * .toBuilder() + * .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + * .setMaxAttempts(5) + * .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + * .setRetryDelayMultiplier(1.3) + * .setRpcTimeoutMultiplier(1.5) + * .setTotalTimeoutDuration(Duration.ofSeconds(300)) + * .build()); + * DeliveryServiceSettings deliveryServiceSettings = deliveryServiceSettingsBuilder.build(); + * }+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@Generated("by gapic-generator-java") +public class DeliveryServiceSettings extends ClientSettings
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ======================= DeliveryServiceClient =======================
+ *
+ * Service Description: The Last Mile Delivery service.
+ *
+ * Sample for DeliveryServiceClient:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class DeliveryServiceStub implements BackgroundResource {
+
+ public UnaryCallable The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the
+ * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
+ * of createDeliveryVehicle:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcDeliveryServiceCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcDeliveryServiceStub extends DeliveryServiceStub {
+ private static final MethodDescriptor This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class HttpJsonDeliveryServiceCallableFactory
+ implements HttpJsonStubCallableFactory This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public class HttpJsonDeliveryServiceStub extends DeliveryServiceStub {
+ private static final TypeRegistry typeRegistry = TypeRegistry.newBuilder().build();
+
+ private static final ApiMethodDescriptor{@code
+ * // 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.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (DeliveryServiceClient deliveryServiceClient = DeliveryServiceClient.create()) {
+ * String parent = "parent-995424086";
+ * DeliveryVehicle deliveryVehicle = DeliveryVehicle.newBuilder().build();
+ * String deliveryVehicleId = "deliveryVehicleId-861424685";
+ * DeliveryVehicle response =
+ * deliveryServiceClient.createDeliveryVehicle(parent, deliveryVehicle, deliveryVehicleId);
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.maps.fleetengine.delivery.v1;
+
+import javax.annotation.Generated;
diff --git a/java-maps-fleetengine-delivery/google-maps-fleetengine-delivery/src/main/java/com/google/maps/fleetengine/delivery/v1/stub/DeliveryServiceStub.java b/java-maps-fleetengine-delivery/google-maps-fleetengine-delivery/src/main/java/com/google/maps/fleetengine/delivery/v1/stub/DeliveryServiceStub.java
new file mode 100644
index 000000000000..861d6753e90a
--- /dev/null
+++ b/java-maps-fleetengine-delivery/google-maps-fleetengine-delivery/src/main/java/com/google/maps/fleetengine/delivery/v1/stub/DeliveryServiceStub.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2024 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.maps.fleetengine.delivery.v1.stub;
+
+import static com.google.maps.fleetengine.delivery.v1.DeliveryServiceClient.ListDeliveryVehiclesPagedResponse;
+import static com.google.maps.fleetengine.delivery.v1.DeliveryServiceClient.ListTasksPagedResponse;
+
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.maps.fleetengine.delivery.v1.BatchCreateTasksRequest;
+import com.google.maps.fleetengine.delivery.v1.BatchCreateTasksResponse;
+import com.google.maps.fleetengine.delivery.v1.CreateDeliveryVehicleRequest;
+import com.google.maps.fleetengine.delivery.v1.CreateTaskRequest;
+import com.google.maps.fleetengine.delivery.v1.DeliveryVehicle;
+import com.google.maps.fleetengine.delivery.v1.GetDeliveryVehicleRequest;
+import com.google.maps.fleetengine.delivery.v1.GetTaskRequest;
+import com.google.maps.fleetengine.delivery.v1.GetTaskTrackingInfoRequest;
+import com.google.maps.fleetengine.delivery.v1.ListDeliveryVehiclesRequest;
+import com.google.maps.fleetengine.delivery.v1.ListDeliveryVehiclesResponse;
+import com.google.maps.fleetengine.delivery.v1.ListTasksRequest;
+import com.google.maps.fleetengine.delivery.v1.ListTasksResponse;
+import com.google.maps.fleetengine.delivery.v1.Task;
+import com.google.maps.fleetengine.delivery.v1.TaskTrackingInfo;
+import com.google.maps.fleetengine.delivery.v1.UpdateDeliveryVehicleRequest;
+import com.google.maps.fleetengine.delivery.v1.UpdateTaskRequest;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the DeliveryService service API.
+ *
+ *
+ *
+ *
+ * {@code
+ * // 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.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * DeliveryServiceStubSettings.Builder deliveryServiceSettingsBuilder =
+ * DeliveryServiceStubSettings.newBuilder();
+ * deliveryServiceSettingsBuilder
+ * .createDeliveryVehicleSettings()
+ * .setRetrySettings(
+ * deliveryServiceSettingsBuilder
+ * .createDeliveryVehicleSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * DeliveryServiceStubSettings deliveryServiceSettings = deliveryServiceSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for
+ * additional support in setting retries.
+ */
+@Generated("by gapic-generator-java")
+public class DeliveryServiceStubSettings extends StubSettings