google-apis-merchantapi_lfp_v1beta 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,501 @@
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 MerchantapiLfpV1beta
24
+
25
+ # A generic empty message that you can re-use to avoid defining duplicated empty
26
+ # messages in your APIs. A typical example is to use it as the request or the
27
+ # response type of an API method. For instance: service Foo ` rpc Bar(google.
28
+ # protobuf.Empty) returns (google.protobuf.Empty); `
29
+ class Empty
30
+ include Google::Apis::Core::Hashable
31
+
32
+ def initialize(**args)
33
+ update!(**args)
34
+ end
35
+
36
+ # Update properties of this object
37
+ def update!(**args)
38
+ end
39
+ end
40
+
41
+ # Local Inventory for the merchant.
42
+ class LfpInventory
43
+ include Google::Apis::Core::Hashable
44
+
45
+ # Required. Availability of the product at this store. For accepted attribute
46
+ # values, see the [local product inventory data specification](https://support.
47
+ # google.com/merchants/answer/3061342)
48
+ # Corresponds to the JSON property `availability`
49
+ # @return [String]
50
+ attr_accessor :availability
51
+
52
+ # Optional. The time when the inventory is collected. If not set, it will be set
53
+ # to the time when the inventory is submitted.
54
+ # Corresponds to the JSON property `collectionTime`
55
+ # @return [String]
56
+ attr_accessor :collection_time
57
+
58
+ # Required. The two-letter ISO 639-1 language code for the item.
59
+ # Corresponds to the JSON property `contentLanguage`
60
+ # @return [String]
61
+ attr_accessor :content_language
62
+
63
+ # Optional. The [feed label](https://developers.google.com/shopping-content/
64
+ # guides/products/feed-labels) for the product. If this is not set, it will
65
+ # default to `regionCode`.
66
+ # Corresponds to the JSON property `feedLabel`
67
+ # @return [String]
68
+ attr_accessor :feed_label
69
+
70
+ # Optional. The Global Trade Item Number of the product.
71
+ # Corresponds to the JSON property `gtin`
72
+ # @return [String]
73
+ attr_accessor :gtin
74
+
75
+ # Output only. Identifier. The name for the `LfpInventory` resource. Format: `
76
+ # accounts/`account`/lfpInventories/`target_merchant`~`store_code`~`offer``
77
+ # Corresponds to the JSON property `name`
78
+ # @return [String]
79
+ attr_accessor :name
80
+
81
+ # Required. Immutable. A unique identifier for the product. If both inventories
82
+ # and sales are submitted for a merchant, this id should match for the same
83
+ # product. **Note**: if the merchant sells the same product new and used, they
84
+ # should have different IDs.
85
+ # Corresponds to the JSON property `offerId`
86
+ # @return [String]
87
+ attr_accessor :offer_id
88
+
89
+ # Optional. Supported pickup method for this offer. Unless the value is "not
90
+ # supported", this field must be submitted together with `pickupSla`. For
91
+ # accepted attribute values, see the [local product inventory data specification]
92
+ # (https://support.google.com/merchants/answer/3061342).
93
+ # Corresponds to the JSON property `pickupMethod`
94
+ # @return [String]
95
+ attr_accessor :pickup_method
96
+
97
+ # Optional. Expected date that an order will be ready for pickup relative to the
98
+ # order date. Must be submitted together with `pickupMethod`. For accepted
99
+ # attribute values, see the [local product inventory data specification](https://
100
+ # support.google.com/merchants/answer/3061342).
101
+ # Corresponds to the JSON property `pickupSla`
102
+ # @return [String]
103
+ attr_accessor :pickup_sla
104
+
105
+ # The price represented as a number and currency.
106
+ # Corresponds to the JSON property `price`
107
+ # @return [Google::Apis::MerchantapiLfpV1beta::Price]
108
+ attr_accessor :price
109
+
110
+ # Optional. Quantity of the product available at this store. Must be greater
111
+ # than or equal to zero.
112
+ # Corresponds to the JSON property `quantity`
113
+ # @return [Fixnum]
114
+ attr_accessor :quantity
115
+
116
+ # Required. The [CLDR territory code](https://github.com/unicode-org/cldr/blob/
117
+ # latest/common/main/en.xml) for the country where the product is sold.
118
+ # Corresponds to the JSON property `regionCode`
119
+ # @return [String]
120
+ attr_accessor :region_code
121
+
122
+ # Required. The identifier of the merchant's store. Either the store code
123
+ # inserted through `InsertLfpStore` or the store code in the Business Profile.
124
+ # Corresponds to the JSON property `storeCode`
125
+ # @return [String]
126
+ attr_accessor :store_code
127
+
128
+ # Required. The Merchant Center ID of the merchant to submit the inventory for.
129
+ # Corresponds to the JSON property `targetAccount`
130
+ # @return [Fixnum]
131
+ attr_accessor :target_account
132
+
133
+ def initialize(**args)
134
+ update!(**args)
135
+ end
136
+
137
+ # Update properties of this object
138
+ def update!(**args)
139
+ @availability = args[:availability] if args.key?(:availability)
140
+ @collection_time = args[:collection_time] if args.key?(:collection_time)
141
+ @content_language = args[:content_language] if args.key?(:content_language)
142
+ @feed_label = args[:feed_label] if args.key?(:feed_label)
143
+ @gtin = args[:gtin] if args.key?(:gtin)
144
+ @name = args[:name] if args.key?(:name)
145
+ @offer_id = args[:offer_id] if args.key?(:offer_id)
146
+ @pickup_method = args[:pickup_method] if args.key?(:pickup_method)
147
+ @pickup_sla = args[:pickup_sla] if args.key?(:pickup_sla)
148
+ @price = args[:price] if args.key?(:price)
149
+ @quantity = args[:quantity] if args.key?(:quantity)
150
+ @region_code = args[:region_code] if args.key?(:region_code)
151
+ @store_code = args[:store_code] if args.key?(:store_code)
152
+ @target_account = args[:target_account] if args.key?(:target_account)
153
+ end
154
+ end
155
+
156
+ # A sale for the merchant.
157
+ class LfpSale
158
+ include Google::Apis::Core::Hashable
159
+
160
+ # Required. The two-letter ISO 639-1 language code for the item.
161
+ # Corresponds to the JSON property `contentLanguage`
162
+ # @return [String]
163
+ attr_accessor :content_language
164
+
165
+ # Optional. The [feed label](https://developers.google.com/shopping-content/
166
+ # guides/products/feed-labels) for the product. If this is not set, it will
167
+ # default to `regionCode`.
168
+ # Corresponds to the JSON property `feedLabel`
169
+ # @return [String]
170
+ attr_accessor :feed_label
171
+
172
+ # Required. The Global Trade Item Number of the sold product.
173
+ # Corresponds to the JSON property `gtin`
174
+ # @return [String]
175
+ attr_accessor :gtin
176
+
177
+ # Output only. Identifier. The name of the `LfpSale` resource. Format: `accounts/
178
+ # `account`/lfpSales/`sale``
179
+ # Corresponds to the JSON property `name`
180
+ # @return [String]
181
+ attr_accessor :name
182
+
183
+ # Required. A unique identifier for the product. If both inventories and sales
184
+ # are submitted for a merchant, this id should match for the same product. **
185
+ # Note**: if the merchant sells the same product new and used, they should have
186
+ # different IDs.
187
+ # Corresponds to the JSON property `offerId`
188
+ # @return [String]
189
+ attr_accessor :offer_id
190
+
191
+ # The price represented as a number and currency.
192
+ # Corresponds to the JSON property `price`
193
+ # @return [Google::Apis::MerchantapiLfpV1beta::Price]
194
+ attr_accessor :price
195
+
196
+ # Required. The relative change of the available quantity. Negative for items
197
+ # returned.
198
+ # Corresponds to the JSON property `quantity`
199
+ # @return [Fixnum]
200
+ attr_accessor :quantity
201
+
202
+ # Required. The [CLDR territory code](https://github.com/unicode-org/cldr/blob/
203
+ # latest/common/main/en.xml) for the country where the product is sold.
204
+ # Corresponds to the JSON property `regionCode`
205
+ # @return [String]
206
+ attr_accessor :region_code
207
+
208
+ # Required. The timestamp for the sale.
209
+ # Corresponds to the JSON property `saleTime`
210
+ # @return [String]
211
+ attr_accessor :sale_time
212
+
213
+ # Required. The identifier of the merchant's store. Either a `storeCode`
214
+ # inserted through the API or the code of the store in the Business Profile.
215
+ # Corresponds to the JSON property `storeCode`
216
+ # @return [String]
217
+ attr_accessor :store_code
218
+
219
+ # Required. The Merchant Center ID of the merchant to submit the sale for.
220
+ # Corresponds to the JSON property `targetAccount`
221
+ # @return [Fixnum]
222
+ attr_accessor :target_account
223
+
224
+ # Output only. System generated globally unique ID for the `LfpSale`.
225
+ # Corresponds to the JSON property `uid`
226
+ # @return [String]
227
+ attr_accessor :uid
228
+
229
+ def initialize(**args)
230
+ update!(**args)
231
+ end
232
+
233
+ # Update properties of this object
234
+ def update!(**args)
235
+ @content_language = args[:content_language] if args.key?(:content_language)
236
+ @feed_label = args[:feed_label] if args.key?(:feed_label)
237
+ @gtin = args[:gtin] if args.key?(:gtin)
238
+ @name = args[:name] if args.key?(:name)
239
+ @offer_id = args[:offer_id] if args.key?(:offer_id)
240
+ @price = args[:price] if args.key?(:price)
241
+ @quantity = args[:quantity] if args.key?(:quantity)
242
+ @region_code = args[:region_code] if args.key?(:region_code)
243
+ @sale_time = args[:sale_time] if args.key?(:sale_time)
244
+ @store_code = args[:store_code] if args.key?(:store_code)
245
+ @target_account = args[:target_account] if args.key?(:target_account)
246
+ @uid = args[:uid] if args.key?(:uid)
247
+ end
248
+ end
249
+
250
+ # A store for the merchant. This will be used to match to a store under the
251
+ # Google Business Profile of the target merchant. If a matching store can't be
252
+ # found, the inventories or sales submitted with the store code will not be used.
253
+ class LfpStore
254
+ include Google::Apis::Core::Hashable
255
+
256
+ # Optional. [Google My Business category id](https://gcid-explorer.corp.google.
257
+ # com/static/gcid.html).
258
+ # Corresponds to the JSON property `gcidCategory`
259
+ # @return [Array<String>]
260
+ attr_accessor :gcid_category
261
+
262
+ # Optional. Output only. The state of matching to a Google Business Profile. See
263
+ # matchingStateHint for further details if no match is found.
264
+ # Corresponds to the JSON property `matchingState`
265
+ # @return [String]
266
+ attr_accessor :matching_state
267
+
268
+ # Optional. Output only. The hint of why the matching has failed. This is only
269
+ # set when matchingState=`STORE_MATCHING_STATE_FAILED`. Possible values are: - "`
270
+ # linked-store-not-found`": There aren't any Google Business Profile stores
271
+ # available for matching. - "`store-match-not-found`": The provided `LfpStore`
272
+ # couldn't be matched to any of the connected Google Business Profile stores.
273
+ # Merchant Center account is connected correctly and stores are available on
274
+ # Google Business Profile, but the `LfpStore` location address does not match
275
+ # with Google Business Profile stores' addresses. Update the `LfpStore` address
276
+ # or Google Business Profile store address to match correctly. - "`store-match-
277
+ # unverified`": The provided `LfpStore` couldn't be matched to any of the
278
+ # connected Google Business Profile stores, as the matched Google Business
279
+ # Profile store is unverified. Go through the Google Business Profile
280
+ # verification process to match correctly.
281
+ # Corresponds to the JSON property `matchingStateHint`
282
+ # @return [String]
283
+ attr_accessor :matching_state_hint
284
+
285
+ # Output only. Identifier. The name of the `LfpStore` resource. Format: `
286
+ # accounts/`account`/lfpStores/`target_merchant`~`store_code``
287
+ # Corresponds to the JSON property `name`
288
+ # @return [String]
289
+ attr_accessor :name
290
+
291
+ # Optional. The store phone number in [E.164](https://en.wikipedia.org/wiki/E.
292
+ # 164) format. Example: `+15556767888`
293
+ # Corresponds to the JSON property `phoneNumber`
294
+ # @return [String]
295
+ attr_accessor :phone_number
296
+
297
+ # Optional. The [Google Place Id](https://developers.google.com/maps/
298
+ # documentation/places/web-service/place-id#id-overview) of the store location.
299
+ # Corresponds to the JSON property `placeId`
300
+ # @return [String]
301
+ attr_accessor :place_id
302
+
303
+ # Required. The street address of the store. Example: 1600 Amphitheatre Pkwy,
304
+ # Mountain View, CA 94043, USA.
305
+ # Corresponds to the JSON property `storeAddress`
306
+ # @return [String]
307
+ attr_accessor :store_address
308
+
309
+ # Required. Immutable. A store identifier that is unique for the target merchant.
310
+ # Corresponds to the JSON property `storeCode`
311
+ # @return [String]
312
+ attr_accessor :store_code
313
+
314
+ # Optional. The merchant or store name.
315
+ # Corresponds to the JSON property `storeName`
316
+ # @return [String]
317
+ attr_accessor :store_name
318
+
319
+ # Required. The Merchant Center id of the merchant to submit the store for.
320
+ # Corresponds to the JSON property `targetAccount`
321
+ # @return [Fixnum]
322
+ attr_accessor :target_account
323
+
324
+ # Optional. The website URL for the store or merchant.
325
+ # Corresponds to the JSON property `websiteUri`
326
+ # @return [String]
327
+ attr_accessor :website_uri
328
+
329
+ def initialize(**args)
330
+ update!(**args)
331
+ end
332
+
333
+ # Update properties of this object
334
+ def update!(**args)
335
+ @gcid_category = args[:gcid_category] if args.key?(:gcid_category)
336
+ @matching_state = args[:matching_state] if args.key?(:matching_state)
337
+ @matching_state_hint = args[:matching_state_hint] if args.key?(:matching_state_hint)
338
+ @name = args[:name] if args.key?(:name)
339
+ @phone_number = args[:phone_number] if args.key?(:phone_number)
340
+ @place_id = args[:place_id] if args.key?(:place_id)
341
+ @store_address = args[:store_address] if args.key?(:store_address)
342
+ @store_code = args[:store_code] if args.key?(:store_code)
343
+ @store_name = args[:store_name] if args.key?(:store_name)
344
+ @target_account = args[:target_account] if args.key?(:target_account)
345
+ @website_uri = args[:website_uri] if args.key?(:website_uri)
346
+ end
347
+ end
348
+
349
+ # Response message for the ListLfpStores method.
350
+ class ListLfpStoresResponse
351
+ include Google::Apis::Core::Hashable
352
+
353
+ # The stores from the specified merchant.
354
+ # Corresponds to the JSON property `lfpStores`
355
+ # @return [Array<Google::Apis::MerchantapiLfpV1beta::LfpStore>]
356
+ attr_accessor :lfp_stores
357
+
358
+ # A token, which can be sent as `pageToken` to retrieve the next page. If this
359
+ # field is omitted, there are no subsequent pages.
360
+ # Corresponds to the JSON property `nextPageToken`
361
+ # @return [String]
362
+ attr_accessor :next_page_token
363
+
364
+ def initialize(**args)
365
+ update!(**args)
366
+ end
367
+
368
+ # Update properties of this object
369
+ def update!(**args)
370
+ @lfp_stores = args[:lfp_stores] if args.key?(:lfp_stores)
371
+ @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
372
+ end
373
+ end
374
+
375
+ # The price represented as a number and currency.
376
+ class Price
377
+ include Google::Apis::Core::Hashable
378
+
379
+ # The price represented as a number in micros (1 million micros is an equivalent
380
+ # to one's currency standard unit, for example, 1 USD = 1000000 micros).
381
+ # Corresponds to the JSON property `amountMicros`
382
+ # @return [Fixnum]
383
+ attr_accessor :amount_micros
384
+
385
+ # The currency of the price using three-letter acronyms according to [ISO 4217](
386
+ # http://en.wikipedia.org/wiki/ISO_4217).
387
+ # Corresponds to the JSON property `currencyCode`
388
+ # @return [String]
389
+ attr_accessor :currency_code
390
+
391
+ def initialize(**args)
392
+ update!(**args)
393
+ end
394
+
395
+ # Update properties of this object
396
+ def update!(**args)
397
+ @amount_micros = args[:amount_micros] if args.key?(:amount_micros)
398
+ @currency_code = args[:currency_code] if args.key?(:currency_code)
399
+ end
400
+ end
401
+
402
+ # The change that happened to the product including old value, new value,
403
+ # country code as the region code and reporting context.
404
+ class ProductChange
405
+ include Google::Apis::Core::Hashable
406
+
407
+ # The new value of the changed resource or attribute.
408
+ # Corresponds to the JSON property `newValue`
409
+ # @return [String]
410
+ attr_accessor :new_value
411
+
412
+ # The old value of the changed resource or attribute.
413
+ # Corresponds to the JSON property `oldValue`
414
+ # @return [String]
415
+ attr_accessor :old_value
416
+
417
+ # Countries that have the change (if applicable)
418
+ # Corresponds to the JSON property `regionCode`
419
+ # @return [String]
420
+ attr_accessor :region_code
421
+
422
+ # Reporting contexts that have the change (if applicable)
423
+ # Corresponds to the JSON property `reportingContext`
424
+ # @return [String]
425
+ attr_accessor :reporting_context
426
+
427
+ def initialize(**args)
428
+ update!(**args)
429
+ end
430
+
431
+ # Update properties of this object
432
+ def update!(**args)
433
+ @new_value = args[:new_value] if args.key?(:new_value)
434
+ @old_value = args[:old_value] if args.key?(:old_value)
435
+ @region_code = args[:region_code] if args.key?(:region_code)
436
+ @reporting_context = args[:reporting_context] if args.key?(:reporting_context)
437
+ end
438
+ end
439
+
440
+ # The message that the merchant will receive to notify about product status
441
+ # change event
442
+ class ProductStatusChangeMessage
443
+ include Google::Apis::Core::Hashable
444
+
445
+ # The target account that owns the entity that changed. Format : `accounts/`
446
+ # merchant_id``
447
+ # Corresponds to the JSON property `account`
448
+ # @return [String]
449
+ attr_accessor :account
450
+
451
+ # The attribute in the resource that changed, in this case it will be always `
452
+ # Status`.
453
+ # Corresponds to the JSON property `attribute`
454
+ # @return [String]
455
+ attr_accessor :attribute
456
+
457
+ # A message to describe the change that happened to the product
458
+ # Corresponds to the JSON property `changes`
459
+ # @return [Array<Google::Apis::MerchantapiLfpV1beta::ProductChange>]
460
+ attr_accessor :changes
461
+
462
+ # The account that manages the merchant's account. can be the same as merchant
463
+ # id if it is standalone account. Format : `accounts/`service_provider_id``
464
+ # Corresponds to the JSON property `managingAccount`
465
+ # @return [String]
466
+ attr_accessor :managing_account
467
+
468
+ # The product name. Format: ``product.name=accounts/`account`/products/`product``
469
+ # `
470
+ # Corresponds to the JSON property `resource`
471
+ # @return [String]
472
+ attr_accessor :resource
473
+
474
+ # The product id.
475
+ # Corresponds to the JSON property `resourceId`
476
+ # @return [String]
477
+ attr_accessor :resource_id
478
+
479
+ # The resource that changed, in this case it will always be `Product`.
480
+ # Corresponds to the JSON property `resourceType`
481
+ # @return [String]
482
+ attr_accessor :resource_type
483
+
484
+ def initialize(**args)
485
+ update!(**args)
486
+ end
487
+
488
+ # Update properties of this object
489
+ def update!(**args)
490
+ @account = args[:account] if args.key?(:account)
491
+ @attribute = args[:attribute] if args.key?(:attribute)
492
+ @changes = args[:changes] if args.key?(:changes)
493
+ @managing_account = args[:managing_account] if args.key?(:managing_account)
494
+ @resource = args[:resource] if args.key?(:resource)
495
+ @resource_id = args[:resource_id] if args.key?(:resource_id)
496
+ @resource_type = args[:resource_type] if args.key?(:resource_type)
497
+ end
498
+ end
499
+ end
500
+ end
501
+ end
@@ -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 MerchantapiLfpV1beta
18
+ # Version of the google-apis-merchantapi_lfp_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