google-cloud-location 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d97ad697437690ae39fcaa3a4515b009e2e4047a5bc98099a6fbd304ee3ca86
4
- data.tar.gz: d5d0b06a117818414b66f64daa979972fd25e16dd5ff9273587f34a99e193528
3
+ metadata.gz: 8b6365018d7007304ce5e7034e6272aa3b9a5b7d76105c0b20cd00ad4ed23190
4
+ data.tar.gz: a889a9a14ffd8a50b9afcea16d17f2c9f9e0e1d7e3e06d041c7c96a97795ecdd
5
5
  SHA512:
6
- metadata.gz: 305210ff36703c6f5cc5f3589bd343d7f4848f6f95e0705b7e86dcf0537644d23e25e98cff7adc5d0de9302a77662f637d83b81c7b7f8b20b22f7813c9d77404
7
- data.tar.gz: 92293ad1ec2f461e30657232a529347dfebf4d2c406e74f50d3815506a842eac4fca8abc71c936db243cc4d1c7a48e3539298f1bdb517a3f7664b52975458a60
6
+ metadata.gz: 33beef6339443a4506e70c72a8371c1845b3784ff4ad7395ce31b66759a608331ff7d42d015e63481539090b3f621ba8d6fe738e4be1ae8d83a2271649e78fd3
7
+ data.tar.gz: 6549f1d9f29f231834bc4e7cececf770d0f932faa745a06fa303c3053d1c5ac98da4247450f039eaaafd8cc55adcc078a72a0d3960bcdd20b7efbc48ade0c818
@@ -31,6 +31,9 @@ module Google
31
31
  # {::Google::Cloud::Location::Location#metadata Location.metadata} field.
32
32
  #
33
33
  class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
34
37
  # @private
35
38
  DEFAULT_ENDPOINT_TEMPLATE = "cloud.$UNIVERSE_DOMAIN$"
36
39
 
@@ -153,8 +156,28 @@ module Google
153
156
  universe_domain: @config.universe_domain,
154
157
  channel_args: @config.channel_args,
155
158
  interceptors: @config.interceptors,
156
- channel_pool_config: @config.channel_pool
159
+ channel_pool_config: @config.channel_pool,
160
+ logger: @config.logger
157
161
  )
162
+
163
+ @locations_stub.stub_logger&.info do |entry|
164
+ entry.set_system_name
165
+ entry.set_service
166
+ entry.message = "Created client for #{entry.service}"
167
+ entry.set_credentials_fields credentials
168
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
169
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
170
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
171
+ end
172
+ end
173
+
174
+ ##
175
+ # The logger used for request/response debug logging.
176
+ #
177
+ # @return [Logger]
178
+ #
179
+ def logger
180
+ @locations_stub.logger
158
181
  end
159
182
 
160
183
  # Service calls
@@ -224,10 +247,11 @@ module Google
224
247
  # Customize the options with defaults
225
248
  metadata = @config.rpcs.list_locations.metadata.to_h
226
249
 
227
- # Set x-goog-api-client and x-goog-user-project headers
250
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
228
251
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
229
252
  lib_name: @config.lib_name, lib_version: @config.lib_version,
230
253
  gapic_version: ::Google::Cloud::Location::VERSION
254
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
231
255
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
232
256
 
233
257
  header_params = {}
@@ -249,7 +273,7 @@ module Google
249
273
  @locations_stub.call_rpc :list_locations, request, options: options do |response, operation|
250
274
  response = ::Gapic::PagedEnumerable.new @locations_stub, :list_locations, request, response, operation, options
251
275
  yield response, operation if block_given?
252
- return response
276
+ throw :response, response
253
277
  end
254
278
  rescue ::GRPC::BadStatus => e
255
279
  raise ::Google::Cloud::Error.from_error(e)
@@ -310,10 +334,11 @@ module Google
310
334
  # Customize the options with defaults
311
335
  metadata = @config.rpcs.get_location.metadata.to_h
312
336
 
313
- # Set x-goog-api-client and x-goog-user-project headers
337
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
314
338
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
315
339
  lib_name: @config.lib_name, lib_version: @config.lib_version,
