google-shopping-css 1.1.0 → 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '096ee8c48da8fd37ae2de892eaa4c1ec0480a9da9da3a14cb4b5284ddca946dc'
4
- data.tar.gz: 4d73066eebb1c21f744d95bcdb8df7e74ab661a8392cdd04378d038306286871
3
+ metadata.gz: d9c08b8481e5e5e013990f816993b7632da67dfd034762b34c137db8a28f2c66
4
+ data.tar.gz: 365f676672e129c6cbb9c530fc0ec79b5ed074cad9869da3b499ae78d9e27985
5
5
  SHA512:
6
- metadata.gz: 31da0abbfda58d8fffa3f850c5e256a2fe2d6eb594300e6666edcd6241d9fd198fff412ad652b553a472615ea6104fc2079bd21a7c86e88861a8a7453b00411e
7
- data.tar.gz: 439b9a0aad76a5c7b3a3fd1eb1b7dc9b6b40db4c559c18b325ab2740ff3ee6c88dd3cf732e410be35fa6efccf1085427e33c9e38476c8798a82b6fd9d5528836
6
+ metadata.gz: f7c6e809f23673c475ae330932c0b93534ef3739b6a3c6004211dd3d1cd88f5577c8b2fa643b986d73707919b62e6b1367cb8b8e97b41aacc05cffa04a374404
7
+ data.tar.gz: 7fc570d61c3b6c0c159b0e0fda80059d2720b83d6d0dd855f86b4ab8b3c8a9339e9267b60d72f2f9dce8aad90af11632be738e15c559a4d11f2bfe8ada94ce94
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Shopping
22
22
  module Css
23
- VERSION = "1.1.0"
23
+ VERSION = "1.2.0"
24
24
  end
25
25
  end
26
26
  end
@@ -308,6 +308,76 @@ module Google
308
308
  rescue ::LoadError
309
309
  false
310
310
  end
311
+
312
+ ##
313
+ # Create a new client object for QuotaService.
314
+ #
315
+ # By default, this returns an instance of
316
+ # [Google::Shopping::Css::V1::QuotaService::Client](https://rubydoc.info/gems/google-shopping-css-v1/Google/Shopping/Css/V1/QuotaService/Client)
317
+ # for a gRPC client for version V1 of the API.
318
+ # However, you can specify a different API version by passing it in the
319
+ # `version` parameter. If the QuotaService service is
320
+ # supported by that API version, and the corresponding gem is available, the
321
+ # appropriate versioned client will be returned.
322
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
323
+ # the `transport` parameter.
324
+ #
325
+ # Raises an exception if the currently installed versioned client gem for the
326
+ # given API version does not support the given transport of the QuotaService service.
327
+ # You can determine whether the method will succeed by calling
328
+ # {Google::Shopping::Css.quota_service_available?}.
329
+ #
330
+ # ## About QuotaService
331
+ #
332
+ # Service to get method call quota information per CSS API method.
333
+ #
334
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
335
+ # Defaults to `:v1`.
336
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
337
+ # @return [::Object] A client object for the specified version.
338
+ #
339
+ def self.quota_service version: :v1, transport: :grpc, &block
340
+ require "google/shopping/css/#{version.to_s.downcase}"
341
+
342
+ package_name = Google::Shopping::Css
343
+ .constants
344
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
345
+ .first
346
+ service_module = Google::Shopping::Css.const_get(package_name).const_get(:QuotaService)
347
+ service_module = service_module.const_get(:Rest) if transport == :rest
348
+ service_module.const_get(:Client).new(&block)
349
+ end
350
+
351
+ ##
352
+ # Determines whether the QuotaService service is supported by the current client.
353
+ # If true, you can retrieve a client object by calling {Google::Shopping::Css.quota_service}.
354
+ # If false, that method will raise an exception. This could happen if the given
355
+ # API version does not exist or does not support the QuotaService service,
356
+ # or if the versioned client gem needs an update to support the QuotaService service.
357
+ #
358
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
359
+ # Defaults to `:v1`.
360
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
361
+ # @return [boolean] Whether the service is available.
362
+ #
363
+ def self.quota_service_available? version: :v1, transport: :grpc
364
+ require "google/shopping/css/#{version.to_s.downcase}"
365
+ package_name = Google::Shopping::Css
366
+ .constants
367
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
368
+ .first
369
+ return false unless package_name
370
+ service_module = Google::Shopping::Css.const_get package_name
371
+ return false unless service_module.const_defined? :QuotaService
372
+ service_module = service_module.const_get :QuotaService
373
+ if transport == :rest
374
+ return false unless service_module.const_defined? :Rest
375
+ service_module = service_module.const_get :Rest
376
+ end
377
+ service_module.const_defined? :Client
378
+ rescue ::LoadError
379
+ false
380
+ end
311
381
  end
312
382
  end
313
383
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-shopping-css
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-29 00:00:00.000000000 Z
10
+ date: 2025-04-21 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: google-cloud-core
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  requirements: []
78
- rubygems_version: 3.6.2
78
+ rubygems_version: 3.6.5
79
79
  specification_version: 4
80
80
  summary: Programmatically manage your Comparison Shopping Service (CSS) account data
81
81
  at scale.