google-apis-merchantapi_products_v1beta 0.1.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.
@@ -0,0 +1,221 @@
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 MerchantapiProductsV1beta
23
+ # Merchant API
24
+ #
25
+ # Programmatically manage your Merchant Center Accounts.
26
+ #
27
+ # @example
28
+ # require 'google/apis/merchantapi_products_v1beta'
29
+ #
30
+ # Merchantapi = Google::Apis::MerchantapiProductsV1beta # 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_products_v1beta',
50
+ client_version: Google::Apis::MerchantapiProductsV1beta::GEM_VERSION)
51
+ @batch_path = 'batch'
52
+ end
53
+
54
+ # Deletes a product input from your Merchant Center account. After inserting,
55
+ # updating, or deleting a product input, it may take several minutes before the
56
+ # processed product can be retrieved.
57
+ # @param [String] name
58
+ # Required. The name of the product input resource to delete. Format: accounts/`
59
+ # account`/productInputs/`product`
60
+ # @param [String] data_source
61
+ # Required. The primary or supplemental data source from which the product input
62
+ # should be deleted. Format: `accounts/`account`/dataSources/`datasource``.
63
+ # @param [String] fields
64
+ # Selector specifying which fields to include in a partial response.
65
+ # @param [String] quota_user
66
+ # Available to use for quota purposes for server-side applications. Can be any
67
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
68
+ # @param [Google::Apis::RequestOptions] options
69
+ # Request-specific options
70
+ #
71
+ # @yield [result, err] Result & error if block supplied
72
+ # @yieldparam result [Google::Apis::MerchantapiProductsV1beta::Empty] parsed result object
73
+ # @yieldparam err [StandardError] error object if request failed
74
+ #
75
+ # @return [Google::Apis::MerchantapiProductsV1beta::Empty]
76
+ #
77
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
78
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
79
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
80
+ def delete_account_product_input(name, data_source: nil, fields: nil, quota_user: nil, options: nil, &block)
81
+ command = make_simple_command(:delete, 'products/v1beta/{+name}', options)
82
+ command.response_representation = Google::Apis::MerchantapiProductsV1beta::Empty::Representation
83
+ command.response_class = Google::Apis::MerchantapiProductsV1beta::Empty
84
+ command.params['name'] = name unless name.nil?
85
+ command.query['dataSource'] = data_source unless data_source.nil?
86
+ command.query['fields'] = fields unless fields.nil?
87
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
88
+ execute_or_queue_command(command, &block)
89
+ end
90
+
91
+ # Uploads a product input to your Merchant Center account. If an input with the
92
+ # same contentLanguage, offerId, and dataSource already exists, this method
93
+ # replaces that entry. After inserting, updating, or deleting a product input,
94
+ # it may take several minutes before the processed product can be retrieved.
95
+ # @param [String] parent
96
+ # Required. The account where this product will be inserted. Format: accounts/`
97
+ # account`
98
+ # @param [Google::Apis::MerchantapiProductsV1beta::ProductInput] product_input_object
99
+ # @param [String] data_source
100
+ # Required. The primary or supplemental product data source name. If the product
101
+ # already exists and data source provided is different, then the product will be
102
+ # moved to a new data source. Format: `accounts/`account`/dataSources/`
103
+ # datasource``.
104
+ # @param [String] fields
105
+ # Selector specifying which fields to include in a partial response.
106
+ # @param [String] quota_user
107
+ # Available to use for quota purposes for server-side applications. Can be any
108
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
109
+ # @param [Google::Apis::RequestOptions] options
110
+ # Request-specific options
111
+ #
112
+ # @yield [result, err] Result & error if block supplied
113
+ # @yieldparam result [Google::Apis::MerchantapiProductsV1beta::ProductInput] parsed result object
114
+ # @yieldparam err [StandardError] error object if request failed
115
+ #
116
+ # @return [Google::Apis::MerchantapiProductsV1beta::ProductInput]
117
+ #
118
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
119
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
120
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
121
+ def insert_account_product_input(parent, product_input_object = nil, data_source: nil, fields: nil, quota_user: nil, options: nil, &block)
122
+ command = make_simple_command(:post, 'products/v1beta/{+parent}/productInputs:insert', options)
123
+ command.request_representation = Google::Apis::MerchantapiProductsV1beta::ProductInput::Representation
124
+ command.request_object = product_input_object
125
+ command.response_representation = Google::Apis::MerchantapiProductsV1beta::ProductInput::Representation
126
+ command.response_class = Google::Apis::MerchantapiProductsV1beta::ProductInput
127
+ command.params['parent'] = parent unless parent.nil?
128
+ command.query['dataSource'] = data_source unless data_source.nil?
129
+ command.query['fields'] = fields unless fields.nil?
130
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
131
+ execute_or_queue_command(command, &block)
132
+ end
133
+
134
+ # Retrieves the processed product from your Merchant Center account. After
135
+ # inserting, updating, or deleting a product input, it may take several minutes
136
+ # before the updated final product can be retrieved.
137
+ # @param [String] name
138
+ # Required. The name of the product to retrieve. Format: `accounts/`account`/
139
+ # products/`product``
140
+ # @param [String] fields
141
+ # Selector specifying which fields to include in a partial response.
142
+ # @param [String] quota_user
143
+ # Available to use for quota purposes for server-side applications. Can be any
144
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
145
+ # @param [Google::Apis::RequestOptions] options
146
+ # Request-specific options
147
+ #
148
+ # @yield [result, err] Result & error if block supplied
149
+ # @yieldparam result [Google::Apis::MerchantapiProductsV1beta::Product] parsed result object
150
+ # @yieldparam err [StandardError] error object if request failed
151
+ #
152
+ # @return [Google::Apis::MerchantapiProductsV1beta::Product]
153
+ #
154
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
155
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
156
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
157
+ def get_account_product(name, fields: nil, quota_user: nil, options: nil, &block)
158
+ command = make_simple_command(:get, 'products/v1beta/{+name}', options)
159
+ command.response_representation = Google::Apis::MerchantapiProductsV1beta::Product::Representation
160
+ command.response_class = Google::Apis::MerchantapiProductsV1beta::Product
161
+ command.params['name'] = name unless name.nil?
162
+ command.query['fields'] = fields unless fields.nil?
163
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
164
+ execute_or_queue_command(command, &block)
165
+ end
166
+
167
+ # Lists the processed products in your Merchant Center account. The response
168
+ # might contain fewer items than specified by pageSize. Rely on pageToken to
169
+ # determine if there are more items to be requested. After inserting, updating,
170
+ # or deleting a product input, it may take several minutes before the updated
171
+ # processed product can be retrieved.
172
+ # @param [String] parent
173
+ # Required. The account to list processed products for. Format: accounts/`
174
+ # account`
175
+ # @param [Fixnum] page_size
176
+ # The maximum number of products to return. The service may return fewer than
177
+ # this value. The maximum value is 1000; values above 1000 will be coerced to
178
+ # 1000. If unspecified, the maximum number of products will be returned.
179
+ # @param [String] page_token
180
+ # A page token, received from a previous `ListProducts` call. Provide this to
181
+ # retrieve the subsequent page. When paginating, all other parameters provided
182
+ # to `ListProducts` must match the call that provided the page token.
183
+ # @param [String] fields
184
+ # Selector specifying which fields to include in a partial response.
185
+ # @param [String] quota_user
186
+ # Available to use for quota purposes for server-side applications. Can be any
187
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
188
+ # @param [Google::Apis::RequestOptions] options
189
+ # Request-specific options
190
+ #
191
+ # @yield [result, err] Result & error if block supplied
192
+ # @yieldparam result [Google::Apis::MerchantapiProductsV1beta::ListProductsResponse] parsed result object
193
+ # @yieldparam err [StandardError] error object if request failed
194
+ #
195
+ # @return [Google::Apis::MerchantapiProductsV1beta::ListProductsResponse]
196
+ #
197
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
198
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
199
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
200
+ def list_account_products(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
201
+ command = make_simple_command(:get, 'products/v1beta/{+parent}/products', options)
202
+ command.response_representation = Google::Apis::MerchantapiProductsV1beta::ListProductsResponse::Representation
203
+ command.response_class = Google::Apis::MerchantapiProductsV1beta::ListProductsResponse
204
+ command.params['parent'] = parent unless parent.nil?
205
+ command.query['pageSize'] = page_size unless page_size.nil?
206
+ command.query['pageToken'] = page_token unless page_token.nil?
207
+ command.query['fields'] = fields unless fields.nil?
208
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
209
+ execute_or_queue_command(command, &block)
210
+ end
211
+
212
+ protected
213
+
214
+ def apply_command_defaults(command)
215
+ command.query['key'] = key unless key.nil?
216
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
217
+ end
218
+ end
219
+ end
220
+ end
221
+ 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_products_v1beta/service.rb'
16
+ require 'google/apis/merchantapi_products_v1beta/classes.rb'
17
+ require 'google/apis/merchantapi_products_v1beta/representations.rb'
18
+ require 'google/apis/merchantapi_products_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 MerchantapiProductsV1beta
28
+ # Version of the Merchant API this client connects to.
29
+ # This is NOT the gem version.
30
+ VERSION = 'ProductsV1beta'
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_products_v1beta"
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-merchantapi_products_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 ProductsV1beta. 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_products_v1beta.rb
50
+ - lib/google/apis/merchantapi_products_v1beta.rb
51
+ - lib/google/apis/merchantapi_products_v1beta/classes.rb
52
+ - lib/google/apis/merchantapi_products_v1beta/gem_version.rb
53
+ - lib/google/apis/merchantapi_products_v1beta/representations.rb
54
+ - lib/google/apis/merchantapi_products_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_products_v1beta/CHANGELOG.md
61
+ documentation_uri: https://googleapis.dev/ruby/google-apis-merchantapi_products_v1beta/v0.1.0
62
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-merchantapi_products_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 ProductsV1beta
82
+ test_files: []