google-shopping-merchant-products 0.1.2 → 0.2.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: 49da1b673ee75dc8944ed0f50f73a4124ea58b2f2ca2fa6f5086e41e73a2eca5
4
- data.tar.gz: 72d3838ea122a1cbcf32e2bbe8855bbeec3bba8d52266532729cde77b6eacbcf
3
+ metadata.gz: 23f03e4ec1e03516cfec34200541afb94191002b6480b6c438747712e3f04597
4
+ data.tar.gz: cb67861cb387aa861ecde6aaf4c976f454898744885c3ce69f90e3440de0d297
5
5
  SHA512:
6
- metadata.gz: 6d492a860f4573d58078f4783db1c2f1aff3ff888c24617d9dc78b426c2d3c109ead3cb37adb5f11adb73c46b5db9581144b4827e6d9530f74e0cc1c6a30d89c
7
- data.tar.gz: bd0f690423228f9ca8deefdc953b5f27f36739bbc69b0e5c441046f4c76850634c00cc1e820dffc707d9342cc23b1475ac6e7e88a7f8cdd8232594d28ebc0620
6
+ metadata.gz: 852901b971f1815ce5b416849401567a8107dca7f183601d6124f899c60ecb46c0470d4d5d9c04fd0a11b0b922fe56160014e3c97b551cf3fcd7f45b75469f59
7
+ data.tar.gz: 0b8ea52d2097733b1418298c81559f3b3120d335d75a236c5fe0351d436bd8b7b9e5f80e3e33f8281c02557b3b79c08f0dec6c8fc6d20a567b7451a015c523d2
data/README.md CHANGED
@@ -59,9 +59,14 @@ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
59
59
  results in logs appearing alongside your application logs in the
