forked from googleapis/google-api-go-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
content-gen.go
6035 lines (5279 loc) · 186 KB
/
content-gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Package content provides access to the Content API for Shopping.
//
// See https://developers.google.com/shopping-content
//
// Usage example:
//
// import "google.golang.org/api/content/v2"
// ...
// contentService, err := content.New(oauthHttpClient)
package content
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/context"
"google.golang.org/api/googleapi"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Background
const apiId = "content:v2"
const apiName = "content"
const apiVersion = "v2"
const basePath = "https://www.googleapis.com/content/v2/"
// OAuth2 scopes used by this API.
const (
// Manage your product listings and accounts for Google Shopping
ContentScope = "https://www.googleapis.com/auth/content"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Accounts = NewAccountsService(s)
s.Accountshipping = NewAccountshippingService(s)
s.Accountstatuses = NewAccountstatusesService(s)
s.Accounttax = NewAccounttaxService(s)
s.Datafeeds = NewDatafeedsService(s)
s.Datafeedstatuses = NewDatafeedstatusesService(s)
s.Inventory = NewInventoryService(s)
s.Products = NewProductsService(s)
s.Productstatuses = NewProductstatusesService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Accounts *AccountsService
Accountshipping *AccountshippingService
Accountstatuses *AccountstatusesService
Accounttax *AccounttaxService
Datafeeds *DatafeedsService
Datafeedstatuses *DatafeedstatusesService
Inventory *InventoryService
Products *ProductsService
Productstatuses *ProductstatusesService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewAccountsService(s *Service) *AccountsService {
rs := &AccountsService{s: s}
return rs
}
type AccountsService struct {
s *Service
}
func NewAccountshippingService(s *Service) *AccountshippingService {
rs := &AccountshippingService{s: s}
return rs
}
type AccountshippingService struct {
s *Service
}
func NewAccountstatusesService(s *Service) *AccountstatusesService {
rs := &AccountstatusesService{s: s}
return rs
}
type AccountstatusesService struct {
s *Service
}
func NewAccounttaxService(s *Service) *AccounttaxService {
rs := &AccounttaxService{s: s}
return rs
}
type AccounttaxService struct {
s *Service
}
func NewDatafeedsService(s *Service) *DatafeedsService {
rs := &DatafeedsService{s: s}
return rs
}
type DatafeedsService struct {
s *Service
}
func NewDatafeedstatusesService(s *Service) *DatafeedstatusesService {
rs := &DatafeedstatusesService{s: s}
return rs
}
type DatafeedstatusesService struct {
s *Service
}
func NewInventoryService(s *Service) *InventoryService {
rs := &InventoryService{s: s}
return rs
}
type InventoryService struct {
s *Service
}
func NewProductsService(s *Service) *ProductsService {
rs := &ProductsService{s: s}
return rs
}
type ProductsService struct {
s *Service
}
func NewProductstatusesService(s *Service) *ProductstatusesService {
rs := &ProductstatusesService{s: s}
return rs
}
type ProductstatusesService struct {
s *Service
}
// Account: Account data.
type Account struct {
// AdultContent: Indicates whether the merchant sells adult content.
AdultContent bool `json:"adultContent,omitempty"`
// AdwordsLinks: List of linked AdWords accounts, active or pending
// approval. To create a new link request, add a new link with status
// active to the list. It will remain is state pending until approved or
// rejected in the AdWords interface. To delete an active link or to
// cancel a link request, remove it from the list.
AdwordsLinks []*AccountAdwordsLink `json:"adwordsLinks,omitempty"`
// Id: Merchant Center account ID.
Id uint64 `json:"id,omitempty,string"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#account".
Kind string `json:"kind,omitempty"`
// Name: Display name for the account.
Name string `json:"name,omitempty"`
// ReviewsUrl: URL for individual seller reviews, i.e., reviews for each
// child account.
ReviewsUrl string `json:"reviewsUrl,omitempty"`
// SellerId: Client-specific, locally-unique, internal ID for the child
// account.
SellerId string `json:"sellerId,omitempty"`
// Users: Users with access to the account. Every account (except for
// subaccounts) must have at least one admin user.
Users []*AccountUser `json:"users,omitempty"`
// WebsiteUrl: The merchant's website.
WebsiteUrl string `json:"websiteUrl,omitempty"`
}
type AccountAdwordsLink struct {
// AdwordsId: Customer ID of the AdWords account.
AdwordsId uint64 `json:"adwordsId,omitempty,string"`
// Status: Status of the link between this Merchant Center account and
// the AdWords account. Upon retrieval, it represents the actual status
// of the link and can be either active if it was approved in Google
// AdWords or pending if it's pending approval. Upon insertion, it
// represents the intended status of the link. Re-uploading a link with
// status active when it's still pending or with status pending when
// it's already active will have no effect: the status will remain
// unchanged. Re-uploading a link with deprecated status inactive is
// equivalent to not submitting the link at all and will delete the link
// if it was active or cancel the link request if it was pending.
Status string `json:"status,omitempty"`
}
type AccountIdentifier struct {
// AggregatorId: The aggregator ID, set for aggregators and subaccounts
// (in that case, it represents the aggregator of the subaccount).
AggregatorId uint64 `json:"aggregatorId,omitempty,string"`
// MerchantId: The merchant account ID, set for individual accounts and
// subaccounts.
MerchantId uint64 `json:"merchantId,omitempty,string"`
}
// AccountShipping: The shipping settings of a merchant account.
type AccountShipping struct {
// AccountId: The ID of the account to which these account shipping
// settings belong.
AccountId uint64 `json:"accountId,omitempty,string"`
// CarrierRates: Carrier-based shipping calculations.
CarrierRates []*AccountShippingCarrierRate `json:"carrierRates,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#accountShipping".
Kind string `json:"kind,omitempty"`
// LocationGroups: Location groups for shipping.
LocationGroups []*AccountShippingLocationGroup `json:"locationGroups,omitempty"`
// RateTables: Rate tables definitions.
RateTables []*AccountShippingRateTable `json:"rateTables,omitempty"`
// Services: Shipping services describing shipping fees calculation.
Services []*AccountShippingShippingService `json:"services,omitempty"`
}
// AccountShippingCarrierRate: A carrier-calculated shipping rate.
type AccountShippingCarrierRate struct {
// Carrier: The carrier that is responsible for the shipping, such as
// "UPS", "FedEx", or "USPS".
Carrier string `json:"carrier,omitempty"`
// CarrierService: The carrier service, such as "Ground" or "2Day".
CarrierService string `json:"carrierService,omitempty"`
// ModifierFlatRate: Additive shipping rate modifier.
ModifierFlatRate *Price `json:"modifierFlatRate,omitempty"`
// ModifierPercent: Multiplicative shipping rate modifier in percent.
// Represented as a floating point number without the percentage
// character.
ModifierPercent string `json:"modifierPercent,omitempty"`
// Name: The name of the carrier rate.
Name string `json:"name,omitempty"`
// SaleCountry: The sale country for which this carrier rate is valid,
// represented as a CLDR territory code.
SaleCountry string `json:"saleCountry,omitempty"`
// ShippingOrigin: Shipping origin represented as a postal code.
ShippingOrigin string `json:"shippingOrigin,omitempty"`
}
type AccountShippingCondition struct {
// DeliveryLocationGroup: Delivery location in terms of a location group
// name. A location group with this name must be specified among
// location groups.
DeliveryLocationGroup string `json:"deliveryLocationGroup,omitempty"`
// DeliveryLocationId: Delivery location in terms of a location ID. Can
// be used to represent administrative areas, smaller country
// subdivisions, or cities.
DeliveryLocationId int64 `json:"deliveryLocationId,omitempty,string"`
// DeliveryPostalCode: Delivery location in terms of a postal code.
DeliveryPostalCode string `json:"deliveryPostalCode,omitempty"`
// DeliveryPostalCodeRange: Delivery location in terms of a postal code
// range.
DeliveryPostalCodeRange *AccountShippingPostalCodeRange `json:"deliveryPostalCodeRange,omitempty"`
// PriceMax: Maximum shipping price. Forms an interval between the
// maximum of smaller prices (exclusive) and this price (inclusive).
PriceMax *Price `json:"priceMax,omitempty"`
// ShippingLabel: Shipping label of the product. The products with the
// label are matched.
ShippingLabel string `json:"shippingLabel,omitempty"`
// WeightMax: Maximum shipping weight. Forms an interval between the
// maximum of smaller weight (exclusive) and this weight (inclusive).
WeightMax *Weight `json:"weightMax,omitempty"`
}
// AccountShippingLocationGroup: A user-defined locations group in a
// given country. All the locations of the group must be of the same
// type.
type AccountShippingLocationGroup struct {
// Country: The CLDR territory code of the country in which this
// location group is.
Country string `json:"country,omitempty"`
// LocationIds: A location ID (also called criteria ID) representing
// administrative areas, smaller country subdivisions (counties), or
// cities.
LocationIds googleapi.Int64s `json:"locationIds,omitempty"`
// Name: The name of the location group.
Name string `json:"name,omitempty"`
// PostalCodeRanges: A postal code range representing a city or a set of
// cities.
PostalCodeRanges []*AccountShippingPostalCodeRange `json:"postalCodeRanges,omitempty"`
// PostalCodes: A postal code representing a city or a set of cities.
//
// - A single postal code (e.g., 12345)
// - A postal code prefix followed by a star (e.g., 1234*)
PostalCodes []string `json:"postalCodes,omitempty"`
}
// AccountShippingPostalCodeRange: A postal code range, that can be
// either:
// - A range of postal codes (e.g., start=12340, end=12359)
// - A range of postal codes prefixes (e.g., start=1234* end=1235*).
// Prefixes must be of the same length (e.g., start=12* end=2* is
// invalid).
type AccountShippingPostalCodeRange struct {
// End: The last (inclusive) postal code or prefix of the range.
End string `json:"end,omitempty"`
// Start: The first (inclusive) postal code or prefix of the range.
Start string `json:"start,omitempty"`
}
// AccountShippingRateTable: A single or bi-dimensional table of
// shipping rates. Each dimension is defined in terms of consecutive
// price/weight ranges, delivery locations, or shipping labels.
type AccountShippingRateTable struct {
// Content: One-dimensional table cells define one condition along the
// same dimension. Bi-dimensional table cells use two dimensions with
// respectively M and N distinct values and must contain exactly M * N
// cells with distinct conditions (for each possible value pairs).
Content []*AccountShippingRateTableCell `json:"content,omitempty"`
// Name: The name of the rate table.
Name string `json:"name,omitempty"`
// SaleCountry: The sale country for which this table is valid,
// represented as a CLDR territory code.
SaleCountry string `json:"saleCountry,omitempty"`
}
type AccountShippingRateTableCell struct {
// Condition: Conditions for which the cell is valid. All cells in a
// table must use the same dimension or pair of dimensions among price,
// weight, shipping label or delivery location. If no condition is
// specified, the cell acts as a catch-all and matches all the elements
// that are not matched by other cells in this dimension.
Condition *AccountShippingCondition `json:"condition,omitempty"`
// Rate: The rate applicable if the cell conditions are matched.
Rate *Price `json:"rate,omitempty"`
}
// AccountShippingShippingService: Shipping services provided in a
// country.
type AccountShippingShippingService struct {
// Active: Whether the shipping service is available.
Active bool `json:"active,omitempty"`
// CalculationMethod: Calculation method for the "simple" case that
// needs no rules.
CalculationMethod *AccountShippingShippingServiceCalculationMethod `json:"calculationMethod,omitempty"`
// CostRuleTree: Decision tree for "complicated" shipping cost
// calculation.
CostRuleTree *AccountShippingShippingServiceCostRule `json:"costRuleTree,omitempty"`
// Name: The name of this shipping service.
Name string `json:"name,omitempty"`
// SaleCountry: The CLDR territory code of the sale country for which
// this service can be used.
SaleCountry string `json:"saleCountry,omitempty"`
}
// AccountShippingShippingServiceCalculationMethod: Shipping cost
// calculation method. Exactly one of the field is set.
type AccountShippingShippingServiceCalculationMethod struct {
// CarrierRate: Name of the carrier rate to use for the calculation.
CarrierRate string `json:"carrierRate,omitempty"`
// Excluded: Delivery is excluded. Valid only within cost rules tree.
Excluded bool `json:"excluded,omitempty"`
// FlatRate: Fixed price shipping, represented as a floating point
// number associated with a currency.
FlatRate *Price `json:"flatRate,omitempty"`
// PercentageRate: Percentage of the price, represented as a floating
// point number without the percentage character.
PercentageRate string `json:"percentageRate,omitempty"`
// RateTable: Name of the rate table to use for the calculation.
RateTable string `json:"rateTable,omitempty"`
}
// AccountShippingShippingServiceCostRule: Building block of the cost
// calculation decision tree.
// - The tree root should have no condition and no calculation method.
// - All the children must have a condition on the same dimension. The
// first child matching a condition is entered, therefore, price and
// weight conditions form contiguous intervals.
// - The last child of an element must have no condition and matches all
// elements not previously matched.
// - Children and calculation method are mutually exclusive, and exactly
// one of them must be defined; the root must only have children.
type AccountShippingShippingServiceCostRule struct {
// CalculationMethod: Final calculation method to be used only in leaf
// nodes.
CalculationMethod *AccountShippingShippingServiceCalculationMethod `json:"calculationMethod,omitempty"`
// Children: Subsequent rules to be applied, only for inner nodes. The
// last child must not specify a condition and acts as a catch-all.
Children []*AccountShippingShippingServiceCostRule `json:"children,omitempty"`
// Condition: Condition for this rule to be applicable. If no condition
// is specified, the rule acts as a catch-all.
Condition *AccountShippingCondition `json:"condition,omitempty"`
}
// AccountStatus: The status of an account, i.e., information about its
// products, which is computed offline and not returned immediately at
// insertion time.
type AccountStatus struct {
// AccountId: The ID of the account for which the status is reported.
AccountId string `json:"accountId,omitempty"`
// DataQualityIssues: A list of data quality issues.
DataQualityIssues []*AccountStatusDataQualityIssue `json:"dataQualityIssues,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#accountStatus".
Kind string `json:"kind,omitempty"`
}
type AccountStatusDataQualityIssue struct {
// Country: Country for which this issue is reported.
Country string `json:"country,omitempty"`
// DisplayedValue: Actual value displayed on the landing page.
DisplayedValue string `json:"displayedValue,omitempty"`
// ExampleItems: Example items featuring the issue.
ExampleItems []*AccountStatusExampleItem `json:"exampleItems,omitempty"`
// Id: Issue identifier.
Id string `json:"id,omitempty"`
// LastChecked: Last time the account was checked for this issue.
LastChecked string `json:"lastChecked,omitempty"`
// NumItems: Number of items in the account found to have the said
// issue.
NumItems int64 `json:"numItems,omitempty"`
// Severity: Severity of the problem.
Severity string `json:"severity,omitempty"`
// SubmittedValue: Submitted value that causes the issue.
SubmittedValue string `json:"submittedValue,omitempty"`
}
// AccountStatusExampleItem: An example of an item that has poor data
// quality. An item value on the landing page differs from what is
// submitted, or conflicts with a policy.
type AccountStatusExampleItem struct {
// ItemId: Unique item ID as specified in the uploaded product data.
ItemId string `json:"itemId,omitempty"`
// Link: Landing page of the item.
Link string `json:"link,omitempty"`
// SubmittedValue: The item value that was submitted.
SubmittedValue string `json:"submittedValue,omitempty"`
// Title: Title of the item.
Title string `json:"title,omitempty"`
// ValueOnLandingPage: The actual value on the landing page.
ValueOnLandingPage string `json:"valueOnLandingPage,omitempty"`
}
// AccountTax: The tax settings of a merchant account.
type AccountTax struct {
// AccountId: The ID of the account to which these account tax settings
// belong.
AccountId uint64 `json:"accountId,omitempty,string"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#accountTax".
Kind string `json:"kind,omitempty"`
// Rules: Tax rules. Updating the tax rules will enable US taxes (not
// reversible). Defining no rules is equivalent to not charging tax at
// all.
Rules []*AccountTaxTaxRule `json:"rules,omitempty"`
}
// AccountTaxTaxRule: Tax calculation rule to apply in a state or
// province (USA only).
type AccountTaxTaxRule struct {
// Country: Country code in which tax is applicable.
Country string `json:"country,omitempty"`
// LocationId: State (or province) is which the tax is applicable,
// described by its location id (also called criteria id).
LocationId uint64 `json:"locationId,omitempty,string"`
// RatePercent: Explicit tax rate in percent, represented as a floating
// point number without the percentage character. Must not be negative.
RatePercent string `json:"ratePercent,omitempty"`
// ShippingTaxed: If true, shipping charges are also taxed.
ShippingTaxed bool `json:"shippingTaxed,omitempty"`
// UseGlobalRate: Whether the tax rate is taken from a global tax table
// or specified explicitly.
UseGlobalRate bool `json:"useGlobalRate,omitempty"`
}
type AccountUser struct {
// Admin: Whether user is an admin.
Admin *bool `json:"admin,omitempty"`
// EmailAddress: User's email address.
EmailAddress string `json:"emailAddress,omitempty"`
}
type AccountsAuthInfoResponse struct {
// AccountIdentifiers: The account identifiers corresponding to the
// authenticated user.
// - For an individual account: only the merchant ID is defined
// - For an aggregator: only the aggregator ID is defined
// - For a subaccount of an MCA: both the merchant ID and the aggregator
// ID are defined.
AccountIdentifiers []*AccountIdentifier `json:"accountIdentifiers,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#accountsAuthInfoResponse".
Kind string `json:"kind,omitempty"`
}
type AccountsCustomBatchRequest struct {
// Entries: The request entries to be processed in the batch.
Entries []*AccountsCustomBatchRequestEntry `json:"entries,omitempty"`
}
// AccountsCustomBatchRequestEntry: A batch entry encoding a single
// non-batch accounts request.
type AccountsCustomBatchRequestEntry struct {
// Account: The account to create or update. Only defined if the method
// is insert or update.
Account *Account `json:"account,omitempty"`
// AccountId: The ID of the account to get or delete. Only defined if
// the method is get or delete.
AccountId uint64 `json:"accountId,omitempty,string"`
// BatchId: An entry ID, unique within the batch request.
BatchId int64 `json:"batchId,omitempty"`
// MerchantId: The ID of the managing account.
MerchantId uint64 `json:"merchantId,omitempty,string"`
Method string `json:"method,omitempty"`
}
type AccountsCustomBatchResponse struct {
// Entries: The result of the execution of the batch requests.
Entries []*AccountsCustomBatchResponseEntry `json:"entries,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#accountsCustomBatchResponse".
Kind string `json:"kind,omitempty"`
}
// AccountsCustomBatchResponseEntry: A batch entry encoding a single
// non-batch accounts response.
type AccountsCustomBatchResponseEntry struct {
// Account: The retrieved, created, or updated account. Not defined if
// the method was delete.
Account *Account `json:"account,omitempty"`
// BatchId: The ID of the request entry this entry responds to.
BatchId int64 `json:"batchId,omitempty"`
// Errors: A list of errors defined if and only if the request failed.
Errors *Errors `json:"errors,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#accountsCustomBatchResponseEntry".
Kind string `json:"kind,omitempty"`
}
type AccountsListResponse struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#accountsListResponse".
Kind string `json:"kind,omitempty"`
// NextPageToken: The token for the retrieval of the next page of
// accounts.
NextPageToken string `json:"nextPageToken,omitempty"`
Resources []*Account `json:"resources,omitempty"`
}
type AccountshippingCustomBatchRequest struct {
// Entries: The request entries to be processed in the batch.
Entries []*AccountshippingCustomBatchRequestEntry `json:"entries,omitempty"`
}
// AccountshippingCustomBatchRequestEntry: A batch entry encoding a
// single non-batch accountshipping request.
type AccountshippingCustomBatchRequestEntry struct {
// AccountId: The ID of the account for which to get/update account
// shipping settings.
AccountId uint64 `json:"accountId,omitempty,string"`
// AccountShipping: The account shipping settings to update. Only
// defined if the method is update.
AccountShipping *AccountShipping `json:"accountShipping,omitempty"`
// BatchId: An entry ID, unique within the batch request.
BatchId int64 `json:"batchId,omitempty"`
// MerchantId: The ID of the managing account.
MerchantId uint64 `json:"merchantId,omitempty,string"`
Method string `json:"method,omitempty"`
}
type AccountshippingCustomBatchResponse struct {
// Entries: The result of the execution of the batch requests.
Entries []*AccountshippingCustomBatchResponseEntry `json:"entries,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#accountshippingCustomBatchResponse".
Kind string `json:"kind,omitempty"`
}
// AccountshippingCustomBatchResponseEntry: A batch entry encoding a
// single non-batch accountshipping response.
type AccountshippingCustomBatchResponseEntry struct {
// AccountShipping: The retrieved or updated account shipping settings.
AccountShipping *AccountShipping `json:"accountShipping,omitempty"`
// BatchId: The ID of the request entry this entry responds to.
BatchId int64 `json:"batchId,omitempty"`
// Errors: A list of errors defined if and only if the request failed.
Errors *Errors `json:"errors,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#accountshippingCustomBatchResponseEntry".
Kind string `json:"kind,omitempty"`
}
type AccountshippingListResponse struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#accountshippingListResponse".
Kind string `json:"kind,omitempty"`
// NextPageToken: The token for the retrieval of the next page of
// account shipping settings.
NextPageToken string `json:"nextPageToken,omitempty"`
Resources []*AccountShipping `json:"resources,omitempty"`
}
type AccountstatusesCustomBatchRequest struct {
// Entries: The request entries to be processed in the batch.
Entries []*AccountstatusesCustomBatchRequestEntry `json:"entries,omitempty"`
}
// AccountstatusesCustomBatchRequestEntry: A batch entry encoding a
// single non-batch accountstatuses request.
type AccountstatusesCustomBatchRequestEntry struct {
// AccountId: The ID of the (sub-)account whose status to get.
AccountId uint64 `json:"accountId,omitempty,string"`
// BatchId: An entry ID, unique within the batch request.
BatchId int64 `json:"batchId,omitempty"`
// MerchantId: The ID of the managing account.
MerchantId uint64 `json:"merchantId,omitempty,string"`
// Method: The method (get).
Method string `json:"method,omitempty"`
}
type AccountstatusesCustomBatchResponse struct {
// Entries: The result of the execution of the batch requests.
Entries []*AccountstatusesCustomBatchResponseEntry `json:"entries,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#accountstatusesCustomBatchResponse".
Kind string `json:"kind,omitempty"`
}
// AccountstatusesCustomBatchResponseEntry: A batch entry encoding a
// single non-batch accountstatuses response.
type AccountstatusesCustomBatchResponseEntry struct {
// AccountStatus: The requested account status. Defined if and only if
// the request was successful.
AccountStatus *AccountStatus `json:"accountStatus,omitempty"`
// BatchId: The ID of the request entry this entry responds to.
BatchId int64 `json:"batchId,omitempty"`
// Errors: A list of errors defined if and only if the request failed.
Errors *Errors `json:"errors,omitempty"`
}
type AccountstatusesListResponse struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#accountstatusesListResponse".
Kind string `json:"kind,omitempty"`
// NextPageToken: The token for the retrieval of the next page of
// account statuses.
NextPageToken string `json:"nextPageToken,omitempty"`
Resources []*AccountStatus `json:"resources,omitempty"`
}
type AccounttaxCustomBatchRequest struct {
// Entries: The request entries to be processed in the batch.
Entries []*AccounttaxCustomBatchRequestEntry `json:"entries,omitempty"`
}
// AccounttaxCustomBatchRequestEntry: A batch entry encoding a single
// non-batch accounttax request.
type AccounttaxCustomBatchRequestEntry struct {
// AccountId: The ID of the account for which to get/update account tax
// settings.
AccountId uint64 `json:"accountId,omitempty,string"`
// AccountTax: The account tax settings to update. Only defined if the
// method is update.
AccountTax *AccountTax `json:"accountTax,omitempty"`
// BatchId: An entry ID, unique within the batch request.
BatchId int64 `json:"batchId,omitempty"`
// MerchantId: The ID of the managing account.
MerchantId uint64 `json:"merchantId,omitempty,string"`
Method string `json:"method,omitempty"`
}
type AccounttaxCustomBatchResponse struct {
// Entries: The result of the execution of the batch requests.
Entries []*AccounttaxCustomBatchResponseEntry `json:"entries,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#accounttaxCustomBatchResponse".
Kind string `json:"kind,omitempty"`
}
// AccounttaxCustomBatchResponseEntry: A batch entry encoding a single
// non-batch accounttax response.
type AccounttaxCustomBatchResponseEntry struct {
// AccountTax: The retrieved or updated account tax settings.
AccountTax *AccountTax `json:"accountTax,omitempty"`
// BatchId: The ID of the request entry this entry responds to.
BatchId int64 `json:"batchId,omitempty"`
// Errors: A list of errors defined if and only if the request failed.
Errors *Errors `json:"errors,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#accounttaxCustomBatchResponseEntry".
Kind string `json:"kind,omitempty"`
}
type AccounttaxListResponse struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#accounttaxListResponse".
Kind string `json:"kind,omitempty"`
// NextPageToken: The token for the retrieval of the next page of
// account tax settings.
NextPageToken string `json:"nextPageToken,omitempty"`
Resources []*AccountTax `json:"resources,omitempty"`
}
// Datafeed: Datafeed data.
type Datafeed struct {
// AttributeLanguage: The two-letter ISO 639-1 language in which the
// attributes are defined in the data feed.
AttributeLanguage string `json:"attributeLanguage,omitempty"`
// ContentLanguage: The two-letter ISO 639-1 language of the items in
// the feed.
ContentLanguage string `json:"contentLanguage,omitempty"`
// ContentType: The type of data feed.
ContentType string `json:"contentType,omitempty"`
// FetchSchedule: Fetch schedule for the feed file.
FetchSchedule *DatafeedFetchSchedule `json:"fetchSchedule,omitempty"`
// FileName: The filename of the feed. All feeds must have a unique file
// name.
FileName string `json:"fileName,omitempty"`
// Format: Format of the feed file.
Format *DatafeedFormat `json:"format,omitempty"`
// Id: The ID of the data feed.
Id int64 `json:"id,omitempty,string"`
// IntendedDestinations: The list of intended destinations (corresponds
// to checked check boxes in Merchant Center).
IntendedDestinations []string `json:"intendedDestinations,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#datafeed".
Kind string `json:"kind,omitempty"`
// Name: A descriptive name of the data feed.
Name string `json:"name,omitempty"`
// TargetCountry: The country where the items in the feed will be
// included in the search index, represented as a CLDR territory code.
TargetCountry string `json:"targetCountry,omitempty"`
}
// DatafeedFetchSchedule: The required fields vary based on the
// frequency of fetching. For a monthly fetch schedule, day_of_month and
// hour are required. For a weekly fetch schedule, weekday and hour are
// required. For a daily fetch schedule, only hour is required.
type DatafeedFetchSchedule struct {
// DayOfMonth: The day of the month the feed file should be fetched
// (1-31).
DayOfMonth int64 `json:"dayOfMonth,omitempty"`
// FetchUrl: The URL where the feed file can be fetched. Google Merchant
// Center will support automatic scheduled uploads using the HTTP,
// HTTPS, FTP, or SFTP protocols, so the value will need to be a valid
// link using one of those four protocols.
FetchUrl string `json:"fetchUrl,omitempty"`
// Hour: The hour of the day the feed file should be fetched (0-24).
Hour int64 `json:"hour,omitempty"`
// Password: An optional password for fetch_url.
Password string `json:"password,omitempty"`
// TimeZone: Time zone used for schedule. UTC by default. E.g.,
// "America/Los_Angeles".
TimeZone string `json:"timeZone,omitempty"`
// Username: An optional user name for fetch_url.
Username string `json:"username,omitempty"`
// Weekday: The day of the week the feed file should be fetched.
Weekday string `json:"weekday,omitempty"`
}
type DatafeedFormat struct {
// ColumnDelimiter: Delimiter for the separation of values in a
// delimiter-separated values feed. If not specified, the delimiter will
// be auto-detected. Ignored for non-DSV data feeds.
ColumnDelimiter string `json:"columnDelimiter,omitempty"`
// FileEncoding: Character encoding scheme of the data feed. If not
// specified, the encoding will be auto-detected.
FileEncoding string `json:"fileEncoding,omitempty"`
// QuotingMode: Specifies how double quotes are interpreted. If not
// specified, the mode will be auto-detected. Ignored for non-DSV data
// feeds.
QuotingMode string `json:"quotingMode,omitempty"`
}
// DatafeedStatus: The status of a datafeed, i.e., the result of the
// last retrieval of the datafeed computed asynchronously when the feed
// processing is finished.
type DatafeedStatus struct {
// DatafeedId: The ID of the feed for which the status is reported.
DatafeedId uint64 `json:"datafeedId,omitempty,string"`
// Errors: The list of errors occurring in the feed.
Errors []*DatafeedStatusError `json:"errors,omitempty"`
// ItemsTotal: The number of items in the feed that were processed.
ItemsTotal uint64 `json:"itemsTotal,omitempty,string"`
// ItemsValid: The number of items in the feed that were valid.
ItemsValid uint64 `json:"itemsValid,omitempty,string"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "content#datafeedStatus".
Kind string `json:"kind,omitempty"`
// LastUploadDate: The last date at which the feed was uploaded.
LastUploadDate string `json:"lastUploadDate,omitempty"`
// ProcessingStatus: The processing status of the feed.
ProcessingStatus string `json:"processingStatus,omitempty"`
// Warnings: The list of errors occurring in the feed.
Warnings []*DatafeedStatusError `json:"warnings,omitempty"`
}
// DatafeedStatusError: An error occurring in the feed, like "invalid
// price".
type DatafeedStatusError struct {
// Code: The code of the error, e.g., "validation/invalid_value".
Code string `json:"code,omitempty"`
// Count: The number of occurrences of the error in the feed.
Count uint64 `json:"count,omitempty,string"`
// Examples: A list of example occurrences of the error, grouped by
// product.
Examples []*DatafeedStatusExample `json:"examples,omitempty"`
// Message: The error message, e.g., "Invalid price".
Message string `json:"message,omitempty"`
}
// DatafeedStatusExample: An example occurrence for a particular error.
type DatafeedStatusExample struct {
// ItemId: The ID of the example item.
ItemId string `json:"itemId,omitempty"`
// LineNumber: Line number in the data feed where the example is found.
LineNumber uint64 `json:"lineNumber,omitempty,string"`
// Value: The problematic value.
Value string `json:"value,omitempty"`
}
type DatafeedsCustomBatchRequest struct {
// Entries: The request entries to be processed in the batch.
Entries []*DatafeedsCustomBatchRequestEntry `json:"entries,omitempty"`
}
// DatafeedsCustomBatchRequestEntry: A batch entry encoding a single
// non-batch datafeeds request.
type DatafeedsCustomBatchRequestEntry struct {
// BatchId: An entry ID, unique within the batch request.
BatchId int64 `json:"batchId,omitempty"`
// Datafeed: The data feed to insert.
Datafeed *Datafeed `json:"datafeed,omitempty"`
// DatafeedId: The ID of the data feed to get or delete.
DatafeedId uint64 `json:"datafeedId,omitempty,string"`
// MerchantId: The ID of the managing account.
MerchantId uint64 `json:"merchantId,omitempty,string"`