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 +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 -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: 23f03e4ec1e03516cfec34200541afb94191002b6480b6c438747712e3f04597
|
4
|
+
data.tar.gz: cb67861cb387aa861ecde6aaf4c976f454898744885c3ce69f90e3440de0d297
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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,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.
|
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:
|
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: '
|
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.
|
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: []
|