google-maps-fleet_engine-delivery-v1 0.a → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/maps/fleet_engine/delivery/v1/delivery_service/client.rb +1621 -0
  6. data/lib/google/maps/fleet_engine/delivery/v1/delivery_service/credentials.rb +49 -0
  7. data/lib/google/maps/fleet_engine/delivery/v1/delivery_service/paths.rb +100 -0
  8. data/lib/google/maps/fleet_engine/delivery/v1/delivery_service/rest/client.rb +1505 -0
  9. data/lib/google/maps/fleet_engine/delivery/v1/delivery_service/rest/service_stub.rb +725 -0
  10. data/lib/google/maps/fleet_engine/delivery/v1/delivery_service/rest.rb +54 -0
  11. data/lib/google/maps/fleet_engine/delivery/v1/delivery_service.rb +57 -0
  12. data/lib/google/maps/fleet_engine/delivery/v1/rest.rb +39 -0
  13. data/lib/google/maps/fleet_engine/delivery/v1/version.rb +8 -3
  14. data/lib/google/maps/fleet_engine/delivery/v1.rb +47 -0
  15. data/lib/google/maps/fleetengine/delivery/v1/common_pb.rb +57 -0
  16. data/lib/google/maps/fleetengine/delivery/v1/delivery_api_pb.rb +75 -0
  17. data/lib/google/maps/fleetengine/delivery/v1/delivery_api_services_pb.rb +73 -0
  18. data/lib/google/maps/fleetengine/delivery/v1/delivery_vehicles_pb.rb +61 -0
  19. data/lib/google/maps/fleetengine/delivery/v1/header_pb.rb +48 -0
  20. data/lib/google/maps/fleetengine/delivery/v1/task_tracking_info_pb.rb +58 -0
  21. data/lib/google/maps/fleetengine/delivery/v1/tasks_pb.rb +62 -0
  22. data/lib/google-maps-fleet_engine-delivery-v1.rb +21 -0
  23. data/proto_docs/README.md +4 -0
  24. data/proto_docs/google/api/client.rb +399 -0
  25. data/proto_docs/google/api/field_behavior.rb +85 -0
  26. data/proto_docs/google/api/launch_stage.rb +71 -0
  27. data/proto_docs/google/api/resource.rb +222 -0
  28. data/proto_docs/google/api/routing.rb +459 -0
  29. data/proto_docs/google/geo/type/viewport.rb +70 -0
  30. data/proto_docs/google/maps/fleetengine/delivery/v1/common.rb +251 -0
  31. data/proto_docs/google/maps/fleetengine/delivery/v1/delivery_api.rb +416 -0
  32. data/proto_docs/google/maps/fleetengine/delivery/v1/delivery_vehicles.rb +271 -0
  33. data/proto_docs/google/maps/fleetengine/delivery/v1/header.rb +113 -0
  34. data/proto_docs/google/maps/fleetengine/delivery/v1/task_tracking_info.rb +91 -0
  35. data/proto_docs/google/maps/fleetengine/delivery/v1/tasks.rb +281 -0
  36. data/proto_docs/google/protobuf/duration.rb +98 -0
  37. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  38. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  39. data/proto_docs/google/protobuf/wrappers.rb +121 -0
  40. data/proto_docs/google/type/latlng.rb +38 -0
  41. metadata +109 -13