60
60
  [Google Cloud Logging](https://cloud.google.com/logging/) service.
61
61
 
62
+ Debug logging also requires that the versioned clients for this service be
63
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
64
+ working, try updating the versioned clients in your bundle or installed gems:
65
+ [google-shopping-merchant-products-v1beta](https://rubydoc.info/gems/google-shopping-merchant-products-v1beta).
66
+
62
67
  ## Supported Ruby Versions
63
68
 
64
- This library is supported on Ruby 2.7+.
69
+ This library is supported on Ruby 3.0+.
65
70
 
66
71
  Google provides official support for Ruby versions that are actively supported
67
72
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -21,7 +21,7 @@ module Google
21
21
  module Shopping
22
22
  module Merchant
23
23
  module Products
24
- VERSION = "0.1.2"
24
+ VERSION = "0.2.0"
25
25
  end
26
26
  end
27
27
  end
@@ -41,6 +41,11 @@ module Google
41
41
  # You can also specify a different transport by passing `:rest` or `:grpc` in
42
42
  # the `transport` parameter.
43
43
  #
44
+ # Raises an exception if the currently installed versioned client gem for the
45
+ # given API version does not support the given transport of the ProductInputsService service.
46
+ # You can determine whether the method will succeed by calling
47
+ # {Google::Shopping::Merchant::Products.product_inputs_service_available?}.
48
+ #
44
49
  # ## About ProductInputsService
45
50
  #
46
51
  # Service to use ProductInput resource.
@@ -63,6 +68,37 @@ module Google
63
68
  service_module.const_get(:Client).new(&block)
64
69
  end
65
70
 
71
+ ##
72
+ # Determines whether the ProductInputsService service is supported by the current client.
73
+ # If true, you can retrieve a client object by calling {Google::Shopping::Merchant::Products.product_inputs_service}.
74
+ # If false, that method will raise an exception. This could happen if the given
75
+ # API version does not exist or does not support the ProductInputsService service,
76
+ # or if the versioned client gem needs an update to support the ProductInputsService service.
77
+ #
78
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
79
+ # Defaults to `:v1beta`.
80
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
81
+ # @return [boolean] Whether the service is available.
82
+ #
83
+ def self.product_inputs_service_available? version: :v1beta, transport: :grpc
84
+ require "google/shopping/merchant/products/#{version.to_s.downcase}"
85
+ package_name = Google::Shopping::Merchant::Products
86
+ .constants
87
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
88
+ .first
89
+ return false unless package_name
90
+ service_module = Google::Shopping::Merchant::Products.const_get package_name
91
+ return false unless service_module.const_defined? :ProductInputsService
92
+ service_module = service_module.const_get :ProductInputsService
93
+ if transport == :rest
94
+ return false unless service_module.const_defined? :Rest
95
+ service_module = service_module.const_get :Rest
96
+ end
97
+ service_module.const_defined? :Client
98
+ rescue ::LoadError
99
+ false
100
+ end
101
+
66
102
  ##
67
103
  # Create a new client object for ProductsService.
68
104
  #
@@ -76,6 +112,11 @@ module Google
76
112
  # You can also specify a different transport by passing `:rest` or `:grpc` in
77
113
  # the `transport` parameter.
78
114
  #
115
+ # Raises an exception if the currently installed versioned client gem for the
116
+ # given API version does not support the given transport of the ProductsService service.
117
+ # You can determine whether the method will succeed by calling
118
+ # {Google::Shopping::Merchant::Products.products_service_available?}.
119
+ #
79
120
  # ## About ProductsService
80
121
  #
81
122
  # Service to use Product resource.
@@ -97,6 +138,37 @@ module Google
97
138
  service_module = service_module.const_get(:Rest) if transport == :rest
98
139
  service_module.const_get(:Client).new(&block)
99
140
  end
141
+
142
+ ##
143
+ # Determines whether the ProductsService service is supported by the current client.
144
+ # If true, you can retrieve a client object by calling {Google::Shopping::Merchant::Products.products_service}.
145
+ # If false, that method will raise an exception. This could happen if the given
146
+ # API version does not exist or does not support the ProductsService service,
147
+ # or if the versioned client gem needs an update to support the ProductsService service.
148
+ #
149
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
150
+ # Defaults to `:v1beta`.
151
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
152
+ # @return [boolean] Whether the service is available.
153
+ #
154
+ def self.products_service_available? version: :v1beta, transport: :grpc
155
+ require "google/shopping/merchant/products/#{version.to_s.downcase}"
156
+ package_name = Google::Shopping::Merchant::Products
157
+ .constants
158
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
159
+ .first
160
+ return false unless package_name
161
+ service_module = Google::Shopping::Merchant::Products.const_get package_name
162
+ return false unless service_module.const_defined? :ProductsService
163
+ service_module = service_module.const_get :ProductsService
164
+ if transport == :rest
165
+ return false unless service_module.const_defined? :Rest
166
+ service_module = service_module.const_get :Rest
167
+ end
168
+ service_module.const_defined? :Client
169
+ rescue ::LoadError
170
+ false
171
+ end
100
172
  end
101
173
  end
102
174
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-shopping-merchant-products
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.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-12-10 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: google-cloud-core
@@ -73,7 +72,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
73
72
  licenses:
74
73
  - Apache-2.0
75
74
  metadata: {}
76
- post_install_message:
77
75
  rdoc_options: []
78
76
  require_paths:
79
77
  - lib
@@ -81,15 +79,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
81
79
  requirements:
82
80
  - - ">="
83
81
  - !ruby/object:Gem::Version
84
- version: '2.7'
82
+ version: '3.0'
85
83
  required_rubygems_version: !ruby/object:Gem::Requirement
86
84
  requirements:
87
85
  - - ">="
88
86
  - !ruby/object:Gem::Version
89
87
  version: '0'
90
88
  requirements: []
91
- rubygems_version: 3.5.23
92
- signing_key:
89
+ rubygems_version: 3.6.2
93
90
  specification_version: 4
94
91
  summary: Programmatically manage your Merchant Center Accounts.
95
92
  test_files: []