google-shopping-merchant-products 0.1.2 → 0.2.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 +4 -4
- data/README.md +6 -1
- data/lib/google/shopping/merchant/products/version.rb +1 -1
- data/lib/google/shopping/merchant/products.rb +72 -1
- metadata +4 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aaab4c31a579d2d2cc0a762a18882ed576d0f143645110fb52a4954cddee006f
|
4
|
+
data.tar.gz: 0ec872c087f57e2b9e90ccd4c6c3825e3b84920bc56e6d58fcc46026a9b571df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d0fb530653757513f1dce84e2e0f748061c0834808bf50bb033ae3ed2313ae2a522649423e28a9def6fe88649cb1e6c2b364dd182b4b265113f722d8a7514d9
|
7
|
+
data.tar.gz: 23275e5b33531c7380ca81e4e90ef091ad5e1a4b186d3e5dc70f9f86f66e29cee36831690b2959a18cc9798b9354a0e8d7ff513d5ce22273348bb9c9eb04f60b
|
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
|
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
|
@@ -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,10 +112,14 @@ 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.
|
82
|
-
# This service works for products with online channel only.
|
83
123
|
#
|
84
124
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
85
125
|
# Defaults to `:v1beta`.
|
@@ -97,6 +137,37 @@ module Google
|
|
97
137
|
service_module = service_module.const_get(:Rest) if transport == :rest
|
98
138
|
service_module.const_get(:Client).new(&block)
|
99
139
|
end
|
140
|
+
|
141
|
+
##
|
142
|
+
# Determines whether the ProductsService service is supported by the current client.
|
143
|
+
# If true, you can retrieve a client object by calling {Google::Shopping::Merchant::Products.products_service}.
|
144
|
+
# If false, that method will raise an exception. This could happen if the given
|
145
|
+
# API version does not exist or does not support the ProductsService service,
|
146
|
+
# or if the versioned client gem needs an update to support the ProductsService service.
|
147
|
+
#
|
148
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
149
|
+
# Defaults to `:v1beta`.
|
150
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
151
|
+
# @return [boolean] Whether the service is available.
|
152
|
+
#
|
153
|
+
def self.products_service_available? version: :v1beta, transport: :grpc
|
154
|
+
require "google/shopping/merchant/products/#{version.to_s.downcase}"
|
155
|
+
package_name = Google::Shopping::Merchant::Products
|
156
|
+
.constants
|
157
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
158
|
+
.first
|
159
|
+
return false unless package_name
|
160
|
+
service_module = Google::Shopping::Merchant::Products.const_get package_name
|
161
|
+
return false unless service_module.const_defined? :ProductsService
|
162
|
+
service_module = service_module.const_get :ProductsService
|
163
|
+
if transport == :rest
|
164
|
+
return false unless service_module.const_defined? :Rest
|
165
|
+
service_module = service_module.const_get :Rest
|
166
|
+
end
|
167
|
+
service_module.const_defined? :Client
|
168
|
+
rescue ::LoadError
|
169
|
+
false
|
170
|
+
end
|
100
171
|
end
|
101
172
|
end
|
102
173
|
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
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-04-21 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: '
|
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
|
92
|
-
signing_key:
|
89
|
+
rubygems_version: 3.6.5
|
93
90
|
specification_version: 4
|
94
91
|
summary: Programmatically manage your Merchant Center Accounts.
|
95
92
|
test_files: []
|