316
340
  gapic_version: ::Google::Cloud::Location::VERSION
341
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
317
342
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
318
343
 
319
344
  header_params = {}
@@ -334,7 +359,6 @@ module Google
334
359
 
335
360
  @locations_stub.call_rpc :get_location, request, options: options do |response, operation|
336
361
  yield response, operation if block_given?
337
- return response
338
362
  end
339
363
  rescue ::GRPC::BadStatus => e
340
364
  raise ::Google::Cloud::Error.from_error(e)
@@ -423,6 +447,11 @@ module Google
423
447
  # default endpoint URL. The default value of nil uses the environment
424
448
  # universe (usually the default "googleapis.com" universe).
425
449
  # @return [::String,nil]
450
+ # @!attribute [rw] logger
451
+ # A custom logger to use for request/response debug logging, or the value
452
+ # `:default` (the default) to construct a default logger, or `nil` to
453
+ # explicitly disable logging.
454
+ # @return [::Logger,:default,nil]
426
455
  #
427
456
  class Configuration
428
457
  extend ::Gapic::Config
@@ -447,6 +476,7 @@ module Google
447
476
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
448
477
  config_attr :quota_project, nil, ::String, nil
449
478
  config_attr :universe_domain, nil, ::String, nil
479
+ config_attr :logger, :default, ::Logger, nil, :default
450
480
 
451
481
  # @private
452
482
  def initialize parent_config = nil
@@ -33,6 +33,9 @@ module Google
33
33
  # {::Google::Cloud::Location::Location#metadata Location.metadata} field.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
36
39
  # @private
37
40
  DEFAULT_ENDPOINT_TEMPLATE = "cloud.$UNIVERSE_DOMAIN$"
38
41
 
@@ -146,8 +149,28 @@ module Google
146
149
  endpoint: @config.endpoint,
147
150
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
148
151
  universe_domain: @config.universe_domain,
149
- credentials: credentials
152
+ credentials: credentials,
153
+ logger: @config.logger
150
154
  )
155
+
156
+ @locations_stub.logger(stub: true)&.info do |entry|
157
+ entry.set_system_name
158
+ entry.set_service
159
+ entry.message = "Created client for #{entry.service}"
160
+ entry.set_credentials_fields credentials
161
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
162
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
163
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
164
+ end
165
+ end
166
+
167
+ ##
168
+ # The logger used for request/response debug logging.
169
+ #
170
+ # @return [Logger]
171
+ #
172
+ def logger
173
+ @locations_stub.logger
151
174
  end
152
175
 
153
176
  # Service calls
@@ -216,12 +239,13 @@ module Google
216
239
  # Customize the options with defaults
217
240
  call_metadata = @config.rpcs.list_locations.metadata.to_h
218
241
 
219
- # Set x-goog-api-client and x-goog-user-project headers
242
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
220
243
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
221
244
  lib_name: @config.lib_name, lib_version: @config.lib_version,
222
245
  gapic_version: ::Google::Cloud::Location::VERSION,
223
246
  transports_version_send: [:rest]
224
247
 
248
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
225
249
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
226
250
 
227
251
  options.apply_defaults timeout: @config.rpcs.list_locations.timeout,
@@ -237,7 +261,7 @@ module Google
237
261
  @locations_stub.list_locations request, options, bindings_override: bindings_override do |result, operation|
238
262
  result = ::Gapic::Rest::PagedEnumerable.new @locations_stub, :list_locations, "locations", request, result, options
239
263
  yield result, operation if block_given?
240
- return result
264
+ throw :response, result
241
265
  end
242
266
  rescue ::Gapic::Rest::Error => e
243
267
  raise ::Google::Cloud::Error.from_error(e)
@@ -297,12 +321,13 @@ module Google
297
321
  # Customize the options with defaults
298
322
  call_metadata = @config.rpcs.get_location.metadata.to_h
299
323
 
300
- # Set x-goog-api-client and x-goog-user-project headers
324
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
301
325
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
302
326
  lib_name: @config.lib_name, lib_version: @config.lib_version,
