google-shopping-merchant-inventories 0.2.0 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 436f63b7d1be24098357e2a142d0eedc6427d090b9c8ce5490dd34eb983ddb24
4
- data.tar.gz: df486898988c03cbc670c45708c95b010e1f21ae200fd1b9857ac02bc9c0ec5d
3
+ metadata.gz: f47927a7b9c00f9bd2c0b1d658546fff081e69da36ff75ca75827c59f2050ae2
4
+ data.tar.gz: a3c58725bdc098cb8008eb924debe489aed7508f58b27acd0b10e2ddd48c4919
5
5
  SHA512:
6
- metadata.gz: d920abad78d1289653a0d9191ffd3c50f45b909b3f0feeeb5a4522ce285318516b47426ccc88531874a5e389f2d2d8f079943d49f62df9fa2284ada6909eb39e
7
- data.tar.gz: 4dc59a867157135cdc9cbffcb0e0e8ebe5f7ee514958637cdb190316c6da59b46027010354a19396633b6d0a7defc8323d6c9f789cc080aeeaf601527d36fdf9
6
+ metadata.gz: f0f0b6e549f1a769cd972129f7adbf59519682b8be1adbc163749bd81199c657011ab46507473d85180ff3563ece7d4cc6cc8e8e1e456f60e60d458ed5456b22
7
+ data.tar.gz: 862a9221c16d96435e844dade3f273bc0aa5024bcd3fe3697f76e5eac4f6b673e0d798f6078f7f69595769cdb10f92953bd8837334271133f82f5c560d70d36a
data/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  Programmatically manage your Merchant Center accounts.
4
4
 
5
- Programmatically manage your Merchant Center accounts.
6
5
 
7
6
  Actual client classes for the various versions of this API are defined in
8
7
  _versioned_ client gems, with names of the form `google-shopping-merchant-inventories-v*`.
