google-apis-merchantapi_inventories_v1beta 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,303 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module MerchantapiInventoriesV1beta
23
+ # Merchant API
24
+ #
25
+ # Programmatically manage your Merchant Center Accounts.
26
+ #
27
+ # @example
28
+ # require 'google/apis/merchantapi_inventories_v1beta'
29
+ #
30
+ # Merchantapi = Google::Apis::MerchantapiInventoriesV1beta # Alias the module
31
+ # service = Merchantapi::MerchantService.new
32
+ #
33
+ # @see https://developers.devsite.corp.google.com/merchant/api
34
+ class MerchantService < Google::Apis::Core::BaseService
35
+ DEFAULT_ENDPOINT_TEMPLATE = "https://merchantapi.$UNIVERSE_DOMAIN$/"
36
+
37
+ # @return [String]
38
+ # API key. Your API key identifies your project and provides you with API access,
39
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
40
+ attr_accessor :key
41
+
42
+ # @return [String]
43
+ # Available to use for quota purposes for server-side applications. Can be any
44
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
45
+ attr_accessor :quota_user
46
+
47
+ def initialize
48
+ super(DEFAULT_ENDPOINT_TEMPLATE, '',
49
+ client_name: 'google-apis-merchantapi_inventories_v1beta',
50
+ client_version: Google::Apis::MerchantapiInventoriesV1beta::GEM_VERSION)
51
+ @batch_path = 'batch'
52
+ end
53
+
54
+ # Deletes the specified `LocalInventory` from the given product in your merchant
55
+ # account. It might take a up to an hour for the `LocalInventory` to be deleted
56
+ # from the specific product. Once you have received a successful delete response,
57
+ # wait for that period before attempting a delete again.
58
+ # @param [String] name
59
+ # Required. The name of the local inventory for the given product to delete.
60
+ # Format: `accounts/`account`/products/`product`/localInventories/`store_code``
61
+ # @param [String] fields
62
+ # Selector specifying which fields to include in a partial response.
63
+ # @param [String] quota_user
64
+ # Available to use for quota purposes for server-side applications. Can be any
65
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
66
+ # @param [Google::Apis::RequestOptions] options
67
+ # Request-specific options
68
+ #
69
+ # @yield [result, err] Result & error if block supplied
70
+ # @yieldparam result [Google::Apis::MerchantapiInventoriesV1beta::Empty] parsed result object
71
+ # @yieldparam err [StandardError] error object if request failed
72
+ #
73
+ # @return [Google::Apis::MerchantapiInventoriesV1beta::Empty]
74
+ #
75
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
76
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
77
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
78
+ def delete_account_product_local_inventory(name, fields: nil, quota_user: nil, options: nil, &block)
79
+ command = make_simple_command(:delete, 'inventories/v1beta/{+name}', options)
80
+ command.response_representation = Google::Apis::MerchantapiInventoriesV1beta::Empty::Representation
81
+ command.response_class = Google::Apis::MerchantapiInventoriesV1beta::Empty
82
+ command.params['name'] = name unless name.nil?
83
+ command.query['fields'] = fields unless fields.nil?
84
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
85
+ execute_or_queue_command(command, &block)
86
+ end
87
+
88
+ # Inserts a `LocalInventory` resource to a product in your merchant account.
89
+ # Replaces the full `LocalInventory` resource if an entry with the same `
90
+ # storeCode` already exists for the product. It might take up to 30 minutes for
91
+ # the new or updated `LocalInventory` resource to appear in products.
92
+ # @param [String] parent
93
+ # Required. The account and product where this inventory will be inserted.
94
+ # Format: `accounts/`account`/products/`product``
95
+ # @param [Google::Apis::MerchantapiInventoriesV1beta::LocalInventory] local_inventory_object
96
+ # @param [String] fields
97
+ # Selector specifying which fields to include in a partial response.
98
+ # @param [String] quota_user
99
+ # Available to use for quota purposes for server-side applications. Can be any
100
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
101
+ # @param [Google::Apis::RequestOptions] options
102
+ # Request-specific options
103
+ #
104
+ # @yield [result, err] Result & error if block supplied
105
+ # @yieldparam result [Google::Apis::MerchantapiInventoriesV1beta::LocalInventory] parsed result object
106
+ # @yieldparam err [StandardError] error object if request failed
107
+ #
108
+ # @return [Google::Apis::MerchantapiInventoriesV1beta::LocalInventory]
109
+ #
110
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
111
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
112
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
113
+ def insert_account_product_local_inventory(parent, local_inventory_object = nil, fields: nil, quota_user: nil, options: nil, &block)
114
+ command = make_simple_command(:post, 'inventories/v1beta/{+parent}/localInventories:insert', options)
115
+ command.request_representation = Google::Apis::MerchantapiInventoriesV1beta::LocalInventory::Representation
116
+ command.request_object = local_inventory_object
117
+ command.response_representation = Google::Apis::MerchantapiInventoriesV1beta::LocalInventory::Representation
118
+ command.response_class = Google::Apis::MerchantapiInventoriesV1beta::LocalInventory
119
+ command.params['parent'] = parent unless parent.nil?
120
+ command.query['fields'] = fields unless fields.nil?
121
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
122
+ execute_or_queue_command(command, &block)
123
+ end
124
+
125
+ # Lists the `LocalInventory` resources for the given product in your merchant
126
+ # account. The response might contain fewer items than specified by `pageSize`.
127
+ # If `pageToken` was returned in previous request, it can be used to obtain
128
+ # additional results. `LocalInventory` resources are listed per product for a
129
+ # given account.
130
+ # @param [String] parent
131
+ # Required. The `name` of the parent product to list local inventories for.
132
+ # Format: `accounts/`account`/products/`product``
133
+ # @param [Fixnum] page_size
134
+ # The maximum number of `LocalInventory` resources for the given product to
135
+ # return. The service returns fewer than this value if the number of inventories
136
+ # for the given product is less that than the `pageSize`. The default value is
137
+ # 25000. The maximum value is 25000; If a value higher than the maximum is
138
+ # specified, then the `pageSize` will default to the maximum
139
+ # @param [String] page_token
140
+ # A page token, received from a previous `ListLocalInventories` call. Provide
141
+ # the page token to retrieve the subsequent page. When paginating, all other
142
+ # parameters provided to `ListLocalInventories` must match the call that
143
+ # provided the page token. The token returned as nextPageToken in the response
144
+ # to the previous request.
145
+ # @param [String] fields
146
+ # Selector specifying which fields to include in a partial response.
147
+ # @param [String] quota_user
148
+ # Available to use for quota purposes for server-side applications. Can be any
149
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
150
+ # @param [Google::Apis::RequestOptions] options
151
+ # Request-specific options
152
+ #
153
+ # @yield [result, err] Result & error if block supplied
154
+ # @yieldparam result [Google::Apis::MerchantapiInventoriesV1beta::ListLocalInventoriesResponse] parsed result object
155
+ # @yieldparam err [StandardError] error object if request failed
156
+ #
157
+ # @return [Google::Apis::MerchantapiInventoriesV1beta::ListLocalInventoriesResponse]
158
+ #
159
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
160
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
161
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
162
+ def list_account_product_local_inventories(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
163
+ command = make_simple_command(:get, 'inventories/v1beta/{+parent}/localInventories', options)
164
+ command.response_representation = Google::Apis::MerchantapiInventoriesV1beta::ListLocalInventoriesResponse::Representation
165
+ command.response_class = Google::Apis::MerchantapiInventoriesV1beta::ListLocalInventoriesResponse
166
+ command.params['parent'] = parent unless parent.nil?
167
+ command.query['pageSize'] = page_size unless page_size.nil?
168
+ command.query['pageToken'] = page_token unless page_token.nil?
169
+ command.query['fields'] = fields unless fields.nil?
170
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
171
+ execute_or_queue_command(command, &block)
172
+ end
173
+
174
+ # Deletes the specified `RegionalInventory` resource from the given product in
175
+ # your merchant account. It might take up to an hour for the `RegionalInventory`
176
+ # to be deleted from the specific product. Once you have received a successful
177
+ # delete response, wait for that period before attempting a delete again.
178
+ # @param [String] name
179
+ # Required. The name of the `RegionalInventory` resource to delete. Format: `
180
+ # accounts/`account`/products/`product`/regionalInventories/`region``
181
+ # @param [String] fields
182
+ # Selector specifying which fields to include in a partial response.
183
+ # @param [String] quota_user
184
+ # Available to use for quota purposes for server-side applications. Can be any
185
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
186
+ # @param [Google::Apis::RequestOptions] options
187
+ # Request-specific options
188
+ #
189
+ # @yield [result, err] Result & error if block supplied
190
+ # @yieldparam result [Google::Apis::MerchantapiInventoriesV1beta::Empty] parsed result object
191
+ # @yieldparam err [StandardError] error object if request failed
192
+ #
193
+ # @return [Google::Apis::MerchantapiInventoriesV1beta::Empty]
194
+ #
195
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
196
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
197
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
198
+ def delete_account_product_regional_inventory(name, fields: nil, quota_user: nil, options: nil, &block)
199
+ command = make_simple_command(:delete, 'inventories/v1beta/{+name}', options)
200
+ command.response_representation = Google::Apis::MerchantapiInventoriesV1beta::Empty::Representation
201
+ command.response_class = Google::Apis::MerchantapiInventoriesV1beta::Empty
202
+ command.params['name'] = name unless name.nil?
203
+ command.query['fields'] = fields unless fields.nil?
204
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
205
+ execute_or_queue_command(command, &block)
206
+ end
207
+
208
+ # Inserts a `RegionalInventory` to a given product in your merchant account.
209
+ # Replaces the full `RegionalInventory` resource if an entry with the same `
210
+ # region` already exists for the product. It might take up to 30 minutes for the
211
+ # new or updated `RegionalInventory` resource to appear in products.
212
+ # @param [String] parent
213
+ # Required. The account and product where this inventory will be inserted.
214
+ # Format: `accounts/`account`/products/`product``
215
+ # @param [Google::Apis::MerchantapiInventoriesV1beta::RegionalInventory] regional_inventory_object
216
+ # @param [String] fields
217
+ # Selector specifying which fields to include in a partial response.
218
+ # @param [String] quota_user
219
+ # Available to use for quota purposes for server-side applications. Can be any
220
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
221
+ # @param [Google::Apis::RequestOptions] options
222
+ # Request-specific options
223
+ #
224
+ # @yield [result, err] Result & error if block supplied
225
+ # @yieldparam result [Google::Apis::MerchantapiInventoriesV1beta::RegionalInventory] parsed result object
226
+ # @yieldparam err [StandardError] error object if request failed
227
+ #
228
+ # @return [Google::Apis::MerchantapiInventoriesV1beta::RegionalInventory]
229
+ #
230
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
231
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
232
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
233
+ def insert_account_product_regional_inventory(parent, regional_inventory_object = nil, fields: nil, quota_user: nil, options: nil, &block)
234
+ command = make_simple_command(:post, 'inventories/v1beta/{+parent}/regionalInventories:insert', options)
235
+ command.request_representation = Google::Apis::MerchantapiInventoriesV1beta::RegionalInventory::Representation
236
+ command.request_object = regional_inventory_object
237
+ command.response_representation = Google::Apis::MerchantapiInventoriesV1beta::RegionalInventory::Representation
238
+ command.response_class = Google::Apis::MerchantapiInventoriesV1beta::RegionalInventory
239
+ command.params['parent'] = parent unless parent.nil?
240
+ command.query['fields'] = fields unless fields.nil?
241
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
242
+ execute_or_queue_command(command, &block)
243
+ end
244
+
245
+ # Lists the `RegionalInventory` resources for the given product in your merchant
246
+ # account. The response might contain fewer items than specified by `pageSize`.
247
+ # If `pageToken` was returned in previous request, it can be used to obtain
248
+ # additional results. `RegionalInventory` resources are listed per product for a
249
+ # given account.
250
+ # @param [String] parent
251
+ # Required. The `name` of the parent product to list `RegionalInventory`
252
+ # resources for. Format: `accounts/`account`/products/`product``
253
+ # @param [Fixnum] page_size
254
+ # The maximum number of `RegionalInventory` resources for the given product to
255
+ # return. The service returns fewer than this value if the number of inventories
256
+ # for the given product is less that than the `pageSize`. The default value is
257
+ # 25000. The maximum value is 100000; If a value higher than the maximum is
258
+ # specified, then the `pageSize` will default to the maximum.
259
+ # @param [String] page_token
260
+ # A page token, received from a previous `ListRegionalInventories` call. Provide
261
+ # the page token to retrieve the subsequent page. When paginating, all other
262
+ # parameters provided to `ListRegionalInventories` must match the call that
263
+ # provided the page token. The token returned as nextPageToken in the response
264
+ # to the previous request.
265
+ # @param [String] fields
266
+ # Selector specifying which fields to include in a partial response.
267
+ # @param [String] quota_user
268
+ # Available to use for quota purposes for server-side applications. Can be any
269
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
270
+ # @param [Google::Apis::RequestOptions] options
271
+ # Request-specific options
272
+ #
273
+ # @yield [result, err] Result & error if block supplied
274
+ # @yieldparam result [Google::Apis::MerchantapiInventoriesV1beta::ListRegionalInventoriesResponse] parsed result object
275
+ # @yieldparam err [StandardError] error object if request failed
276
+ #
277
+ # @return [Google::Apis::MerchantapiInventoriesV1beta::ListRegionalInventoriesResponse]
278
+ #
279
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
280
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
281
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
282
+ def list_account_product_regional_inventories(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
283
+ command = make_simple_command(:get, 'inventories/v1beta/{+parent}/regionalInventories', options)
284
+ command.response_representation = Google::Apis::MerchantapiInventoriesV1beta::ListRegionalInventoriesResponse::Representation
285
+ command.response_class = Google::Apis::MerchantapiInventoriesV1beta::ListRegionalInventoriesResponse
286
+ command.params['parent'] = parent unless parent.nil?
287
+ command.query['pageSize'] = page_size unless page_size.nil?
288
+ command.query['pageToken'] = page_token unless page_token.nil?
289
+ command.query['fields'] = fields unless fields.nil?
290
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
291
+ execute_or_queue_command(command, &block)
292
+ end
293
+
294
+ protected
295
+
296
+ def apply_command_defaults(command)
297
+ command.query['key'] = key unless key.nil?
298
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
299
+ end
300
+ end
301
+ end
302
+ end
303
+ end
@@ -0,0 +1,36 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/merchantapi_inventories_v1beta/service.rb'
16
+ require 'google/apis/merchantapi_inventories_v1beta/classes.rb'
17
+ require 'google/apis/merchantapi_inventories_v1beta/representations.rb'
18
+ require 'google/apis/merchantapi_inventories_v1beta/gem_version.rb'
19
+
20
+ module Google
21
+ module Apis
22
+ # Merchant API
23
+ #
24
+ # Programmatically manage your Merchant Center Accounts.
25
+ #
26
+ # @see https://developers.devsite.corp.google.com/merchant/api
27
+ module MerchantapiInventoriesV1beta
28
+ # Version of the Merchant API this client connects to.
29
+ # This is NOT the gem version.
30
+ VERSION = 'InventoriesV1beta'
31
+
32
+ # Manage your product listings and accounts for Google Shopping
33
+ AUTH_CONTENT = 'https://www.googleapis.com/auth/content'
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,15 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "google/apis/merchantapi_inventories_v1beta"
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-merchantapi_inventories_v1beta
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-06-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-apis-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.15.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: 2.a
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.15.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: 2.a
33
+ description: This is the simple REST client for Merchant API InventoriesV1beta. Simple
34
+ REST clients are Ruby client libraries that provide access to Google services via
35
+ their HTTP REST API endpoints. These libraries are generated and updated automatically
36
+ based on the discovery documents published by the service, and they handle most
37
+ concerns such as authentication, pagination, retry, timeouts, and logging. You can
38
+ use this client to access the Merchant API, but note that some services may provide
39
+ a separate modern client that is easier to use.
40
+ email: googleapis-packages@google.com
41
+ executables: []
42
+ extensions: []
43
+ extra_rdoc_files: []
44
+ files:
45
+ - ".yardopts"
46
+ - CHANGELOG.md
47
+ - LICENSE.md
48
+ - OVERVIEW.md
49
+ - lib/google-apis-merchantapi_inventories_v1beta.rb
50
+ - lib/google/apis/merchantapi_inventories_v1beta.rb
51
+ - lib/google/apis/merchantapi_inventories_v1beta/classes.rb
52
+ - lib/google/apis/merchantapi_inventories_v1beta/gem_version.rb
53
+ - lib/google/apis/merchantapi_inventories_v1beta/representations.rb
54
+ - lib/google/apis/merchantapi_inventories_v1beta/service.rb
55
+ homepage: https://github.com/google/google-api-ruby-client
56
+ licenses:
57
+ - Apache-2.0
58
+ metadata:
59
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
60
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-merchantapi_inventories_v1beta/CHANGELOG.md
61
+ documentation_uri: https://googleapis.dev/ruby/google-apis-merchantapi_inventories_v1beta/v0.1.0
62
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-merchantapi_inventories_v1beta
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '2.7'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubygems_version: 3.5.6
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: Simple REST client for Merchant API InventoriesV1beta
82
+ test_files: []