303
327
  gapic_version: ::Google::Cloud::Location::VERSION,
304
328
  transports_version_send: [:rest]
305
329
 
330
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
306
331
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
307
332
 
308
333
  options.apply_defaults timeout: @config.rpcs.get_location.timeout,
@@ -317,7 +342,6 @@ module Google
317
342
 
318
343
  @locations_stub.get_location request, options, bindings_override: bindings_override do |result, operation|
319
344
  yield result, operation if block_given?
320
- return result
321
345
  end
322
346
  rescue ::Gapic::Rest::Error => e
323
347
  raise ::Google::Cloud::Error.from_error(e)
@@ -397,6 +421,11 @@ module Google
397
421
  # default endpoint URL. The default value of nil uses the environment
398
422
  # universe (usually the default "googleapis.com" universe).
399
423
  # @return [::String,nil]
424
+ # @!attribute [rw] logger
425
+ # A custom logger to use for request/response debug logging, or the value
426
+ # `:default` (the default) to construct a default logger, or `nil` to
427
+ # explicitly disable logging.
428
+ # @return [::Logger,:default,nil]
400
429
  #
401
430
  class Configuration
402
431
  extend ::Gapic::Config
@@ -425,6 +454,7 @@ module Google
425
454
  # by the host service.
426
455
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
427
456
  config_attr :bindings_override, {}, ::Hash, nil
457
+ config_attr :logger, :default, ::Logger, nil, :default
428
458
 
429
459
  # @private
430
460
  def initialize parent_config = nil
@@ -29,7 +29,8 @@ module Google
29
29
  # including transcoding, making the REST call, and deserialing the response.
30
30
  #
31
31
  class ServiceStub
32
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
32
+ # @private
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
33
34
  # These require statements are intentionally placed here to initialize
34
35
  # the REST modules only when it's required.
35
36
  require "gapic/rest"
@@ -39,7 +40,9 @@ module Google
39
40
  universe_domain: universe_domain,
40
41
  credentials: credentials,
41
42
  numeric_enums: true,
42
- raise_faraday_errors: false
43
+ service_name: self.class,
44
+ raise_faraday_errors: false,
45
+ logger: logger
43
46
  end
44
47
 
45
48
  ##
@@ -60,6 +63,15 @@ module Google
60
63
  @client_stub.endpoint
61
64
  end
62
65
 
66
+ ##
67
+ # The logger used for request/response debug logging.
68
+ #
69
+ # @return [Logger]
70
+ #
71
+ def logger stub: false
72
+ stub ? @client_stub.stub_logger : @client_stub.logger
73
+ end
74
+
63
75
  ##
64
76
  # Baseline implementation for the list_locations REST call
65
77
  #
@@ -88,16 +100,18 @@ module Google
88
100
 
89
101
  response = @client_stub.make_http_request(
90
102
  verb,
91
- uri: uri,
92
- body: body || "",
93
- params: query_string_params,
103
+ uri: uri,
104
+ body: body || "",
105
+ params: query_string_params,
106
+ method_name: "list_locations",
94
107
  options: options
95
108
  )
96
109
  operation = ::Gapic::Rest::TransportOperation.new response
97
110
  result = ::Google::Cloud::Location::ListLocationsResponse.decode_json response.body, ignore_unknown_fields: true
98
-
99
- yield result, operation if block_given?
100
- result
111
+ catch :response do
112
+ yield result, operation if block_given?
113
+ result
114
+ end
101
115
  end
102
116
 
103
117
  ##
@@ -128,16 +142,18 @@ module Google
128
142
 
129
143
  response = @client_stub.make_http_request(
130
144
  verb,
131
- uri: uri,
132
- body: body || "",
133
- params: query_string_params,
145
+ uri: uri,
146
+ body: body || "",
147
+ params: query_string_params,
148
+ method_name: "get_location",
134
149
  options: options
135
150
  )
136
151
  operation = ::Gapic::Rest::TransportOperation.new response
