google-maps-fleet_engine-v1 0.a → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) 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/v1/rest.rb +38 -0
  6. data/lib/google/maps/fleet_engine/v1/trip_service/client.rb +1004 -0
  7. data/lib/google/maps/fleet_engine/v1/trip_service/credentials.rb +47 -0
  8. data/lib/google/maps/fleet_engine/v1/trip_service/paths.rb +50 -0
  9. data/lib/google/maps/fleet_engine/v1/trip_service/rest/client.rb +938 -0
  10. data/lib/google/maps/fleet_engine/v1/trip_service/rest/service_stub.rb +368 -0
  11. data/lib/google/maps/fleet_engine/v1/trip_service/rest.rb +52 -0
  12. data/lib/google/maps/fleet_engine/v1/trip_service.rb +55 -0
  13. data/lib/google/maps/fleet_engine/v1/vehicle_service/client.rb +1314 -0
  14. data/lib/google/maps/fleet_engine/v1/vehicle_service/credentials.rb +47 -0
  15. data/lib/google/maps/fleet_engine/v1/vehicle_service/paths.rb +50 -0
  16. data/lib/google/maps/fleet_engine/v1/vehicle_service/rest/client.rb +1240 -0
  17. data/lib/google/maps/fleet_engine/v1/vehicle_service/rest/service_stub.rb +427 -0
  18. data/lib/google/maps/fleet_engine/v1/vehicle_service/rest.rb +52 -0
  19. data/lib/google/maps/fleet_engine/v1/vehicle_service.rb +55 -0
  20. data/lib/google/maps/fleet_engine/v1/version.rb +8 -3
  21. data/lib/google/maps/fleet_engine/v1.rb +46 -0
  22. data/lib/google/maps/fleetengine/v1/fleetengine_pb.rb +63 -0
  23. data/lib/google/maps/fleetengine/v1/header_pb.rb +46 -0
  24. data/lib/google/maps/fleetengine/v1/traffic_pb.rb +44 -0
  25. data/lib/google/maps/fleetengine/v1/trip_api_pb.rb +66 -0
  26. data/lib/google/maps/fleetengine/v1/trip_api_services_pb.rb +53 -0
  27. data/lib/google/maps/fleetengine/v1/trips_pb.rb +61 -0
  28. data/lib/google/maps/fleetengine/v1/vehicle_api_pb.rb +80 -0
  29. data/lib/google/maps/fleetengine/v1/vehicle_api_services_pb.rb +103 -0
  30. data/lib/google/maps/fleetengine/v1/vehicles_pb.rb +64 -0
  31. data/lib/google-maps-fleet_engine-v1.rb +21 -0
  32. data/proto_docs/README.md +4 -0
  33. data/proto_docs/google/api/client.rb +399 -0
  34. data/proto_docs/google/api/field_behavior.rb +85 -0
  35. data/proto_docs/google/api/launch_stage.rb +71 -0
  36. data/proto_docs/google/api/resource.rb +222 -0
  37. data/proto_docs/google/api/routing.rb +459 -0
  38. data/proto_docs/google/geo/type/viewport.rb +70 -0
  39. data/proto_docs/google/maps/fleetengine/v1/fleetengine.rb +342 -0
  40. data/proto_docs/google/maps/fleetengine/v1/header.rb +111 -0
  41. data/proto_docs/google/maps/fleetengine/v1/traffic.rb +76 -0
  42. data/proto_docs/google/maps/fleetengine/v1/trip_api.rb +296 -0
  43. data/proto_docs/google/maps/fleetengine/v1/trips.rb +286 -0
  44. data/proto_docs/google/maps/fleetengine/v1/vehicle_api.rb +659 -0
  45. data/proto_docs/google/maps/fleetengine/v1/vehicles.rb +358 -0
  46. data/proto_docs/google/protobuf/duration.rb +98 -0
  47. data/proto_docs/google/protobuf/empty.rb +34 -0
  48. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  49. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  50. data/proto_docs/google/protobuf/wrappers.rb +121 -0
  51. data/proto_docs/google/type/latlng.rb +38 -0
  52. metadata +119 -13
