google-cloud-location 0.8.1 → 0.10.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: 4e1c2800b2da05b07529b141f07753d8bb4128fee8fa055a84414bbad21f497b
4
- data.tar.gz: cdb187cd174e4108d43077897dd392845644e43b593d31613393333f8ae98c04
3
+ metadata.gz: 89a307988299ddb69732c9944f95b495c9ba113638d454ae4398570aa1b68ddb
4
+ data.tar.gz: 49f1a1072b944c2dc03483e7c62d58d6bb826e359941f41ad13bcd45e47d7b92
5
5
  SHA512:
6
- metadata.gz: 41bf55fba596d7656a4d06f3fde82bdd0d4507e8b5552622f30043397b32f42a984ada6cb3fbe359b37afee5db622907efbe8a20cf96a452a0f7c76410395ccc
7
- data.tar.gz: 7111301240cba7b901b8648c3c55506cb19c1c4d21b493706748bb18a553482e7169c1c23c03b31b10b8c72bd6a1e569c4730bb46e43779274d598e8679c8f6d
6
+ metadata.gz: 1ba82b65f2ec1010c923cefe10ed325ce1641e18edd1f8b3ba38eee177dab96f33a18716785a919a33dea74ebaf331a3bb772ac1072fc6479f865c31c9f091cf
7
+ data.tar.gz: c3f3ef8f29ed1e8d9abdc1290a6a9eb4e13c620ae702609a11732620ac552edaf0009ee2687256b02fb9c74478236ac7c1db11f3a26d23dcc497c3abe3b3505e
@@ -156,8 +156,28 @@ module Google
156
156
  universe_domain: @config.universe_domain,
157
157
  channel_args: @config.channel_args,
158
158
  interceptors: @config.interceptors,
159
- channel_pool_config: @config.channel_pool
159
+ channel_pool_config: @config.channel_pool,
160
+ logger: @config.logger
160
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
161
181
  end
162
182
 
163
183
  # Service calls
@@ -253,7 +273,7 @@ module Google
253
273
  @locations_stub.call_rpc :list_locations, request, options: options do |response, operation|
254
274
  response = ::Gapic::PagedEnumerable.new @locations_stub, :list_locations, request, response, operation, options
255
275
  yield response, operation if block_given?
256
- return response
276
+ throw :response, response
257
277
  end
258
278
  rescue ::GRPC::BadStatus => e
259
279
  raise ::Google::Cloud::Error.from_error(e)
@@ -339,7 +359,6 @@ module Google
339
359
 
340
360
  @locations_stub.call_rpc :get_location, request, options: options do |response, operation|
341
361
  yield response, operation if block_given?
342
- return response
343
362
  end
344
363
  rescue ::GRPC::BadStatus => e
345
364
  raise ::Google::Cloud::Error.from_error(e)
@@ -389,6 +408,13 @@ module Google
389
408
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
390
409
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
391
410
  # * (`nil`) indicating no credentials
411
+ #
412
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
413
+ # external source for authentication to Google Cloud, you must validate it before
414
+ # providing it to a Google API client library. Providing an unvalidated credential
415
+ # configuration to Google APIs can compromise the security of your systems and data.
416
+ # For more information, refer to [Validate credential configurations from external
417
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
392
418
  # @return [::Object]
393
419
  # @!attribute [rw] scope
394
420
  # The OAuth scopes
@@ -428,6 +454,11 @@ module Google
428
454
  # default endpoint URL. The default value of nil uses the environment
429
455
  # universe (usually the default "googleapis.com" universe).
430
456
  # @return [::String,nil]
457
+ # @!attribute [rw] logger
458
+ # A custom logger to use for request/response debug logging, or the value
459
+ # `:default` (the default) to construct a default logger, or `nil` to
460
+ # explicitly disable logging.
461
+ # @return [::Logger,:default,nil]
431
462
  #
432
463
  class Configuration
433
464
  extend ::Gapic::Config
@@ -452,6 +483,7 @@ module Google
452
483
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
453
484
  config_attr :quota_project, nil, ::String, nil
454
485
  config_attr :universe_domain, nil, ::String, nil
486
+ config_attr :logger, :default, ::Logger, nil, :default
455
487
 
456
488
  # @private
457
489
  def initialize parent_config = nil
@@ -149,8 +149,28 @@ module Google
149
149
  endpoint: @config.endpoint,
150
150
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
151
151
  universe_domain: @config.universe_domain,
152
- credentials: credentials
152
+ credentials: credentials,
153
+ logger: @config.logger
153
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
154
174
  end