137
152
  result = ::Google::Cloud::Location::Location.decode_json response.body, ignore_unknown_fields: true
138
-
139
- yield result, operation if block_given?
140
- result
153
+ catch :response do
154
+ yield result, operation if block_given?
155
+ result
156
+ end
141
157
  end
142
158
 
143
159
  ##
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module Location
23
- VERSION = "0.8.0"
23
+ VERSION = "0.9.0"
24
24
  end
25
25
  end
26
26
  end
@@ -28,6 +28,9 @@ module Google
28
28
  # @!attribute [rw] destinations
29
29
  # @return [::Array<::Google::Api::ClientLibraryDestination>]
30
30
  # The destination where API teams want this client library to be published.
31
+ # @!attribute [rw] selective_gapic_generation
32
+ # @return [::Google::Api::SelectiveGapicGeneration]
33
+ # Configuration for which RPCs should be generated in the GAPIC client.
31
34
  class CommonLanguageSettings
32
35
  include ::Google::Protobuf::MessageExts
33
36
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -118,6 +121,10 @@ module Google
118
121
  # @return [::String]
119
122
  # Optional link to proto reference documentation. Example:
120
123
  # https://cloud.google.com/pubsub/lite/docs/reference/rpc
124
+ # @!attribute [rw] rest_reference_documentation_uri
125
+ # @return [::String]
126
+ # Optional link to REST reference documentation. Example:
127
+ # https://cloud.google.com/pubsub/lite/docs/reference/rest
121
128
  class Publishing
122
129
  include ::Google::Protobuf::MessageExts
123
130
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -192,9 +199,32 @@ module Google
192
199
  # @!attribute [rw] common
193
200
  # @return [::Google::Api::CommonLanguageSettings]
194
201
  # Some settings.
202
+ # @!attribute [rw] experimental_features
203
+ # @return [::Google::Api::PythonSettings::ExperimentalFeatures]
204
+ # Experimental features to be included during client library generation.
195
205
  class PythonSettings
196
206
  include ::Google::Protobuf::MessageExts
197
207
  extend ::Google::Protobuf::MessageExts::ClassMethods
208
+
209
+ # Experimental features to be included during client library generation.
210
+ # These fields will be deprecated once the feature graduates and is enabled
211
+ # by default.
212
+ # @!attribute [rw] rest_async_io_enabled
213
+ # @return [::Boolean]
214
+ # Enables generation of asynchronous REST clients if `rest` transport is
215
+ # enabled. By default, asynchronous REST clients will not be generated.
216
+ # This feature will be enabled by default 1 month after launching the
217
+ # feature in preview packages.
218
+ # @!attribute [rw] protobuf_pythonic_types_enabled
219
+ # @return [::Boolean]
220
+ # Enables generation of protobuf code using new types that are more
221
+ # Pythonic which are included in `protobuf>=5.29.x`. This feature will be
222
+ # enabled by default 1 month after launching the feature in preview
223
+ # packages.
224
+ class ExperimentalFeatures
225
+ include ::Google::Protobuf::MessageExts
226
+ extend ::Google::Protobuf::MessageExts::ClassMethods
227
+ end
198
228
  end
199
229
 
200
230
  # Settings for Node client libraries.
@@ -276,9 +306,28 @@ module Google
276
306
  # @!attribute [rw] common
277
307
  # @return [::Google::Api::CommonLanguageSettings]
278
308
  # Some settings.
309
+ # @!attribute [rw] renamed_services
310
+ # @return [::Google::Protobuf::Map{::String => ::String}]
311
+ # Map of service names to renamed services. Keys are the package relative
312
+ # service names and values are the name to be used for the service client
313
+ # and call options.
314
+ #
315
+ # publishing:
316
+ # go_settings:
317
+ # renamed_services:
318
+ # Publisher: TopicAdmin
279
319
  class GoSettings
280
320
  include ::Google::Protobuf::MessageExts
281
321
  extend ::Google::Protobuf::MessageExts::ClassMethods