@@ -0,0 +1,1004 @@
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/v1/trip_api_pb"
21
+
22
+ module Google
23
+ module Maps
24
+ module FleetEngine
25
+ module V1
26
+ module TripService
27
+ ##
28
+ # Client for the TripService service.
29
+ #
30
+ # Trip management service.
31
+ #
32
+ class Client
33
+ # @private
34
+ API_VERSION = ""
35
+
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "fleetengine.$UNIVERSE_DOMAIN$"
38
+
39
+ include Paths
40
+
41
+ # @private
42
+ attr_reader :trip_service_stub
43
+
44
+ ##
45
+ # Configure the TripService Client class.
46
+ #
47
+ # See {::Google::Maps::FleetEngine::V1::TripService::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all TripService clients
53
+ # ::Google::Maps::FleetEngine::V1::TripService::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", "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_trip.timeout = 15.0
74
+ default_config.rpcs.create_trip.retry_policy = {
75
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
76
+ }
77
+
78
+ default_config.rpcs.get_trip.timeout = 15.0
79
+ default_config.rpcs.get_trip.retry_policy = {
80
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
81
+ }
82
+
83
+ default_config.rpcs.search_trips.timeout = 15.0
84
+ default_config.rpcs.search_trips.retry_policy = {
85
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
86
+ }
87
+
88
+ default_config.rpcs.update_trip.timeout = 15.0
89
+ default_config.rpcs.update_trip.retry_policy = {
90
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
91
+ }
92
+
93
+ default_config
94
+ end
95
+ yield @configure if block_given?
96
+ @configure
97
+ end
98
+
99
+ ##
100
+ # Configure the TripService Client instance.
101
+ #
102
+ # The configuration is set to the derived mode, meaning that values can be changed,
103
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
104
+ # should be made on {Client.configure}.
105
+ #
106
+ # See {::Google::Maps::FleetEngine::V1::TripService::Client::Configuration}
107
+ # for a description of the configuration fields.
108
+ #
109
+ # @yield [config] Configure the Client client.
110
+ # @yieldparam config [Client::Configuration]
111
+ #
112
+ # @return [Client::Configuration]
113
+ #
114
+ def configure
115
+ yield @config if block_given?
116
+ @config
117
+ end
118
+
119
+ ##
120
+ # The effective universe domain
121
+ #
122
+ # @return [String]
123
+ #
124
+ def universe_domain
125
+ @trip_service_stub.universe_domain
126
+ end
127
+
128
+ ##
129
+ # Create a new TripService client object.
130
+ #
131
+ # @example
132
+ #
133
+ # # Create a client using the default configuration
134
+ # client = ::Google::Maps::FleetEngine::V1::TripService::Client.new
135
+ #
136
+ # # Create a client using a custom configuration
137
+ # client = ::Google::Maps::FleetEngine::V1::TripService::Client.new do |config|
138
+ # config.timeout = 10.0
139
+ # end
140
+ #
141
+ # @yield [config] Configure the TripService client.
142
+ # @yieldparam config [Client::Configuration]
143
+ #
144
+ def initialize
145
+ # These require statements are intentionally placed here to initialize
146
+ # the gRPC module only when it's required.
147
+ # See https://github.com/googleapis/toolkit/issues/446
148
+ require "gapic/grpc"
149
+ require "google/maps/fleetengine/v1/trip_api_services_pb"
150
+
151
+ # Create the configuration object
152
+ @config = Configuration.new Client.configure
153
+
154
+ # Yield the configuration if needed
155
+ yield @config if block_given?
156
+
157
+ # Create credentials
158
+ credentials = @config.credentials
159
+ # Use self-signed JWT if the endpoint is unchanged from default,
160
+ # but only if the default endpoint does not have a region prefix.
161
+ enable_self_signed_jwt = @config.endpoint.nil? ||
162
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
163
+ !@config.endpoint.split(".").first.include?("-"))
164
+ credentials ||= Credentials.default scope: @config.scope,
165
+ enable_self_signed_jwt: enable_self_signed_jwt
166
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
167
+ credentials = Credentials.new credentials, scope: @config.scope
168
+ end
169
+ @quota_project_id = @config.quota_project
170
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
171
+
172
+ @trip_service_stub = ::Gapic::ServiceStub.new(
173
+ ::Google::Maps::FleetEngine::V1::TripService::Stub,
174
+ credentials: credentials,
175
+ endpoint: @config.endpoint,
176
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
177
+ universe_domain: @config.universe_domain,
178
+ channel_args: @config.channel_args,
179
+ interceptors: @config.interceptors,
180
+ channel_pool_config: @config.channel_pool
181
+ )
182
+ end
183
+
184
+ # Service calls
185
+
186
+ ##
187
+ # Creates a trip in the Fleet Engine and returns the new trip.
188
+ #
189
+ # @overload create_trip(request, options = nil)
190
+ # Pass arguments to `create_trip` via a request object, either of type
191
+ # {::Google::Maps::FleetEngine::V1::CreateTripRequest} or an equivalent Hash.
192
+ #
193
+ # @param request [::Google::Maps::FleetEngine::V1::CreateTripRequest, ::Hash]
194
+ # A request object representing the call parameters. Required. To specify no
195
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
196
+ # @param options [::Gapic::CallOptions, ::Hash]
197
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
198
+ #
199
+ # @overload create_trip(header: nil, parent: nil, trip_id: nil, trip: nil)
200
+ # Pass arguments to `create_trip` via keyword arguments. Note that at
201
+ # least one keyword argument is required. To specify no parameters, or to keep all
202
+ # the default parameter values, pass an empty Hash as a request object (see above).
203
+ #
204
+ # @param header [::Google::Maps::FleetEngine::V1::RequestHeader, ::Hash]
205
+ # The standard Fleet Engine request header.
206
+ # @param parent [::String]
207
+ # Required. Must be in the format `providers/{provider}`.
208
+ # The provider must be the Project ID (for example, `sample-cloud-project`)
209
+ # of the Google Cloud Project of which the service account making
210
+ # this call is a member.
211
+ # @param trip_id [::String]
212
+ # Required. Unique Trip ID.
213
+ # Subject to the following restrictions:
214
+ #
215
+ # * Must be a valid Unicode string.
216
+ # * Limited to a maximum length of 64 characters.
217
+ # * Normalized according to [Unicode Normalization Form C]
218
+ # (http://www.unicode.org/reports/tr15/).
219
+ # * May not contain any of the following ASCII characters: '/', ':', '?',
220
+ # ',', or '#'.
221
+ # @param trip [::Google::Maps::FleetEngine::V1::Trip, ::Hash]
222
+ # Required. Trip entity to create.
223
+ #
224
+ # When creating a Trip, the following fields are required:
225
+ #
226
+ # * `trip_type`
227
+ # * `pickup_point`
228
+ #
229
+ # The following fields are used if you provide them:
230
+ #
231
+ # * `number_of_passengers`
232
+ # * `vehicle_id`
233
+ # * `dropoff_point`
234
+ # * `intermediate_destinations`
235
+ # * `vehicle_waypoints`
236
+ #
237
+ # All other Trip fields are ignored. For example, all trips start with a
238
+ # `trip_status` of `NEW` even if you pass in a `trip_status` of `CANCELED` in
239
+ # the creation request.
240
+ #
241
+ # Only `EXCLUSIVE` trips support `intermediate_destinations`.
242
+ #
243
+ # When `vehicle_id` is set for a shared trip, you must supply
244
+ # the list of `Trip.vehicle_waypoints` to specify the order of the remaining
245
+ # waypoints for the vehicle, otherwise the waypoint order will be
246
+ # undetermined.
247
+ #
248
+ # When you specify `Trip.vehicle_waypoints`, the list must contain all
249
+ # the remaining waypoints of the vehicle's trips, with no extra waypoints.
250
+ # You must order these waypoints such that for a given trip, the pickup
251
+ # point is before intermediate destinations, and all intermediate
252
+ # destinations come before the drop-off point. An `EXCLUSIVE` trip's
253
+ # waypoints must not interleave with any other trips.
254
+ #
255
+ # The `trip_id`, `waypoint_type` and `location` fields are used, and all
256
+ # other TripWaypoint fields in `vehicle_waypoints` are ignored.
257
+ #
258
+ # @yield [response, operation] Access the result along with the RPC operation
259
+ # @yieldparam response [::Google::Maps::FleetEngine::V1::Trip]
260
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
261
+ #
262
+ # @return [::Google::Maps::FleetEngine::V1::Trip]
263
+ #
264
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
265
+ #
266
+ # @example Basic example
267
+ # require "google/maps/fleet_engine/v1"
268
+ #
269
+ # # Create a client object. The client can be reused for multiple calls.
270
+ # client = Google::Maps::FleetEngine::V1::TripService::Client.new
271
+ #
272
+ # # Create a request. To set request fields, pass in keyword arguments.
273
+ # request = Google::Maps::FleetEngine::V1::CreateTripRequest.new
274
+ #
275
+ # # Call the create_trip method.
276
+ # result = client.create_trip request
277
+ #
278
+ # # The returned object is of type Google::Maps::FleetEngine::V1::Trip.
279
+ # p result
280
+ #
281
+ def create_trip request, options = nil
282
+ raise ::ArgumentError, "request must be provided" if request.nil?
283
+
284
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::FleetEngine::V1::CreateTripRequest
285
+
286
+ # Converts hash and nil to an options object
287
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
288
+
289
+ # Customize the options with defaults
290
+ metadata = @config.rpcs.create_trip.metadata.to_h
291
+
292
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
293
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
294
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
295
+ gapic_version: ::Google::Maps::FleetEngine::V1::VERSION
296
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
297
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
298
+
299
+ header_params = {}
300
+ if request.parent &&
301
+ %r{^providers/[^/]+/?$}.match?(request.parent)
302
+ header_params["provider_id"] = request.parent
303
+ end
304
+
305
+ request_params_header = URI.encode_www_form header_params
306
+ metadata[:"x-goog-request-params"] ||= request_params_header
307
+
308
+ options.apply_defaults timeout: @config.rpcs.create_trip.timeout,
309
+ metadata: metadata,
310
+ retry_policy: @config.rpcs.create_trip.retry_policy
311
+
312
+ options.apply_defaults timeout: @config.timeout,
313
+ metadata: @config.metadata,
314
+ retry_policy: @config.retry_policy
315
+
316
+ @trip_service_stub.call_rpc :create_trip, request, options: options do |response, operation|
317
+ yield response, operation if block_given?
318
+ return response
319
+ end
320
+ rescue ::GRPC::BadStatus => e
321
+ raise ::Google::Cloud::Error.from_error(e)
322
+ end
323
+
324
+ ##
325
+ # Get information about a single trip.
326
+ #
327
+ # @overload get_trip(request, options = nil)
328
+ # Pass arguments to `get_trip` via a request object, either of type
329
+ # {::Google::Maps::FleetEngine::V1::GetTripRequest} or an equivalent Hash.
330
+ #
331
+ # @param request [::Google::Maps::FleetEngine::V1::GetTripRequest, ::Hash]
332
+ # A request object representing the call parameters. Required. To specify no
333
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
334
+ # @param options [::Gapic::CallOptions, ::Hash]
335
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
336
+ #
337
+ # @overload get_trip(header: nil, name: nil, view: nil, current_route_segment_version: nil, remaining_waypoints_version: nil, route_format_type: nil, current_route_segment_traffic_version: nil, remaining_waypoints_route_version: nil)
338
+ # Pass arguments to `get_trip` via keyword arguments. Note that at
339
+ # least one keyword argument is required. To specify no parameters, or to keep all
340
+ # the default parameter values, pass an empty Hash as a request object (see above).
341
+ #
342
+ # @param header [::Google::Maps::FleetEngine::V1::RequestHeader, ::Hash]
343
+ # The standard Fleet Engine request header.
344
+ # @param name [::String]
345
+ # Required. Must be in the format `providers/{provider}/trips/{trip}`.
346
+ # The provider must be the Project ID (for example, `sample-cloud-project`)
347
+ # of the Google Cloud Project of which the service account making
348
+ # this call is a member.
349
+ # @param view [::Google::Maps::FleetEngine::V1::TripView]
350
+ # The subset of Trip fields that should be returned and their interpretation.
351
+ # @param current_route_segment_version [::Google::Protobuf::Timestamp, ::Hash]
352
+ # Indicates the minimum timestamp (exclusive) for which `Trip.route` or
353
+ # `Trip.current_route_segment` data are retrieved. If route data are
354
+ # unchanged since this timestamp, the route field is not set in the response.
355
+ # If a minimum is unspecified, the route data are always retrieved.
356
+ # @param remaining_waypoints_version [::Google::Protobuf::Timestamp, ::Hash]
357
+ # Indicates the minimum timestamp (exclusive) for which
358
+ # `Trip.remaining_waypoints` are retrieved. If they are unchanged since this
359
+ # timestamp, the `remaining_waypoints` are not set in the response. If this
360
+ # field is unspecified, `remaining_waypoints` is always retrieved.
361
+ # @param route_format_type [::Google::Maps::FleetEngine::V1::PolylineFormatType]
362
+ # The returned current route format, `LAT_LNG_LIST_TYPE` (in `Trip.route`),
363
+ # or `ENCODED_POLYLINE_TYPE` (in `Trip.current_route_segment`). The default
364
+ # is `LAT_LNG_LIST_TYPE`.
365
+ # @param current_route_segment_traffic_version [::Google::Protobuf::Timestamp, ::Hash]
366
+ # Indicates the minimum timestamp (exclusive) for which
367
+ # `Trip.current_route_segment_traffic` is retrieved. If traffic data are
368
+ # unchanged since this timestamp, the `current_route_segment_traffic` field
369
+ # is not set in the response. If a minimum is unspecified, the traffic data
370
+ # are always retrieved. Note that traffic is only available for On-Demand
371
+ # Rides and Deliveries Solution customers.
372
+ # @param remaining_waypoints_route_version [::Google::Protobuf::Timestamp, ::Hash]
373
+ # Indicates the minimum timestamp (exclusive) for which
374
+ # `Trip.remaining_waypoints.traffic_to_waypoint` and
375
+ # `Trip.remaining_waypoints.path_to_waypoint` data are retrieved. If data are
376
+ # unchanged since this timestamp, the fields above are
377
+ # not set in the response. If `remaining_waypoints_route_version` is
378
+ # unspecified, traffic and path are always retrieved.
379
+ #
380
+ # @yield [response, operation] Access the result along with the RPC operation
381
+ # @yieldparam response [::Google::Maps::FleetEngine::V1::Trip]
382
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
383
+ #
384
+ # @return [::Google::Maps::FleetEngine::V1::Trip]
385
+ #
386
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
387
+ #
388
+ # @example Basic example
389
+ # require "google/maps/fleet_engine/v1"
390
+ #
391
+ # # Create a client object. The client can be reused for multiple calls.
392
+ # client = Google::Maps::FleetEngine::V1::TripService::Client.new
393
+ #
394
+ # # Create a request. To set request fields, pass in keyword arguments.
395
+ # request = Google::Maps::FleetEngine::V1::GetTripRequest.new
396
+ #
397
+ # # Call the get_trip method.
398
+ # result = client.get_trip request
399
+ #
400
+ # # The returned object is of type Google::Maps::FleetEngine::V1::Trip.
401
+ # p result
402
+ #
403
+ def get_trip request, options = nil
404
+ raise ::ArgumentError, "request must be provided" if request.nil?
405
+
406
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::FleetEngine::V1::GetTripRequest
407
+
408
+ # Converts hash and nil to an options object
409
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
410
+
411
+ # Customize the options with defaults
412
+ metadata = @config.rpcs.get_trip.metadata.to_h
413
+
414
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
415
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
416
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
417
+ gapic_version: ::Google::Maps::FleetEngine::V1::VERSION
418
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
419
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
420
+
421
+ header_params = {}
422
+ if request.name &&
423
+ %r{^providers/[^/]+/?$}.match?(request.name)
424
+ header_params["provider_id"] = request.name
425
+ end
426
+
427
+ request_params_header = URI.encode_www_form header_params
428
+ metadata[:"x-goog-request-params"] ||= request_params_header
429
+
430
+ options.apply_defaults timeout: @config.rpcs.get_trip.timeout,
431
+ metadata: metadata,
432
+ retry_policy: @config.rpcs.get_trip.retry_policy
433
+
434
+ options.apply_defaults timeout: @config.timeout,
435
+ metadata: @config.metadata,
436
+ retry_policy: @config.retry_policy
437
+
438
+ @trip_service_stub.call_rpc :get_trip, request, options: options do |response, operation|
439
+ yield response, operation if block_given?
440
+ return response
441
+ end
442
+ rescue ::GRPC::BadStatus => e
443
+ raise ::Google::Cloud::Error.from_error(e)
444
+ end
445
+
446
+ ##
447
+ # Report billable trip usage.
448
+ #
449
+ # @overload report_billable_trip(request, options = nil)
450
+ # Pass arguments to `report_billable_trip` via a request object, either of type
451
+ # {::Google::Maps::FleetEngine::V1::ReportBillableTripRequest} or an equivalent Hash.
452
+ #
453
+ # @param request [::Google::Maps::FleetEngine::V1::ReportBillableTripRequest, ::Hash]
454
+ # A request object representing the call parameters. Required. To specify no
455
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
456
+ # @param options [::Gapic::CallOptions, ::Hash]
457
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
458
+ #
459
+ # @overload report_billable_trip(name: nil, country_code: nil, platform: nil, related_ids: nil, solution_type: nil)
460
+ # Pass arguments to `report_billable_trip` via keyword arguments. Note that at
461
+ # least one keyword argument is required. To specify no parameters, or to keep all
462
+ # the default parameter values, pass an empty Hash as a request object (see above).
463
+ #
464
+ # @param name [::String]
465
+ # Required. Must be in the format
466
+ # `providers/{provider}/billableTrips/{billable_trip}`. The
467
+ # provider must be the Project ID (for example, `sample-cloud-project`) of
468
+ # the Google Cloud Project of which the service account making this call is a
469
+ # member.
470
+ # @param country_code [::String]
471
+ # Required. Two letter country code of the country where the trip takes
472
+ # place. Price is defined according to country code.
473
+ # @param platform [::Google::Maps::FleetEngine::V1::BillingPlatformIdentifier]
474
+ # The platform upon which the request was issued.
475
+ # @param related_ids [::Array<::String>]
476
+ # The identifiers that are directly related to the trip being reported. These
477
+ # are usually IDs (for example, session IDs) of pre-booking operations done
478
+ # before the trip ID is available. The number of `related_ids` is
479
+ # limited to 50.
480
+ # @param solution_type [::Google::Maps::FleetEngine::V1::ReportBillableTripRequest::SolutionType]
481
+ # The type of GMP product solution (for example,
482
+ # `ON_DEMAND_RIDESHARING_AND_DELIVERIES`) used for the reported trip.
483
+ #
484
+ # @yield [response, operation] Access the result along with the RPC operation
485
+ # @yieldparam response [::Google::Protobuf::Empty]
486
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
487
+ #
488
+ # @return [::Google::Protobuf::Empty]
489
+ #
490
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
491
+ #
492
+ # @example Basic example
493
+ # require "google/maps/fleet_engine/v1"
494
+ #
495
+ # # Create a client object. The client can be reused for multiple calls.
496
+ # client = Google::Maps::FleetEngine::V1::TripService::Client.new
497
+ #
498
+ # # Create a request. To set request fields, pass in keyword arguments.
499
+ # request = Google::Maps::FleetEngine::V1::ReportBillableTripRequest.new
500
+ #
501
+ # # Call the report_billable_trip method.
502
+ # result = client.report_billable_trip request
503
+ #
504
+ # # The returned object is of type Google::Protobuf::Empty.
505
+ # p result
506
+ #
507
+ def report_billable_trip request, options = nil
508
+ raise ::ArgumentError, "request must be provided" if request.nil?
509
+
510
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::FleetEngine::V1::ReportBillableTripRequest
511
+
512
+ # Converts hash and nil to an options object
513
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
514
+
515
+ # Customize the options with defaults
516
+ metadata = @config.rpcs.report_billable_trip.metadata.to_h
517
+
518
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
519
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
520
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
521
+ gapic_version: ::Google::Maps::FleetEngine::V1::VERSION
522
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
523
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
524
+
525
+ header_params = {}
526
+ if request.name &&
527
+ %r{^providers/[^/]+/?$}.match?(request.name)
528
+ header_params["provider_id"] = request.name
529
+ end
530
+
531
+ request_params_header = URI.encode_www_form header_params
532
+ metadata[:"x-goog-request-params"] ||= request_params_header
533
+
534
+ options.apply_defaults timeout: @config.rpcs.report_billable_trip.timeout,
535
+ metadata: metadata,
536
+ retry_policy: @config.rpcs.report_billable_trip.retry_policy
537
+
538
+ options.apply_defaults timeout: @config.timeout,
539
+ metadata: @config.metadata,
540
+ retry_policy: @config.retry_policy
541
+
542
+ @trip_service_stub.call_rpc :report_billable_trip, request, options: options do |response, operation|
543
+ yield response, operation if block_given?
544
+ return response
545
+ end
546
+ rescue ::GRPC::BadStatus => e
547
+ raise ::Google::Cloud::Error.from_error(e)
548
+ end
549
+
550
+ ##
551
+ # Get all the trips for a specific vehicle.
552
+ #
553
+ # @overload search_trips(request, options = nil)
554
+ # Pass arguments to `search_trips` via a request object, either of type
555
+ # {::Google::Maps::FleetEngine::V1::SearchTripsRequest} or an equivalent Hash.
556
+ #
557
+ # @param request [::Google::Maps::FleetEngine::V1::SearchTripsRequest, ::Hash]
558
+ # A request object representing the call parameters. Required. To specify no
559
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
560
+ # @param options [::Gapic::CallOptions, ::Hash]
561
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
562
+ #
563
+ # @overload search_trips(header: nil, parent: nil, vehicle_id: nil, active_trips_only: nil, page_size: nil, page_token: nil, minimum_staleness: nil)
564
+ # Pass arguments to `search_trips` via keyword arguments. Note that at
565
+ # least one keyword argument is required. To specify no parameters, or to keep all
566
+ # the default parameter values, pass an empty Hash as a request object (see above).
567
+ #
568
+ # @param header [::Google::Maps::FleetEngine::V1::RequestHeader, ::Hash]
569
+ # The standard Fleet Engine request header.
570
+ # @param parent [::String]
571
+ # Required. Must be in the format `providers/{provider}`.
572
+ # The provider must be the Project ID (for example, `sample-cloud-project`)
573
+ # of the Google Cloud Project of which the service account making
574
+ # this call is a member.
575
+ # @param vehicle_id [::String]
576
+ # The vehicle associated with the trips in the request. If unspecified, the
577
+ # returned trips do not contain:
578
+ #
579
+ # * `current_route_segment`
580
+ # * `remaining_waypoints`
581
+ # * `remaining_distance_meters`
582
+ # * `eta_to_first_waypoint`
583
+ # @param active_trips_only [::Boolean]
584
+ # If set to true, the response includes Trips that influence a driver's
585
+ # route.
586
+ # @param page_size [::Integer]
587
+ # If not set, the server decides the number of results to return.
588
+ # @param page_token [::String]
589
+ # Set this to a value previously returned in the `SearchTripsResponse` to
590
+ # continue from previous results.
591
+ # @param minimum_staleness [::Google::Protobuf::Duration, ::Hash]
592
+ # If specified, returns the trips that have not been updated after the time
593
+ # `(current - minimum_staleness)`.
594
+ #
595
+ # @yield [response, operation] Access the result along with the RPC operation
596
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Maps::FleetEngine::V1::Trip>]
597
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
598
+ #
599
+ # @return [::Gapic::PagedEnumerable<::Google::Maps::FleetEngine::V1::Trip>]
600
+ #
601
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
602
+ #
603
+ # @example Basic example
604
+ # require "google/maps/fleet_engine/v1"
605
+ #
606
+ # # Create a client object. The client can be reused for multiple calls.
607
+ # client = Google::Maps::FleetEngine::V1::TripService::Client.new
608
+ #
609
+ # # Create a request. To set request fields, pass in keyword arguments.
610
+ # request = Google::Maps::FleetEngine::V1::SearchTripsRequest.new
611
+ #
612
+ # # Call the search_trips method.
613
+ # result = client.search_trips request
614
+ #
615
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
616
+ # # over elements, and API calls will be issued to fetch pages as needed.
617
+ # result.each do |item|
618
+ # # Each element is of type ::Google::Maps::FleetEngine::V1::Trip.
619
+ # p item
620
+ # end
621
+ #
622
+ def search_trips request, options = nil
623
+ raise ::ArgumentError, "request must be provided" if request.nil?
624
+
625
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::FleetEngine::V1::SearchTripsRequest
626
+
627
+ # Converts hash and nil to an options object
628
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
629
+
630
+ # Customize the options with defaults
631
+ metadata = @config.rpcs.search_trips.metadata.to_h
632
+
633
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
634
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
635
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
636
+ gapic_version: ::Google::Maps::FleetEngine::V1::VERSION
637
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
638
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
639
+
640
+ header_params = {}
641
+ if request.parent &&
642
+ %r{^providers/[^/]+/?$}.match?(request.parent)
643
+ header_params["provider_id"] = request.parent
644
+ end
645
+
646
+ request_params_header = URI.encode_www_form header_params
647
+ metadata[:"x-goog-request-params"] ||= request_params_header
648
+
649
+ options.apply_defaults timeout: @config.rpcs.search_trips.timeout,
650
+ metadata: metadata,
651
+ retry_policy: @config.rpcs.search_trips.retry_policy
652
+
653
+ options.apply_defaults timeout: @config.timeout,
654
+ metadata: @config.metadata,
655
+ retry_policy: @config.retry_policy
656
+
657
+ @trip_service_stub.call_rpc :search_trips, request, options: options do |response, operation|
658
+ response = ::Gapic::PagedEnumerable.new @trip_service_stub, :search_trips, request, response, operation, options
659
+ yield response, operation if block_given?
660
+ return response
661
+ end
662
+ rescue ::GRPC::BadStatus => e
663
+ raise ::Google::Cloud::Error.from_error(e)
664
+ end
665
+
666
+ ##
667
+ # Updates trip data.
668
+ #
669
+ # @overload update_trip(request, options = nil)
670
+ # Pass arguments to `update_trip` via a request object, either of type
671
+ # {::Google::Maps::FleetEngine::V1::UpdateTripRequest} or an equivalent Hash.
672
+ #
673
+ # @param request [::Google::Maps::FleetEngine::V1::UpdateTripRequest, ::Hash]
674
+ # A request object representing the call parameters. Required. To specify no
675
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
676
+ # @param options [::Gapic::CallOptions, ::Hash]
677
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
678
+ #
679
+ # @overload update_trip(header: nil, name: nil, trip: nil, update_mask: nil)
680
+ # Pass arguments to `update_trip` via keyword arguments. Note that at
681
+ # least one keyword argument is required. To specify no parameters, or to keep all
682
+ # the default parameter values, pass an empty Hash as a request object (see above).
683
+ #
684
+ # @param header [::Google::Maps::FleetEngine::V1::RequestHeader, ::Hash]
685
+ # The standard Fleet Engine request header.
686
+ # @param name [::String]
687
+ # Required. Must be in the format
688
+ # `providers/{provider}/trips/{trip}`. The provider must
689
+ # be the Project ID (for example, `sample-consumer-project`) of the Google
690
+ # Cloud Project of which the service account making this call is a member.
691
+ # @param trip [::Google::Maps::FleetEngine::V1::Trip, ::Hash]
692
+ # Required. The Trip associated with the update.
693
+ #
694
+ # The following fields are maintained by the Fleet Engine. Do not update
695
+ # them using Trip.update.
696
+ #
697
+ # * `current_route_segment`
698
+ # * `current_route_segment_end_point`
699
+ # * `current_route_segment_traffic`
700
+ # * `current_route_segment_traffic_version`
701
+ # * `current_route_segment_version`
702
+ # * `dropoff_time`
703
+ # * `eta_to_next_waypoint`
704
+ # * `intermediate_destinations_version`
705
+ # * `last_location`
706
+ # * `name`
707
+ # * `number_of_passengers`
708
+ # * `pickup_time`
709
+ # * `remaining_distance_meters`
710
+ # * `remaining_time_to_first_waypoint`
711
+ # * `remaining_waypoints`
712
+ # * `remaining_waypoints_version`
713
+ # * `route`
714
+ #
715
+ # When you update the `Trip.vehicle_id` for a shared trip, you must supply
716
+ # the list of `Trip.vehicle_waypoints` to specify the order of the remaining
717
+ # waypoints, otherwise the order will be undetermined.
718
+ #
719
+ # When you specify `Trip.vehicle_waypoints`, the list must contain all
720
+ # the remaining waypoints of the vehicle's trips, with no extra waypoints.
721
+ # You must order these waypoints such that for a given trip, the pickup
722
+ # point is before intermediate destinations, and all intermediate
723
+ # destinations come before the drop-off point. An `EXCLUSIVE` trip's
724
+ # waypoints must not interleave with any other trips.
725
+ # The `trip_id`, `waypoint_type` and `location` fields are used, and all
726
+ # other TripWaypoint fields in `vehicle_waypoints` are ignored.
727
+ #
728
+ # To avoid a race condition for trips with multiple destinations, you
729
+ # should provide `Trip.intermediate_destinations_version` when updating
730
+ # the trip status to `ENROUTE_TO_INTERMEDIATE_DESTINATION`. The
731
+ # `Trip.intermediate_destinations_version` passed must be consistent with
732
+ # Fleet Engine's version. If it isn't, the request fails.
733
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
734
+ # Required. The field mask indicating which fields in Trip to update.
735
+ # The `update_mask` must contain at least one field.
736
+ #
737
+ # @yield [response, operation] Access the result along with the RPC operation
738
+ # @yieldparam response [::Google::Maps::FleetEngine::V1::Trip]
739
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
740
+ #
741
+ # @return [::Google::Maps::FleetEngine::V1::Trip]
742
+ #
743
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
744
+ #
745
+ # @example Basic example
746
+ # require "google/maps/fleet_engine/v1"
747
+ #
748
+ # # Create a client object. The client can be reused for multiple calls.
749
+ # client = Google::Maps::FleetEngine::V1::TripService::Client.new
750
+ #
751
+ # # Create a request. To set request fields, pass in keyword arguments.
752
+ # request = Google::Maps::FleetEngine::V1::UpdateTripRequest.new
753
+ #
754
+ # # Call the update_trip method.
755
+ # result = client.update_trip request
756
+ #
757
+ # # The returned object is of type Google::Maps::FleetEngine::V1::Trip.
758
+ # p result
759
+ #
760
+ def update_trip request, options = nil
761
+ raise ::ArgumentError, "request must be provided" if request.nil?
762
+
763
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::FleetEngine::V1::UpdateTripRequest
764
+
765
+ # Converts hash and nil to an options object
766
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
767
+
768
+ # Customize the options with defaults
769
+ metadata = @config.rpcs.update_trip.metadata.to_h
770
+
771
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
772
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
773
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
774
+ gapic_version: ::Google::Maps::FleetEngine::V1::VERSION
775
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
776
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
777
+
778
+ header_params = {}
779
+ if request.name &&
780
+ %r{^providers/[^/]+/?$}.match?(request.name)
781
+ header_params["provider_id"] = request.name
782
+ end
783
+
784
+ request_params_header = URI.encode_www_form header_params
785
+ metadata[:"x-goog-request-params"] ||= request_params_header
786
+
787
+ options.apply_defaults timeout: @config.rpcs.update_trip.timeout,
788
+ metadata: metadata,
789
+ retry_policy: @config.rpcs.update_trip.retry_policy
790
+
791
+ options.apply_defaults timeout: @config.timeout,
792
+ metadata: @config.metadata,
793
+ retry_policy: @config.retry_policy
794
+
795
+ @trip_service_stub.call_rpc :update_trip, request, options: options do |response, operation|
796
+ yield response, operation if block_given?
797
+ return response
798
+ end
799
+ rescue ::GRPC::BadStatus => e
800
+ raise ::Google::Cloud::Error.from_error(e)
801
+ end
802
+
803
+ ##
804
+ # Configuration class for the TripService API.
805
+ #
806
+ # This class represents the configuration for TripService,
807
+ # providing control over timeouts, retry behavior, logging, transport
808
+ # parameters, and other low-level controls. Certain parameters can also be
809
+ # applied individually to specific RPCs. See
810
+ # {::Google::Maps::FleetEngine::V1::TripService::Client::Configuration::Rpcs}
811
+ # for a list of RPCs that can be configured independently.
812
+ #
813
+ # Configuration can be applied globally to all clients, or to a single client
814
+ # on construction.
815
+ #
816
+ # @example
817
+ #
818
+ # # Modify the global config, setting the timeout for
819
+ # # create_trip to 20 seconds,
820
+ # # and all remaining timeouts to 10 seconds.
821
+ # ::Google::Maps::FleetEngine::V1::TripService::Client.configure do |config|
822
+ # config.timeout = 10.0
823
+ # config.rpcs.create_trip.timeout = 20.0
824
+ # end
825
+ #
826
+ # # Apply the above configuration only to a new client.
827
+ # client = ::Google::Maps::FleetEngine::V1::TripService::Client.new do |config|
828
+ # config.timeout = 10.0
829
+ # config.rpcs.create_trip.timeout = 20.0
830
+ # end
831
+ #
832
+ # @!attribute [rw] endpoint
833
+ # A custom service endpoint, as a hostname or hostname:port. The default is
834
+ # nil, indicating to use the default endpoint in the current universe domain.
835
+ # @return [::String,nil]
836
+ # @!attribute [rw] credentials
837
+ # Credentials to send with calls. You may provide any of the following types:
838
+ # * (`String`) The path to a service account key file in JSON format
839
+ # * (`Hash`) A service account key as a Hash
840
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
841
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
842
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
843
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
844
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
845
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
846
+ # * (`nil`) indicating no credentials
847
+ # @return [::Object]
848
+ # @!attribute [rw] scope
849
+ # The OAuth scopes
850
+ # @return [::Array<::String>]
851
+ # @!attribute [rw] lib_name
852
+ # The library name as recorded in instrumentation and logging
853
+ # @return [::String]
854
+ # @!attribute [rw] lib_version
855
+ # The library version as recorded in instrumentation and logging
856
+ # @return [::String]
857
+ # @!attribute [rw] channel_args
858
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
859
+ # `GRPC::Core::Channel` object is provided as the credential.
860
+ # @return [::Hash]
861
+ # @!attribute [rw] interceptors
862
+ # An array of interceptors that are run before calls are executed.
863
+ # @return [::Array<::GRPC::ClientInterceptor>]
864
+ # @!attribute [rw] timeout
865
+ # The call timeout in seconds.
866
+ # @return [::Numeric]
867
+ # @!attribute [rw] metadata
868
+ # Additional gRPC headers to be sent with the call.
869
+ # @return [::Hash{::Symbol=>::String}]
870
+ # @!attribute [rw] retry_policy
871
+ # The retry policy. The value is a hash with the following keys:
872
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
873
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
874
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
875
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
876
+ # trigger a retry.
877
+ # @return [::Hash]
878
+ # @!attribute [rw] quota_project
879
+ # A separate project against which to charge quota.
880
+ # @return [::String]
881
+ # @!attribute [rw] universe_domain
882
+ # The universe domain within which to make requests. This determines the
883
+ # default endpoint URL. The default value of nil uses the environment
884
+ # universe (usually the default "googleapis.com" universe).
885
+ # @return [::String,nil]
886
+ #
887
+ class Configuration
888
+ extend ::Gapic::Config
889
+
890
+ # @private
891
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
892
+ DEFAULT_ENDPOINT = "fleetengine.googleapis.com"
893
+
894
+ config_attr :endpoint, nil, ::String, nil
895
+ config_attr :credentials, nil do |value|
896
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
897
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
898
+ allowed.any? { |klass| klass === value }
899
+ end
900
+ config_attr :scope, nil, ::String, ::Array, nil
901
+ config_attr :lib_name, nil, ::String, nil
902
+ config_attr :lib_version, nil, ::String, nil
903
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
904
+ config_attr :interceptors, nil, ::Array, nil
905
+ config_attr :timeout, nil, ::Numeric, nil
906
+ config_attr :metadata, nil, ::Hash, nil
907
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
908
+ config_attr :quota_project, nil, ::String, nil
909
+ config_attr :universe_domain, nil, ::String, nil
910
+
911
+ # @private
912
+ def initialize parent_config = nil
913
+ @parent_config = parent_config unless parent_config.nil?
914
+
915
+ yield self if block_given?
916
+ end
917
+
918
+ ##
919
+ # Configurations for individual RPCs
920
+ # @return [Rpcs]
921
+ #
922
+ def rpcs
923
+ @rpcs ||= begin
924
+ parent_rpcs = nil
925
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
926
+ Rpcs.new parent_rpcs
927
+ end
928
+ end
929
+
930
+ ##
931
+ # Configuration for the channel pool
932
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
933
+ #
934
+ def channel_pool
935
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
936
+ end
937
+
938
+ ##
939
+ # Configuration RPC class for the TripService API.
940
+ #
941
+ # Includes fields providing the configuration for each RPC in this service.
942
+ # Each configuration object is of type `Gapic::Config::Method` and includes
943
+ # the following configuration fields:
944
+ #
945
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
946
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
947
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
948
+ # include the following keys:
949
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
950
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
951
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
952
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
953
+ # trigger a retry.
954
+ #
955
+ class Rpcs
956
+ ##
957
+ # RPC-specific configuration for `create_trip`
958
+ # @return [::Gapic::Config::Method]
959
+ #
960
+ attr_reader :create_trip
961
+ ##
962
+ # RPC-specific configuration for `get_trip`
963
+ # @return [::Gapic::Config::Method]
964
+ #
965
+ attr_reader :get_trip
966
+ ##
967
+ # RPC-specific configuration for `report_billable_trip`
968
+ # @return [::Gapic::Config::Method]
969
+ #
970
+ attr_reader :report_billable_trip
971
+ ##
972
+ # RPC-specific configuration for `search_trips`
973
+ # @return [::Gapic::Config::Method]
974
+ #
975
+ attr_reader :search_trips
976
+ ##
977
+ # RPC-specific configuration for `update_trip`
978
+ # @return [::Gapic::Config::Method]
979
+ #
980
+ attr_reader :update_trip
981
+
982
+ # @private
983
+ def initialize parent_rpcs = nil
984
+ create_trip_config = parent_rpcs.create_trip if parent_rpcs.respond_to? :create_trip
985
+ @create_trip = ::Gapic::Config::Method.new create_trip_config
986
+ get_trip_config = parent_rpcs.get_trip if parent_rpcs.respond_to? :get_trip
987
+ @get_trip = ::Gapic::Config::Method.new get_trip_config
988
+ report_billable_trip_config = parent_rpcs.report_billable_trip if parent_rpcs.respond_to? :report_billable_trip
989
+ @report_billable_trip = ::Gapic::Config::Method.new report_billable_trip_config
990
+ search_trips_config = parent_rpcs.search_trips if parent_rpcs.respond_to? :search_trips
991
+ @search_trips = ::Gapic::Config::Method.new search_trips_config
992
+ update_trip_config = parent_rpcs.update_trip if parent_rpcs.respond_to? :update_trip
993
+ @update_trip = ::Gapic::Config::Method.new update_trip_config
994
+
995
+ yield self if block_given?
996
+ end
997
+ end
998
+ end
999
+ end
1000
+ end
1001
+ end
1002
+ end
1003
+ end
1004
+ end