google-apis-merchantapi_promotions_v1beta 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +13 -0
- data/CHANGELOG.md +7 -0
- data/LICENSE.md +202 -0
- data/OVERVIEW.md +96 -0
- data/lib/google/apis/merchantapi_promotions_v1beta/classes.rb +795 -0
- data/lib/google/apis/merchantapi_promotions_v1beta/gem_version.rb +28 -0
- data/lib/google/apis/merchantapi_promotions_v1beta/representations.rb +262 -0
- data/lib/google/apis/merchantapi_promotions_v1beta/service.rb +178 -0
- data/lib/google/apis/merchantapi_promotions_v1beta.rb +36 -0
- data/lib/google-apis-merchantapi_promotions_v1beta.rb +15 -0
- metadata +82 -0
@@ -0,0 +1,28 @@
|
|
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
|
+
module Google
|
16
|
+
module Apis
|
17
|
+
module MerchantapiPromotionsV1beta
|
18
|
+
# Version of the google-apis-merchantapi_promotions_v1beta gem
|
19
|
+
GEM_VERSION = "0.1.0"
|
20
|
+
|
21
|
+
# Version of the code generator used to generate this client
|
22
|
+
GENERATOR_VERSION = "0.15.0"
|
23
|
+
|
24
|
+
# Revision of the discovery document this client was generated from
|
25
|
+
REVISION = "20240611"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,262 @@
|
|
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 'date'
|
16
|
+
require 'google/apis/core/base_service'
|
17
|
+
require 'google/apis/core/json_representation'
|
18
|
+
require 'google/apis/core/hashable'
|
19
|
+
require 'google/apis/errors'
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Apis
|
23
|
+
module MerchantapiPromotionsV1beta
|
24
|
+
|
25
|
+
class Attributes
|
26
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
27
|
+
|
28
|
+
include Google::Apis::Core::JsonObjectSupport
|
29
|
+
end
|
30
|
+
|
31
|
+
class CustomAttribute
|
32
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
33
|
+
|
34
|
+
include Google::Apis::Core::JsonObjectSupport
|
35
|
+
end
|
36
|
+
|
37
|
+
class DestinationStatus
|
38
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
39
|
+
|
40
|
+
include Google::Apis::Core::JsonObjectSupport
|
41
|
+
end
|
42
|
+
|
43
|
+
class InsertPromotionRequest
|
44
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
45
|
+
|
46
|
+
include Google::Apis::Core::JsonObjectSupport
|
47
|
+
end
|
48
|
+
|
49
|
+
class Interval
|
50
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
51
|
+
|
52
|
+
include Google::Apis::Core::JsonObjectSupport
|
53
|
+
end
|
54
|
+
|
55
|
+
class ItemLevelIssue
|
56
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
57
|
+
|
58
|
+
include Google::Apis::Core::JsonObjectSupport
|
59
|
+
end
|
60
|
+
|
61
|
+
class ListPromotionsResponse
|
62
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
63
|
+
|
64
|
+
include Google::Apis::Core::JsonObjectSupport
|
65
|
+
end
|
66
|
+
|
67
|
+
class Price
|
68
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
69
|
+
|
70
|
+
include Google::Apis::Core::JsonObjectSupport
|
71
|
+
end
|
72
|
+
|
73
|
+
class ProductChange
|
74
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
75
|
+
|
76
|
+
include Google::Apis::Core::JsonObjectSupport
|
77
|
+
end
|
78
|
+
|
79
|
+
class ProductStatusChangeMessage
|
80
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
81
|
+
|
82
|
+
include Google::Apis::Core::JsonObjectSupport
|
83
|
+
end
|
84
|
+
|
85
|
+
class Promotion
|
86
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
87
|
+
|
88
|
+
include Google::Apis::Core::JsonObjectSupport
|
89
|
+
end
|
90
|
+
|
91
|
+
class PromotionStatus
|
92
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
93
|
+
|
94
|
+
include Google::Apis::Core::JsonObjectSupport
|
95
|
+
end
|
96
|
+
|
97
|
+
class Attributes
|
98
|
+
# @private
|
99
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
100
|
+
collection :brand_exclusion, as: 'brandExclusion'
|
101
|
+
collection :brand_inclusion, as: 'brandInclusion'
|
102
|
+
property :coupon_value_type, as: 'couponValueType'
|
103
|
+
property :free_gift_description, as: 'freeGiftDescription'
|
104
|
+
property :free_gift_item_id, as: 'freeGiftItemId'
|
105
|
+
property :free_gift_value, as: 'freeGiftValue', class: Google::Apis::MerchantapiPromotionsV1beta::Price, decorator: Google::Apis::MerchantapiPromotionsV1beta::Price::Representation
|
106
|
+
|
107
|
+
property :generic_redemption_code, as: 'genericRedemptionCode'
|
108
|
+
property :get_this_quantity_discounted, :numeric_string => true, as: 'getThisQuantityDiscounted'
|
109
|
+
collection :item_group_id_exclusion, as: 'itemGroupIdExclusion'
|
110
|
+
collection :item_group_id_inclusion, as: 'itemGroupIdInclusion'
|
111
|
+
collection :item_id_exclusion, as: 'itemIdExclusion'
|
112
|
+
collection :item_id_inclusion, as: 'itemIdInclusion'
|
113
|
+
property :limit_quantity, :numeric_string => true, as: 'limitQuantity'
|
114
|
+
property :limit_value, as: 'limitValue', class: Google::Apis::MerchantapiPromotionsV1beta::Price, decorator: Google::Apis::MerchantapiPromotionsV1beta::Price::Representation
|
115
|
+
|
116
|
+
property :long_title, as: 'longTitle'
|
117
|
+
property :minimum_purchase_amount, as: 'minimumPurchaseAmount', class: Google::Apis::MerchantapiPromotionsV1beta::Price, decorator: Google::Apis::MerchantapiPromotionsV1beta::Price::Representation
|
118
|
+
|
119
|
+
property :minimum_purchase_quantity, :numeric_string => true, as: 'minimumPurchaseQuantity'
|
120
|
+
property :money_off_amount, as: 'moneyOffAmount', class: Google::Apis::MerchantapiPromotionsV1beta::Price, decorator: Google::Apis::MerchantapiPromotionsV1beta::Price::Representation
|
121
|
+
|
122
|
+
property :offer_type, as: 'offerType'
|
123
|
+
property :percent_off, :numeric_string => true, as: 'percentOff'
|
124
|
+
property :product_applicability, as: 'productApplicability'
|
125
|
+
collection :product_type_exclusion, as: 'productTypeExclusion'
|
126
|
+
collection :product_type_inclusion, as: 'productTypeInclusion'
|
127
|
+
collection :promotion_destinations, as: 'promotionDestinations'
|
128
|
+
property :promotion_display_time_period, as: 'promotionDisplayTimePeriod', class: Google::Apis::MerchantapiPromotionsV1beta::Interval, decorator: Google::Apis::MerchantapiPromotionsV1beta::Interval::Representation
|
129
|
+
|
130
|
+
property :promotion_effective_time_period, as: 'promotionEffectiveTimePeriod', class: Google::Apis::MerchantapiPromotionsV1beta::Interval, decorator: Google::Apis::MerchantapiPromotionsV1beta::Interval::Representation
|
131
|
+
|
132
|
+
property :promotion_url, as: 'promotionUrl'
|
133
|
+
property :store_applicability, as: 'storeApplicability'
|
134
|
+
collection :store_codes_exclusion, as: 'storeCodesExclusion'
|
135
|
+
collection :store_codes_inclusion, as: 'storeCodesInclusion'
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
class CustomAttribute
|
140
|
+
# @private
|
141
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
142
|
+
collection :group_values, as: 'groupValues', class: Google::Apis::MerchantapiPromotionsV1beta::CustomAttribute, decorator: Google::Apis::MerchantapiPromotionsV1beta::CustomAttribute::Representation
|
143
|
+
|
144
|
+
property :name, as: 'name'
|
145
|
+
property :value, as: 'value'
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
class DestinationStatus
|
150
|
+
# @private
|
151
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
152
|
+
property :reporting_context, as: 'reportingContext'
|
153
|
+
property :status, as: 'status'
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
class InsertPromotionRequest
|
158
|
+
# @private
|
159
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
160
|
+
property :data_source, as: 'dataSource'
|
161
|
+
property :promotion, as: 'promotion', class: Google::Apis::MerchantapiPromotionsV1beta::Promotion, decorator: Google::Apis::MerchantapiPromotionsV1beta::Promotion::Representation
|
162
|
+
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
class Interval
|
167
|
+
# @private
|
168
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
169
|
+
property :end_time, as: 'endTime'
|
170
|
+
property :start_time, as: 'startTime'
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
class ItemLevelIssue
|
175
|
+
# @private
|
176
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
177
|
+
collection :applicable_countries, as: 'applicableCountries'
|
178
|
+
property :attribute, as: 'attribute'
|
179
|
+
property :code, as: 'code'
|
180
|
+
property :description, as: 'description'
|
181
|
+
property :detail, as: 'detail'
|
182
|
+
property :documentation, as: 'documentation'
|
183
|
+
property :reporting_context, as: 'reportingContext'
|
184
|
+
property :resolution, as: 'resolution'
|
185
|
+
property :severity, as: 'severity'
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
class ListPromotionsResponse
|
190
|
+
# @private
|
191
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
192
|
+
property :next_page_token, as: 'nextPageToken'
|
193
|
+
collection :promotions, as: 'promotions', class: Google::Apis::MerchantapiPromotionsV1beta::Promotion, decorator: Google::Apis::MerchantapiPromotionsV1beta::Promotion::Representation
|
194
|
+
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
class Price
|
199
|
+
# @private
|
200
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
201
|
+
property :amount_micros, :numeric_string => true, as: 'amountMicros'
|
202
|
+
property :currency_code, as: 'currencyCode'
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
class ProductChange
|
207
|
+
# @private
|
208
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
209
|
+
property :new_value, as: 'newValue'
|
210
|
+
property :old_value, as: 'oldValue'
|
211
|
+
property :region_code, as: 'regionCode'
|
212
|
+
property :reporting_context, as: 'reportingContext'
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
class ProductStatusChangeMessage
|
217
|
+
# @private
|
218
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
219
|
+
property :account, as: 'account'
|
220
|
+
property :attribute, as: 'attribute'
|
221
|
+
collection :changes, as: 'changes', class: Google::Apis::MerchantapiPromotionsV1beta::ProductChange, decorator: Google::Apis::MerchantapiPromotionsV1beta::ProductChange::Representation
|
222
|
+
|
223
|
+
property :managing_account, as: 'managingAccount'
|
224
|
+
property :resource, as: 'resource'
|
225
|
+
property :resource_id, as: 'resourceId'
|
226
|
+
property :resource_type, as: 'resourceType'
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
class Promotion
|
231
|
+
# @private
|
232
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
233
|
+
property :attributes, as: 'attributes', class: Google::Apis::MerchantapiPromotionsV1beta::Attributes, decorator: Google::Apis::MerchantapiPromotionsV1beta::Attributes::Representation
|
234
|
+
|
235
|
+
property :content_language, as: 'contentLanguage'
|
236
|
+
collection :custom_attributes, as: 'customAttributes', class: Google::Apis::MerchantapiPromotionsV1beta::CustomAttribute, decorator: Google::Apis::MerchantapiPromotionsV1beta::CustomAttribute::Representation
|
237
|
+
|
238
|
+
property :data_source, as: 'dataSource'
|
239
|
+
property :name, as: 'name'
|
240
|
+
property :promotion_id, as: 'promotionId'
|
241
|
+
property :promotion_status, as: 'promotionStatus', class: Google::Apis::MerchantapiPromotionsV1beta::PromotionStatus, decorator: Google::Apis::MerchantapiPromotionsV1beta::PromotionStatus::Representation
|
242
|
+
|
243
|
+
collection :redemption_channel, as: 'redemptionChannel'
|
244
|
+
property :target_country, as: 'targetCountry'
|
245
|
+
property :version_number, :numeric_string => true, as: 'versionNumber'
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
class PromotionStatus
|
250
|
+
# @private
|
251
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
252
|
+
property :creation_date, as: 'creationDate'
|
253
|
+
collection :destination_statuses, as: 'destinationStatuses', class: Google::Apis::MerchantapiPromotionsV1beta::DestinationStatus, decorator: Google::Apis::MerchantapiPromotionsV1beta::DestinationStatus::Representation
|
254
|
+
|
255
|
+
collection :item_level_issues, as: 'itemLevelIssues', class: Google::Apis::MerchantapiPromotionsV1beta::ItemLevelIssue, decorator: Google::Apis::MerchantapiPromotionsV1beta::ItemLevelIssue::Representation
|
256
|
+
|
257
|
+
property :last_update_date, as: 'lastUpdateDate'
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|
@@ -0,0 +1,178 @@
|
|
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 MerchantapiPromotionsV1beta
|
23
|
+
# Merchant API
|
24
|
+
#
|
25
|
+
# Programmatically manage your Merchant Center Accounts.
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# require 'google/apis/merchantapi_promotions_v1beta'
|
29
|
+
#
|
30
|
+
# Merchantapi = Google::Apis::MerchantapiPromotionsV1beta # 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_promotions_v1beta',
|
50
|
+
client_version: Google::Apis::MerchantapiPromotionsV1beta::GEM_VERSION)
|
51
|
+
@batch_path = 'batch'
|
52
|
+
end
|
53
|
+
|
54
|
+
# Retrieves the promotion from your Merchant Center account. After inserting or
|
55
|
+
# updating a promotion input, it may take several minutes before the updated
|
56
|
+
# promotion can be retrieved.
|
57
|
+
# @param [String] name
|
58
|
+
# Required. The name of the promotion to retrieve. Format: `accounts/`account`/
|
59
|
+
# promotions/`promotions``
|
60
|
+
# @param [String] fields
|
61
|
+
# Selector specifying which fields to include in a partial response.
|
62
|
+
# @param [String] quota_user
|
63
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
64
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
65
|
+
# @param [Google::Apis::RequestOptions] options
|
66
|
+
# Request-specific options
|
67
|
+
#
|
68
|
+
# @yield [result, err] Result & error if block supplied
|
69
|
+
# @yieldparam result [Google::Apis::MerchantapiPromotionsV1beta::Promotion] parsed result object
|
70
|
+
# @yieldparam err [StandardError] error object if request failed
|
71
|
+
#
|
72
|
+
# @return [Google::Apis::MerchantapiPromotionsV1beta::Promotion]
|
73
|
+
#
|
74
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
75
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
76
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
77
|
+
def get_account_promotion(name, fields: nil, quota_user: nil, options: nil, &block)
|
78
|
+
command = make_simple_command(:get, 'promotions/v1beta/{+name}', options)
|
79
|
+
command.response_representation = Google::Apis::MerchantapiPromotionsV1beta::Promotion::Representation
|
80
|
+
command.response_class = Google::Apis::MerchantapiPromotionsV1beta::Promotion
|
81
|
+
command.params['name'] = name unless name.nil?
|
82
|
+
command.query['fields'] = fields unless fields.nil?
|
83
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
84
|
+
execute_or_queue_command(command, &block)
|
85
|
+
end
|
86
|
+
|
87
|
+
# Inserts a promotion for your Merchant Center account. If the promotion already
|
88
|
+
# exists, then it updates the promotion instead.
|
89
|
+
# @param [String] parent
|
90
|
+
# Required. The account where the promotion will be inserted. Format: accounts/`
|
91
|
+
# account`
|
92
|
+
# @param [Google::Apis::MerchantapiPromotionsV1beta::InsertPromotionRequest] insert_promotion_request_object
|
93
|
+
# @param [String] fields
|
94
|
+
# Selector specifying which fields to include in a partial response.
|
95
|
+
# @param [String] quota_user
|
96
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
97
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
98
|
+
# @param [Google::Apis::RequestOptions] options
|
99
|
+
# Request-specific options
|
100
|
+
#
|
101
|
+
# @yield [result, err] Result & error if block supplied
|
102
|
+
# @yieldparam result [Google::Apis::MerchantapiPromotionsV1beta::Promotion] parsed result object
|
103
|
+
# @yieldparam err [StandardError] error object if request failed
|
104
|
+
#
|
105
|
+
# @return [Google::Apis::MerchantapiPromotionsV1beta::Promotion]
|
106
|
+
#
|
107
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
108
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
109
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
110
|
+
def insert_promotion(parent, insert_promotion_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
111
|
+
command = make_simple_command(:post, 'promotions/v1beta/{+parent}/promotions:insert', options)
|
112
|
+
command.request_representation = Google::Apis::MerchantapiPromotionsV1beta::InsertPromotionRequest::Representation
|
113
|
+
command.request_object = insert_promotion_request_object
|
114
|
+
command.response_representation = Google::Apis::MerchantapiPromotionsV1beta::Promotion::Representation
|
115
|
+
command.response_class = Google::Apis::MerchantapiPromotionsV1beta::Promotion
|
116
|
+
command.params['parent'] = parent unless parent.nil?
|
117
|
+
command.query['fields'] = fields unless fields.nil?
|
118
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
119
|
+
execute_or_queue_command(command, &block)
|
120
|
+
end
|
121
|
+
|
122
|
+
# Lists the promotions in your Merchant Center account. The response might
|
123
|
+
# contain fewer items than specified by `pageSize`. Rely on `pageToken` to
|
124
|
+
# determine if there are more items to be requested. After inserting or updating
|
125
|
+
# a promotion, it may take several minutes before the updated processed
|
126
|
+
# promotion can be retrieved.
|
127
|
+
# @param [String] parent
|
128
|
+
# Required. The account to list processed promotions for. Format: `accounts/`
|
129
|
+
# account``
|
130
|
+
# @param [Fixnum] page_size
|
131
|
+
# Output only. The maximum number of promotions to return. The service may
|
132
|
+
# return fewer than this value. The maximum value is 1000; values above 1000
|
133
|
+
# will be coerced to 1000. If unspecified, the maximum number of promotions will
|
134
|
+
# be returned.
|
135
|
+
# @param [String] page_token
|
136
|
+
# Output only. A page token, received from a previous `ListPromotions` call.
|
137
|
+
# Provide this to retrieve the subsequent page. When paginating, all other
|
138
|
+
# parameters provided to `ListPromotions` must match the call that provided the
|
139
|
+
# page token.
|
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::MerchantapiPromotionsV1beta::ListPromotionsResponse] parsed result object
|
150
|
+
# @yieldparam err [StandardError] error object if request failed
|
151
|
+
#
|
152
|
+
# @return [Google::Apis::MerchantapiPromotionsV1beta::ListPromotionsResponse]
|
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 list_account_promotions(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
158
|
+
command = make_simple_command(:get, 'promotions/v1beta/{+parent}/promotions', options)
|
159
|
+
command.response_representation = Google::Apis::MerchantapiPromotionsV1beta::ListPromotionsResponse::Representation
|
160
|
+
command.response_class = Google::Apis::MerchantapiPromotionsV1beta::ListPromotionsResponse
|
161
|
+
command.params['parent'] = parent unless parent.nil?
|
162
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
163
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
164
|
+
command.query['fields'] = fields unless fields.nil?
|
165
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
166
|
+
execute_or_queue_command(command, &block)
|
167
|
+
end
|
168
|
+
|
169
|
+
protected
|
170
|
+
|
171
|
+
def apply_command_defaults(command)
|
172
|
+
command.query['key'] = key unless key.nil?
|
173
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
178
|
+
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_promotions_v1beta/service.rb'
|
16
|
+
require 'google/apis/merchantapi_promotions_v1beta/classes.rb'
|
17
|
+
require 'google/apis/merchantapi_promotions_v1beta/representations.rb'
|
18
|
+
require 'google/apis/merchantapi_promotions_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 MerchantapiPromotionsV1beta
|
28
|
+
# Version of the Merchant API this client connects to.
|
29
|
+
# This is NOT the gem version.
|
30
|
+
VERSION = 'PromotionsV1beta'
|
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_promotions_v1beta"
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: google-apis-merchantapi_promotions_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 PromotionsV1beta. 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_promotions_v1beta.rb
|
50
|
+
- lib/google/apis/merchantapi_promotions_v1beta.rb
|
51
|
+
- lib/google/apis/merchantapi_promotions_v1beta/classes.rb
|
52
|
+
- lib/google/apis/merchantapi_promotions_v1beta/gem_version.rb
|
53
|
+
- lib/google/apis/merchantapi_promotions_v1beta/representations.rb
|
54
|
+
- lib/google/apis/merchantapi_promotions_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_promotions_v1beta/CHANGELOG.md
|
61
|
+
documentation_uri: https://googleapis.dev/ruby/google-apis-merchantapi_promotions_v1beta/v0.1.0
|
62
|
+
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-merchantapi_promotions_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 PromotionsV1beta
|
82
|
+
test_files: []
|