@@ -0,0 +1,1505 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/maps/fleetengine/delivery/v1/delivery_api_pb"
21
+ require "google/maps/fleet_engine/delivery/v1/delivery_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Maps
25
+ module FleetEngine
26
+ module Delivery
27
+ module V1
28
+ module DeliveryService
29
+ module Rest
30
+ ##
31
+ # REST client for the DeliveryService service.
32
+ #
33
+ # The Last Mile Delivery service.
34
+ #
35
+ class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "fleetengine.$UNIVERSE_DOMAIN$"
38
+
39
+ include Paths
40
+
41
+ # @private
42
+ attr_reader :delivery_service_stub
43
+
44
+ ##
45
+ # Configure the DeliveryService Client class.
46
+ #
47
+ # See {::Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all DeliveryService clients
53
+ # ::Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client.configure do |config|
54
+ # config.timeout = 10.0
55
+ # end
56
+ #
57
+ # @yield [config] Configure the Client client.
58
+ # @yieldparam config [Client::Configuration]
59
+ #
60
+ # @return [Client::Configuration]
61
+ #
62
+ def self.configure
63
+ @configure ||= begin
64
+ namespace = ["Google", "Maps", "FleetEngine", "Delivery", "V1"]
65
+ parent_config = while namespace.any?
66
+ parent_name = namespace.join "::"
67
+ parent_const = const_get parent_name
68
+ break parent_const.configure if parent_const.respond_to? :configure
69
+ namespace.pop
70
+ end
71
+ default_config = Client::Configuration.new parent_config
72
+
73
+ default_config.rpcs.create_delivery_vehicle.timeout = 60.0
74
+ default_config.rpcs.create_delivery_vehicle.retry_policy = {
75
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
76
+ }
77
+
78
+ default_config.rpcs.get_delivery_vehicle.timeout = 60.0
79
+ default_config.rpcs.get_delivery_vehicle.retry_policy = {
80
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
81
+ }
82
+
83
+ default_config.rpcs.update_delivery_vehicle.timeout = 60.0
84
+ default_config.rpcs.update_delivery_vehicle.retry_policy = {
85
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
86
+ }
87
+
88
+ default_config.rpcs.batch_create_tasks.timeout = 60.0
89
+ default_config.rpcs.batch_create_tasks.retry_policy = {
90
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
91
+ }
92
+
93
+ default_config.rpcs.create_task.timeout = 60.0
94
+ default_config.rpcs.create_task.retry_policy = {
95
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
96
+ }
97
+
98
+ default_config.rpcs.get_task.timeout = 60.0
99
+ default_config.rpcs.get_task.retry_policy = {
100
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
101
+ }
102
+
103
+ default_config.rpcs.search_tasks.timeout = 60.0
104
+ default_config.rpcs.search_tasks.retry_policy = {
105
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
106
+ }
107
+
108
+ default_config.rpcs.update_task.timeout = 60.0
109
+ default_config.rpcs.update_task.retry_policy = {
110
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
111
+ }
112
+
113
+ default_config.rpcs.list_tasks.timeout = 60.0
114
+ default_config.rpcs.list_tasks.retry_policy = {
115
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
116
+ }
117
+
118
+ default_config.rpcs.get_task_tracking_info.timeout = 60.0
119
+ default_config.rpcs.get_task_tracking_info.retry_policy = {
120
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
121
+ }
122
+
123
+ default_config.rpcs.list_delivery_vehicles.timeout = 60.0
124
+ default_config.rpcs.list_delivery_vehicles.retry_policy = {
125
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
126
+ }
127
+
128
+ default_config
129
+ end
130
+ yield @configure if block_given?
131
+ @configure
132
+ end
133
+
134
+ ##
135
+ # Configure the DeliveryService Client instance.
136
+ #
137
+ # The configuration is set to the derived mode, meaning that values can be changed,
138
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
139
+ # should be made on {Client.configure}.
140
+ #
141
+ # See {::Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client::Configuration}
142
+ # for a description of the configuration fields.
143
+ #
144
+ # @yield [config] Configure the Client client.
145
+ # @yieldparam config [Client::Configuration]
146
+ #
147
+ # @return [Client::Configuration]
148
+ #
149
+ def configure
150
+ yield @config if block_given?
151
+ @config
152
+ end
153
+
154
+ ##
155
+ # The effective universe domain
156
+ #
157
+ # @return [String]
158
+ #
159
+ def universe_domain
160
+ @delivery_service_stub.universe_domain
161
+ end
162
+
163
+ ##
164
+ # Create a new DeliveryService REST client object.
165
+ #
166
+ # @example
167
+ #
168
+ # # Create a client using the default configuration
169
+ # client = ::Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client.new
170
+ #
171
+ # # Create a client using a custom configuration
172
+ # client = ::Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client.new do |config|
173
+ # config.timeout = 10.0
174
+ # end
175
+ #
176
+ # @yield [config] Configure the DeliveryService client.
177
+ # @yieldparam config [Client::Configuration]
178
+ #
179
+ def initialize
180
+ # Create the configuration object
181
+ @config = Configuration.new Client.configure
182
+
183
+ # Yield the configuration if needed
184
+ yield @config if block_given?
185
+
186
+ # Create credentials
187
+ credentials = @config.credentials
188
+ # Use self-signed JWT if the endpoint is unchanged from default,
189
+ # but only if the default endpoint does not have a region prefix.
190
+ enable_self_signed_jwt = @config.endpoint.nil? ||
191
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
192
+ !@config.endpoint.split(".").first.include?("-"))
193
+ credentials ||= Credentials.default scope: @config.scope,
194
+ enable_self_signed_jwt: enable_self_signed_jwt
195
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
196
+ credentials = Credentials.new credentials, scope: @config.scope
197
+ end
198
+
199
+ @quota_project_id = @config.quota_project
200
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
201
+
202
+ @delivery_service_stub = ::Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::ServiceStub.new(
203
+ endpoint: @config.endpoint,
204
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
205
+ universe_domain: @config.universe_domain,
206
+ credentials: credentials
207
+ )
208
+ end
209
+
210
+ # Service calls
211
+
212
+ ##
213
+ # Creates and returns a new `DeliveryVehicle`.
214
+ #
215
+ # @overload create_delivery_vehicle(request, options = nil)
216
+ # Pass arguments to `create_delivery_vehicle` via a request object, either of type
217
+ # {::Google::Maps::FleetEngine::Delivery::V1::CreateDeliveryVehicleRequest} or an equivalent Hash.
218
+ #
219
+ # @param request [::Google::Maps::FleetEngine::Delivery::V1::CreateDeliveryVehicleRequest, ::Hash]
220
+ # A request object representing the call parameters. Required. To specify no
221
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
222
+ # @param options [::Gapic::CallOptions, ::Hash]
223
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
224
+ #
225
+ # @overload create_delivery_vehicle(header: nil, parent: nil, delivery_vehicle_id: nil, delivery_vehicle: nil)
226
+ # Pass arguments to `create_delivery_vehicle` via keyword arguments. Note that at
227
+ # least one keyword argument is required. To specify no parameters, or to keep all
228
+ # the default parameter values, pass an empty Hash as a request object (see above).
229
+ #
230
+ # @param header [::Google::Maps::FleetEngine::Delivery::V1::DeliveryRequestHeader, ::Hash]
231
+ # Optional. The standard Delivery API request header.
232
+ # @param parent [::String]
233
+ # Required. Must be in the format `providers/{provider}`. The provider must
234
+ # be the Google Cloud Project ID. For example, `sample-cloud-project`.
235
+ # @param delivery_vehicle_id [::String]
236
+ # Required. The Delivery Vehicle ID must be unique and subject to the
237
+ # following restrictions:
238
+ #
239
+ # * Must be a valid Unicode string.
240
+ # * Limited to a maximum length of 64 characters.
241
+ # * Normalized according to [Unicode Normalization Form C]
242
+ # (http://www.unicode.org/reports/tr15/).
243
+ # * May not contain any of the following ASCII characters: '/', ':', '?',
244
+ # ',', or '#'.
245
+ # @param delivery_vehicle [::Google::Maps::FleetEngine::Delivery::V1::DeliveryVehicle, ::Hash]
246
+ # Required. The `DeliveryVehicle` entity to create. When creating a new
247
+ # delivery vehicle, you may set the following optional fields:
248
+ #
249
+ # * last_location
250
+ # * attributes
251
+ #
252
+ # Note: The DeliveryVehicle's `name` field is ignored. All other
253
+ # DeliveryVehicle fields must not be set; otherwise, an error is returned.
254
+ # @yield [result, operation] Access the result along with the TransportOperation object
255
+ # @yieldparam result [::Google::Maps::FleetEngine::Delivery::V1::DeliveryVehicle]
256
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
257
+ #
258
+ # @return [::Google::Maps::FleetEngine::Delivery::V1::DeliveryVehicle]
259
+ #
260
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
261
+ #
262
+ # @example Basic example
263
+ # require "google/maps/fleet_engine/delivery/v1"
264
+ #
265
+ # # Create a client object. The client can be reused for multiple calls.
266
+ # client = Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client.new
267
+ #
268
+ # # Create a request. To set request fields, pass in keyword arguments.
269
+ # request = Google::Maps::FleetEngine::Delivery::V1::CreateDeliveryVehicleRequest.new
270
+ #
271
+ # # Call the create_delivery_vehicle method.
272
+ # result = client.create_delivery_vehicle request
273
+ #
274
+ # # The returned object is of type Google::Maps::FleetEngine::Delivery::V1::DeliveryVehicle.
275
+ # p result
276
+ #
277
+ def create_delivery_vehicle request, options = nil
278
+ raise ::ArgumentError, "request must be provided" if request.nil?
279
+
280
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::FleetEngine::Delivery::V1::CreateDeliveryVehicleRequest
281
+
282
+ # Converts hash and nil to an options object
283
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
284
+
285
+ # Customize the options with defaults
286
+ call_metadata = @config.rpcs.create_delivery_vehicle.metadata.to_h
287
+
288
+ # Set x-goog-api-client and x-goog-user-project headers
289
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
290
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
291
+ gapic_version: ::Google::Maps::FleetEngine::Delivery::V1::VERSION,
292
+ transports_version_send: [:rest]
293
+
294
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
295
+
296
+ options.apply_defaults timeout: @config.rpcs.create_delivery_vehicle.timeout,
297
+ metadata: call_metadata,
298
+ retry_policy: @config.rpcs.create_delivery_vehicle.retry_policy
299
+
300
+ options.apply_defaults timeout: @config.timeout,
301
+ metadata: @config.metadata,
302
+ retry_policy: @config.retry_policy
303
+
304
+ @delivery_service_stub.create_delivery_vehicle request, options do |result, operation|
305
+ yield result, operation if block_given?
306
+ return result
307
+ end
308
+ rescue ::Gapic::Rest::Error => e
309
+ raise ::Google::Cloud::Error.from_error(e)
310
+ end
311
+
312
+ ##
313
+ # Returns the specified `DeliveryVehicle` instance.
314
+ #
315
+ # @overload get_delivery_vehicle(request, options = nil)
316
+ # Pass arguments to `get_delivery_vehicle` via a request object, either of type
317
+ # {::Google::Maps::FleetEngine::Delivery::V1::GetDeliveryVehicleRequest} or an equivalent Hash.
318
+ #
319
+ # @param request [::Google::Maps::FleetEngine::Delivery::V1::GetDeliveryVehicleRequest, ::Hash]
320
+ # A request object representing the call parameters. Required. To specify no
321
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
322
+ # @param options [::Gapic::CallOptions, ::Hash]
323
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
324
+ #
325
+ # @overload get_delivery_vehicle(header: nil, name: nil)
326
+ # Pass arguments to `get_delivery_vehicle` via keyword arguments. Note that at
327
+ # least one keyword argument is required. To specify no parameters, or to keep all
328
+ # the default parameter values, pass an empty Hash as a request object (see above).
329
+ #
330
+ # @param header [::Google::Maps::FleetEngine::Delivery::V1::DeliveryRequestHeader, ::Hash]
331
+ # Optional. The standard Delivery API request header.
332
+ # @param name [::String]
333
+ # Required. Must be in the format
334
+ # `providers/{provider}/deliveryVehicles/{delivery_vehicle}`.
335
+ # The `provider` must be the Google Cloud Project ID. For example,
336
+ # `sample-cloud-project`.
337
+ # @yield [result, operation] Access the result along with the TransportOperation object
338
+ # @yieldparam result [::Google::Maps::FleetEngine::Delivery::V1::DeliveryVehicle]
339
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
340
+ #
341
+ # @return [::Google::Maps::FleetEngine::Delivery::V1::DeliveryVehicle]
342
+ #
343
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
344
+ #
345
+ # @example Basic example
346
+ # require "google/maps/fleet_engine/delivery/v1"
347
+ #
348
+ # # Create a client object. The client can be reused for multiple calls.
349
+ # client = Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client.new
350
+ #
351
+ # # Create a request. To set request fields, pass in keyword arguments.
352
+ # request = Google::Maps::FleetEngine::Delivery::V1::GetDeliveryVehicleRequest.new
353
+ #
354
+ # # Call the get_delivery_vehicle method.
355
+ # result = client.get_delivery_vehicle request
356
+ #
357
+ # # The returned object is of type Google::Maps::FleetEngine::Delivery::V1::DeliveryVehicle.
358
+ # p result
359
+ #
360
+ def get_delivery_vehicle request, options = nil
361
+ raise ::ArgumentError, "request must be provided" if request.nil?
362
+
363
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::FleetEngine::Delivery::V1::GetDeliveryVehicleRequest
364
+
365
+ # Converts hash and nil to an options object
366
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
367
+
368
+ # Customize the options with defaults
369
+ call_metadata = @config.rpcs.get_delivery_vehicle.metadata.to_h
370
+
371
+ # Set x-goog-api-client and x-goog-user-project headers
372
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
373
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
374
+ gapic_version: ::Google::Maps::FleetEngine::Delivery::V1::VERSION,
375
+ transports_version_send: [:rest]
376
+
377
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
378
+
379
+ options.apply_defaults timeout: @config.rpcs.get_delivery_vehicle.timeout,
380
+ metadata: call_metadata,
381
+ retry_policy: @config.rpcs.get_delivery_vehicle.retry_policy
382
+
383
+ options.apply_defaults timeout: @config.timeout,
384
+ metadata: @config.metadata,
385
+ retry_policy: @config.retry_policy
386
+
387
+ @delivery_service_stub.get_delivery_vehicle request, options do |result, operation|
388
+ yield result, operation if block_given?
389
+ return result
390
+ end
391
+ rescue ::Gapic::Rest::Error => e
392
+ raise ::Google::Cloud::Error.from_error(e)
393
+ end
394
+
395
+ ##
396
+ # Writes updated `DeliveryVehicle` data to Fleet Engine, and assigns
397
+ # `Tasks` to the `DeliveryVehicle`. You cannot update the name of the
398
+ # `DeliveryVehicle`. You *can* update `remaining_vehicle_journey_segments`
399
+ # though, but it must contain all of the `VehicleJourneySegment`s currently
400
+ # on the `DeliveryVehicle`. The `task_id`s are retrieved from
401
+ # `remaining_vehicle_journey_segments`, and their corresponding `Tasks` are
402
+ # assigned to the `DeliveryVehicle` if they have not yet been assigned.
403
+ #
404
+ # @overload update_delivery_vehicle(request, options = nil)
405
+ # Pass arguments to `update_delivery_vehicle` via a request object, either of type
406
+ # {::Google::Maps::FleetEngine::Delivery::V1::UpdateDeliveryVehicleRequest} or an equivalent Hash.
407
+ #
408
+ # @param request [::Google::Maps::FleetEngine::Delivery::V1::UpdateDeliveryVehicleRequest, ::Hash]
409
+ # A request object representing the call parameters. Required. To specify no
410
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
411
+ # @param options [::Gapic::CallOptions, ::Hash]
412
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
413
+ #
414
+ # @overload update_delivery_vehicle(header: nil, delivery_vehicle: nil, update_mask: nil)
415
+ # Pass arguments to `update_delivery_vehicle` via keyword arguments. Note that at
416
+ # least one keyword argument is required. To specify no parameters, or to keep all
417
+ # the default parameter values, pass an empty Hash as a request object (see above).
418
+ #
419
+ # @param header [::Google::Maps::FleetEngine::Delivery::V1::DeliveryRequestHeader, ::Hash]
420
+ # Optional. The standard Delivery API request header.
421
+ # @param delivery_vehicle [::Google::Maps::FleetEngine::Delivery::V1::DeliveryVehicle, ::Hash]
422
+ # Required. The `DeliveryVehicle` entity update to apply.
423
+ # Note: You cannot update the name of the `DeliveryVehicle`.
424
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
425
+ # Required. A field mask that indicates which `DeliveryVehicle` fields to
426
+ # update. Note that the update_mask must contain at least one field.
427
+ #
428
+ # This is a comma-separated list of fully qualified names of fields. Example:
429
+ # `"remaining_vehicle_journey_segments"`.
430
+ # @yield [result, operation] Access the result along with the TransportOperation object
431
+ # @yieldparam result [::Google::Maps::FleetEngine::Delivery::V1::DeliveryVehicle]
432
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
433
+ #
434
+ # @return [::Google::Maps::FleetEngine::Delivery::V1::DeliveryVehicle]
435
+ #
436
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
437
+ #
438
+ # @example Basic example
439
+ # require "google/maps/fleet_engine/delivery/v1"
440
+ #
441
+ # # Create a client object. The client can be reused for multiple calls.
442
+ # client = Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client.new
443
+ #
444
+ # # Create a request. To set request fields, pass in keyword arguments.
445
+ # request = Google::Maps::FleetEngine::Delivery::V1::UpdateDeliveryVehicleRequest.new
446
+ #
447
+ # # Call the update_delivery_vehicle method.
448
+ # result = client.update_delivery_vehicle request
449
+ #
450
+ # # The returned object is of type Google::Maps::FleetEngine::Delivery::V1::DeliveryVehicle.
451
+ # p result
452
+ #
453
+ def update_delivery_vehicle request, options = nil
454
+ raise ::ArgumentError, "request must be provided" if request.nil?
455
+
456
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::FleetEngine::Delivery::V1::UpdateDeliveryVehicleRequest
457
+
458
+ # Converts hash and nil to an options object
459
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
460
+
461
+ # Customize the options with defaults
462
+ call_metadata = @config.rpcs.update_delivery_vehicle.metadata.to_h
463
+
464
+ # Set x-goog-api-client and x-goog-user-project headers
465
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
466
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
467
+ gapic_version: ::Google::Maps::FleetEngine::Delivery::V1::VERSION,
468
+ transports_version_send: [:rest]
469
+
470
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
471
+
472
+ options.apply_defaults timeout: @config.rpcs.update_delivery_vehicle.timeout,
473
+ metadata: call_metadata,
474
+ retry_policy: @config.rpcs.update_delivery_vehicle.retry_policy
475
+
476
+ options.apply_defaults timeout: @config.timeout,
477
+ metadata: @config.metadata,
478
+ retry_policy: @config.retry_policy
479
+
480
+ @delivery_service_stub.update_delivery_vehicle request, options do |result, operation|
481
+ yield result, operation if block_given?
482
+ return result
483
+ end
484
+ rescue ::Gapic::Rest::Error => e
485
+ raise ::Google::Cloud::Error.from_error(e)
486
+ end
487
+
488
+ ##
489
+ # Creates and returns a batch of new `Task` objects.
490
+ #
491
+ # @overload batch_create_tasks(request, options = nil)
492
+ # Pass arguments to `batch_create_tasks` via a request object, either of type
493
+ # {::Google::Maps::FleetEngine::Delivery::V1::BatchCreateTasksRequest} or an equivalent Hash.
494
+ #
495
+ # @param request [::Google::Maps::FleetEngine::Delivery::V1::BatchCreateTasksRequest, ::Hash]
496
+ # A request object representing the call parameters. Required. To specify no
497
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
498
+ # @param options [::Gapic::CallOptions, ::Hash]
499
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
500
+ #
501
+ # @overload batch_create_tasks(header: nil, parent: nil, requests: nil)
502
+ # Pass arguments to `batch_create_tasks` via keyword arguments. Note that at
503
+ # least one keyword argument is required. To specify no parameters, or to keep all
504
+ # the default parameter values, pass an empty Hash as a request object (see above).
505
+ #
506
+ # @param header [::Google::Maps::FleetEngine::Delivery::V1::DeliveryRequestHeader, ::Hash]
507
+ # Optional. The standard Delivery API request header.
508
+ # Note: If you set this field, then the header field in the
509
+ # `CreateTaskRequest` messages must either be empty, or it must match this
510
+ # field.
511
+ # @param parent [::String]
512
+ # Required. The parent resource shared by all tasks. This value must be in
513
+ # the format `providers/{provider}`. The `provider` must be the Google Cloud
514
+ # Project ID. For example, `sample-cloud-project`. The parent field in the
515
+ # `CreateTaskRequest` messages must either be empty, or it must match this
516
+ # field.
517
+ # @param requests [::Array<::Google::Maps::FleetEngine::Delivery::V1::CreateTaskRequest, ::Hash>]
518
+ # Required. The request message that specifies the resources to create.
519
+ # Note: You can create a maximum of 500 tasks in a batch.
520
+ # @yield [result, operation] Access the result along with the TransportOperation object
521
+ # @yieldparam result [::Google::Maps::FleetEngine::Delivery::V1::BatchCreateTasksResponse]
522
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
523
+ #
524
+ # @return [::Google::Maps::FleetEngine::Delivery::V1::BatchCreateTasksResponse]
525
+ #
526
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
527
+ #
528
+ # @example Basic example
529
+ # require "google/maps/fleet_engine/delivery/v1"
530
+ #
531
+ # # Create a client object. The client can be reused for multiple calls.
532
+ # client = Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client.new
533
+ #
534
+ # # Create a request. To set request fields, pass in keyword arguments.
535
+ # request = Google::Maps::FleetEngine::Delivery::V1::BatchCreateTasksRequest.new
536
+ #
537
+ # # Call the batch_create_tasks method.
538
+ # result = client.batch_create_tasks request
539
+ #
540
+ # # The returned object is of type Google::Maps::FleetEngine::Delivery::V1::BatchCreateTasksResponse.
541
+ # p result
542
+ #
543
+ def batch_create_tasks request, options = nil
544
+ raise ::ArgumentError, "request must be provided" if request.nil?
545
+
546
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::FleetEngine::Delivery::V1::BatchCreateTasksRequest
547
+
548
+ # Converts hash and nil to an options object
549
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
550
+
551
+ # Customize the options with defaults
552
+ call_metadata = @config.rpcs.batch_create_tasks.metadata.to_h
553
+
554
+ # Set x-goog-api-client and x-goog-user-project headers
555
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
556
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
557
+ gapic_version: ::Google::Maps::FleetEngine::Delivery::V1::VERSION,
558
+ transports_version_send: [:rest]
559
+
560
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
561
+
562
+ options.apply_defaults timeout: @config.rpcs.batch_create_tasks.timeout,
563
+ metadata: call_metadata,
564
+ retry_policy: @config.rpcs.batch_create_tasks.retry_policy
565
+
566
+ options.apply_defaults timeout: @config.timeout,
567
+ metadata: @config.metadata,
568
+ retry_policy: @config.retry_policy
569
+
570
+ @delivery_service_stub.batch_create_tasks request, options do |result, operation|
571
+ yield result, operation if block_given?
572
+ return result
573
+ end
574
+ rescue ::Gapic::Rest::Error => e
575
+ raise ::Google::Cloud::Error.from_error(e)
576
+ end
577
+
578
+ ##
579
+ # Creates and returns a new `Task` object.
580
+ #
581
+ # @overload create_task(request, options = nil)
582
+ # Pass arguments to `create_task` via a request object, either of type
583
+ # {::Google::Maps::FleetEngine::Delivery::V1::CreateTaskRequest} or an equivalent Hash.
584
+ #
585
+ # @param request [::Google::Maps::FleetEngine::Delivery::V1::CreateTaskRequest, ::Hash]
586
+ # A request object representing the call parameters. Required. To specify no
587
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
588
+ # @param options [::Gapic::CallOptions, ::Hash]
589
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
590
+ #
591
+ # @overload create_task(header: nil, parent: nil, task_id: nil, task: nil)
592
+ # Pass arguments to `create_task` via keyword arguments. Note that at
593
+ # least one keyword argument is required. To specify no parameters, or to keep all
594
+ # the default parameter values, pass an empty Hash as a request object (see above).
595
+ #
596
+ # @param header [::Google::Maps::FleetEngine::Delivery::V1::DeliveryRequestHeader, ::Hash]
597
+ # Optional. The standard Delivery API request header.
598
+ # @param parent [::String]
599
+ # Required. Must be in the format `providers/{provider}`. The `provider` must
600
+ # be the Google Cloud Project ID. For example, `sample-cloud-project`.
601
+ # @param task_id [::String]
602
+ # Required. The Task ID must be unique, but it should be not a shipment
603
+ # tracking ID. To store a shipment tracking ID, use the `tracking_id` field.
604
+ # Note that multiple tasks can have the same `tracking_id`. Task IDs are
605
+ # subject to the following restrictions:
606
+ #
607
+ # * Must be a valid Unicode string.
608
+ # * Limited to a maximum length of 64 characters.
609
+ # * Normalized according to [Unicode Normalization Form C]
610
+ # (http://www.unicode.org/reports/tr15/).
611
+ # * May not contain any of the following ASCII characters: '/', ':', '?',
612
+ # ',', or '#'.
613
+ # @param task [::Google::Maps::FleetEngine::Delivery::V1::Task, ::Hash]
614
+ # Required. The Task entity to create.
615
+ # When creating a Task, the following fields are required:
616
+ #
617
+ # * `type`
618
+ # * `state` (must be set to `OPEN`)
619
+ # * `tracking_id` (must not be set for `UNAVAILABLE` or `SCHEDULED_STOP`
620
+ # tasks, but required for all other task types)
621
+ # * `planned_location` (optional for `UNAVAILABLE` tasks)
622
+ # * `task_duration`
623
+ #
624
+ # Note: The Task's `name` field is ignored. All other Task fields must not be
625
+ # set; otherwise, an error is returned.
626
+ # @yield [result, operation] Access the result along with the TransportOperation object
627
+ # @yieldparam result [::Google::Maps::FleetEngine::Delivery::V1::Task]
628
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
629
+ #
630
+ # @return [::Google::Maps::FleetEngine::Delivery::V1::Task]
631
+ #
632
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
633
+ #
634
+ # @example Basic example
635
+ # require "google/maps/fleet_engine/delivery/v1"
636
+ #
637
+ # # Create a client object. The client can be reused for multiple calls.
638
+ # client = Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client.new
639
+ #
640
+ # # Create a request. To set request fields, pass in keyword arguments.
641
+ # request = Google::Maps::FleetEngine::Delivery::V1::CreateTaskRequest.new
642
+ #
643
+ # # Call the create_task method.
644
+ # result = client.create_task request
645
+ #
646
+ # # The returned object is of type Google::Maps::FleetEngine::Delivery::V1::Task.
647
+ # p result
648
+ #
649
+ def create_task request, options = nil
650
+ raise ::ArgumentError, "request must be provided" if request.nil?
651
+
652
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::FleetEngine::Delivery::V1::CreateTaskRequest
653
+
654
+ # Converts hash and nil to an options object
655
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
656
+
657
+ # Customize the options with defaults
658
+ call_metadata = @config.rpcs.create_task.metadata.to_h
659
+
660
+ # Set x-goog-api-client and x-goog-user-project headers
661
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
662
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
663
+ gapic_version: ::Google::Maps::FleetEngine::Delivery::V1::VERSION,
664
+ transports_version_send: [:rest]
665
+
666
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
667
+
668
+ options.apply_defaults timeout: @config.rpcs.create_task.timeout,
669
+ metadata: call_metadata,
670
+ retry_policy: @config.rpcs.create_task.retry_policy
671
+
672
+ options.apply_defaults timeout: @config.timeout,
673
+ metadata: @config.metadata,
674
+ retry_policy: @config.retry_policy
675
+
676
+ @delivery_service_stub.create_task request, options do |result, operation|
677
+ yield result, operation if block_given?
678
+ return result
679
+ end
680
+ rescue ::Gapic::Rest::Error => e
681
+ raise ::Google::Cloud::Error.from_error(e)
682
+ end
683
+
684
+ ##
685
+ # Gets information about a `Task`.
686
+ #
687
+ # @overload get_task(request, options = nil)
688
+ # Pass arguments to `get_task` via a request object, either of type
689
+ # {::Google::Maps::FleetEngine::Delivery::V1::GetTaskRequest} or an equivalent Hash.
690
+ #
691
+ # @param request [::Google::Maps::FleetEngine::Delivery::V1::GetTaskRequest, ::Hash]
692
+ # A request object representing the call parameters. Required. To specify no
693
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
694
+ # @param options [::Gapic::CallOptions, ::Hash]
695
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
696
+ #
697
+ # @overload get_task(header: nil, name: nil)
698
+ # Pass arguments to `get_task` via keyword arguments. Note that at
699
+ # least one keyword argument is required. To specify no parameters, or to keep all
700
+ # the default parameter values, pass an empty Hash as a request object (see above).
701
+ #
702
+ # @param header [::Google::Maps::FleetEngine::Delivery::V1::DeliveryRequestHeader, ::Hash]
703
+ # Optional. The standard Delivery API request header.
704
+ # @param name [::String]
705
+ # Required. Must be in the format `providers/{provider}/tasks/{task}`. The
706
+ # `provider` must be the Google Cloud Project ID. For example,
707
+ # `sample-cloud-project`.
708
+ # @yield [result, operation] Access the result along with the TransportOperation object
709
+ # @yieldparam result [::Google::Maps::FleetEngine::Delivery::V1::Task]
710
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
711
+ #
712
+ # @return [::Google::Maps::FleetEngine::Delivery::V1::Task]
713
+ #
714
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
715
+ #
716
+ # @example Basic example
717
+ # require "google/maps/fleet_engine/delivery/v1"
718
+ #
719
+ # # Create a client object. The client can be reused for multiple calls.
720
+ # client = Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client.new
721
+ #
722
+ # # Create a request. To set request fields, pass in keyword arguments.
723
+ # request = Google::Maps::FleetEngine::Delivery::V1::GetTaskRequest.new
724
+ #
725
+ # # Call the get_task method.
726
+ # result = client.get_task request
727
+ #
728
+ # # The returned object is of type Google::Maps::FleetEngine::Delivery::V1::Task.
729
+ # p result
730
+ #
731
+ def get_task request, options = nil
732
+ raise ::ArgumentError, "request must be provided" if request.nil?
733
+
734
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::FleetEngine::Delivery::V1::GetTaskRequest
735
+
736
+ # Converts hash and nil to an options object
737
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
738
+
739
+ # Customize the options with defaults
740
+ call_metadata = @config.rpcs.get_task.metadata.to_h
741
+
742
+ # Set x-goog-api-client and x-goog-user-project headers
743
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
744
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
745
+ gapic_version: ::Google::Maps::FleetEngine::Delivery::V1::VERSION,
746
+ transports_version_send: [:rest]
747
+
748
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
749
+
750
+ options.apply_defaults timeout: @config.rpcs.get_task.timeout,
751
+ metadata: call_metadata,
752
+ retry_policy: @config.rpcs.get_task.retry_policy
753
+
754
+ options.apply_defaults timeout: @config.timeout,
755
+ metadata: @config.metadata,
756
+ retry_policy: @config.retry_policy
757
+
758
+ @delivery_service_stub.get_task request, options do |result, operation|
759
+ yield result, operation if block_given?
760
+ return result
761
+ end
762
+ rescue ::Gapic::Rest::Error => e
763
+ raise ::Google::Cloud::Error.from_error(e)
764
+ end
765
+
766
+ ##
767
+ # Deprecated: Use `GetTaskTrackingInfo` instead.
768
+ #
769
+ # @overload search_tasks(request, options = nil)
770
+ # Pass arguments to `search_tasks` via a request object, either of type
771
+ # {::Google::Maps::FleetEngine::Delivery::V1::SearchTasksRequest} or an equivalent Hash.
772
+ #
773
+ # @param request [::Google::Maps::FleetEngine::Delivery::V1::SearchTasksRequest, ::Hash]
774
+ # A request object representing the call parameters. Required. To specify no
775
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
776
+ # @param options [::Gapic::CallOptions, ::Hash]
777
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
778
+ #
779
+ # @overload search_tasks(header: nil, parent: nil, tracking_id: nil, page_size: nil, page_token: nil)
780
+ # Pass arguments to `search_tasks` via keyword arguments. Note that at
781
+ # least one keyword argument is required. To specify no parameters, or to keep all
782
+ # the default parameter values, pass an empty Hash as a request object (see above).
783
+ #
784
+ # @param header [::Google::Maps::FleetEngine::Delivery::V1::DeliveryRequestHeader, ::Hash]
785
+ # Optional. The standard Delivery API request header.
786
+ # @param parent [::String]
787
+ # Required. Must be in the format `providers/{provider}`.
788
+ # The provider must be the Google Cloud Project ID. For example,
789
+ # `sample-cloud-project`.
790
+ # @param tracking_id [::String]
791
+ # Required. The identifier of the set of related Tasks being requested.
792
+ # Tracking IDs are subject to the following restrictions:
793
+ #
794
+ # * Must be a valid Unicode string.
795
+ # * Limited to a maximum length of 64 characters.
796
+ # * Normalized according to [Unicode Normalization Form C]
797
+ # (http://www.unicode.org/reports/tr15/).
798
+ # * May not contain any of the following ASCII characters: '/', ':', '?',
799
+ # ',', or '#'.
800
+ # @param page_size [::Integer]
801
+ # Optional. The maximum number of Tasks to return. The service may return
802
+ # fewer than this value. If you don't specify this value, then the server
803
+ # determines the number of results to return.
804
+ # @param page_token [::String]
805
+ # Optional. A page token, received from a previous `SearchTasks` call. You
806
+ # must provide this value to retrieve the subsequent page.
807
+ #
808
+ # When paginating, all other parameters provided to `SearchTasks` must match
809
+ # the call that provided the page token.
810
+ # @yield [result, operation] Access the result along with the TransportOperation object
811
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Maps::FleetEngine::Delivery::V1::Task>]
812
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
813
+ #
814
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Maps::FleetEngine::Delivery::V1::Task>]
815
+ #
816
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
817
+ #
818
+ # @example Basic example
819
+ # require "google/maps/fleet_engine/delivery/v1"
820
+ #
821
+ # # Create a client object. The client can be reused for multiple calls.
822
+ # client = Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client.new
823
+ #
824
+ # # Create a request. To set request fields, pass in keyword arguments.
825
+ # request = Google::Maps::FleetEngine::Delivery::V1::SearchTasksRequest.new
826
+ #
827
+ # # Call the search_tasks method.
828
+ # result = client.search_tasks request
829
+ #
830
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
831
+ # # over elements, and API calls will be issued to fetch pages as needed.
832
+ # result.each do |item|
833
+ # # Each element is of type ::Google::Maps::FleetEngine::Delivery::V1::Task.
834
+ # p item
835
+ # end
836
+ #
837
+ def search_tasks request, options = nil
838
+ raise ::ArgumentError, "request must be provided" if request.nil?
839
+
840
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::FleetEngine::Delivery::V1::SearchTasksRequest
841
+
842
+ # Converts hash and nil to an options object
843
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
844
+
845
+ # Customize the options with defaults
846
+ call_metadata = @config.rpcs.search_tasks.metadata.to_h
847
+
848
+ # Set x-goog-api-client and x-goog-user-project headers
849
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
850
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
851
+ gapic_version: ::Google::Maps::FleetEngine::Delivery::V1::VERSION,
852
+ transports_version_send: [:rest]
853
+
854
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
855
+
856
+ options.apply_defaults timeout: @config.rpcs.search_tasks.timeout,
857
+ metadata: call_metadata,
858
+ retry_policy: @config.rpcs.search_tasks.retry_policy
859
+
860
+ options.apply_defaults timeout: @config.timeout,
861
+ metadata: @config.metadata,
862
+ retry_policy: @config.retry_policy
863
+
864
+ @delivery_service_stub.search_tasks request, options do |result, operation|
865
+ result = ::Gapic::Rest::PagedEnumerable.new @delivery_service_stub, :search_tasks, "tasks", request, result, options
866
+ yield result, operation if block_given?
867
+ return result
868
+ end
869
+ rescue ::Gapic::Rest::Error => e
870
+ raise ::Google::Cloud::Error.from_error(e)
871
+ end
872
+
873
+ ##
874
+ # Updates `Task` data.
875
+ #
876
+ # @overload update_task(request, options = nil)
877
+ # Pass arguments to `update_task` via a request object, either of type
878
+ # {::Google::Maps::FleetEngine::Delivery::V1::UpdateTaskRequest} or an equivalent Hash.
879
+ #
880
+ # @param request [::Google::Maps::FleetEngine::Delivery::V1::UpdateTaskRequest, ::Hash]
881
+ # A request object representing the call parameters. Required. To specify no
882
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
883
+ # @param options [::Gapic::CallOptions, ::Hash]
884
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
885
+ #
886
+ # @overload update_task(header: nil, task: nil, update_mask: nil)
887
+ # Pass arguments to `update_task` via keyword arguments. Note that at
888
+ # least one keyword argument is required. To specify no parameters, or to keep all
889
+ # the default parameter values, pass an empty Hash as a request object (see above).
890
+ #
891
+ # @param header [::Google::Maps::FleetEngine::Delivery::V1::DeliveryRequestHeader, ::Hash]
892
+ # Optional. The standard Delivery API request header.
893
+ # @param task [::Google::Maps::FleetEngine::Delivery::V1::Task, ::Hash]
894
+ # Required. The Task associated with the update.
895
+ # The following fields are maintained by Fleet Engine. Do not update
896
+ # them using `Task.update`.
897
+ #
898
+ # * `last_location`.
899
+ # * `last_location_snappable`.
900
+ # * `name`.
901
+ # * `remaining_vehicle_journey_segments`.
902
+ # * `task_outcome_location_source`.
903
+ #
904
+ # Note: You cannot change the value of `task_outcome` once you set it.
905
+ #
906
+ # If the Task has been assigned to a delivery vehicle, then don't set the
907
+ # Task state to CLOSED using `Task.update`. Instead, remove the `VehicleStop`
908
+ # that contains the Task from the delivery vehicle, which automatically sets
909
+ # the Task state to CLOSED.
910
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
911
+ # Required. The field mask that indicates which Task fields to update.
912
+ # Note: The `update_mask` must contain at least one field.
913
+ #
914
+ # This is a comma-separated list of fully qualified names of fields. Example:
915
+ # `"task_outcome,task_outcome_time,task_outcome_location"`.
916
+ # @yield [result, operation] Access the result along with the TransportOperation object
917
+ # @yieldparam result [::Google::Maps::FleetEngine::Delivery::V1::Task]
918
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
919
+ #
920
+ # @return [::Google::Maps::FleetEngine::Delivery::V1::Task]
921
+ #
922
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
923
+ #
924
+ # @example Basic example
925
+ # require "google/maps/fleet_engine/delivery/v1"
926
+ #
927
+ # # Create a client object. The client can be reused for multiple calls.
928
+ # client = Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client.new
929
+ #
930
+ # # Create a request. To set request fields, pass in keyword arguments.
931
+ # request = Google::Maps::FleetEngine::Delivery::V1::UpdateTaskRequest.new
932
+ #
933
+ # # Call the update_task method.
934
+ # result = client.update_task request
935
+ #
936
+ # # The returned object is of type Google::Maps::FleetEngine::Delivery::V1::Task.
937
+ # p result
938
+ #
939
+ def update_task request, options = nil
940
+ raise ::ArgumentError, "request must be provided" if request.nil?
941
+
942
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::FleetEngine::Delivery::V1::UpdateTaskRequest
943
+
944
+ # Converts hash and nil to an options object
945
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
946
+
947
+ # Customize the options with defaults
948
+ call_metadata = @config.rpcs.update_task.metadata.to_h
949
+
950
+ # Set x-goog-api-client and x-goog-user-project headers
951
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
952
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
953
+ gapic_version: ::Google::Maps::FleetEngine::Delivery::V1::VERSION,
954
+ transports_version_send: [:rest]
955
+
956
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
957
+
958
+ options.apply_defaults timeout: @config.rpcs.update_task.timeout,
959
+ metadata: call_metadata,
960
+ retry_policy: @config.rpcs.update_task.retry_policy
961
+
962
+ options.apply_defaults timeout: @config.timeout,
963
+ metadata: @config.metadata,
964
+ retry_policy: @config.retry_policy
965
+
966
+ @delivery_service_stub.update_task request, options do |result, operation|
967
+ yield result, operation if block_given?
968
+ return result
969
+ end
970
+ rescue ::Gapic::Rest::Error => e
971
+ raise ::Google::Cloud::Error.from_error(e)
972
+ end
973
+
974
+ ##
975
+ # Gets all `Task`s that meet the specified filtering criteria.
976
+ #
977
+ # @overload list_tasks(request, options = nil)
978
+ # Pass arguments to `list_tasks` via a request object, either of type
979
+ # {::Google::Maps::FleetEngine::Delivery::V1::ListTasksRequest} or an equivalent Hash.
980
+ #
981
+ # @param request [::Google::Maps::FleetEngine::Delivery::V1::ListTasksRequest, ::Hash]
982
+ # A request object representing the call parameters. Required. To specify no
983
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
984
+ # @param options [::Gapic::CallOptions, ::Hash]
985
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
986
+ #
987
+ # @overload list_tasks(header: nil, parent: nil, page_size: nil, page_token: nil, filter: nil)
988
+ # Pass arguments to `list_tasks` via keyword arguments. Note that at
989
+ # least one keyword argument is required. To specify no parameters, or to keep all
990
+ # the default parameter values, pass an empty Hash as a request object (see above).
991
+ #
992
+ # @param header [::Google::Maps::FleetEngine::Delivery::V1::DeliveryRequestHeader, ::Hash]
993
+ # Optional. The standard Delivery API request header.
994
+ # @param parent [::String]
995
+ # Required. Must be in the format `providers/{provider}`.
996
+ # The `provider` must be the Google Cloud Project ID. For example,
997
+ # `sample-cloud-project`.
998
+ # @param page_size [::Integer]
999
+ # Optional. The maximum number of Tasks to return. The service may return
1000
+ # fewer than this value. If you don't specify this value, then the server
1001
+ # determines the number of results to return.
1002
+ # @param page_token [::String]
1003
+ # Optional. A page token received from a previous `ListTasks` call.
1004
+ # You can provide this to retrieve the subsequent page.
1005
+ #
1006
+ # When paginating, all other parameters provided to `ListTasks` must match
1007
+ # the call that provided the page token.
1008
+ # @param filter [::String]
1009
+ # Optional. A filter query to apply when listing Tasks. See
1010
+ # http://aip.dev/160 for examples of filter syntax. If you don't specify a
1011
+ # value, or if you filter on an empty string, then all Tasks are returned.
1012
+ # For information about the Task properties that you can filter on, see [List
1013
+ # tasks](https://developers.google.com/maps/documentation/transportation-logistics/last-mile-fleet-solution/fleet-performance/fleet-engine/deliveries_api#list-tasks).
1014
+ # @yield [result, operation] Access the result along with the TransportOperation object
1015
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Maps::FleetEngine::Delivery::V1::Task>]
1016
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1017
+ #
1018
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Maps::FleetEngine::Delivery::V1::Task>]
1019
+ #
1020
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1021
+ #
1022
+ # @example Basic example
1023
+ # require "google/maps/fleet_engine/delivery/v1"
1024
+ #
1025
+ # # Create a client object. The client can be reused for multiple calls.
1026
+ # client = Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client.new
1027
+ #
1028
+ # # Create a request. To set request fields, pass in keyword arguments.
1029
+ # request = Google::Maps::FleetEngine::Delivery::V1::ListTasksRequest.new
1030
+ #
1031
+ # # Call the list_tasks method.
1032
+ # result = client.list_tasks request
1033
+ #
1034
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1035
+ # # over elements, and API calls will be issued to fetch pages as needed.
1036
+ # result.each do |item|
1037
+ # # Each element is of type ::Google::Maps::FleetEngine::Delivery::V1::Task.
1038
+ # p item
1039
+ # end
1040
+ #
1041
+ def list_tasks request, options = nil
1042
+ raise ::ArgumentError, "request must be provided" if request.nil?
1043
+
1044
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::FleetEngine::Delivery::V1::ListTasksRequest
1045
+
1046
+ # Converts hash and nil to an options object
1047
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1048
+
1049
+ # Customize the options with defaults
1050
+ call_metadata = @config.rpcs.list_tasks.metadata.to_h
1051
+
1052
+ # Set x-goog-api-client and x-goog-user-project headers
1053
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1054
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1055
+ gapic_version: ::Google::Maps::FleetEngine::Delivery::V1::VERSION,
1056
+ transports_version_send: [:rest]
1057
+
1058
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1059
+
1060
+ options.apply_defaults timeout: @config.rpcs.list_tasks.timeout,
1061
+ metadata: call_metadata,
1062
+ retry_policy: @config.rpcs.list_tasks.retry_policy
1063
+
1064
+ options.apply_defaults timeout: @config.timeout,
1065
+ metadata: @config.metadata,
1066
+ retry_policy: @config.retry_policy
1067
+
1068
+ @delivery_service_stub.list_tasks request, options do |result, operation|
1069
+ result = ::Gapic::Rest::PagedEnumerable.new @delivery_service_stub, :list_tasks, "tasks", request, result, options
1070
+ yield result, operation if block_given?
1071
+ return result
1072
+ end
1073
+ rescue ::Gapic::Rest::Error => e
1074
+ raise ::Google::Cloud::Error.from_error(e)
1075
+ end
1076
+
1077
+ ##
1078
+ # Returns the specified `TaskTrackingInfo` instance.
1079
+ #
1080
+ # @overload get_task_tracking_info(request, options = nil)
1081
+ # Pass arguments to `get_task_tracking_info` via a request object, either of type
1082
+ # {::Google::Maps::FleetEngine::Delivery::V1::GetTaskTrackingInfoRequest} or an equivalent Hash.
1083
+ #
1084
+ # @param request [::Google::Maps::FleetEngine::Delivery::V1::GetTaskTrackingInfoRequest, ::Hash]
1085
+ # A request object representing the call parameters. Required. To specify no
1086
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1087
+ # @param options [::Gapic::CallOptions, ::Hash]
1088
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1089
+ #
1090
+ # @overload get_task_tracking_info(header: nil, name: nil)
1091
+ # Pass arguments to `get_task_tracking_info` via keyword arguments. Note that at
1092
+ # least one keyword argument is required. To specify no parameters, or to keep all
1093
+ # the default parameter values, pass an empty Hash as a request object (see above).
1094
+ #
1095
+ # @param header [::Google::Maps::FleetEngine::Delivery::V1::DeliveryRequestHeader, ::Hash]
1096
+ # Optional. The standard Delivery API request header.
1097
+ # @param name [::String]
1098
+ # Required. Must be in the format
1099
+ # `providers/{provider}/taskTrackingInfo/{tracking_id}`. The `provider`
1100
+ # must be the Google Cloud Project ID, and the `tracking_id` must be the
1101
+ # tracking ID associated with the task. An example name can be
1102
+ # `providers/sample-cloud-project/taskTrackingInfo/sample-tracking-id`.
1103
+ # @yield [result, operation] Access the result along with the TransportOperation object
1104
+ # @yieldparam result [::Google::Maps::FleetEngine::Delivery::V1::TaskTrackingInfo]
1105
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1106
+ #
1107
+ # @return [::Google::Maps::FleetEngine::Delivery::V1::TaskTrackingInfo]
1108
+ #
1109
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1110
+ #
1111
+ # @example Basic example
1112
+ # require "google/maps/fleet_engine/delivery/v1"
1113
+ #
1114
+ # # Create a client object. The client can be reused for multiple calls.
1115
+ # client = Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client.new
1116
+ #
1117
+ # # Create a request. To set request fields, pass in keyword arguments.
1118
+ # request = Google::Maps::FleetEngine::Delivery::V1::GetTaskTrackingInfoRequest.new
1119
+ #
1120
+ # # Call the get_task_tracking_info method.
1121
+ # result = client.get_task_tracking_info request
1122
+ #
1123
+ # # The returned object is of type Google::Maps::FleetEngine::Delivery::V1::TaskTrackingInfo.
1124
+ # p result
1125
+ #
1126
+ def get_task_tracking_info request, options = nil
1127
+ raise ::ArgumentError, "request must be provided" if request.nil?
1128
+
1129
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::FleetEngine::Delivery::V1::GetTaskTrackingInfoRequest
1130
+
1131
+ # Converts hash and nil to an options object
1132
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1133
+
1134
+ # Customize the options with defaults
1135
+ call_metadata = @config.rpcs.get_task_tracking_info.metadata.to_h
1136
+
1137
+ # Set x-goog-api-client and x-goog-user-project headers
1138
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1139
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1140
+ gapic_version: ::Google::Maps::FleetEngine::Delivery::V1::VERSION,
1141
+ transports_version_send: [:rest]
1142
+
1143
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1144
+
1145
+ options.apply_defaults timeout: @config.rpcs.get_task_tracking_info.timeout,
1146
+ metadata: call_metadata,
1147
+ retry_policy: @config.rpcs.get_task_tracking_info.retry_policy
1148
+
1149
+ options.apply_defaults timeout: @config.timeout,
1150
+ metadata: @config.metadata,
1151
+ retry_policy: @config.retry_policy
1152
+
1153
+ @delivery_service_stub.get_task_tracking_info request, options do |result, operation|
1154
+ yield result, operation if block_given?
1155
+ return result
1156
+ end
1157
+ rescue ::Gapic::Rest::Error => e
1158
+ raise ::Google::Cloud::Error.from_error(e)
1159
+ end
1160
+
1161
+ ##
1162
+ # Gets all `DeliveryVehicle`s that meet the specified filtering criteria.
1163
+ #
1164
+ # @overload list_delivery_vehicles(request, options = nil)
1165
+ # Pass arguments to `list_delivery_vehicles` via a request object, either of type
1166
+ # {::Google::Maps::FleetEngine::Delivery::V1::ListDeliveryVehiclesRequest} or an equivalent Hash.
1167
+ #
1168
+ # @param request [::Google::Maps::FleetEngine::Delivery::V1::ListDeliveryVehiclesRequest, ::Hash]
1169
+ # A request object representing the call parameters. Required. To specify no
1170
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1171
+ # @param options [::Gapic::CallOptions, ::Hash]
1172
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1173
+ #
1174
+ # @overload list_delivery_vehicles(header: nil, parent: nil, page_size: nil, page_token: nil, filter: nil, viewport: nil)
1175
+ # Pass arguments to `list_delivery_vehicles` via keyword arguments. Note that at
1176
+ # least one keyword argument is required. To specify no parameters, or to keep all
1177
+ # the default parameter values, pass an empty Hash as a request object (see above).
1178
+ #
1179
+ # @param header [::Google::Maps::FleetEngine::Delivery::V1::DeliveryRequestHeader, ::Hash]
1180
+ # Optional. The standard Delivery API request header.
1181
+ # @param parent [::String]
1182
+ # Required. Must be in the format `providers/{provider}`.
1183
+ # The `provider` must be the Google Cloud Project ID.
1184
+ # For example, `sample-cloud-project`.
1185
+ # @param page_size [::Integer]
1186
+ # Optional. The maximum number of vehicles to return. The service may return
1187
+ # fewer than this number. If you don't specify this number, then the server
1188
+ # determines the number of results to return.
1189
+ # @param page_token [::String]
1190
+ # Optional. A page token, received from a previous `ListDeliveryVehicles`
1191
+ # call. You must provide this in order to retrieve the subsequent page.
1192
+ #
1193
+ # When paginating, all other parameters provided to `ListDeliveryVehicles`
1194
+ # must match the call that provided the page token.
1195
+ # @param filter [::String]
1196
+ # Optional. A filter query to apply when listing delivery vehicles. See
1197
+ # http://aip.dev/160 for examples of the filter syntax. If you don't specify
1198
+ # a value, or if you specify an empty string for the filter, then all
1199
+ # delivery vehicles are returned.
1200
+ #
1201
+ # Note that the only queries supported for `ListDeliveryVehicles` are
1202
+ # on vehicle attributes (for example, `attributes.<key> = <value>` or
1203
+ # `attributes.<key1> = <value1> AND attributes.<key2> = <value2>`). Also, all
1204
+ # attributes are stored as strings, so the only supported comparisons against
1205
+ # attributes are string comparisons. In order to compare against number or
1206
+ # boolean values, the values must be explicitly quoted to be treated as
1207
+ # strings (for example, `attributes.<key> = "10"` or
1208
+ # `attributes.<key> = "true"`).
1209
+ #
1210
+ # The maximum number of restrictions allowed in a filter query is 50. A
1211
+ # restriction is a part of the query of the form
1212
+ # `attribute.<KEY> <COMPARATOR> <VALUE>`, for example `attributes.foo = bar`
1213
+ # is 1 restriction.
1214
+ # @param viewport [::Google::Geo::Type::Viewport, ::Hash]
1215
+ # Optional. A filter that limits the vehicles returned to those whose last
1216
+ # known location was in the rectangular area defined by the viewport.
1217
+ # @yield [result, operation] Access the result along with the TransportOperation object
1218
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Maps::FleetEngine::Delivery::V1::DeliveryVehicle>]
1219
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1220
+ #
1221
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Maps::FleetEngine::Delivery::V1::DeliveryVehicle>]
1222
+ #
1223
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1224
+ #
1225
+ # @example Basic example
1226
+ # require "google/maps/fleet_engine/delivery/v1"
1227
+ #
1228
+ # # Create a client object. The client can be reused for multiple calls.
1229
+ # client = Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client.new
1230
+ #
1231
+ # # Create a request. To set request fields, pass in keyword arguments.
1232
+ # request = Google::Maps::FleetEngine::Delivery::V1::ListDeliveryVehiclesRequest.new
1233
+ #
1234
+ # # Call the list_delivery_vehicles method.
1235
+ # result = client.list_delivery_vehicles request
1236
+ #
1237
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1238
+ # # over elements, and API calls will be issued to fetch pages as needed.
1239
+ # result.each do |item|
1240
+ # # Each element is of type ::Google::Maps::FleetEngine::Delivery::V1::DeliveryVehicle.
1241
+ # p item
1242
+ # end
1243
+ #
1244
+ def list_delivery_vehicles request, options = nil
1245
+ raise ::ArgumentError, "request must be provided" if request.nil?
1246
+
1247
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::FleetEngine::Delivery::V1::ListDeliveryVehiclesRequest
1248
+
1249
+ # Converts hash and nil to an options object
1250
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1251
+
1252
+ # Customize the options with defaults
1253
+ call_metadata = @config.rpcs.list_delivery_vehicles.metadata.to_h
1254
+
1255
+ # Set x-goog-api-client and x-goog-user-project headers
1256
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1257
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1258
+ gapic_version: ::Google::Maps::FleetEngine::Delivery::V1::VERSION,
1259
+ transports_version_send: [:rest]
1260
+
1261
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1262
+
1263
+ options.apply_defaults timeout: @config.rpcs.list_delivery_vehicles.timeout,
1264
+ metadata: call_metadata,
1265
+ retry_policy: @config.rpcs.list_delivery_vehicles.retry_policy
1266
+
1267
+ options.apply_defaults timeout: @config.timeout,
1268
+ metadata: @config.metadata,
1269
+ retry_policy: @config.retry_policy
1270
+
1271
+ @delivery_service_stub.list_delivery_vehicles request, options do |result, operation|
1272
+ result = ::Gapic::Rest::PagedEnumerable.new @delivery_service_stub, :list_delivery_vehicles, "delivery_vehicles", request, result, options
1273
+ yield result, operation if block_given?
1274
+ return result
1275
+ end
1276
+ rescue ::Gapic::Rest::Error => e
1277
+ raise ::Google::Cloud::Error.from_error(e)
1278
+ end
1279
+
1280
+ ##
1281
+ # Configuration class for the DeliveryService REST API.
1282
+ #
1283
+ # This class represents the configuration for DeliveryService REST,
1284
+ # providing control over timeouts, retry behavior, logging, transport
1285
+ # parameters, and other low-level controls. Certain parameters can also be
1286
+ # applied individually to specific RPCs. See
1287
+ # {::Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client::Configuration::Rpcs}
1288
+ # for a list of RPCs that can be configured independently.
1289
+ #
1290
+ # Configuration can be applied globally to all clients, or to a single client
1291
+ # on construction.
1292
+ #
1293
+ # @example
1294
+ #
1295
+ # # Modify the global config, setting the timeout for
1296
+ # # create_delivery_vehicle to 20 seconds,
1297
+ # # and all remaining timeouts to 10 seconds.
1298
+ # ::Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client.configure do |config|
1299
+ # config.timeout = 10.0
1300
+ # config.rpcs.create_delivery_vehicle.timeout = 20.0
1301
+ # end
1302
+ #
1303
+ # # Apply the above configuration only to a new client.
1304
+ # client = ::Google::Maps::FleetEngine::Delivery::V1::DeliveryService::Rest::Client.new do |config|
1305
+ # config.timeout = 10.0
1306
+ # config.rpcs.create_delivery_vehicle.timeout = 20.0
1307
+ # end
1308
+ #
1309
+ # @!attribute [rw] endpoint
1310
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1311
+ # nil, indicating to use the default endpoint in the current universe domain.
1312
+ # @return [::String,nil]
1313
+ # @!attribute [rw] credentials
1314
+ # Credentials to send with calls. You may provide any of the following types:
1315
+ # * (`String`) The path to a service account key file in JSON format
1316
+ # * (`Hash`) A service account key as a Hash
1317
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1318
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1319
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1320
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1321
+ # * (`nil`) indicating no credentials
1322
+ # @return [::Object]
1323
+ # @!attribute [rw] scope
1324
+ # The OAuth scopes
1325
+ # @return [::Array<::String>]
1326
+ # @!attribute [rw] lib_name
1327
+ # The library name as recorded in instrumentation and logging
1328
+ # @return [::String]
1329
+ # @!attribute [rw] lib_version
1330
+ # The library version as recorded in instrumentation and logging
1331
+ # @return [::String]
1332
+ # @!attribute [rw] timeout
1333
+ # The call timeout in seconds.
1334
+ # @return [::Numeric]
1335
+ # @!attribute [rw] metadata
1336
+ # Additional headers to be sent with the call.
1337
+ # @return [::Hash{::Symbol=>::String}]
1338
+ # @!attribute [rw] retry_policy
1339
+ # The retry policy. The value is a hash with the following keys:
1340
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1341
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1342
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1343
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1344
+ # trigger a retry.
1345
+ # @return [::Hash]
1346
+ # @!attribute [rw] quota_project
1347
+ # A separate project against which to charge quota.
1348
+ # @return [::String]
1349
+ # @!attribute [rw] universe_domain
1350
+ # The universe domain within which to make requests. This determines the
1351
+ # default endpoint URL. The default value of nil uses the environment
1352
+ # universe (usually the default "googleapis.com" universe).
1353
+ # @return [::String,nil]
1354
+ #
1355
+ class Configuration
1356
+ extend ::Gapic::Config
1357
+
1358
+ # @private
1359
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1360
+ DEFAULT_ENDPOINT = "fleetengine.googleapis.com"
1361
+
1362
+ config_attr :endpoint, nil, ::String, nil
1363
+ config_attr :credentials, nil do |value|
1364
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1365
+ allowed.any? { |klass| klass === value }
1366
+ end
1367
+ config_attr :scope, nil, ::String, ::Array, nil
1368
+ config_attr :lib_name, nil, ::String, nil
1369
+ config_attr :lib_version, nil, ::String, nil
1370
+ config_attr :timeout, nil, ::Numeric, nil
1371
+ config_attr :metadata, nil, ::Hash, nil
1372
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1373
+ config_attr :quota_project, nil, ::String, nil
1374
+ config_attr :universe_domain, nil, ::String, nil
1375
+
1376
+ # @private
1377
+ def initialize parent_config = nil
1378
+ @parent_config = parent_config unless parent_config.nil?
1379
+
1380
+ yield self if block_given?
1381
+ end
1382
+
1383
+ ##
1384
+ # Configurations for individual RPCs
1385
+ # @return [Rpcs]
1386
+ #
1387
+ def rpcs
1388
+ @rpcs ||= begin
1389
+ parent_rpcs = nil
1390
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1391
+ Rpcs.new parent_rpcs
1392
+ end
1393
+ end
1394
+
1395
+ ##
1396
+ # Configuration RPC class for the DeliveryService API.
1397
+ #
1398
+ # Includes fields providing the configuration for each RPC in this service.
1399
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1400
+ # the following configuration fields:
1401
+ #
1402
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1403
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1404
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1405
+ # include the following keys:
1406
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1407
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1408
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1409
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1410
+ # trigger a retry.
1411
+ #
1412
+ class Rpcs
1413
+ ##
1414
+ # RPC-specific configuration for `create_delivery_vehicle`
1415
+ # @return [::Gapic::Config::Method]
1416
+ #
1417
+ attr_reader :create_delivery_vehicle
1418
+ ##
1419
+ # RPC-specific configuration for `get_delivery_vehicle`
1420
+ # @return [::Gapic::Config::Method]
1421
+ #
1422
+ attr_reader :get_delivery_vehicle
1423
+ ##
1424
+ # RPC-specific configuration for `update_delivery_vehicle`
1425
+ # @return [::Gapic::Config::Method]
1426
+ #
1427
+ attr_reader :update_delivery_vehicle
1428
+ ##
1429
+ # RPC-specific configuration for `batch_create_tasks`
1430
+ # @return [::Gapic::Config::Method]
1431
+ #
1432
+ attr_reader :batch_create_tasks
1433
+ ##
1434
+ # RPC-specific configuration for `create_task`
1435
+ # @return [::Gapic::Config::Method]
1436
+ #
1437
+ attr_reader :create_task
1438
+ ##
1439
+ # RPC-specific configuration for `get_task`
1440
+ # @return [::Gapic::Config::Method]
1441
+ #
1442
+ attr_reader :get_task
1443
+ ##
1444
+ # RPC-specific configuration for `search_tasks`
1445
+ # @return [::Gapic::Config::Method]
1446
+ #
1447
+ attr_reader :search_tasks
1448
+ ##
1449
+ # RPC-specific configuration for `update_task`
1450
+ # @return [::Gapic::Config::Method]
1451
+ #
1452
+ attr_reader :update_task
1453
+ ##
1454
+ # RPC-specific configuration for `list_tasks`
1455
+ # @return [::Gapic::Config::Method]
1456
+ #
1457
+ attr_reader :list_tasks
1458
+ ##
1459
+ # RPC-specific configuration for `get_task_tracking_info`
1460
+ # @return [::Gapic::Config::Method]
1461
+ #
1462
+ attr_reader :get_task_tracking_info
1463
+ ##
1464
+ # RPC-specific configuration for `list_delivery_vehicles`
1465
+ # @return [::Gapic::Config::Method]
1466
+ #
1467
+ attr_reader :list_delivery_vehicles
1468
+
1469
+ # @private
1470
+ def initialize parent_rpcs = nil
1471
+ create_delivery_vehicle_config = parent_rpcs.create_delivery_vehicle if parent_rpcs.respond_to? :create_delivery_vehicle
1472
+ @create_delivery_vehicle = ::Gapic::Config::Method.new create_delivery_vehicle_config
1473
+ get_delivery_vehicle_config = parent_rpcs.get_delivery_vehicle if parent_rpcs.respond_to? :get_delivery_vehicle
1474
+ @get_delivery_vehicle = ::Gapic::Config::Method.new get_delivery_vehicle_config
1475
+ update_delivery_vehicle_config = parent_rpcs.update_delivery_vehicle if parent_rpcs.respond_to? :update_delivery_vehicle
1476
+ @update_delivery_vehicle = ::Gapic::Config::Method.new update_delivery_vehicle_config
1477
+ batch_create_tasks_config = parent_rpcs.batch_create_tasks if parent_rpcs.respond_to? :batch_create_tasks
1478
+ @batch_create_tasks = ::Gapic::Config::Method.new batch_create_tasks_config
1479
+ create_task_config = parent_rpcs.create_task if parent_rpcs.respond_to? :create_task
1480
+ @create_task = ::Gapic::Config::Method.new create_task_config
1481
+ get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task
1482
+ @get_task = ::Gapic::Config::Method.new get_task_config
1483
+ search_tasks_config = parent_rpcs.search_tasks if parent_rpcs.respond_to? :search_tasks
1484
+ @search_tasks = ::Gapic::Config::Method.new search_tasks_config
1485
+ update_task_config = parent_rpcs.update_task if parent_rpcs.respond_to? :update_task
1486
+ @update_task = ::Gapic::Config::Method.new update_task_config
1487
+ list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks
1488
+ @list_tasks = ::Gapic::Config::Method.new list_tasks_config
1489
+ get_task_tracking_info_config = parent_rpcs.get_task_tracking_info if parent_rpcs.respond_to? :get_task_tracking_info
1490
+ @get_task_tracking_info = ::Gapic::Config::Method.new get_task_tracking_info_config
1491
+ list_delivery_vehicles_config = parent_rpcs.list_delivery_vehicles if parent_rpcs.respond_to? :list_delivery_vehicles
1492
+ @list_delivery_vehicles = ::Gapic::Config::Method.new list_delivery_vehicles_config
1493
+
1494
+ yield self if block_given?
1495
+ end
1496
+ end
1497
+ end
1498
+ end
1499
+ end
1500
+ end
1501
+ end
1502
+ end
1503
+ end
1504
+ end
1505
+ end