google-maps-isochrones-v1 0.a → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +122 -0
- data/README.md +153 -8
- data/lib/google/maps/isochrones/v1/isochrone_service/client.rb +497 -0
- data/lib/google/maps/isochrones/v1/isochrone_service/credentials.rb +48 -0
- data/lib/google/maps/isochrones/v1/isochrone_service/paths.rb +47 -0
- data/lib/google/maps/isochrones/v1/isochrone_service/rest/client.rb +455 -0
- data/lib/google/maps/isochrones/v1/isochrone_service/rest/service_stub.rb +141 -0
- data/lib/google/maps/isochrones/v1/isochrone_service/rest.rb +53 -0
- data/lib/google/maps/isochrones/v1/isochrone_service.rb +56 -0
- data/lib/google/maps/isochrones/v1/isochrones_service_pb.rb +35 -0
- data/lib/google/maps/isochrones/v1/isochrones_service_services_pb.rb +46 -0
- data/lib/google/maps/isochrones/v1/rest.rb +37 -0
- data/lib/google/maps/isochrones/v1/version.rb +7 -2
- data/lib/google/maps/isochrones/v1.rb +45 -0
- data/lib/google-maps-isochrones-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +593 -0
- data/proto_docs/google/api/field_behavior.rb +85 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +227 -0
- data/proto_docs/google/maps/isochrones/v1/isochrones_service.rb +147 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/struct.rb +108 -0
- data/proto_docs/google/type/latlng.rb +38 -0
- metadata +58 -9
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 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/isochrones/v1/isochrones_service_pb"
|
|
21
|
+
|
|
22
|
+
module Google
|
|
23
|
+
module Maps
|
|
24
|
+
module Isochrones
|
|
25
|
+
module V1
|
|
26
|
+
module IsochroneService
|
|
27
|
+
##
|
|
28
|
+
# Client for the IsochroneService service.
|
|
29
|
+
#
|
|
30
|
+
# Service for calculating isochrones. An isochrone is an area of reachability
|
|
31
|
+
# from a given origin point within a specified travel time.
|
|
32
|
+
#
|
|
33
|
+
class Client
|
|
34
|
+
# @private
|
|
35
|
+
API_VERSION = ""
|
|
36
|
+
|
|
37
|
+
# @private
|
|
38
|
+
DEFAULT_ENDPOINT_TEMPLATE = "isochrones.$UNIVERSE_DOMAIN$"
|
|
39
|
+
|
|
40
|
+
include Paths
|
|
41
|
+
|
|
42
|
+
# @private
|
|
43
|
+
attr_reader :isochrone_service_stub
|
|
44
|
+
|
|
45
|
+
##
|
|
46
|
+
# Configure the IsochroneService Client class.
|
|
47
|
+
#
|
|
48
|
+
# See {::Google::Maps::Isochrones::V1::IsochroneService::Client::Configuration}
|
|
49
|
+
# for a description of the configuration fields.
|
|
50
|
+
#
|
|
51
|
+
# @example
|
|
52
|
+
#
|
|
53
|
+
# # Modify the configuration for all IsochroneService clients
|
|
54
|
+
# ::Google::Maps::Isochrones::V1::IsochroneService::Client.configure do |config|
|
|
55
|
+
# config.timeout = 10.0
|
|
56
|
+
# end
|
|
57
|
+
#
|
|
58
|
+
# @yield [config] Configure the Client client.
|
|
59
|
+
# @yieldparam config [Client::Configuration]
|
|
60
|
+
#
|
|
61
|
+
# @return [Client::Configuration]
|
|
62
|
+
#
|
|
63
|
+
def self.configure
|
|
64
|
+
@configure ||= begin
|
|
65
|
+
namespace = ["Google", "Maps", "Isochrones", "V1"]
|
|
66
|
+
parent_config = while namespace.any?
|
|
67
|
+
parent_name = namespace.join "::"
|
|
68
|
+
parent_const = const_get parent_name
|
|
69
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
|
70
|
+
namespace.pop
|
|
71
|
+
end
|
|
72
|
+
default_config = Client::Configuration.new parent_config
|
|
73
|
+
|
|
74
|
+
default_config.rpcs.generate_isochrone.timeout = 60.0
|
|
75
|
+
default_config.rpcs.generate_isochrone.retry_policy = {
|
|
76
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
default_config
|
|
80
|
+
end
|
|
81
|
+
yield @configure if block_given?
|
|
82
|
+
@configure
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
##
|
|
86
|
+
# Configure the IsochroneService Client instance.
|
|
87
|
+
#
|
|
88
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
|
89
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
|
90
|
+
# should be made on {Client.configure}.
|
|
91
|
+
#
|
|
92
|
+
# See {::Google::Maps::Isochrones::V1::IsochroneService::Client::Configuration}
|
|
93
|
+
# for a description of the configuration fields.
|
|
94
|
+
#
|
|
95
|
+
# @yield [config] Configure the Client client.
|
|
96
|
+
# @yieldparam config [Client::Configuration]
|
|
97
|
+
#
|
|
98
|
+
# @return [Client::Configuration]
|
|
99
|
+
#
|
|
100
|
+
def configure
|
|
101
|
+
yield @config if block_given?
|
|
102
|
+
@config
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
##
|
|
106
|
+
# The effective universe domain
|
|
107
|
+
#
|
|
108
|
+
# @return [String]
|
|
109
|
+
#
|
|
110
|
+
def universe_domain
|
|
111
|
+
@isochrone_service_stub.universe_domain
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
##
|
|
115
|
+
# Create a new IsochroneService client object.
|
|
116
|
+
#
|
|
117
|
+
# @example
|
|
118
|
+
#
|
|
119
|
+
# # Create a client using the default configuration
|
|
120
|
+
# client = ::Google::Maps::Isochrones::V1::IsochroneService::Client.new
|
|
121
|
+
#
|
|
122
|
+
# # Create a client using a custom configuration
|
|
123
|
+
# client = ::Google::Maps::Isochrones::V1::IsochroneService::Client.new do |config|
|
|
124
|
+
# config.timeout = 10.0
|
|
125
|
+
# end
|
|
126
|
+
#
|
|
127
|
+
# @yield [config] Configure the IsochroneService client.
|
|
128
|
+
# @yieldparam config [Client::Configuration]
|
|
129
|
+
#
|
|
130
|
+
def initialize
|
|
131
|
+
# These require statements are intentionally placed here to initialize
|
|
132
|
+
# the gRPC module only when it's required.
|
|
133
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
|
134
|
+
require "gapic/grpc"
|
|
135
|
+
require "google/maps/isochrones/v1/isochrones_service_services_pb"
|
|
136
|
+
|
|
137
|
+
# Create the configuration object
|
|
138
|
+
@config = Configuration.new Client.configure
|
|
139
|
+
|
|
140
|
+
# Yield the configuration if needed
|
|
141
|
+
yield @config if block_given?
|
|
142
|
+
|
|
143
|
+
# Create credentials
|
|
144
|
+
credentials = @config.credentials
|
|
145
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
|
146
|
+
# but only if the default endpoint does not have a region prefix.
|
|
147
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
|
148
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
|
149
|
+
!@config.endpoint.split(".").first.include?("-"))
|
|
150
|
+
credentials ||= Credentials.default scope: @config.scope,
|
|
151
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
|
152
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
|
153
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
|
154
|
+
end
|
|
155
|
+
@quota_project_id = @config.quota_project
|
|
156
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
|
157
|
+
|
|
158
|
+
@isochrone_service_stub = ::Gapic::ServiceStub.new(
|
|
159
|
+
::Google::Maps::Isochrones::V1::IsochroneService::Stub,
|
|
160
|
+
credentials: credentials,
|
|
161
|
+
endpoint: @config.endpoint,
|
|
162
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
|
163
|
+
universe_domain: @config.universe_domain,
|
|
164
|
+
channel_args: @config.channel_args,
|
|
165
|
+
interceptors: @config.interceptors,
|
|
166
|
+
channel_pool_config: @config.channel_pool,
|
|
167
|
+
logger: @config.logger
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
@isochrone_service_stub.stub_logger&.info do |entry|
|
|
171
|
+
entry.set_system_name
|
|
172
|
+
entry.set_service
|
|
173
|
+
entry.message = "Created client for #{entry.service}"
|
|
174
|
+
entry.set_credentials_fields credentials
|
|
175
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
|
176
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
|
177
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
##
|
|
182
|
+
# The logger used for request/response debug logging.
|
|
183
|
+
#
|
|
184
|
+
# @return [Logger]
|
|
185
|
+
#
|
|
186
|
+
def logger
|
|
187
|
+
@isochrone_service_stub.logger
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Service calls
|
|
191
|
+
|
|
192
|
+
##
|
|
193
|
+
# Calculates and returns a single isochrone for a given set of parameters.
|
|
194
|
+
#
|
|
195
|
+
# @overload generate_isochrone(request, options = nil)
|
|
196
|
+
# Pass arguments to `generate_isochrone` via a request object, either of type
|
|
197
|
+
# {::Google::Maps::Isochrones::V1::GenerateIsochroneRequest} or an equivalent Hash.
|
|
198
|
+
#
|
|
199
|
+
# @param request [::Google::Maps::Isochrones::V1::GenerateIsochroneRequest, ::Hash]
|
|
200
|
+
# A request object representing the call parameters. Required. To specify no
|
|
201
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
202
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
203
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
204
|
+
#
|
|
205
|
+
# @overload generate_isochrone(location: nil, place: nil, travel_duration: nil, travel_mode: nil, travel_direction: nil, routing_preference: nil, enable_smoothing: nil, polygon_fidelity: nil)
|
|
206
|
+
# Pass arguments to `generate_isochrone` via keyword arguments. Note that at
|
|
207
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
208
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
209
|
+
#
|
|
210
|
+
# @param location [::Google::Type::LatLng, ::Hash]
|
|
211
|
+
# The origin as a latitude/longitude coordinate.
|
|
212
|
+
#
|
|
213
|
+
# Note: The following parameters are mutually exclusive: `location`, `place`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
214
|
+
# @param place [::String]
|
|
215
|
+
# The resource name of a place, in the `places/{place_id}` format.
|
|
216
|
+
#
|
|
217
|
+
# Note: The following parameters are mutually exclusive: `place`, `location`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
218
|
+
# @param travel_duration [::Google::Protobuf::Duration, ::Hash]
|
|
219
|
+
# Required. The travel time for the isochrone calculation. The value must
|
|
220
|
+
# be positive and is capped at 7200 seconds (120 minutes).
|
|
221
|
+
# For DRIVE mode, the maximum allowed duration is 3600 seconds (60 minutes).
|
|
222
|
+
# @param travel_mode [::Google::Maps::Isochrones::V1::GenerateIsochroneRequest::TravelMode]
|
|
223
|
+
# Required. The mode of transportation.
|
|
224
|
+
# @param travel_direction [::Google::Maps::Isochrones::V1::GenerateIsochroneRequest::TravelDirection]
|
|
225
|
+
# Required. The direction of travel.
|
|
226
|
+
# @param routing_preference [::Google::Maps::Isochrones::V1::GenerateIsochroneRequest::RoutingPreference]
|
|
227
|
+
# Optional. Specifies the preference for how to route. Defaults to
|
|
228
|
+
# TRAFFIC_UNAWARE.
|
|
229
|
+
# @param enable_smoothing [::Boolean]
|
|
230
|
+
# Optional. Specifies whether to smooth the edges of the resulting isochrone
|
|
231
|
+
# polygons.
|
|
232
|
+
# @param polygon_fidelity [::Google::Maps::Isochrones::V1::GenerateIsochroneRequest::PolygonFidelity]
|
|
233
|
+
# Optional. Controls the precision of the generated polygon.
|
|
234
|
+
# Defaults to POLYGON_FIDELITY_UNSPECIFIED.
|
|
235
|
+
#
|
|
236
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
237
|
+
# @yieldparam response [::Google::Maps::Isochrones::V1::GenerateIsochroneResponse]
|
|
238
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
239
|
+
#
|
|
240
|
+
# @return [::Google::Maps::Isochrones::V1::GenerateIsochroneResponse]
|
|
241
|
+
#
|
|
242
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
243
|
+
#
|
|
244
|
+
# @example Basic example
|
|
245
|
+
# require "google/maps/isochrones/v1"
|
|
246
|
+
#
|
|
247
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
248
|
+
# client = Google::Maps::Isochrones::V1::IsochroneService::Client.new
|
|
249
|
+
#
|
|
250
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
251
|
+
# request = Google::Maps::Isochrones::V1::GenerateIsochroneRequest.new
|
|
252
|
+
#
|
|
253
|
+
# # Call the generate_isochrone method.
|
|
254
|
+
# result = client.generate_isochrone request
|
|
255
|
+
#
|
|
256
|
+
# # The returned object is of type Google::Maps::Isochrones::V1::GenerateIsochroneResponse.
|
|
257
|
+
# p result
|
|
258
|
+
#
|
|
259
|
+
def generate_isochrone request, options = nil
|
|
260
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
261
|
+
|
|
262
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Maps::Isochrones::V1::GenerateIsochroneRequest
|
|
263
|
+
|
|
264
|
+
# Converts hash and nil to an options object
|
|
265
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
266
|
+
|
|
267
|
+
# Customize the options with defaults
|
|
268
|
+
metadata = @config.rpcs.generate_isochrone.metadata.to_h
|
|
269
|
+
|
|
270
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
271
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
272
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
273
|
+
gapic_version: ::Google::Maps::Isochrones::V1::VERSION
|
|
274
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
275
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
276
|
+
|
|
277
|
+
options.apply_defaults timeout: @config.rpcs.generate_isochrone.timeout,
|
|
278
|
+
metadata: metadata,
|
|
279
|
+
retry_policy: @config.rpcs.generate_isochrone.retry_policy
|
|
280
|
+
|
|
281
|
+
options.apply_defaults timeout: @config.timeout,
|
|
282
|
+
metadata: @config.metadata,
|
|
283
|
+
retry_policy: @config.retry_policy
|
|
284
|
+
|
|
285
|
+
@isochrone_service_stub.call_rpc :generate_isochrone, request, options: options do |response, operation|
|
|
286
|
+
yield response, operation if block_given?
|
|
287
|
+
end
|
|
288
|
+
rescue ::GRPC::BadStatus => e
|
|
289
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
##
|
|
293
|
+
# Configuration class for the IsochroneService API.
|
|
294
|
+
#
|
|
295
|
+
# This class represents the configuration for IsochroneService,
|
|
296
|
+
# providing control over timeouts, retry behavior, logging, transport
|
|
297
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
|
298
|
+
# applied individually to specific RPCs. See
|
|
299
|
+
# {::Google::Maps::Isochrones::V1::IsochroneService::Client::Configuration::Rpcs}
|
|
300
|
+
# for a list of RPCs that can be configured independently.
|
|
301
|
+
#
|
|
302
|
+
# Configuration can be applied globally to all clients, or to a single client
|
|
303
|
+
# on construction.
|
|
304
|
+
#
|
|
305
|
+
# @example
|
|
306
|
+
#
|
|
307
|
+
# # Modify the global config, setting the timeout for
|
|
308
|
+
# # generate_isochrone to 20 seconds,
|
|
309
|
+
# # and all remaining timeouts to 10 seconds.
|
|
310
|
+
# ::Google::Maps::Isochrones::V1::IsochroneService::Client.configure do |config|
|
|
311
|
+
# config.timeout = 10.0
|
|
312
|
+
# config.rpcs.generate_isochrone.timeout = 20.0
|
|
313
|
+
# end
|
|
314
|
+
#
|
|
315
|
+
# # Apply the above configuration only to a new client.
|
|
316
|
+
# client = ::Google::Maps::Isochrones::V1::IsochroneService::Client.new do |config|
|
|
317
|
+
# config.timeout = 10.0
|
|
318
|
+
# config.rpcs.generate_isochrone.timeout = 20.0
|
|
319
|
+
# end
|
|
320
|
+
#
|
|
321
|
+
# @!attribute [rw] endpoint
|
|
322
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
|
323
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
|
324
|
+
# @return [::String,nil]
|
|
325
|
+
# @!attribute [rw] credentials
|
|
326
|
+
# Credentials to send with calls. You may provide any of the following types:
|
|
327
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
|
328
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
|
329
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
|
330
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
|
331
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
|
332
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
|
333
|
+
# * (`nil`) indicating no credentials
|
|
334
|
+
#
|
|
335
|
+
# @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
|
|
336
|
+
# is deprecated. Providing an unvalidated credential configuration to
|
|
337
|
+
# Google APIs can compromise the security of your systems and data.
|
|
338
|
+
#
|
|
339
|
+
# @example
|
|
340
|
+
#
|
|
341
|
+
# # The recommended way to provide credentials is to use the `make_creds` method
|
|
342
|
+
# # on the appropriate credentials class for your environment.
|
|
343
|
+
#
|
|
344
|
+
# require "googleauth"
|
|
345
|
+
#
|
|
346
|
+
# credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
|
|
347
|
+
# json_key_io: ::File.open("/path/to/keyfile.json")
|
|
348
|
+
# )
|
|
349
|
+
#
|
|
350
|
+
# client = ::Google::Maps::Isochrones::V1::IsochroneService::Client.new do |config|
|
|
351
|
+
# config.credentials = credentials
|
|
352
|
+
# end
|
|
353
|
+
#
|
|
354
|
+
# @note Warning: If you accept a credential configuration (JSON file or Hash) from an
|
|
355
|
+
# external source for authentication to Google Cloud, you must validate it before
|
|
356
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
|
357
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
|
358
|
+
# For more information, refer to [Validate credential configurations from external
|
|
359
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
|
360
|
+
# @return [::Object]
|
|
361
|
+
# @!attribute [rw] scope
|
|
362
|
+
# The OAuth scopes
|
|
363
|
+
# @return [::Array<::String>]
|
|
364
|
+
# @!attribute [rw] lib_name
|
|
365
|
+
# The library name as recorded in instrumentation and logging
|
|
366
|
+
# @return [::String]
|
|
367
|
+
# @!attribute [rw] lib_version
|
|
368
|
+
# The library version as recorded in instrumentation and logging
|
|
369
|
+
# @return [::String]
|
|
370
|
+
# @!attribute [rw] channel_args
|
|
371
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
|
372
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
|
373
|
+
# @return [::Hash]
|
|
374
|
+
# @!attribute [rw] interceptors
|
|
375
|
+
# An array of interceptors that are run before calls are executed.
|
|
376
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
|
377
|
+
# @!attribute [rw] timeout
|
|
378
|
+
# The call timeout in seconds.
|
|
379
|
+
# @return [::Numeric]
|
|
380
|
+
# @!attribute [rw] metadata
|
|
381
|
+
# Additional gRPC headers to be sent with the call.
|
|
382
|
+
# @return [::Hash{::Symbol=>::String}]
|
|
383
|
+
# @!attribute [rw] retry_policy
|
|
384
|
+
# The retry policy. The value is a hash with the following keys:
|
|
385
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
|
386
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
|
387
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
|
388
|
+
# * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
|
|
389
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
|
390
|
+
# trigger a retry.
|
|
391
|
+
# @return [::Hash]
|
|
392
|
+
# @!attribute [rw] quota_project
|
|
393
|
+
# A separate project against which to charge quota.
|
|
394
|
+
# @return [::String]
|
|
395
|
+
# @!attribute [rw] universe_domain
|
|
396
|
+
# The universe domain within which to make requests. This determines the
|
|
397
|
+
# default endpoint URL. The default value of nil uses the environment
|
|
398
|
+
# universe (usually the default "googleapis.com" universe).
|
|
399
|
+
# @return [::String,nil]
|
|
400
|
+
# @!attribute [rw] logger
|
|
401
|
+
# A custom logger to use for request/response debug logging, or the value
|
|
402
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
|
403
|
+
# explicitly disable logging.
|
|
404
|
+
# @return [::Logger,:default,nil]
|
|
405
|
+
#
|
|
406
|
+
class Configuration
|
|
407
|
+
extend ::Gapic::Config
|
|
408
|
+
|
|
409
|
+
# @private
|
|
410
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
|
411
|
+
DEFAULT_ENDPOINT = "isochrones.googleapis.com"
|
|
412
|
+
|
|
413
|
+
config_attr :endpoint, nil, ::String, nil
|
|
414
|
+
config_attr :credentials, nil do |value|
|
|
415
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
|
|
416
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
|
|
417
|
+
allowed.any? { |klass| klass === value }
|
|
418
|
+
end
|
|
419
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
|
420
|
+
config_attr :lib_name, nil, ::String, nil
|
|
421
|
+
config_attr :lib_version, nil, ::String, nil
|
|
422
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
|
423
|
+
config_attr :interceptors, nil, ::Array, nil
|
|
424
|
+
config_attr :timeout, nil, ::Numeric, nil
|
|
425
|
+
config_attr :metadata, nil, ::Hash, nil
|
|
426
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
|
427
|
+
config_attr :quota_project, nil, ::String, nil
|
|
428
|
+
config_attr :universe_domain, nil, ::String, nil
|
|
429
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
|
430
|
+
|
|
431
|
+
# @private
|
|
432
|
+
def initialize parent_config = nil
|
|
433
|
+
@parent_config = parent_config unless parent_config.nil?
|
|
434
|
+
|
|
435
|
+
yield self if block_given?
|
|
436
|
+
end
|
|
437
|
+
|
|
438
|
+
##
|
|
439
|
+
# Configurations for individual RPCs
|
|
440
|
+
# @return [Rpcs]
|
|
441
|
+
#
|
|
442
|
+
def rpcs
|
|
443
|
+
@rpcs ||= begin
|
|
444
|
+
parent_rpcs = nil
|
|
445
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
|
446
|
+
Rpcs.new parent_rpcs
|
|
447
|
+
end
|
|
448
|
+
end
|
|
449
|
+
|
|
450
|
+
##
|
|
451
|
+
# Configuration for the channel pool
|
|
452
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
|
453
|
+
#
|
|
454
|
+
def channel_pool
|
|
455
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
##
|
|
459
|
+
# Configuration RPC class for the IsochroneService API.
|
|
460
|
+
#
|
|
461
|
+
# Includes fields providing the configuration for each RPC in this service.
|
|
462
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
|
463
|
+
# the following configuration fields:
|
|
464
|
+
#
|
|
465
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
|
466
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
|
467
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
|
468
|
+
# include the following keys:
|
|
469
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
|
470
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
|
471
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
|
472
|
+
# * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
|
|
473
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
|
474
|
+
# trigger a retry.
|
|
475
|
+
#
|
|
476
|
+
class Rpcs
|
|
477
|
+
##
|
|
478
|
+
# RPC-specific configuration for `generate_isochrone`
|
|
479
|
+
# @return [::Gapic::Config::Method]
|
|
480
|
+
#
|
|
481
|
+
attr_reader :generate_isochrone
|
|
482
|
+
|
|
483
|
+
# @private
|
|
484
|
+
def initialize parent_rpcs = nil
|
|
485
|
+
generate_isochrone_config = parent_rpcs.generate_isochrone if parent_rpcs.respond_to? :generate_isochrone
|
|
486
|
+
@generate_isochrone = ::Gapic::Config::Method.new generate_isochrone_config
|
|
487
|
+
|
|
488
|
+
yield self if block_given?
|
|
489
|
+
end
|
|
490
|
+
end
|
|
491
|
+
end
|
|
492
|
+
end
|
|
493
|
+
end
|
|
494
|
+
end
|
|
495
|
+
end
|
|
496
|
+
end
|
|
497
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 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 "googleauth"
|
|
20
|
+
|
|
21
|
+
module Google
|
|
22
|
+
module Maps
|
|
23
|
+
module Isochrones
|
|
24
|
+
module V1
|
|
25
|
+
module IsochroneService
|
|
26
|
+
# Credentials for the IsochroneService API.
|
|
27
|
+
class Credentials < ::Google::Auth::Credentials
|
|
28
|
+
self.scope = [
|
|
29
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
|
30
|
+
"https://www.googleapis.com/auth/maps-platform.isochrones"
|
|
31
|
+
]
|
|
32
|
+
self.env_vars = [
|
|
33
|
+
"GOOGLE_CLOUD_CREDENTIALS",
|
|
34
|
+
"GOOGLE_CLOUD_KEYFILE",
|
|
35
|
+
"GCLOUD_KEYFILE",
|
|
36
|
+
"GOOGLE_CLOUD_CREDENTIALS_JSON",
|
|
37
|
+
"GOOGLE_CLOUD_KEYFILE_JSON",
|
|
38
|
+
"GCLOUD_KEYFILE_JSON"
|
|
39
|
+
]
|
|
40
|
+
self.paths = [
|
|
41
|
+
"~/.config/google_cloud/application_default_credentials.json"
|
|
42
|
+
]
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 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
|
+
|
|
20
|
+
module Google
|
|
21
|
+
module Maps
|
|
22
|
+
module Isochrones
|
|
23
|
+
module V1
|
|
24
|
+
module IsochroneService
|
|
25
|
+
# Path helper methods for the IsochroneService API.
|
|
26
|
+
module Paths
|
|
27
|
+
##
|
|
28
|
+
# Create a fully-qualified Place resource string.
|
|
29
|
+
#
|
|
30
|
+
# The resource will be in the following format:
|
|
31
|
+
#
|
|
32
|
+
# `places/{place_id}`
|
|
33
|
+
#
|
|
34
|
+
# @param place_id [String]
|
|
35
|
+
#
|
|
36
|
+
# @return [::String]
|
|
37
|
+
def place_path place_id:
|
|
38
|
+
"places/#{place_id}"
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
extend self
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|