google-shopping-css 1.0.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 +4 -4
- data/README.md +31 -1
- data/lib/google/shopping/css/version.rb +1 -1
- data/lib/google/shopping/css.rb +214 -0
- 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: d9c08b8481e5e5e013990f816993b7632da67dfd034762b34c137db8a28f2c66
|
4
|
+
data.tar.gz: 365f676672e129c6cbb9c530fc0ec79b5ed074cad9869da3b499ae78d9e27985
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7c6e809f23673c475ae330932c0b93534ef3739b6a3c6004211dd3d1cd88f5577c8b2fa643b986d73707919b62e6b1367cb8b8e97b41aacc05cffa04a374404
|
7
|
+
data.tar.gz: 7fc570d61c3b6c0c159b0e0fda80059d2720b83d6d0dd855f86b4ab8b3c8a9339e9267b60d72f2f9dce8aad90af11632be738e15c559a4d11f2bfe8ada94ce94
|
data/README.md
CHANGED
@@ -34,9 +34,39 @@ In order to use this library, you first need to go through the following steps:
|
|
34
34
|
1. [Enable the API.](https://console.cloud.google.com/apis/library/css.googleapis.com)
|
35
35
|
1. {file:AUTHENTICATION.md Set up authentication.}
|
36
36
|
|
37
|
+
## Debug Logging
|
38
|
+
|
39
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
40
|
+
your application's integration with the API. When logging is activated, key
|
41
|
+
events such as requests and responses, along with data payloads and metadata
|
42
|
+
such as headers and client configuration, are logged to the standard error
|
43
|
+
stream.
|
44
|
+
|
45
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
46
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
47
|
+
customers, private keys, or other security data that could be compromising if
|
48
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
49
|
+
the principle of least access. Google also recommends that Client Library Debug
|
50
|
+
Logging be enabled only temporarily during active debugging, and not used
|
51
|
+
permanently in production.
|
52
|
+
|
53
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
54
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
55
|
+
list of client library gem names. This will select the default logging behavior,
|
56
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
57
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
58
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
59
|
+
results in logs appearing alongside your application logs in the
|
60
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
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-css-v1](https://rubydoc.info/gems/google-shopping-css-v1).
|
66
|
+
|
37
67
|
## Supported Ruby Versions
|
38
68
|
|
39
|
-
This library is supported on Ruby
|
69
|
+
This library is supported on Ruby 3.0+.
|
40
70
|
|
41
71
|
Google provides official support for Ruby versions that are actively supported
|
42
72
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
data/lib/google/shopping/css.rb
CHANGED
@@ -40,6 +40,11 @@ module Google
|
|
40
40
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
41
41
|
# the `transport` parameter.
|
42
42
|
#
|
43
|
+
# Raises an exception if the currently installed versioned client gem for the
|
44
|
+
# given API version does not support the given transport of the AccountsService service.
|
45
|
+
# You can determine whether the method will succeed by calling
|
46
|
+
# {Google::Shopping::Css.accounts_service_available?}.
|
47
|
+
#
|
43
48
|
# ## About AccountsService
|
44
49
|
#
|
45
50
|
# Service for managing CSS/MC account information.
|
@@ -61,6 +66,37 @@ module Google
|
|
61
66
|
service_module.const_get(:Client).new(&block)
|
62
67
|
end
|
63
68
|
|
69
|
+
##
|
70
|
+
# Determines whether the AccountsService service is supported by the current client.
|
71
|
+
# If true, you can retrieve a client object by calling {Google::Shopping::Css.accounts_service}.
|
72
|
+
# If false, that method will raise an exception. This could happen if the given
|
73
|
+
# API version does not exist or does not support the AccountsService service,
|
74
|
+
# or if the versioned client gem needs an update to support the AccountsService service.
|
75
|
+
#
|
76
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
77
|
+
# Defaults to `:v1`.
|
78
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
79
|
+
# @return [boolean] Whether the service is available.
|
80
|
+
#
|
81
|
+
def self.accounts_service_available? version: :v1, transport: :grpc
|
82
|
+
require "google/shopping/css/#{version.to_s.downcase}"
|
83
|
+
package_name = Google::Shopping::Css
|
84
|
+
.constants
|
85
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
86
|
+
.first
|
87
|
+
return false unless package_name
|
88
|
+
service_module = Google::Shopping::Css.const_get package_name
|
89
|
+
return false unless service_module.const_defined? :AccountsService
|
90
|
+
service_module = service_module.const_get :AccountsService
|
91
|
+
if transport == :rest
|
92
|
+
return false unless service_module.const_defined? :Rest
|
93
|
+
service_module = service_module.const_get :Rest
|
94
|
+
end
|
95
|
+
service_module.const_defined? :Client
|
96
|
+
rescue ::LoadError
|
97
|
+
false
|
98
|
+
end
|
99
|
+
|
64
100
|
##
|
65
101
|
# Create a new client object for AccountLabelsService.
|
66
102
|
#
|
@@ -74,6 +110,11 @@ module Google
|
|
74
110
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
75
111
|
# the `transport` parameter.
|
76
112
|
#
|
113
|
+
# Raises an exception if the currently installed versioned client gem for the
|
114
|
+
# given API version does not support the given transport of the AccountLabelsService service.
|
115
|
+
# You can determine whether the method will succeed by calling
|
116
|
+
# {Google::Shopping::Css.account_labels_service_available?}.
|
117
|
+
#
|
77
118
|
# ## About AccountLabelsService
|
78
119
|
#
|
79
120
|
# Manages Merchant Center and CSS accounts labels.
|
@@ -95,6 +136,37 @@ module Google
|
|
95
136
|
service_module.const_get(:Client).new(&block)
|
96
137
|
end
|
97
138
|
|
139
|
+
##
|
140
|
+
# Determines whether the AccountLabelsService service is supported by the current client.
|
141
|
+
# If true, you can retrieve a client object by calling {Google::Shopping::Css.account_labels_service}.
|
142
|
+
# If false, that method will raise an exception. This could happen if the given
|
143
|
+
# API version does not exist or does not support the AccountLabelsService service,
|
144
|
+
# or if the versioned client gem needs an update to support the AccountLabelsService service.
|
145
|
+
#
|
146
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
147
|
+
# Defaults to `:v1`.
|
148
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
149
|
+
# @return [boolean] Whether the service is available.
|
150
|
+
#
|
151
|
+
def self.account_labels_service_available? version: :v1, transport: :grpc
|
152
|
+
require "google/shopping/css/#{version.to_s.downcase}"
|
153
|
+
package_name = Google::Shopping::Css
|
154
|
+
.constants
|
155
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
156
|
+
.first
|
157
|
+
return false unless package_name
|
158
|
+
service_module = Google::Shopping::Css.const_get package_name
|
159
|
+
return false unless service_module.const_defined? :AccountLabelsService
|
160
|
+
service_module = service_module.const_get :AccountLabelsService
|
161
|
+
if transport == :rest
|
162
|
+
return false unless service_module.const_defined? :Rest
|
163
|
+
service_module = service_module.const_get :Rest
|
164
|
+
end
|
165
|
+
service_module.const_defined? :Client
|
166
|
+
rescue ::LoadError
|
167
|
+
false
|
168
|
+
end
|
169
|
+
|
98
170
|
##
|
99
171
|
# Create a new client object for CssProductInputsService.
|
100
172
|
#
|
@@ -108,6 +180,11 @@ module Google
|
|
108
180
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
109
181
|
# the `transport` parameter.
|
110
182
|
#
|
183
|
+
# Raises an exception if the currently installed versioned client gem for the
|
184
|
+
# given API version does not support the given transport of the CssProductInputsService service.
|
185
|
+
# You can determine whether the method will succeed by calling
|
186
|
+
# {Google::Shopping::Css.css_product_inputs_service_available?}.
|
187
|
+
#
|
111
188
|
# ## About CssProductInputsService
|
112
189
|
#
|
113
190
|
# Service to use CssProductInput resource.
|
@@ -130,6 +207,37 @@ module Google
|
|
130
207
|
service_module.const_get(:Client).new(&block)
|
131
208
|
end
|
132
209
|
|
210
|
+
##
|
211
|
+
# Determines whether the CssProductInputsService service is supported by the current client.
|
212
|
+
# If true, you can retrieve a client object by calling {Google::Shopping::Css.css_product_inputs_service}.
|
213
|
+
# If false, that method will raise an exception. This could happen if the given
|
214
|
+
# API version does not exist or does not support the CssProductInputsService service,
|
215
|
+
# or if the versioned client gem needs an update to support the CssProductInputsService service.
|
216
|
+
#
|
217
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
218
|
+
# Defaults to `:v1`.
|
219
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
220
|
+
# @return [boolean] Whether the service is available.
|
221
|
+
#
|
222
|
+
def self.css_product_inputs_service_available? version: :v1, transport: :grpc
|
223
|
+
require "google/shopping/css/#{version.to_s.downcase}"
|
224
|
+
package_name = Google::Shopping::Css
|
225
|
+
.constants
|
226
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
227
|
+
.first
|
228
|
+
return false unless package_name
|
229
|
+
service_module = Google::Shopping::Css.const_get package_name
|
230
|
+
return false unless service_module.const_defined? :CssProductInputsService
|
231
|
+
service_module = service_module.const_get :CssProductInputsService
|
232
|
+
if transport == :rest
|
233
|
+
return false unless service_module.const_defined? :Rest
|
234
|
+
service_module = service_module.const_get :Rest
|
235
|
+
end
|
236
|
+
service_module.const_defined? :Client
|
237
|
+
rescue ::LoadError
|
238
|
+
false
|
239
|
+
end
|
240
|
+
|
133
241
|
##
|
134
242
|
# Create a new client object for CssProductsService.
|
135
243
|
#
|
@@ -143,6 +251,11 @@ module Google
|
|
143
251
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
144
252
|
# the `transport` parameter.
|
145
253
|
#
|
254
|
+
# Raises an exception if the currently installed versioned client gem for the
|
255
|
+
# given API version does not support the given transport of the CssProductsService service.
|
256
|
+
# You can determine whether the method will succeed by calling
|
257
|
+
# {Google::Shopping::Css.css_products_service_available?}.
|
258
|
+
#
|
146
259
|
# ## About CssProductsService
|
147
260
|
#
|
148
261
|
# Service for doing get and list on Css Products(a.k.a Aggregate Offers
|
@@ -164,6 +277,107 @@ module Google
|
|
164
277
|
service_module = service_module.const_get(:Rest) if transport == :rest
|
165
278
|
service_module.const_get(:Client).new(&block)
|
166
279
|
end
|
280
|
+
|
281
|
+
##
|
282
|
+
# Determines whether the CssProductsService service is supported by the current client.
|
283
|
+
# If true, you can retrieve a client object by calling {Google::Shopping::Css.css_products_service}.
|
284
|
+
# If false, that method will raise an exception. This could happen if the given
|
285
|
+
# API version does not exist or does not support the CssProductsService service,
|
286
|
+
# or if the versioned client gem needs an update to support the CssProductsService service.
|
287
|
+
#
|
288
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
289
|
+
# Defaults to `:v1`.
|
290
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
291
|
+
# @return [boolean] Whether the service is available.
|
292
|
+
#
|
293
|
+
def self.css_products_service_available? version: :v1, transport: :grpc
|
294
|
+
require "google/shopping/css/#{version.to_s.downcase}"
|
295
|
+
package_name = Google::Shopping::Css
|
296
|
+
.constants
|
297
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
298
|
+
.first
|
299
|
+
return false unless package_name
|
300
|
+
service_module = Google::Shopping::Css.const_get package_name
|
301
|
+
return false unless service_module.const_defined? :CssProductsService
|
302
|
+
service_module = service_module.const_get :CssProductsService
|
303
|
+
if transport == :rest
|
304
|
+
return false unless service_module.const_defined? :Rest
|
305
|
+
service_module = service_module.const_get :Rest
|
306
|
+
end
|
307
|
+
service_module.const_defined? :Client
|
308
|
+
rescue ::LoadError
|
309
|
+
false
|
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
|
167
381
|
end
|
168
382
|
end
|
169
383
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-shopping-css
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.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:
|
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
|
@@ -62,7 +61,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
|
|
62
61
|
licenses:
|
63
62
|
- Apache-2.0
|
64
63
|
metadata: {}
|
65
|
-
post_install_message:
|
66
64
|
rdoc_options: []
|
67
65
|
require_paths:
|
68
66
|
- lib
|
@@ -70,15 +68,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
70
68
|
requirements:
|
71
69
|
- - ">="
|
72
70
|
- !ruby/object:Gem::Version
|
73
|
-
version: '
|
71
|
+
version: '3.0'
|
74
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
73
|
requirements:
|
76
74
|
- - ">="
|
77
75
|
- !ruby/object:Gem::Version
|
78
76
|
version: '0'
|
79
77
|
requirements: []
|
80
|
-
rubygems_version: 3.5
|
81
|
-
signing_key:
|
78
|
+
rubygems_version: 3.6.5
|
82
79
|
specification_version: 4
|
83
80
|
summary: Programmatically manage your Comparison Shopping Service (CSS) account data
|
84
81
|
at scale.
|