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 mybusinessaccountmanagement
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 = "mybusinessaccountmanagement:v1"
90 const apiName = "mybusinessaccountmanagement"
91 const apiVersion = "v1"
92 const basePath = "https://mybusinessaccountmanagement.googleapis.com/"
93 const basePathTemplate = "https://mybusinessaccountmanagement.UNIVERSE_DOMAIN/"
94 const mtlsBasePath = "https://mybusinessaccountmanagement.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.Accounts = NewAccountsService(s)
127 s.Locations = NewLocationsService(s)
128 return s, nil
129 }
130
131 type Service struct {
132 client *http.Client
133 BasePath string
134 UserAgent string
135
136 Accounts *AccountsService
137
138 Locations *LocationsService
139 }
140
141 func (s *Service) userAgent() string {
142 if s.UserAgent == "" {
143 return googleapi.UserAgent
144 }
145 return googleapi.UserAgent + " " + s.UserAgent
146 }
147
148 func NewAccountsService(s *Service) *AccountsService {
149 rs := &AccountsService{s: s}
150 rs.Admins = NewAccountsAdminsService(s)
151 rs.Invitations = NewAccountsInvitationsService(s)
152 return rs
153 }
154
155 type AccountsService struct {
156 s *Service
157
158 Admins *AccountsAdminsService
159
160 Invitations *AccountsInvitationsService
161 }
162
163 func NewAccountsAdminsService(s *Service) *AccountsAdminsService {
164 rs := &AccountsAdminsService{s: s}
165 return rs
166 }
167
168 type AccountsAdminsService struct {
169 s *Service
170 }
171
172 func NewAccountsInvitationsService(s *Service) *AccountsInvitationsService {
173 rs := &AccountsInvitationsService{s: s}
174 return rs
175 }
176
177 type AccountsInvitationsService struct {
178 s *Service
179 }
180
181 func NewLocationsService(s *Service) *LocationsService {
182 rs := &LocationsService{s: s}
183 rs.Admins = NewLocationsAdminsService(s)
184 return rs
185 }
186
187 type LocationsService struct {
188 s *Service
189
190 Admins *LocationsAdminsService
191 }
192
193 func NewLocationsAdminsService(s *Service) *LocationsAdminsService {
194 rs := &LocationsAdminsService{s: s}
195 return rs
196 }
197
198 type LocationsAdminsService struct {
199 s *Service
200 }
201
202
203 type AcceptInvitationRequest struct {
204 }
205
206
207
208
209
210
211 type Account struct {
212
213
214 AccountName string `json:"accountName,omitempty"`
215
216 AccountNumber string `json:"accountNumber,omitempty"`
217
218 Name string `json:"name,omitempty"`
219
220
221 OrganizationInfo *OrganizationInfo `json:"organizationInfo,omitempty"`
222
223
224
225
226
227
228
229 PermissionLevel string `json:"permissionLevel,omitempty"`
230
231
232
233 PrimaryOwner string `json:"primaryOwner,omitempty"`
234
235
236
237
238
239
240
241
242
243 Role string `json:"role,omitempty"`
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258 Type string `json:"type,omitempty"`
259
260
261
262
263
264
265
266
267
268
269
270 VerificationState string `json:"verificationState,omitempty"`
271
272
273
274
275
276
277
278
279
280
281
282 VettedState string `json:"vettedState,omitempty"`
283
284
285 googleapi.ServerResponse `json:"-"`
286
287
288
289
290
291 ForceSendFields []string `json:"-"`
292
293
294
295
296 NullFields []string `json:"-"`
297 }
298
299 func (s *Account) MarshalJSON() ([]byte, error) {
300 type NoMethod Account
301 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
302 }
303
304
305 type Admin struct {
306
307
308
309
310
311 Account string `json:"account,omitempty"`
312
313
314
315
316
317 Admin string `json:"admin,omitempty"`
318
319
320
321
322 Name string `json:"name,omitempty"`
323
324
325 PendingInvitation bool `json:"pendingInvitation,omitempty"`
326
327
328
329
330
331
332
333
334
335
336
337
338 Role string `json:"role,omitempty"`
339
340
341 googleapi.ServerResponse `json:"-"`
342
343
344
345
346
347 ForceSendFields []string `json:"-"`
348
349
350
351
352 NullFields []string `json:"-"`
353 }
354
355 func (s *Admin) MarshalJSON() ([]byte, error) {
356 type NoMethod Admin
357 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
358 }
359
360
361
362 type DeclineInvitationRequest struct {
363 }
364
365
366
367
368
369 type Empty struct {
370
371 googleapi.ServerResponse `json:"-"`
372 }
373
374
375 type Invitation struct {
376
377
378 Name string `json:"name,omitempty"`
379
380
381
382
383
384
385
386
387
388
389
390 Role string `json:"role,omitempty"`
391
392 TargetAccount *Account `json:"targetAccount,omitempty"`
393
394 TargetLocation *TargetLocation `json:"targetLocation,omitempty"`
395
396
397
398
399
400
401
402 TargetType string `json:"targetType,omitempty"`
403
404
405
406
407
408 ForceSendFields []string `json:"-"`
409
410
411
412
413 NullFields []string `json:"-"`
414 }
415
416 func (s *Invitation) MarshalJSON() ([]byte, error) {
417 type NoMethod Invitation
418 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
419 }
420
421
422
423 type ListAccountAdminsResponse struct {
424
425 AccountAdmins []*Admin `json:"accountAdmins,omitempty"`
426
427
428 googleapi.ServerResponse `json:"-"`
429
430
431
432
433
434 ForceSendFields []string `json:"-"`
435
436
437
438
439 NullFields []string `json:"-"`
440 }
441
442 func (s *ListAccountAdminsResponse) MarshalJSON() ([]byte, error) {
443 type NoMethod ListAccountAdminsResponse
444 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
445 }
446
447
448 type ListAccountsResponse struct {
449
450
451
452 Accounts []*Account `json:"accounts,omitempty"`
453
454
455
456
457 NextPageToken string `json:"nextPageToken,omitempty"`
458
459
460 googleapi.ServerResponse `json:"-"`
461
462
463
464
465
466 ForceSendFields []string `json:"-"`
467
468
469
470
471 NullFields []string `json:"-"`
472 }
473
474 func (s *ListAccountsResponse) MarshalJSON() ([]byte, error) {
475 type NoMethod ListAccountsResponse
476 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
477 }
478
479
480 type ListInvitationsResponse struct {
481
482
483 Invitations []*Invitation `json:"invitations,omitempty"`
484
485
486 googleapi.ServerResponse `json:"-"`
487
488
489
490
491
492 ForceSendFields []string `json:"-"`
493
494
495
496
497 NullFields []string `json:"-"`
498 }
499
500 func (s *ListInvitationsResponse) MarshalJSON() ([]byte, error) {
501 type NoMethod ListInvitationsResponse
502 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
503 }
504
505
506
507 type ListLocationAdminsResponse struct {
508
509 Admins []*Admin `json:"admins,omitempty"`
510
511
512 googleapi.ServerResponse `json:"-"`
513
514
515
516
517
518 ForceSendFields []string `json:"-"`
519
520
521
522
523 NullFields []string `json:"-"`
524 }
525
526 func (s *ListLocationAdminsResponse) MarshalJSON() ([]byte, error) {
527 type NoMethod ListLocationAdminsResponse
528 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
529 }
530
531
532 type OrganizationInfo struct {
533
534 Address *PostalAddress `json:"address,omitempty"`
535
536 PhoneNumber string `json:"phoneNumber,omitempty"`
537
538 RegisteredDomain string `json:"registeredDomain,omitempty"`
539
540
541
542
543
544 ForceSendFields []string `json:"-"`
545
546
547
548
549 NullFields []string `json:"-"`
550 }
551
552 func (s *OrganizationInfo) MarshalJSON() ([]byte, error) {
553 type NoMethod OrganizationInfo
554 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
555 }
556
557
558
559
560
561
562
563
564
565
566
567
568 type PostalAddress struct {
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586 AddressLines []string `json:"addressLines,omitempty"`
587
588
589
590
591
592
593 AdministrativeArea string `json:"administrativeArea,omitempty"`
594
595
596
597
598
599
600
601
602 LanguageCode string `json:"languageCode,omitempty"`
603
604
605
606
607 Locality string `json:"locality,omitempty"`
608
609 Organization string `json:"organization,omitempty"`
610
611
612
613
614 PostalCode string `json:"postalCode,omitempty"`
615
616
617
618 Recipients []string `json:"recipients,omitempty"`
619
620
621
622
623
624 RegionCode string `json:"regionCode,omitempty"`
625
626
627
628 Revision int64 `json:"revision,omitempty"`
629
630
631
632
633
634 SortingCode string `json:"sortingCode,omitempty"`
635
636
637 Sublocality string `json:"sublocality,omitempty"`
638
639
640
641
642
643 ForceSendFields []string `json:"-"`
644
645
646
647
648 NullFields []string `json:"-"`
649 }
650
651 func (s *PostalAddress) MarshalJSON() ([]byte, error) {
652 type NoMethod PostalAddress
653 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
654 }
655
656
657 type TargetLocation struct {
658
659 Address string `json:"address,omitempty"`
660
661 LocationName string `json:"locationName,omitempty"`
662
663
664
665
666
667 ForceSendFields []string `json:"-"`
668
669
670
671
672 NullFields []string `json:"-"`
673 }
674
675 func (s *TargetLocation) MarshalJSON() ([]byte, error) {
676 type NoMethod TargetLocation
677 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
678 }
679
680
681 type TransferLocationRequest struct {
682
683
684 DestinationAccount string `json:"destinationAccount,omitempty"`
685
686
687
688
689
690 ForceSendFields []string `json:"-"`
691
692
693
694
695 NullFields []string `json:"-"`
696 }
697
698 func (s *TransferLocationRequest) MarshalJSON() ([]byte, error) {
699 type NoMethod TransferLocationRequest
700 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
701 }
702
703 type AccountsCreateCall struct {
704 s *Service
705 account *Account
706 urlParams_ gensupport.URLParams
707 ctx_ context.Context
708 header_ http.Header
709 }
710
711
712
713
714
715
716
717 func (r *AccountsService) Create(account *Account) *AccountsCreateCall {
718 c := &AccountsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
719 c.account = account
720 return c
721 }
722
723
724
725
726 func (c *AccountsCreateCall) Fields(s ...googleapi.Field) *AccountsCreateCall {
727 c.urlParams_.Set("fields", googleapi.CombineFields(s))
728 return c
729 }
730
731
732 func (c *AccountsCreateCall) Context(ctx context.Context) *AccountsCreateCall {
733 c.ctx_ = ctx
734 return c
735 }
736
737
738
739 func (c *AccountsCreateCall) Header() http.Header {
740 if c.header_ == nil {
741 c.header_ = make(http.Header)
742 }
743 return c.header_
744 }
745
746 func (c *AccountsCreateCall) doRequest(alt string) (*http.Response, error) {
747 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
748 var body io.Reader = nil
749 body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
750 if err != nil {
751 return nil, err
752 }
753 c.urlParams_.Set("alt", alt)
754 c.urlParams_.Set("prettyPrint", "false")
755 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts")
756 urls += "?" + c.urlParams_.Encode()
757 req, err := http.NewRequest("POST", urls, body)
758 if err != nil {
759 return nil, err
760 }
761 req.Header = reqHeaders
762 return gensupport.SendRequest(c.ctx_, c.s.client, req)
763 }
764
765
766
767
768
769
770 func (c *AccountsCreateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
771 gensupport.SetOptions(c.urlParams_, opts...)
772 res, err := c.doRequest("json")
773 if res != nil && res.StatusCode == http.StatusNotModified {
774 if res.Body != nil {
775 res.Body.Close()
776 }
777 return nil, gensupport.WrapError(&googleapi.Error{
778 Code: res.StatusCode,
779 Header: res.Header,
780 })
781 }
782 if err != nil {
783 return nil, err
784 }
785 defer googleapi.CloseBody(res)
786 if err := googleapi.CheckResponse(res); err != nil {
787 return nil, gensupport.WrapError(err)
788 }
789 ret := &Account{
790 ServerResponse: googleapi.ServerResponse{
791 Header: res.Header,
792 HTTPStatusCode: res.StatusCode,
793 },
794 }
795 target := &ret
796 if err := gensupport.DecodeResponse(target, res); err != nil {
797 return nil, err
798 }
799 return ret, nil
800 }
801
802 type AccountsGetCall struct {
803 s *Service
804 name string
805 urlParams_ gensupport.URLParams
806 ifNoneMatch_ string
807 ctx_ context.Context
808 header_ http.Header
809 }
810
811
812
813
814
815 func (r *AccountsService) Get(name string) *AccountsGetCall {
816 c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
817 c.name = name
818 return c
819 }
820
821
822
823
824 func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
825 c.urlParams_.Set("fields", googleapi.CombineFields(s))
826 return c
827 }
828
829
830
831
832 func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
833 c.ifNoneMatch_ = entityTag
834 return c
835 }
836
837
838 func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
839 c.ctx_ = ctx
840 return c
841 }
842
843
844
845 func (c *AccountsGetCall) Header() http.Header {
846 if c.header_ == nil {
847 c.header_ = make(http.Header)
848 }
849 return c.header_
850 }
851
852 func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
853 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
854 if c.ifNoneMatch_ != "" {
855 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
856 }
857 var body io.Reader = nil
858 c.urlParams_.Set("alt", alt)
859 c.urlParams_.Set("prettyPrint", "false")
860 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
861 urls += "?" + c.urlParams_.Encode()
862 req, err := http.NewRequest("GET", urls, body)
863 if err != nil {
864 return nil, err
865 }
866 req.Header = reqHeaders
867 googleapi.Expand(req.URL, map[string]string{
868 "name": c.name,
869 })
870 return gensupport.SendRequest(c.ctx_, c.s.client, req)
871 }
872
873
874
875
876
877
878 func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
879 gensupport.SetOptions(c.urlParams_, opts...)
880 res, err := c.doRequest("json")
881 if res != nil && res.StatusCode == http.StatusNotModified {
882 if res.Body != nil {
883 res.Body.Close()
884 }
885 return nil, gensupport.WrapError(&googleapi.Error{
886 Code: res.StatusCode,
887 Header: res.Header,
888 })
889 }
890 if err != nil {
891 return nil, err
892 }
893 defer googleapi.CloseBody(res)
894 if err := googleapi.CheckResponse(res); err != nil {
895 return nil, gensupport.WrapError(err)
896 }
897 ret := &Account{
898 ServerResponse: googleapi.ServerResponse{
899 Header: res.Header,
900 HTTPStatusCode: res.StatusCode,
901 },
902 }
903 target := &ret
904 if err := gensupport.DecodeResponse(target, res); err != nil {
905 return nil, err
906 }
907 return ret, nil
908 }
909
910 type AccountsListCall struct {
911 s *Service
912 urlParams_ gensupport.URLParams
913 ifNoneMatch_ string
914 ctx_ context.Context
915 header_ http.Header
916 }
917
918
919
920
921 func (r *AccountsService) List() *AccountsListCall {
922 c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
923 return c
924 }
925
926
927
928
929
930
931
932 func (c *AccountsListCall) Filter(filter string) *AccountsListCall {
933 c.urlParams_.Set("filter", filter)
934 return c
935 }
936
937
938
939 func (c *AccountsListCall) PageSize(pageSize int64) *AccountsListCall {
940 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
941 return c
942 }
943
944
945
946
947
948 func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
949 c.urlParams_.Set("pageToken", pageToken)
950 return c
951 }
952
953
954
955
956
957
958 func (c *AccountsListCall) ParentAccount(parentAccount string) *AccountsListCall {
959 c.urlParams_.Set("parentAccount", parentAccount)
960 return c
961 }
962
963
964
965
966 func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
967 c.urlParams_.Set("fields", googleapi.CombineFields(s))
968 return c
969 }
970
971
972
973
974 func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
975 c.ifNoneMatch_ = entityTag
976 return c
977 }
978
979
980 func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
981 c.ctx_ = ctx
982 return c
983 }
984
985
986
987 func (c *AccountsListCall) Header() http.Header {
988 if c.header_ == nil {
989 c.header_ = make(http.Header)
990 }
991 return c.header_
992 }
993
994 func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
995 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
996 if c.ifNoneMatch_ != "" {
997 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
998 }
999 var body io.Reader = nil
1000 c.urlParams_.Set("alt", alt)
1001 c.urlParams_.Set("prettyPrint", "false")
1002 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts")
1003 urls += "?" + c.urlParams_.Encode()
1004 req, err := http.NewRequest("GET", urls, body)
1005 if err != nil {
1006 return nil, err
1007 }
1008 req.Header = reqHeaders
1009 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1010 }
1011
1012
1013
1014
1015
1016
1017
1018 func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*ListAccountsResponse, error) {
1019 gensupport.SetOptions(c.urlParams_, opts...)
1020 res, err := c.doRequest("json")
1021 if res != nil && res.StatusCode == http.StatusNotModified {
1022 if res.Body != nil {
1023 res.Body.Close()
1024 }
1025 return nil, gensupport.WrapError(&googleapi.Error{
1026 Code: res.StatusCode,
1027 Header: res.Header,
1028 })
1029 }
1030 if err != nil {
1031 return nil, err
1032 }
1033 defer googleapi.CloseBody(res)
1034 if err := googleapi.CheckResponse(res); err != nil {
1035 return nil, gensupport.WrapError(err)
1036 }
1037 ret := &ListAccountsResponse{
1038 ServerResponse: googleapi.ServerResponse{
1039 Header: res.Header,
1040 HTTPStatusCode: res.StatusCode,
1041 },
1042 }
1043 target := &ret
1044 if err := gensupport.DecodeResponse(target, res); err != nil {
1045 return nil, err
1046 }
1047 return ret, nil
1048 }
1049
1050
1051
1052
1053 func (c *AccountsListCall) Pages(ctx context.Context, f func(*ListAccountsResponse) error) error {
1054 c.ctx_ = ctx
1055 defer c.PageToken(c.urlParams_.Get("pageToken"))
1056 for {
1057 x, err := c.Do()
1058 if err != nil {
1059 return err
1060 }
1061 if err := f(x); err != nil {
1062 return err
1063 }
1064 if x.NextPageToken == "" {
1065 return nil
1066 }
1067 c.PageToken(x.NextPageToken)
1068 }
1069 }
1070
1071 type AccountsPatchCall struct {
1072 s *Service
1073 name string
1074 account *Account
1075 urlParams_ gensupport.URLParams
1076 ctx_ context.Context
1077 header_ http.Header
1078 }
1079
1080
1081
1082
1083
1084 func (r *AccountsService) Patch(name string, account *Account) *AccountsPatchCall {
1085 c := &AccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1086 c.name = name
1087 c.account = account
1088 return c
1089 }
1090
1091
1092
1093 func (c *AccountsPatchCall) UpdateMask(updateMask string) *AccountsPatchCall {
1094 c.urlParams_.Set("updateMask", updateMask)
1095 return c
1096 }
1097
1098
1099
1100 func (c *AccountsPatchCall) ValidateOnly(validateOnly bool) *AccountsPatchCall {
1101 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
1102 return c
1103 }
1104
1105
1106
1107
1108 func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall {
1109 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1110 return c
1111 }
1112
1113
1114 func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall {
1115 c.ctx_ = ctx
1116 return c
1117 }
1118
1119
1120
1121 func (c *AccountsPatchCall) Header() http.Header {
1122 if c.header_ == nil {
1123 c.header_ = make(http.Header)
1124 }
1125 return c.header_
1126 }
1127
1128 func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) {
1129 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1130 var body io.Reader = nil
1131 body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
1132 if err != nil {
1133 return nil, err
1134 }
1135 c.urlParams_.Set("alt", alt)
1136 c.urlParams_.Set("prettyPrint", "false")
1137 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1138 urls += "?" + c.urlParams_.Encode()
1139 req, err := http.NewRequest("PATCH", urls, body)
1140 if err != nil {
1141 return nil, err
1142 }
1143 req.Header = reqHeaders
1144 googleapi.Expand(req.URL, map[string]string{
1145 "name": c.name,
1146 })
1147 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1148 }
1149
1150
1151
1152
1153
1154
1155 func (c *AccountsPatchCall) Do(opts ...googleapi.CallOption) (*Account, error) {
1156 gensupport.SetOptions(c.urlParams_, opts...)
1157 res, err := c.doRequest("json")
1158 if res != nil && res.StatusCode == http.StatusNotModified {
1159 if res.Body != nil {
1160 res.Body.Close()
1161 }
1162 return nil, gensupport.WrapError(&googleapi.Error{
1163 Code: res.StatusCode,
1164 Header: res.Header,
1165 })
1166 }
1167 if err != nil {
1168 return nil, err
1169 }
1170 defer googleapi.CloseBody(res)
1171 if err := googleapi.CheckResponse(res); err != nil {
1172 return nil, gensupport.WrapError(err)
1173 }
1174 ret := &Account{
1175 ServerResponse: googleapi.ServerResponse{
1176 Header: res.Header,
1177 HTTPStatusCode: res.StatusCode,
1178 },
1179 }
1180 target := &ret
1181 if err := gensupport.DecodeResponse(target, res); err != nil {
1182 return nil, err
1183 }
1184 return ret, nil
1185 }
1186
1187 type AccountsAdminsCreateCall struct {
1188 s *Service
1189 parent string
1190 admin *Admin
1191 urlParams_ gensupport.URLParams
1192 ctx_ context.Context
1193 header_ http.Header
1194 }
1195
1196
1197
1198
1199
1200
1201
1202
1203 func (r *AccountsAdminsService) Create(parent string, admin *Admin) *AccountsAdminsCreateCall {
1204 c := &AccountsAdminsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1205 c.parent = parent
1206 c.admin = admin
1207 return c
1208 }
1209
1210
1211
1212
1213 func (c *AccountsAdminsCreateCall) Fields(s ...googleapi.Field) *AccountsAdminsCreateCall {
1214 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1215 return c
1216 }
1217
1218
1219 func (c *AccountsAdminsCreateCall) Context(ctx context.Context) *AccountsAdminsCreateCall {
1220 c.ctx_ = ctx
1221 return c
1222 }
1223
1224
1225
1226 func (c *AccountsAdminsCreateCall) Header() http.Header {
1227 if c.header_ == nil {
1228 c.header_ = make(http.Header)
1229 }
1230 return c.header_
1231 }
1232
1233 func (c *AccountsAdminsCreateCall) doRequest(alt string) (*http.Response, error) {
1234 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1235 var body io.Reader = nil
1236 body, err := googleapi.WithoutDataWrapper.JSONReader(c.admin)
1237 if err != nil {
1238 return nil, err
1239 }
1240 c.urlParams_.Set("alt", alt)
1241 c.urlParams_.Set("prettyPrint", "false")
1242 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/admins")
1243 urls += "?" + c.urlParams_.Encode()
1244 req, err := http.NewRequest("POST", urls, body)
1245 if err != nil {
1246 return nil, err
1247 }
1248 req.Header = reqHeaders
1249 googleapi.Expand(req.URL, map[string]string{
1250 "parent": c.parent,
1251 })
1252 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1253 }
1254
1255
1256
1257
1258
1259
1260 func (c *AccountsAdminsCreateCall) Do(opts ...googleapi.CallOption) (*Admin, error) {
1261 gensupport.SetOptions(c.urlParams_, opts...)
1262 res, err := c.doRequest("json")
1263 if res != nil && res.StatusCode == http.StatusNotModified {
1264 if res.Body != nil {
1265 res.Body.Close()
1266 }
1267 return nil, gensupport.WrapError(&googleapi.Error{
1268 Code: res.StatusCode,
1269 Header: res.Header,
1270 })
1271 }
1272 if err != nil {
1273 return nil, err
1274 }
1275 defer googleapi.CloseBody(res)
1276 if err := googleapi.CheckResponse(res); err != nil {
1277 return nil, gensupport.WrapError(err)
1278 }
1279 ret := &Admin{
1280 ServerResponse: googleapi.ServerResponse{
1281 Header: res.Header,
1282 HTTPStatusCode: res.StatusCode,
1283 },
1284 }
1285 target := &ret
1286 if err := gensupport.DecodeResponse(target, res); err != nil {
1287 return nil, err
1288 }
1289 return ret, nil
1290 }
1291
1292 type AccountsAdminsDeleteCall struct {
1293 s *Service
1294 name string
1295 urlParams_ gensupport.URLParams
1296 ctx_ context.Context
1297 header_ http.Header
1298 }
1299
1300
1301
1302
1303
1304 func (r *AccountsAdminsService) Delete(name string) *AccountsAdminsDeleteCall {
1305 c := &AccountsAdminsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1306 c.name = name
1307 return c
1308 }
1309
1310
1311
1312
1313 func (c *AccountsAdminsDeleteCall) Fields(s ...googleapi.Field) *AccountsAdminsDeleteCall {
1314 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1315 return c
1316 }
1317
1318
1319 func (c *AccountsAdminsDeleteCall) Context(ctx context.Context) *AccountsAdminsDeleteCall {
1320 c.ctx_ = ctx
1321 return c
1322 }
1323
1324
1325
1326 func (c *AccountsAdminsDeleteCall) Header() http.Header {
1327 if c.header_ == nil {
1328 c.header_ = make(http.Header)
1329 }
1330 return c.header_
1331 }
1332
1333 func (c *AccountsAdminsDeleteCall) doRequest(alt string) (*http.Response, error) {
1334 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1335 var body io.Reader = nil
1336 c.urlParams_.Set("alt", alt)
1337 c.urlParams_.Set("prettyPrint", "false")
1338 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1339 urls += "?" + c.urlParams_.Encode()
1340 req, err := http.NewRequest("DELETE", urls, body)
1341 if err != nil {
1342 return nil, err
1343 }
1344 req.Header = reqHeaders
1345 googleapi.Expand(req.URL, map[string]string{
1346 "name": c.name,
1347 })
1348 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1349 }
1350
1351
1352
1353
1354
1355
1356 func (c *AccountsAdminsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1357 gensupport.SetOptions(c.urlParams_, opts...)
1358 res, err := c.doRequest("json")
1359 if res != nil && res.StatusCode == http.StatusNotModified {
1360 if res.Body != nil {
1361 res.Body.Close()
1362 }
1363 return nil, gensupport.WrapError(&googleapi.Error{
1364 Code: res.StatusCode,
1365 Header: res.Header,
1366 })
1367 }
1368 if err != nil {
1369 return nil, err
1370 }
1371 defer googleapi.CloseBody(res)
1372 if err := googleapi.CheckResponse(res); err != nil {
1373 return nil, gensupport.WrapError(err)
1374 }
1375 ret := &Empty{
1376 ServerResponse: googleapi.ServerResponse{
1377 Header: res.Header,
1378 HTTPStatusCode: res.StatusCode,
1379 },
1380 }
1381 target := &ret
1382 if err := gensupport.DecodeResponse(target, res); err != nil {
1383 return nil, err
1384 }
1385 return ret, nil
1386 }
1387
1388 type AccountsAdminsListCall struct {
1389 s *Service
1390 parent string
1391 urlParams_ gensupport.URLParams
1392 ifNoneMatch_ string
1393 ctx_ context.Context
1394 header_ http.Header
1395 }
1396
1397
1398
1399
1400
1401 func (r *AccountsAdminsService) List(parent string) *AccountsAdminsListCall {
1402 c := &AccountsAdminsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1403 c.parent = parent
1404 return c
1405 }
1406
1407
1408
1409
1410 func (c *AccountsAdminsListCall) Fields(s ...googleapi.Field) *AccountsAdminsListCall {
1411 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1412 return c
1413 }
1414
1415
1416
1417
1418 func (c *AccountsAdminsListCall) IfNoneMatch(entityTag string) *AccountsAdminsListCall {
1419 c.ifNoneMatch_ = entityTag
1420 return c
1421 }
1422
1423
1424 func (c *AccountsAdminsListCall) Context(ctx context.Context) *AccountsAdminsListCall {
1425 c.ctx_ = ctx
1426 return c
1427 }
1428
1429
1430
1431 func (c *AccountsAdminsListCall) Header() http.Header {
1432 if c.header_ == nil {
1433 c.header_ = make(http.Header)
1434 }
1435 return c.header_
1436 }
1437
1438 func (c *AccountsAdminsListCall) doRequest(alt string) (*http.Response, error) {
1439 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1440 if c.ifNoneMatch_ != "" {
1441 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1442 }
1443 var body io.Reader = nil
1444 c.urlParams_.Set("alt", alt)
1445 c.urlParams_.Set("prettyPrint", "false")
1446 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/admins")
1447 urls += "?" + c.urlParams_.Encode()
1448 req, err := http.NewRequest("GET", urls, body)
1449 if err != nil {
1450 return nil, err
1451 }
1452 req.Header = reqHeaders
1453 googleapi.Expand(req.URL, map[string]string{
1454 "parent": c.parent,
1455 })
1456 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1457 }
1458
1459
1460
1461
1462
1463
1464
1465 func (c *AccountsAdminsListCall) Do(opts ...googleapi.CallOption) (*ListAccountAdminsResponse, error) {
1466 gensupport.SetOptions(c.urlParams_, opts...)
1467 res, err := c.doRequest("json")
1468 if res != nil && res.StatusCode == http.StatusNotModified {
1469 if res.Body != nil {
1470 res.Body.Close()
1471 }
1472 return nil, gensupport.WrapError(&googleapi.Error{
1473 Code: res.StatusCode,
1474 Header: res.Header,
1475 })
1476 }
1477 if err != nil {
1478 return nil, err
1479 }
1480 defer googleapi.CloseBody(res)
1481 if err := googleapi.CheckResponse(res); err != nil {
1482 return nil, gensupport.WrapError(err)
1483 }
1484 ret := &ListAccountAdminsResponse{
1485 ServerResponse: googleapi.ServerResponse{
1486 Header: res.Header,
1487 HTTPStatusCode: res.StatusCode,
1488 },
1489 }
1490 target := &ret
1491 if err := gensupport.DecodeResponse(target, res); err != nil {
1492 return nil, err
1493 }
1494 return ret, nil
1495 }
1496
1497 type AccountsAdminsPatchCall struct {
1498 s *Service
1499 name string
1500 admin *Admin
1501 urlParams_ gensupport.URLParams
1502 ctx_ context.Context
1503 header_ http.Header
1504 }
1505
1506
1507
1508
1509
1510
1511
1512 func (r *AccountsAdminsService) Patch(name string, admin *Admin) *AccountsAdminsPatchCall {
1513 c := &AccountsAdminsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1514 c.name = name
1515 c.admin = admin
1516 return c
1517 }
1518
1519
1520
1521 func (c *AccountsAdminsPatchCall) UpdateMask(updateMask string) *AccountsAdminsPatchCall {
1522 c.urlParams_.Set("updateMask", updateMask)
1523 return c
1524 }
1525
1526
1527
1528
1529 func (c *AccountsAdminsPatchCall) Fields(s ...googleapi.Field) *AccountsAdminsPatchCall {
1530 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1531 return c
1532 }
1533
1534
1535 func (c *AccountsAdminsPatchCall) Context(ctx context.Context) *AccountsAdminsPatchCall {
1536 c.ctx_ = ctx
1537 return c
1538 }
1539
1540
1541
1542 func (c *AccountsAdminsPatchCall) Header() http.Header {
1543 if c.header_ == nil {
1544 c.header_ = make(http.Header)
1545 }
1546 return c.header_
1547 }
1548
1549 func (c *AccountsAdminsPatchCall) doRequest(alt string) (*http.Response, error) {
1550 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1551 var body io.Reader = nil
1552 body, err := googleapi.WithoutDataWrapper.JSONReader(c.admin)
1553 if err != nil {
1554 return nil, err
1555 }
1556 c.urlParams_.Set("alt", alt)
1557 c.urlParams_.Set("prettyPrint", "false")
1558 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1559 urls += "?" + c.urlParams_.Encode()
1560 req, err := http.NewRequest("PATCH", urls, body)
1561 if err != nil {
1562 return nil, err
1563 }
1564 req.Header = reqHeaders
1565 googleapi.Expand(req.URL, map[string]string{
1566 "name": c.name,
1567 })
1568 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1569 }
1570
1571
1572
1573
1574
1575
1576 func (c *AccountsAdminsPatchCall) Do(opts ...googleapi.CallOption) (*Admin, error) {
1577 gensupport.SetOptions(c.urlParams_, opts...)
1578 res, err := c.doRequest("json")
1579 if res != nil && res.StatusCode == http.StatusNotModified {
1580 if res.Body != nil {
1581 res.Body.Close()
1582 }
1583 return nil, gensupport.WrapError(&googleapi.Error{
1584 Code: res.StatusCode,
1585 Header: res.Header,
1586 })
1587 }
1588 if err != nil {
1589 return nil, err
1590 }
1591 defer googleapi.CloseBody(res)
1592 if err := googleapi.CheckResponse(res); err != nil {
1593 return nil, gensupport.WrapError(err)
1594 }
1595 ret := &Admin{
1596 ServerResponse: googleapi.ServerResponse{
1597 Header: res.Header,
1598 HTTPStatusCode: res.StatusCode,
1599 },
1600 }
1601 target := &ret
1602 if err := gensupport.DecodeResponse(target, res); err != nil {
1603 return nil, err
1604 }
1605 return ret, nil
1606 }
1607
1608 type AccountsInvitationsAcceptCall struct {
1609 s *Service
1610 name string
1611 acceptinvitationrequest *AcceptInvitationRequest
1612 urlParams_ gensupport.URLParams
1613 ctx_ context.Context
1614 header_ http.Header
1615 }
1616
1617
1618
1619
1620
1621 func (r *AccountsInvitationsService) Accept(name string, acceptinvitationrequest *AcceptInvitationRequest) *AccountsInvitationsAcceptCall {
1622 c := &AccountsInvitationsAcceptCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1623 c.name = name
1624 c.acceptinvitationrequest = acceptinvitationrequest
1625 return c
1626 }
1627
1628
1629
1630
1631 func (c *AccountsInvitationsAcceptCall) Fields(s ...googleapi.Field) *AccountsInvitationsAcceptCall {
1632 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1633 return c
1634 }
1635
1636
1637 func (c *AccountsInvitationsAcceptCall) Context(ctx context.Context) *AccountsInvitationsAcceptCall {
1638 c.ctx_ = ctx
1639 return c
1640 }
1641
1642
1643
1644 func (c *AccountsInvitationsAcceptCall) Header() http.Header {
1645 if c.header_ == nil {
1646 c.header_ = make(http.Header)
1647 }
1648 return c.header_
1649 }
1650
1651 func (c *AccountsInvitationsAcceptCall) doRequest(alt string) (*http.Response, error) {
1652 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1653 var body io.Reader = nil
1654 body, err := googleapi.WithoutDataWrapper.JSONReader(c.acceptinvitationrequest)
1655 if err != nil {
1656 return nil, err
1657 }
1658 c.urlParams_.Set("alt", alt)
1659 c.urlParams_.Set("prettyPrint", "false")
1660 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:accept")
1661 urls += "?" + c.urlParams_.Encode()
1662 req, err := http.NewRequest("POST", urls, body)
1663 if err != nil {
1664 return nil, err
1665 }
1666 req.Header = reqHeaders
1667 googleapi.Expand(req.URL, map[string]string{
1668 "name": c.name,
1669 })
1670 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1671 }
1672
1673
1674
1675
1676
1677
1678 func (c *AccountsInvitationsAcceptCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1679 gensupport.SetOptions(c.urlParams_, opts...)
1680 res, err := c.doRequest("json")
1681 if res != nil && res.StatusCode == http.StatusNotModified {
1682 if res.Body != nil {
1683 res.Body.Close()
1684 }
1685 return nil, gensupport.WrapError(&googleapi.Error{
1686 Code: res.StatusCode,
1687 Header: res.Header,
1688 })
1689 }
1690 if err != nil {
1691 return nil, err
1692 }
1693 defer googleapi.CloseBody(res)
1694 if err := googleapi.CheckResponse(res); err != nil {
1695 return nil, gensupport.WrapError(err)
1696 }
1697 ret := &Empty{
1698 ServerResponse: googleapi.ServerResponse{
1699 Header: res.Header,
1700 HTTPStatusCode: res.StatusCode,
1701 },
1702 }
1703 target := &ret
1704 if err := gensupport.DecodeResponse(target, res); err != nil {
1705 return nil, err
1706 }
1707 return ret, nil
1708 }
1709
1710 type AccountsInvitationsDeclineCall struct {
1711 s *Service
1712 name string
1713 declineinvitationrequest *DeclineInvitationRequest
1714 urlParams_ gensupport.URLParams
1715 ctx_ context.Context
1716 header_ http.Header
1717 }
1718
1719
1720
1721
1722
1723 func (r *AccountsInvitationsService) Decline(name string, declineinvitationrequest *DeclineInvitationRequest) *AccountsInvitationsDeclineCall {
1724 c := &AccountsInvitationsDeclineCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1725 c.name = name
1726 c.declineinvitationrequest = declineinvitationrequest
1727 return c
1728 }
1729
1730
1731
1732
1733 func (c *AccountsInvitationsDeclineCall) Fields(s ...googleapi.Field) *AccountsInvitationsDeclineCall {
1734 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1735 return c
1736 }
1737
1738
1739 func (c *AccountsInvitationsDeclineCall) Context(ctx context.Context) *AccountsInvitationsDeclineCall {
1740 c.ctx_ = ctx
1741 return c
1742 }
1743
1744
1745
1746 func (c *AccountsInvitationsDeclineCall) Header() http.Header {
1747 if c.header_ == nil {
1748 c.header_ = make(http.Header)
1749 }
1750 return c.header_
1751 }
1752
1753 func (c *AccountsInvitationsDeclineCall) doRequest(alt string) (*http.Response, error) {
1754 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1755 var body io.Reader = nil
1756 body, err := googleapi.WithoutDataWrapper.JSONReader(c.declineinvitationrequest)
1757 if err != nil {
1758 return nil, err
1759 }
1760 c.urlParams_.Set("alt", alt)
1761 c.urlParams_.Set("prettyPrint", "false")
1762 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:decline")
1763 urls += "?" + c.urlParams_.Encode()
1764 req, err := http.NewRequest("POST", urls, body)
1765 if err != nil {
1766 return nil, err
1767 }
1768 req.Header = reqHeaders
1769 googleapi.Expand(req.URL, map[string]string{
1770 "name": c.name,
1771 })
1772 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1773 }
1774
1775
1776
1777
1778
1779
1780 func (c *AccountsInvitationsDeclineCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1781 gensupport.SetOptions(c.urlParams_, opts...)
1782 res, err := c.doRequest("json")
1783 if res != nil && res.StatusCode == http.StatusNotModified {
1784 if res.Body != nil {
1785 res.Body.Close()
1786 }
1787 return nil, gensupport.WrapError(&googleapi.Error{
1788 Code: res.StatusCode,
1789 Header: res.Header,
1790 })
1791 }
1792 if err != nil {
1793 return nil, err
1794 }
1795 defer googleapi.CloseBody(res)
1796 if err := googleapi.CheckResponse(res); err != nil {
1797 return nil, gensupport.WrapError(err)
1798 }
1799 ret := &Empty{
1800 ServerResponse: googleapi.ServerResponse{
1801 Header: res.Header,
1802 HTTPStatusCode: res.StatusCode,
1803 },
1804 }
1805 target := &ret
1806 if err := gensupport.DecodeResponse(target, res); err != nil {
1807 return nil, err
1808 }
1809 return ret, nil
1810 }
1811
1812 type AccountsInvitationsListCall struct {
1813 s *Service
1814 parent string
1815 urlParams_ gensupport.URLParams
1816 ifNoneMatch_ string
1817 ctx_ context.Context
1818 header_ http.Header
1819 }
1820
1821
1822
1823
1824
1825 func (r *AccountsInvitationsService) List(parent string) *AccountsInvitationsListCall {
1826 c := &AccountsInvitationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1827 c.parent = parent
1828 return c
1829 }
1830
1831
1832
1833 func (c *AccountsInvitationsListCall) Filter(filter string) *AccountsInvitationsListCall {
1834 c.urlParams_.Set("filter", filter)
1835 return c
1836 }
1837
1838
1839
1840
1841 func (c *AccountsInvitationsListCall) Fields(s ...googleapi.Field) *AccountsInvitationsListCall {
1842 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1843 return c
1844 }
1845
1846
1847
1848
1849 func (c *AccountsInvitationsListCall) IfNoneMatch(entityTag string) *AccountsInvitationsListCall {
1850 c.ifNoneMatch_ = entityTag
1851 return c
1852 }
1853
1854
1855 func (c *AccountsInvitationsListCall) Context(ctx context.Context) *AccountsInvitationsListCall {
1856 c.ctx_ = ctx
1857 return c
1858 }
1859
1860
1861
1862 func (c *AccountsInvitationsListCall) Header() http.Header {
1863 if c.header_ == nil {
1864 c.header_ = make(http.Header)
1865 }
1866 return c.header_
1867 }
1868
1869 func (c *AccountsInvitationsListCall) doRequest(alt string) (*http.Response, error) {
1870 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1871 if c.ifNoneMatch_ != "" {
1872 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1873 }
1874 var body io.Reader = nil
1875 c.urlParams_.Set("alt", alt)
1876 c.urlParams_.Set("prettyPrint", "false")
1877 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/invitations")
1878 urls += "?" + c.urlParams_.Encode()
1879 req, err := http.NewRequest("GET", urls, body)
1880 if err != nil {
1881 return nil, err
1882 }
1883 req.Header = reqHeaders
1884 googleapi.Expand(req.URL, map[string]string{
1885 "parent": c.parent,
1886 })
1887 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1888 }
1889
1890
1891
1892
1893
1894
1895
1896 func (c *AccountsInvitationsListCall) Do(opts ...googleapi.CallOption) (*ListInvitationsResponse, error) {
1897 gensupport.SetOptions(c.urlParams_, opts...)
1898 res, err := c.doRequest("json")
1899 if res != nil && res.StatusCode == http.StatusNotModified {
1900 if res.Body != nil {
1901 res.Body.Close()
1902 }
1903 return nil, gensupport.WrapError(&googleapi.Error{
1904 Code: res.StatusCode,
1905 Header: res.Header,
1906 })
1907 }
1908 if err != nil {
1909 return nil, err
1910 }
1911 defer googleapi.CloseBody(res)
1912 if err := googleapi.CheckResponse(res); err != nil {
1913 return nil, gensupport.WrapError(err)
1914 }
1915 ret := &ListInvitationsResponse{
1916 ServerResponse: googleapi.ServerResponse{
1917 Header: res.Header,
1918 HTTPStatusCode: res.StatusCode,
1919 },
1920 }
1921 target := &ret
1922 if err := gensupport.DecodeResponse(target, res); err != nil {
1923 return nil, err
1924 }
1925 return ret, nil
1926 }
1927
1928 type LocationsTransferCall struct {
1929 s *Service
1930 name string
1931 transferlocationrequest *TransferLocationRequest
1932 urlParams_ gensupport.URLParams
1933 ctx_ context.Context
1934 header_ http.Header
1935 }
1936
1937
1938
1939
1940
1941
1942
1943 func (r *LocationsService) Transfer(name string, transferlocationrequest *TransferLocationRequest) *LocationsTransferCall {
1944 c := &LocationsTransferCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1945 c.name = name
1946 c.transferlocationrequest = transferlocationrequest
1947 return c
1948 }
1949
1950
1951
1952
1953 func (c *LocationsTransferCall) Fields(s ...googleapi.Field) *LocationsTransferCall {
1954 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1955 return c
1956 }
1957
1958
1959 func (c *LocationsTransferCall) Context(ctx context.Context) *LocationsTransferCall {
1960 c.ctx_ = ctx
1961 return c
1962 }
1963
1964
1965
1966 func (c *LocationsTransferCall) Header() http.Header {
1967 if c.header_ == nil {
1968 c.header_ = make(http.Header)
1969 }
1970 return c.header_
1971 }
1972
1973 func (c *LocationsTransferCall) doRequest(alt string) (*http.Response, error) {
1974 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1975 var body io.Reader = nil
1976 body, err := googleapi.WithoutDataWrapper.JSONReader(c.transferlocationrequest)
1977 if err != nil {
1978 return nil, err
1979 }
1980 c.urlParams_.Set("alt", alt)
1981 c.urlParams_.Set("prettyPrint", "false")
1982 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:transfer")
1983 urls += "?" + c.urlParams_.Encode()
1984 req, err := http.NewRequest("POST", urls, body)
1985 if err != nil {
1986 return nil, err
1987 }
1988 req.Header = reqHeaders
1989 googleapi.Expand(req.URL, map[string]string{
1990 "name": c.name,
1991 })
1992 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1993 }
1994
1995
1996
1997
1998
1999
2000 func (c *LocationsTransferCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2001 gensupport.SetOptions(c.urlParams_, opts...)
2002 res, err := c.doRequest("json")
2003 if res != nil && res.StatusCode == http.StatusNotModified {
2004 if res.Body != nil {
2005 res.Body.Close()
2006 }
2007 return nil, gensupport.WrapError(&googleapi.Error{
2008 Code: res.StatusCode,
2009 Header: res.Header,
2010 })
2011 }
2012 if err != nil {
2013 return nil, err
2014 }
2015 defer googleapi.CloseBody(res)
2016 if err := googleapi.CheckResponse(res); err != nil {
2017 return nil, gensupport.WrapError(err)
2018 }
2019 ret := &Empty{
2020 ServerResponse: googleapi.ServerResponse{
2021 Header: res.Header,
2022 HTTPStatusCode: res.StatusCode,
2023 },
2024 }
2025 target := &ret
2026 if err := gensupport.DecodeResponse(target, res); err != nil {
2027 return nil, err
2028 }
2029 return ret, nil
2030 }
2031
2032 type LocationsAdminsCreateCall struct {
2033 s *Service
2034 parent string
2035 admin *Admin
2036 urlParams_ gensupport.URLParams
2037 ctx_ context.Context
2038 header_ http.Header
2039 }
2040
2041
2042
2043
2044
2045
2046
2047
2048 func (r *LocationsAdminsService) Create(parent string, admin *Admin) *LocationsAdminsCreateCall {
2049 c := &LocationsAdminsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2050 c.parent = parent
2051 c.admin = admin
2052 return c
2053 }
2054
2055
2056
2057
2058 func (c *LocationsAdminsCreateCall) Fields(s ...googleapi.Field) *LocationsAdminsCreateCall {
2059 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2060 return c
2061 }
2062
2063
2064 func (c *LocationsAdminsCreateCall) Context(ctx context.Context) *LocationsAdminsCreateCall {
2065 c.ctx_ = ctx
2066 return c
2067 }
2068
2069
2070
2071 func (c *LocationsAdminsCreateCall) Header() http.Header {
2072 if c.header_ == nil {
2073 c.header_ = make(http.Header)
2074 }
2075 return c.header_
2076 }
2077
2078 func (c *LocationsAdminsCreateCall) doRequest(alt string) (*http.Response, error) {
2079 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2080 var body io.Reader = nil
2081 body, err := googleapi.WithoutDataWrapper.JSONReader(c.admin)
2082 if err != nil {
2083 return nil, err
2084 }
2085 c.urlParams_.Set("alt", alt)
2086 c.urlParams_.Set("prettyPrint", "false")
2087 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/admins")
2088 urls += "?" + c.urlParams_.Encode()
2089 req, err := http.NewRequest("POST", urls, body)
2090 if err != nil {
2091 return nil, err
2092 }
2093 req.Header = reqHeaders
2094 googleapi.Expand(req.URL, map[string]string{
2095 "parent": c.parent,
2096 })
2097 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2098 }
2099
2100
2101
2102
2103
2104
2105 func (c *LocationsAdminsCreateCall) Do(opts ...googleapi.CallOption) (*Admin, error) {
2106 gensupport.SetOptions(c.urlParams_, opts...)
2107 res, err := c.doRequest("json")
2108 if res != nil && res.StatusCode == http.StatusNotModified {
2109 if res.Body != nil {
2110 res.Body.Close()
2111 }
2112 return nil, gensupport.WrapError(&googleapi.Error{
2113 Code: res.StatusCode,
2114 Header: res.Header,
2115 })
2116 }
2117 if err != nil {
2118 return nil, err
2119 }
2120 defer googleapi.CloseBody(res)
2121 if err := googleapi.CheckResponse(res); err != nil {
2122 return nil, gensupport.WrapError(err)
2123 }
2124 ret := &Admin{
2125 ServerResponse: googleapi.ServerResponse{
2126 Header: res.Header,
2127 HTTPStatusCode: res.StatusCode,
2128 },
2129 }
2130 target := &ret
2131 if err := gensupport.DecodeResponse(target, res); err != nil {
2132 return nil, err
2133 }
2134 return ret, nil
2135 }
2136
2137 type LocationsAdminsDeleteCall struct {
2138 s *Service
2139 name string
2140 urlParams_ gensupport.URLParams
2141 ctx_ context.Context
2142 header_ http.Header
2143 }
2144
2145
2146
2147
2148 func (r *LocationsAdminsService) Delete(name string) *LocationsAdminsDeleteCall {
2149 c := &LocationsAdminsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2150 c.name = name
2151 return c
2152 }
2153
2154
2155
2156
2157 func (c *LocationsAdminsDeleteCall) Fields(s ...googleapi.Field) *LocationsAdminsDeleteCall {
2158 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2159 return c
2160 }
2161
2162
2163 func (c *LocationsAdminsDeleteCall) Context(ctx context.Context) *LocationsAdminsDeleteCall {
2164 c.ctx_ = ctx
2165 return c
2166 }
2167
2168
2169
2170 func (c *LocationsAdminsDeleteCall) Header() http.Header {
2171 if c.header_ == nil {
2172 c.header_ = make(http.Header)
2173 }
2174 return c.header_
2175 }
2176
2177 func (c *LocationsAdminsDeleteCall) doRequest(alt string) (*http.Response, error) {
2178 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2179 var body io.Reader = nil
2180 c.urlParams_.Set("alt", alt)
2181 c.urlParams_.Set("prettyPrint", "false")
2182 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2183 urls += "?" + c.urlParams_.Encode()
2184 req, err := http.NewRequest("DELETE", urls, body)
2185 if err != nil {
2186 return nil, err
2187 }
2188 req.Header = reqHeaders
2189 googleapi.Expand(req.URL, map[string]string{
2190 "name": c.name,
2191 })
2192 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2193 }
2194
2195
2196
2197
2198
2199
2200 func (c *LocationsAdminsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2201 gensupport.SetOptions(c.urlParams_, opts...)
2202 res, err := c.doRequest("json")
2203 if res != nil && res.StatusCode == http.StatusNotModified {
2204 if res.Body != nil {
2205 res.Body.Close()
2206 }
2207 return nil, gensupport.WrapError(&googleapi.Error{
2208 Code: res.StatusCode,
2209 Header: res.Header,
2210 })
2211 }
2212 if err != nil {
2213 return nil, err
2214 }
2215 defer googleapi.CloseBody(res)
2216 if err := googleapi.CheckResponse(res); err != nil {
2217 return nil, gensupport.WrapError(err)
2218 }
2219 ret := &Empty{
2220 ServerResponse: googleapi.ServerResponse{
2221 Header: res.Header,
2222 HTTPStatusCode: res.StatusCode,
2223 },
2224 }
2225 target := &ret
2226 if err := gensupport.DecodeResponse(target, res); err != nil {
2227 return nil, err
2228 }
2229 return ret, nil
2230 }
2231
2232 type LocationsAdminsListCall struct {
2233 s *Service
2234 parent string
2235 urlParams_ gensupport.URLParams
2236 ifNoneMatch_ string
2237 ctx_ context.Context
2238 header_ http.Header
2239 }
2240
2241
2242
2243
2244
2245 func (r *LocationsAdminsService) List(parent string) *LocationsAdminsListCall {
2246 c := &LocationsAdminsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2247 c.parent = parent
2248 return c
2249 }
2250
2251
2252
2253
2254 func (c *LocationsAdminsListCall) Fields(s ...googleapi.Field) *LocationsAdminsListCall {
2255 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2256 return c
2257 }
2258
2259
2260
2261
2262 func (c *LocationsAdminsListCall) IfNoneMatch(entityTag string) *LocationsAdminsListCall {
2263 c.ifNoneMatch_ = entityTag
2264 return c
2265 }
2266
2267
2268 func (c *LocationsAdminsListCall) Context(ctx context.Context) *LocationsAdminsListCall {
2269 c.ctx_ = ctx
2270 return c
2271 }
2272
2273
2274
2275 func (c *LocationsAdminsListCall) Header() http.Header {
2276 if c.header_ == nil {
2277 c.header_ = make(http.Header)
2278 }
2279 return c.header_
2280 }
2281
2282 func (c *LocationsAdminsListCall) doRequest(alt string) (*http.Response, error) {
2283 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2284 if c.ifNoneMatch_ != "" {
2285 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2286 }
2287 var body io.Reader = nil
2288 c.urlParams_.Set("alt", alt)
2289 c.urlParams_.Set("prettyPrint", "false")
2290 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/admins")
2291 urls += "?" + c.urlParams_.Encode()
2292 req, err := http.NewRequest("GET", urls, body)
2293 if err != nil {
2294 return nil, err
2295 }
2296 req.Header = reqHeaders
2297 googleapi.Expand(req.URL, map[string]string{
2298 "parent": c.parent,
2299 })
2300 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2301 }
2302
2303
2304
2305
2306
2307
2308
2309 func (c *LocationsAdminsListCall) Do(opts ...googleapi.CallOption) (*ListLocationAdminsResponse, error) {
2310 gensupport.SetOptions(c.urlParams_, opts...)
2311 res, err := c.doRequest("json")
2312 if res != nil && res.StatusCode == http.StatusNotModified {
2313 if res.Body != nil {
2314 res.Body.Close()
2315 }
2316 return nil, gensupport.WrapError(&googleapi.Error{
2317 Code: res.StatusCode,
2318 Header: res.Header,
2319 })
2320 }
2321 if err != nil {
2322 return nil, err
2323 }
2324 defer googleapi.CloseBody(res)
2325 if err := googleapi.CheckResponse(res); err != nil {
2326 return nil, gensupport.WrapError(err)
2327 }
2328 ret := &ListLocationAdminsResponse{
2329 ServerResponse: googleapi.ServerResponse{
2330 Header: res.Header,
2331 HTTPStatusCode: res.StatusCode,
2332 },
2333 }
2334 target := &ret
2335 if err := gensupport.DecodeResponse(target, res); err != nil {
2336 return nil, err
2337 }
2338 return ret, nil
2339 }
2340
2341 type LocationsAdminsPatchCall struct {
2342 s *Service
2343 name string
2344 admin *Admin
2345 urlParams_ gensupport.URLParams
2346 ctx_ context.Context
2347 header_ http.Header
2348 }
2349
2350
2351
2352
2353
2354
2355
2356
2357 func (r *LocationsAdminsService) Patch(name string, admin *Admin) *LocationsAdminsPatchCall {
2358 c := &LocationsAdminsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2359 c.name = name
2360 c.admin = admin
2361 return c
2362 }
2363
2364
2365
2366 func (c *LocationsAdminsPatchCall) UpdateMask(updateMask string) *LocationsAdminsPatchCall {
2367 c.urlParams_.Set("updateMask", updateMask)
2368 return c
2369 }
2370
2371
2372
2373
2374 func (c *LocationsAdminsPatchCall) Fields(s ...googleapi.Field) *LocationsAdminsPatchCall {
2375 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2376 return c
2377 }
2378
2379
2380 func (c *LocationsAdminsPatchCall) Context(ctx context.Context) *LocationsAdminsPatchCall {
2381 c.ctx_ = ctx
2382 return c
2383 }
2384
2385
2386
2387 func (c *LocationsAdminsPatchCall) Header() http.Header {
2388 if c.header_ == nil {
2389 c.header_ = make(http.Header)
2390 }
2391 return c.header_
2392 }
2393
2394 func (c *LocationsAdminsPatchCall) doRequest(alt string) (*http.Response, error) {
2395 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2396 var body io.Reader = nil
2397 body, err := googleapi.WithoutDataWrapper.JSONReader(c.admin)
2398 if err != nil {
2399 return nil, err
2400 }
2401 c.urlParams_.Set("alt", alt)
2402 c.urlParams_.Set("prettyPrint", "false")
2403 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2404 urls += "?" + c.urlParams_.Encode()
2405 req, err := http.NewRequest("PATCH", urls, body)
2406 if err != nil {
2407 return nil, err
2408 }
2409 req.Header = reqHeaders
2410 googleapi.Expand(req.URL, map[string]string{
2411 "name": c.name,
2412 })
2413 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2414 }
2415
2416
2417
2418
2419
2420
2421 func (c *LocationsAdminsPatchCall) Do(opts ...googleapi.CallOption) (*Admin, error) {
2422 gensupport.SetOptions(c.urlParams_, opts...)
2423 res, err := c.doRequest("json")
2424 if res != nil && res.StatusCode == http.StatusNotModified {
2425 if res.Body != nil {
2426 res.Body.Close()
2427 }
2428 return nil, gensupport.WrapError(&googleapi.Error{
2429 Code: res.StatusCode,
2430 Header: res.Header,
2431 })
2432 }
2433 if err != nil {
2434 return nil, err
2435 }
2436 defer googleapi.CloseBody(res)
2437 if err := googleapi.CheckResponse(res); err != nil {
2438 return nil, gensupport.WrapError(err)
2439 }
2440 ret := &Admin{
2441 ServerResponse: googleapi.ServerResponse{
2442 Header: res.Header,
2443 HTTPStatusCode: res.StatusCode,
2444 },
2445 }
2446 target := &ret
2447 if err := gensupport.DecodeResponse(target, res); err != nil {
2448 return nil, err
2449 }
2450 return ret, nil
2451 }
2452
View as plain text