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 androiddeviceprovisioning
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 = "androiddeviceprovisioning:v1"
90 const apiName = "androiddeviceprovisioning"
91 const apiVersion = "v1"
92 const basePath = "https://androiddeviceprovisioning.googleapis.com/"
93 const basePathTemplate = "https://androiddeviceprovisioning.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://androiddeviceprovisioning.mtls.googleapis.com/"
95
96
97 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
98 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
99 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
100 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
101 opts = append(opts, internaloption.EnableNewAuthLibrary())
102 client, endpoint, err := htransport.NewClient(ctx, opts...)
103 if err != nil {
104 return nil, err
105 }
106 s, err := New(client)
107 if err != nil {
108 return nil, err
109 }
110 if endpoint != "" {
111 s.BasePath = endpoint
112 }
113 return s, nil
114 }
115
116
117
118
119
120
121 func New(client *http.Client) (*Service, error) {
122 if client == nil {
123 return nil, errors.New("client is nil")
124 }
125 s := &Service{client: client, BasePath: basePath}
126 s.Customers = NewCustomersService(s)
127 s.Operations = NewOperationsService(s)
128 s.Partners = NewPartnersService(s)
129 return s, nil
130 }
131
132 type Service struct {
133 client *http.Client
134 BasePath string
135 UserAgent string
136
137 Customers *CustomersService
138
139 Operations *OperationsService
140
141 Partners *PartnersService
142 }
143
144 func (s *Service) userAgent() string {
145 if s.UserAgent == "" {
146 return googleapi.UserAgent
147 }
148 return googleapi.UserAgent + " " + s.UserAgent
149 }
150
151 func NewCustomersService(s *Service) *CustomersService {
152 rs := &CustomersService{s: s}
153 rs.Configurations = NewCustomersConfigurationsService(s)
154 rs.Devices = NewCustomersDevicesService(s)
155 rs.Dpcs = NewCustomersDpcsService(s)
156 return rs
157 }
158
159 type CustomersService struct {
160 s *Service
161
162 Configurations *CustomersConfigurationsService
163
164 Devices *CustomersDevicesService
165
166 Dpcs *CustomersDpcsService
167 }
168
169 func NewCustomersConfigurationsService(s *Service) *CustomersConfigurationsService {
170 rs := &CustomersConfigurationsService{s: s}
171 return rs
172 }
173
174 type CustomersConfigurationsService struct {
175 s *Service
176 }
177
178 func NewCustomersDevicesService(s *Service) *CustomersDevicesService {
179 rs := &CustomersDevicesService{s: s}
180 return rs
181 }
182
183 type CustomersDevicesService struct {
184 s *Service
185 }
186
187 func NewCustomersDpcsService(s *Service) *CustomersDpcsService {
188 rs := &CustomersDpcsService{s: s}
189 return rs
190 }
191
192 type CustomersDpcsService struct {
193 s *Service
194 }
195
196 func NewOperationsService(s *Service) *OperationsService {
197 rs := &OperationsService{s: s}
198 return rs
199 }
200
201 type OperationsService struct {
202 s *Service
203 }
204
205 func NewPartnersService(s *Service) *PartnersService {
206 rs := &PartnersService{s: s}
207 rs.Customers = NewPartnersCustomersService(s)
208 rs.Devices = NewPartnersDevicesService(s)
209 rs.Vendors = NewPartnersVendorsService(s)
210 return rs
211 }
212
213 type PartnersService struct {
214 s *Service
215
216 Customers *PartnersCustomersService
217
218 Devices *PartnersDevicesService
219
220 Vendors *PartnersVendorsService
221 }
222
223 func NewPartnersCustomersService(s *Service) *PartnersCustomersService {
224 rs := &PartnersCustomersService{s: s}
225 return rs
226 }
227
228 type PartnersCustomersService struct {
229 s *Service
230 }
231
232 func NewPartnersDevicesService(s *Service) *PartnersDevicesService {
233 rs := &PartnersDevicesService{s: s}
234 return rs
235 }
236
237 type PartnersDevicesService struct {
238 s *Service
239 }
240
241 func NewPartnersVendorsService(s *Service) *PartnersVendorsService {
242 rs := &PartnersVendorsService{s: s}
243 rs.Customers = NewPartnersVendorsCustomersService(s)
244 return rs
245 }
246
247 type PartnersVendorsService struct {
248 s *Service
249
250 Customers *PartnersVendorsCustomersService
251 }
252
253 func NewPartnersVendorsCustomersService(s *Service) *PartnersVendorsCustomersService {
254 rs := &PartnersVendorsCustomersService{s: s}
255 return rs
256 }
257
258 type PartnersVendorsCustomersService struct {
259 s *Service
260 }
261
262
263
264 type ClaimDeviceRequest struct {
265
266
267 ConfigurationId int64 `json:"configurationId,omitempty,string"`
268
269 CustomerId int64 `json:"customerId,omitempty,string"`
270
271
272 DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
273
274 DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"`
275
276 GoogleWorkspaceCustomerId string `json:"googleWorkspaceCustomerId,omitempty"`
277
278
279 PreProvisioningToken string `json:"preProvisioningToken,omitempty"`
280
281
282
283
284
285
286 SectionType string `json:"sectionType,omitempty"`
287
288
289
290 SimlockProfileId int64 `json:"simlockProfileId,omitempty,string"`
291
292
293
294
295
296 ForceSendFields []string `json:"-"`
297
298
299
300
301 NullFields []string `json:"-"`
302 }
303
304 func (s *ClaimDeviceRequest) MarshalJSON() ([]byte, error) {
305 type NoMethod ClaimDeviceRequest
306 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
307 }
308
309
310 type ClaimDeviceResponse struct {
311
312 DeviceId int64 `json:"deviceId,omitempty,string"`
313
314
315 DeviceName string `json:"deviceName,omitempty"`
316
317
318 googleapi.ServerResponse `json:"-"`
319
320
321
322
323
324 ForceSendFields []string `json:"-"`
325
326
327
328
329 NullFields []string `json:"-"`
330 }
331
332 func (s *ClaimDeviceResponse) MarshalJSON() ([]byte, error) {
333 type NoMethod ClaimDeviceResponse
334 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
335 }
336
337
338
339
340 type ClaimDevicesRequest struct {
341
342 Claims []*PartnerClaim `json:"claims,omitempty"`
343
344
345
346
347
348 ForceSendFields []string `json:"-"`
349
350
351
352
353 NullFields []string `json:"-"`
354 }
355
356 func (s *ClaimDevicesRequest) MarshalJSON() ([]byte, error) {
357 type NoMethod ClaimDevicesRequest
358 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
359 }
360
361
362
363 type Company struct {
364
365
366 AdminEmails []string `json:"adminEmails,omitempty"`
367
368 CompanyId int64 `json:"companyId,omitempty,string"`
369
370
371 CompanyName string `json:"companyName,omitempty"`
372
373
374 GoogleWorkspaceAccount *GoogleWorkspaceAccount `json:"googleWorkspaceAccount,omitempty"`
375
376
377
378
379
380
381
382
383
384
385
386 LanguageCode string `json:"languageCode,omitempty"`
387
388
389
390
391
392
393 Name string `json:"name,omitempty"`
394
395
396
397
398 OwnerEmails []string `json:"ownerEmails,omitempty"`
399
400
401
402
403
404 SkipWelcomeEmail bool `json:"skipWelcomeEmail,omitempty"`
405
406
407
408
409
410
411
412
413
414
415
416
417 TermsStatus string `json:"termsStatus,omitempty"`
418
419
420 googleapi.ServerResponse `json:"-"`
421
422
423
424
425
426 ForceSendFields []string `json:"-"`
427
428
429
430
431 NullFields []string `json:"-"`
432 }
433
434 func (s *Company) MarshalJSON() ([]byte, error) {
435 type NoMethod Company
436 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
437 }
438
439
440
441
442
443
444
445
446 type Configuration struct {
447
448
449 CompanyName string `json:"companyName,omitempty"`
450
451
452 ConfigurationId int64 `json:"configurationId,omitempty,string"`
453
454
455
456 ConfigurationName string `json:"configurationName,omitempty"`
457
458
459
460 ContactEmail string `json:"contactEmail,omitempty"`
461
462
463
464
465 ContactPhone string `json:"contactPhone,omitempty"`
466
467
468
469
470 CustomMessage string `json:"customMessage,omitempty"`
471
472
473 DpcExtras string `json:"dpcExtras,omitempty"`
474
475
476
477 DpcResourcePath string `json:"dpcResourcePath,omitempty"`
478
479
480
481
482 ForcedResetTime string `json:"forcedResetTime,omitempty"`
483
484
485
486
487
488 IsDefault bool `json:"isDefault,omitempty"`
489
490
491
492 Name string `json:"name,omitempty"`
493
494
495 googleapi.ServerResponse `json:"-"`
496
497
498
499
500
501 ForceSendFields []string `json:"-"`
502
503
504
505
506 NullFields []string `json:"-"`
507 }
508
509 func (s *Configuration) MarshalJSON() ([]byte, error) {
510 type NoMethod Configuration
511 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
512 }
513
514
515 type CreateCustomerRequest struct {
516
517
518
519
520 Customer *Company `json:"customer,omitempty"`
521
522
523
524
525
526 ForceSendFields []string `json:"-"`
527
528
529
530
531 NullFields []string `json:"-"`
532 }
533
534 func (s *CreateCustomerRequest) MarshalJSON() ([]byte, error) {
535 type NoMethod CreateCustomerRequest
536 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
537 }
538
539
540
541 type CustomerApplyConfigurationRequest struct {
542
543
544 Configuration string `json:"configuration,omitempty"`
545
546
547 Device *DeviceReference `json:"device,omitempty"`
548
549
550
551
552
553 ForceSendFields []string `json:"-"`
554
555
556
557
558 NullFields []string `json:"-"`
559 }
560
561 func (s *CustomerApplyConfigurationRequest) MarshalJSON() ([]byte, error) {
562 type NoMethod CustomerApplyConfigurationRequest
563 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
564 }
565
566
567
568 type CustomerListConfigurationsResponse struct {
569
570 Configurations []*Configuration `json:"configurations,omitempty"`
571
572
573 googleapi.ServerResponse `json:"-"`
574
575
576
577
578
579 ForceSendFields []string `json:"-"`
580
581
582
583
584 NullFields []string `json:"-"`
585 }
586
587 func (s *CustomerListConfigurationsResponse) MarshalJSON() ([]byte, error) {
588 type NoMethod CustomerListConfigurationsResponse
589 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
590 }
591
592
593 type CustomerListCustomersResponse struct {
594
595 Customers []*Company `json:"customers,omitempty"`
596
597
598 NextPageToken string `json:"nextPageToken,omitempty"`
599
600
601 googleapi.ServerResponse `json:"-"`
602
603
604
605
606
607 ForceSendFields []string `json:"-"`
608
609
610
611
612 NullFields []string `json:"-"`
613 }
614
615 func (s *CustomerListCustomersResponse) MarshalJSON() ([]byte, error) {
616 type NoMethod CustomerListCustomersResponse
617 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
618 }
619
620
621 type CustomerListDevicesResponse struct {
622
623 Devices []*Device `json:"devices,omitempty"`
624
625
626 NextPageToken string `json:"nextPageToken,omitempty"`
627
628
629 googleapi.ServerResponse `json:"-"`
630
631
632
633
634
635 ForceSendFields []string `json:"-"`
636
637
638
639
640 NullFields []string `json:"-"`
641 }
642
643 func (s *CustomerListDevicesResponse) MarshalJSON() ([]byte, error) {
644 type NoMethod CustomerListDevicesResponse
645 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
646 }
647
648
649 type CustomerListDpcsResponse struct {
650
651
652 Dpcs []*Dpc `json:"dpcs,omitempty"`
653
654
655 googleapi.ServerResponse `json:"-"`
656
657
658
659
660
661 ForceSendFields []string `json:"-"`
662
663
664
665
666 NullFields []string `json:"-"`
667 }
668
669 func (s *CustomerListDpcsResponse) MarshalJSON() ([]byte, error) {
670 type NoMethod CustomerListDpcsResponse
671 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
672 }
673
674
675
676 type CustomerRemoveConfigurationRequest struct {
677
678
679 Device *DeviceReference `json:"device,omitempty"`
680
681
682
683
684
685 ForceSendFields []string `json:"-"`
686
687
688
689
690 NullFields []string `json:"-"`
691 }
692
693 func (s *CustomerRemoveConfigurationRequest) MarshalJSON() ([]byte, error) {
694 type NoMethod CustomerRemoveConfigurationRequest
695 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
696 }
697
698
699
700 type CustomerUnclaimDeviceRequest struct {
701
702
703 Device *DeviceReference `json:"device,omitempty"`
704
705
706
707
708
709 ForceSendFields []string `json:"-"`
710
711
712
713
714 NullFields []string `json:"-"`
715 }
716
717 func (s *CustomerUnclaimDeviceRequest) MarshalJSON() ([]byte, error) {
718 type NoMethod CustomerUnclaimDeviceRequest
719 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
720 }
721
722
723 type Device struct {
724
725
726
727
728
729 Claims []*DeviceClaim `json:"claims,omitempty"`
730
731 Configuration string `json:"configuration,omitempty"`
732
733 DeviceId int64 `json:"deviceId,omitempty,string"`
734
735
736
737 DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
738
739
740
741 DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"`
742
743
744 Name string `json:"name,omitempty"`
745
746
747 googleapi.ServerResponse `json:"-"`
748
749
750
751
752
753 ForceSendFields []string `json:"-"`
754
755
756
757
758 NullFields []string `json:"-"`
759 }
760
761 func (s *Device) MarshalJSON() ([]byte, error) {
762 type NoMethod Device
763 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
764 }
765
766
767
768
769
770 type DeviceClaim struct {
771
772
773
774
775
776
777
778 AdditionalService string `json:"additionalService,omitempty"`
779
780
781 GoogleWorkspaceCustomerId string `json:"googleWorkspaceCustomerId,omitempty"`
782
783 OwnerCompanyId int64 `json:"ownerCompanyId,omitempty,string"`
784
785 ResellerId int64 `json:"resellerId,omitempty,string"`
786
787
788
789
790
791
792 SectionType string `json:"sectionType,omitempty"`
793
794
795 VacationModeExpireTime string `json:"vacationModeExpireTime,omitempty"`
796
797
798
799 VacationModeStartTime string `json:"vacationModeStartTime,omitempty"`
800
801
802
803
804
805 ForceSendFields []string `json:"-"`
806
807
808
809
810 NullFields []string `json:"-"`
811 }
812
813 func (s *DeviceClaim) MarshalJSON() ([]byte, error) {
814 type NoMethod DeviceClaim
815 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
816 }
817
818
819
820
821 type DeviceIdentifier struct {
822
823
824 ChromeOsAttestedDeviceId string `json:"chromeOsAttestedDeviceId,omitempty"`
825
826
827
828
829
830
831 DeviceType string `json:"deviceType,omitempty"`
832
833 Imei string `json:"imei,omitempty"`
834
835
836
837
838 Manufacturer string `json:"manufacturer,omitempty"`
839
840 Meid string `json:"meid,omitempty"`
841
842
843
844 Model string `json:"model,omitempty"`
845
846
847 SerialNumber string `json:"serialNumber,omitempty"`
848
849
850
851
852
853 ForceSendFields []string `json:"-"`
854
855
856
857
858 NullFields []string `json:"-"`
859 }
860
861 func (s *DeviceIdentifier) MarshalJSON() ([]byte, error) {
862 type NoMethod DeviceIdentifier
863 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
864 }
865
866
867
868
869 type DeviceMetadata struct {
870
871 Entries map[string]string `json:"entries,omitempty"`
872
873
874 googleapi.ServerResponse `json:"-"`
875
876
877
878
879
880 ForceSendFields []string `json:"-"`
881
882
883
884
885 NullFields []string `json:"-"`
886 }
887
888 func (s *DeviceMetadata) MarshalJSON() ([]byte, error) {
889 type NoMethod DeviceMetadata
890 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
891 }
892
893
894
895
896
897
898
899
900 type DeviceReference struct {
901
902 DeviceId int64 `json:"deviceId,omitempty,string"`
903
904 DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
905
906
907
908
909
910 ForceSendFields []string `json:"-"`
911
912
913
914
915 NullFields []string `json:"-"`
916 }
917
918 func (s *DeviceReference) MarshalJSON() ([]byte, error) {
919 type NoMethod DeviceReference
920 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
921 }
922
923
924
925
926
927 type DevicesLongRunningOperationMetadata struct {
928
929
930
931 DevicesCount int64 `json:"devicesCount,omitempty"`
932
933
934
935
936
937
938
939
940
941 ProcessingStatus string `json:"processingStatus,omitempty"`
942
943
944
945 Progress int64 `json:"progress,omitempty"`
946
947
948
949
950
951 ForceSendFields []string `json:"-"`
952
953
954
955
956 NullFields []string `json:"-"`
957 }
958
959 func (s *DevicesLongRunningOperationMetadata) MarshalJSON() ([]byte, error) {
960 type NoMethod DevicesLongRunningOperationMetadata
961 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
962 }
963
964
965
966
967
968 type DevicesLongRunningOperationResponse struct {
969
970
971
972 PerDeviceStatus []*OperationPerDevice `json:"perDeviceStatus,omitempty"`
973
974
975 SuccessCount int64 `json:"successCount,omitempty"`
976
977
978
979
980
981 ForceSendFields []string `json:"-"`
982
983
984
985
986 NullFields []string `json:"-"`
987 }
988
989 func (s *DevicesLongRunningOperationResponse) MarshalJSON() ([]byte, error) {
990 type NoMethod DevicesLongRunningOperationResponse
991 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
992 }
993
994
995
996
997
998
999 type Dpc struct {
1000
1001
1002 DpcName string `json:"dpcName,omitempty"`
1003
1004
1005
1006
1007 Name string `json:"name,omitempty"`
1008
1009
1010
1011 PackageName string `json:"packageName,omitempty"`
1012
1013
1014
1015
1016
1017 ForceSendFields []string `json:"-"`
1018
1019
1020
1021
1022 NullFields []string `json:"-"`
1023 }
1024
1025 func (s *Dpc) MarshalJSON() ([]byte, error) {
1026 type NoMethod Dpc
1027 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1028 }
1029
1030
1031
1032
1033
1034 type Empty struct {
1035
1036 googleapi.ServerResponse `json:"-"`
1037 }
1038
1039
1040 type FindDevicesByDeviceIdentifierRequest struct {
1041
1042 DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
1043
1044
1045 Limit int64 `json:"limit,omitempty,string"`
1046
1047 PageToken string `json:"pageToken,omitempty"`
1048
1049
1050
1051
1052
1053 ForceSendFields []string `json:"-"`
1054
1055
1056
1057
1058 NullFields []string `json:"-"`
1059 }
1060
1061 func (s *FindDevicesByDeviceIdentifierRequest) MarshalJSON() ([]byte, error) {
1062 type NoMethod FindDevicesByDeviceIdentifierRequest
1063 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1064 }
1065
1066
1067 type FindDevicesByDeviceIdentifierResponse struct {
1068
1069 Devices []*Device `json:"devices,omitempty"`
1070
1071
1072 NextPageToken string `json:"nextPageToken,omitempty"`
1073
1074 TotalSize int64 `json:"totalSize,omitempty"`
1075
1076
1077 googleapi.ServerResponse `json:"-"`
1078
1079
1080
1081
1082
1083 ForceSendFields []string `json:"-"`
1084
1085
1086
1087
1088 NullFields []string `json:"-"`
1089 }
1090
1091 func (s *FindDevicesByDeviceIdentifierResponse) MarshalJSON() ([]byte, error) {
1092 type NoMethod FindDevicesByDeviceIdentifierResponse
1093 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1094 }
1095
1096
1097 type FindDevicesByOwnerRequest struct {
1098
1099 CustomerId googleapi.Int64s `json:"customerId,omitempty"`
1100
1101
1102 GoogleWorkspaceCustomerId []string `json:"googleWorkspaceCustomerId,omitempty"`
1103
1104
1105 Limit int64 `json:"limit,omitempty,string"`
1106
1107 PageToken string `json:"pageToken,omitempty"`
1108
1109
1110
1111
1112
1113
1114 SectionType string `json:"sectionType,omitempty"`
1115
1116
1117
1118
1119
1120 ForceSendFields []string `json:"-"`
1121
1122
1123
1124
1125 NullFields []string `json:"-"`
1126 }
1127
1128 func (s *FindDevicesByOwnerRequest) MarshalJSON() ([]byte, error) {
1129 type NoMethod FindDevicesByOwnerRequest
1130 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1131 }
1132
1133
1134 type FindDevicesByOwnerResponse struct {
1135
1136 Devices []*Device `json:"devices,omitempty"`
1137
1138
1139 NextPageToken string `json:"nextPageToken,omitempty"`
1140
1141 TotalSize int64 `json:"totalSize,omitempty"`
1142
1143
1144 googleapi.ServerResponse `json:"-"`
1145
1146
1147
1148
1149
1150 ForceSendFields []string `json:"-"`
1151
1152
1153
1154
1155 NullFields []string `json:"-"`
1156 }
1157
1158 func (s *FindDevicesByOwnerResponse) MarshalJSON() ([]byte, error) {
1159 type NoMethod FindDevicesByOwnerResponse
1160 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1161 }
1162
1163
1164 type GetDeviceSimLockStateRequest struct {
1165
1166 DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
1167
1168
1169
1170
1171
1172 ForceSendFields []string `json:"-"`
1173
1174
1175
1176
1177 NullFields []string `json:"-"`
1178 }
1179
1180 func (s *GetDeviceSimLockStateRequest) MarshalJSON() ([]byte, error) {
1181 type NoMethod GetDeviceSimLockStateRequest
1182 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1183 }
1184
1185
1186 type GetDeviceSimLockStateResponse struct {
1187
1188
1189
1190
1191
1192
1193 SimLockState string `json:"simLockState,omitempty"`
1194
1195
1196 googleapi.ServerResponse `json:"-"`
1197
1198
1199
1200
1201
1202 ForceSendFields []string `json:"-"`
1203
1204
1205
1206
1207 NullFields []string `json:"-"`
1208 }
1209
1210 func (s *GetDeviceSimLockStateResponse) MarshalJSON() ([]byte, error) {
1211 type NoMethod GetDeviceSimLockStateResponse
1212 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1213 }
1214
1215
1216 type GoogleWorkspaceAccount struct {
1217
1218 CustomerId string `json:"customerId,omitempty"`
1219
1220
1221 PreProvisioningTokens []string `json:"preProvisioningTokens,omitempty"`
1222
1223
1224
1225
1226
1227 ForceSendFields []string `json:"-"`
1228
1229
1230
1231
1232 NullFields []string `json:"-"`
1233 }
1234
1235 func (s *GoogleWorkspaceAccount) MarshalJSON() ([]byte, error) {
1236 type NoMethod GoogleWorkspaceAccount
1237 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1238 }
1239
1240
1241
1242 type ListCustomersResponse struct {
1243
1244 Customers []*Company `json:"customers,omitempty"`
1245
1246
1247 NextPageToken string `json:"nextPageToken,omitempty"`
1248
1249 TotalSize int64 `json:"totalSize,omitempty"`
1250
1251
1252 googleapi.ServerResponse `json:"-"`
1253
1254
1255
1256
1257
1258 ForceSendFields []string `json:"-"`
1259
1260
1261
1262
1263 NullFields []string `json:"-"`
1264 }
1265
1266 func (s *ListCustomersResponse) MarshalJSON() ([]byte, error) {
1267 type NoMethod ListCustomersResponse
1268 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1269 }
1270
1271
1272
1273 type ListVendorCustomersResponse struct {
1274
1275 Customers []*Company `json:"customers,omitempty"`
1276
1277
1278 NextPageToken string `json:"nextPageToken,omitempty"`
1279
1280 TotalSize int64 `json:"totalSize,omitempty"`
1281
1282
1283 googleapi.ServerResponse `json:"-"`
1284
1285
1286
1287
1288
1289 ForceSendFields []string `json:"-"`
1290
1291
1292
1293
1294 NullFields []string `json:"-"`
1295 }
1296
1297 func (s *ListVendorCustomersResponse) MarshalJSON() ([]byte, error) {
1298 type NoMethod ListVendorCustomersResponse
1299 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1300 }
1301
1302
1303 type ListVendorsResponse struct {
1304
1305
1306 NextPageToken string `json:"nextPageToken,omitempty"`
1307
1308 TotalSize int64 `json:"totalSize,omitempty"`
1309
1310
1311 Vendors []*Company `json:"vendors,omitempty"`
1312
1313
1314 googleapi.ServerResponse `json:"-"`
1315
1316
1317
1318
1319
1320 ForceSendFields []string `json:"-"`
1321
1322
1323
1324
1325 NullFields []string `json:"-"`
1326 }
1327
1328 func (s *ListVendorsResponse) MarshalJSON() ([]byte, error) {
1329 type NoMethod ListVendorsResponse
1330 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1331 }
1332
1333
1334
1335 type Operation struct {
1336
1337
1338
1339 Done bool `json:"done,omitempty"`
1340
1341
1342
1343
1344 Error *Status `json:"error,omitempty"`
1345
1346
1347
1348 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1349
1350
1351
1352 Name string `json:"name,omitempty"`
1353
1354
1355
1356 Response googleapi.RawMessage `json:"response,omitempty"`
1357
1358
1359 googleapi.ServerResponse `json:"-"`
1360
1361
1362
1363
1364
1365 ForceSendFields []string `json:"-"`
1366
1367
1368
1369
1370 NullFields []string `json:"-"`
1371 }
1372
1373 func (s *Operation) MarshalJSON() ([]byte, error) {
1374 type NoMethod Operation
1375 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1376 }
1377
1378
1379
1380 type OperationPerDevice struct {
1381
1382 Claim *PartnerClaim `json:"claim,omitempty"`
1383
1384 Result *PerDeviceStatusInBatch `json:"result,omitempty"`
1385
1386
1387 Unclaim *PartnerUnclaim `json:"unclaim,omitempty"`
1388
1389
1390 UpdateMetadata *UpdateMetadataArguments `json:"updateMetadata,omitempty"`
1391
1392
1393
1394
1395
1396 ForceSendFields []string `json:"-"`
1397
1398
1399
1400
1401 NullFields []string `json:"-"`
1402 }
1403
1404 func (s *OperationPerDevice) MarshalJSON() ([]byte, error) {
1405 type NoMethod OperationPerDevice
1406 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1407 }
1408
1409
1410 type PartnerClaim struct {
1411
1412
1413 ConfigurationId int64 `json:"configurationId,omitempty,string"`
1414
1415 CustomerId int64 `json:"customerId,omitempty,string"`
1416
1417 DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
1418
1419 DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"`
1420
1421 GoogleWorkspaceCustomerId string `json:"googleWorkspaceCustomerId,omitempty"`
1422
1423
1424 PreProvisioningToken string `json:"preProvisioningToken,omitempty"`
1425
1426
1427
1428
1429
1430
1431 SectionType string `json:"sectionType,omitempty"`
1432
1433
1434
1435 SimlockProfileId int64 `json:"simlockProfileId,omitempty,string"`
1436
1437
1438
1439
1440
1441 ForceSendFields []string `json:"-"`
1442
1443
1444
1445
1446 NullFields []string `json:"-"`
1447 }
1448
1449 func (s *PartnerClaim) MarshalJSON() ([]byte, error) {
1450 type NoMethod PartnerClaim
1451 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1452 }
1453
1454
1455 type PartnerUnclaim struct {
1456
1457 DeviceId int64 `json:"deviceId,omitempty,string"`
1458
1459 DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
1460
1461
1462
1463
1464
1465
1466 SectionType string `json:"sectionType,omitempty"`
1467
1468
1469 VacationModeDays int64 `json:"vacationModeDays,omitempty"`
1470
1471
1472 VacationModeExpireTime string `json:"vacationModeExpireTime,omitempty"`
1473
1474
1475
1476
1477
1478 ForceSendFields []string `json:"-"`
1479
1480
1481
1482
1483 NullFields []string `json:"-"`
1484 }
1485
1486 func (s *PartnerUnclaim) MarshalJSON() ([]byte, error) {
1487 type NoMethod PartnerUnclaim
1488 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1489 }
1490
1491
1492
1493 type PerDeviceStatusInBatch struct {
1494
1495 DeviceId int64 `json:"deviceId,omitempty,string"`
1496
1497 ErrorIdentifier string `json:"errorIdentifier,omitempty"`
1498
1499
1500 ErrorMessage string `json:"errorMessage,omitempty"`
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520 Status string `json:"status,omitempty"`
1521
1522
1523
1524
1525
1526 ForceSendFields []string `json:"-"`
1527
1528
1529
1530
1531 NullFields []string `json:"-"`
1532 }
1533
1534 func (s *PerDeviceStatusInBatch) MarshalJSON() ([]byte, error) {
1535 type NoMethod PerDeviceStatusInBatch
1536 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1537 }
1538
1539
1540
1541
1542
1543
1544
1545 type Status struct {
1546
1547 Code int64 `json:"code,omitempty"`
1548
1549
1550 Details []googleapi.RawMessage `json:"details,omitempty"`
1551
1552
1553
1554 Message string `json:"message,omitempty"`
1555
1556
1557
1558
1559
1560 ForceSendFields []string `json:"-"`
1561
1562
1563
1564
1565 NullFields []string `json:"-"`
1566 }
1567
1568 func (s *Status) MarshalJSON() ([]byte, error) {
1569 type NoMethod Status
1570 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1571 }
1572
1573
1574 type UnclaimDeviceRequest struct {
1575
1576 DeviceId int64 `json:"deviceId,omitempty,string"`
1577
1578
1579 DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
1580
1581
1582
1583
1584
1585
1586 SectionType string `json:"sectionType,omitempty"`
1587
1588
1589 VacationModeDays int64 `json:"vacationModeDays,omitempty"`
1590
1591 VacationModeExpireTime string `json:"vacationModeExpireTime,omitempty"`
1592
1593
1594
1595
1596
1597 ForceSendFields []string `json:"-"`
1598
1599
1600
1601
1602 NullFields []string `json:"-"`
1603 }
1604
1605 func (s *UnclaimDeviceRequest) MarshalJSON() ([]byte, error) {
1606 type NoMethod UnclaimDeviceRequest
1607 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1608 }
1609
1610
1611 type UnclaimDevicesRequest struct {
1612
1613 Unclaims []*PartnerUnclaim `json:"unclaims,omitempty"`
1614
1615
1616
1617
1618
1619 ForceSendFields []string `json:"-"`
1620
1621
1622
1623
1624 NullFields []string `json:"-"`
1625 }
1626
1627 func (s *UnclaimDevicesRequest) MarshalJSON() ([]byte, error) {
1628 type NoMethod UnclaimDevicesRequest
1629 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1630 }
1631
1632
1633
1634 type UpdateDeviceMetadataInBatchRequest struct {
1635
1636 Updates []*UpdateMetadataArguments `json:"updates,omitempty"`
1637
1638
1639
1640
1641
1642 ForceSendFields []string `json:"-"`
1643
1644
1645
1646
1647 NullFields []string `json:"-"`
1648 }
1649
1650 func (s *UpdateDeviceMetadataInBatchRequest) MarshalJSON() ([]byte, error) {
1651 type NoMethod UpdateDeviceMetadataInBatchRequest
1652 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1653 }
1654
1655
1656 type UpdateDeviceMetadataRequest struct {
1657
1658 DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"`
1659
1660
1661
1662
1663
1664 ForceSendFields []string `json:"-"`
1665
1666
1667
1668
1669 NullFields []string `json:"-"`
1670 }
1671
1672 func (s *UpdateDeviceMetadataRequest) MarshalJSON() ([]byte, error) {
1673 type NoMethod UpdateDeviceMetadataRequest
1674 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1675 }
1676
1677
1678 type UpdateMetadataArguments struct {
1679
1680 DeviceId int64 `json:"deviceId,omitempty,string"`
1681
1682 DeviceIdentifier *DeviceIdentifier `json:"deviceIdentifier,omitempty"`
1683
1684 DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"`
1685
1686
1687
1688
1689
1690 ForceSendFields []string `json:"-"`
1691
1692
1693
1694
1695 NullFields []string `json:"-"`
1696 }
1697
1698 func (s *UpdateMetadataArguments) MarshalJSON() ([]byte, error) {
1699 type NoMethod UpdateMetadataArguments
1700 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
1701 }
1702
1703 type CustomersListCall struct {
1704 s *Service
1705 urlParams_ gensupport.URLParams
1706 ifNoneMatch_ string
1707 ctx_ context.Context
1708 header_ http.Header
1709 }
1710
1711
1712 func (r *CustomersService) List() *CustomersListCall {
1713 c := &CustomersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1714 return c
1715 }
1716
1717
1718
1719
1720 func (c *CustomersListCall) PageSize(pageSize int64) *CustomersListCall {
1721 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1722 return c
1723 }
1724
1725
1726
1727
1728 func (c *CustomersListCall) PageToken(pageToken string) *CustomersListCall {
1729 c.urlParams_.Set("pageToken", pageToken)
1730 return c
1731 }
1732
1733
1734
1735
1736 func (c *CustomersListCall) Fields(s ...googleapi.Field) *CustomersListCall {
1737 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1738 return c
1739 }
1740
1741
1742
1743
1744 func (c *CustomersListCall) IfNoneMatch(entityTag string) *CustomersListCall {
1745 c.ifNoneMatch_ = entityTag
1746 return c
1747 }
1748
1749
1750 func (c *CustomersListCall) Context(ctx context.Context) *CustomersListCall {
1751 c.ctx_ = ctx
1752 return c
1753 }
1754
1755
1756
1757 func (c *CustomersListCall) Header() http.Header {
1758 if c.header_ == nil {
1759 c.header_ = make(http.Header)
1760 }
1761 return c.header_
1762 }
1763
1764 func (c *CustomersListCall) doRequest(alt string) (*http.Response, error) {
1765 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1766 if c.ifNoneMatch_ != "" {
1767 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1768 }
1769 var body io.Reader = nil
1770 c.urlParams_.Set("alt", alt)
1771 c.urlParams_.Set("prettyPrint", "false")
1772 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/customers")
1773 urls += "?" + c.urlParams_.Encode()
1774 req, err := http.NewRequest("GET", urls, body)
1775 if err != nil {
1776 return nil, err
1777 }
1778 req.Header = reqHeaders
1779 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1780 }
1781
1782
1783
1784
1785
1786
1787
1788 func (c *CustomersListCall) Do(opts ...googleapi.CallOption) (*CustomerListCustomersResponse, error) {
1789 gensupport.SetOptions(c.urlParams_, opts...)
1790 res, err := c.doRequest("json")
1791 if res != nil && res.StatusCode == http.StatusNotModified {
1792 if res.Body != nil {
1793 res.Body.Close()
1794 }
1795 return nil, gensupport.WrapError(&googleapi.Error{
1796 Code: res.StatusCode,
1797 Header: res.Header,
1798 })
1799 }
1800 if err != nil {
1801 return nil, err
1802 }
1803 defer googleapi.CloseBody(res)
1804 if err := googleapi.CheckResponse(res); err != nil {
1805 return nil, gensupport.WrapError(err)
1806 }
1807 ret := &CustomerListCustomersResponse{
1808 ServerResponse: googleapi.ServerResponse{
1809 Header: res.Header,
1810 HTTPStatusCode: res.StatusCode,
1811 },
1812 }
1813 target := &ret
1814 if err := gensupport.DecodeResponse(target, res); err != nil {
1815 return nil, err
1816 }
1817 return ret, nil
1818 }
1819
1820
1821
1822
1823 func (c *CustomersListCall) Pages(ctx context.Context, f func(*CustomerListCustomersResponse) error) error {
1824 c.ctx_ = ctx
1825 defer c.PageToken(c.urlParams_.Get("pageToken"))
1826 for {
1827 x, err := c.Do()
1828 if err != nil {
1829 return err
1830 }
1831 if err := f(x); err != nil {
1832 return err
1833 }
1834 if x.NextPageToken == "" {
1835 return nil
1836 }
1837 c.PageToken(x.NextPageToken)
1838 }
1839 }
1840
1841 type CustomersConfigurationsCreateCall struct {
1842 s *Service
1843 parent string
1844 configuration *Configuration
1845 urlParams_ gensupport.URLParams
1846 ctx_ context.Context
1847 header_ http.Header
1848 }
1849
1850
1851
1852
1853
1854
1855
1856 func (r *CustomersConfigurationsService) Create(parent string, configuration *Configuration) *CustomersConfigurationsCreateCall {
1857 c := &CustomersConfigurationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1858 c.parent = parent
1859 c.configuration = configuration
1860 return c
1861 }
1862
1863
1864
1865
1866 func (c *CustomersConfigurationsCreateCall) Fields(s ...googleapi.Field) *CustomersConfigurationsCreateCall {
1867 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1868 return c
1869 }
1870
1871
1872 func (c *CustomersConfigurationsCreateCall) Context(ctx context.Context) *CustomersConfigurationsCreateCall {
1873 c.ctx_ = ctx
1874 return c
1875 }
1876
1877
1878
1879 func (c *CustomersConfigurationsCreateCall) Header() http.Header {
1880 if c.header_ == nil {
1881 c.header_ = make(http.Header)
1882 }
1883 return c.header_
1884 }
1885
1886 func (c *CustomersConfigurationsCreateCall) doRequest(alt string) (*http.Response, error) {
1887 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1888 var body io.Reader = nil
1889 body, err := googleapi.WithoutDataWrapper.JSONReader(c.configuration)
1890 if err != nil {
1891 return nil, err
1892 }
1893 c.urlParams_.Set("alt", alt)
1894 c.urlParams_.Set("prettyPrint", "false")
1895 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/configurations")
1896 urls += "?" + c.urlParams_.Encode()
1897 req, err := http.NewRequest("POST", urls, body)
1898 if err != nil {
1899 return nil, err
1900 }
1901 req.Header = reqHeaders
1902 googleapi.Expand(req.URL, map[string]string{
1903 "parent": c.parent,
1904 })
1905 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1906 }
1907
1908
1909
1910
1911
1912
1913 func (c *CustomersConfigurationsCreateCall) Do(opts ...googleapi.CallOption) (*Configuration, error) {
1914 gensupport.SetOptions(c.urlParams_, opts...)
1915 res, err := c.doRequest("json")
1916 if res != nil && res.StatusCode == http.StatusNotModified {
1917 if res.Body != nil {
1918 res.Body.Close()
1919 }
1920 return nil, gensupport.WrapError(&googleapi.Error{
1921 Code: res.StatusCode,
1922 Header: res.Header,
1923 })
1924 }
1925 if err != nil {
1926 return nil, err
1927 }
1928 defer googleapi.CloseBody(res)
1929 if err := googleapi.CheckResponse(res); err != nil {
1930 return nil, gensupport.WrapError(err)
1931 }
1932 ret := &Configuration{
1933 ServerResponse: googleapi.ServerResponse{
1934 Header: res.Header,
1935 HTTPStatusCode: res.StatusCode,
1936 },
1937 }
1938 target := &ret
1939 if err := gensupport.DecodeResponse(target, res); err != nil {
1940 return nil, err
1941 }
1942 return ret, nil
1943 }
1944
1945 type CustomersConfigurationsDeleteCall struct {
1946 s *Service
1947 name string
1948 urlParams_ gensupport.URLParams
1949 ctx_ context.Context
1950 header_ http.Header
1951 }
1952
1953
1954
1955
1956
1957
1958
1959 func (r *CustomersConfigurationsService) Delete(name string) *CustomersConfigurationsDeleteCall {
1960 c := &CustomersConfigurationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1961 c.name = name
1962 return c
1963 }
1964
1965
1966
1967
1968 func (c *CustomersConfigurationsDeleteCall) Fields(s ...googleapi.Field) *CustomersConfigurationsDeleteCall {
1969 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1970 return c
1971 }
1972
1973
1974 func (c *CustomersConfigurationsDeleteCall) Context(ctx context.Context) *CustomersConfigurationsDeleteCall {
1975 c.ctx_ = ctx
1976 return c
1977 }
1978
1979
1980
1981 func (c *CustomersConfigurationsDeleteCall) Header() http.Header {
1982 if c.header_ == nil {
1983 c.header_ = make(http.Header)
1984 }
1985 return c.header_
1986 }
1987
1988 func (c *CustomersConfigurationsDeleteCall) doRequest(alt string) (*http.Response, error) {
1989 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1990 var body io.Reader = nil
1991 c.urlParams_.Set("alt", alt)
1992 c.urlParams_.Set("prettyPrint", "false")
1993 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1994 urls += "?" + c.urlParams_.Encode()
1995 req, err := http.NewRequest("DELETE", urls, body)
1996 if err != nil {
1997 return nil, err
1998 }
1999 req.Header = reqHeaders
2000 googleapi.Expand(req.URL, map[string]string{
2001 "name": c.name,
2002 })
2003 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2004 }
2005
2006
2007
2008
2009
2010
2011 func (c *CustomersConfigurationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2012 gensupport.SetOptions(c.urlParams_, opts...)
2013 res, err := c.doRequest("json")
2014 if res != nil && res.StatusCode == http.StatusNotModified {
2015 if res.Body != nil {
2016 res.Body.Close()
2017 }
2018 return nil, gensupport.WrapError(&googleapi.Error{
2019 Code: res.StatusCode,
2020 Header: res.Header,
2021 })
2022 }
2023 if err != nil {
2024 return nil, err
2025 }
2026 defer googleapi.CloseBody(res)
2027 if err := googleapi.CheckResponse(res); err != nil {
2028 return nil, gensupport.WrapError(err)
2029 }
2030 ret := &Empty{
2031 ServerResponse: googleapi.ServerResponse{
2032 Header: res.Header,
2033 HTTPStatusCode: res.StatusCode,
2034 },
2035 }
2036 target := &ret
2037 if err := gensupport.DecodeResponse(target, res); err != nil {
2038 return nil, err
2039 }
2040 return ret, nil
2041 }
2042
2043 type CustomersConfigurationsGetCall struct {
2044 s *Service
2045 name string
2046 urlParams_ gensupport.URLParams
2047 ifNoneMatch_ string
2048 ctx_ context.Context
2049 header_ http.Header
2050 }
2051
2052
2053
2054
2055
2056 func (r *CustomersConfigurationsService) Get(name string) *CustomersConfigurationsGetCall {
2057 c := &CustomersConfigurationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2058 c.name = name
2059 return c
2060 }
2061
2062
2063
2064
2065 func (c *CustomersConfigurationsGetCall) Fields(s ...googleapi.Field) *CustomersConfigurationsGetCall {
2066 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2067 return c
2068 }
2069
2070
2071
2072
2073 func (c *CustomersConfigurationsGetCall) IfNoneMatch(entityTag string) *CustomersConfigurationsGetCall {
2074 c.ifNoneMatch_ = entityTag
2075 return c
2076 }
2077
2078
2079 func (c *CustomersConfigurationsGetCall) Context(ctx context.Context) *CustomersConfigurationsGetCall {
2080 c.ctx_ = ctx
2081 return c
2082 }
2083
2084
2085
2086 func (c *CustomersConfigurationsGetCall) Header() http.Header {
2087 if c.header_ == nil {
2088 c.header_ = make(http.Header)
2089 }
2090 return c.header_
2091 }
2092
2093 func (c *CustomersConfigurationsGetCall) doRequest(alt string) (*http.Response, error) {
2094 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2095 if c.ifNoneMatch_ != "" {
2096 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2097 }
2098 var body io.Reader = nil
2099 c.urlParams_.Set("alt", alt)
2100 c.urlParams_.Set("prettyPrint", "false")
2101 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2102 urls += "?" + c.urlParams_.Encode()
2103 req, err := http.NewRequest("GET", urls, body)
2104 if err != nil {
2105 return nil, err
2106 }
2107 req.Header = reqHeaders
2108 googleapi.Expand(req.URL, map[string]string{
2109 "name": c.name,
2110 })
2111 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2112 }
2113
2114
2115
2116
2117
2118
2119 func (c *CustomersConfigurationsGetCall) Do(opts ...googleapi.CallOption) (*Configuration, error) {
2120 gensupport.SetOptions(c.urlParams_, opts...)
2121 res, err := c.doRequest("json")
2122 if res != nil && res.StatusCode == http.StatusNotModified {
2123 if res.Body != nil {
2124 res.Body.Close()
2125 }
2126 return nil, gensupport.WrapError(&googleapi.Error{
2127 Code: res.StatusCode,
2128 Header: res.Header,
2129 })
2130 }
2131 if err != nil {
2132 return nil, err
2133 }
2134 defer googleapi.CloseBody(res)
2135 if err := googleapi.CheckResponse(res); err != nil {
2136 return nil, gensupport.WrapError(err)
2137 }
2138 ret := &Configuration{
2139 ServerResponse: googleapi.ServerResponse{
2140 Header: res.Header,
2141 HTTPStatusCode: res.StatusCode,
2142 },
2143 }
2144 target := &ret
2145 if err := gensupport.DecodeResponse(target, res); err != nil {
2146 return nil, err
2147 }
2148 return ret, nil
2149 }
2150
2151 type CustomersConfigurationsListCall struct {
2152 s *Service
2153 parent string
2154 urlParams_ gensupport.URLParams
2155 ifNoneMatch_ string
2156 ctx_ context.Context
2157 header_ http.Header
2158 }
2159
2160
2161
2162
2163
2164 func (r *CustomersConfigurationsService) List(parent string) *CustomersConfigurationsListCall {
2165 c := &CustomersConfigurationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2166 c.parent = parent
2167 return c
2168 }
2169
2170
2171
2172
2173 func (c *CustomersConfigurationsListCall) Fields(s ...googleapi.Field) *CustomersConfigurationsListCall {
2174 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2175 return c
2176 }
2177
2178
2179
2180
2181 func (c *CustomersConfigurationsListCall) IfNoneMatch(entityTag string) *CustomersConfigurationsListCall {
2182 c.ifNoneMatch_ = entityTag
2183 return c
2184 }
2185
2186
2187 func (c *CustomersConfigurationsListCall) Context(ctx context.Context) *CustomersConfigurationsListCall {
2188 c.ctx_ = ctx
2189 return c
2190 }
2191
2192
2193
2194 func (c *CustomersConfigurationsListCall) Header() http.Header {
2195 if c.header_ == nil {
2196 c.header_ = make(http.Header)
2197 }
2198 return c.header_
2199 }
2200
2201 func (c *CustomersConfigurationsListCall) doRequest(alt string) (*http.Response, error) {
2202 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2203 if c.ifNoneMatch_ != "" {
2204 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2205 }
2206 var body io.Reader = nil
2207 c.urlParams_.Set("alt", alt)
2208 c.urlParams_.Set("prettyPrint", "false")
2209 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/configurations")
2210 urls += "?" + c.urlParams_.Encode()
2211 req, err := http.NewRequest("GET", urls, body)
2212 if err != nil {
2213 return nil, err
2214 }
2215 req.Header = reqHeaders
2216 googleapi.Expand(req.URL, map[string]string{
2217 "parent": c.parent,
2218 })
2219 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2220 }
2221
2222
2223
2224
2225
2226
2227
2228 func (c *CustomersConfigurationsListCall) Do(opts ...googleapi.CallOption) (*CustomerListConfigurationsResponse, error) {
2229 gensupport.SetOptions(c.urlParams_, opts...)
2230 res, err := c.doRequest("json")
2231 if res != nil && res.StatusCode == http.StatusNotModified {
2232 if res.Body != nil {
2233 res.Body.Close()
2234 }
2235 return nil, gensupport.WrapError(&googleapi.Error{
2236 Code: res.StatusCode,
2237 Header: res.Header,
2238 })
2239 }
2240 if err != nil {
2241 return nil, err
2242 }
2243 defer googleapi.CloseBody(res)
2244 if err := googleapi.CheckResponse(res); err != nil {
2245 return nil, gensupport.WrapError(err)
2246 }
2247 ret := &CustomerListConfigurationsResponse{
2248 ServerResponse: googleapi.ServerResponse{
2249 Header: res.Header,
2250 HTTPStatusCode: res.StatusCode,
2251 },
2252 }
2253 target := &ret
2254 if err := gensupport.DecodeResponse(target, res); err != nil {
2255 return nil, err
2256 }
2257 return ret, nil
2258 }
2259
2260 type CustomersConfigurationsPatchCall struct {
2261 s *Service
2262 name string
2263 configuration *Configuration
2264 urlParams_ gensupport.URLParams
2265 ctx_ context.Context
2266 header_ http.Header
2267 }
2268
2269
2270
2271
2272
2273
2274 func (r *CustomersConfigurationsService) Patch(name string, configuration *Configuration) *CustomersConfigurationsPatchCall {
2275 c := &CustomersConfigurationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2276 c.name = name
2277 c.configuration = configuration
2278 return c
2279 }
2280
2281
2282
2283
2284
2285
2286 func (c *CustomersConfigurationsPatchCall) UpdateMask(updateMask string) *CustomersConfigurationsPatchCall {
2287 c.urlParams_.Set("updateMask", updateMask)
2288 return c
2289 }
2290
2291
2292
2293
2294 func (c *CustomersConfigurationsPatchCall) Fields(s ...googleapi.Field) *CustomersConfigurationsPatchCall {
2295 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2296 return c
2297 }
2298
2299
2300 func (c *CustomersConfigurationsPatchCall) Context(ctx context.Context) *CustomersConfigurationsPatchCall {
2301 c.ctx_ = ctx
2302 return c
2303 }
2304
2305
2306
2307 func (c *CustomersConfigurationsPatchCall) Header() http.Header {
2308 if c.header_ == nil {
2309 c.header_ = make(http.Header)
2310 }
2311 return c.header_
2312 }
2313
2314 func (c *CustomersConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) {
2315 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2316 var body io.Reader = nil
2317 body, err := googleapi.WithoutDataWrapper.JSONReader(c.configuration)
2318 if err != nil {
2319 return nil, err
2320 }
2321 c.urlParams_.Set("alt", alt)
2322 c.urlParams_.Set("prettyPrint", "false")
2323 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2324 urls += "?" + c.urlParams_.Encode()
2325 req, err := http.NewRequest("PATCH", urls, body)
2326 if err != nil {
2327 return nil, err
2328 }
2329 req.Header = reqHeaders
2330 googleapi.Expand(req.URL, map[string]string{
2331 "name": c.name,
2332 })
2333 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2334 }
2335
2336
2337
2338
2339
2340
2341 func (c *CustomersConfigurationsPatchCall) Do(opts ...googleapi.CallOption) (*Configuration, error) {
2342 gensupport.SetOptions(c.urlParams_, opts...)
2343 res, err := c.doRequest("json")
2344 if res != nil && res.StatusCode == http.StatusNotModified {
2345 if res.Body != nil {
2346 res.Body.Close()
2347 }
2348 return nil, gensupport.WrapError(&googleapi.Error{
2349 Code: res.StatusCode,
2350 Header: res.Header,
2351 })
2352 }
2353 if err != nil {
2354 return nil, err
2355 }
2356 defer googleapi.CloseBody(res)
2357 if err := googleapi.CheckResponse(res); err != nil {
2358 return nil, gensupport.WrapError(err)
2359 }
2360 ret := &Configuration{
2361 ServerResponse: googleapi.ServerResponse{
2362 Header: res.Header,
2363 HTTPStatusCode: res.StatusCode,
2364 },
2365 }
2366 target := &ret
2367 if err := gensupport.DecodeResponse(target, res); err != nil {
2368 return nil, err
2369 }
2370 return ret, nil
2371 }
2372
2373 type CustomersDevicesApplyConfigurationCall struct {
2374 s *Service
2375 parent string
2376 customerapplyconfigurationrequest *CustomerApplyConfigurationRequest
2377 urlParams_ gensupport.URLParams
2378 ctx_ context.Context
2379 header_ http.Header
2380 }
2381
2382
2383
2384
2385
2386
2387
2388
2389 func (r *CustomersDevicesService) ApplyConfiguration(parent string, customerapplyconfigurationrequest *CustomerApplyConfigurationRequest) *CustomersDevicesApplyConfigurationCall {
2390 c := &CustomersDevicesApplyConfigurationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2391 c.parent = parent
2392 c.customerapplyconfigurationrequest = customerapplyconfigurationrequest
2393 return c
2394 }
2395
2396
2397
2398
2399 func (c *CustomersDevicesApplyConfigurationCall) Fields(s ...googleapi.Field) *CustomersDevicesApplyConfigurationCall {
2400 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2401 return c
2402 }
2403
2404
2405 func (c *CustomersDevicesApplyConfigurationCall) Context(ctx context.Context) *CustomersDevicesApplyConfigurationCall {
2406 c.ctx_ = ctx
2407 return c
2408 }
2409
2410
2411
2412 func (c *CustomersDevicesApplyConfigurationCall) Header() http.Header {
2413 if c.header_ == nil {
2414 c.header_ = make(http.Header)
2415 }
2416 return c.header_
2417 }
2418
2419 func (c *CustomersDevicesApplyConfigurationCall) doRequest(alt string) (*http.Response, error) {
2420 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2421 var body io.Reader = nil
2422 body, err := googleapi.WithoutDataWrapper.JSONReader(c.customerapplyconfigurationrequest)
2423 if err != nil {
2424 return nil, err
2425 }
2426 c.urlParams_.Set("alt", alt)
2427 c.urlParams_.Set("prettyPrint", "false")
2428 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/devices:applyConfiguration")
2429 urls += "?" + c.urlParams_.Encode()
2430 req, err := http.NewRequest("POST", urls, body)
2431 if err != nil {
2432 return nil, err
2433 }
2434 req.Header = reqHeaders
2435 googleapi.Expand(req.URL, map[string]string{
2436 "parent": c.parent,
2437 })
2438 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2439 }
2440
2441
2442
2443
2444
2445
2446 func (c *CustomersDevicesApplyConfigurationCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2447 gensupport.SetOptions(c.urlParams_, opts...)
2448 res, err := c.doRequest("json")
2449 if res != nil && res.StatusCode == http.StatusNotModified {
2450 if res.Body != nil {
2451 res.Body.Close()
2452 }
2453 return nil, gensupport.WrapError(&googleapi.Error{
2454 Code: res.StatusCode,
2455 Header: res.Header,
2456 })
2457 }
2458 if err != nil {
2459 return nil, err
2460 }
2461 defer googleapi.CloseBody(res)
2462 if err := googleapi.CheckResponse(res); err != nil {
2463 return nil, gensupport.WrapError(err)
2464 }
2465 ret := &Empty{
2466 ServerResponse: googleapi.ServerResponse{
2467 Header: res.Header,
2468 HTTPStatusCode: res.StatusCode,
2469 },
2470 }
2471 target := &ret
2472 if err := gensupport.DecodeResponse(target, res); err != nil {
2473 return nil, err
2474 }
2475 return ret, nil
2476 }
2477
2478 type CustomersDevicesGetCall struct {
2479 s *Service
2480 name string
2481 urlParams_ gensupport.URLParams
2482 ifNoneMatch_ string
2483 ctx_ context.Context
2484 header_ http.Header
2485 }
2486
2487
2488
2489
2490
2491 func (r *CustomersDevicesService) Get(name string) *CustomersDevicesGetCall {
2492 c := &CustomersDevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2493 c.name = name
2494 return c
2495 }
2496
2497
2498
2499
2500 func (c *CustomersDevicesGetCall) Fields(s ...googleapi.Field) *CustomersDevicesGetCall {
2501 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2502 return c
2503 }
2504
2505
2506
2507
2508 func (c *CustomersDevicesGetCall) IfNoneMatch(entityTag string) *CustomersDevicesGetCall {
2509 c.ifNoneMatch_ = entityTag
2510 return c
2511 }
2512
2513
2514 func (c *CustomersDevicesGetCall) Context(ctx context.Context) *CustomersDevicesGetCall {
2515 c.ctx_ = ctx
2516 return c
2517 }
2518
2519
2520
2521 func (c *CustomersDevicesGetCall) Header() http.Header {
2522 if c.header_ == nil {
2523 c.header_ = make(http.Header)
2524 }
2525 return c.header_
2526 }
2527
2528 func (c *CustomersDevicesGetCall) doRequest(alt string) (*http.Response, error) {
2529 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2530 if c.ifNoneMatch_ != "" {
2531 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2532 }
2533 var body io.Reader = nil
2534 c.urlParams_.Set("alt", alt)
2535 c.urlParams_.Set("prettyPrint", "false")
2536 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2537 urls += "?" + c.urlParams_.Encode()
2538 req, err := http.NewRequest("GET", urls, body)
2539 if err != nil {
2540 return nil, err
2541 }
2542 req.Header = reqHeaders
2543 googleapi.Expand(req.URL, map[string]string{
2544 "name": c.name,
2545 })
2546 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2547 }
2548
2549
2550
2551
2552
2553
2554 func (c *CustomersDevicesGetCall) Do(opts ...googleapi.CallOption) (*Device, error) {
2555 gensupport.SetOptions(c.urlParams_, opts...)
2556 res, err := c.doRequest("json")
2557 if res != nil && res.StatusCode == http.StatusNotModified {
2558 if res.Body != nil {
2559 res.Body.Close()
2560 }
2561 return nil, gensupport.WrapError(&googleapi.Error{
2562 Code: res.StatusCode,
2563 Header: res.Header,
2564 })
2565 }
2566 if err != nil {
2567 return nil, err
2568 }
2569 defer googleapi.CloseBody(res)
2570 if err := googleapi.CheckResponse(res); err != nil {
2571 return nil, gensupport.WrapError(err)
2572 }
2573 ret := &Device{
2574 ServerResponse: googleapi.ServerResponse{
2575 Header: res.Header,
2576 HTTPStatusCode: res.StatusCode,
2577 },
2578 }
2579 target := &ret
2580 if err := gensupport.DecodeResponse(target, res); err != nil {
2581 return nil, err
2582 }
2583 return ret, nil
2584 }
2585
2586 type CustomersDevicesListCall struct {
2587 s *Service
2588 parent string
2589 urlParams_ gensupport.URLParams
2590 ifNoneMatch_ string
2591 ctx_ context.Context
2592 header_ http.Header
2593 }
2594
2595
2596
2597
2598
2599 func (r *CustomersDevicesService) List(parent string) *CustomersDevicesListCall {
2600 c := &CustomersDevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2601 c.parent = parent
2602 return c
2603 }
2604
2605
2606
2607 func (c *CustomersDevicesListCall) PageSize(pageSize int64) *CustomersDevicesListCall {
2608 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2609 return c
2610 }
2611
2612
2613
2614 func (c *CustomersDevicesListCall) PageToken(pageToken string) *CustomersDevicesListCall {
2615 c.urlParams_.Set("pageToken", pageToken)
2616 return c
2617 }
2618
2619
2620
2621
2622 func (c *CustomersDevicesListCall) Fields(s ...googleapi.Field) *CustomersDevicesListCall {
2623 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2624 return c
2625 }
2626
2627
2628
2629
2630 func (c *CustomersDevicesListCall) IfNoneMatch(entityTag string) *CustomersDevicesListCall {
2631 c.ifNoneMatch_ = entityTag
2632 return c
2633 }
2634
2635
2636 func (c *CustomersDevicesListCall) Context(ctx context.Context) *CustomersDevicesListCall {
2637 c.ctx_ = ctx
2638 return c
2639 }
2640
2641
2642
2643 func (c *CustomersDevicesListCall) Header() http.Header {
2644 if c.header_ == nil {
2645 c.header_ = make(http.Header)
2646 }
2647 return c.header_
2648 }
2649
2650 func (c *CustomersDevicesListCall) doRequest(alt string) (*http.Response, error) {
2651 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2652 if c.ifNoneMatch_ != "" {
2653 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2654 }
2655 var body io.Reader = nil
2656 c.urlParams_.Set("alt", alt)
2657 c.urlParams_.Set("prettyPrint", "false")
2658 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/devices")
2659 urls += "?" + c.urlParams_.Encode()
2660 req, err := http.NewRequest("GET", urls, body)
2661 if err != nil {
2662 return nil, err
2663 }
2664 req.Header = reqHeaders
2665 googleapi.Expand(req.URL, map[string]string{
2666 "parent": c.parent,
2667 })
2668 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2669 }
2670
2671
2672
2673
2674
2675
2676
2677 func (c *CustomersDevicesListCall) Do(opts ...googleapi.CallOption) (*CustomerListDevicesResponse, error) {
2678 gensupport.SetOptions(c.urlParams_, opts...)
2679 res, err := c.doRequest("json")
2680 if res != nil && res.StatusCode == http.StatusNotModified {
2681 if res.Body != nil {
2682 res.Body.Close()
2683 }
2684 return nil, gensupport.WrapError(&googleapi.Error{
2685 Code: res.StatusCode,
2686 Header: res.Header,
2687 })
2688 }
2689 if err != nil {
2690 return nil, err
2691 }
2692 defer googleapi.CloseBody(res)
2693 if err := googleapi.CheckResponse(res); err != nil {
2694 return nil, gensupport.WrapError(err)
2695 }
2696 ret := &CustomerListDevicesResponse{
2697 ServerResponse: googleapi.ServerResponse{
2698 Header: res.Header,
2699 HTTPStatusCode: res.StatusCode,
2700 },
2701 }
2702 target := &ret
2703 if err := gensupport.DecodeResponse(target, res); err != nil {
2704 return nil, err
2705 }
2706 return ret, nil
2707 }
2708
2709
2710
2711
2712 func (c *CustomersDevicesListCall) Pages(ctx context.Context, f func(*CustomerListDevicesResponse) error) error {
2713 c.ctx_ = ctx
2714 defer c.PageToken(c.urlParams_.Get("pageToken"))
2715 for {
2716 x, err := c.Do()
2717 if err != nil {
2718 return err
2719 }
2720 if err := f(x); err != nil {
2721 return err
2722 }
2723 if x.NextPageToken == "" {
2724 return nil
2725 }
2726 c.PageToken(x.NextPageToken)
2727 }
2728 }
2729
2730 type CustomersDevicesRemoveConfigurationCall struct {
2731 s *Service
2732 parent string
2733 customerremoveconfigurationrequest *CustomerRemoveConfigurationRequest
2734 urlParams_ gensupport.URLParams
2735 ctx_ context.Context
2736 header_ http.Header
2737 }
2738
2739
2740
2741
2742
2743 func (r *CustomersDevicesService) RemoveConfiguration(parent string, customerremoveconfigurationrequest *CustomerRemoveConfigurationRequest) *CustomersDevicesRemoveConfigurationCall {
2744 c := &CustomersDevicesRemoveConfigurationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2745 c.parent = parent
2746 c.customerremoveconfigurationrequest = customerremoveconfigurationrequest
2747 return c
2748 }
2749
2750
2751
2752
2753 func (c *CustomersDevicesRemoveConfigurationCall) Fields(s ...googleapi.Field) *CustomersDevicesRemoveConfigurationCall {
2754 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2755 return c
2756 }
2757
2758
2759 func (c *CustomersDevicesRemoveConfigurationCall) Context(ctx context.Context) *CustomersDevicesRemoveConfigurationCall {
2760 c.ctx_ = ctx
2761 return c
2762 }
2763
2764
2765
2766 func (c *CustomersDevicesRemoveConfigurationCall) Header() http.Header {
2767 if c.header_ == nil {
2768 c.header_ = make(http.Header)
2769 }
2770 return c.header_
2771 }
2772
2773 func (c *CustomersDevicesRemoveConfigurationCall) doRequest(alt string) (*http.Response, error) {
2774 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2775 var body io.Reader = nil
2776 body, err := googleapi.WithoutDataWrapper.JSONReader(c.customerremoveconfigurationrequest)
2777 if err != nil {
2778 return nil, err
2779 }
2780 c.urlParams_.Set("alt", alt)
2781 c.urlParams_.Set("prettyPrint", "false")
2782 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/devices:removeConfiguration")
2783 urls += "?" + c.urlParams_.Encode()
2784 req, err := http.NewRequest("POST", urls, body)
2785 if err != nil {
2786 return nil, err
2787 }
2788 req.Header = reqHeaders
2789 googleapi.Expand(req.URL, map[string]string{
2790 "parent": c.parent,
2791 })
2792 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2793 }
2794
2795
2796
2797
2798
2799
2800 func (c *CustomersDevicesRemoveConfigurationCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2801 gensupport.SetOptions(c.urlParams_, opts...)
2802 res, err := c.doRequest("json")
2803 if res != nil && res.StatusCode == http.StatusNotModified {
2804 if res.Body != nil {
2805 res.Body.Close()
2806 }
2807 return nil, gensupport.WrapError(&googleapi.Error{
2808 Code: res.StatusCode,
2809 Header: res.Header,
2810 })
2811 }
2812 if err != nil {
2813 return nil, err
2814 }
2815 defer googleapi.CloseBody(res)
2816 if err := googleapi.CheckResponse(res); err != nil {
2817 return nil, gensupport.WrapError(err)
2818 }
2819 ret := &Empty{
2820 ServerResponse: googleapi.ServerResponse{
2821 Header: res.Header,
2822 HTTPStatusCode: res.StatusCode,
2823 },
2824 }
2825 target := &ret
2826 if err := gensupport.DecodeResponse(target, res); err != nil {
2827 return nil, err
2828 }
2829 return ret, nil
2830 }
2831
2832 type CustomersDevicesUnclaimCall struct {
2833 s *Service
2834 parent string
2835 customerunclaimdevicerequest *CustomerUnclaimDeviceRequest
2836 urlParams_ gensupport.URLParams
2837 ctx_ context.Context
2838 header_ http.Header
2839 }
2840
2841
2842
2843
2844
2845
2846
2847 func (r *CustomersDevicesService) Unclaim(parent string, customerunclaimdevicerequest *CustomerUnclaimDeviceRequest) *CustomersDevicesUnclaimCall {
2848 c := &CustomersDevicesUnclaimCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2849 c.parent = parent
2850 c.customerunclaimdevicerequest = customerunclaimdevicerequest
2851 return c
2852 }
2853
2854
2855
2856
2857 func (c *CustomersDevicesUnclaimCall) Fields(s ...googleapi.Field) *CustomersDevicesUnclaimCall {
2858 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2859 return c
2860 }
2861
2862
2863 func (c *CustomersDevicesUnclaimCall) Context(ctx context.Context) *CustomersDevicesUnclaimCall {
2864 c.ctx_ = ctx
2865 return c
2866 }
2867
2868
2869
2870 func (c *CustomersDevicesUnclaimCall) Header() http.Header {
2871 if c.header_ == nil {
2872 c.header_ = make(http.Header)
2873 }
2874 return c.header_
2875 }
2876
2877 func (c *CustomersDevicesUnclaimCall) doRequest(alt string) (*http.Response, error) {
2878 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2879 var body io.Reader = nil
2880 body, err := googleapi.WithoutDataWrapper.JSONReader(c.customerunclaimdevicerequest)
2881 if err != nil {
2882 return nil, err
2883 }
2884 c.urlParams_.Set("alt", alt)
2885 c.urlParams_.Set("prettyPrint", "false")
2886 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/devices:unclaim")
2887 urls += "?" + c.urlParams_.Encode()
2888 req, err := http.NewRequest("POST", urls, body)
2889 if err != nil {
2890 return nil, err
2891 }
2892 req.Header = reqHeaders
2893 googleapi.Expand(req.URL, map[string]string{
2894 "parent": c.parent,
2895 })
2896 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2897 }
2898
2899
2900
2901
2902
2903
2904 func (c *CustomersDevicesUnclaimCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2905 gensupport.SetOptions(c.urlParams_, opts...)
2906 res, err := c.doRequest("json")
2907 if res != nil && res.StatusCode == http.StatusNotModified {
2908 if res.Body != nil {
2909 res.Body.Close()
2910 }
2911 return nil, gensupport.WrapError(&googleapi.Error{
2912 Code: res.StatusCode,
2913 Header: res.Header,
2914 })
2915 }
2916 if err != nil {
2917 return nil, err
2918 }
2919 defer googleapi.CloseBody(res)
2920 if err := googleapi.CheckResponse(res); err != nil {
2921 return nil, gensupport.WrapError(err)
2922 }
2923 ret := &Empty{
2924 ServerResponse: googleapi.ServerResponse{
2925 Header: res.Header,
2926 HTTPStatusCode: res.StatusCode,
2927 },
2928 }
2929 target := &ret
2930 if err := gensupport.DecodeResponse(target, res); err != nil {
2931 return nil, err
2932 }
2933 return ret, nil
2934 }
2935
2936 type CustomersDpcsListCall struct {
2937 s *Service
2938 parent string
2939 urlParams_ gensupport.URLParams
2940 ifNoneMatch_ string
2941 ctx_ context.Context
2942 header_ http.Header
2943 }
2944
2945
2946
2947
2948
2949
2950 func (r *CustomersDpcsService) List(parent string) *CustomersDpcsListCall {
2951 c := &CustomersDpcsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2952 c.parent = parent
2953 return c
2954 }
2955
2956
2957
2958
2959 func (c *CustomersDpcsListCall) Fields(s ...googleapi.Field) *CustomersDpcsListCall {
2960 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2961 return c
2962 }
2963
2964
2965
2966
2967 func (c *CustomersDpcsListCall) IfNoneMatch(entityTag string) *CustomersDpcsListCall {
2968 c.ifNoneMatch_ = entityTag
2969 return c
2970 }
2971
2972
2973 func (c *CustomersDpcsListCall) Context(ctx context.Context) *CustomersDpcsListCall {
2974 c.ctx_ = ctx
2975 return c
2976 }
2977
2978
2979
2980 func (c *CustomersDpcsListCall) Header() http.Header {
2981 if c.header_ == nil {
2982 c.header_ = make(http.Header)
2983 }
2984 return c.header_
2985 }
2986
2987 func (c *CustomersDpcsListCall) doRequest(alt string) (*http.Response, error) {
2988 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2989 if c.ifNoneMatch_ != "" {
2990 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2991 }
2992 var body io.Reader = nil
2993 c.urlParams_.Set("alt", alt)
2994 c.urlParams_.Set("prettyPrint", "false")
2995 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/dpcs")
2996 urls += "?" + c.urlParams_.Encode()
2997 req, err := http.NewRequest("GET", urls, body)
2998 if err != nil {
2999 return nil, err
3000 }
3001 req.Header = reqHeaders
3002 googleapi.Expand(req.URL, map[string]string{
3003 "parent": c.parent,
3004 })
3005 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3006 }
3007
3008
3009
3010
3011
3012
3013
3014 func (c *CustomersDpcsListCall) Do(opts ...googleapi.CallOption) (*CustomerListDpcsResponse, error) {
3015 gensupport.SetOptions(c.urlParams_, opts...)
3016 res, err := c.doRequest("json")
3017 if res != nil && res.StatusCode == http.StatusNotModified {
3018 if res.Body != nil {
3019 res.Body.Close()
3020 }
3021 return nil, gensupport.WrapError(&googleapi.Error{
3022 Code: res.StatusCode,
3023 Header: res.Header,
3024 })
3025 }
3026 if err != nil {
3027 return nil, err
3028 }
3029 defer googleapi.CloseBody(res)
3030 if err := googleapi.CheckResponse(res); err != nil {
3031 return nil, gensupport.WrapError(err)
3032 }
3033 ret := &CustomerListDpcsResponse{
3034 ServerResponse: googleapi.ServerResponse{
3035 Header: res.Header,
3036 HTTPStatusCode: res.StatusCode,
3037 },
3038 }
3039 target := &ret
3040 if err := gensupport.DecodeResponse(target, res); err != nil {
3041 return nil, err
3042 }
3043 return ret, nil
3044 }
3045
3046 type OperationsGetCall struct {
3047 s *Service
3048 name string
3049 urlParams_ gensupport.URLParams
3050 ifNoneMatch_ string
3051 ctx_ context.Context
3052 header_ http.Header
3053 }
3054
3055
3056
3057
3058
3059
3060 func (r *OperationsService) Get(name string) *OperationsGetCall {
3061 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3062 c.name = name
3063 return c
3064 }
3065
3066
3067
3068
3069 func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
3070 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3071 return c
3072 }
3073
3074
3075
3076
3077 func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
3078 c.ifNoneMatch_ = entityTag
3079 return c
3080 }
3081
3082
3083 func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
3084 c.ctx_ = ctx
3085 return c
3086 }
3087
3088
3089
3090 func (c *OperationsGetCall) Header() http.Header {
3091 if c.header_ == nil {
3092 c.header_ = make(http.Header)
3093 }
3094 return c.header_
3095 }
3096
3097 func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
3098 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3099 if c.ifNoneMatch_ != "" {
3100 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3101 }
3102 var body io.Reader = nil
3103 c.urlParams_.Set("alt", alt)
3104 c.urlParams_.Set("prettyPrint", "false")
3105 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3106 urls += "?" + c.urlParams_.Encode()
3107 req, err := http.NewRequest("GET", urls, body)
3108 if err != nil {
3109 return nil, err
3110 }
3111 req.Header = reqHeaders
3112 googleapi.Expand(req.URL, map[string]string{
3113 "name": c.name,
3114 })
3115 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3116 }
3117
3118
3119
3120
3121
3122
3123 func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3124 gensupport.SetOptions(c.urlParams_, opts...)
3125 res, err := c.doRequest("json")
3126 if res != nil && res.StatusCode == http.StatusNotModified {
3127 if res.Body != nil {
3128 res.Body.Close()
3129 }
3130 return nil, gensupport.WrapError(&googleapi.Error{
3131 Code: res.StatusCode,
3132 Header: res.Header,
3133 })
3134 }
3135 if err != nil {
3136 return nil, err
3137 }
3138 defer googleapi.CloseBody(res)
3139 if err := googleapi.CheckResponse(res); err != nil {
3140 return nil, gensupport.WrapError(err)
3141 }
3142 ret := &Operation{
3143 ServerResponse: googleapi.ServerResponse{
3144 Header: res.Header,
3145 HTTPStatusCode: res.StatusCode,
3146 },
3147 }
3148 target := &ret
3149 if err := gensupport.DecodeResponse(target, res); err != nil {
3150 return nil, err
3151 }
3152 return ret, nil
3153 }
3154
3155 type PartnersCustomersCreateCall struct {
3156 s *Service
3157 parent string
3158 createcustomerrequest *CreateCustomerRequest
3159 urlParams_ gensupport.URLParams
3160 ctx_ context.Context
3161 header_ http.Header
3162 }
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172 func (r *PartnersCustomersService) Create(parent string, createcustomerrequest *CreateCustomerRequest) *PartnersCustomersCreateCall {
3173 c := &PartnersCustomersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3174 c.parent = parent
3175 c.createcustomerrequest = createcustomerrequest
3176 return c
3177 }
3178
3179
3180
3181
3182 func (c *PartnersCustomersCreateCall) Fields(s ...googleapi.Field) *PartnersCustomersCreateCall {
3183 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3184 return c
3185 }
3186
3187
3188 func (c *PartnersCustomersCreateCall) Context(ctx context.Context) *PartnersCustomersCreateCall {
3189 c.ctx_ = ctx
3190 return c
3191 }
3192
3193
3194
3195 func (c *PartnersCustomersCreateCall) Header() http.Header {
3196 if c.header_ == nil {
3197 c.header_ = make(http.Header)
3198 }
3199 return c.header_
3200 }
3201
3202 func (c *PartnersCustomersCreateCall) doRequest(alt string) (*http.Response, error) {
3203 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3204 var body io.Reader = nil
3205 body, err := googleapi.WithoutDataWrapper.JSONReader(c.createcustomerrequest)
3206 if err != nil {
3207 return nil, err
3208 }
3209 c.urlParams_.Set("alt", alt)
3210 c.urlParams_.Set("prettyPrint", "false")
3211 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customers")
3212 urls += "?" + c.urlParams_.Encode()
3213 req, err := http.NewRequest("POST", urls, body)
3214 if err != nil {
3215 return nil, err
3216 }
3217 req.Header = reqHeaders
3218 googleapi.Expand(req.URL, map[string]string{
3219 "parent": c.parent,
3220 })
3221 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3222 }
3223
3224
3225
3226
3227
3228
3229 func (c *PartnersCustomersCreateCall) Do(opts ...googleapi.CallOption) (*Company, error) {
3230 gensupport.SetOptions(c.urlParams_, opts...)
3231 res, err := c.doRequest("json")
3232 if res != nil && res.StatusCode == http.StatusNotModified {
3233 if res.Body != nil {
3234 res.Body.Close()
3235 }
3236 return nil, gensupport.WrapError(&googleapi.Error{
3237 Code: res.StatusCode,
3238 Header: res.Header,
3239 })
3240 }
3241 if err != nil {
3242 return nil, err
3243 }
3244 defer googleapi.CloseBody(res)
3245 if err := googleapi.CheckResponse(res); err != nil {
3246 return nil, gensupport.WrapError(err)
3247 }
3248 ret := &Company{
3249 ServerResponse: googleapi.ServerResponse{
3250 Header: res.Header,
3251 HTTPStatusCode: res.StatusCode,
3252 },
3253 }
3254 target := &ret
3255 if err := gensupport.DecodeResponse(target, res); err != nil {
3256 return nil, err
3257 }
3258 return ret, nil
3259 }
3260
3261 type PartnersCustomersListCall struct {
3262 s *Service
3263 partnerId int64
3264 urlParams_ gensupport.URLParams
3265 ifNoneMatch_ string
3266 ctx_ context.Context
3267 header_ http.Header
3268 }
3269
3270
3271
3272
3273
3274
3275 func (r *PartnersCustomersService) List(partnerId int64) *PartnersCustomersListCall {
3276 c := &PartnersCustomersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3277 c.partnerId = partnerId
3278 return c
3279 }
3280
3281
3282
3283 func (c *PartnersCustomersListCall) PageSize(pageSize int64) *PartnersCustomersListCall {
3284 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3285 return c
3286 }
3287
3288
3289
3290 func (c *PartnersCustomersListCall) PageToken(pageToken string) *PartnersCustomersListCall {
3291 c.urlParams_.Set("pageToken", pageToken)
3292 return c
3293 }
3294
3295
3296
3297
3298 func (c *PartnersCustomersListCall) Fields(s ...googleapi.Field) *PartnersCustomersListCall {
3299 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3300 return c
3301 }
3302
3303
3304
3305
3306 func (c *PartnersCustomersListCall) IfNoneMatch(entityTag string) *PartnersCustomersListCall {
3307 c.ifNoneMatch_ = entityTag
3308 return c
3309 }
3310
3311
3312 func (c *PartnersCustomersListCall) Context(ctx context.Context) *PartnersCustomersListCall {
3313 c.ctx_ = ctx
3314 return c
3315 }
3316
3317
3318
3319 func (c *PartnersCustomersListCall) Header() http.Header {
3320 if c.header_ == nil {
3321 c.header_ = make(http.Header)
3322 }
3323 return c.header_
3324 }
3325
3326 func (c *PartnersCustomersListCall) doRequest(alt string) (*http.Response, error) {
3327 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3328 if c.ifNoneMatch_ != "" {
3329 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3330 }
3331 var body io.Reader = nil
3332 c.urlParams_.Set("alt", alt)
3333 c.urlParams_.Set("prettyPrint", "false")
3334 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/customers")
3335 urls += "?" + c.urlParams_.Encode()
3336 req, err := http.NewRequest("GET", urls, body)
3337 if err != nil {
3338 return nil, err
3339 }
3340 req.Header = reqHeaders
3341 googleapi.Expand(req.URL, map[string]string{
3342 "partnerId": strconv.FormatInt(c.partnerId, 10),
3343 })
3344 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3345 }
3346
3347
3348
3349
3350
3351
3352
3353 func (c *PartnersCustomersListCall) Do(opts ...googleapi.CallOption) (*ListCustomersResponse, error) {
3354 gensupport.SetOptions(c.urlParams_, opts...)
3355 res, err := c.doRequest("json")
3356 if res != nil && res.StatusCode == http.StatusNotModified {
3357 if res.Body != nil {
3358 res.Body.Close()
3359 }
3360 return nil, gensupport.WrapError(&googleapi.Error{
3361 Code: res.StatusCode,
3362 Header: res.Header,
3363 })
3364 }
3365 if err != nil {
3366 return nil, err
3367 }
3368 defer googleapi.CloseBody(res)
3369 if err := googleapi.CheckResponse(res); err != nil {
3370 return nil, gensupport.WrapError(err)
3371 }
3372 ret := &ListCustomersResponse{
3373 ServerResponse: googleapi.ServerResponse{
3374 Header: res.Header,
3375 HTTPStatusCode: res.StatusCode,
3376 },
3377 }
3378 target := &ret
3379 if err := gensupport.DecodeResponse(target, res); err != nil {
3380 return nil, err
3381 }
3382 return ret, nil
3383 }
3384
3385
3386
3387
3388 func (c *PartnersCustomersListCall) Pages(ctx context.Context, f func(*ListCustomersResponse) error) error {
3389 c.ctx_ = ctx
3390 defer c.PageToken(c.urlParams_.Get("pageToken"))
3391 for {
3392 x, err := c.Do()
3393 if err != nil {
3394 return err
3395 }
3396 if err := f(x); err != nil {
3397 return err
3398 }
3399 if x.NextPageToken == "" {
3400 return nil
3401 }
3402 c.PageToken(x.NextPageToken)
3403 }
3404 }
3405
3406 type PartnersDevicesClaimCall struct {
3407 s *Service
3408 partnerId int64
3409 claimdevicerequest *ClaimDeviceRequest
3410 urlParams_ gensupport.URLParams
3411 ctx_ context.Context
3412 header_ http.Header
3413 }
3414
3415
3416
3417
3418
3419
3420 func (r *PartnersDevicesService) Claim(partnerId int64, claimdevicerequest *ClaimDeviceRequest) *PartnersDevicesClaimCall {
3421 c := &PartnersDevicesClaimCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3422 c.partnerId = partnerId
3423 c.claimdevicerequest = claimdevicerequest
3424 return c
3425 }
3426
3427
3428
3429
3430 func (c *PartnersDevicesClaimCall) Fields(s ...googleapi.Field) *PartnersDevicesClaimCall {
3431 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3432 return c
3433 }
3434
3435
3436 func (c *PartnersDevicesClaimCall) Context(ctx context.Context) *PartnersDevicesClaimCall {
3437 c.ctx_ = ctx
3438 return c
3439 }
3440
3441
3442
3443 func (c *PartnersDevicesClaimCall) Header() http.Header {
3444 if c.header_ == nil {
3445 c.header_ = make(http.Header)
3446 }
3447 return c.header_
3448 }
3449
3450 func (c *PartnersDevicesClaimCall) doRequest(alt string) (*http.Response, error) {
3451 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3452 var body io.Reader = nil
3453 body, err := googleapi.WithoutDataWrapper.JSONReader(c.claimdevicerequest)
3454 if err != nil {
3455 return nil, err
3456 }
3457 c.urlParams_.Set("alt", alt)
3458 c.urlParams_.Set("prettyPrint", "false")
3459 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/devices:claim")
3460 urls += "?" + c.urlParams_.Encode()
3461 req, err := http.NewRequest("POST", urls, body)
3462 if err != nil {
3463 return nil, err
3464 }
3465 req.Header = reqHeaders
3466 googleapi.Expand(req.URL, map[string]string{
3467 "partnerId": strconv.FormatInt(c.partnerId, 10),
3468 })
3469 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3470 }
3471
3472
3473
3474
3475
3476
3477
3478 func (c *PartnersDevicesClaimCall) Do(opts ...googleapi.CallOption) (*ClaimDeviceResponse, error) {
3479 gensupport.SetOptions(c.urlParams_, opts...)
3480 res, err := c.doRequest("json")
3481 if res != nil && res.StatusCode == http.StatusNotModified {
3482 if res.Body != nil {
3483 res.Body.Close()
3484 }
3485 return nil, gensupport.WrapError(&googleapi.Error{
3486 Code: res.StatusCode,
3487 Header: res.Header,
3488 })
3489 }
3490 if err != nil {
3491 return nil, err
3492 }
3493 defer googleapi.CloseBody(res)
3494 if err := googleapi.CheckResponse(res); err != nil {
3495 return nil, gensupport.WrapError(err)
3496 }
3497 ret := &ClaimDeviceResponse{
3498 ServerResponse: googleapi.ServerResponse{
3499 Header: res.Header,
3500 HTTPStatusCode: res.StatusCode,
3501 },
3502 }
3503 target := &ret
3504 if err := gensupport.DecodeResponse(target, res); err != nil {
3505 return nil, err
3506 }
3507 return ret, nil
3508 }
3509
3510 type PartnersDevicesClaimAsyncCall struct {
3511 s *Service
3512 partnerId int64
3513 claimdevicesrequest *ClaimDevicesRequest
3514 urlParams_ gensupport.URLParams
3515 ctx_ context.Context
3516 header_ http.Header
3517 }
3518
3519
3520
3521
3522
3523
3524 func (r *PartnersDevicesService) ClaimAsync(partnerId int64, claimdevicesrequest *ClaimDevicesRequest) *PartnersDevicesClaimAsyncCall {
3525 c := &PartnersDevicesClaimAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3526 c.partnerId = partnerId
3527 c.claimdevicesrequest = claimdevicesrequest
3528 return c
3529 }
3530
3531
3532
3533
3534 func (c *PartnersDevicesClaimAsyncCall) Fields(s ...googleapi.Field) *PartnersDevicesClaimAsyncCall {
3535 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3536 return c
3537 }
3538
3539
3540 func (c *PartnersDevicesClaimAsyncCall) Context(ctx context.Context) *PartnersDevicesClaimAsyncCall {
3541 c.ctx_ = ctx
3542 return c
3543 }
3544
3545
3546
3547 func (c *PartnersDevicesClaimAsyncCall) Header() http.Header {
3548 if c.header_ == nil {
3549 c.header_ = make(http.Header)
3550 }
3551 return c.header_
3552 }
3553
3554 func (c *PartnersDevicesClaimAsyncCall) doRequest(alt string) (*http.Response, error) {
3555 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3556 var body io.Reader = nil
3557 body, err := googleapi.WithoutDataWrapper.JSONReader(c.claimdevicesrequest)
3558 if err != nil {
3559 return nil, err
3560 }
3561 c.urlParams_.Set("alt", alt)
3562 c.urlParams_.Set("prettyPrint", "false")
3563 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/devices:claimAsync")
3564 urls += "?" + c.urlParams_.Encode()
3565 req, err := http.NewRequest("POST", urls, body)
3566 if err != nil {
3567 return nil, err
3568 }
3569 req.Header = reqHeaders
3570 googleapi.Expand(req.URL, map[string]string{
3571 "partnerId": strconv.FormatInt(c.partnerId, 10),
3572 })
3573 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3574 }
3575
3576
3577
3578
3579
3580
3581 func (c *PartnersDevicesClaimAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3582 gensupport.SetOptions(c.urlParams_, opts...)
3583 res, err := c.doRequest("json")
3584 if res != nil && res.StatusCode == http.StatusNotModified {
3585 if res.Body != nil {
3586 res.Body.Close()
3587 }
3588 return nil, gensupport.WrapError(&googleapi.Error{
3589 Code: res.StatusCode,
3590 Header: res.Header,
3591 })
3592 }
3593 if err != nil {
3594 return nil, err
3595 }
3596 defer googleapi.CloseBody(res)
3597 if err := googleapi.CheckResponse(res); err != nil {
3598 return nil, gensupport.WrapError(err)
3599 }
3600 ret := &Operation{
3601 ServerResponse: googleapi.ServerResponse{
3602 Header: res.Header,
3603 HTTPStatusCode: res.StatusCode,
3604 },
3605 }
3606 target := &ret
3607 if err := gensupport.DecodeResponse(target, res); err != nil {
3608 return nil, err
3609 }
3610 return ret, nil
3611 }
3612
3613 type PartnersDevicesFindByIdentifierCall struct {
3614 s *Service
3615 partnerId int64
3616 finddevicesbydeviceidentifierrequest *FindDevicesByDeviceIdentifierRequest
3617 urlParams_ gensupport.URLParams
3618 ctx_ context.Context
3619 header_ http.Header
3620 }
3621
3622
3623
3624
3625 func (r *PartnersDevicesService) FindByIdentifier(partnerId int64, finddevicesbydeviceidentifierrequest *FindDevicesByDeviceIdentifierRequest) *PartnersDevicesFindByIdentifierCall {
3626 c := &PartnersDevicesFindByIdentifierCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3627 c.partnerId = partnerId
3628 c.finddevicesbydeviceidentifierrequest = finddevicesbydeviceidentifierrequest
3629 return c
3630 }
3631
3632
3633
3634
3635 func (c *PartnersDevicesFindByIdentifierCall) Fields(s ...googleapi.Field) *PartnersDevicesFindByIdentifierCall {
3636 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3637 return c
3638 }
3639
3640
3641 func (c *PartnersDevicesFindByIdentifierCall) Context(ctx context.Context) *PartnersDevicesFindByIdentifierCall {
3642 c.ctx_ = ctx
3643 return c
3644 }
3645
3646
3647
3648 func (c *PartnersDevicesFindByIdentifierCall) Header() http.Header {
3649 if c.header_ == nil {
3650 c.header_ = make(http.Header)
3651 }
3652 return c.header_
3653 }
3654
3655 func (c *PartnersDevicesFindByIdentifierCall) doRequest(alt string) (*http.Response, error) {
3656 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3657 var body io.Reader = nil
3658 body, err := googleapi.WithoutDataWrapper.JSONReader(c.finddevicesbydeviceidentifierrequest)
3659 if err != nil {
3660 return nil, err
3661 }
3662 c.urlParams_.Set("alt", alt)
3663 c.urlParams_.Set("prettyPrint", "false")
3664 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/devices:findByIdentifier")
3665 urls += "?" + c.urlParams_.Encode()
3666 req, err := http.NewRequest("POST", urls, body)
3667 if err != nil {
3668 return nil, err
3669 }
3670 req.Header = reqHeaders
3671 googleapi.Expand(req.URL, map[string]string{
3672 "partnerId": strconv.FormatInt(c.partnerId, 10),
3673 })
3674 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3675 }
3676
3677
3678
3679
3680
3681
3682
3683 func (c *PartnersDevicesFindByIdentifierCall) Do(opts ...googleapi.CallOption) (*FindDevicesByDeviceIdentifierResponse, error) {
3684 gensupport.SetOptions(c.urlParams_, opts...)
3685 res, err := c.doRequest("json")
3686 if res != nil && res.StatusCode == http.StatusNotModified {
3687 if res.Body != nil {
3688 res.Body.Close()
3689 }
3690 return nil, gensupport.WrapError(&googleapi.Error{
3691 Code: res.StatusCode,
3692 Header: res.Header,
3693 })
3694 }
3695 if err != nil {
3696 return nil, err
3697 }
3698 defer googleapi.CloseBody(res)
3699 if err := googleapi.CheckResponse(res); err != nil {
3700 return nil, gensupport.WrapError(err)
3701 }
3702 ret := &FindDevicesByDeviceIdentifierResponse{
3703 ServerResponse: googleapi.ServerResponse{
3704 Header: res.Header,
3705 HTTPStatusCode: res.StatusCode,
3706 },
3707 }
3708 target := &ret
3709 if err := gensupport.DecodeResponse(target, res); err != nil {
3710 return nil, err
3711 }
3712 return ret, nil
3713 }
3714
3715
3716
3717
3718 func (c *PartnersDevicesFindByIdentifierCall) Pages(ctx context.Context, f func(*FindDevicesByDeviceIdentifierResponse) error) error {
3719 c.ctx_ = ctx
3720 defer func(pt string) { c.finddevicesbydeviceidentifierrequest.PageToken = pt }(c.finddevicesbydeviceidentifierrequest.PageToken)
3721 for {
3722 x, err := c.Do()
3723 if err != nil {
3724 return err
3725 }
3726 if err := f(x); err != nil {
3727 return err
3728 }
3729 if x.NextPageToken == "" {
3730 return nil
3731 }
3732 c.finddevicesbydeviceidentifierrequest.PageToken = x.NextPageToken
3733 }
3734 }
3735
3736 type PartnersDevicesFindByOwnerCall struct {
3737 s *Service
3738 partnerId int64
3739 finddevicesbyownerrequest *FindDevicesByOwnerRequest
3740 urlParams_ gensupport.URLParams
3741 ctx_ context.Context
3742 header_ http.Header
3743 }
3744
3745
3746
3747
3748
3749
3750
3751 func (r *PartnersDevicesService) FindByOwner(partnerId int64, finddevicesbyownerrequest *FindDevicesByOwnerRequest) *PartnersDevicesFindByOwnerCall {
3752 c := &PartnersDevicesFindByOwnerCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3753 c.partnerId = partnerId
3754 c.finddevicesbyownerrequest = finddevicesbyownerrequest
3755 return c
3756 }
3757
3758
3759
3760
3761 func (c *PartnersDevicesFindByOwnerCall) Fields(s ...googleapi.Field) *PartnersDevicesFindByOwnerCall {
3762 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3763 return c
3764 }
3765
3766
3767 func (c *PartnersDevicesFindByOwnerCall) Context(ctx context.Context) *PartnersDevicesFindByOwnerCall {
3768 c.ctx_ = ctx
3769 return c
3770 }
3771
3772
3773
3774 func (c *PartnersDevicesFindByOwnerCall) Header() http.Header {
3775 if c.header_ == nil {
3776 c.header_ = make(http.Header)
3777 }
3778 return c.header_
3779 }
3780
3781 func (c *PartnersDevicesFindByOwnerCall) doRequest(alt string) (*http.Response, error) {
3782 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3783 var body io.Reader = nil
3784 body, err := googleapi.WithoutDataWrapper.JSONReader(c.finddevicesbyownerrequest)
3785 if err != nil {
3786 return nil, err
3787 }
3788 c.urlParams_.Set("alt", alt)
3789 c.urlParams_.Set("prettyPrint", "false")
3790 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/devices:findByOwner")
3791 urls += "?" + c.urlParams_.Encode()
3792 req, err := http.NewRequest("POST", urls, body)
3793 if err != nil {
3794 return nil, err
3795 }
3796 req.Header = reqHeaders
3797 googleapi.Expand(req.URL, map[string]string{
3798 "partnerId": strconv.FormatInt(c.partnerId, 10),
3799 })
3800 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3801 }
3802
3803
3804
3805
3806
3807
3808
3809 func (c *PartnersDevicesFindByOwnerCall) Do(opts ...googleapi.CallOption) (*FindDevicesByOwnerResponse, error) {
3810 gensupport.SetOptions(c.urlParams_, opts...)
3811 res, err := c.doRequest("json")
3812 if res != nil && res.StatusCode == http.StatusNotModified {
3813 if res.Body != nil {
3814 res.Body.Close()
3815 }
3816 return nil, gensupport.WrapError(&googleapi.Error{
3817 Code: res.StatusCode,
3818 Header: res.Header,
3819 })
3820 }
3821 if err != nil {
3822 return nil, err
3823 }
3824 defer googleapi.CloseBody(res)
3825 if err := googleapi.CheckResponse(res); err != nil {
3826 return nil, gensupport.WrapError(err)
3827 }
3828 ret := &FindDevicesByOwnerResponse{
3829 ServerResponse: googleapi.ServerResponse{
3830 Header: res.Header,
3831 HTTPStatusCode: res.StatusCode,
3832 },
3833 }
3834 target := &ret
3835 if err := gensupport.DecodeResponse(target, res); err != nil {
3836 return nil, err
3837 }
3838 return ret, nil
3839 }
3840
3841
3842
3843
3844 func (c *PartnersDevicesFindByOwnerCall) Pages(ctx context.Context, f func(*FindDevicesByOwnerResponse) error) error {
3845 c.ctx_ = ctx
3846 defer func(pt string) { c.finddevicesbyownerrequest.PageToken = pt }(c.finddevicesbyownerrequest.PageToken)
3847 for {
3848 x, err := c.Do()
3849 if err != nil {
3850 return err
3851 }
3852 if err := f(x); err != nil {
3853 return err
3854 }
3855 if x.NextPageToken == "" {
3856 return nil
3857 }
3858 c.finddevicesbyownerrequest.PageToken = x.NextPageToken
3859 }
3860 }
3861
3862 type PartnersDevicesGetCall struct {
3863 s *Service
3864 name string
3865 urlParams_ gensupport.URLParams
3866 ifNoneMatch_ string
3867 ctx_ context.Context
3868 header_ http.Header
3869 }
3870
3871
3872
3873
3874
3875 func (r *PartnersDevicesService) Get(name string) *PartnersDevicesGetCall {
3876 c := &PartnersDevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3877 c.name = name
3878 return c
3879 }
3880
3881
3882
3883
3884 func (c *PartnersDevicesGetCall) Fields(s ...googleapi.Field) *PartnersDevicesGetCall {
3885 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3886 return c
3887 }
3888
3889
3890
3891
3892 func (c *PartnersDevicesGetCall) IfNoneMatch(entityTag string) *PartnersDevicesGetCall {
3893 c.ifNoneMatch_ = entityTag
3894 return c
3895 }
3896
3897
3898 func (c *PartnersDevicesGetCall) Context(ctx context.Context) *PartnersDevicesGetCall {
3899 c.ctx_ = ctx
3900 return c
3901 }
3902
3903
3904
3905 func (c *PartnersDevicesGetCall) Header() http.Header {
3906 if c.header_ == nil {
3907 c.header_ = make(http.Header)
3908 }
3909 return c.header_
3910 }
3911
3912 func (c *PartnersDevicesGetCall) doRequest(alt string) (*http.Response, error) {
3913 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3914 if c.ifNoneMatch_ != "" {
3915 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3916 }
3917 var body io.Reader = nil
3918 c.urlParams_.Set("alt", alt)
3919 c.urlParams_.Set("prettyPrint", "false")
3920 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3921 urls += "?" + c.urlParams_.Encode()
3922 req, err := http.NewRequest("GET", urls, body)
3923 if err != nil {
3924 return nil, err
3925 }
3926 req.Header = reqHeaders
3927 googleapi.Expand(req.URL, map[string]string{
3928 "name": c.name,
3929 })
3930 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3931 }
3932
3933
3934
3935
3936
3937
3938 func (c *PartnersDevicesGetCall) Do(opts ...googleapi.CallOption) (*Device, error) {
3939 gensupport.SetOptions(c.urlParams_, opts...)
3940 res, err := c.doRequest("json")
3941 if res != nil && res.StatusCode == http.StatusNotModified {
3942 if res.Body != nil {
3943 res.Body.Close()
3944 }
3945 return nil, gensupport.WrapError(&googleapi.Error{
3946 Code: res.StatusCode,
3947 Header: res.Header,
3948 })
3949 }
3950 if err != nil {
3951 return nil, err
3952 }
3953 defer googleapi.CloseBody(res)
3954 if err := googleapi.CheckResponse(res); err != nil {
3955 return nil, gensupport.WrapError(err)
3956 }
3957 ret := &Device{
3958 ServerResponse: googleapi.ServerResponse{
3959 Header: res.Header,
3960 HTTPStatusCode: res.StatusCode,
3961 },
3962 }
3963 target := &ret
3964 if err := gensupport.DecodeResponse(target, res); err != nil {
3965 return nil, err
3966 }
3967 return ret, nil
3968 }
3969
3970 type PartnersDevicesGetSimLockStateCall struct {
3971 s *Service
3972 partnerId int64
3973 getdevicesimlockstaterequest *GetDeviceSimLockStateRequest
3974 urlParams_ gensupport.URLParams
3975 ctx_ context.Context
3976 header_ http.Header
3977 }
3978
3979
3980
3981
3982 func (r *PartnersDevicesService) GetSimLockState(partnerId int64, getdevicesimlockstaterequest *GetDeviceSimLockStateRequest) *PartnersDevicesGetSimLockStateCall {
3983 c := &PartnersDevicesGetSimLockStateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3984 c.partnerId = partnerId
3985 c.getdevicesimlockstaterequest = getdevicesimlockstaterequest
3986 return c
3987 }
3988
3989
3990
3991
3992 func (c *PartnersDevicesGetSimLockStateCall) Fields(s ...googleapi.Field) *PartnersDevicesGetSimLockStateCall {
3993 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3994 return c
3995 }
3996
3997
3998 func (c *PartnersDevicesGetSimLockStateCall) Context(ctx context.Context) *PartnersDevicesGetSimLockStateCall {
3999 c.ctx_ = ctx
4000 return c
4001 }
4002
4003
4004
4005 func (c *PartnersDevicesGetSimLockStateCall) Header() http.Header {
4006 if c.header_ == nil {
4007 c.header_ = make(http.Header)
4008 }
4009 return c.header_
4010 }
4011
4012 func (c *PartnersDevicesGetSimLockStateCall) doRequest(alt string) (*http.Response, error) {
4013 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4014 var body io.Reader = nil
4015 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getdevicesimlockstaterequest)
4016 if err != nil {
4017 return nil, err
4018 }
4019 c.urlParams_.Set("alt", alt)
4020 c.urlParams_.Set("prettyPrint", "false")
4021 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/devices:getSimLockState")
4022 urls += "?" + c.urlParams_.Encode()
4023 req, err := http.NewRequest("POST", urls, body)
4024 if err != nil {
4025 return nil, err
4026 }
4027 req.Header = reqHeaders
4028 googleapi.Expand(req.URL, map[string]string{
4029 "partnerId": strconv.FormatInt(c.partnerId, 10),
4030 })
4031 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4032 }
4033
4034
4035
4036
4037
4038
4039
4040 func (c *PartnersDevicesGetSimLockStateCall) Do(opts ...googleapi.CallOption) (*GetDeviceSimLockStateResponse, error) {
4041 gensupport.SetOptions(c.urlParams_, opts...)
4042 res, err := c.doRequest("json")
4043 if res != nil && res.StatusCode == http.StatusNotModified {
4044 if res.Body != nil {
4045 res.Body.Close()
4046 }
4047 return nil, gensupport.WrapError(&googleapi.Error{
4048 Code: res.StatusCode,
4049 Header: res.Header,
4050 })
4051 }
4052 if err != nil {
4053 return nil, err
4054 }
4055 defer googleapi.CloseBody(res)
4056 if err := googleapi.CheckResponse(res); err != nil {
4057 return nil, gensupport.WrapError(err)
4058 }
4059 ret := &GetDeviceSimLockStateResponse{
4060 ServerResponse: googleapi.ServerResponse{
4061 Header: res.Header,
4062 HTTPStatusCode: res.StatusCode,
4063 },
4064 }
4065 target := &ret
4066 if err := gensupport.DecodeResponse(target, res); err != nil {
4067 return nil, err
4068 }
4069 return ret, nil
4070 }
4071
4072 type PartnersDevicesMetadataCall struct {
4073 s *Service
4074 metadataOwnerId int64
4075 deviceId int64
4076 updatedevicemetadatarequest *UpdateDeviceMetadataRequest
4077 urlParams_ gensupport.URLParams
4078 ctx_ context.Context
4079 header_ http.Header
4080 }
4081
4082
4083
4084
4085
4086
4087
4088 func (r *PartnersDevicesService) Metadata(metadataOwnerId int64, deviceId int64, updatedevicemetadatarequest *UpdateDeviceMetadataRequest) *PartnersDevicesMetadataCall {
4089 c := &PartnersDevicesMetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4090 c.metadataOwnerId = metadataOwnerId
4091 c.deviceId = deviceId
4092 c.updatedevicemetadatarequest = updatedevicemetadatarequest
4093 return c
4094 }
4095
4096
4097
4098
4099 func (c *PartnersDevicesMetadataCall) Fields(s ...googleapi.Field) *PartnersDevicesMetadataCall {
4100 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4101 return c
4102 }
4103
4104
4105 func (c *PartnersDevicesMetadataCall) Context(ctx context.Context) *PartnersDevicesMetadataCall {
4106 c.ctx_ = ctx
4107 return c
4108 }
4109
4110
4111
4112 func (c *PartnersDevicesMetadataCall) Header() http.Header {
4113 if c.header_ == nil {
4114 c.header_ = make(http.Header)
4115 }
4116 return c.header_
4117 }
4118
4119 func (c *PartnersDevicesMetadataCall) doRequest(alt string) (*http.Response, error) {
4120 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4121 var body io.Reader = nil
4122 body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatedevicemetadatarequest)
4123 if err != nil {
4124 return nil, err
4125 }
4126 c.urlParams_.Set("alt", alt)
4127 c.urlParams_.Set("prettyPrint", "false")
4128 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+metadataOwnerId}/devices/{+deviceId}/metadata")
4129 urls += "?" + c.urlParams_.Encode()
4130 req, err := http.NewRequest("POST", urls, body)
4131 if err != nil {
4132 return nil, err
4133 }
4134 req.Header = reqHeaders
4135 googleapi.Expand(req.URL, map[string]string{
4136 "metadataOwnerId": strconv.FormatInt(c.metadataOwnerId, 10),
4137 "deviceId": strconv.FormatInt(c.deviceId, 10),
4138 })
4139 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4140 }
4141
4142
4143
4144
4145
4146
4147 func (c *PartnersDevicesMetadataCall) Do(opts ...googleapi.CallOption) (*DeviceMetadata, error) {
4148 gensupport.SetOptions(c.urlParams_, opts...)
4149 res, err := c.doRequest("json")
4150 if res != nil && res.StatusCode == http.StatusNotModified {
4151 if res.Body != nil {
4152 res.Body.Close()
4153 }
4154 return nil, gensupport.WrapError(&googleapi.Error{
4155 Code: res.StatusCode,
4156 Header: res.Header,
4157 })
4158 }
4159 if err != nil {
4160 return nil, err
4161 }
4162 defer googleapi.CloseBody(res)
4163 if err := googleapi.CheckResponse(res); err != nil {
4164 return nil, gensupport.WrapError(err)
4165 }
4166 ret := &DeviceMetadata{
4167 ServerResponse: googleapi.ServerResponse{
4168 Header: res.Header,
4169 HTTPStatusCode: res.StatusCode,
4170 },
4171 }
4172 target := &ret
4173 if err := gensupport.DecodeResponse(target, res); err != nil {
4174 return nil, err
4175 }
4176 return ret, nil
4177 }
4178
4179 type PartnersDevicesUnclaimCall struct {
4180 s *Service
4181 partnerId int64
4182 unclaimdevicerequest *UnclaimDeviceRequest
4183 urlParams_ gensupport.URLParams
4184 ctx_ context.Context
4185 header_ http.Header
4186 }
4187
4188
4189
4190
4191
4192 func (r *PartnersDevicesService) Unclaim(partnerId int64, unclaimdevicerequest *UnclaimDeviceRequest) *PartnersDevicesUnclaimCall {
4193 c := &PartnersDevicesUnclaimCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4194 c.partnerId = partnerId
4195 c.unclaimdevicerequest = unclaimdevicerequest
4196 return c
4197 }
4198
4199
4200
4201
4202 func (c *PartnersDevicesUnclaimCall) Fields(s ...googleapi.Field) *PartnersDevicesUnclaimCall {
4203 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4204 return c
4205 }
4206
4207
4208 func (c *PartnersDevicesUnclaimCall) Context(ctx context.Context) *PartnersDevicesUnclaimCall {
4209 c.ctx_ = ctx
4210 return c
4211 }
4212
4213
4214
4215 func (c *PartnersDevicesUnclaimCall) Header() http.Header {
4216 if c.header_ == nil {
4217 c.header_ = make(http.Header)
4218 }
4219 return c.header_
4220 }
4221
4222 func (c *PartnersDevicesUnclaimCall) doRequest(alt string) (*http.Response, error) {
4223 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4224 var body io.Reader = nil
4225 body, err := googleapi.WithoutDataWrapper.JSONReader(c.unclaimdevicerequest)
4226 if err != nil {
4227 return nil, err
4228 }
4229 c.urlParams_.Set("alt", alt)
4230 c.urlParams_.Set("prettyPrint", "false")
4231 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/devices:unclaim")
4232 urls += "?" + c.urlParams_.Encode()
4233 req, err := http.NewRequest("POST", urls, body)
4234 if err != nil {
4235 return nil, err
4236 }
4237 req.Header = reqHeaders
4238 googleapi.Expand(req.URL, map[string]string{
4239 "partnerId": strconv.FormatInt(c.partnerId, 10),
4240 })
4241 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4242 }
4243
4244
4245
4246
4247
4248
4249 func (c *PartnersDevicesUnclaimCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4250 gensupport.SetOptions(c.urlParams_, opts...)
4251 res, err := c.doRequest("json")
4252 if res != nil && res.StatusCode == http.StatusNotModified {
4253 if res.Body != nil {
4254 res.Body.Close()
4255 }
4256 return nil, gensupport.WrapError(&googleapi.Error{
4257 Code: res.StatusCode,
4258 Header: res.Header,
4259 })
4260 }
4261 if err != nil {
4262 return nil, err
4263 }
4264 defer googleapi.CloseBody(res)
4265 if err := googleapi.CheckResponse(res); err != nil {
4266 return nil, gensupport.WrapError(err)
4267 }
4268 ret := &Empty{
4269 ServerResponse: googleapi.ServerResponse{
4270 Header: res.Header,
4271 HTTPStatusCode: res.StatusCode,
4272 },
4273 }
4274 target := &ret
4275 if err := gensupport.DecodeResponse(target, res); err != nil {
4276 return nil, err
4277 }
4278 return ret, nil
4279 }
4280
4281 type PartnersDevicesUnclaimAsyncCall struct {
4282 s *Service
4283 partnerId int64
4284 unclaimdevicesrequest *UnclaimDevicesRequest
4285 urlParams_ gensupport.URLParams
4286 ctx_ context.Context
4287 header_ http.Header
4288 }
4289
4290
4291
4292
4293
4294
4295
4296 func (r *PartnersDevicesService) UnclaimAsync(partnerId int64, unclaimdevicesrequest *UnclaimDevicesRequest) *PartnersDevicesUnclaimAsyncCall {
4297 c := &PartnersDevicesUnclaimAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4298 c.partnerId = partnerId
4299 c.unclaimdevicesrequest = unclaimdevicesrequest
4300 return c
4301 }
4302
4303
4304
4305
4306 func (c *PartnersDevicesUnclaimAsyncCall) Fields(s ...googleapi.Field) *PartnersDevicesUnclaimAsyncCall {
4307 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4308 return c
4309 }
4310
4311
4312 func (c *PartnersDevicesUnclaimAsyncCall) Context(ctx context.Context) *PartnersDevicesUnclaimAsyncCall {
4313 c.ctx_ = ctx
4314 return c
4315 }
4316
4317
4318
4319 func (c *PartnersDevicesUnclaimAsyncCall) Header() http.Header {
4320 if c.header_ == nil {
4321 c.header_ = make(http.Header)
4322 }
4323 return c.header_
4324 }
4325
4326 func (c *PartnersDevicesUnclaimAsyncCall) doRequest(alt string) (*http.Response, error) {
4327 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4328 var body io.Reader = nil
4329 body, err := googleapi.WithoutDataWrapper.JSONReader(c.unclaimdevicesrequest)
4330 if err != nil {
4331 return nil, err
4332 }
4333 c.urlParams_.Set("alt", alt)
4334 c.urlParams_.Set("prettyPrint", "false")
4335 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/devices:unclaimAsync")
4336 urls += "?" + c.urlParams_.Encode()
4337 req, err := http.NewRequest("POST", urls, body)
4338 if err != nil {
4339 return nil, err
4340 }
4341 req.Header = reqHeaders
4342 googleapi.Expand(req.URL, map[string]string{
4343 "partnerId": strconv.FormatInt(c.partnerId, 10),
4344 })
4345 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4346 }
4347
4348
4349
4350
4351
4352
4353 func (c *PartnersDevicesUnclaimAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4354 gensupport.SetOptions(c.urlParams_, opts...)
4355 res, err := c.doRequest("json")
4356 if res != nil && res.StatusCode == http.StatusNotModified {
4357 if res.Body != nil {
4358 res.Body.Close()
4359 }
4360 return nil, gensupport.WrapError(&googleapi.Error{
4361 Code: res.StatusCode,
4362 Header: res.Header,
4363 })
4364 }
4365 if err != nil {
4366 return nil, err
4367 }
4368 defer googleapi.CloseBody(res)
4369 if err := googleapi.CheckResponse(res); err != nil {
4370 return nil, gensupport.WrapError(err)
4371 }
4372 ret := &Operation{
4373 ServerResponse: googleapi.ServerResponse{
4374 Header: res.Header,
4375 HTTPStatusCode: res.StatusCode,
4376 },
4377 }
4378 target := &ret
4379 if err := gensupport.DecodeResponse(target, res); err != nil {
4380 return nil, err
4381 }
4382 return ret, nil
4383 }
4384
4385 type PartnersDevicesUpdateMetadataAsyncCall struct {
4386 s *Service
4387 partnerId int64
4388 updatedevicemetadatainbatchrequest *UpdateDeviceMetadataInBatchRequest
4389 urlParams_ gensupport.URLParams
4390 ctx_ context.Context
4391 header_ http.Header
4392 }
4393
4394
4395
4396
4397
4398
4399
4400
4401 func (r *PartnersDevicesService) UpdateMetadataAsync(partnerId int64, updatedevicemetadatainbatchrequest *UpdateDeviceMetadataInBatchRequest) *PartnersDevicesUpdateMetadataAsyncCall {
4402 c := &PartnersDevicesUpdateMetadataAsyncCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4403 c.partnerId = partnerId
4404 c.updatedevicemetadatainbatchrequest = updatedevicemetadatainbatchrequest
4405 return c
4406 }
4407
4408
4409
4410
4411 func (c *PartnersDevicesUpdateMetadataAsyncCall) Fields(s ...googleapi.Field) *PartnersDevicesUpdateMetadataAsyncCall {
4412 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4413 return c
4414 }
4415
4416
4417 func (c *PartnersDevicesUpdateMetadataAsyncCall) Context(ctx context.Context) *PartnersDevicesUpdateMetadataAsyncCall {
4418 c.ctx_ = ctx
4419 return c
4420 }
4421
4422
4423
4424 func (c *PartnersDevicesUpdateMetadataAsyncCall) Header() http.Header {
4425 if c.header_ == nil {
4426 c.header_ = make(http.Header)
4427 }
4428 return c.header_
4429 }
4430
4431 func (c *PartnersDevicesUpdateMetadataAsyncCall) doRequest(alt string) (*http.Response, error) {
4432 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4433 var body io.Reader = nil
4434 body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatedevicemetadatainbatchrequest)
4435 if err != nil {
4436 return nil, err
4437 }
4438 c.urlParams_.Set("alt", alt)
4439 c.urlParams_.Set("prettyPrint", "false")
4440 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/partners/{+partnerId}/devices:updateMetadataAsync")
4441 urls += "?" + c.urlParams_.Encode()
4442 req, err := http.NewRequest("POST", urls, body)
4443 if err != nil {
4444 return nil, err
4445 }
4446 req.Header = reqHeaders
4447 googleapi.Expand(req.URL, map[string]string{
4448 "partnerId": strconv.FormatInt(c.partnerId, 10),
4449 })
4450 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4451 }
4452
4453
4454
4455
4456
4457
4458 func (c *PartnersDevicesUpdateMetadataAsyncCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4459 gensupport.SetOptions(c.urlParams_, opts...)
4460 res, err := c.doRequest("json")
4461 if res != nil && res.StatusCode == http.StatusNotModified {
4462 if res.Body != nil {
4463 res.Body.Close()
4464 }
4465 return nil, gensupport.WrapError(&googleapi.Error{
4466 Code: res.StatusCode,
4467 Header: res.Header,
4468 })
4469 }
4470 if err != nil {
4471 return nil, err
4472 }
4473 defer googleapi.CloseBody(res)
4474 if err := googleapi.CheckResponse(res); err != nil {
4475 return nil, gensupport.WrapError(err)
4476 }
4477 ret := &Operation{
4478 ServerResponse: googleapi.ServerResponse{
4479 Header: res.Header,
4480 HTTPStatusCode: res.StatusCode,
4481 },
4482 }
4483 target := &ret
4484 if err := gensupport.DecodeResponse(target, res); err != nil {
4485 return nil, err
4486 }
4487 return ret, nil
4488 }
4489
4490 type PartnersVendorsListCall struct {
4491 s *Service
4492 parent string
4493 urlParams_ gensupport.URLParams
4494 ifNoneMatch_ string
4495 ctx_ context.Context
4496 header_ http.Header
4497 }
4498
4499
4500
4501
4502 func (r *PartnersVendorsService) List(parent string) *PartnersVendorsListCall {
4503 c := &PartnersVendorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4504 c.parent = parent
4505 return c
4506 }
4507
4508
4509
4510 func (c *PartnersVendorsListCall) PageSize(pageSize int64) *PartnersVendorsListCall {
4511 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4512 return c
4513 }
4514
4515
4516
4517 func (c *PartnersVendorsListCall) PageToken(pageToken string) *PartnersVendorsListCall {
4518 c.urlParams_.Set("pageToken", pageToken)
4519 return c
4520 }
4521
4522
4523
4524
4525 func (c *PartnersVendorsListCall) Fields(s ...googleapi.Field) *PartnersVendorsListCall {
4526 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4527 return c
4528 }
4529
4530
4531
4532
4533 func (c *PartnersVendorsListCall) IfNoneMatch(entityTag string) *PartnersVendorsListCall {
4534 c.ifNoneMatch_ = entityTag
4535 return c
4536 }
4537
4538
4539 func (c *PartnersVendorsListCall) Context(ctx context.Context) *PartnersVendorsListCall {
4540 c.ctx_ = ctx
4541 return c
4542 }
4543
4544
4545
4546 func (c *PartnersVendorsListCall) Header() http.Header {
4547 if c.header_ == nil {
4548 c.header_ = make(http.Header)
4549 }
4550 return c.header_
4551 }
4552
4553 func (c *PartnersVendorsListCall) doRequest(alt string) (*http.Response, error) {
4554 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4555 if c.ifNoneMatch_ != "" {
4556 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4557 }
4558 var body io.Reader = nil
4559 c.urlParams_.Set("alt", alt)
4560 c.urlParams_.Set("prettyPrint", "false")
4561 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/vendors")
4562 urls += "?" + c.urlParams_.Encode()
4563 req, err := http.NewRequest("GET", urls, body)
4564 if err != nil {
4565 return nil, err
4566 }
4567 req.Header = reqHeaders
4568 googleapi.Expand(req.URL, map[string]string{
4569 "parent": c.parent,
4570 })
4571 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4572 }
4573
4574
4575
4576
4577
4578
4579
4580 func (c *PartnersVendorsListCall) Do(opts ...googleapi.CallOption) (*ListVendorsResponse, error) {
4581 gensupport.SetOptions(c.urlParams_, opts...)
4582 res, err := c.doRequest("json")
4583 if res != nil && res.StatusCode == http.StatusNotModified {
4584 if res.Body != nil {
4585 res.Body.Close()
4586 }
4587 return nil, gensupport.WrapError(&googleapi.Error{
4588 Code: res.StatusCode,
4589 Header: res.Header,
4590 })
4591 }
4592 if err != nil {
4593 return nil, err
4594 }
4595 defer googleapi.CloseBody(res)
4596 if err := googleapi.CheckResponse(res); err != nil {
4597 return nil, gensupport.WrapError(err)
4598 }
4599 ret := &ListVendorsResponse{
4600 ServerResponse: googleapi.ServerResponse{
4601 Header: res.Header,
4602 HTTPStatusCode: res.StatusCode,
4603 },
4604 }
4605 target := &ret
4606 if err := gensupport.DecodeResponse(target, res); err != nil {
4607 return nil, err
4608 }
4609 return ret, nil
4610 }
4611
4612
4613
4614
4615 func (c *PartnersVendorsListCall) Pages(ctx context.Context, f func(*ListVendorsResponse) error) error {
4616 c.ctx_ = ctx
4617 defer c.PageToken(c.urlParams_.Get("pageToken"))
4618 for {
4619 x, err := c.Do()
4620 if err != nil {
4621 return err
4622 }
4623 if err := f(x); err != nil {
4624 return err
4625 }
4626 if x.NextPageToken == "" {
4627 return nil
4628 }
4629 c.PageToken(x.NextPageToken)
4630 }
4631 }
4632
4633 type PartnersVendorsCustomersListCall struct {
4634 s *Service
4635 parent string
4636 urlParams_ gensupport.URLParams
4637 ifNoneMatch_ string
4638 ctx_ context.Context
4639 header_ http.Header
4640 }
4641
4642
4643
4644
4645
4646 func (r *PartnersVendorsCustomersService) List(parent string) *PartnersVendorsCustomersListCall {
4647 c := &PartnersVendorsCustomersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4648 c.parent = parent
4649 return c
4650 }
4651
4652
4653
4654 func (c *PartnersVendorsCustomersListCall) PageSize(pageSize int64) *PartnersVendorsCustomersListCall {
4655 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4656 return c
4657 }
4658
4659
4660
4661 func (c *PartnersVendorsCustomersListCall) PageToken(pageToken string) *PartnersVendorsCustomersListCall {
4662 c.urlParams_.Set("pageToken", pageToken)
4663 return c
4664 }
4665
4666
4667
4668
4669 func (c *PartnersVendorsCustomersListCall) Fields(s ...googleapi.Field) *PartnersVendorsCustomersListCall {
4670 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4671 return c
4672 }
4673
4674
4675
4676
4677 func (c *PartnersVendorsCustomersListCall) IfNoneMatch(entityTag string) *PartnersVendorsCustomersListCall {
4678 c.ifNoneMatch_ = entityTag
4679 return c
4680 }
4681
4682
4683 func (c *PartnersVendorsCustomersListCall) Context(ctx context.Context) *PartnersVendorsCustomersListCall {
4684 c.ctx_ = ctx
4685 return c
4686 }
4687
4688
4689
4690 func (c *PartnersVendorsCustomersListCall) Header() http.Header {
4691 if c.header_ == nil {
4692 c.header_ = make(http.Header)
4693 }
4694 return c.header_
4695 }
4696
4697 func (c *PartnersVendorsCustomersListCall) doRequest(alt string) (*http.Response, error) {
4698 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4699 if c.ifNoneMatch_ != "" {
4700 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4701 }
4702 var body io.Reader = nil
4703 c.urlParams_.Set("alt", alt)
4704 c.urlParams_.Set("prettyPrint", "false")
4705 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/customers")
4706 urls += "?" + c.urlParams_.Encode()
4707 req, err := http.NewRequest("GET", urls, body)
4708 if err != nil {
4709 return nil, err
4710 }
4711 req.Header = reqHeaders
4712 googleapi.Expand(req.URL, map[string]string{
4713 "parent": c.parent,
4714 })
4715 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4716 }
4717
4718
4719
4720
4721
4722
4723
4724 func (c *PartnersVendorsCustomersListCall) Do(opts ...googleapi.CallOption) (*ListVendorCustomersResponse, error) {
4725 gensupport.SetOptions(c.urlParams_, opts...)
4726 res, err := c.doRequest("json")
4727 if res != nil && res.StatusCode == http.StatusNotModified {
4728 if res.Body != nil {
4729 res.Body.Close()
4730 }
4731 return nil, gensupport.WrapError(&googleapi.Error{
4732 Code: res.StatusCode,
4733 Header: res.Header,
4734 })
4735 }
4736 if err != nil {
4737 return nil, err
4738 }
4739 defer googleapi.CloseBody(res)
4740 if err := googleapi.CheckResponse(res); err != nil {
4741 return nil, gensupport.WrapError(err)
4742 }
4743 ret := &ListVendorCustomersResponse{
4744 ServerResponse: googleapi.ServerResponse{
4745 Header: res.Header,
4746 HTTPStatusCode: res.StatusCode,
4747 },
4748 }
4749 target := &ret
4750 if err := gensupport.DecodeResponse(target, res); err != nil {
4751 return nil, err
4752 }
4753 return ret, nil
4754 }
4755
4756
4757
4758
4759 func (c *PartnersVendorsCustomersListCall) Pages(ctx context.Context, f func(*ListVendorCustomersResponse) error) error {
4760 c.ctx_ = ctx
4761 defer c.PageToken(c.urlParams_.Get("pageToken"))
4762 for {
4763 x, err := c.Do()
4764 if err != nil {
4765 return err
4766 }
4767 if err := f(x); err != nil {
4768 return err
4769 }
4770 if x.NextPageToken == "" {
4771 return nil
4772 }
4773 c.PageToken(x.NextPageToken)
4774 }
4775 }
4776
View as plain text