322
+
323
+ # @!attribute [rw] key
324
+ # @return [::String]
325
+ # @!attribute [rw] value
326
+ # @return [::String]
327
+ class RenamedServicesEntry
328
+ include ::Google::Protobuf::MessageExts
329
+ extend ::Google::Protobuf::MessageExts::ClassMethods
330
+ end
282
331
  end
283
332
 
284
333
  # Describes the generator configuration for a method.
@@ -286,6 +335,13 @@ module Google
286
335
  # @return [::String]
287
336
  # The fully qualified name of the method, for which the options below apply.
288
337
  # This is used to find the method to apply the options.
338
+ #
339
+ # Example:
340
+ #
341
+ # publishing:
342
+ # method_settings:
343
+ # - selector: google.storage.control.v2.StorageControl.CreateFolder
344
+ # # method settings for CreateFolder...
289
345
  # @!attribute [rw] long_running
290
346
  # @return [::Google::Api::MethodSettings::LongRunning]
291
347
  # Describes settings to use for long-running operations when generating
@@ -294,17 +350,14 @@ module Google
294
350
  #
295
351
  # Example of a YAML configuration::
296
352
  #
297
- # publishing:
298
- # method_settings:
353
+ # publishing:
354
+ # method_settings:
299
355
  # - selector: google.cloud.speech.v2.Speech.BatchRecognize
300
356
  # long_running:
301
- # initial_poll_delay:
302
- # seconds: 60 # 1 minute
357
+ # initial_poll_delay: 60s # 1 minute
303
358
  # poll_delay_multiplier: 1.5
304
- # max_poll_delay:
305
- # seconds: 360 # 6 minutes
306
- # total_poll_timeout:
307
- # seconds: 54000 # 90 minutes
359
+ # max_poll_delay: 360s # 6 minutes
360
+ # total_poll_timeout: 54000s # 90 minutes
308
361
  # @!attribute [rw] auto_populated_fields
309
362
  # @return [::Array<::String>]
310
363
  # List of top-level fields of the request message, that should be
@@ -313,8 +366,8 @@ module Google
313
366
  #
314
367
  # Example of a YAML configuration:
315
368
  #
316
- # publishing:
317
- # method_settings:
369
+ # publishing:
370
+ # method_settings:
318
371
  # - selector: google.example.v1.ExampleService.CreateExample
319
372
  # auto_populated_fields:
320
373
  # - request_id
@@ -350,6 +403,17 @@ module Google
350
403
  end
351
404
  end
352
405
 
406
+ # This message is used to configure the generation of a subset of the RPCs in
407
+ # a service for client libraries.
408
+ # @!attribute [rw] methods
409
+ # @return [::Array<::String>]
410
+ # An allowlist of the fully qualified names of RPCs that should be included
411
+ # on public client surfaces.
412
+ class SelectiveGapicGeneration
413
+ include ::Google::Protobuf::MessageExts
414
+ extend ::Google::Protobuf::MessageExts::ClassMethods
415
+ end
416
+
353
417
  # The organization for which the client libraries are being published.
354
418
  # Affects the url where generated docs are published, etc.
355
419
  module ClientLibraryOrganization
@@ -124,8 +124,13 @@ module Google
124
124
  # @return [::String]
125
125
  # The plural name used in the resource name and permission names, such as
126
126
  # 'projects' for the resource name of 'projects/\\{project}' and the permission
127
- # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
128
- # concept of the `plural` field in k8s CRD spec
127
+ # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception
128
+ # to this is for Nested Collections that have stuttering names, as defined
129
+ # in [AIP-122](https://google.aip.dev/122#nested-collections), where the
130
+ # collection ID in the resource name pattern does not necessarily directly
131
+ # match the `plural` value.
132
+ #
133
+ # It is the same concept of the `plural` field in k8s CRD spec
129
134
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
130
135
  #
131
136
  # Note: The plural form is required even for singleton resources. See
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-location
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-26 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.21.1
19
+ version: 0.24.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.21.1
29
+ version: 0.24.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  requirements: []
96
- rubygems_version: 3.5.6
96
+ rubygems_version: 3.5.23
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: API Client library for the Locations API