google-shopping-merchant-accounts 0.3.0 → 0.4.1

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: d189c1b35b7cf3f5d5ec29af5b9cccaeb490ae9a484e87c5b724a1a783419874
4
- data.tar.gz: f17016b4ee5cca262ad63cd98150fa050c3c9fd7ff162030ed2053908b126c31
3
+ metadata.gz: 24006d44a73d79cf87fc47a0c169d667414ff20e9a6acf5aa68003ce07a8c614
4
+ data.tar.gz: 48aedc7303bfc701e5f639f5b07465a1a046defab590ff559d1ac26fcb98d54d
5
5
  SHA512:
6
- metadata.gz: 2a468f596d47ed79625bc2a4c47d86b14a7bc84a0527df082df38f81058aa09d73db07e520671987327c8c239308a12788ed582cccb1cbc62062f56a2ff66405
7
- data.tar.gz: 5944259f92c11a28e7f324721df598ebec3b3274a352470ee3f590ec960865dbd321b891be59a0e232427f79279d8d31ae895d695bac9e477e04f03e49952836
6
+ metadata.gz: 4b16c31a471ba3cab531c9bb9cfa9175463a63b1e538429bcee689b133841da838abc88335258496abf778402a97dd77109e2b108be268b832b5551435406bd3
7
+ data.tar.gz: d2da70bcd042e297ae943cd3b0ef74a2ba19df07dcc1de0bb08ef23331cc3300f41c6fea17d70415bc980f0cb132452d61961d7db2c3c3e481eebe1a98c632c8
data/README.md CHANGED
@@ -7,7 +7,7 @@ Merchant API consists of multiple Sub-APIs. Accounts Sub-API: Enables you to pro
7
7
  Actual client classes for the various versions of this API are defined in
8
8
  _versioned_ client gems, with names of the form `google-shopping-merchant-accounts-v*`.
9
9
  The gem `google-shopping-merchant-accounts` is the main client library that brings the
10
- verisoned gems in as dependencies, and provides high-level methods for
10
+ versioned gems in as dependencies, and provides high-level methods for
11
11
  constructing clients. More information on versioned clients can be found below
12
12
  in the section titled *Which client should I use?*.
13
13
 
@@ -21,7 +21,7 @@ module Google
21
21
  module Shopping
22
22
  module Merchant
23
23
  module Accounts
24
- VERSION = "0.3.0"
24
+ VERSION = "0.4.1"
25
25
  end
26
26
  end
27
27
  end
@@ -383,6 +383,78 @@ module Google
383
383
  false
384
384
  end
385
385
 
386
+ ##
387
+ # Create a new client object for AutomaticImprovementsService.
388
+ #
389
+ # By default, this returns an instance of
390
+ # [Google::Shopping::Merchant::Accounts::V1beta::AutomaticImprovementsService::Client](https://rubydoc.info/gems/google-shopping-merchant-accounts-v1beta/Google/Shopping/Merchant/Accounts/V1beta/AutomaticImprovementsService/Client)
391
+ # for a gRPC client for version V1beta of the API.
392
+ # However, you can specify a different API version by passing it in the
393
+ # `version` parameter. If the AutomaticImprovementsService service is
394
+ # supported by that API version, and the corresponding gem is available, the
395
+ # appropriate versioned client will be returned.
396
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
397
+ # the `transport` parameter.
398
+ #
399
+ # Raises an exception if the currently installed versioned client gem for the
400
+ # given API version does not support the given transport of the AutomaticImprovementsService service.
401
+ # You can determine whether the method will succeed by calling
402
+ # {Google::Shopping::Merchant::Accounts.automatic_improvements_service_available?}.
403
+ #
404
+ # ## About AutomaticImprovementsService
405
+ #
406
+ # Service to manage the automatic improvements of an account. The automatic
407
+ # improvements of the account can be used to automatically update products,
408
+ # improve images and shipping.
409
+ #
410
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
411
+ # Defaults to `:v1beta`.
412
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
413
+ # @return [::Object] A client object for the specified version.
414
+ #
415
+ def self.automatic_improvements_service version: :v1beta, transport: :grpc, &block
416
+ require "google/shopping/merchant/accounts/#{version.to_s.downcase}"
417
+
418
+ package_name = Google::Shopping::Merchant::Accounts
419
+ .constants
420
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
421
+ .first
422
+ service_module = Google::Shopping::Merchant::Accounts.const_get(package_name).const_get(:AutomaticImprovementsService)
423
+ service_module = service_module.const_get(:Rest) if transport == :rest
424
+ service_module.const_get(:Client).new(&block)
425
+ end
426
+
427
+ ##
428
+ # Determines whether the AutomaticImprovementsService service is supported by the current client.
429
+ # If true, you can retrieve a client object by calling {Google::Shopping::Merchant::Accounts.automatic_improvements_service}.
430
+ # If false, that method will raise an exception. This could happen if the given
431
+ # API version does not exist or does not support the AutomaticImprovementsService service,
432
+ # or if the versioned client gem needs an update to support the AutomaticImprovementsService service.
433
+ #
434
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
435
+ # Defaults to `:v1beta`.
436
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
437
+ # @return [boolean] Whether the service is available.
438
+ #
439
+ def self.automatic_improvements_service_available? version: :v1beta, transport: :grpc
440
+ require "google/shopping/merchant/accounts/#{version.to_s.downcase}"
441
+ package_name = Google::Shopping::Merchant::Accounts
442
+ .constants
443
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
444
+ .first
445
+ return false unless package_name
446
+ service_module = Google::Shopping::Merchant::Accounts.const_get package_name
447
+ return false unless service_module.const_defined? :AutomaticImprovementsService
448
+ service_module = service_module.const_get :AutomaticImprovementsService
449
+ if transport == :rest
450
+ return false unless service_module.const_defined? :Rest
451
+ service_module = service_module.const_get :Rest
452
+ end
453
+ service_module.const_defined? :Client
454
+ rescue ::LoadError
455
+ false
456
+ end
457
+
386
458
  ##
387
459
  # Create a new client object for BusinessIdentityService.
388
460
  #
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-shopping-merchant-accounts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.1
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: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: google-cloud-core
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []
89
- rubygems_version: 3.6.2
89
+ rubygems_version: 3.6.8
90
90
  specification_version: 4
91
91
  summary: Programmatically manage your Merchant Center Accounts.
92
92
  test_files: []