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 package manufacturers
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "net/http"
61 "net/url"
62 "strconv"
63 "strings"
64
65 googleapi "google.golang.org/api/googleapi"
66 internal "google.golang.org/api/internal"
67 gensupport "google.golang.org/api/internal/gensupport"
68 option "google.golang.org/api/option"
69 internaloption "google.golang.org/api/option/internaloption"
70 htransport "google.golang.org/api/transport/http"
71 )
72
73
74
75 var _ = bytes.NewBuffer
76 var _ = strconv.Itoa
77 var _ = fmt.Sprintf
78 var _ = json.NewDecoder
79 var _ = io.Copy
80 var _ = url.Parse
81 var _ = gensupport.MarshalJSON
82 var _ = googleapi.Version
83 var _ = errors.New
84 var _ = strings.Replace
85 var _ = context.Canceled
86 var _ = internaloption.WithDefaultEndpoint
87 var _ = internal.Version
88
89 const apiId = "manufacturers:v1"
90 const apiName = "manufacturers"
91 const apiVersion = "v1"
92 const basePath = "https://manufacturers.googleapis.com/"
93 const basePathTemplate = "https://manufacturers.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://manufacturers.mtls.googleapis.com/"
95
96
97 const (
98
99 ManufacturercenterScope = "https://www.googleapis.com/auth/manufacturercenter"
100 )
101
102
103 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
104 scopesOption := internaloption.WithDefaultScopes(
105 "https://www.googleapis.com/auth/manufacturercenter",
106 )
107
108 opts = append([]option.ClientOption{scopesOption}, opts...)
109 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
110 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
111 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
112 opts = append(opts, internaloption.EnableNewAuthLibrary())
113 client, endpoint, err := htransport.NewClient(ctx, opts...)
114 if err != nil {
115 return nil, err
116 }
117 s, err := New(client)
118 if err != nil {
119 return nil, err
120 }
121 if endpoint != "" {
122 s.BasePath = endpoint
123 }
124 return s, nil
125 }
126
127
128
129
130
131
132 func New(client *http.Client) (*Service, error) {
133 if client == nil {
134 return nil, errors.New("client is nil")
135 }
136 s := &Service{client: client, BasePath: basePath}
137 s.Accounts = NewAccountsService(s)
138 return s, nil
139 }
140
141 type Service struct {
142 client *http.Client
143 BasePath string
144 UserAgent string
145
146 Accounts *AccountsService
147 }
148
149 func (s *Service) userAgent() string {
150 if s.UserAgent == "" {
151 return googleapi.UserAgent
152 }
153 return googleapi.UserAgent + " " + s.UserAgent
154 }
155
156 func NewAccountsService(s *Service) *AccountsService {
157 rs := &AccountsService{s: s}
158 rs.Languages = NewAccountsLanguagesService(s)
159 rs.Products = NewAccountsProductsService(s)
160 return rs
161 }
162
163 type AccountsService struct {
164 s *Service
165
166 Languages *AccountsLanguagesService
167
168 Products *AccountsProductsService
169 }
170
171 func NewAccountsLanguagesService(s *Service) *AccountsLanguagesService {
172 rs := &AccountsLanguagesService{s: s}
173 rs.ProductCertifications = NewAccountsLanguagesProductCertificationsService(s)
174 return rs
175 }
176
177 type AccountsLanguagesService struct {
178 s *Service
179
180 ProductCertifications *AccountsLanguagesProductCertificationsService
181 }
182
183 func NewAccountsLanguagesProductCertificationsService(s *Service) *AccountsLanguagesProductCertificationsService {
184 rs := &AccountsLanguagesProductCertificationsService{s: s}
185 return rs
186 }
187
188 type AccountsLanguagesProductCertificationsService struct {
189 s *Service
190 }
191
192 func NewAccountsProductsService(s *Service) *AccountsProductsService {
193 rs := &AccountsProductsService{s: s}
194 return rs
195 }
196
197 type AccountsProductsService struct {
198 s *Service
199 }
200
201
202
203 type Attributes struct {
204
205
206
207 AdditionalImageLink []*Image `json:"additionalImageLink,omitempty"`
208
209
210 AgeGroup string `json:"ageGroup,omitempty"`
211
212
213 Brand string `json:"brand,omitempty"`
214
215
216 Capacity *Capacity `json:"capacity,omitempty"`
217
218 Certification []*GoogleShoppingManufacturersV1ProductCertification `json:"certification,omitempty"`
219
220
221 Color string `json:"color,omitempty"`
222
223
224 Count *Count `json:"count,omitempty"`
225
226
227 Description string `json:"description,omitempty"`
228
229
230 DisclosureDate string `json:"disclosureDate,omitempty"`
231
232
233
234 ExcludedDestination []string `json:"excludedDestination,omitempty"`
235
236
237
238 FeatureDescription []*FeatureDescription `json:"featureDescription,omitempty"`
239
240
241 Flavor string `json:"flavor,omitempty"`
242
243
244 Format string `json:"format,omitempty"`
245
246
247 Gender string `json:"gender,omitempty"`
248
249
250 Grocery *Grocery `json:"grocery,omitempty"`
251
252
253
254 Gtin []string `json:"gtin,omitempty"`
255
256
257 ImageLink *Image `json:"imageLink,omitempty"`
258
259
260
261 IncludedDestination []string `json:"includedDestination,omitempty"`
262
263
264 ItemGroupId string `json:"itemGroupId,omitempty"`
265
266
267 Material string `json:"material,omitempty"`
268
269
270
271 Mpn string `json:"mpn,omitempty"`
272
273
274 Nutrition *Nutrition `json:"nutrition,omitempty"`
275
276
277 Pattern string `json:"pattern,omitempty"`
278
279
280 ProductDetail []*ProductDetail `json:"productDetail,omitempty"`
281
282
283 ProductHighlight []string `json:"productHighlight,omitempty"`
284
285
286
287 ProductLine string `json:"productLine,omitempty"`
288
289
290 ProductName string `json:"productName,omitempty"`
291
292
293
294 ProductPageUrl string `json:"productPageUrl,omitempty"`
295
296
297 ProductType []string `json:"productType,omitempty"`
298
299
300 ReleaseDate string `json:"releaseDate,omitempty"`
301
302
303 RichProductContent []string `json:"richProductContent,omitempty"`
304
305
306 Scent string `json:"scent,omitempty"`
307
308
309 Size string `json:"size,omitempty"`
310
311
312 SizeSystem string `json:"sizeSystem,omitempty"`
313
314
315 SizeType []string `json:"sizeType,omitempty"`
316
317
318
319 SuggestedRetailPrice *Price `json:"suggestedRetailPrice,omitempty"`
320
321
322
323 TargetClientId string `json:"targetClientId,omitempty"`
324
325
326 Theme string `json:"theme,omitempty"`
327
328
329 Title string `json:"title,omitempty"`
330
331
332 VideoLink []string `json:"videoLink,omitempty"`
333
334 VirtualModelLink string `json:"virtualModelLink,omitempty"`
335
336
337
338
339
340 ForceSendFields []string `json:"-"`
341
342
343
344
345 NullFields []string `json:"-"`
346 }
347
348 func (s *Attributes) MarshalJSON() ([]byte, error) {
349 type NoMethod Attributes
350 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
351 }
352
353
354
355 type Capacity struct {
356
357 Unit string `json:"unit,omitempty"`
358
359 Value int64 `json:"value,omitempty,string"`
360
361
362
363
364
365 ForceSendFields []string `json:"-"`
366
367
368
369
370 NullFields []string `json:"-"`
371 }
372
373 func (s *Capacity) MarshalJSON() ([]byte, error) {
374 type NoMethod Capacity
375 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
376 }
377
378
379 type Certification struct {
380
381 Authority string `json:"authority,omitempty"`
382
383 Code string `json:"code,omitempty"`
384
385 Link string `json:"link,omitempty"`
386
387 Logo string `json:"logo,omitempty"`
388
389 Name string `json:"name,omitempty"`
390
391 ValidUntil string `json:"validUntil,omitempty"`
392
393 Value string `json:"value,omitempty"`
394
395
396
397
398
399 ForceSendFields []string `json:"-"`
400
401
402
403
404 NullFields []string `json:"-"`
405 }
406
407 func (s *Certification) MarshalJSON() ([]byte, error) {
408 type NoMethod Certification
409 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
410 }
411
412
413
414 type Count struct {
415
416 Unit string `json:"unit,omitempty"`
417
418 Value int64 `json:"value,omitempty,string"`
419
420
421
422
423
424 ForceSendFields []string `json:"-"`
425
426
427
428
429 NullFields []string `json:"-"`
430 }
431
432 func (s *Count) MarshalJSON() ([]byte, error) {
433 type NoMethod Count
434 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
435 }
436
437
438 type DestinationStatus struct {
439
440 Destination string `json:"destination,omitempty"`
441
442
443
444
445
446
447
448 Status string `json:"status,omitempty"`
449
450
451
452
453
454 ForceSendFields []string `json:"-"`
455
456
457
458
459 NullFields []string `json:"-"`
460 }
461
462 func (s *DestinationStatus) MarshalJSON() ([]byte, error) {
463 type NoMethod DestinationStatus
464 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
465 }
466
467
468
469
470
471 type Empty struct {
472
473 googleapi.ServerResponse `json:"-"`
474 }
475
476
477
478
479 type FeatureDescription struct {
480
481 Headline string `json:"headline,omitempty"`
482
483 Image *Image `json:"image,omitempty"`
484
485 Text string `json:"text,omitempty"`
486
487
488
489
490
491 ForceSendFields []string `json:"-"`
492
493
494
495
496 NullFields []string `json:"-"`
497 }
498
499 func (s *FeatureDescription) MarshalJSON() ([]byte, error) {
500 type NoMethod FeatureDescription
501 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
502 }
503
504
505 type FloatUnit struct {
506
507 Amount float64 `json:"amount,omitempty"`
508
509 Unit string `json:"unit,omitempty"`
510
511
512
513
514
515 ForceSendFields []string `json:"-"`
516
517
518
519
520 NullFields []string `json:"-"`
521 }
522
523 func (s *FloatUnit) MarshalJSON() ([]byte, error) {
524 type NoMethod FloatUnit
525 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
526 }
527
528 func (s *FloatUnit) UnmarshalJSON(data []byte) error {
529 type NoMethod FloatUnit
530 var s1 struct {
531 Amount gensupport.JSONFloat64 `json:"amount"`
532 *NoMethod
533 }
534 s1.NoMethod = (*NoMethod)(s)
535 if err := json.Unmarshal(data, &s1); err != nil {
536 return err
537 }
538 s.Amount = float64(s1.Amount)
539 return nil
540 }
541
542
543
544 type GoogleShoppingManufacturersV1ProductCertification struct {
545
546 Authority string `json:"authority,omitempty"`
547
548 Code string `json:"code,omitempty"`
549
550 Name string `json:"name,omitempty"`
551
552
553
554
555
556 ForceSendFields []string `json:"-"`
557
558
559
560
561 NullFields []string `json:"-"`
562 }
563
564 func (s *GoogleShoppingManufacturersV1ProductCertification) MarshalJSON() ([]byte, error) {
565 type NoMethod GoogleShoppingManufacturersV1ProductCertification
566 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
567 }
568
569 type Grocery struct {
570
571 ActiveIngredients string `json:"activeIngredients,omitempty"`
572
573 AlcoholByVolume float64 `json:"alcoholByVolume,omitempty"`
574
575 Allergens string `json:"allergens,omitempty"`
576
577 DerivedNutritionClaim []string `json:"derivedNutritionClaim,omitempty"`
578
579 Directions string `json:"directions,omitempty"`
580
581 Indications string `json:"indications,omitempty"`
582
583 Ingredients string `json:"ingredients,omitempty"`
584
585 NutritionClaim []string `json:"nutritionClaim,omitempty"`
586
587 StorageInstructions string `json:"storageInstructions,omitempty"`
588
589
590
591
592
593 ForceSendFields []string `json:"-"`
594
595
596
597
598 NullFields []string `json:"-"`
599 }
600
601 func (s *Grocery) MarshalJSON() ([]byte, error) {
602 type NoMethod Grocery
603 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
604 }
605
606 func (s *Grocery) UnmarshalJSON(data []byte) error {
607 type NoMethod Grocery
608 var s1 struct {
609 AlcoholByVolume gensupport.JSONFloat64 `json:"alcoholByVolume"`
610 *NoMethod
611 }
612 s1.NoMethod = (*NoMethod)(s)
613 if err := json.Unmarshal(data, &s1); err != nil {
614 return err
615 }
616 s.AlcoholByVolume = float64(s1.AlcoholByVolume)
617 return nil
618 }
619
620
621 type Image struct {
622
623
624
625 ImageUrl string `json:"imageUrl,omitempty"`
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647 Status string `json:"status,omitempty"`
648
649
650
651
652
653
654 Type string `json:"type,omitempty"`
655
656
657
658
659
660 ForceSendFields []string `json:"-"`
661
662
663
664
665 NullFields []string `json:"-"`
666 }
667
668 func (s *Image) MarshalJSON() ([]byte, error) {
669 type NoMethod Image
670 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
671 }
672
673
674 type Issue struct {
675
676
677
678 Attribute string `json:"attribute,omitempty"`
679
680 Description string `json:"description,omitempty"`
681
682 Destination string `json:"destination,omitempty"`
683
684
685
686
687
688
689
690
691
692 Resolution string `json:"resolution,omitempty"`
693
694
695
696
697
698
699
700
701
702
703
704 Severity string `json:"severity,omitempty"`
705
706 Timestamp string `json:"timestamp,omitempty"`
707
708 Title string `json:"title,omitempty"`
709
710
711 Type string `json:"type,omitempty"`
712
713
714
715
716
717 ForceSendFields []string `json:"-"`
718
719
720
721
722 NullFields []string `json:"-"`
723 }
724
725 func (s *Issue) MarshalJSON() ([]byte, error) {
726 type NoMethod Issue
727 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
728 }
729
730
731
732 type ListProductCertificationsResponse struct {
733
734
735 NextPageToken string `json:"nextPageToken,omitempty"`
736
737
738 ProductCertifications []*ProductCertification `json:"productCertifications,omitempty"`
739
740
741 googleapi.ServerResponse `json:"-"`
742
743
744
745
746
747 ForceSendFields []string `json:"-"`
748
749
750
751
752 NullFields []string `json:"-"`
753 }
754
755 func (s *ListProductCertificationsResponse) MarshalJSON() ([]byte, error) {
756 type NoMethod ListProductCertificationsResponse
757 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
758 }
759
760 type ListProductsResponse struct {
761
762
763 NextPageToken string `json:"nextPageToken,omitempty"`
764
765 Products []*Product `json:"products,omitempty"`
766
767
768 googleapi.ServerResponse `json:"-"`
769
770
771
772
773
774 ForceSendFields []string `json:"-"`
775
776
777
778
779 NullFields []string `json:"-"`
780 }
781
782 func (s *ListProductsResponse) MarshalJSON() ([]byte, error) {
783 type NoMethod ListProductsResponse
784 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
785 }
786
787 type Nutrition struct {
788
789 AddedSugars *FloatUnit `json:"addedSugars,omitempty"`
790
791 AddedSugarsDailyPercentage float64 `json:"addedSugarsDailyPercentage,omitempty"`
792
793 Calcium *FloatUnit `json:"calcium,omitempty"`
794
795 CalciumDailyPercentage float64 `json:"calciumDailyPercentage,omitempty"`
796
797 Cholesterol *FloatUnit `json:"cholesterol,omitempty"`
798
799 CholesterolDailyPercentage float64 `json:"cholesterolDailyPercentage,omitempty"`
800
801 DietaryFiber *FloatUnit `json:"dietaryFiber,omitempty"`
802
803 DietaryFiberDailyPercentage float64 `json:"dietaryFiberDailyPercentage,omitempty"`
804
805 Energy *FloatUnit `json:"energy,omitempty"`
806
807 EnergyFromFat *FloatUnit `json:"energyFromFat,omitempty"`
808
809 FolateDailyPercentage float64 `json:"folateDailyPercentage,omitempty"`
810
811 FolateFolicAcid *FloatUnit `json:"folateFolicAcid,omitempty"`
812
813 FolateMcgDfe float64 `json:"folateMcgDfe,omitempty"`
814
815 Iron *FloatUnit `json:"iron,omitempty"`
816
817 IronDailyPercentage float64 `json:"ironDailyPercentage,omitempty"`
818
819 MonounsaturatedFat *FloatUnit `json:"monounsaturatedFat,omitempty"`
820
821 NutritionFactMeasure string `json:"nutritionFactMeasure,omitempty"`
822
823 Polyols *FloatUnit `json:"polyols,omitempty"`
824
825 PolyunsaturatedFat *FloatUnit `json:"polyunsaturatedFat,omitempty"`
826
827 Potassium *FloatUnit `json:"potassium,omitempty"`
828
829 PotassiumDailyPercentage float64 `json:"potassiumDailyPercentage,omitempty"`
830
831 PreparedSizeDescription string `json:"preparedSizeDescription,omitempty"`
832
833 Protein *FloatUnit `json:"protein,omitempty"`
834
835 ProteinDailyPercentage float64 `json:"proteinDailyPercentage,omitempty"`
836
837 SaturatedFat *FloatUnit `json:"saturatedFat,omitempty"`
838
839 SaturatedFatDailyPercentage float64 `json:"saturatedFatDailyPercentage,omitempty"`
840
841 ServingSizeDescription string `json:"servingSizeDescription,omitempty"`
842
843 ServingSizeMeasure *FloatUnit `json:"servingSizeMeasure,omitempty"`
844
845 ServingsPerContainer string `json:"servingsPerContainer,omitempty"`
846
847 Sodium *FloatUnit `json:"sodium,omitempty"`
848
849 SodiumDailyPercentage float64 `json:"sodiumDailyPercentage,omitempty"`
850
851 Starch *FloatUnit `json:"starch,omitempty"`
852
853 TotalCarbohydrate *FloatUnit `json:"totalCarbohydrate,omitempty"`
854
855 TotalCarbohydrateDailyPercentage float64 `json:"totalCarbohydrateDailyPercentage,omitempty"`
856
857 TotalFat *FloatUnit `json:"totalFat,omitempty"`
858
859 TotalFatDailyPercentage float64 `json:"totalFatDailyPercentage,omitempty"`
860
861 TotalSugars *FloatUnit `json:"totalSugars,omitempty"`
862
863 TotalSugarsDailyPercentage float64 `json:"totalSugarsDailyPercentage,omitempty"`
864
865 TransFat *FloatUnit `json:"transFat,omitempty"`
866
867 TransFatDailyPercentage float64 `json:"transFatDailyPercentage,omitempty"`
868
869 VitaminD *FloatUnit `json:"vitaminD,omitempty"`
870
871 VitaminDDailyPercentage float64 `json:"vitaminDDailyPercentage,omitempty"`
872
873 VoluntaryNutritionFact []*VoluntaryNutritionFact `json:"voluntaryNutritionFact,omitempty"`
874
875
876
877
878
879 ForceSendFields []string `json:"-"`
880
881
882
883
884 NullFields []string `json:"-"`
885 }
886
887 func (s *Nutrition) MarshalJSON() ([]byte, error) {
888 type NoMethod Nutrition
889 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
890 }
891
892 func (s *Nutrition) UnmarshalJSON(data []byte) error {
893 type NoMethod Nutrition
894 var s1 struct {
895 AddedSugarsDailyPercentage gensupport.JSONFloat64 `json:"addedSugarsDailyPercentage"`
896 CalciumDailyPercentage gensupport.JSONFloat64 `json:"calciumDailyPercentage"`
897 CholesterolDailyPercentage gensupport.JSONFloat64 `json:"cholesterolDailyPercentage"`
898 DietaryFiberDailyPercentage gensupport.JSONFloat64 `json:"dietaryFiberDailyPercentage"`
899 FolateDailyPercentage gensupport.JSONFloat64 `json:"folateDailyPercentage"`
900 FolateMcgDfe gensupport.JSONFloat64 `json:"folateMcgDfe"`
901 IronDailyPercentage gensupport.JSONFloat64 `json:"ironDailyPercentage"`
902 PotassiumDailyPercentage gensupport.JSONFloat64 `json:"potassiumDailyPercentage"`
903 ProteinDailyPercentage gensupport.JSONFloat64 `json:"proteinDailyPercentage"`
904 SaturatedFatDailyPercentage gensupport.JSONFloat64 `json:"saturatedFatDailyPercentage"`
905 SodiumDailyPercentage gensupport.JSONFloat64 `json:"sodiumDailyPercentage"`
906 TotalCarbohydrateDailyPercentage gensupport.JSONFloat64 `json:"totalCarbohydrateDailyPercentage"`
907 TotalFatDailyPercentage gensupport.JSONFloat64 `json:"totalFatDailyPercentage"`
908 TotalSugarsDailyPercentage gensupport.JSONFloat64 `json:"totalSugarsDailyPercentage"`
909 TransFatDailyPercentage gensupport.JSONFloat64 `json:"transFatDailyPercentage"`
910 VitaminDDailyPercentage gensupport.JSONFloat64 `json:"vitaminDDailyPercentage"`
911 *NoMethod
912 }
913 s1.NoMethod = (*NoMethod)(s)
914 if err := json.Unmarshal(data, &s1); err != nil {
915 return err
916 }
917 s.AddedSugarsDailyPercentage = float64(s1.AddedSugarsDailyPercentage)
918 s.CalciumDailyPercentage = float64(s1.CalciumDailyPercentage)
919 s.CholesterolDailyPercentage = float64(s1.CholesterolDailyPercentage)
920 s.DietaryFiberDailyPercentage = float64(s1.DietaryFiberDailyPercentage)
921 s.FolateDailyPercentage = float64(s1.FolateDailyPercentage)
922 s.FolateMcgDfe = float64(s1.FolateMcgDfe)
923 s.IronDailyPercentage = float64(s1.IronDailyPercentage)
924 s.PotassiumDailyPercentage = float64(s1.PotassiumDailyPercentage)
925 s.ProteinDailyPercentage = float64(s1.ProteinDailyPercentage)
926 s.SaturatedFatDailyPercentage = float64(s1.SaturatedFatDailyPercentage)
927 s.SodiumDailyPercentage = float64(s1.SodiumDailyPercentage)
928 s.TotalCarbohydrateDailyPercentage = float64(s1.TotalCarbohydrateDailyPercentage)
929 s.TotalFatDailyPercentage = float64(s1.TotalFatDailyPercentage)
930 s.TotalSugarsDailyPercentage = float64(s1.TotalSugarsDailyPercentage)
931 s.TransFatDailyPercentage = float64(s1.TransFatDailyPercentage)
932 s.VitaminDDailyPercentage = float64(s1.VitaminDDailyPercentage)
933 return nil
934 }
935
936
937 type Price struct {
938
939 Amount string `json:"amount,omitempty"`
940
941 Currency string `json:"currency,omitempty"`
942
943
944
945
946
947 ForceSendFields []string `json:"-"`
948
949
950
951
952 NullFields []string `json:"-"`
953 }
954
955 func (s *Price) MarshalJSON() ([]byte, error) {
956 type NoMethod Price
957 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
958 }
959
960
961 type Product struct {
962
963
964 Attributes *Attributes `json:"attributes,omitempty"`
965
966
967 ContentLanguage string `json:"contentLanguage,omitempty"`
968
969 DestinationStatuses []*DestinationStatus `json:"destinationStatuses,omitempty"`
970
971 Issues []*Issue `json:"issues,omitempty"`
972
973
974
975
976
977
978 Name string `json:"name,omitempty"`
979
980
981 Parent string `json:"parent,omitempty"`
982
983
984 ProductId string `json:"productId,omitempty"`
985
986
987 TargetCountry string `json:"targetCountry,omitempty"`
988
989
990 googleapi.ServerResponse `json:"-"`
991
992
993
994
995
996 ForceSendFields []string `json:"-"`
997
998
999
1000
1001 NullFields []string `json:"-"`
1002 }
1003
1004 func (s *Product) MarshalJSON() ([]byte, error) {
1005 type NoMethod Product
1006 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1007 }
1008
1009
1010 type ProductCertification struct {
1011
1012
1013 Brand string `json:"brand,omitempty"`
1014
1015
1016 Certification []*Certification `json:"certification,omitempty"`
1017
1018 CountryCode []string `json:"countryCode,omitempty"`
1019
1020 DestinationStatuses []*DestinationStatus `json:"destinationStatuses,omitempty"`
1021
1022
1023 Issues []*Issue `json:"issues,omitempty"`
1024
1025
1026
1027 Mpn []string `json:"mpn,omitempty"`
1028
1029
1030
1031
1032
1033
1034 Name string `json:"name,omitempty"`
1035
1036 ProductCode []string `json:"productCode,omitempty"`
1037
1038
1039 ProductType []string `json:"productType,omitempty"`
1040
1041 Title string `json:"title,omitempty"`
1042
1043
1044 googleapi.ServerResponse `json:"-"`
1045
1046
1047
1048
1049
1050 ForceSendFields []string `json:"-"`
1051
1052
1053
1054
1055 NullFields []string `json:"-"`
1056 }
1057
1058 func (s *ProductCertification) MarshalJSON() ([]byte, error) {
1059 type NoMethod ProductCertification
1060 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1061 }
1062
1063
1064
1065 type ProductDetail struct {
1066
1067 AttributeName string `json:"attributeName,omitempty"`
1068
1069 AttributeValue string `json:"attributeValue,omitempty"`
1070
1071
1072 SectionName string `json:"sectionName,omitempty"`
1073
1074
1075
1076
1077
1078 ForceSendFields []string `json:"-"`
1079
1080
1081
1082
1083 NullFields []string `json:"-"`
1084 }
1085
1086 func (s *ProductDetail) MarshalJSON() ([]byte, error) {
1087 type NoMethod ProductDetail
1088 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1089 }
1090
1091
1092 type VoluntaryNutritionFact struct {
1093
1094 DailyPercentage float64 `json:"dailyPercentage,omitempty"`
1095
1096 Name string `json:"name,omitempty"`
1097
1098 Value *FloatUnit `json:"value,omitempty"`
1099
1100
1101
1102
1103
1104 ForceSendFields []string `json:"-"`
1105
1106
1107
1108
1109 NullFields []string `json:"-"`
1110 }
1111
1112 func (s *VoluntaryNutritionFact) MarshalJSON() ([]byte, error) {
1113 type NoMethod VoluntaryNutritionFact
1114 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1115 }
1116
1117 func (s *VoluntaryNutritionFact) UnmarshalJSON(data []byte) error {
1118 type NoMethod VoluntaryNutritionFact
1119 var s1 struct {
1120 DailyPercentage gensupport.JSONFloat64 `json:"dailyPercentage"`
1121 *NoMethod
1122 }
1123 s1.NoMethod = (*NoMethod)(s)
1124 if err := json.Unmarshal(data, &s1); err != nil {
1125 return err
1126 }
1127 s.DailyPercentage = float64(s1.DailyPercentage)
1128 return nil
1129 }
1130
1131 type AccountsLanguagesProductCertificationsDeleteCall struct {
1132 s *Service
1133 name string
1134 urlParams_ gensupport.URLParams
1135 ctx_ context.Context
1136 header_ http.Header
1137 }
1138
1139
1140
1141
1142
1143
1144 func (r *AccountsLanguagesProductCertificationsService) Delete(name string) *AccountsLanguagesProductCertificationsDeleteCall {
1145 c := &AccountsLanguagesProductCertificationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1146 c.name = name
1147 return c
1148 }
1149
1150
1151
1152
1153 func (c *AccountsLanguagesProductCertificationsDeleteCall) Fields(s ...googleapi.Field) *AccountsLanguagesProductCertificationsDeleteCall {
1154 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1155 return c
1156 }
1157
1158
1159 func (c *AccountsLanguagesProductCertificationsDeleteCall) Context(ctx context.Context) *AccountsLanguagesProductCertificationsDeleteCall {
1160 c.ctx_ = ctx
1161 return c
1162 }
1163
1164
1165
1166 func (c *AccountsLanguagesProductCertificationsDeleteCall) Header() http.Header {
1167 if c.header_ == nil {
1168 c.header_ = make(http.Header)
1169 }
1170 return c.header_
1171 }
1172
1173 func (c *AccountsLanguagesProductCertificationsDeleteCall) doRequest(alt string) (*http.Response, error) {
1174 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1175 var body io.Reader = nil
1176 c.urlParams_.Set("alt", alt)
1177 c.urlParams_.Set("prettyPrint", "false")
1178 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1179 urls += "?" + c.urlParams_.Encode()
1180 req, err := http.NewRequest("DELETE", urls, body)
1181 if err != nil {
1182 return nil, err
1183 }
1184 req.Header = reqHeaders
1185 googleapi.Expand(req.URL, map[string]string{
1186 "name": c.name,
1187 })
1188 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1189 }
1190
1191
1192
1193
1194
1195
1196 func (c *AccountsLanguagesProductCertificationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1197 gensupport.SetOptions(c.urlParams_, opts...)
1198 res, err := c.doRequest("json")
1199 if res != nil && res.StatusCode == http.StatusNotModified {
1200 if res.Body != nil {
1201 res.Body.Close()
1202 }
1203 return nil, gensupport.WrapError(&googleapi.Error{
1204 Code: res.StatusCode,
1205 Header: res.Header,
1206 })
1207 }
1208 if err != nil {
1209 return nil, err
1210 }
1211 defer googleapi.CloseBody(res)
1212 if err := googleapi.CheckResponse(res); err != nil {
1213 return nil, gensupport.WrapError(err)
1214 }
1215 ret := &Empty{
1216 ServerResponse: googleapi.ServerResponse{
1217 Header: res.Header,
1218 HTTPStatusCode: res.StatusCode,
1219 },
1220 }
1221 target := &ret
1222 if err := gensupport.DecodeResponse(target, res); err != nil {
1223 return nil, err
1224 }
1225 return ret, nil
1226 }
1227
1228 type AccountsLanguagesProductCertificationsGetCall struct {
1229 s *Service
1230 name string
1231 urlParams_ gensupport.URLParams
1232 ifNoneMatch_ string
1233 ctx_ context.Context
1234 header_ http.Header
1235 }
1236
1237
1238
1239
1240
1241
1242 func (r *AccountsLanguagesProductCertificationsService) Get(name string) *AccountsLanguagesProductCertificationsGetCall {
1243 c := &AccountsLanguagesProductCertificationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1244 c.name = name
1245 return c
1246 }
1247
1248
1249
1250
1251 func (c *AccountsLanguagesProductCertificationsGetCall) Fields(s ...googleapi.Field) *AccountsLanguagesProductCertificationsGetCall {
1252 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1253 return c
1254 }
1255
1256
1257
1258
1259 func (c *AccountsLanguagesProductCertificationsGetCall) IfNoneMatch(entityTag string) *AccountsLanguagesProductCertificationsGetCall {
1260 c.ifNoneMatch_ = entityTag
1261 return c
1262 }
1263
1264
1265 func (c *AccountsLanguagesProductCertificationsGetCall) Context(ctx context.Context) *AccountsLanguagesProductCertificationsGetCall {
1266 c.ctx_ = ctx
1267 return c
1268 }
1269
1270
1271
1272 func (c *AccountsLanguagesProductCertificationsGetCall) Header() http.Header {
1273 if c.header_ == nil {
1274 c.header_ = make(http.Header)
1275 }
1276 return c.header_
1277 }
1278
1279 func (c *AccountsLanguagesProductCertificationsGetCall) doRequest(alt string) (*http.Response, error) {
1280 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1281 if c.ifNoneMatch_ != "" {
1282 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1283 }
1284 var body io.Reader = nil
1285 c.urlParams_.Set("alt", alt)
1286 c.urlParams_.Set("prettyPrint", "false")
1287 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1288 urls += "?" + c.urlParams_.Encode()
1289 req, err := http.NewRequest("GET", urls, body)
1290 if err != nil {
1291 return nil, err
1292 }
1293 req.Header = reqHeaders
1294 googleapi.Expand(req.URL, map[string]string{
1295 "name": c.name,
1296 })
1297 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1298 }
1299
1300
1301
1302
1303
1304
1305
1306 func (c *AccountsLanguagesProductCertificationsGetCall) Do(opts ...googleapi.CallOption) (*ProductCertification, error) {
1307 gensupport.SetOptions(c.urlParams_, opts...)
1308 res, err := c.doRequest("json")
1309 if res != nil && res.StatusCode == http.StatusNotModified {
1310 if res.Body != nil {
1311 res.Body.Close()
1312 }
1313 return nil, gensupport.WrapError(&googleapi.Error{
1314 Code: res.StatusCode,
1315 Header: res.Header,
1316 })
1317 }
1318 if err != nil {
1319 return nil, err
1320 }
1321 defer googleapi.CloseBody(res)
1322 if err := googleapi.CheckResponse(res); err != nil {
1323 return nil, gensupport.WrapError(err)
1324 }
1325 ret := &ProductCertification{
1326 ServerResponse: googleapi.ServerResponse{
1327 Header: res.Header,
1328 HTTPStatusCode: res.StatusCode,
1329 },
1330 }
1331 target := &ret
1332 if err := gensupport.DecodeResponse(target, res); err != nil {
1333 return nil, err
1334 }
1335 return ret, nil
1336 }
1337
1338 type AccountsLanguagesProductCertificationsListCall struct {
1339 s *Service
1340 parent string
1341 urlParams_ gensupport.URLParams
1342 ifNoneMatch_ string
1343 ctx_ context.Context
1344 header_ http.Header
1345 }
1346
1347
1348
1349
1350
1351
1352 func (r *AccountsLanguagesProductCertificationsService) List(parent string) *AccountsLanguagesProductCertificationsListCall {
1353 c := &AccountsLanguagesProductCertificationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1354 c.parent = parent
1355 return c
1356 }
1357
1358
1359
1360
1361
1362 func (c *AccountsLanguagesProductCertificationsListCall) PageSize(pageSize int64) *AccountsLanguagesProductCertificationsListCall {
1363 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1364 return c
1365 }
1366
1367
1368
1369
1370
1371
1372 func (c *AccountsLanguagesProductCertificationsListCall) PageToken(pageToken string) *AccountsLanguagesProductCertificationsListCall {
1373 c.urlParams_.Set("pageToken", pageToken)
1374 return c
1375 }
1376
1377
1378
1379
1380 func (c *AccountsLanguagesProductCertificationsListCall) Fields(s ...googleapi.Field) *AccountsLanguagesProductCertificationsListCall {
1381 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1382 return c
1383 }
1384
1385
1386
1387
1388 func (c *AccountsLanguagesProductCertificationsListCall) IfNoneMatch(entityTag string) *AccountsLanguagesProductCertificationsListCall {
1389 c.ifNoneMatch_ = entityTag
1390 return c
1391 }
1392
1393
1394 func (c *AccountsLanguagesProductCertificationsListCall) Context(ctx context.Context) *AccountsLanguagesProductCertificationsListCall {
1395 c.ctx_ = ctx
1396 return c
1397 }
1398
1399
1400
1401 func (c *AccountsLanguagesProductCertificationsListCall) Header() http.Header {
1402 if c.header_ == nil {
1403 c.header_ = make(http.Header)
1404 }
1405 return c.header_
1406 }
1407
1408 func (c *AccountsLanguagesProductCertificationsListCall) doRequest(alt string) (*http.Response, error) {
1409 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1410 if c.ifNoneMatch_ != "" {
1411 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1412 }
1413 var body io.Reader = nil
1414 c.urlParams_.Set("alt", alt)
1415 c.urlParams_.Set("prettyPrint", "false")
1416 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/productCertifications")
1417 urls += "?" + c.urlParams_.Encode()
1418 req, err := http.NewRequest("GET", urls, body)
1419 if err != nil {
1420 return nil, err
1421 }
1422 req.Header = reqHeaders
1423 googleapi.Expand(req.URL, map[string]string{
1424 "parent": c.parent,
1425 })
1426 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1427 }
1428
1429
1430
1431
1432
1433
1434
1435 func (c *AccountsLanguagesProductCertificationsListCall) Do(opts ...googleapi.CallOption) (*ListProductCertificationsResponse, error) {
1436 gensupport.SetOptions(c.urlParams_, opts...)
1437 res, err := c.doRequest("json")
1438 if res != nil && res.StatusCode == http.StatusNotModified {
1439 if res.Body != nil {
1440 res.Body.Close()
1441 }
1442 return nil, gensupport.WrapError(&googleapi.Error{
1443 Code: res.StatusCode,
1444 Header: res.Header,
1445 })
1446 }
1447 if err != nil {
1448 return nil, err
1449 }
1450 defer googleapi.CloseBody(res)
1451 if err := googleapi.CheckResponse(res); err != nil {
1452 return nil, gensupport.WrapError(err)
1453 }
1454 ret := &ListProductCertificationsResponse{
1455 ServerResponse: googleapi.ServerResponse{
1456 Header: res.Header,
1457 HTTPStatusCode: res.StatusCode,
1458 },
1459 }
1460 target := &ret
1461 if err := gensupport.DecodeResponse(target, res); err != nil {
1462 return nil, err
1463 }
1464 return ret, nil
1465 }
1466
1467
1468
1469
1470 func (c *AccountsLanguagesProductCertificationsListCall) Pages(ctx context.Context, f func(*ListProductCertificationsResponse) error) error {
1471 c.ctx_ = ctx
1472 defer c.PageToken(c.urlParams_.Get("pageToken"))
1473 for {
1474 x, err := c.Do()
1475 if err != nil {
1476 return err
1477 }
1478 if err := f(x); err != nil {
1479 return err
1480 }
1481 if x.NextPageToken == "" {
1482 return nil
1483 }
1484 c.PageToken(x.NextPageToken)
1485 }
1486 }
1487
1488 type AccountsLanguagesProductCertificationsPatchCall struct {
1489 s *Service
1490 nameid string
1491 productcertification *ProductCertification
1492 urlParams_ gensupport.URLParams
1493 ctx_ context.Context
1494 header_ http.Header
1495 }
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506 func (r *AccountsLanguagesProductCertificationsService) Patch(nameid string, productcertification *ProductCertification) *AccountsLanguagesProductCertificationsPatchCall {
1507 c := &AccountsLanguagesProductCertificationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1508 c.nameid = nameid
1509 c.productcertification = productcertification
1510 return c
1511 }
1512
1513
1514
1515
1516
1517 func (c *AccountsLanguagesProductCertificationsPatchCall) UpdateMask(updateMask string) *AccountsLanguagesProductCertificationsPatchCall {
1518 c.urlParams_.Set("updateMask", updateMask)
1519 return c
1520 }
1521
1522
1523
1524
1525 func (c *AccountsLanguagesProductCertificationsPatchCall) Fields(s ...googleapi.Field) *AccountsLanguagesProductCertificationsPatchCall {
1526 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1527 return c
1528 }
1529
1530
1531 func (c *AccountsLanguagesProductCertificationsPatchCall) Context(ctx context.Context) *AccountsLanguagesProductCertificationsPatchCall {
1532 c.ctx_ = ctx
1533 return c
1534 }
1535
1536
1537
1538 func (c *AccountsLanguagesProductCertificationsPatchCall) Header() http.Header {
1539 if c.header_ == nil {
1540 c.header_ = make(http.Header)
1541 }
1542 return c.header_
1543 }
1544
1545 func (c *AccountsLanguagesProductCertificationsPatchCall) doRequest(alt string) (*http.Response, error) {
1546 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1547 var body io.Reader = nil
1548 body, err := googleapi.WithoutDataWrapper.JSONReader(c.productcertification)
1549 if err != nil {
1550 return nil, err
1551 }
1552 c.urlParams_.Set("alt", alt)
1553 c.urlParams_.Set("prettyPrint", "false")
1554 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1555 urls += "?" + c.urlParams_.Encode()
1556 req, err := http.NewRequest("PATCH", urls, body)
1557 if err != nil {
1558 return nil, err
1559 }
1560 req.Header = reqHeaders
1561 googleapi.Expand(req.URL, map[string]string{
1562 "name": c.nameid,
1563 })
1564 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1565 }
1566
1567
1568
1569
1570
1571
1572
1573 func (c *AccountsLanguagesProductCertificationsPatchCall) Do(opts ...googleapi.CallOption) (*ProductCertification, error) {
1574 gensupport.SetOptions(c.urlParams_, opts...)
1575 res, err := c.doRequest("json")
1576 if res != nil && res.StatusCode == http.StatusNotModified {
1577 if res.Body != nil {
1578 res.Body.Close()
1579 }
1580 return nil, gensupport.WrapError(&googleapi.Error{
1581 Code: res.StatusCode,
1582 Header: res.Header,
1583 })
1584 }
1585 if err != nil {
1586 return nil, err
1587 }
1588 defer googleapi.CloseBody(res)
1589 if err := googleapi.CheckResponse(res); err != nil {
1590 return nil, gensupport.WrapError(err)
1591 }
1592 ret := &ProductCertification{
1593 ServerResponse: googleapi.ServerResponse{
1594 Header: res.Header,
1595 HTTPStatusCode: res.StatusCode,
1596 },
1597 }
1598 target := &ret
1599 if err := gensupport.DecodeResponse(target, res); err != nil {
1600 return nil, err
1601 }
1602 return ret, nil
1603 }
1604
1605 type AccountsProductsDeleteCall struct {
1606 s *Service
1607 parent string
1608 name string
1609 urlParams_ gensupport.URLParams
1610 ctx_ context.Context
1611 header_ http.Header
1612 }
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625 func (r *AccountsProductsService) Delete(parent string, name string) *AccountsProductsDeleteCall {
1626 c := &AccountsProductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1627 c.parent = parent
1628 c.name = name
1629 return c
1630 }
1631
1632
1633
1634
1635 func (c *AccountsProductsDeleteCall) Fields(s ...googleapi.Field) *AccountsProductsDeleteCall {
1636 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1637 return c
1638 }
1639
1640
1641 func (c *AccountsProductsDeleteCall) Context(ctx context.Context) *AccountsProductsDeleteCall {
1642 c.ctx_ = ctx
1643 return c
1644 }
1645
1646
1647
1648 func (c *AccountsProductsDeleteCall) Header() http.Header {
1649 if c.header_ == nil {
1650 c.header_ = make(http.Header)
1651 }
1652 return c.header_
1653 }
1654
1655 func (c *AccountsProductsDeleteCall) doRequest(alt string) (*http.Response, error) {
1656 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1657 var body io.Reader = nil
1658 c.urlParams_.Set("alt", alt)
1659 c.urlParams_.Set("prettyPrint", "false")
1660 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products/{+name}")
1661 urls += "?" + c.urlParams_.Encode()
1662 req, err := http.NewRequest("DELETE", urls, body)
1663 if err != nil {
1664 return nil, err
1665 }
1666 req.Header = reqHeaders
1667 googleapi.Expand(req.URL, map[string]string{
1668 "parent": c.parent,
1669 "name": c.name,
1670 })
1671 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1672 }
1673
1674
1675
1676
1677
1678
1679 func (c *AccountsProductsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1680 gensupport.SetOptions(c.urlParams_, opts...)
1681 res, err := c.doRequest("json")
1682 if res != nil && res.StatusCode == http.StatusNotModified {
1683 if res.Body != nil {
1684 res.Body.Close()
1685 }
1686 return nil, gensupport.WrapError(&googleapi.Error{
1687 Code: res.StatusCode,
1688 Header: res.Header,
1689 })
1690 }
1691 if err != nil {
1692 return nil, err
1693 }
1694 defer googleapi.CloseBody(res)
1695 if err := googleapi.CheckResponse(res); err != nil {
1696 return nil, gensupport.WrapError(err)
1697 }
1698 ret := &Empty{
1699 ServerResponse: googleapi.ServerResponse{
1700 Header: res.Header,
1701 HTTPStatusCode: res.StatusCode,
1702 },
1703 }
1704 target := &ret
1705 if err := gensupport.DecodeResponse(target, res); err != nil {
1706 return nil, err
1707 }
1708 return ret, nil
1709 }
1710
1711 type AccountsProductsGetCall struct {
1712 s *Service
1713 parent string
1714 name string
1715 urlParams_ gensupport.URLParams
1716 ifNoneMatch_ string
1717 ctx_ context.Context
1718 header_ http.Header
1719 }
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736 func (r *AccountsProductsService) Get(parent string, name string) *AccountsProductsGetCall {
1737 c := &AccountsProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1738 c.parent = parent
1739 c.name = name
1740 return c
1741 }
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752 func (c *AccountsProductsGetCall) Include(include ...string) *AccountsProductsGetCall {
1753 c.urlParams_.SetMulti("include", append([]string{}, include...))
1754 return c
1755 }
1756
1757
1758
1759
1760 func (c *AccountsProductsGetCall) Fields(s ...googleapi.Field) *AccountsProductsGetCall {
1761 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1762 return c
1763 }
1764
1765
1766
1767
1768 func (c *AccountsProductsGetCall) IfNoneMatch(entityTag string) *AccountsProductsGetCall {
1769 c.ifNoneMatch_ = entityTag
1770 return c
1771 }
1772
1773
1774 func (c *AccountsProductsGetCall) Context(ctx context.Context) *AccountsProductsGetCall {
1775 c.ctx_ = ctx
1776 return c
1777 }
1778
1779
1780
1781 func (c *AccountsProductsGetCall) Header() http.Header {
1782 if c.header_ == nil {
1783 c.header_ = make(http.Header)
1784 }
1785 return c.header_
1786 }
1787
1788 func (c *AccountsProductsGetCall) doRequest(alt string) (*http.Response, error) {
1789 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1790 if c.ifNoneMatch_ != "" {
1791 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1792 }
1793 var body io.Reader = nil
1794 c.urlParams_.Set("alt", alt)
1795 c.urlParams_.Set("prettyPrint", "false")
1796 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products/{+name}")
1797 urls += "?" + c.urlParams_.Encode()
1798 req, err := http.NewRequest("GET", urls, body)
1799 if err != nil {
1800 return nil, err
1801 }
1802 req.Header = reqHeaders
1803 googleapi.Expand(req.URL, map[string]string{
1804 "parent": c.parent,
1805 "name": c.name,
1806 })
1807 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1808 }
1809
1810
1811
1812
1813
1814
1815 func (c *AccountsProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, error) {
1816 gensupport.SetOptions(c.urlParams_, opts...)
1817 res, err := c.doRequest("json")
1818 if res != nil && res.StatusCode == http.StatusNotModified {
1819 if res.Body != nil {
1820 res.Body.Close()
1821 }
1822 return nil, gensupport.WrapError(&googleapi.Error{
1823 Code: res.StatusCode,
1824 Header: res.Header,
1825 })
1826 }
1827 if err != nil {
1828 return nil, err
1829 }
1830 defer googleapi.CloseBody(res)
1831 if err := googleapi.CheckResponse(res); err != nil {
1832 return nil, gensupport.WrapError(err)
1833 }
1834 ret := &Product{
1835 ServerResponse: googleapi.ServerResponse{
1836 Header: res.Header,
1837 HTTPStatusCode: res.StatusCode,
1838 },
1839 }
1840 target := &ret
1841 if err := gensupport.DecodeResponse(target, res); err != nil {
1842 return nil, err
1843 }
1844 return ret, nil
1845 }
1846
1847 type AccountsProductsListCall struct {
1848 s *Service
1849 parent string
1850 urlParams_ gensupport.URLParams
1851 ifNoneMatch_ string
1852 ctx_ context.Context
1853 header_ http.Header
1854 }
1855
1856
1857
1858
1859
1860 func (r *AccountsProductsService) List(parent string) *AccountsProductsListCall {
1861 c := &AccountsProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1862 c.parent = parent
1863 return c
1864 }
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875 func (c *AccountsProductsListCall) Include(include ...string) *AccountsProductsListCall {
1876 c.urlParams_.SetMulti("include", append([]string{}, include...))
1877 return c
1878 }
1879
1880
1881
1882 func (c *AccountsProductsListCall) PageSize(pageSize int64) *AccountsProductsListCall {
1883 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1884 return c
1885 }
1886
1887
1888
1889 func (c *AccountsProductsListCall) PageToken(pageToken string) *AccountsProductsListCall {
1890 c.urlParams_.Set("pageToken", pageToken)
1891 return c
1892 }
1893
1894
1895
1896
1897 func (c *AccountsProductsListCall) Fields(s ...googleapi.Field) *AccountsProductsListCall {
1898 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1899 return c
1900 }
1901
1902
1903
1904
1905 func (c *AccountsProductsListCall) IfNoneMatch(entityTag string) *AccountsProductsListCall {
1906 c.ifNoneMatch_ = entityTag
1907 return c
1908 }
1909
1910
1911 func (c *AccountsProductsListCall) Context(ctx context.Context) *AccountsProductsListCall {
1912 c.ctx_ = ctx
1913 return c
1914 }
1915
1916
1917
1918 func (c *AccountsProductsListCall) Header() http.Header {
1919 if c.header_ == nil {
1920 c.header_ = make(http.Header)
1921 }
1922 return c.header_
1923 }
1924
1925 func (c *AccountsProductsListCall) doRequest(alt string) (*http.Response, error) {
1926 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1927 if c.ifNoneMatch_ != "" {
1928 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1929 }
1930 var body io.Reader = nil
1931 c.urlParams_.Set("alt", alt)
1932 c.urlParams_.Set("prettyPrint", "false")
1933 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products")
1934 urls += "?" + c.urlParams_.Encode()
1935 req, err := http.NewRequest("GET", urls, body)
1936 if err != nil {
1937 return nil, err
1938 }
1939 req.Header = reqHeaders
1940 googleapi.Expand(req.URL, map[string]string{
1941 "parent": c.parent,
1942 })
1943 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1944 }
1945
1946
1947
1948
1949
1950
1951
1952 func (c *AccountsProductsListCall) Do(opts ...googleapi.CallOption) (*ListProductsResponse, error) {
1953 gensupport.SetOptions(c.urlParams_, opts...)
1954 res, err := c.doRequest("json")
1955 if res != nil && res.StatusCode == http.StatusNotModified {
1956 if res.Body != nil {
1957 res.Body.Close()
1958 }
1959 return nil, gensupport.WrapError(&googleapi.Error{
1960 Code: res.StatusCode,
1961 Header: res.Header,
1962 })
1963 }
1964 if err != nil {
1965 return nil, err
1966 }
1967 defer googleapi.CloseBody(res)
1968 if err := googleapi.CheckResponse(res); err != nil {
1969 return nil, gensupport.WrapError(err)
1970 }
1971 ret := &ListProductsResponse{
1972 ServerResponse: googleapi.ServerResponse{
1973 Header: res.Header,
1974 HTTPStatusCode: res.StatusCode,
1975 },
1976 }
1977 target := &ret
1978 if err := gensupport.DecodeResponse(target, res); err != nil {
1979 return nil, err
1980 }
1981 return ret, nil
1982 }
1983
1984
1985
1986
1987 func (c *AccountsProductsListCall) Pages(ctx context.Context, f func(*ListProductsResponse) error) error {
1988 c.ctx_ = ctx
1989 defer c.PageToken(c.urlParams_.Get("pageToken"))
1990 for {
1991 x, err := c.Do()
1992 if err != nil {
1993 return err
1994 }
1995 if err := f(x); err != nil {
1996 return err
1997 }
1998 if x.NextPageToken == "" {
1999 return nil
2000 }
2001 c.PageToken(x.NextPageToken)
2002 }
2003 }
2004
2005 type AccountsProductsUpdateCall struct {
2006 s *Service
2007 parent string
2008 name string
2009 attributes *Attributes
2010 urlParams_ gensupport.URLParams
2011 ctx_ context.Context
2012 header_ http.Header
2013 }
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036 func (r *AccountsProductsService) Update(parent string, name string, attributes *Attributes) *AccountsProductsUpdateCall {
2037 c := &AccountsProductsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2038 c.parent = parent
2039 c.name = name
2040 c.attributes = attributes
2041 return c
2042 }
2043
2044
2045
2046
2047 func (c *AccountsProductsUpdateCall) Fields(s ...googleapi.Field) *AccountsProductsUpdateCall {
2048 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2049 return c
2050 }
2051
2052
2053 func (c *AccountsProductsUpdateCall) Context(ctx context.Context) *AccountsProductsUpdateCall {
2054 c.ctx_ = ctx
2055 return c
2056 }
2057
2058
2059
2060 func (c *AccountsProductsUpdateCall) Header() http.Header {
2061 if c.header_ == nil {
2062 c.header_ = make(http.Header)
2063 }
2064 return c.header_
2065 }
2066
2067 func (c *AccountsProductsUpdateCall) doRequest(alt string) (*http.Response, error) {
2068 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2069 var body io.Reader = nil
2070 body, err := googleapi.WithoutDataWrapper.JSONReader(c.attributes)
2071 if err != nil {
2072 return nil, err
2073 }
2074 c.urlParams_.Set("alt", alt)
2075 c.urlParams_.Set("prettyPrint", "false")
2076 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/products/{+name}")
2077 urls += "?" + c.urlParams_.Encode()
2078 req, err := http.NewRequest("PUT", urls, body)
2079 if err != nil {
2080 return nil, err
2081 }
2082 req.Header = reqHeaders
2083 googleapi.Expand(req.URL, map[string]string{
2084 "parent": c.parent,
2085 "name": c.name,
2086 })
2087 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2088 }
2089
2090
2091
2092
2093
2094
2095 func (c *AccountsProductsUpdateCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2096 gensupport.SetOptions(c.urlParams_, opts...)
2097 res, err := c.doRequest("json")
2098 if res != nil && res.StatusCode == http.StatusNotModified {
2099 if res.Body != nil {
2100 res.Body.Close()
2101 }
2102 return nil, gensupport.WrapError(&googleapi.Error{
2103 Code: res.StatusCode,
2104 Header: res.Header,
2105 })
2106 }
2107 if err != nil {
2108 return nil, err
2109 }
2110 defer googleapi.CloseBody(res)
2111 if err := googleapi.CheckResponse(res); err != nil {
2112 return nil, gensupport.WrapError(err)
2113 }
2114 ret := &Empty{
2115 ServerResponse: googleapi.ServerResponse{
2116 Header: res.Header,
2117 HTTPStatusCode: res.StatusCode,
2118 },
2119 }
2120 target := &ret
2121 if err := gensupport.DecodeResponse(target, res); err != nil {
2122 return nil, err
2123 }
2124 return ret, nil
2125 }
2126
View as plain text