-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
mybusinessaccountmanagement-gen.go
3184 lines (2916 loc) · 111 KB
/
mybusinessaccountmanagement-gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2022 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package mybusinessaccountmanagement provides access to the My Business Account Management API.
//
// For product documentation, see: https://developers.google.com/my-business/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/mybusinessaccountmanagement/v1"
// ...
// ctx := context.Background()
// mybusinessaccountmanagementService, err := mybusinessaccountmanagement.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// mybusinessaccountmanagementService, err := mybusinessaccountmanagement.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// mybusinessaccountmanagementService, err := mybusinessaccountmanagement.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package mybusinessaccountmanagement // import "google.golang.org/api/mybusinessaccountmanagement/v1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
internal "google.golang.org/api/internal"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
const apiId = "mybusinessaccountmanagement:v1"
const apiName = "mybusinessaccountmanagement"
const apiVersion = "v1"
const basePath = "https://mybusinessaccountmanagement.googleapis.com/"
const mtlsBasePath = "https://mybusinessaccountmanagement.mtls.googleapis.com/"
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Accounts = NewAccountsService(s)
s.Locations = NewLocationsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Accounts *AccountsService
Locations *LocationsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewAccountsService(s *Service) *AccountsService {
rs := &AccountsService{s: s}
rs.Admins = NewAccountsAdminsService(s)
rs.Invitations = NewAccountsInvitationsService(s)
return rs
}
type AccountsService struct {
s *Service
Admins *AccountsAdminsService
Invitations *AccountsInvitationsService
}
func NewAccountsAdminsService(s *Service) *AccountsAdminsService {
rs := &AccountsAdminsService{s: s}
return rs
}
type AccountsAdminsService struct {
s *Service
}
func NewAccountsInvitationsService(s *Service) *AccountsInvitationsService {
rs := &AccountsInvitationsService{s: s}
return rs
}
type AccountsInvitationsService struct {
s *Service
}
func NewLocationsService(s *Service) *LocationsService {
rs := &LocationsService{s: s}
rs.Admins = NewLocationsAdminsService(s)
return rs
}
type LocationsService struct {
s *Service
Admins *LocationsAdminsService
}
func NewLocationsAdminsService(s *Service) *LocationsAdminsService {
rs := &LocationsAdminsService{s: s}
return rs
}
type LocationsAdminsService struct {
s *Service
}
// AcceptInvitationRequest: Request message for
// AccessControl.AcceptInvitation.
type AcceptInvitationRequest struct {
}
// Account: An account is a container for your location. If you are the
// only user who manages locations for your business, you can use your
// personal Google Account. To share management of locations with
// multiple users, [create a business account]
// (https://support.google.com/business/answer/6085339?ref_topic=6085325).
type Account struct {
// AccountName: Required. The name of the account. For an account of
// type `PERSONAL`, this is the first and last name of the user account.
AccountName string `json:"accountName,omitempty"`
// AccountNumber: Output only. Account reference number if provisioned.
AccountNumber string `json:"accountNumber,omitempty"`
// Name: Immutable. The resource name, in the format
// `accounts/{account_id}`.
Name string `json:"name,omitempty"`
// OrganizationInfo: Output only. Additional info for an organization.
// This is populated only for an organization account.
OrganizationInfo *OrganizationInfo `json:"organizationInfo,omitempty"`
// PermissionLevel: Output only. Specifies the permission level the user
// has for this account.
//
// Possible values:
// "PERMISSION_LEVEL_UNSPECIFIED" - Not specified.
// "OWNER_LEVEL" - The user has owner level permission.
// "MEMBER_LEVEL" - The user has member level permission.
PermissionLevel string `json:"permissionLevel,omitempty"`
// PrimaryOwner: Required. Input only. The resource name of the account
// which will be the primary owner of the account being created. It
// should be of the form `accounts/{account_id}/`.
PrimaryOwner string `json:"primaryOwner,omitempty"`
// Role: Output only. Specifies the AccountRole of this account.
//
// Possible values:
// "ACCOUNT_ROLE_UNSPECIFIED" - Not specified.
// "PRIMARY_OWNER" - The user is the primary owner this account.
// "OWNER" - The user owner of the account.
// "MANAGER" - The user can manage this account.
// "SITE_MANAGER" - The user can manage a limited set of features for
// the account.
Role string `json:"role,omitempty"`
// Type: Required. Contains the type of account. Accounts of type
// PERSONAL and ORGANIZATION cannot be created using this API.
//
// Possible values:
// "ACCOUNT_TYPE_UNSPECIFIED" - Not specified.
// "PERSONAL" - An end-user account.
// "LOCATION_GROUP" - A group of Locations. For more information, see
// the [help center article]
// (https://support.google.com/business/answer/6085326)
// "USER_GROUP" - A User Group for segregating organization staff in
// groups. For more information, see the [help center
// article](https://support.google.com/business/answer/7655731)
// "ORGANIZATION" - An organization representing a company. For more
// information, see the [help center
// article](https://support.google.com/business/answer/7663063)
Type string `json:"type,omitempty"`
// VerificationState: Output only. If verified, future locations that
// are created are automatically connected to Google Maps, and have
// Google+ pages created, without requiring moderation.
//
// Possible values:
// "VERIFICATION_STATE_UNSPECIFIED" - Not specified.
// "VERIFIED" - Verified account.
// "UNVERIFIED" - Account that is not verified, and verification has
// not been requested.
// "VERIFICATION_REQUESTED" - Account that is not verified, but
// verification has been requested.
VerificationState string `json:"verificationState,omitempty"`
// VettedState: Output only. Indicates whether the account is vetted by
// Google. A vetted account is able to verify locations via the
// VETTED_PARTNER method.
//
// Possible values:
// "VETTED_STATE_UNSPECIFIED" - Not Specified
// "NOT_VETTED" - The account is not vetted by Google.
// "VETTED" - The account is vetted by Google and in a valid state. An
// account is automatically vetted if it has direct access to a vetted
// group account.
// "INVALID" - The account is vetted but in an invalid state. The
// account will behave like an unvetted account.
VettedState string `json:"vettedState,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AccountName") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AccountName") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Account) MarshalJSON() ([]byte, error) {
type NoMethod Account
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Admin: An administrator of an Account or a location.
type Admin struct {
// Account: Immutable. The name of the Account resource that this Admin
// refers to. Used when calling CreateAccountAdmin or
// CreateLocationAdmin to invite UserGroups or LocationGroups as admins,
// respectively. If both this field and `admin` are set on `CREATE`
// requests, this field takes precedence and the email address in
// `admin` will be ignored. Format: `accounts/{account}`.
Account string `json:"account,omitempty"`
// Admin: Optional. The name of the admin. When making the initial
// invitation, this is the invitee's email address. On `GET` calls, the
// user's email address is returned if the invitation is still pending.
// Otherwise, it contains the user's first and last names. This field is
// only needed to be set during admin creation.
Admin string `json:"admin,omitempty"`
// Name: Immutable. The resource name. For account admins, this is in
// the form: `accounts/{account_id}/admins/{admin_id}` For location
// admins, this is in the form:
// `locations/{location_id}/admins/{admin_id}` This field will be
// ignored if set during admin creation.
Name string `json:"name,omitempty"`
// PendingInvitation: Output only. Indicates whether this admin has a
// pending invitation for the specified resource.
PendingInvitation bool `json:"pendingInvitation,omitempty"`
// Role: Required. Specifies the role that this admin uses with the
// specified Account or Location.
//
// Possible values:
// "ADMIN_ROLE_UNSPECIFIED" - Not specified.
// "PRIMARY_OWNER" - The admin has owner-level access and is the
// primary owner. (Displays as 'Primary Owner' in UI).
// "OWNER" - The admin has owner-level access. (Displays as 'Owner' in
// UI).
// "MANAGER" - The admin has managerial access.
// "SITE_MANAGER" - The admin can manage social (Google+) pages.
// (Displays as 'Site Manager' in UI). This API doesn't allow creating
// an account admin with a SITE_MANAGER role.
Role string `json:"role,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Account") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Account") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Admin) MarshalJSON() ([]byte, error) {
type NoMethod Admin
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// DeclineInvitationRequest: Request message for
// AccessControl.DeclineInvitation.
type DeclineInvitationRequest struct {
}
// Empty: A generic empty message that you can re-use to avoid defining
// duplicated empty messages in your APIs. A typical example is to use
// it as the request or the response type of an API method. For
// instance: service Foo { rpc Bar(google.protobuf.Empty) returns
// (google.protobuf.Empty); }
type Empty struct {
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
}
// Invitation: Represents a pending invitation.
type Invitation struct {
// Name: Required. The resource name for the invitation.
// `accounts/{account_id}/invitations/{invitation_id}`.
Name string `json:"name,omitempty"`
// Role: Output only. The invited role on the account.
//
// Possible values:
// "ADMIN_ROLE_UNSPECIFIED" - Not specified.
// "PRIMARY_OWNER" - The admin has owner-level access and is the
// primary owner. (Displays as 'Primary Owner' in UI).
// "OWNER" - The admin has owner-level access. (Displays as 'Owner' in
// UI).
// "MANAGER" - The admin has managerial access.
// "SITE_MANAGER" - The admin can manage social (Google+) pages.
// (Displays as 'Site Manager' in UI). This API doesn't allow creating
// an account admin with a SITE_MANAGER role.
Role string `json:"role,omitempty"`
// TargetAccount: The sparsely populated account this invitation is for.
TargetAccount *Account `json:"targetAccount,omitempty"`
// TargetLocation: The target location this invitation is for.
TargetLocation *TargetLocation `json:"targetLocation,omitempty"`
// TargetType: Output only. Specifies which target types should appear
// in the response.
//
// Possible values:
// "TARGET_TYPE_UNSPECIFIED" - Set when target type is unspecified.
// "ACCOUNTS_ONLY" - List invitations only for targets of type
// Account.
// "LOCATIONS_ONLY" - List invitations only for targets of type
// Location.
TargetType string `json:"targetType,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Invitation) MarshalJSON() ([]byte, error) {
type NoMethod Invitation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListAccountAdminsResponse: Response message for
// AccessControl.ListAccountAdmins.
type ListAccountAdminsResponse struct {
// AccountAdmins: A collection of Admin instances.
AccountAdmins []*Admin `json:"accountAdmins,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AccountAdmins") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AccountAdmins") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListAccountAdminsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListAccountAdminsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListAccountsResponse: Response message for Accounts.ListAccounts.
type ListAccountsResponse struct {
// Accounts: A collection of accounts to which the user has access. The
// personal account of the user doing the query will always be the first
// item of the result, unless it is filtered out.
Accounts []*Account `json:"accounts,omitempty"`
// NextPageToken: If the number of accounts exceeds the requested page
// size, this field is populated with a token to fetch the next page of
// accounts on a subsequent call to `accounts.list`. If there are no
// more accounts, this field is not present in the response.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Accounts") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Accounts") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListAccountsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListAccountsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListInvitationsResponse: Response message for
// AccessControl.ListInvitations.
type ListInvitationsResponse struct {
// Invitations: A collection of invitations that are pending for the
// account. The number of invitations listed here cannot exceed 1000.
Invitations []*Invitation `json:"invitations,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Invitations") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Invitations") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListInvitationsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListInvitationsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListLocationAdminsResponse: Response message for
// AccessControl.ListLocationAdmins.
type ListLocationAdminsResponse struct {
// Admins: A collection of Admins.
Admins []*Admin `json:"admins,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Admins") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Admins") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListLocationAdminsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListLocationAdminsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// OrganizationInfo: Additional information stored for an organization.
type OrganizationInfo struct {
// Address: Output only. The postal address for the account.
Address *PostalAddress `json:"address,omitempty"`
// PhoneNumber: Output only. The contact number for the organization.
PhoneNumber string `json:"phoneNumber,omitempty"`
// RegisteredDomain: Output only. The registered domain for the account.
RegisteredDomain string `json:"registeredDomain,omitempty"`
// ForceSendFields is a list of field names (e.g. "Address") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Address") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *OrganizationInfo) MarshalJSON() ([]byte, error) {
type NoMethod OrganizationInfo
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// PostalAddress: Represents a postal address, e.g. for postal delivery
// or payments addresses. Given a postal address, a postal service can
// deliver items to a premise, P.O. Box or similar. It is not intended
// to model geographical locations (roads, towns, mountains). In typical
// usage an address would be created via user input or from importing
// existing data, depending on the type of process. Advice on address
// input / editing: - Use an internationalization-ready address widget
// such as https://github.com/google/libaddressinput) - Users should not
// be presented with UI elements for input or editing of fields outside
// countries where that field is used. For more guidance on how to use
// this schema, please see:
// https://support.google.com/business/answer/6397478
type PostalAddress struct {
// AddressLines: Unstructured address lines describing the lower levels
// of an address. Because values in address_lines do not have type
// information and may sometimes contain multiple values in a single
// field (e.g. "Austin, TX"), it is important that the line order is
// clear. The order of address lines should be "envelope order" for the
// country/region of the address. In places where this can vary (e.g.
// Japan), address_language is used to make it explicit (e.g. "ja" for
// large-to-small ordering and "ja-Latn" or "en" for small-to-large).
// This way, the most specific line of an address can be selected based
// on the language. The minimum permitted structural representation of
// an address consists of a region_code with all remaining information
// placed in the address_lines. It would be possible to format such an
// address very approximately without geocoding, but no semantic
// reasoning could be made about any of the address components until it
// was at least partially resolved. Creating an address only containing
// a region_code and address_lines, and then geocoding is the
// recommended way to handle completely unstructured addresses (as
// opposed to guessing which parts of the address should be localities
// or administrative areas).
AddressLines []string `json:"addressLines,omitempty"`
// AdministrativeArea: Optional. Highest administrative subdivision
// which is used for postal addresses of a country or region. For
// example, this can be a state, a province, an oblast, or a prefecture.
// Specifically, for Spain this is the province and not the autonomous
// community (e.g. "Barcelona" and not "Catalonia"). Many countries
// don't use an administrative area in postal addresses. E.g. in
// Switzerland this should be left unpopulated.
AdministrativeArea string `json:"administrativeArea,omitempty"`
// LanguageCode: Optional. BCP-47 language code of the contents of this
// address (if known). This is often the UI language of the input form
// or is expected to match one of the languages used in the address'
// country/region, or their transliterated equivalents. This can affect
// formatting in certain countries, but is not critical to the
// correctness of the data and will never affect any validation or other
// non-formatting related operations. If this value is not known, it
// should be omitted (rather than specifying a possibly incorrect
// default). Examples: "zh-Hant", "ja", "ja-Latn", "en".
LanguageCode string `json:"languageCode,omitempty"`
// Locality: Optional. Generally refers to the city/town portion of the
// address. Examples: US city, IT comune, UK post town. In regions of
// the world where localities are not well defined or do not fit into
// this structure well, leave locality empty and use address_lines.
Locality string `json:"locality,omitempty"`
// Organization: Optional. The name of the organization at the address.
Organization string `json:"organization,omitempty"`
// PostalCode: Optional. Postal code of the address. Not all countries
// use or require postal codes to be present, but where they are used,
// they may trigger additional validation with other parts of the
// address (e.g. state/zip validation in the U.S.A.).
PostalCode string `json:"postalCode,omitempty"`
// Recipients: Optional. The recipient at the address. This field may,
// under certain circumstances, contain multiline information. For
// example, it might contain "care of" information.
Recipients []string `json:"recipients,omitempty"`
// RegionCode: Required. CLDR region code of the country/region of the
// address. This is never inferred and it is up to the user to ensure
// the value is correct. See https://cldr.unicode.org/ and
// https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html
// for details. Example: "CH" for Switzerland.
RegionCode string `json:"regionCode,omitempty"`
// Revision: The schema revision of the `PostalAddress`. This must be
// set to 0, which is the latest revision. All new revisions **must** be
// backward compatible with old revisions.
Revision int64 `json:"revision,omitempty"`
// SortingCode: Optional. Additional, country-specific, sorting code.
// This is not used in most regions. Where it is used, the value is
// either a string like "CEDEX", optionally followed by a number (e.g.
// "CEDEX 7"), or just a number alone, representing the "sector code"
// (Jamaica), "delivery area indicator" (Malawi) or "post office
// indicator" (e.g. Côte d'Ivoire).
SortingCode string `json:"sortingCode,omitempty"`
// Sublocality: Optional. Sublocality of the address. For example, this
// can be neighborhoods, boroughs, districts.
Sublocality string `json:"sublocality,omitempty"`
// ForceSendFields is a list of field names (e.g. "AddressLines") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AddressLines") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *PostalAddress) MarshalJSON() ([]byte, error) {
type NoMethod PostalAddress
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TargetLocation: Represents a target location for a pending
// invitation.
type TargetLocation struct {
// Address: The address of the location to which the user is invited.
Address string `json:"address,omitempty"`
// LocationName: The name of the location to which the user is invited.
LocationName string `json:"locationName,omitempty"`
// ForceSendFields is a list of field names (e.g. "Address") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Address") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *TargetLocation) MarshalJSON() ([]byte, error) {
type NoMethod TargetLocation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// TransferLocationRequest: Request message for
// AccessControl.TransferLocation.
type TransferLocationRequest struct {
// DestinationAccount: Required. Name of the account resource to
// transfer the location to (for example, "accounts/{account}").
DestinationAccount string `json:"destinationAccount,omitempty"`
// ForceSendFields is a list of field names (e.g. "DestinationAccount")
// to unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DestinationAccount") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *TransferLocationRequest) MarshalJSON() ([]byte, error) {
type NoMethod TransferLocationRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// method id "mybusinessaccountmanagement.accounts.create":
type AccountsCreateCall struct {
s *Service
account *Account
urlParams_ gensupport.URLParams
ctx_ context.Context
header_ http.Header
}
// Create: Creates an account with the specified name and type under the
// given parent. - Personal accounts and Organizations cannot be
// created. - User Groups cannot be created with a Personal account as
// primary owner. - Location Groups cannot be created with a primary
// owner of a Personal account if the Personal account is in an
// Organization. - Location Groups cannot own Location Groups.
func (r *AccountsService) Create(account *Account) *AccountsCreateCall {
c := &AccountsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.account = account
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *AccountsCreateCall) Fields(s ...googleapi.Field) *AccountsCreateCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *AccountsCreateCall) Context(ctx context.Context) *AccountsCreateCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *AccountsCreateCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *AccountsCreateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
if err != nil {
return nil, err
}
reqHeaders.Set("Content-Type", "application/json")
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("POST", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "mybusinessaccountmanagement.accounts.create" call.
// Exactly one of *Account or error will be non-nil. Any non-2xx status
// code is an error. Response headers are in either
// *Account.ServerResponse.Header or (if a response was returned at all)
// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified
// was returned.
func (c *AccountsCreateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &Account{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Creates an account with the specified name and type under the given parent. - Personal accounts and Organizations cannot be created. - User Groups cannot be created with a Personal account as primary owner. - Location Groups cannot be created with a primary owner of a Personal account if the Personal account is in an Organization. - Location Groups cannot own Location Groups.",
// "flatPath": "v1/accounts",
// "httpMethod": "POST",
// "id": "mybusinessaccountmanagement.accounts.create",
// "parameterOrder": [],
// "parameters": {},
// "path": "v1/accounts",
// "request": {
// "$ref": "Account"
// },
// "response": {
// "$ref": "Account"
// }
// }
}
// method id "mybusinessaccountmanagement.accounts.get":
type AccountsGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Gets the specified account. Returns `NOT_FOUND` if the account
// does not exist or if the caller does not have access rights to it.
//
// - name: The name of the account to fetch.
func (r *AccountsService) Get(name string) *AccountsGetCall {
c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *AccountsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())