155
175
 
156
176
  # Service calls
@@ -241,7 +261,7 @@ module Google
241
261
  @locations_stub.list_locations request, options, bindings_override: bindings_override do |result, operation|
242
262
  result = ::Gapic::Rest::PagedEnumerable.new @locations_stub, :list_locations, "locations", request, result, options
243
263
  yield result, operation if block_given?
244
- return result
264
+ throw :response, result
245
265
  end
246
266
  rescue ::Gapic::Rest::Error => e
247
267
  raise ::Google::Cloud::Error.from_error(e)
@@ -322,7 +342,6 @@ module Google
322
342
 
323
343
  @locations_stub.get_location request, options, bindings_override: bindings_override do |result, operation|
324
344
  yield result, operation if block_given?
325
- return result
326
345
  end
327
346
  rescue ::Gapic::Rest::Error => e
328
347
  raise ::Google::Cloud::Error.from_error(e)
@@ -370,6 +389,13 @@ module Google
370
389
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
371
390
  # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
372
391
  # * (`nil`) indicating no credentials
392
+ #
393
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
394
+ # external source for authentication to Google Cloud, you must validate it before
395
+ # providing it to a Google API client library. Providing an unvalidated credential
396
+ # configuration to Google APIs can compromise the security of your systems and data.
397
+ # For more information, refer to [Validate credential configurations from external
398
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
373
399
  # @return [::Object]
374
400
  # @!attribute [rw] scope
375
401
  # The OAuth scopes
@@ -402,6 +428,11 @@ module Google
402
428
  # default endpoint URL. The default value of nil uses the environment
403
429
  # universe (usually the default "googleapis.com" universe).
404
430
  # @return [::String,nil]
431
+ # @!attribute [rw] logger
432
+ # A custom logger to use for request/response debug logging, or the value
433
+ # `:default` (the default) to construct a default logger, or `nil` to
434
+ # explicitly disable logging.
435
+ # @return [::Logger,:default,nil]
405
436
  #
406
437
  class Configuration
407
438
  extend ::Gapic::Config
@@ -430,6 +461,7 @@ module Google
430
461
  # by the host service.
431
462
  # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
432
463
  config_attr :bindings_override, {}, ::Hash, nil
464
+ config_attr :logger, :default, ::Logger, nil, :default
433
465
 
434
466
  # @private
435
467
  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.1"
23
+ VERSION = "0.10.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
@@ -212,6 +215,12 @@ module Google
212
215
  # enabled. By default, asynchronous REST clients will not be generated.
213
216
  # This feature will be enabled by default 1 month after launching the
214
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.
215
224
  class ExperimentalFeatures
216
225
  include ::Google::Protobuf::MessageExts
217
226
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -297,9 +306,28 @@ module Google
297
306
  # @!attribute [rw] common
298
307
  # @return [::Google::Api::CommonLanguageSettings]
299
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
300
319
  class GoSettings
301
320
  include ::Google::Protobuf::MessageExts
302
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
303
331
  end
304
332
 
305
333
  # Describes the generator configuration for a method.
@@ -375,6 +403,17 @@ module Google
375
403
  end
376
404
  end
377
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
+
378
417
  # The organization for which the client libraries are being published.
379
418
  # Affects the url where generated docs are published, etc.
380
419
  module ClientLibraryOrganization
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-location
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-08-30 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: gapic-common
@@ -16,7 +15,7 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 0.21.1
18
+ version: 0.25.0
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
21
  version: 2.a
@@ -26,7 +25,7 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- version: 0.21.1
28
+ version: 0.25.0
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
31
  version: 2.a
@@ -78,7 +77,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
78
77
  licenses:
79
78
  - Apache-2.0
80
79
  metadata: {}
81
- post_install_message:
82
80
  rdoc_options: []
83
81
  require_paths:
84
82
  - lib
@@ -86,15 +84,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
86
84
  requirements:
87
85
  - - ">="
88
86
  - !ruby/object:Gem::Version
89
- version: '2.7'
87
+ version: '3.0'
90
88
  required_rubygems_version: !ruby/object:Gem::Requirement
91
89
  requirements:
92
90
  - - ">="
93
91
  - !ruby/object:Gem::Version
94
92
  version: '0'
95
93
  requirements: []
96
- rubygems_version: 3.5.6
97
- signing_key:
94
+ rubygems_version: 3.6.2
98
95
  specification_version: 4
99
96
  summary: API Client library for the Locations API
100
97
  test_files: []