@@ -34,9 +33,39 @@ In order to use this library, you first need to go through the following steps:
34
33
  1. [Enable the API.](https://console.cloud.google.com/apis/library/merchantapi.googleapis.com)
35
34
  1. {file:AUTHENTICATION.md Set up authentication.}
36
35
 
36
+ ## Debug Logging
37
+
38
+ This library comes with opt-in Debug Logging that can help you troubleshoot
39
+ your application's integration with the API. When logging is activated, key
40
+ events such as requests and responses, along with data payloads and metadata
41
+ such as headers and client configuration, are logged to the standard error
42
+ stream.
43
+
44
+ **WARNING:** Client Library Debug Logging includes your data payloads in
45
+ plaintext, which could include sensitive data such as PII for yourself or your
46
+ customers, private keys, or other security data that could be compromising if
47
+ leaked. Always practice good data hygiene with your application logs, and follow
48
+ the principle of least access. Google also recommends that Client Library Debug
49
+ Logging be enabled only temporarily during active debugging, and not used
50
+ permanently in production.
51
+
52
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
53
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
54
+ list of client library gem names. This will select the default logging behavior,
55
+ which writes logs to the standard error stream. On a local workstation, this may
56
+ result in logs appearing on the console. When running on a Google Cloud hosting
57
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
58
+ results in logs appearing alongside your application logs in the
59
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
60
+
61
+ Debug logging also requires that the versioned clients for this service be
62
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
63
+ working, try updating the versioned clients in your bundle or installed gems:
64
+ [google-shopping-merchant-inventories-v1beta](https://rubydoc.info/gems/google-shopping-merchant-inventories-v1beta).
65
+
37
66
  ## Supported Ruby Versions
38
67
 
39
- This library is supported on Ruby 2.6+.
68
+ This library is supported on Ruby 3.0+.
40
69
 
41
70
  Google provides official support for Ruby versions that are actively supported
42
71
  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 Inventories
24
- VERSION = "0.2.0"
24
+ VERSION = "0.4.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 LocalInventoryService service.
46
+ # You can determine whether the method will succeed by calling
47
+ # {Google::Shopping::Merchant::Inventories.local_inventory_service_available?}.
48
+ #
44
49
  # ## About LocalInventoryService
45
50
  #
46
51
  # Service to manage local inventory for products
@@ -62,6 +67,37 @@ module Google
62
67
  service_module.const_get(:Client).new(&block)
63
68
  end
64
69
 
70
+ ##
71
+ # Determines whether the LocalInventoryService service is supported by the current client.
72
+ # If true, you can retrieve a client object by calling {Google::Shopping::Merchant::Inventories.local_inventory_service}.
73
+ # If false, that method will raise an exception. This could happen if the given
74
+ # API version does not exist or does not support the LocalInventoryService service,
75
+ # or if the versioned client gem needs an update to support the LocalInventoryService service.
76
+ #
77
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
78
+ # Defaults to `:v1beta`.
79
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
80
+ # @return [boolean] Whether the service is available.
81
+ #
82
+ def self.local_inventory_service_available? version: :v1beta, transport: :grpc
83
+ require "google/shopping/merchant/inventories/#{version.to_s.downcase}"
84
+ package_name = Google::Shopping::Merchant::Inventories
85
+ .constants
86
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
87
+ .first
88
+ return false unless package_name
89
+ service_module = Google::Shopping::Merchant::Inventories.const_get package_name
90
+ return false unless service_module.const_defined? :LocalInventoryService
91
+ service_module = service_module.const_get :LocalInventoryService
92
+ if transport == :rest
93
+ return false unless service_module.const_defined? :Rest
94
+ service_module = service_module.const_get :Rest
95
+ end
96
+ service_module.const_defined? :Client
97
+ rescue ::LoadError
98
+ false
99
+ end
100
+
65
101
  ##
66
102
  # Create a new client object for RegionalInventoryService.
67
103
  #
@@ -75,6 +111,11 @@ module Google
75
111
  # You can also specify a different transport by passing `:rest` or `:grpc` in
76
112
  # the `transport` parameter.
77
113
  #
114
+ # Raises an exception if the currently installed versioned client gem for the
115
+ # given API version does not support the given transport of the RegionalInventoryService service.
116
+ # You can determine whether the method will succeed by calling
117
+ # {Google::Shopping::Merchant::Inventories.regional_inventory_service_available?}.
118
+ #
78
119
  # ## About RegionalInventoryService
79
120
  #
80
121
  # Service to manage regional inventory for products. There is also separate
@@ -96,6 +137,37 @@ module Google
96
137
  service_module = service_module.const_get(:Rest) if transport == :rest
97
138
  service_module.const_get(:Client).new(&block)
98
139
  end
140
+
141
+ ##
142
+ # Determines whether the RegionalInventoryService service is supported by the current client.
143
+ # If true, you can retrieve a client object by calling {Google::Shopping::Merchant::Inventories.regional_inventory_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 RegionalInventoryService service,
146
+ # or if the versioned client gem needs an update to support the RegionalInventoryService 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.regional_inventory_service_available? version: :v1beta, transport: :grpc
154
+ require "google/shopping/merchant/inventories/#{version.to_s.downcase}"
155
+ package_name = Google::Shopping::Merchant::Inventories
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::Inventories.const_get package_name
161
+ return false unless service_module.const_defined? :RegionalInventoryService
162
+ service_module = service_module.const_get :RegionalInventoryService
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
99
171
  end
100
172
  end
101
173
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-shopping-merchant-inventories
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.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-01-15 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
@@ -44,118 +43,6 @@ dependencies:
44
43
  - - "<"
45
44
  - !ruby/object:Gem::Version
46
45
  version: 2.a
47
- - !ruby/object:Gem::Dependency
48
- name: google-style
49
- requirement: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: 1.26.1
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: 1.26.1
61
- - !ruby/object:Gem::Dependency
62
- name: minitest
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '5.16'
68
- type: :development
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: '5.16'
75
- - !ruby/object:Gem::Dependency
76
- name: minitest-focus
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: '1.1'
82
- type: :development
83
- prerelease: false
84
- version_requirements: !ruby/object:Gem::Requirement
85
- requirements:
86
- - - "~>"
87
- - !ruby/object:Gem::Version
88
- version: '1.1'
89
- - !ruby/object:Gem::Dependency
90
- name: minitest-rg
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: '5.2'
96
- type: :development
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: '5.2'
103
- - !ruby/object:Gem::Dependency
104
- name: rake
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - ">="
108
- - !ruby/object:Gem::Version
109
- version: '13.0'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- version: '13.0'
117
- - !ruby/object:Gem::Dependency
118
- name: redcarpet
119
- requirement: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - "~>"
122
- - !ruby/object:Gem::Version
123
- version: '3.0'
124
- type: :development
125
- prerelease: false
126
- version_requirements: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - "~>"
129
- - !ruby/object:Gem::Version
130
- version: '3.0'
131
- - !ruby/object:Gem::Dependency
132
- name: simplecov
133
- requirement: !ruby/object:Gem::Requirement
134
- requirements:
135
- - - "~>"
136
- - !ruby/object:Gem::Version
137
- version: '0.9'
138
- type: :development
139
- prerelease: false
140
- version_requirements: !ruby/object:Gem::Requirement
141
- requirements:
142
- - - "~>"
143
- - !ruby/object:Gem::Version
144
- version: '0.9'
145
- - !ruby/object:Gem::Dependency
146
- name: yard
147
- requirement: !ruby/object:Gem::Requirement
148
- requirements:
149
- - - "~>"
150
- - !ruby/object:Gem::Version
151
- version: '0.9'
152
- type: :development
153
- prerelease: false
154
- version_requirements: !ruby/object:Gem::Requirement
155
- requirements:
156
- - - "~>"
157
- - !ruby/object:Gem::Version
158
- version: '0.9'
159
46
  description: Programmatically manage your Merchant Center accounts.
160
47
  email: googleapis-packages@google.com
161
48
  executables: []
@@ -173,7 +60,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
173
60
  licenses:
174
61
  - Apache-2.0
175
62
  metadata: {}
176
- post_install_message:
177
63
  rdoc_options: []
178
64
  require_paths:
179
65
  - lib
@@ -181,15 +67,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
181
67
  requirements:
182
68
  - - ">="
183
69
  - !ruby/object:Gem::Version
184
- version: '2.6'
70
+ version: '3.0'
185
71
  required_rubygems_version: !ruby/object:Gem::Requirement
186
72
  requirements:
187
73
  - - ">="
188
74
  - !ruby/object:Gem::Version
189
75
  version: '0'
190
76
  requirements: []
191
- rubygems_version: 3.5.3
192
- signing_key:
77
+ rubygems_version: 3.6.2
193
78
  specification_version: 4
194
79
  summary: Programmatically manage your Merchant Center accounts.
195
80
  test_files: []