...

Source file src/google.golang.org/api/mybusinessaccountmanagement/v1/mybusinessaccountmanagement-gen.go

Documentation: google.golang.org/api/mybusinessaccountmanagement/v1

     1  // Copyright 2024 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package mybusinessaccountmanagement provides access to the My Business Account Management API.
     8  //
     9  // For product documentation, see: https://developers.google.com/my-business/
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/mybusinessaccountmanagement/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	mybusinessaccountmanagementService, err := mybusinessaccountmanagement.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // To use an API key for authentication (note: some APIs do not support API
    38  // keys), use [google.golang.org/api/option.WithAPIKey]:
    39  //
    40  //	mybusinessaccountmanagementService, err := mybusinessaccountmanagement.NewService(ctx, option.WithAPIKey("AIza..."))
    41  //
    42  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    43  // flow, use [google.golang.org/api/option.WithTokenSource]:
    44  //
    45  //	config := &oauth2.Config{...}
    46  //	// ...
    47  //	token, err := config.Exchange(ctx, ...)
    48  //	mybusinessaccountmanagementService, err := mybusinessaccountmanagement.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package mybusinessaccountmanagement // import "google.golang.org/api/mybusinessaccountmanagement/v1"
    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  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    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  // NewService creates a new Service.
    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  // New creates a new Service. It uses the provided http.Client for requests.
   117  //
   118  // Deprecated: please use NewService instead.
   119  // To provide a custom HTTP client, use option.WithHTTPClient.
   120  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   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 // API endpoint base URL
   134  	UserAgent string // optional additional User-Agent fragment
   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  // AcceptInvitationRequest: Request message for AccessControl.AcceptInvitation.
   203  type AcceptInvitationRequest struct {
   204  }
   205  
   206  // Account: An account is a container for your location. If you are the only
   207  // user who manages locations for your business, you can use your personal
   208  // Google Account. To share management of locations with multiple users,
   209  // [create a business account]
   210  // (https://support.google.com/business/answer/6085339?ref_topic=6085325).
   211  type Account struct {
   212  	// AccountName: Required. The name of the account. For an account of type
   213  	// `PERSONAL`, this is the first and last name of the user account.
   214  	AccountName string `json:"accountName,omitempty"`
   215  	// AccountNumber: Output only. Account reference number if provisioned.
   216  	AccountNumber string `json:"accountNumber,omitempty"`
   217  	// Name: Immutable. The resource name, in the format `accounts/{account_id}`.
   218  	Name string `json:"name,omitempty"`
   219  	// OrganizationInfo: Output only. Additional info for an organization. This is
   220  	// populated only for an organization account.
   221  	OrganizationInfo *OrganizationInfo `json:"organizationInfo,omitempty"`
   222  	// PermissionLevel: Output only. Specifies the permission level the user has
   223  	// for this account.
   224  	//
   225  	// Possible values:
   226  	//   "PERMISSION_LEVEL_UNSPECIFIED" - Not specified.
   227  	//   "OWNER_LEVEL" - The user has owner level permission.
   228  	//   "MEMBER_LEVEL" - The user has member level permission.
   229  	PermissionLevel string `json:"permissionLevel,omitempty"`
   230  	// PrimaryOwner: Required. Input only. The resource name of the account which
   231  	// will be the primary owner of the account being created. It should be of the
   232  	// form `accounts/{account_id}`.
   233  	PrimaryOwner string `json:"primaryOwner,omitempty"`
   234  	// Role: Output only. Specifies the AccountRole of this account.
   235  	//
   236  	// Possible values:
   237  	//   "ACCOUNT_ROLE_UNSPECIFIED" - Not specified.
   238  	//   "PRIMARY_OWNER" - The user is the primary owner this account.
   239  	//   "OWNER" - The user owner of the account.
   240  	//   "MANAGER" - The user can manage this account.
   241  	//   "SITE_MANAGER" - The user can manage a limited set of features for the
   242  	// account.
   243  	Role string `json:"role,omitempty"`
   244  	// Type: Required. Contains the type of account. Accounts of type PERSONAL and
   245  	// ORGANIZATION cannot be created using this API.
   246  	//
   247  	// Possible values:
   248  	//   "ACCOUNT_TYPE_UNSPECIFIED" - Not specified.
   249  	//   "PERSONAL" - An end-user account.
   250  	//   "LOCATION_GROUP" - A group of Locations. For more information, see the
   251  	// [help center article] (https://support.google.com/business/answer/6085326)
   252  	//   "USER_GROUP" - A User Group for segregating organization staff in groups.
   253  	// For more information, see the [help center
   254  	// article](https://support.google.com/business/answer/7655731)
   255  	//   "ORGANIZATION" - An organization representing a company. For more
   256  	// information, see the [help center
   257  	// article](https://support.google.com/business/answer/7663063)
   258  	Type string `json:"type,omitempty"`
   259  	// VerificationState: Output only. If verified, future locations that are
   260  	// created are automatically connected to Google Maps, and have Google+ pages
   261  	// created, without requiring moderation.
   262  	//
   263  	// Possible values:
   264  	//   "VERIFICATION_STATE_UNSPECIFIED" - Not specified.
   265  	//   "VERIFIED" - Verified account.
   266  	//   "UNVERIFIED" - Account that is not verified, and verification has not been
   267  	// requested.
   268  	//   "VERIFICATION_REQUESTED" - Account that is not verified, but verification
   269  	// has been requested.
   270  	VerificationState string `json:"verificationState,omitempty"`
   271  	// VettedState: Output only. Indicates whether the account is vetted by Google.
   272  	// A vetted account is able to verify locations via the VETTED_PARTNER method.
   273  	//
   274  	// Possible values:
   275  	//   "VETTED_STATE_UNSPECIFIED" - Not Specified
   276  	//   "NOT_VETTED" - The account is not vetted by Google.
   277  	//   "VETTED" - The account is vetted by Google and in a valid state. An
   278  	// account is automatically vetted if it has direct access to a vetted group
   279  	// account.
   280  	//   "INVALID" - The account is vetted but in an invalid state. The account
   281  	// will behave like an unvetted account.
   282  	VettedState string `json:"vettedState,omitempty"`
   283  
   284  	// ServerResponse contains the HTTP response code and headers from the server.
   285  	googleapi.ServerResponse `json:"-"`
   286  	// ForceSendFields is a list of field names (e.g. "AccountName") to
   287  	// unconditionally include in API requests. By default, fields with empty or
   288  	// default values are omitted from API requests. See
   289  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   290  	// details.
   291  	ForceSendFields []string `json:"-"`
   292  	// NullFields is a list of field names (e.g. "AccountName") to include in API
   293  	// requests with the JSON null value. By default, fields with empty values are
   294  	// omitted from API requests. See
   295  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   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  // Admin: An administrator of an Account or a location.
   305  type Admin struct {
   306  	// Account: Immutable. The name of the Account resource that this Admin refers
   307  	// to. Used when calling locations.admins.create to invite a LocationGroup as
   308  	// an admin. If both this field and `admin` are set on `CREATE` requests, this
   309  	// field takes precedence and the email address in `admin` will be ignored.
   310  	// Format: `accounts/{account}`.
   311  	Account string `json:"account,omitempty"`
   312  	// Admin: Optional. The name of the admin. When making the initial invitation,
   313  	// this is the invitee's email address. On `GET` calls, the user's email
   314  	// address is returned if the invitation is still pending. Otherwise, it
   315  	// contains the user's first and last names. This field is only needed to be
   316  	// set during admin creation.
   317  	Admin string `json:"admin,omitempty"`
   318  	// Name: Immutable. The resource name. For account admins, this is in the form:
   319  	// `accounts/{account_id}/admins/{admin_id}` For location admins, this is in
   320  	// the form: `locations/{location_id}/admins/{admin_id}` This field will be
   321  	// ignored if set during admin creation.
   322  	Name string `json:"name,omitempty"`
   323  	// PendingInvitation: Output only. Indicates whether this admin has a pending
   324  	// invitation for the specified resource.
   325  	PendingInvitation bool `json:"pendingInvitation,omitempty"`
   326  	// Role: Required. Specifies the role that this admin uses with the specified
   327  	// Account or Location.
   328  	//
   329  	// Possible values:
   330  	//   "ADMIN_ROLE_UNSPECIFIED" - Not specified.
   331  	//   "PRIMARY_OWNER" - The admin has owner-level access and is the primary
   332  	// owner. (Displays as 'Primary Owner' in UI).
   333  	//   "OWNER" - The admin has owner-level access. (Displays as 'Owner' in UI).
   334  	//   "MANAGER" - The admin has managerial access.
   335  	//   "SITE_MANAGER" - The admin can manage social (Google+) pages. (Displays as
   336  	// 'Site Manager' in UI). This API doesn't allow creating an account admin with
   337  	// a SITE_MANAGER role.
   338  	Role string `json:"role,omitempty"`
   339  
   340  	// ServerResponse contains the HTTP response code and headers from the server.
   341  	googleapi.ServerResponse `json:"-"`
   342  	// ForceSendFields is a list of field names (e.g. "Account") to unconditionally
   343  	// include in API requests. By default, fields with empty or default values are
   344  	// omitted from API requests. See
   345  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   346  	// details.
   347  	ForceSendFields []string `json:"-"`
   348  	// NullFields is a list of field names (e.g. "Account") to include in API
   349  	// requests with the JSON null value. By default, fields with empty values are
   350  	// omitted from API requests. See
   351  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   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  // DeclineInvitationRequest: Request message for
   361  // AccessControl.DeclineInvitation.
   362  type DeclineInvitationRequest struct {
   363  }
   364  
   365  // Empty: A generic empty message that you can re-use to avoid defining
   366  // duplicated empty messages in your APIs. A typical example is to use it as
   367  // the request or the response type of an API method. For instance: service Foo
   368  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   369  type Empty struct {
   370  	// ServerResponse contains the HTTP response code and headers from the server.
   371  	googleapi.ServerResponse `json:"-"`
   372  }
   373  
   374  // Invitation: Represents a pending invitation.
   375  type Invitation struct {
   376  	// Name: Required. The resource name for the invitation.
   377  	// `accounts/{account_id}/invitations/{invitation_id}`.
   378  	Name string `json:"name,omitempty"`
   379  	// Role: Output only. The invited role on the account.
   380  	//
   381  	// Possible values:
   382  	//   "ADMIN_ROLE_UNSPECIFIED" - Not specified.
   383  	//   "PRIMARY_OWNER" - The admin has owner-level access and is the primary
   384  	// owner. (Displays as 'Primary Owner' in UI).
   385  	//   "OWNER" - The admin has owner-level access. (Displays as 'Owner' in UI).
   386  	//   "MANAGER" - The admin has managerial access.
   387  	//   "SITE_MANAGER" - The admin can manage social (Google+) pages. (Displays as
   388  	// 'Site Manager' in UI). This API doesn't allow creating an account admin with
   389  	// a SITE_MANAGER role.
   390  	Role string `json:"role,omitempty"`
   391  	// TargetAccount: The sparsely populated account this invitation is for.
   392  	TargetAccount *Account `json:"targetAccount,omitempty"`
   393  	// TargetLocation: The target location this invitation is for.
   394  	TargetLocation *TargetLocation `json:"targetLocation,omitempty"`
   395  	// TargetType: Output only. Specifies which target types should appear in the
   396  	// response.
   397  	//
   398  	// Possible values:
   399  	//   "TARGET_TYPE_UNSPECIFIED" - Set when target type is unspecified.
   400  	//   "ACCOUNTS_ONLY" - List invitations only for targets of type Account.
   401  	//   "LOCATIONS_ONLY" - List invitations only for targets of type Location.
   402  	TargetType string `json:"targetType,omitempty"`
   403  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
   404  	// include in API requests. By default, fields with empty or default values are
   405  	// omitted from API requests. See
   406  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   407  	// details.
   408  	ForceSendFields []string `json:"-"`
   409  	// NullFields is a list of field names (e.g. "Name") to include in API requests
   410  	// with the JSON null value. By default, fields with empty values are omitted
   411  	// from API requests. See
   412  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   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  // ListAccountAdminsResponse: Response message for
   422  // AccessControl.ListAccountAdmins.
   423  type ListAccountAdminsResponse struct {
   424  	// AccountAdmins: A collection of Admin instances.
   425  	AccountAdmins []*Admin `json:"accountAdmins,omitempty"`
   426  
   427  	// ServerResponse contains the HTTP response code and headers from the server.
   428  	googleapi.ServerResponse `json:"-"`
   429  	// ForceSendFields is a list of field names (e.g. "AccountAdmins") to
   430  	// unconditionally include in API requests. By default, fields with empty or
   431  	// default values are omitted from API requests. See
   432  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   433  	// details.
   434  	ForceSendFields []string `json:"-"`
   435  	// NullFields is a list of field names (e.g. "AccountAdmins") to include in API
   436  	// requests with the JSON null value. By default, fields with empty values are
   437  	// omitted from API requests. See
   438  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   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  // ListAccountsResponse: Response message for Accounts.ListAccounts.
   448  type ListAccountsResponse struct {
   449  	// Accounts: A collection of accounts to which the user has access. The
   450  	// personal account of the user doing the query will always be the first item
   451  	// of the result, unless it is filtered out.
   452  	Accounts []*Account `json:"accounts,omitempty"`
   453  	// NextPageToken: If the number of accounts exceeds the requested page size,
   454  	// this field is populated with a token to fetch the next page of accounts on a
   455  	// subsequent call to `accounts.list`. If there are no more accounts, this
   456  	// field is not present in the response.
   457  	NextPageToken string `json:"nextPageToken,omitempty"`
   458  
   459  	// ServerResponse contains the HTTP response code and headers from the server.
   460  	googleapi.ServerResponse `json:"-"`
   461  	// ForceSendFields is a list of field names (e.g. "Accounts") to
   462  	// unconditionally include in API requests. By default, fields with empty or
   463  	// default values are omitted from API requests. See
   464  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   465  	// details.
   466  	ForceSendFields []string `json:"-"`
   467  	// NullFields is a list of field names (e.g. "Accounts") to include in API
   468  	// requests with the JSON null value. By default, fields with empty values are
   469  	// omitted from API requests. See
   470  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   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  // ListInvitationsResponse: Response message for AccessControl.ListInvitations.
   480  type ListInvitationsResponse struct {
   481  	// Invitations: A collection of invitations that are pending for the account.
   482  	// The number of invitations listed here cannot exceed 1000.
   483  	Invitations []*Invitation `json:"invitations,omitempty"`
   484  
   485  	// ServerResponse contains the HTTP response code and headers from the server.
   486  	googleapi.ServerResponse `json:"-"`
   487  	// ForceSendFields is a list of field names (e.g. "Invitations") to
   488  	// unconditionally include in API requests. By default, fields with empty or
   489  	// default values are omitted from API requests. See
   490  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   491  	// details.
   492  	ForceSendFields []string `json:"-"`
   493  	// NullFields is a list of field names (e.g. "Invitations") to include in API
   494  	// requests with the JSON null value. By default, fields with empty values are
   495  	// omitted from API requests. See
   496  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   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  // ListLocationAdminsResponse: Response message for
   506  // AccessControl.ListLocationAdmins.
   507  type ListLocationAdminsResponse struct {
   508  	// Admins: A collection of Admins.
   509  	Admins []*Admin `json:"admins,omitempty"`
   510  
   511  	// ServerResponse contains the HTTP response code and headers from the server.
   512  	googleapi.ServerResponse `json:"-"`
   513  	// ForceSendFields is a list of field names (e.g. "Admins") to unconditionally
   514  	// include in API requests. By default, fields with empty or default values are
   515  	// omitted from API requests. See
   516  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   517  	// details.
   518  	ForceSendFields []string `json:"-"`
   519  	// NullFields is a list of field names (e.g. "Admins") to include in API
   520  	// requests with the JSON null value. By default, fields with empty values are
   521  	// omitted from API requests. See
   522  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   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  // OrganizationInfo: Additional information stored for an organization.
   532  type OrganizationInfo struct {
   533  	// Address: Output only. The postal address for the account.
   534  	Address *PostalAddress `json:"address,omitempty"`
   535  	// PhoneNumber: Output only. The contact number for the organization.
   536  	PhoneNumber string `json:"phoneNumber,omitempty"`
   537  	// RegisteredDomain: Output only. The registered domain for the account.
   538  	RegisteredDomain string `json:"registeredDomain,omitempty"`
   539  	// ForceSendFields is a list of field names (e.g. "Address") to unconditionally
   540  	// include in API requests. By default, fields with empty or default values are
   541  	// omitted from API requests. See
   542  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   543  	// details.
   544  	ForceSendFields []string `json:"-"`
   545  	// NullFields is a list of field names (e.g. "Address") to include in API
   546  	// requests with the JSON null value. By default, fields with empty values are
   547  	// omitted from API requests. See
   548  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   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  // PostalAddress: Represents a postal address, e.g. for postal delivery or
   558  // payments addresses. Given a postal address, a postal service can deliver
   559  // items to a premise, P.O. Box or similar. It is not intended to model
   560  // geographical locations (roads, towns, mountains). In typical usage an
   561  // address would be created via user input or from importing existing data,
   562  // depending on the type of process. Advice on address input / editing: - Use
   563  // an internationalization-ready address widget such as
   564  // https://github.com/google/libaddressinput) - Users should not be presented
   565  // with UI elements for input or editing of fields outside countries where that
   566  // field is used. For more guidance on how to use this schema, please see:
   567  // https://support.google.com/business/answer/6397478
   568  type PostalAddress struct {
   569  	// AddressLines: Unstructured address lines describing the lower levels of an
   570  	// address. Because values in address_lines do not have type information and
   571  	// may sometimes contain multiple values in a single field (e.g. "Austin, TX"),
   572  	// it is important that the line order is clear. The order of address lines
   573  	// should be "envelope order" for the country/region of the address. In places
   574  	// where this can vary (e.g. Japan), address_language is used to make it
   575  	// explicit (e.g. "ja" for large-to-small ordering and "ja-Latn" or "en" for
   576  	// small-to-large). This way, the most specific line of an address can be
   577  	// selected based on the language. The minimum permitted structural
   578  	// representation of an address consists of a region_code with all remaining
   579  	// information placed in the address_lines. It would be possible to format such
   580  	// an address very approximately without geocoding, but no semantic reasoning
   581  	// could be made about any of the address components until it was at least
   582  	// partially resolved. Creating an address only containing a region_code and
   583  	// address_lines, and then geocoding is the recommended way to handle
   584  	// completely unstructured addresses (as opposed to guessing which parts of the
   585  	// address should be localities or administrative areas).
   586  	AddressLines []string `json:"addressLines,omitempty"`
   587  	// AdministrativeArea: Optional. Highest administrative subdivision which is
   588  	// used for postal addresses of a country or region. For example, this can be a
   589  	// state, a province, an oblast, or a prefecture. Specifically, for Spain this
   590  	// is the province and not the autonomous community (e.g. "Barcelona" and not
   591  	// "Catalonia"). Many countries don't use an administrative area in postal
   592  	// addresses. E.g. in Switzerland this should be left unpopulated.
   593  	AdministrativeArea string `json:"administrativeArea,omitempty"`
   594  	// LanguageCode: Optional. BCP-47 language code of the contents of this address
   595  	// (if known). This is often the UI language of the input form or is expected
   596  	// to match one of the languages used in the address' country/region, or their
   597  	// transliterated equivalents. This can affect formatting in certain countries,
   598  	// but is not critical to the correctness of the data and will never affect any
   599  	// validation or other non-formatting related operations. If this value is not
   600  	// known, it should be omitted (rather than specifying a possibly incorrect
   601  	// default). Examples: "zh-Hant", "ja", "ja-Latn", "en".
   602  	LanguageCode string `json:"languageCode,omitempty"`
   603  	// Locality: Optional. Generally refers to the city/town portion of the
   604  	// address. Examples: US city, IT comune, UK post town. In regions of the world
   605  	// where localities are not well defined or do not fit into this structure
   606  	// well, leave locality empty and use address_lines.
   607  	Locality string `json:"locality,omitempty"`
   608  	// Organization: Optional. The name of the organization at the address.
   609  	Organization string `json:"organization,omitempty"`
   610  	// PostalCode: Optional. Postal code of the address. Not all countries use or
   611  	// require postal codes to be present, but where they are used, they may
   612  	// trigger additional validation with other parts of the address (e.g.
   613  	// state/zip validation in the U.S.A.).
   614  	PostalCode string `json:"postalCode,omitempty"`
   615  	// Recipients: Optional. The recipient at the address. This field may, under
   616  	// certain circumstances, contain multiline information. For example, it might
   617  	// contain "care of" information.
   618  	Recipients []string `json:"recipients,omitempty"`
   619  	// RegionCode: Required. CLDR region code of the country/region of the address.
   620  	// This is never inferred and it is up to the user to ensure the value is
   621  	// correct. See https://cldr.unicode.org/ and
   622  	// https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html
   623  	// for details. Example: "CH" for Switzerland.
   624  	RegionCode string `json:"regionCode,omitempty"`
   625  	// Revision: The schema revision of the `PostalAddress`. This must be set to 0,
   626  	// which is the latest revision. All new revisions **must** be backward
   627  	// compatible with old revisions.
   628  	Revision int64 `json:"revision,omitempty"`
   629  	// SortingCode: Optional. Additional, country-specific, sorting code. This is
   630  	// not used in most regions. Where it is used, the value is either a string
   631  	// like "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a
   632  	// number alone, representing the "sector code" (Jamaica), "delivery area
   633  	// indicator" (Malawi) or "post office indicator" (e.g. Côte d'Ivoire).
   634  	SortingCode string `json:"sortingCode,omitempty"`
   635  	// Sublocality: Optional. Sublocality of the address. For example, this can be
   636  	// neighborhoods, boroughs, districts.
   637  	Sublocality string `json:"sublocality,omitempty"`
   638  	// ForceSendFields is a list of field names (e.g. "AddressLines") to
   639  	// unconditionally include in API requests. By default, fields with empty or
   640  	// default values are omitted from API requests. See
   641  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   642  	// details.
   643  	ForceSendFields []string `json:"-"`
   644  	// NullFields is a list of field names (e.g. "AddressLines") to include in API
   645  	// requests with the JSON null value. By default, fields with empty values are
   646  	// omitted from API requests. See
   647  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   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  // TargetLocation: Represents a target location for a pending invitation.
   657  type TargetLocation struct {
   658  	// Address: The address of the location to which the user is invited.
   659  	Address string `json:"address,omitempty"`
   660  	// LocationName: The name of the location to which the user is invited.
   661  	LocationName string `json:"locationName,omitempty"`
   662  	// ForceSendFields is a list of field names (e.g. "Address") to unconditionally
   663  	// include in API requests. By default, fields with empty or default values are
   664  	// omitted from API requests. See
   665  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   666  	// details.
   667  	ForceSendFields []string `json:"-"`
   668  	// NullFields is a list of field names (e.g. "Address") to include in API
   669  	// requests with the JSON null value. By default, fields with empty values are
   670  	// omitted from API requests. See
   671  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   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  // TransferLocationRequest: Request message for AccessControl.TransferLocation.
   681  type TransferLocationRequest struct {
   682  	// DestinationAccount: Required. Name of the account resource to transfer the
   683  	// location to (for example, "accounts/{account}").
   684  	DestinationAccount string `json:"destinationAccount,omitempty"`
   685  	// ForceSendFields is a list of field names (e.g. "DestinationAccount") to
   686  	// unconditionally include in API requests. By default, fields with empty or
   687  	// default values are omitted from API requests. See
   688  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   689  	// details.
   690  	ForceSendFields []string `json:"-"`
   691  	// NullFields is a list of field names (e.g. "DestinationAccount") to include
   692  	// in API requests with the JSON null value. By default, fields with empty
   693  	// values are omitted from API requests. See
   694  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   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  // Create: Creates an account with the specified name and type under the given
   712  // parent. - Personal accounts and Organizations cannot be created. - User
   713  // Groups cannot be created with a Personal account as primary owner. -
   714  // Location Groups cannot be created with a primary owner of a Personal account
   715  // if the Personal account is in an Organization. - Location Groups cannot own
   716  // Location Groups.
   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  // Fields allows partial responses to be retrieved. See
   724  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   725  // details.
   726  func (c *AccountsCreateCall) Fields(s ...googleapi.Field) *AccountsCreateCall {
   727  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   728  	return c
   729  }
   730  
   731  // Context sets the context to be used in this call's Do method.
   732  func (c *AccountsCreateCall) Context(ctx context.Context) *AccountsCreateCall {
   733  	c.ctx_ = ctx
   734  	return c
   735  }
   736  
   737  // Header returns a http.Header that can be modified by the caller to add
   738  // headers to the request.
   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  // Do executes the "mybusinessaccountmanagement.accounts.create" call.
   766  // Any non-2xx status code is an error. Response headers are in either
   767  // *Account.ServerResponse.Header or (if a response was returned at all) in
   768  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   769  // whether the returned error was because http.StatusNotModified was returned.
   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  // Get: Gets the specified account. Returns `NOT_FOUND` if the account does not
   812  // exist or if the caller does not have access rights to it.
   813  //
   814  // - name: The name of the account to fetch.
   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  // Fields allows partial responses to be retrieved. See
   822  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   823  // details.
   824  func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
   825  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   826  	return c
   827  }
   828  
   829  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   830  // object's ETag matches the given value. This is useful for getting updates
   831  // only after the object has changed since the last request.
   832  func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
   833  	c.ifNoneMatch_ = entityTag
   834  	return c
   835  }
   836  
   837  // Context sets the context to be used in this call's Do method.
   838  func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
   839  	c.ctx_ = ctx
   840  	return c
   841  }
   842  
   843  // Header returns a http.Header that can be modified by the caller to add
   844  // headers to the request.
   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  // Do executes the "mybusinessaccountmanagement.accounts.get" call.
   874  // Any non-2xx status code is an error. Response headers are in either
   875  // *Account.ServerResponse.Header or (if a response was returned at all) in
   876  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   877  // whether the returned error was because http.StatusNotModified was returned.
   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  // List: Lists all of the accounts for the authenticated user. This includes
   919  // all accounts that the user owns, as well as any accounts for which the user
   920  // has management rights.
   921  func (r *AccountsService) List() *AccountsListCall {
   922  	c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   923  	return c
   924  }
   925  
   926  // Filter sets the optional parameter "filter": A filter constraining the
   927  // accounts to return. The response includes only entries that match the
   928  // filter. If `filter` is empty, then no constraints are applied and all
   929  // accounts (paginated) are retrieved for the requested account. For example, a
   930  // request with the filter `type=USER_GROUP` will only return user groups. The
   931  // `type` field is the only supported filter.
   932  func (c *AccountsListCall) Filter(filter string) *AccountsListCall {
   933  	c.urlParams_.Set("filter", filter)
   934  	return c
   935  }
   936  
   937  // PageSize sets the optional parameter "pageSize": How many accounts to fetch
   938  // per page. The default and maximum is 20.
   939  func (c *AccountsListCall) PageSize(pageSize int64) *AccountsListCall {
   940  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   941  	return c
   942  }
   943  
   944  // PageToken sets the optional parameter "pageToken": If specified, the next
   945  // page of accounts is retrieved. The `pageToken` is returned when a call to
   946  // `accounts.list` returns more results than can fit into the requested page
   947  // size.
   948  func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
   949  	c.urlParams_.Set("pageToken", pageToken)
   950  	return c
   951  }
   952  
   953  // ParentAccount sets the optional parameter "parentAccount": The resource name
   954  // of the account for which the list of directly accessible accounts is to be
   955  // retrieved. This only makes sense for Organizations and User Groups. If
   956  // empty, will return `ListAccounts` for the authenticated user.
   957  // `accounts/{account_id}`.
   958  func (c *AccountsListCall) ParentAccount(parentAccount string) *AccountsListCall {
   959  	c.urlParams_.Set("parentAccount", parentAccount)
   960  	return c
   961  }
   962  
   963  // Fields allows partial responses to be retrieved. See
   964  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   965  // details.
   966  func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
   967  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   968  	return c
   969  }
   970  
   971  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   972  // object's ETag matches the given value. This is useful for getting updates
   973  // only after the object has changed since the last request.
   974  func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
   975  	c.ifNoneMatch_ = entityTag
   976  	return c
   977  }
   978  
   979  // Context sets the context to be used in this call's Do method.
   980  func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
   981  	c.ctx_ = ctx
   982  	return c
   983  }
   984  
   985  // Header returns a http.Header that can be modified by the caller to add
   986  // headers to the request.
   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  // Do executes the "mybusinessaccountmanagement.accounts.list" call.
  1013  // Any non-2xx status code is an error. Response headers are in either
  1014  // *ListAccountsResponse.ServerResponse.Header or (if a response was returned
  1015  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1016  // check whether the returned error was because http.StatusNotModified was
  1017  // returned.
  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  // Pages invokes f for each page of results.
  1051  // A non-nil error returned from f will halt the iteration.
  1052  // The provided context supersedes any context provided to the Context method.
  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  // Patch: Updates the specified business account. Personal accounts cannot be
  1081  // updated using this method.
  1082  //
  1083  // - name: Immutable. The resource name, in the format `accounts/{account_id}`.
  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  // UpdateMask sets the optional parameter "updateMask": Required. The specific
  1092  // fields that should be updated. The only editable field is `accountName`.
  1093  func (c *AccountsPatchCall) UpdateMask(updateMask string) *AccountsPatchCall {
  1094  	c.urlParams_.Set("updateMask", updateMask)
  1095  	return c
  1096  }
  1097  
  1098  // ValidateOnly sets the optional parameter "validateOnly": If true, the
  1099  // request is validated without actually updating the account.
  1100  func (c *AccountsPatchCall) ValidateOnly(validateOnly bool) *AccountsPatchCall {
  1101  	c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
  1102  	return c
  1103  }
  1104  
  1105  // Fields allows partial responses to be retrieved. See
  1106  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1107  // details.
  1108  func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall {
  1109  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1110  	return c
  1111  }
  1112  
  1113  // Context sets the context to be used in this call's Do method.
  1114  func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall {
  1115  	c.ctx_ = ctx
  1116  	return c
  1117  }
  1118  
  1119  // Header returns a http.Header that can be modified by the caller to add
  1120  // headers to the request.
  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  // Do executes the "mybusinessaccountmanagement.accounts.patch" call.
  1151  // Any non-2xx status code is an error. Response headers are in either
  1152  // *Account.ServerResponse.Header or (if a response was returned at all) in
  1153  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1154  // whether the returned error was because http.StatusNotModified was returned.
  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  // Create: Invites the specified user to become an administrator for the
  1197  // specified account. The invitee must accept the invitation in order to be
  1198  // granted access to the account. See AcceptInvitation to programmatically
  1199  // accept an invitation.
  1200  //
  1201  //   - parent: The resource name of the account this admin is created for.
  1202  //     `accounts/{account_id}`.
  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  // Fields allows partial responses to be retrieved. See
  1211  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1212  // details.
  1213  func (c *AccountsAdminsCreateCall) Fields(s ...googleapi.Field) *AccountsAdminsCreateCall {
  1214  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1215  	return c
  1216  }
  1217  
  1218  // Context sets the context to be used in this call's Do method.
  1219  func (c *AccountsAdminsCreateCall) Context(ctx context.Context) *AccountsAdminsCreateCall {
  1220  	c.ctx_ = ctx
  1221  	return c
  1222  }
  1223  
  1224  // Header returns a http.Header that can be modified by the caller to add
  1225  // headers to the request.
  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  // Do executes the "mybusinessaccountmanagement.accounts.admins.create" call.
  1256  // Any non-2xx status code is an error. Response headers are in either
  1257  // *Admin.ServerResponse.Header or (if a response was returned at all) in
  1258  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1259  // whether the returned error was because http.StatusNotModified was returned.
  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  // Delete: Removes the specified admin from the specified account.
  1301  //
  1302  //   - name: The resource name of the admin to remove from the account.
  1303  //     `accounts/{account_id}/admins/{admin_id}`.
  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  // Fields allows partial responses to be retrieved. See
  1311  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1312  // details.
  1313  func (c *AccountsAdminsDeleteCall) Fields(s ...googleapi.Field) *AccountsAdminsDeleteCall {
  1314  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1315  	return c
  1316  }
  1317  
  1318  // Context sets the context to be used in this call's Do method.
  1319  func (c *AccountsAdminsDeleteCall) Context(ctx context.Context) *AccountsAdminsDeleteCall {
  1320  	c.ctx_ = ctx
  1321  	return c
  1322  }
  1323  
  1324  // Header returns a http.Header that can be modified by the caller to add
  1325  // headers to the request.
  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  // Do executes the "mybusinessaccountmanagement.accounts.admins.delete" call.
  1352  // Any non-2xx status code is an error. Response headers are in either
  1353  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1354  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1355  // whether the returned error was because http.StatusNotModified was returned.
  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  // List: Lists the admins for the specified account.
  1398  //
  1399  //   - parent: The name of the account from which to retrieve a list of admins.
  1400  //     `accounts/{account_id}/admins`.
  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  // Fields allows partial responses to be retrieved. See
  1408  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1409  // details.
  1410  func (c *AccountsAdminsListCall) Fields(s ...googleapi.Field) *AccountsAdminsListCall {
  1411  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1412  	return c
  1413  }
  1414  
  1415  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1416  // object's ETag matches the given value. This is useful for getting updates
  1417  // only after the object has changed since the last request.
  1418  func (c *AccountsAdminsListCall) IfNoneMatch(entityTag string) *AccountsAdminsListCall {
  1419  	c.ifNoneMatch_ = entityTag
  1420  	return c
  1421  }
  1422  
  1423  // Context sets the context to be used in this call's Do method.
  1424  func (c *AccountsAdminsListCall) Context(ctx context.Context) *AccountsAdminsListCall {
  1425  	c.ctx_ = ctx
  1426  	return c
  1427  }
  1428  
  1429  // Header returns a http.Header that can be modified by the caller to add
  1430  // headers to the request.
  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  // Do executes the "mybusinessaccountmanagement.accounts.admins.list" call.
  1460  // Any non-2xx status code is an error. Response headers are in either
  1461  // *ListAccountAdminsResponse.ServerResponse.Header or (if a response was
  1462  // returned at all) in error.(*googleapi.Error).Header. Use
  1463  // googleapi.IsNotModified to check whether the returned error was because
  1464  // http.StatusNotModified was returned.
  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  // Patch: Updates the Admin for the specified Account Admin.
  1507  //
  1508  //   - name: Immutable. The resource name. For account admins, this is in the
  1509  //     form: `accounts/{account_id}/admins/{admin_id}` For location admins, this
  1510  //     is in the form: `locations/{location_id}/admins/{admin_id}` This field
  1511  //     will be ignored if set during admin creation.
  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  // UpdateMask sets the optional parameter "updateMask": Required. The specific
  1520  // fields that should be updated. The only editable field is role.
  1521  func (c *AccountsAdminsPatchCall) UpdateMask(updateMask string) *AccountsAdminsPatchCall {
  1522  	c.urlParams_.Set("updateMask", updateMask)
  1523  	return c
  1524  }
  1525  
  1526  // Fields allows partial responses to be retrieved. See
  1527  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1528  // details.
  1529  func (c *AccountsAdminsPatchCall) Fields(s ...googleapi.Field) *AccountsAdminsPatchCall {
  1530  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1531  	return c
  1532  }
  1533  
  1534  // Context sets the context to be used in this call's Do method.
  1535  func (c *AccountsAdminsPatchCall) Context(ctx context.Context) *AccountsAdminsPatchCall {
  1536  	c.ctx_ = ctx
  1537  	return c
  1538  }
  1539  
  1540  // Header returns a http.Header that can be modified by the caller to add
  1541  // headers to the request.
  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  // Do executes the "mybusinessaccountmanagement.accounts.admins.patch" call.
  1572  // Any non-2xx status code is an error. Response headers are in either
  1573  // *Admin.ServerResponse.Header or (if a response was returned at all) in
  1574  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1575  // whether the returned error was because http.StatusNotModified was returned.
  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  // Accept: Accepts the specified invitation.
  1618  //
  1619  //   - name: The name of the invitation that is being accepted.
  1620  //     `accounts/{account_id}/invitations/{invitation_id}`.
  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  // Fields allows partial responses to be retrieved. See
  1629  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1630  // details.
  1631  func (c *AccountsInvitationsAcceptCall) Fields(s ...googleapi.Field) *AccountsInvitationsAcceptCall {
  1632  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1633  	return c
  1634  }
  1635  
  1636  // Context sets the context to be used in this call's Do method.
  1637  func (c *AccountsInvitationsAcceptCall) Context(ctx context.Context) *AccountsInvitationsAcceptCall {
  1638  	c.ctx_ = ctx
  1639  	return c
  1640  }
  1641  
  1642  // Header returns a http.Header that can be modified by the caller to add
  1643  // headers to the request.
  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  // Do executes the "mybusinessaccountmanagement.accounts.invitations.accept" call.
  1674  // Any non-2xx status code is an error. Response headers are in either
  1675  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1676  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1677  // whether the returned error was because http.StatusNotModified was returned.
  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  // Decline: Declines the specified invitation.
  1720  //
  1721  //   - name: The name of the account invitation that is being declined.
  1722  //     `accounts/{account_id}/invitations/{invitation_id}`.
  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  // Fields allows partial responses to be retrieved. See
  1731  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1732  // details.
  1733  func (c *AccountsInvitationsDeclineCall) Fields(s ...googleapi.Field) *AccountsInvitationsDeclineCall {
  1734  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1735  	return c
  1736  }
  1737  
  1738  // Context sets the context to be used in this call's Do method.
  1739  func (c *AccountsInvitationsDeclineCall) Context(ctx context.Context) *AccountsInvitationsDeclineCall {
  1740  	c.ctx_ = ctx
  1741  	return c
  1742  }
  1743  
  1744  // Header returns a http.Header that can be modified by the caller to add
  1745  // headers to the request.
  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  // Do executes the "mybusinessaccountmanagement.accounts.invitations.decline" call.
  1776  // Any non-2xx status code is an error. Response headers are in either
  1777  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1778  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1779  // whether the returned error was because http.StatusNotModified was returned.
  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  // List: Lists pending invitations for the specified account.
  1822  //
  1823  //   - parent: The name of the account from which the list of invitations is
  1824  //     being retrieved. `accounts/{account_id}/invitations`.
  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  // Filter sets the optional parameter "filter": Filtering the response is
  1832  // supported via the Invitation.target_type field.
  1833  func (c *AccountsInvitationsListCall) Filter(filter string) *AccountsInvitationsListCall {
  1834  	c.urlParams_.Set("filter", filter)
  1835  	return c
  1836  }
  1837  
  1838  // Fields allows partial responses to be retrieved. See
  1839  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1840  // details.
  1841  func (c *AccountsInvitationsListCall) Fields(s ...googleapi.Field) *AccountsInvitationsListCall {
  1842  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1843  	return c
  1844  }
  1845  
  1846  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1847  // object's ETag matches the given value. This is useful for getting updates
  1848  // only after the object has changed since the last request.
  1849  func (c *AccountsInvitationsListCall) IfNoneMatch(entityTag string) *AccountsInvitationsListCall {
  1850  	c.ifNoneMatch_ = entityTag
  1851  	return c
  1852  }
  1853  
  1854  // Context sets the context to be used in this call's Do method.
  1855  func (c *AccountsInvitationsListCall) Context(ctx context.Context) *AccountsInvitationsListCall {
  1856  	c.ctx_ = ctx
  1857  	return c
  1858  }
  1859  
  1860  // Header returns a http.Header that can be modified by the caller to add
  1861  // headers to the request.
  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  // Do executes the "mybusinessaccountmanagement.accounts.invitations.list" call.
  1891  // Any non-2xx status code is an error. Response headers are in either
  1892  // *ListInvitationsResponse.ServerResponse.Header or (if a response was
  1893  // returned at all) in error.(*googleapi.Error).Header. Use
  1894  // googleapi.IsNotModified to check whether the returned error was because
  1895  // http.StatusNotModified was returned.
  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  // Transfer: Moves a location from an account that the user owns to another
  1938  // account that the same user administers. The user must be an owner of the
  1939  // account the location is currently associated with and must also be at least
  1940  // a manager of the destination account.
  1941  //
  1942  // - name: The name of the location to transfer. `locations/{location_id}`.
  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  // Fields allows partial responses to be retrieved. See
  1951  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1952  // details.
  1953  func (c *LocationsTransferCall) Fields(s ...googleapi.Field) *LocationsTransferCall {
  1954  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1955  	return c
  1956  }
  1957  
  1958  // Context sets the context to be used in this call's Do method.
  1959  func (c *LocationsTransferCall) Context(ctx context.Context) *LocationsTransferCall {
  1960  	c.ctx_ = ctx
  1961  	return c
  1962  }
  1963  
  1964  // Header returns a http.Header that can be modified by the caller to add
  1965  // headers to the request.
  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  // Do executes the "mybusinessaccountmanagement.locations.transfer" call.
  1996  // Any non-2xx status code is an error. Response headers are in either
  1997  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1998  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1999  // whether the returned error was because http.StatusNotModified was returned.
  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  // Create: Invites the specified user to become an administrator for the
  2042  // specified location. The invitee must accept the invitation in order to be
  2043  // granted access to the location. See AcceptInvitation to programmatically
  2044  // accept an invitation.
  2045  //
  2046  //   - parent: The resource name of the location this admin is created for.
  2047  //     `locations/{location_id}/admins`.
  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  // Fields allows partial responses to be retrieved. See
  2056  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2057  // details.
  2058  func (c *LocationsAdminsCreateCall) Fields(s ...googleapi.Field) *LocationsAdminsCreateCall {
  2059  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2060  	return c
  2061  }
  2062  
  2063  // Context sets the context to be used in this call's Do method.
  2064  func (c *LocationsAdminsCreateCall) Context(ctx context.Context) *LocationsAdminsCreateCall {
  2065  	c.ctx_ = ctx
  2066  	return c
  2067  }
  2068  
  2069  // Header returns a http.Header that can be modified by the caller to add
  2070  // headers to the request.
  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  // Do executes the "mybusinessaccountmanagement.locations.admins.create" call.
  2101  // Any non-2xx status code is an error. Response headers are in either
  2102  // *Admin.ServerResponse.Header or (if a response was returned at all) in
  2103  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2104  // whether the returned error was because http.StatusNotModified was returned.
  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  // Delete: Removes the specified admin as a manager of the specified location.
  2146  //
  2147  // - name: The resource name of the admin to remove from the location.
  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  // Fields allows partial responses to be retrieved. See
  2155  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2156  // details.
  2157  func (c *LocationsAdminsDeleteCall) Fields(s ...googleapi.Field) *LocationsAdminsDeleteCall {
  2158  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2159  	return c
  2160  }
  2161  
  2162  // Context sets the context to be used in this call's Do method.
  2163  func (c *LocationsAdminsDeleteCall) Context(ctx context.Context) *LocationsAdminsDeleteCall {
  2164  	c.ctx_ = ctx
  2165  	return c
  2166  }
  2167  
  2168  // Header returns a http.Header that can be modified by the caller to add
  2169  // headers to the request.
  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  // Do executes the "mybusinessaccountmanagement.locations.admins.delete" call.
  2196  // Any non-2xx status code is an error. Response headers are in either
  2197  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2198  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2199  // whether the returned error was because http.StatusNotModified was returned.
  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  // List: Lists all of the admins for the specified location.
  2242  //
  2243  //   - parent: The name of the location to list admins of.
  2244  //     `locations/{location_id}/admins`.
  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  // Fields allows partial responses to be retrieved. See
  2252  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2253  // details.
  2254  func (c *LocationsAdminsListCall) Fields(s ...googleapi.Field) *LocationsAdminsListCall {
  2255  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2256  	return c
  2257  }
  2258  
  2259  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2260  // object's ETag matches the given value. This is useful for getting updates
  2261  // only after the object has changed since the last request.
  2262  func (c *LocationsAdminsListCall) IfNoneMatch(entityTag string) *LocationsAdminsListCall {
  2263  	c.ifNoneMatch_ = entityTag
  2264  	return c
  2265  }
  2266  
  2267  // Context sets the context to be used in this call's Do method.
  2268  func (c *LocationsAdminsListCall) Context(ctx context.Context) *LocationsAdminsListCall {
  2269  	c.ctx_ = ctx
  2270  	return c
  2271  }
  2272  
  2273  // Header returns a http.Header that can be modified by the caller to add
  2274  // headers to the request.
  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  // Do executes the "mybusinessaccountmanagement.locations.admins.list" call.
  2304  // Any non-2xx status code is an error. Response headers are in either
  2305  // *ListLocationAdminsResponse.ServerResponse.Header or (if a response was
  2306  // returned at all) in error.(*googleapi.Error).Header. Use
  2307  // googleapi.IsNotModified to check whether the returned error was because
  2308  // http.StatusNotModified was returned.
  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  // Patch: Updates the Admin for the specified location. Only the AdminRole of
  2351  // the Admin can be updated.
  2352  //
  2353  //   - name: Immutable. The resource name. For account admins, this is in the
  2354  //     form: `accounts/{account_id}/admins/{admin_id}` For location admins, this
  2355  //     is in the form: `locations/{location_id}/admins/{admin_id}` This field
  2356  //     will be ignored if set during admin creation.
  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  // UpdateMask sets the optional parameter "updateMask": Required. The specific
  2365  // fields that should be updated. The only editable field is role.
  2366  func (c *LocationsAdminsPatchCall) UpdateMask(updateMask string) *LocationsAdminsPatchCall {
  2367  	c.urlParams_.Set("updateMask", updateMask)
  2368  	return c
  2369  }
  2370  
  2371  // Fields allows partial responses to be retrieved. See
  2372  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2373  // details.
  2374  func (c *LocationsAdminsPatchCall) Fields(s ...googleapi.Field) *LocationsAdminsPatchCall {
  2375  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2376  	return c
  2377  }
  2378  
  2379  // Context sets the context to be used in this call's Do method.
  2380  func (c *LocationsAdminsPatchCall) Context(ctx context.Context) *LocationsAdminsPatchCall {
  2381  	c.ctx_ = ctx
  2382  	return c
  2383  }
  2384  
  2385  // Header returns a http.Header that can be modified by the caller to add
  2386  // headers to the request.
  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  // Do executes the "mybusinessaccountmanagement.locations.admins.patch" call.
  2417  // Any non-2xx status code is an error. Response headers are in either
  2418  // *Admin.ServerResponse.Header or (if a response was returned at all) in
  2419  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2420  // whether the returned error was because http.StatusNotModified was returned.
  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