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,795 @@
|
|
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
|
+
# Attributes.
|
26
|
+
class Attributes
|
27
|
+
include Google::Apis::Core::Hashable
|
28
|
+
|
29
|
+
# Optional. Product filter by [brand exclusion](https://support.google.com/
|
30
|
+
# merchants/answer/13861679?ref_topic=13773355&sjid=17642868584668136159-NC) for
|
31
|
+
# the promotion. The product filter attributes only applies when the products
|
32
|
+
# eligible for promotion product applicability `product_applicability` attribute
|
33
|
+
# is set to [specific_products](https://support.google.com/merchants/answer/
|
34
|
+
# 13837299?ref_topic=13773355&sjid=17642868584668136159-NC).
|
35
|
+
# Corresponds to the JSON property `brandExclusion`
|
36
|
+
# @return [Array<String>]
|
37
|
+
attr_accessor :brand_exclusion
|
38
|
+
|
39
|
+
# Optional. Product filter by brand for the promotion. The product filter
|
40
|
+
# attributes only applies when the products eligible for promotion product
|
41
|
+
# applicability `product_applicability` attribute is set to [specific_products](
|
42
|
+
# https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=
|
43
|
+
# 17642868584668136159-NC).
|
44
|
+
# Corresponds to the JSON property `brandInclusion`
|
45
|
+
# @return [Array<String>]
|
46
|
+
attr_accessor :brand_inclusion
|
47
|
+
|
48
|
+
# Required. The [coupon value type] (https://support.google.com/merchants/answer/
|
49
|
+
# 13861986?ref_topic=13773355&sjid=17642868584668136159-NC) attribute to signal
|
50
|
+
# the type of promotion that you are running. Depending on type of the selected
|
51
|
+
# coupon value [some attributes are required](https://support.google.com/
|
52
|
+
# merchants/answer/6393006?ref_topic=7322920).
|
53
|
+
# Corresponds to the JSON property `couponValueType`
|
54
|
+
# @return [String]
|
55
|
+
attr_accessor :coupon_value_type
|
56
|
+
|
57
|
+
# Optional. [Free gift description](https://support.google.com/merchants/answer/
|
58
|
+
# 13847245?ref_topic=13773355&sjid=17642868584668136159-NC) for the promotion.
|
59
|
+
# Corresponds to the JSON property `freeGiftDescription`
|
60
|
+
# @return [String]
|
61
|
+
attr_accessor :free_gift_description
|
62
|
+
|
63
|
+
# Optional. [Free gift item ID](https://support.google.com/merchants/answer/
|
64
|
+
# 13857152?ref_topic=13773355&sjid=17642868584668136159-NC) for the promotion.
|
65
|
+
# Corresponds to the JSON property `freeGiftItemId`
|
66
|
+
# @return [String]
|
67
|
+
attr_accessor :free_gift_item_id
|
68
|
+
|
69
|
+
# The price represented as a number and currency.
|
70
|
+
# Corresponds to the JSON property `freeGiftValue`
|
71
|
+
# @return [Google::Apis::MerchantapiPromotionsV1beta::Price]
|
72
|
+
attr_accessor :free_gift_value
|
73
|
+
|
74
|
+
# Optional. Generic redemption code for the promotion. To be used with the `
|
75
|
+
# offerType` field and must meet the [minimum requirements](https://support.
|
76
|
+
# google.com/merchants/answer/13837405?ref_topic=13773355&sjid=
|
77
|
+
# 17642868584668136159-NC).
|
78
|
+
# Corresponds to the JSON property `genericRedemptionCode`
|
79
|
+
# @return [String]
|
80
|
+
attr_accessor :generic_redemption_code
|
81
|
+
|
82
|
+
# Optional. The number of items discounted in the promotion. The attribute is
|
83
|
+
# set when `couponValueType` is equal to `buy_m_get_n_money_off` or `
|
84
|
+
# buy_m_get_n_percent_off`.
|
85
|
+
# Corresponds to the JSON property `getThisQuantityDiscounted`
|
86
|
+
# @return [Fixnum]
|
87
|
+
attr_accessor :get_this_quantity_discounted
|
88
|
+
|
89
|
+
# Optional. Product filter by [item group ID](https://support.google.com/
|
90
|
+
# merchants/answer/13837298?ref_topic=13773355&sjid=17642868584668136159-NC).
|
91
|
+
# The product filter attributes only applies when the products eligible for
|
92
|
+
# promotion product applicability `product_applicability` attribute is set to [
|
93
|
+
# specific_products](https://support.google.com/merchants/answer/13837299?
|
94
|
+
# ref_topic=13773355&sjid=17642868584668136159-NC). exclusion for the promotion.
|
95
|
+
# Corresponds to the JSON property `itemGroupIdExclusion`
|
96
|
+
# @return [Array<String>]
|
97
|
+
attr_accessor :item_group_id_exclusion
|
98
|
+
|
99
|
+
# Optional. Product filter by item group ID for the promotion. The product
|
100
|
+
# filter attributes only applies when the products eligible for promotion
|
101
|
+
# product applicability [product_applicability] attribute is set to [
|
102
|
+
# specific_products](https://support.google.com/merchants/answer/13837299?
|
103
|
+
# ref_topic=13773355&sjid=17642868584668136159-NC).
|
104
|
+
# Corresponds to the JSON property `itemGroupIdInclusion`
|
105
|
+
# @return [Array<String>]
|
106
|
+
attr_accessor :item_group_id_inclusion
|
107
|
+
|
108
|
+
# Optional. Product filter by [item ID exclusion](https://support.google.com/
|
109
|
+
# merchants/answer/13863524?ref_topic=13773355&sjid=17642868584668136159-NC) for
|
110
|
+
# the promotion. The product filter attributes only applies when the products
|
111
|
+
# eligible for promotion product applicability `product_applicability` attribute
|
112
|
+
# is set to [specific_products](https://support.google.com/merchants/answer/
|
113
|
+
# 13837299?ref_topic=13773355&sjid=17642868584668136159-NC).
|
114
|
+
# Corresponds to the JSON property `itemIdExclusion`
|
115
|
+
# @return [Array<String>]
|
116
|
+
attr_accessor :item_id_exclusion
|
117
|
+
|
118
|
+
# Optional. Product filter by [item ID](https://support.google.com/merchants/
|
119
|
+
# answer/13861565?ref_topic=13773355&sjid=17642868584668136159-NC) for the
|
120
|
+
# promotion. The product filter attributes only applies when the products
|
121
|
+
# eligible for promotion product applicability `product_applicability` attribute
|
122
|
+
# is set to [specific_products](https://support.google.com/merchants/answer/
|
123
|
+
# 13837299?ref_topic=13773355&sjid=17642868584668136159-NC).
|
124
|
+
# Corresponds to the JSON property `itemIdInclusion`
|
125
|
+
# @return [Array<String>]
|
126
|
+
attr_accessor :item_id_inclusion
|
127
|
+
|
128
|
+
# Optional. [Maximum purchase quantity](https://support.google.com/merchants/
|
129
|
+
# answer/13861564?ref_topic=13773355&sjid=17642868584668136159-NC) for the
|
130
|
+
# promotion.
|
131
|
+
# Corresponds to the JSON property `limitQuantity`
|
132
|
+
# @return [Fixnum]
|
133
|
+
attr_accessor :limit_quantity
|
134
|
+
|
135
|
+
# The price represented as a number and currency.
|
136
|
+
# Corresponds to the JSON property `limitValue`
|
137
|
+
# @return [Google::Apis::MerchantapiPromotionsV1beta::Price]
|
138
|
+
attr_accessor :limit_value
|
139
|
+
|
140
|
+
# Required. [Long title](https://support.google.com/merchants/answer/13838102?
|
141
|
+
# ref_topic=13773355&sjid=17642868584668136159-NC) for the promotion.
|
142
|
+
# Corresponds to the JSON property `longTitle`
|
143
|
+
# @return [String]
|
144
|
+
attr_accessor :long_title
|
145
|
+
|
146
|
+
# The price represented as a number and currency.
|
147
|
+
# Corresponds to the JSON property `minimumPurchaseAmount`
|
148
|
+
# @return [Google::Apis::MerchantapiPromotionsV1beta::Price]
|
149
|
+
attr_accessor :minimum_purchase_amount
|
150
|
+
|
151
|
+
# Optional. [Minimum purchase quantity](https://support.google.com/merchants/
|
152
|
+
# answer/13838182?ref_topic=13773355&sjid=17642868584668136159-NC) for the
|
153
|
+
# promotion.
|
154
|
+
# Corresponds to the JSON property `minimumPurchaseQuantity`
|
155
|
+
# @return [Fixnum]
|
156
|
+
attr_accessor :minimum_purchase_quantity
|
157
|
+
|
158
|
+
# The price represented as a number and currency.
|
159
|
+
# Corresponds to the JSON property `moneyOffAmount`
|
160
|
+
# @return [Google::Apis::MerchantapiPromotionsV1beta::Price]
|
161
|
+
attr_accessor :money_off_amount
|
162
|
+
|
163
|
+
# Required. [Type](https://support.google.com/merchants/answer/13837405?
|
164
|
+
# ref_topic=13773355&sjid=17642868584668136159-NC) of the promotion. Use this
|
165
|
+
# attribute to indicate whether or not customers need a coupon code to redeem
|
166
|
+
# your promotion.
|
167
|
+
# Corresponds to the JSON property `offerType`
|
168
|
+
# @return [String]
|
169
|
+
attr_accessor :offer_type
|
170
|
+
|
171
|
+
# Optional. The [percentage discount](https://support.google.com/merchants/
|
172
|
+
# answer/13837404?sjid=17642868584668136159-NC) offered in the promotion.
|
173
|
+
# Corresponds to the JSON property `percentOff`
|
174
|
+
# @return [Fixnum]
|
175
|
+
attr_accessor :percent_off
|
176
|
+
|
177
|
+
# Required. Applicability of the promotion to either all products or [only
|
178
|
+
# specific products](https://support.google.com/merchants/answer/6396257?
|
179
|
+
# ref_topic=6396150&sjid=17642868584668136159-NC).
|
180
|
+
# Corresponds to the JSON property `productApplicability`
|
181
|
+
# @return [String]
|
182
|
+
attr_accessor :product_applicability
|
183
|
+
|
184
|
+
# Optional. Product filter by [product type exclusion](https://support.google.
|
185
|
+
# com/merchants/answer/13863746?ref_topic=13773355&sjid=17642868584668136159-NC)
|
186
|
+
# for the promotion. The product filter attributes only applies when the
|
187
|
+
# products eligible for promotion product applicability `product_applicability`
|
188
|
+
# attribute is set to [specific_products](https://support.google.com/merchants/
|
189
|
+
# answer/13837299?ref_topic=13773355&sjid=17642868584668136159-NC).
|
190
|
+
# Corresponds to the JSON property `productTypeExclusion`
|
191
|
+
# @return [Array<String>]
|
192
|
+
attr_accessor :product_type_exclusion
|
193
|
+
|
194
|
+
# Optional. Product filter by product type for the promotion. The product filter
|
195
|
+
# attributes only applies when the products eligible for promotion product
|
196
|
+
# applicability `product_applicability` attribute is set to [specific_products](
|
197
|
+
# https://support.google.com/merchants/answer/13837299?ref_topic=13773355&sjid=
|
198
|
+
# 17642868584668136159-NC).
|
199
|
+
# Corresponds to the JSON property `productTypeInclusion`
|
200
|
+
# @return [Array<String>]
|
201
|
+
attr_accessor :product_type_inclusion
|
202
|
+
|
203
|
+
# Required. The list of destinations where the promotion applies to. If you don'
|
204
|
+
# t specify a destination by including a supported value in your data source,
|
205
|
+
# your promotion will display in Shopping ads and free listings by default. You
|
206
|
+
# may have previously submitted the following values as destinations for your
|
207
|
+
# products: Shopping Actions, Surfaces across Google, Local surfaces across
|
208
|
+
# Google. To represent these values use `FREE_LISTINGS`, `FREE_LOCAL_LISTINGS`, `
|
209
|
+
# LOCAL_INVENTORY_ADS`. For more details see [Promotion destination](https://
|
210
|
+
# support.google.com/merchants/answer/13837465?sjid=5155774230887277618-NC)
|
211
|
+
# Corresponds to the JSON property `promotionDestinations`
|
212
|
+
# @return [Array<String>]
|
213
|
+
attr_accessor :promotion_destinations
|
214
|
+
|
215
|
+
# Represents a time interval, encoded as a Timestamp start (inclusive) and a
|
216
|
+
# Timestamp end (exclusive). The start must be less than or equal to the end.
|
217
|
+
# When the start equals the end, the interval is empty (matches no time). When
|
218
|
+
# both start and end are unspecified, the interval matches any time.
|
219
|
+
# Corresponds to the JSON property `promotionDisplayTimePeriod`
|
220
|
+
# @return [Google::Apis::MerchantapiPromotionsV1beta::Interval]
|
221
|
+
attr_accessor :promotion_display_time_period
|
222
|
+
|
223
|
+
# Represents a time interval, encoded as a Timestamp start (inclusive) and a
|
224
|
+
# Timestamp end (exclusive). The start must be less than or equal to the end.
|
225
|
+
# When the start equals the end, the interval is empty (matches no time). When
|
226
|
+
# both start and end are unspecified, the interval matches any time.
|
227
|
+
# Corresponds to the JSON property `promotionEffectiveTimePeriod`
|
228
|
+
# @return [Google::Apis::MerchantapiPromotionsV1beta::Interval]
|
229
|
+
attr_accessor :promotion_effective_time_period
|
230
|
+
|
231
|
+
# Optional. URL to the page on the merchant's site where the promotion shows.
|
232
|
+
# Local Inventory ads promotions throw an error if no `promotion_url` is
|
233
|
+
# included. URL is used to confirm that the promotion is valid and can be
|
234
|
+
# redeemed.
|
235
|
+
# Corresponds to the JSON property `promotionUrl`
|
236
|
+
# @return [String]
|
237
|
+
attr_accessor :promotion_url
|
238
|
+
|
239
|
+
# Optional. Whether the promotion applies to [all stores, or only specified
|
240
|
+
# stores](https://support.google.com/merchants/answer/13857563?sjid=
|
241
|
+
# 17642868584668136159-NC). Local Inventory ads promotions throw an error if no
|
242
|
+
# store applicability is included. An `INVALID_ARGUMENT` error is thrown if `
|
243
|
+
# store_applicability` is set to `ALL_STORES` and `store_codes_inclusion` or `
|
244
|
+
# score_code_exclusion` is set to a value.
|
245
|
+
# Corresponds to the JSON property `storeApplicability`
|
246
|
+
# @return [String]
|
247
|
+
attr_accessor :store_applicability
|
248
|
+
|
249
|
+
# Optional. [Store codes to exclude](https://support.google.com/merchants/answer/
|
250
|
+
# 13859586?ref_topic=13773355&sjid=17642868584668136159-NC) for the promotion.
|
251
|
+
# The store filter attributes only applies when the `store_applicability`
|
252
|
+
# attribute is set to [specific_stores](https://support.google.com/merchants/
|
253
|
+
# answer/13857563?ref_topic=13773355&sjid=17642868584668136159-NC).
|
254
|
+
# Corresponds to the JSON property `storeCodesExclusion`
|
255
|
+
# @return [Array<String>]
|
256
|
+
attr_accessor :store_codes_exclusion
|
257
|
+
|
258
|
+
# Optional. [Store codes to include](https://support.google.com/merchants/answer/
|
259
|
+
# 13857470?ref_topic=13773355&sjid=17642868584668136159-NC) for the promotion.
|
260
|
+
# The store filter attributes only applies when the `store_applicability`
|
261
|
+
# attribute is set to [specific_stores](https://support.google.com/merchants/
|
262
|
+
# answer/13857563?ref_topic=13773355&sjid=17642868584668136159-NC). Store code (
|
263
|
+
# the store ID from your Business Profile) of the physical store the product is
|
264
|
+
# sold in. See the [Local product inventory data specification](https://support.
|
265
|
+
# google.com/merchants/answer/3061342) for more information.
|
266
|
+
# Corresponds to the JSON property `storeCodesInclusion`
|
267
|
+
# @return [Array<String>]
|
268
|
+
attr_accessor :store_codes_inclusion
|
269
|
+
|
270
|
+
def initialize(**args)
|
271
|
+
update!(**args)
|
272
|
+
end
|
273
|
+
|
274
|
+
# Update properties of this object
|
275
|
+
def update!(**args)
|
276
|
+
@brand_exclusion = args[:brand_exclusion] if args.key?(:brand_exclusion)
|
277
|
+
@brand_inclusion = args[:brand_inclusion] if args.key?(:brand_inclusion)
|
278
|
+
@coupon_value_type = args[:coupon_value_type] if args.key?(:coupon_value_type)
|
279
|
+
@free_gift_description = args[:free_gift_description] if args.key?(:free_gift_description)
|
280
|
+
@free_gift_item_id = args[:free_gift_item_id] if args.key?(:free_gift_item_id)
|
281
|
+
@free_gift_value = args[:free_gift_value] if args.key?(:free_gift_value)
|
282
|
+
@generic_redemption_code = args[:generic_redemption_code] if args.key?(:generic_redemption_code)
|
283
|
+
@get_this_quantity_discounted = args[:get_this_quantity_discounted] if args.key?(:get_this_quantity_discounted)
|
284
|
+
@item_group_id_exclusion = args[:item_group_id_exclusion] if args.key?(:item_group_id_exclusion)
|
285
|
+
@item_group_id_inclusion = args[:item_group_id_inclusion] if args.key?(:item_group_id_inclusion)
|
286
|
+
@item_id_exclusion = args[:item_id_exclusion] if args.key?(:item_id_exclusion)
|
287
|
+
@item_id_inclusion = args[:item_id_inclusion] if args.key?(:item_id_inclusion)
|
288
|
+
@limit_quantity = args[:limit_quantity] if args.key?(:limit_quantity)
|
289
|
+
@limit_value = args[:limit_value] if args.key?(:limit_value)
|
290
|
+
@long_title = args[:long_title] if args.key?(:long_title)
|
291
|
+
@minimum_purchase_amount = args[:minimum_purchase_amount] if args.key?(:minimum_purchase_amount)
|
292
|
+
@minimum_purchase_quantity = args[:minimum_purchase_quantity] if args.key?(:minimum_purchase_quantity)
|
293
|
+
@money_off_amount = args[:money_off_amount] if args.key?(:money_off_amount)
|
294
|
+
@offer_type = args[:offer_type] if args.key?(:offer_type)
|
295
|
+
@percent_off = args[:percent_off] if args.key?(:percent_off)
|
296
|
+
@product_applicability = args[:product_applicability] if args.key?(:product_applicability)
|
297
|
+
@product_type_exclusion = args[:product_type_exclusion] if args.key?(:product_type_exclusion)
|
298
|
+
@product_type_inclusion = args[:product_type_inclusion] if args.key?(:product_type_inclusion)
|
299
|
+
@promotion_destinations = args[:promotion_destinations] if args.key?(:promotion_destinations)
|
300
|
+
@promotion_display_time_period = args[:promotion_display_time_period] if args.key?(:promotion_display_time_period)
|
301
|
+
@promotion_effective_time_period = args[:promotion_effective_time_period] if args.key?(:promotion_effective_time_period)
|
302
|
+
@promotion_url = args[:promotion_url] if args.key?(:promotion_url)
|
303
|
+
@store_applicability = args[:store_applicability] if args.key?(:store_applicability)
|
304
|
+
@store_codes_exclusion = args[:store_codes_exclusion] if args.key?(:store_codes_exclusion)
|
305
|
+
@store_codes_inclusion = args[:store_codes_inclusion] if args.key?(:store_codes_inclusion)
|
306
|
+
end
|
307
|
+
end
|
308
|
+
|
309
|
+
# A message that represents custom attributes. Exactly one of `value` or `
|
310
|
+
# group_values` must not be empty.
|
311
|
+
class CustomAttribute
|
312
|
+
include Google::Apis::Core::Hashable
|
313
|
+
|
314
|
+
# Subattributes within this attribute group. If `group_values` is not empty, `
|
315
|
+
# value` must be empty.
|
316
|
+
# Corresponds to the JSON property `groupValues`
|
317
|
+
# @return [Array<Google::Apis::MerchantapiPromotionsV1beta::CustomAttribute>]
|
318
|
+
attr_accessor :group_values
|
319
|
+
|
320
|
+
# The name of the attribute.
|
321
|
+
# Corresponds to the JSON property `name`
|
322
|
+
# @return [String]
|
323
|
+
attr_accessor :name
|
324
|
+
|
325
|
+
# The value of the attribute. If `value` is not empty, `group_values` must be
|
326
|
+
# empty.
|
327
|
+
# Corresponds to the JSON property `value`
|
328
|
+
# @return [String]
|
329
|
+
attr_accessor :value
|
330
|
+
|
331
|
+
def initialize(**args)
|
332
|
+
update!(**args)
|
333
|
+
end
|
334
|
+
|
335
|
+
# Update properties of this object
|
336
|
+
def update!(**args)
|
337
|
+
@group_values = args[:group_values] if args.key?(:group_values)
|
338
|
+
@name = args[:name] if args.key?(:name)
|
339
|
+
@value = args[:value] if args.key?(:value)
|
340
|
+
end
|
341
|
+
end
|
342
|
+
|
343
|
+
# The status for the specified destination.
|
344
|
+
class DestinationStatus
|
345
|
+
include Google::Apis::Core::Hashable
|
346
|
+
|
347
|
+
# Output only. The name of the promotion destination.
|
348
|
+
# Corresponds to the JSON property `reportingContext`
|
349
|
+
# @return [String]
|
350
|
+
attr_accessor :reporting_context
|
351
|
+
|
352
|
+
# Output only. The status for the specified destination.
|
353
|
+
# Corresponds to the JSON property `status`
|
354
|
+
# @return [String]
|
355
|
+
attr_accessor :status
|
356
|
+
|
357
|
+
def initialize(**args)
|
358
|
+
update!(**args)
|
359
|
+
end
|
360
|
+
|
361
|
+
# Update properties of this object
|
362
|
+
def update!(**args)
|
363
|
+
@reporting_context = args[:reporting_context] if args.key?(:reporting_context)
|
364
|
+
@status = args[:status] if args.key?(:status)
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
368
|
+
# Request message for the `InsertPromotion` method.
|
369
|
+
class InsertPromotionRequest
|
370
|
+
include Google::Apis::Core::Hashable
|
371
|
+
|
372
|
+
# Required. The data source of the [promotion](https://support.google.com/
|
373
|
+
# merchants/answer/6396268?sjid=5155774230887277618-NC) Format: `accounts/`
|
374
|
+
# account`/dataSources/`datasource``.
|
375
|
+
# Corresponds to the JSON property `dataSource`
|
376
|
+
# @return [String]
|
377
|
+
attr_accessor :data_source
|
378
|
+
|
379
|
+
# Represents a promotion. See the following articles for more details. Required
|
380
|
+
# promotion input attributes to pass data validation checks are primarily
|
381
|
+
# defined below: * [Promotions data specification](https://support.google.com/
|
382
|
+
# merchants/answer/2906014) * [Local promotions data specification](https://
|
383
|
+
# support.google.com/merchants/answer/10146130) After inserting, updating a
|
384
|
+
# promotion input, it may take several minutes before the final promotion can be
|
385
|
+
# retrieved.
|
386
|
+
# Corresponds to the JSON property `promotion`
|
387
|
+
# @return [Google::Apis::MerchantapiPromotionsV1beta::Promotion]
|
388
|
+
attr_accessor :promotion
|
389
|
+
|
390
|
+
def initialize(**args)
|
391
|
+
update!(**args)
|
392
|
+
end
|
393
|
+
|
394
|
+
# Update properties of this object
|
395
|
+
def update!(**args)
|
396
|
+
@data_source = args[:data_source] if args.key?(:data_source)
|
397
|
+
@promotion = args[:promotion] if args.key?(:promotion)
|
398
|
+
end
|
399
|
+
end
|
400
|
+
|
401
|
+
# Represents a time interval, encoded as a Timestamp start (inclusive) and a
|
402
|
+
# Timestamp end (exclusive). The start must be less than or equal to the end.
|
403
|
+
# When the start equals the end, the interval is empty (matches no time). When
|
404
|
+
# both start and end are unspecified, the interval matches any time.
|
405
|
+
class Interval
|
406
|
+
include Google::Apis::Core::Hashable
|
407
|
+
|
408
|
+
# Optional. Exclusive end of the interval. If specified, a Timestamp matching
|
409
|
+
# this interval will have to be before the end.
|
410
|
+
# Corresponds to the JSON property `endTime`
|
411
|
+
# @return [String]
|
412
|
+
attr_accessor :end_time
|
413
|
+
|
414
|
+
# Optional. Inclusive start of the interval. If specified, a Timestamp matching
|
415
|
+
# this interval will have to be the same or after the start.
|
416
|
+
# Corresponds to the JSON property `startTime`
|
417
|
+
# @return [String]
|
418
|
+
attr_accessor :start_time
|
419
|
+
|
420
|
+
def initialize(**args)
|
421
|
+
update!(**args)
|
422
|
+
end
|
423
|
+
|
424
|
+
# Update properties of this object
|
425
|
+
def update!(**args)
|
426
|
+
@end_time = args[:end_time] if args.key?(:end_time)
|
427
|
+
@start_time = args[:start_time] if args.key?(:start_time)
|
428
|
+
end
|
429
|
+
end
|
430
|
+
|
431
|
+
# The issue associated with the promotion.
|
432
|
+
class ItemLevelIssue
|
433
|
+
include Google::Apis::Core::Hashable
|
434
|
+
|
435
|
+
# Output only. List of country codes (ISO 3166-1 alpha-2) where issue applies to
|
436
|
+
# the offer.
|
437
|
+
# Corresponds to the JSON property `applicableCountries`
|
438
|
+
# @return [Array<String>]
|
439
|
+
attr_accessor :applicable_countries
|
440
|
+
|
441
|
+
# Output only. The attribute's name, if the issue is caused by a single
|
442
|
+
# attribute.
|
443
|
+
# Corresponds to the JSON property `attribute`
|
444
|
+
# @return [String]
|
445
|
+
attr_accessor :attribute
|
446
|
+
|
447
|
+
# Output only. The error code of the issue.
|
448
|
+
# Corresponds to the JSON property `code`
|
449
|
+
# @return [String]
|
450
|
+
attr_accessor :code
|
451
|
+
|
452
|
+
# Output only. A short issue description in English.
|
453
|
+
# Corresponds to the JSON property `description`
|
454
|
+
# @return [String]
|
455
|
+
attr_accessor :description
|
456
|
+
|
457
|
+
# Output only. A detailed issue description in English.
|
458
|
+
# Corresponds to the JSON property `detail`
|
459
|
+
# @return [String]
|
460
|
+
attr_accessor :detail
|
461
|
+
|
462
|
+
# Output only. The URL of a web page to help with resolving this issue.
|
463
|
+
# Corresponds to the JSON property `documentation`
|
464
|
+
# @return [String]
|
465
|
+
attr_accessor :documentation
|
466
|
+
|
467
|
+
# Output only. The destination the issue applies to.
|
468
|
+
# Corresponds to the JSON property `reportingContext`
|
469
|
+
# @return [String]
|
470
|
+
attr_accessor :reporting_context
|
471
|
+
|
472
|
+
# Output only. Whether the issue can be resolved by the merchant.
|
473
|
+
# Corresponds to the JSON property `resolution`
|
474
|
+
# @return [String]
|
475
|
+
attr_accessor :resolution
|
476
|
+
|
477
|
+
# Output only. How this issue affects serving of the promotion.
|
478
|
+
# Corresponds to the JSON property `severity`
|
479
|
+
# @return [String]
|
480
|
+
attr_accessor :severity
|
481
|
+
|
482
|
+
def initialize(**args)
|
483
|
+
update!(**args)
|
484
|
+
end
|
485
|
+
|
486
|
+
# Update properties of this object
|
487
|
+
def update!(**args)
|
488
|
+
@applicable_countries = args[:applicable_countries] if args.key?(:applicable_countries)
|
489
|
+
@attribute = args[:attribute] if args.key?(:attribute)
|
490
|
+
@code = args[:code] if args.key?(:code)
|
491
|
+
@description = args[:description] if args.key?(:description)
|
492
|
+
@detail = args[:detail] if args.key?(:detail)
|
493
|
+
@documentation = args[:documentation] if args.key?(:documentation)
|
494
|
+
@reporting_context = args[:reporting_context] if args.key?(:reporting_context)
|
495
|
+
@resolution = args[:resolution] if args.key?(:resolution)
|
496
|
+
@severity = args[:severity] if args.key?(:severity)
|
497
|
+
end
|
498
|
+
end
|
499
|
+
|
500
|
+
# Response message for the `ListPromotions` method.
|
501
|
+
class ListPromotionsResponse
|
502
|
+
include Google::Apis::Core::Hashable
|
503
|
+
|
504
|
+
# A token, which can be sent as `page_token` to retrieve the next page. If this
|
505
|
+
# field is omitted, there are no subsequent pages.
|
506
|
+
# Corresponds to the JSON property `nextPageToken`
|
507
|
+
# @return [String]
|
508
|
+
attr_accessor :next_page_token
|
509
|
+
|
510
|
+
# The processed promotions from the specified account.
|
511
|
+
# Corresponds to the JSON property `promotions`
|
512
|
+
# @return [Array<Google::Apis::MerchantapiPromotionsV1beta::Promotion>]
|
513
|
+
attr_accessor :promotions
|
514
|
+
|
515
|
+
def initialize(**args)
|
516
|
+
update!(**args)
|
517
|
+
end
|
518
|
+
|
519
|
+
# Update properties of this object
|
520
|
+
def update!(**args)
|
521
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
522
|
+
@promotions = args[:promotions] if args.key?(:promotions)
|
523
|
+
end
|
524
|
+
end
|
525
|
+
|
526
|
+
# The price represented as a number and currency.
|
527
|
+
class Price
|
528
|
+
include Google::Apis::Core::Hashable
|
529
|
+
|
530
|
+
# The price represented as a number in micros (1 million micros is an equivalent
|
531
|
+
# to one's currency standard unit, for example, 1 USD = 1000000 micros).
|
532
|
+
# Corresponds to the JSON property `amountMicros`
|
533
|
+
# @return [Fixnum]
|
534
|
+
attr_accessor :amount_micros
|
535
|
+
|
536
|
+
# The currency of the price using three-letter acronyms according to [ISO 4217](
|
537
|
+
# http://en.wikipedia.org/wiki/ISO_4217).
|
538
|
+
# Corresponds to the JSON property `currencyCode`
|
539
|
+
# @return [String]
|
540
|
+
attr_accessor :currency_code
|
541
|
+
|
542
|
+
def initialize(**args)
|
543
|
+
update!(**args)
|
544
|
+
end
|
545
|
+
|
546
|
+
# Update properties of this object
|
547
|
+
def update!(**args)
|
548
|
+
@amount_micros = args[:amount_micros] if args.key?(:amount_micros)
|
549
|
+
@currency_code = args[:currency_code] if args.key?(:currency_code)
|
550
|
+
end
|
551
|
+
end
|
552
|
+
|
553
|
+
# The change that happened to the product including old value, new value,
|
554
|
+
# country code as the region code and reporting context.
|
555
|
+
class ProductChange
|
556
|
+
include Google::Apis::Core::Hashable
|
557
|
+
|
558
|
+
# The new value of the changed resource or attribute.
|
559
|
+
# Corresponds to the JSON property `newValue`
|
560
|
+
# @return [String]
|
561
|
+
attr_accessor :new_value
|
562
|
+
|
563
|
+
# The old value of the changed resource or attribute.
|
564
|
+
# Corresponds to the JSON property `oldValue`
|
565
|
+
# @return [String]
|
566
|
+
attr_accessor :old_value
|
567
|
+
|
568
|
+
# Countries that have the change (if applicable)
|
569
|
+
# Corresponds to the JSON property `regionCode`
|
570
|
+
# @return [String]
|
571
|
+
attr_accessor :region_code
|
572
|
+
|
573
|
+
# Reporting contexts that have the change (if applicable)
|
574
|
+
# Corresponds to the JSON property `reportingContext`
|
575
|
+
# @return [String]
|
576
|
+
attr_accessor :reporting_context
|
577
|
+
|
578
|
+
def initialize(**args)
|
579
|
+
update!(**args)
|
580
|
+
end
|
581
|
+
|
582
|
+
# Update properties of this object
|
583
|
+
def update!(**args)
|
584
|
+
@new_value = args[:new_value] if args.key?(:new_value)
|
585
|
+
@old_value = args[:old_value] if args.key?(:old_value)
|
586
|
+
@region_code = args[:region_code] if args.key?(:region_code)
|
587
|
+
@reporting_context = args[:reporting_context] if args.key?(:reporting_context)
|
588
|
+
end
|
589
|
+
end
|
590
|
+
|
591
|
+
# The message that the merchant will receive to notify about product status
|
592
|
+
# change event
|
593
|
+
class ProductStatusChangeMessage
|
594
|
+
include Google::Apis::Core::Hashable
|
595
|
+
|
596
|
+
# The target account that owns the entity that changed. Format : `accounts/`
|
597
|
+
# merchant_id``
|
598
|
+
# Corresponds to the JSON property `account`
|
599
|
+
# @return [String]
|
600
|
+
attr_accessor :account
|
601
|
+
|
602
|
+
# The attribute in the resource that changed, in this case it will be always `
|
603
|
+
# Status`.
|
604
|
+
# Corresponds to the JSON property `attribute`
|
605
|
+
# @return [String]
|
606
|
+
attr_accessor :attribute
|
607
|
+
|
608
|
+
# A message to describe the change that happened to the product
|
609
|
+
# Corresponds to the JSON property `changes`
|
610
|
+
# @return [Array<Google::Apis::MerchantapiPromotionsV1beta::ProductChange>]
|
611
|
+
attr_accessor :changes
|
612
|
+
|
613
|
+
# The account that manages the merchant's account. can be the same as merchant
|
614
|
+
# id if it is standalone account. Format : `accounts/`service_provider_id``
|
615
|
+
# Corresponds to the JSON property `managingAccount`
|
616
|
+
# @return [String]
|
617
|
+
attr_accessor :managing_account
|
618
|
+
|
619
|
+
# The product name. Format: ``product.name=accounts/`account`/products/`product``
|
620
|
+
# `
|
621
|
+
# Corresponds to the JSON property `resource`
|
622
|
+
# @return [String]
|
623
|
+
attr_accessor :resource
|
624
|
+
|
625
|
+
# The product id.
|
626
|
+
# Corresponds to the JSON property `resourceId`
|
627
|
+
# @return [String]
|
628
|
+
attr_accessor :resource_id
|
629
|
+
|
630
|
+
# The resource that changed, in this case it will always be `Product`.
|
631
|
+
# Corresponds to the JSON property `resourceType`
|
632
|
+
# @return [String]
|
633
|
+
attr_accessor :resource_type
|
634
|
+
|
635
|
+
def initialize(**args)
|
636
|
+
update!(**args)
|
637
|
+
end
|
638
|
+
|
639
|
+
# Update properties of this object
|
640
|
+
def update!(**args)
|
641
|
+
@account = args[:account] if args.key?(:account)
|
642
|
+
@attribute = args[:attribute] if args.key?(:attribute)
|
643
|
+
@changes = args[:changes] if args.key?(:changes)
|
644
|
+
@managing_account = args[:managing_account] if args.key?(:managing_account)
|
645
|
+
@resource = args[:resource] if args.key?(:resource)
|
646
|
+
@resource_id = args[:resource_id] if args.key?(:resource_id)
|
647
|
+
@resource_type = args[:resource_type] if args.key?(:resource_type)
|
648
|
+
end
|
649
|
+
end
|
650
|
+
|
651
|
+
# Represents a promotion. See the following articles for more details. Required
|
652
|
+
# promotion input attributes to pass data validation checks are primarily
|
653
|
+
# defined below: * [Promotions data specification](https://support.google.com/
|
654
|
+
# merchants/answer/2906014) * [Local promotions data specification](https://
|
655
|
+
# support.google.com/merchants/answer/10146130) After inserting, updating a
|
656
|
+
# promotion input, it may take several minutes before the final promotion can be
|
657
|
+
# retrieved.
|
658
|
+
class Promotion
|
659
|
+
include Google::Apis::Core::Hashable
|
660
|
+
|
661
|
+
# Attributes.
|
662
|
+
# Corresponds to the JSON property `attributes`
|
663
|
+
# @return [Google::Apis::MerchantapiPromotionsV1beta::Attributes]
|
664
|
+
attr_accessor :attributes
|
665
|
+
|
666
|
+
# Required. The two-letter [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1)
|
667
|
+
# language code for the promotion. Promotions is only for [selected languages](
|
668
|
+
# https://support.google.com/merchants/answer/4588281?ref_topic=6396150&sjid=
|
669
|
+
# 18314938579342094533-NC#option3&zippy=).
|
670
|
+
# Corresponds to the JSON property `contentLanguage`
|
671
|
+
# @return [String]
|
672
|
+
attr_accessor :content_language
|
673
|
+
|
674
|
+
# Optional. A list of custom (merchant-provided) attributes. It can also be used
|
675
|
+
# for submitting any attribute of the data specification in its generic form (
|
676
|
+
# for example, `` "name": "size type", "value": "regular" ``). This is useful
|
677
|
+
# for submitting attributes not explicitly exposed by the API.
|
678
|
+
# Corresponds to the JSON property `customAttributes`
|
679
|
+
# @return [Array<Google::Apis::MerchantapiPromotionsV1beta::CustomAttribute>]
|
680
|
+
attr_accessor :custom_attributes
|
681
|
+
|
682
|
+
# Output only. The primary data source of the promotion.
|
683
|
+
# Corresponds to the JSON property `dataSource`
|
684
|
+
# @return [String]
|
685
|
+
attr_accessor :data_source
|
686
|
+
|
687
|
+
# Identifier. The name of the promotion. Format: `accounts/`account`/promotions/`
|
688
|
+
# promotion``
|
689
|
+
# Corresponds to the JSON property `name`
|
690
|
+
# @return [String]
|
691
|
+
attr_accessor :name
|
692
|
+
|
693
|
+
# Required. The user provided promotion ID to uniquely identify the promotion.
|
694
|
+
# Follow [minimum requirements](https://support.google.com/merchants/answer/
|
695
|
+
# 7050148?ref_topic=7322920&sjid=871860036916537104-NC#minimum_requirements) to
|
696
|
+
# prevent promotion disapprovals.
|
697
|
+
# Corresponds to the JSON property `promotionId`
|
698
|
+
# @return [String]
|
699
|
+
attr_accessor :promotion_id
|
700
|
+
|
701
|
+
# The status of the promotion.
|
702
|
+
# Corresponds to the JSON property `promotionStatus`
|
703
|
+
# @return [Google::Apis::MerchantapiPromotionsV1beta::PromotionStatus]
|
704
|
+
attr_accessor :promotion_status
|
705
|
+
|
706
|
+
# Required. [Redemption channel](https://support.google.com/merchants/answer/
|
707
|
+
# 13837674?ref_topic=13773355&sjid=17642868584668136159-NC) for the promotion.
|
708
|
+
# At least one channel is required.
|
709
|
+
# Corresponds to the JSON property `redemptionChannel`
|
710
|
+
# @return [Array<String>]
|
711
|
+
attr_accessor :redemption_channel
|
712
|
+
|
713
|
+
# Required. The target country used as part of the unique identifier.
|
714
|
+
# Represented as a [CLDR territory code](https://github.com/unicode-org/cldr/
|
715
|
+
# blob/latest/common/main/en.xml). Promotions are only available in selected
|
716
|
+
# countries, [Free Listings and Shopping ads](https://support.google.com/
|
717
|
+
# merchants/answer/4588460) [Local Inventory ads](https://support.google.com/
|
718
|
+
# merchants/answer/10146326)
|
719
|
+
# Corresponds to the JSON property `targetCountry`
|
720
|
+
# @return [String]
|
721
|
+
attr_accessor :target_country
|
722
|
+
|
723
|
+
# Optional. Represents the existing version (freshness) of the promotion, which
|
724
|
+
# can be used to preserve the right order when multiple updates are done at the
|
725
|
+
# same time. If set, the insertion is prevented when version number is lower
|
726
|
+
# than the current version number of the existing promotion. Re-insertion (for
|
727
|
+
# example, promotion refresh after 30 days) can be performed with the current `
|
728
|
+
# version_number`. If the operation is prevented, the aborted exception will be
|
729
|
+
# thrown.
|
730
|
+
# Corresponds to the JSON property `versionNumber`
|
731
|
+
# @return [Fixnum]
|
732
|
+
attr_accessor :version_number
|
733
|
+
|
734
|
+
def initialize(**args)
|
735
|
+
update!(**args)
|
736
|
+
end
|
737
|
+
|
738
|
+
# Update properties of this object
|
739
|
+
def update!(**args)
|
740
|
+
@attributes = args[:attributes] if args.key?(:attributes)
|
741
|
+
@content_language = args[:content_language] if args.key?(:content_language)
|
742
|
+
@custom_attributes = args[:custom_attributes] if args.key?(:custom_attributes)
|
743
|
+
@data_source = args[:data_source] if args.key?(:data_source)
|
744
|
+
@name = args[:name] if args.key?(:name)
|
745
|
+
@promotion_id = args[:promotion_id] if args.key?(:promotion_id)
|
746
|
+
@promotion_status = args[:promotion_status] if args.key?(:promotion_status)
|
747
|
+
@redemption_channel = args[:redemption_channel] if args.key?(:redemption_channel)
|
748
|
+
@target_country = args[:target_country] if args.key?(:target_country)
|
749
|
+
@version_number = args[:version_number] if args.key?(:version_number)
|
750
|
+
end
|
751
|
+
end
|
752
|
+
|
753
|
+
# The status of the promotion.
|
754
|
+
class PromotionStatus
|
755
|
+
include Google::Apis::Core::Hashable
|
756
|
+
|
757
|
+
# Output only. Date on which the promotion has been created in [ISO 8601](http://
|
758
|
+
# en.wikipedia.org/wiki/ISO_8601) format: Date, time, and offset, for example `
|
759
|
+
# 2020-01-02T09:00:00+01:00` or `2020-01-02T09:00:00Z`
|
760
|
+
# Corresponds to the JSON property `creationDate`
|
761
|
+
# @return [String]
|
762
|
+
attr_accessor :creation_date
|
763
|
+
|
764
|
+
# Output only. The intended destinations for the promotion.
|
765
|
+
# Corresponds to the JSON property `destinationStatuses`
|
766
|
+
# @return [Array<Google::Apis::MerchantapiPromotionsV1beta::DestinationStatus>]
|
767
|
+
attr_accessor :destination_statuses
|
768
|
+
|
769
|
+
# Output only. A list of issues associated with the promotion.
|
770
|
+
# Corresponds to the JSON property `itemLevelIssues`
|
771
|
+
# @return [Array<Google::Apis::MerchantapiPromotionsV1beta::ItemLevelIssue>]
|
772
|
+
attr_accessor :item_level_issues
|
773
|
+
|
774
|
+
# Output only. Date on which the promotion status has been last updated in [ISO
|
775
|
+
# 8601](http://en.wikipedia.org/wiki/ISO_8601) format: Date, time, and offset,
|
776
|
+
# for example `2020-01-02T09:00:00+01:00` or `2020-01-02T09:00:00Z`
|
777
|
+
# Corresponds to the JSON property `lastUpdateDate`
|
778
|
+
# @return [String]
|
779
|
+
attr_accessor :last_update_date
|
780
|
+
|
781
|
+
def initialize(**args)
|
782
|
+
update!(**args)
|
783
|
+
end
|
784
|
+
|
785
|
+
# Update properties of this object
|
786
|
+
def update!(**args)
|
787
|
+
@creation_date = args[:creation_date] if args.key?(:creation_date)
|
788
|
+
@destination_statuses = args[:destination_statuses] if args.key?(:destination_statuses)
|
789
|
+
@item_level_issues = args[:item_level_issues] if args.key?(:item_level_issues)
|
790
|
+
@last_update_date = args[:last_update_date] if args.key?(:last_update_date)
|
791
|
+
end
|
792
|
+
end
|
793
|
+
end
|
794
|
+
end
|
795
|
+
end
|