...

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

Documentation: google.golang.org/api/cloudbilling/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 cloudbilling provides access to the Cloud Billing API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/billing/docs/apis
    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/cloudbilling/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	cloudbillingService, err := cloudbilling.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  // By default, all available scopes (see "Constants") are used to authenticate.
    38  // To restrict scopes, use [google.golang.org/api/option.WithScopes]:
    39  //
    40  //	cloudbillingService, err := cloudbilling.NewService(ctx, option.WithScopes(cloudbilling.CloudPlatformScope))
    41  //
    42  // To use an API key for authentication (note: some APIs do not support API
    43  // keys), use [google.golang.org/api/option.WithAPIKey]:
    44  //
    45  //	cloudbillingService, err := cloudbilling.NewService(ctx, option.WithAPIKey("AIza..."))
    46  //
    47  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    48  // flow, use [google.golang.org/api/option.WithTokenSource]:
    49  //
    50  //	config := &oauth2.Config{...}
    51  //	// ...
    52  //	token, err := config.Exchange(ctx, ...)
    53  //	cloudbillingService, err := cloudbilling.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    54  //
    55  // See [google.golang.org/api/option.ClientOption] for details on options.
    56  package cloudbilling // import "google.golang.org/api/cloudbilling/v1"
    57  
    58  import (
    59  	"bytes"
    60  	"context"
    61  	"encoding/json"
    62  	"errors"
    63  	"fmt"
    64  	"io"
    65  	"net/http"
    66  	"net/url"
    67  	"strconv"
    68  	"strings"
    69  
    70  	googleapi "google.golang.org/api/googleapi"
    71  	internal "google.golang.org/api/internal"
    72  	gensupport "google.golang.org/api/internal/gensupport"
    73  	option "google.golang.org/api/option"
    74  	internaloption "google.golang.org/api/option/internaloption"
    75  	htransport "google.golang.org/api/transport/http"
    76  )
    77  
    78  // Always reference these packages, just in case the auto-generated code
    79  // below doesn't.
    80  var _ = bytes.NewBuffer
    81  var _ = strconv.Itoa
    82  var _ = fmt.Sprintf
    83  var _ = json.NewDecoder
    84  var _ = io.Copy
    85  var _ = url.Parse
    86  var _ = gensupport.MarshalJSON
    87  var _ = googleapi.Version
    88  var _ = errors.New
    89  var _ = strings.Replace
    90  var _ = context.Canceled
    91  var _ = internaloption.WithDefaultEndpoint
    92  var _ = internal.Version
    93  
    94  const apiId = "cloudbilling:v1"
    95  const apiName = "cloudbilling"
    96  const apiVersion = "v1"
    97  const basePath = "https://cloudbilling.googleapis.com/"
    98  const basePathTemplate = "https://cloudbilling.UNIVERSE_DOMAIN/"
    99  const mtlsBasePath = "https://cloudbilling.mtls.googleapis.com/"
   100  
   101  // OAuth2 scopes used by this API.
   102  const (
   103  	// View and manage your Google Cloud Platform billing accounts
   104  	CloudBillingScope = "https://www.googleapis.com/auth/cloud-billing"
   105  
   106  	// View your Google Cloud Platform billing accounts
   107  	CloudBillingReadonlyScope = "https://www.googleapis.com/auth/cloud-billing.readonly"
   108  
   109  	// See, edit, configure, and delete your Google Cloud data and see the email
   110  	// address for your Google Account.
   111  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
   112  )
   113  
   114  // NewService creates a new APIService.
   115  func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, error) {
   116  	scopesOption := internaloption.WithDefaultScopes(
   117  		"https://www.googleapis.com/auth/cloud-billing",
   118  		"https://www.googleapis.com/auth/cloud-billing.readonly",
   119  		"https://www.googleapis.com/auth/cloud-platform",
   120  	)
   121  	// NOTE: prepend, so we don't override user-specified scopes.
   122  	opts = append([]option.ClientOption{scopesOption}, opts...)
   123  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   124  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   125  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   126  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   127  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   128  	if err != nil {
   129  		return nil, err
   130  	}
   131  	s, err := New(client)
   132  	if err != nil {
   133  		return nil, err
   134  	}
   135  	if endpoint != "" {
   136  		s.BasePath = endpoint
   137  	}
   138  	return s, nil
   139  }
   140  
   141  // New creates a new APIService. It uses the provided http.Client for requests.
   142  //
   143  // Deprecated: please use NewService instead.
   144  // To provide a custom HTTP client, use option.WithHTTPClient.
   145  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   146  func New(client *http.Client) (*APIService, error) {
   147  	if client == nil {
   148  		return nil, errors.New("client is nil")
   149  	}
   150  	s := &APIService{client: client, BasePath: basePath}
   151  	s.BillingAccounts = NewBillingAccountsService(s)
   152  	s.Organizations = NewOrganizationsService(s)
   153  	s.Projects = NewProjectsService(s)
   154  	s.Services = NewServicesService(s)
   155  	return s, nil
   156  }
   157  
   158  type APIService struct {
   159  	client    *http.Client
   160  	BasePath  string // API endpoint base URL
   161  	UserAgent string // optional additional User-Agent fragment
   162  
   163  	BillingAccounts *BillingAccountsService
   164  
   165  	Organizations *OrganizationsService
   166  
   167  	Projects *ProjectsService
   168  
   169  	Services *ServicesService
   170  }
   171  
   172  func (s *APIService) userAgent() string {
   173  	if s.UserAgent == "" {
   174  		return googleapi.UserAgent
   175  	}
   176  	return googleapi.UserAgent + " " + s.UserAgent
   177  }
   178  
   179  func NewBillingAccountsService(s *APIService) *BillingAccountsService {
   180  	rs := &BillingAccountsService{s: s}
   181  	rs.Projects = NewBillingAccountsProjectsService(s)
   182  	rs.SubAccounts = NewBillingAccountsSubAccountsService(s)
   183  	return rs
   184  }
   185  
   186  type BillingAccountsService struct {
   187  	s *APIService
   188  
   189  	Projects *BillingAccountsProjectsService
   190  
   191  	SubAccounts *BillingAccountsSubAccountsService
   192  }
   193  
   194  func NewBillingAccountsProjectsService(s *APIService) *BillingAccountsProjectsService {
   195  	rs := &BillingAccountsProjectsService{s: s}
   196  	return rs
   197  }
   198  
   199  type BillingAccountsProjectsService struct {
   200  	s *APIService
   201  }
   202  
   203  func NewBillingAccountsSubAccountsService(s *APIService) *BillingAccountsSubAccountsService {
   204  	rs := &BillingAccountsSubAccountsService{s: s}
   205  	return rs
   206  }
   207  
   208  type BillingAccountsSubAccountsService struct {
   209  	s *APIService
   210  }
   211  
   212  func NewOrganizationsService(s *APIService) *OrganizationsService {
   213  	rs := &OrganizationsService{s: s}
   214  	rs.BillingAccounts = NewOrganizationsBillingAccountsService(s)
   215  	return rs
   216  }
   217  
   218  type OrganizationsService struct {
   219  	s *APIService
   220  
   221  	BillingAccounts *OrganizationsBillingAccountsService
   222  }
   223  
   224  func NewOrganizationsBillingAccountsService(s *APIService) *OrganizationsBillingAccountsService {
   225  	rs := &OrganizationsBillingAccountsService{s: s}
   226  	return rs
   227  }
   228  
   229  type OrganizationsBillingAccountsService struct {
   230  	s *APIService
   231  }
   232  
   233  func NewProjectsService(s *APIService) *ProjectsService {
   234  	rs := &ProjectsService{s: s}
   235  	return rs
   236  }
   237  
   238  type ProjectsService struct {
   239  	s *APIService
   240  }
   241  
   242  func NewServicesService(s *APIService) *ServicesService {
   243  	rs := &ServicesService{s: s}
   244  	rs.Skus = NewServicesSkusService(s)
   245  	return rs
   246  }
   247  
   248  type ServicesService struct {
   249  	s *APIService
   250  
   251  	Skus *ServicesSkusService
   252  }
   253  
   254  func NewServicesSkusService(s *APIService) *ServicesSkusService {
   255  	rs := &ServicesSkusService{s: s}
   256  	return rs
   257  }
   258  
   259  type ServicesSkusService struct {
   260  	s *APIService
   261  }
   262  
   263  // AggregationInfo: Represents the aggregation level and interval for pricing
   264  // of a single SKU.
   265  type AggregationInfo struct {
   266  	// AggregationCount: The number of intervals to aggregate over. Example: If
   267  	// aggregation_level is "DAILY" and aggregation_count is 14, aggregation will
   268  	// be over 14 days.
   269  	AggregationCount int64 `json:"aggregationCount,omitempty"`
   270  	// Possible values:
   271  	//   "AGGREGATION_INTERVAL_UNSPECIFIED"
   272  	//   "DAILY"
   273  	//   "MONTHLY"
   274  	AggregationInterval string `json:"aggregationInterval,omitempty"`
   275  	// Possible values:
   276  	//   "AGGREGATION_LEVEL_UNSPECIFIED"
   277  	//   "ACCOUNT"
   278  	//   "PROJECT"
   279  	AggregationLevel string `json:"aggregationLevel,omitempty"`
   280  	// ForceSendFields is a list of field names (e.g. "AggregationCount") to
   281  	// unconditionally include in API requests. By default, fields with empty or
   282  	// default values are omitted from API requests. See
   283  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   284  	// details.
   285  	ForceSendFields []string `json:"-"`
   286  	// NullFields is a list of field names (e.g. "AggregationCount") to include in
   287  	// API requests with the JSON null value. By default, fields with empty values
   288  	// are omitted from API requests. See
   289  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   290  	NullFields []string `json:"-"`
   291  }
   292  
   293  func (s *AggregationInfo) MarshalJSON() ([]byte, error) {
   294  	type NoMethod AggregationInfo
   295  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   296  }
   297  
   298  // AuditConfig: Specifies the audit configuration for a service. The
   299  // configuration determines which permission types are logged, and what
   300  // identities, if any, are exempted from logging. An AuditConfig must have one
   301  // or more AuditLogConfigs. If there are AuditConfigs for both `allServices`
   302  // and a specific service, the union of the two AuditConfigs is used for that
   303  // service: the log_types specified in each AuditConfig are enabled, and the
   304  // exempted_members in each AuditLogConfig are exempted. Example Policy with
   305  // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices",
   306  // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [
   307  // "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type":
   308  // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com",
   309  // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type":
   310  // "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For
   311  // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
   312  // logging. It also exempts `jose@example.com` from DATA_READ logging, and
   313  // `aliya@example.com` from DATA_WRITE logging.
   314  type AuditConfig struct {
   315  	// AuditLogConfigs: The configuration for logging of each type of permission.
   316  	AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
   317  	// Service: Specifies a service that will be enabled for audit logging. For
   318  	// example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices`
   319  	// is a special value that covers all services.
   320  	Service string `json:"service,omitempty"`
   321  	// ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
   322  	// unconditionally include in API requests. By default, fields with empty or
   323  	// default values are omitted from API requests. See
   324  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   325  	// details.
   326  	ForceSendFields []string `json:"-"`
   327  	// NullFields is a list of field names (e.g. "AuditLogConfigs") to include in
   328  	// API requests with the JSON null value. By default, fields with empty values
   329  	// are omitted from API requests. See
   330  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   331  	NullFields []string `json:"-"`
   332  }
   333  
   334  func (s *AuditConfig) MarshalJSON() ([]byte, error) {
   335  	type NoMethod AuditConfig
   336  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   337  }
   338  
   339  // AuditLogConfig: Provides the configuration for logging a type of
   340  // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ",
   341  // "exempted_members": [ "user:jose@example.com" ] }, { "log_type":
   342  // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while
   343  // exempting jose@example.com from DATA_READ logging.
   344  type AuditLogConfig struct {
   345  	// ExemptedMembers: Specifies the identities that do not cause logging for this
   346  	// type of permission. Follows the same format of Binding.members.
   347  	ExemptedMembers []string `json:"exemptedMembers,omitempty"`
   348  	// LogType: The log type that this config enables.
   349  	//
   350  	// Possible values:
   351  	//   "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
   352  	//   "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
   353  	//   "DATA_WRITE" - Data writes. Example: CloudSQL Users create
   354  	//   "DATA_READ" - Data reads. Example: CloudSQL Users list
   355  	LogType string `json:"logType,omitempty"`
   356  	// ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
   357  	// unconditionally include in API requests. By default, fields with empty or
   358  	// default values are omitted from API requests. See
   359  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   360  	// details.
   361  	ForceSendFields []string `json:"-"`
   362  	// NullFields is a list of field names (e.g. "ExemptedMembers") to include in
   363  	// API requests with the JSON null value. By default, fields with empty values
   364  	// are omitted from API requests. See
   365  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   366  	NullFields []string `json:"-"`
   367  }
   368  
   369  func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
   370  	type NoMethod AuditLogConfig
   371  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   372  }
   373  
   374  // BillingAccount: A billing account in the Google Cloud Console
   375  // (https://console.cloud.google.com/). You can assign a billing account to one
   376  // or more projects.
   377  type BillingAccount struct {
   378  	// DisplayName: The display name given to the billing account, such as `My
   379  	// Billing Account`. This name is displayed in the Google Cloud Console.
   380  	DisplayName string `json:"displayName,omitempty"`
   381  	// MasterBillingAccount: If this account is a subaccount
   382  	// (https://cloud.google.com/billing/docs/concepts), then this will be the
   383  	// resource name of the parent billing account that it is being resold through.
   384  	// Otherwise this will be empty.
   385  	MasterBillingAccount string `json:"masterBillingAccount,omitempty"`
   386  	// Name: Output only. The resource name of the billing account. The resource
   387  	// name has the form `billingAccounts/{billing_account_id}`. For example,
   388  	// `billingAccounts/012345-567890-ABCDEF` would be the resource name for
   389  	// billing account `012345-567890-ABCDEF`.
   390  	Name string `json:"name,omitempty"`
   391  	// Open: Output only. True if the billing account is open, and will therefore
   392  	// be charged for any usage on associated projects. False if the billing
   393  	// account is closed, and therefore projects associated with it are unable to
   394  	// use paid services.
   395  	Open bool `json:"open,omitempty"`
   396  	// Parent: Output only. The billing account's parent resource identifier. Use
   397  	// the `MoveBillingAccount` method to update the account's parent resource if
   398  	// it is a organization. Format: - `organizations/{organization_id}`, for
   399  	// example, `organizations/12345678` - `billingAccounts/{billing_account_id}`,
   400  	// for example, `billingAccounts/012345-567890-ABCDEF`
   401  	Parent string `json:"parent,omitempty"`
   402  
   403  	// ServerResponse contains the HTTP response code and headers from the server.
   404  	googleapi.ServerResponse `json:"-"`
   405  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   406  	// unconditionally include in API requests. By default, fields with empty or
   407  	// default values are omitted from API requests. See
   408  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   409  	// details.
   410  	ForceSendFields []string `json:"-"`
   411  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
   412  	// requests with the JSON null value. By default, fields with empty values are
   413  	// omitted from API requests. See
   414  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   415  	NullFields []string `json:"-"`
   416  }
   417  
   418  func (s *BillingAccount) MarshalJSON() ([]byte, error) {
   419  	type NoMethod BillingAccount
   420  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   421  }
   422  
   423  // Binding: Associates `members`, or principals, with a `role`.
   424  type Binding struct {
   425  	// Condition: The condition that is associated with this binding. If the
   426  	// condition evaluates to `true`, then this binding applies to the current
   427  	// request. If the condition evaluates to `false`, then this binding does not
   428  	// apply to the current request. However, a different role binding might grant
   429  	// the same role to one or more of the principals in this binding. To learn
   430  	// which resources support conditions in their IAM policies, see the IAM
   431  	// documentation
   432  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   433  	Condition *Expr `json:"condition,omitempty"`
   434  	// Members: Specifies the principals requesting access for a Google Cloud
   435  	// resource. `members` can have the following values: * `allUsers`: A special
   436  	// identifier that represents anyone who is on the internet; with or without a
   437  	// Google account. * `allAuthenticatedUsers`: A special identifier that
   438  	// represents anyone who is authenticated with a Google account or a service
   439  	// account. Does not include identities that come from external identity
   440  	// providers (IdPs) through identity federation. * `user:{emailid}`: An email
   441  	// address that represents a specific Google account. For example,
   442  	// `alice@example.com` . * `serviceAccount:{emailid}`: An email address that
   443  	// represents a Google service account. For example,
   444  	// `my-other-app@appspot.gserviceaccount.com`. *
   445  	// `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
   446  	// identifier for a Kubernetes service account
   447  	// (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
   448  	// For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
   449  	// `group:{emailid}`: An email address that represents a Google group. For
   450  	// example, `admins@example.com`. * `domain:{domain}`: The G Suite domain
   451  	// (primary) that represents all the users of that domain. For example,
   452  	// `google.com` or `example.com`. *
   453  	// `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub
   454  	// ject/{subject_attribute_value}`: A single identity in a workforce identity
   455  	// pool. *
   456  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   457  	// group/{group_id}`: All workforce identities in a group. *
   458  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   459  	// attribute.{attribute_name}/{attribute_value}`: All workforce identities with
   460  	// a specific attribute value. *
   461  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   462  	// *`: All identities in a workforce identity pool. *
   463  	// `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo
   464  	// rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single
   465  	// identity in a workload identity pool. *
   466  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   467  	// /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool
   468  	// group. *
   469  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   470  	// /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
   471  	// `: All identities in a workload identity pool with a certain attribute. *
   472  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   473  	// /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity
   474  	// pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
   475  	// unique identifier) representing a user that has been recently deleted. For
   476  	// example, `alice@example.com?uid=123456789012345678901`. If the user is
   477  	// recovered, this value reverts to `user:{emailid}` and the recovered user
   478  	// retains the role in the binding. *
   479  	// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
   480  	// unique identifier) representing a service account that has been recently
   481  	// deleted. For example,
   482  	// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the
   483  	// service account is undeleted, this value reverts to
   484  	// `serviceAccount:{emailid}` and the undeleted service account retains the
   485  	// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
   486  	// address (plus unique identifier) representing a Google group that has been
   487  	// recently deleted. For example,
   488  	// `admins@example.com?uid=123456789012345678901`. If the group is recovered,
   489  	// this value reverts to `group:{emailid}` and the recovered group retains the
   490  	// role in the binding. *
   491  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool
   492  	// _id}/subject/{subject_attribute_value}`: Deleted single identity in a
   493  	// workforce identity pool. For example,
   494  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po
   495  	// ol-id/subject/my-subject-attribute-value`.
   496  	Members []string `json:"members,omitempty"`
   497  	// Role: Role that is assigned to the list of `members`, or principals. For
   498  	// example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview
   499  	// of the IAM roles and permissions, see the IAM documentation
   500  	// (https://cloud.google.com/iam/docs/roles-overview). For a list of the
   501  	// available pre-defined roles, see here
   502  	// (https://cloud.google.com/iam/docs/understanding-roles).
   503  	Role string `json:"role,omitempty"`
   504  	// ForceSendFields is a list of field names (e.g. "Condition") to
   505  	// unconditionally include in API requests. By default, fields with empty or
   506  	// default values are omitted from API requests. See
   507  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   508  	// details.
   509  	ForceSendFields []string `json:"-"`
   510  	// NullFields is a list of field names (e.g. "Condition") to include in API
   511  	// requests with the JSON null value. By default, fields with empty values are
   512  	// omitted from API requests. See
   513  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   514  	NullFields []string `json:"-"`
   515  }
   516  
   517  func (s *Binding) MarshalJSON() ([]byte, error) {
   518  	type NoMethod Binding
   519  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   520  }
   521  
   522  // Category: Represents the category hierarchy of a SKU.
   523  type Category struct {
   524  	// ResourceFamily: The type of product the SKU refers to. Example: "Compute",
   525  	// "Storage", "Network", "ApplicationServices" etc.
   526  	ResourceFamily string `json:"resourceFamily,omitempty"`
   527  	// ResourceGroup: A group classification for related SKUs. Example: "RAM",
   528  	// "GPU", "Prediction", "Ops", "GoogleEgress" etc.
   529  	ResourceGroup string `json:"resourceGroup,omitempty"`
   530  	// ServiceDisplayName: The display name of the service this SKU belongs to.
   531  	ServiceDisplayName string `json:"serviceDisplayName,omitempty"`
   532  	// UsageType: Represents how the SKU is consumed. Example: "OnDemand",
   533  	// "Preemptible", "Commit1Mo", "Commit1Yr" etc.
   534  	UsageType string `json:"usageType,omitempty"`
   535  	// ForceSendFields is a list of field names (e.g. "ResourceFamily") to
   536  	// unconditionally include in API requests. By default, fields with empty or
   537  	// default values are omitted from API requests. See
   538  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   539  	// details.
   540  	ForceSendFields []string `json:"-"`
   541  	// NullFields is a list of field names (e.g. "ResourceFamily") to include in
   542  	// API requests with the JSON null value. By default, fields with empty values
   543  	// are omitted from API requests. See
   544  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   545  	NullFields []string `json:"-"`
   546  }
   547  
   548  func (s *Category) MarshalJSON() ([]byte, error) {
   549  	type NoMethod Category
   550  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   551  }
   552  
   553  // Expr: Represents a textual expression in the Common Expression Language
   554  // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics
   555  // of CEL are documented at https://github.com/google/cel-spec. Example
   556  // (Comparison): title: "Summary size limit" description: "Determines if a
   557  // summary is less than 100 chars" expression: "document.summary.size() < 100"
   558  // Example (Equality): title: "Requestor is owner" description: "Determines if
   559  // requestor is the document owner" expression: "document.owner ==
   560  // request.auth.claims.email" Example (Logic): title: "Public documents"
   561  // description: "Determine whether the document should be publicly visible"
   562  // expression: "document.type != 'private' && document.type != 'internal'"
   563  // Example (Data Manipulation): title: "Notification string" description:
   564  // "Create a notification string with a timestamp." expression: "'New message
   565  // received at ' + string(document.create_time)" The exact variables and
   566  // functions that may be referenced within an expression are determined by the
   567  // service that evaluates it. See the service documentation for additional
   568  // information.
   569  type Expr struct {
   570  	// Description: Optional. Description of the expression. This is a longer text
   571  	// which describes the expression, e.g. when hovered over it in a UI.
   572  	Description string `json:"description,omitempty"`
   573  	// Expression: Textual representation of an expression in Common Expression
   574  	// Language syntax.
   575  	Expression string `json:"expression,omitempty"`
   576  	// Location: Optional. String indicating the location of the expression for
   577  	// error reporting, e.g. a file name and a position in the file.
   578  	Location string `json:"location,omitempty"`
   579  	// Title: Optional. Title for the expression, i.e. a short string describing
   580  	// its purpose. This can be used e.g. in UIs which allow to enter the
   581  	// expression.
   582  	Title string `json:"title,omitempty"`
   583  	// ForceSendFields is a list of field names (e.g. "Description") to
   584  	// unconditionally include in API requests. By default, fields with empty or
   585  	// default values are omitted from API requests. See
   586  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   587  	// details.
   588  	ForceSendFields []string `json:"-"`
   589  	// NullFields is a list of field names (e.g. "Description") to include in API
   590  	// requests with the JSON null value. By default, fields with empty values are
   591  	// omitted from API requests. See
   592  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   593  	NullFields []string `json:"-"`
   594  }
   595  
   596  func (s *Expr) MarshalJSON() ([]byte, error) {
   597  	type NoMethod Expr
   598  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   599  }
   600  
   601  // GeoTaxonomy: Encapsulates the geographic taxonomy data for a sku.
   602  type GeoTaxonomy struct {
   603  	// Regions: The list of regions associated with a sku. Empty for Global skus,
   604  	// which are associated with all Google Cloud regions.
   605  	Regions []string `json:"regions,omitempty"`
   606  	// Type: The type of Geo Taxonomy: GLOBAL, REGIONAL, or MULTI_REGIONAL.
   607  	//
   608  	// Possible values:
   609  	//   "TYPE_UNSPECIFIED" - The type is not specified.
   610  	//   "GLOBAL" - The sku is global in nature, e.g. a license sku. Global skus
   611  	// are available in all regions, and so have an empty region list.
   612  	//   "REGIONAL" - The sku is available in a specific region, e.g. "us-west2".
   613  	//   "MULTI_REGIONAL" - The sku is associated with multiple regions, e.g.
   614  	// "us-west2" and "us-east1".
   615  	Type string `json:"type,omitempty"`
   616  	// ForceSendFields is a list of field names (e.g. "Regions") to unconditionally
   617  	// include in API requests. By default, fields with empty or default values are
   618  	// omitted from API requests. See
   619  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   620  	// details.
   621  	ForceSendFields []string `json:"-"`
   622  	// NullFields is a list of field names (e.g. "Regions") to include in API
   623  	// requests with the JSON null value. By default, fields with empty values are
   624  	// omitted from API requests. See
   625  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   626  	NullFields []string `json:"-"`
   627  }
   628  
   629  func (s *GeoTaxonomy) MarshalJSON() ([]byte, error) {
   630  	type NoMethod GeoTaxonomy
   631  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   632  }
   633  
   634  // ListBillingAccountsResponse: Response message for `ListBillingAccounts`.
   635  type ListBillingAccountsResponse struct {
   636  	// BillingAccounts: A list of billing accounts.
   637  	BillingAccounts []*BillingAccount `json:"billingAccounts,omitempty"`
   638  	// NextPageToken: A token to retrieve the next page of results. To retrieve the
   639  	// next page, call `ListBillingAccounts` again with the `page_token` field set
   640  	// to this value. This field is empty if there are no more results to retrieve.
   641  	NextPageToken string `json:"nextPageToken,omitempty"`
   642  
   643  	// ServerResponse contains the HTTP response code and headers from the server.
   644  	googleapi.ServerResponse `json:"-"`
   645  	// ForceSendFields is a list of field names (e.g. "BillingAccounts") to
   646  	// unconditionally include in API requests. By default, fields with empty or
   647  	// default values are omitted from API requests. See
   648  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   649  	// details.
   650  	ForceSendFields []string `json:"-"`
   651  	// NullFields is a list of field names (e.g. "BillingAccounts") to include in
   652  	// API requests with the JSON null value. By default, fields with empty values
   653  	// are omitted from API requests. See
   654  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   655  	NullFields []string `json:"-"`
   656  }
   657  
   658  func (s *ListBillingAccountsResponse) MarshalJSON() ([]byte, error) {
   659  	type NoMethod ListBillingAccountsResponse
   660  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   661  }
   662  
   663  // ListProjectBillingInfoResponse: Request message for
   664  // `ListProjectBillingInfoResponse`.
   665  type ListProjectBillingInfoResponse struct {
   666  	// NextPageToken: A token to retrieve the next page of results. To retrieve the
   667  	// next page, call `ListProjectBillingInfo` again with the `page_token` field
   668  	// set to this value. This field is empty if there are no more results to
   669  	// retrieve.
   670  	NextPageToken string `json:"nextPageToken,omitempty"`
   671  	// ProjectBillingInfo: A list of `ProjectBillingInfo` resources representing
   672  	// the projects associated with the billing account.
   673  	ProjectBillingInfo []*ProjectBillingInfo `json:"projectBillingInfo,omitempty"`
   674  
   675  	// ServerResponse contains the HTTP response code and headers from the server.
   676  	googleapi.ServerResponse `json:"-"`
   677  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   678  	// unconditionally include in API requests. By default, fields with empty or
   679  	// default values are omitted from API requests. See
   680  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   681  	// details.
   682  	ForceSendFields []string `json:"-"`
   683  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   684  	// requests with the JSON null value. By default, fields with empty values are
   685  	// omitted from API requests. See
   686  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   687  	NullFields []string `json:"-"`
   688  }
   689  
   690  func (s *ListProjectBillingInfoResponse) MarshalJSON() ([]byte, error) {
   691  	type NoMethod ListProjectBillingInfoResponse
   692  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   693  }
   694  
   695  // ListServicesResponse: Response message for `ListServices`.
   696  type ListServicesResponse struct {
   697  	// NextPageToken: A token to retrieve the next page of results. To retrieve the
   698  	// next page, call `ListServices` again with the `page_token` field set to this
   699  	// value. This field is empty if there are no more results to retrieve.
   700  	NextPageToken string `json:"nextPageToken,omitempty"`
   701  	// Services: A list of services.
   702  	Services []*Service `json:"services,omitempty"`
   703  
   704  	// ServerResponse contains the HTTP response code and headers from the server.
   705  	googleapi.ServerResponse `json:"-"`
   706  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   707  	// unconditionally include in API requests. By default, fields with empty or
   708  	// default values are omitted from API requests. See
   709  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   710  	// details.
   711  	ForceSendFields []string `json:"-"`
   712  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   713  	// requests with the JSON null value. By default, fields with empty values are
   714  	// omitted from API requests. See
   715  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   716  	NullFields []string `json:"-"`
   717  }
   718  
   719  func (s *ListServicesResponse) MarshalJSON() ([]byte, error) {
   720  	type NoMethod ListServicesResponse
   721  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   722  }
   723  
   724  // ListSkusResponse: Response message for `ListSkus`.
   725  type ListSkusResponse struct {
   726  	// NextPageToken: A token to retrieve the next page of results. To retrieve the
   727  	// next page, call `ListSkus` again with the `page_token` field set to this
   728  	// value. This field is empty if there are no more results to retrieve.
   729  	NextPageToken string `json:"nextPageToken,omitempty"`
   730  	// Skus: The list of public SKUs of the given service.
   731  	Skus []*Sku `json:"skus,omitempty"`
   732  
   733  	// ServerResponse contains the HTTP response code and headers from the server.
   734  	googleapi.ServerResponse `json:"-"`
   735  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   736  	// unconditionally include in API requests. By default, fields with empty or
   737  	// default values are omitted from API requests. See
   738  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   739  	// details.
   740  	ForceSendFields []string `json:"-"`
   741  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   742  	// requests with the JSON null value. By default, fields with empty values are
   743  	// omitted from API requests. See
   744  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   745  	NullFields []string `json:"-"`
   746  }
   747  
   748  func (s *ListSkusResponse) MarshalJSON() ([]byte, error) {
   749  	type NoMethod ListSkusResponse
   750  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   751  }
   752  
   753  // Money: Represents an amount of money with its currency type.
   754  type Money struct {
   755  	// CurrencyCode: The three-letter currency code defined in ISO 4217.
   756  	CurrencyCode string `json:"currencyCode,omitempty"`
   757  	// Nanos: Number of nano (10^-9) units of the amount. The value must be between
   758  	// -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos`
   759  	// must be positive or zero. If `units` is zero, `nanos` can be positive, zero,
   760  	// or negative. If `units` is negative, `nanos` must be negative or zero. For
   761  	// example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
   762  	Nanos int64 `json:"nanos,omitempty"`
   763  	// Units: The whole units of the amount. For example if `currencyCode` is
   764  	// "USD", then 1 unit is one US dollar.
   765  	Units int64 `json:"units,omitempty,string"`
   766  	// ForceSendFields is a list of field names (e.g. "CurrencyCode") to
   767  	// unconditionally include in API requests. By default, fields with empty or
   768  	// default values are omitted from API requests. See
   769  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   770  	// details.
   771  	ForceSendFields []string `json:"-"`
   772  	// NullFields is a list of field names (e.g. "CurrencyCode") to include in API
   773  	// requests with the JSON null value. By default, fields with empty values are
   774  	// omitted from API requests. See
   775  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   776  	NullFields []string `json:"-"`
   777  }
   778  
   779  func (s *Money) MarshalJSON() ([]byte, error) {
   780  	type NoMethod Money
   781  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   782  }
   783  
   784  // MoveBillingAccountRequest: Request message for `MoveBillingAccount` RPC.
   785  type MoveBillingAccountRequest struct {
   786  	// DestinationParent: Required. The resource name of the Organization to move
   787  	// the billing account under. Must be of the form
   788  	// `organizations/{organization_id}`.
   789  	DestinationParent string `json:"destinationParent,omitempty"`
   790  	// ForceSendFields is a list of field names (e.g. "DestinationParent") to
   791  	// unconditionally include in API requests. By default, fields with empty or
   792  	// default values are omitted from API requests. See
   793  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   794  	// details.
   795  	ForceSendFields []string `json:"-"`
   796  	// NullFields is a list of field names (e.g. "DestinationParent") to include in
   797  	// API requests with the JSON null value. By default, fields with empty values
   798  	// are omitted from API requests. See
   799  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   800  	NullFields []string `json:"-"`
   801  }
   802  
   803  func (s *MoveBillingAccountRequest) MarshalJSON() ([]byte, error) {
   804  	type NoMethod MoveBillingAccountRequest
   805  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   806  }
   807  
   808  // Policy: An Identity and Access Management (IAM) policy, which specifies
   809  // access controls for Google Cloud resources. A `Policy` is a collection of
   810  // `bindings`. A `binding` binds one or more `members`, or principals, to a
   811  // single `role`. Principals can be user accounts, service accounts, Google
   812  // groups, and domains (such as G Suite). A `role` is a named list of
   813  // permissions; each `role` can be an IAM predefined role or a user-created
   814  // custom role. For some types of Google Cloud resources, a `binding` can also
   815  // specify a `condition`, which is a logical expression that allows access to a
   816  // resource only if the expression evaluates to `true`. A condition can add
   817  // constraints based on attributes of the request, the resource, or both. To
   818  // learn which resources support conditions in their IAM policies, see the IAM
   819  // documentation
   820  // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
   821  // example:** ``` { "bindings": [ { "role":
   822  // "roles/resourcemanager.organizationAdmin", "members": [
   823  // "user:mike@example.com", "group:admins@example.com", "domain:google.com",
   824  // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role":
   825  // "roles/resourcemanager.organizationViewer", "members": [
   826  // "user:eve@example.com" ], "condition": { "title": "expirable access",
   827  // "description": "Does not grant access after Sep 2020", "expression":
   828  // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
   829  // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
   830  // members: - user:mike@example.com - group:admins@example.com -
   831  // domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
   832  // role: roles/resourcemanager.organizationAdmin - members: -
   833  // user:eve@example.com role: roles/resourcemanager.organizationViewer
   834  // condition: title: expirable access description: Does not grant access after
   835  // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
   836  // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
   837  // see the IAM documentation (https://cloud.google.com/iam/docs/).
   838  type Policy struct {
   839  	// AuditConfigs: Specifies cloud audit logging configuration for this policy.
   840  	AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
   841  	// Bindings: Associates a list of `members`, or principals, with a `role`.
   842  	// Optionally, may specify a `condition` that determines how and when the
   843  	// `bindings` are applied. Each of the `bindings` must contain at least one
   844  	// principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
   845  	// up to 250 of these principals can be Google groups. Each occurrence of a
   846  	// principal counts towards these limits. For example, if the `bindings` grant
   847  	// 50 different roles to `user:alice@example.com`, and not to any other
   848  	// principal, then you can add another 1,450 principals to the `bindings` in
   849  	// the `Policy`.
   850  	Bindings []*Binding `json:"bindings,omitempty"`
   851  	// Etag: `etag` is used for optimistic concurrency control as a way to help
   852  	// prevent simultaneous updates of a policy from overwriting each other. It is
   853  	// strongly suggested that systems make use of the `etag` in the
   854  	// read-modify-write cycle to perform policy updates in order to avoid race
   855  	// conditions: An `etag` is returned in the response to `getIamPolicy`, and
   856  	// systems are expected to put that etag in the request to `setIamPolicy` to
   857  	// ensure that their change will be applied to the same version of the policy.
   858  	// **Important:** If you use IAM Conditions, you must include the `etag` field
   859  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
   860  	// you to overwrite a version `3` policy with a version `1` policy, and all of
   861  	// the conditions in the version `3` policy are lost.
   862  	Etag string `json:"etag,omitempty"`
   863  	// Version: Specifies the format of the policy. Valid values are `0`, `1`, and
   864  	// `3`. Requests that specify an invalid value are rejected. Any operation that
   865  	// affects conditional role bindings must specify version `3`. This requirement
   866  	// applies to the following operations: * Getting a policy that includes a
   867  	// conditional role binding * Adding a conditional role binding to a policy *
   868  	// Changing a conditional role binding in a policy * Removing any role binding,
   869  	// with or without a condition, from a policy that includes conditions
   870  	// **Important:** If you use IAM Conditions, you must include the `etag` field
   871  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
   872  	// you to overwrite a version `3` policy with a version `1` policy, and all of
   873  	// the conditions in the version `3` policy are lost. If a policy does not
   874  	// include any conditions, operations on that policy may specify any valid
   875  	// version or leave the field unset. To learn which resources support
   876  	// conditions in their IAM policies, see the IAM documentation
   877  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   878  	Version int64 `json:"version,omitempty"`
   879  
   880  	// ServerResponse contains the HTTP response code and headers from the server.
   881  	googleapi.ServerResponse `json:"-"`
   882  	// ForceSendFields is a list of field names (e.g. "AuditConfigs") to
   883  	// unconditionally include in API requests. By default, fields with empty or
   884  	// default values are omitted from API requests. See
   885  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   886  	// details.
   887  	ForceSendFields []string `json:"-"`
   888  	// NullFields is a list of field names (e.g. "AuditConfigs") to include in API
   889  	// requests with the JSON null value. By default, fields with empty values are
   890  	// omitted from API requests. See
   891  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   892  	NullFields []string `json:"-"`
   893  }
   894  
   895  func (s *Policy) MarshalJSON() ([]byte, error) {
   896  	type NoMethod Policy
   897  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   898  }
   899  
   900  // PricingExpression: Expresses a mathematical pricing formula. For Example:-
   901  // `usage_unit: GBy` `tiered_rates:` `[start_usage_amount: 20, unit_price:
   902  // $10]` `[start_usage_amount: 100, unit_price: $5]` The above expresses a
   903  // pricing formula where the first 20GB is free, the next 80GB is priced at $10
   904  // per GB followed by $5 per GB for additional usage.
   905  type PricingExpression struct {
   906  	// BaseUnit: The base unit for the SKU which is the unit used in usage exports.
   907  	// Example: "By"
   908  	BaseUnit string `json:"baseUnit,omitempty"`
   909  	// BaseUnitConversionFactor: Conversion factor for converting from price per
   910  	// usage_unit to price per base_unit, and start_usage_amount to
   911  	// start_usage_amount in base_unit. unit_price / base_unit_conversion_factor =
   912  	// price per base_unit. start_usage_amount * base_unit_conversion_factor =
   913  	// start_usage_amount in base_unit.
   914  	BaseUnitConversionFactor float64 `json:"baseUnitConversionFactor,omitempty"`
   915  	// BaseUnitDescription: The base unit in human readable form. Example: "byte".
   916  	BaseUnitDescription string `json:"baseUnitDescription,omitempty"`
   917  	// DisplayQuantity: The recommended quantity of units for displaying pricing
   918  	// info. When displaying pricing info it is recommended to display: (unit_price
   919  	// * display_quantity) per display_quantity usage_unit. This field does not
   920  	// affect the pricing formula and is for display purposes only. Example: If the
   921  	// unit_price is "0.0001 USD", the usage_unit is "GB" and the display_quantity
   922  	// is "1000" then the recommended way of displaying the pricing info is "0.10
   923  	// USD per 1000 GB"
   924  	DisplayQuantity float64 `json:"displayQuantity,omitempty"`
   925  	// TieredRates: The list of tiered rates for this pricing. The total cost is
   926  	// computed by applying each of the tiered rates on usage. This repeated list
   927  	// is sorted by ascending order of start_usage_amount.
   928  	TieredRates []*TierRate `json:"tieredRates,omitempty"`
   929  	// UsageUnit: The short hand for unit of usage this pricing is specified in.
   930  	// Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte".
   931  	UsageUnit string `json:"usageUnit,omitempty"`
   932  	// UsageUnitDescription: The unit of usage in human readable form. Example:
   933  	// "gibi byte".
   934  	UsageUnitDescription string `json:"usageUnitDescription,omitempty"`
   935  	// ForceSendFields is a list of field names (e.g. "BaseUnit") to
   936  	// unconditionally include in API requests. By default, fields with empty or
   937  	// default values are omitted from API requests. See
   938  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   939  	// details.
   940  	ForceSendFields []string `json:"-"`
   941  	// NullFields is a list of field names (e.g. "BaseUnit") to include in API
   942  	// requests with the JSON null value. By default, fields with empty values are
   943  	// omitted from API requests. See
   944  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   945  	NullFields []string `json:"-"`
   946  }
   947  
   948  func (s *PricingExpression) MarshalJSON() ([]byte, error) {
   949  	type NoMethod PricingExpression
   950  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   951  }
   952  
   953  func (s *PricingExpression) UnmarshalJSON(data []byte) error {
   954  	type NoMethod PricingExpression
   955  	var s1 struct {
   956  		BaseUnitConversionFactor gensupport.JSONFloat64 `json:"baseUnitConversionFactor"`
   957  		DisplayQuantity          gensupport.JSONFloat64 `json:"displayQuantity"`
   958  		*NoMethod
   959  	}
   960  	s1.NoMethod = (*NoMethod)(s)
   961  	if err := json.Unmarshal(data, &s1); err != nil {
   962  		return err
   963  	}
   964  	s.BaseUnitConversionFactor = float64(s1.BaseUnitConversionFactor)
   965  	s.DisplayQuantity = float64(s1.DisplayQuantity)
   966  	return nil
   967  }
   968  
   969  // PricingInfo: Represents the pricing information for a SKU at a single point
   970  // of time.
   971  type PricingInfo struct {
   972  	// AggregationInfo: Aggregation Info. This can be left unspecified if the
   973  	// pricing expression doesn't require aggregation.
   974  	AggregationInfo *AggregationInfo `json:"aggregationInfo,omitempty"`
   975  	// CurrencyConversionRate: Conversion rate used for currency conversion, from
   976  	// USD to the currency specified in the request. This includes any surcharge
   977  	// collected for billing in non USD currency. If a currency is not specified in
   978  	// the request this defaults to 1.0. Example: USD * currency_conversion_rate =
   979  	// JPY
   980  	CurrencyConversionRate float64 `json:"currencyConversionRate,omitempty"`
   981  	// EffectiveTime: The timestamp from which this pricing was effective within
   982  	// the requested time range. This is guaranteed to be greater than or equal to
   983  	// the start_time field in the request and less than the end_time field in the
   984  	// request. If a time range was not specified in the request this field will be
   985  	// equivalent to a time within the last 12 hours, indicating the latest pricing
   986  	// info.
   987  	EffectiveTime string `json:"effectiveTime,omitempty"`
   988  	// PricingExpression: Expresses the pricing formula. See `PricingExpression`
   989  	// for an example.
   990  	PricingExpression *PricingExpression `json:"pricingExpression,omitempty"`
   991  	// Summary: An optional human readable summary of the pricing information, has
   992  	// a maximum length of 256 characters.
   993  	Summary string `json:"summary,omitempty"`
   994  	// ForceSendFields is a list of field names (e.g. "AggregationInfo") to
   995  	// unconditionally include in API requests. By default, fields with empty or
   996  	// default values are omitted from API requests. See
   997  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   998  	// details.
   999  	ForceSendFields []string `json:"-"`
  1000  	// NullFields is a list of field names (e.g. "AggregationInfo") to include in
  1001  	// API requests with the JSON null value. By default, fields with empty values
  1002  	// are omitted from API requests. See
  1003  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1004  	NullFields []string `json:"-"`
  1005  }
  1006  
  1007  func (s *PricingInfo) MarshalJSON() ([]byte, error) {
  1008  	type NoMethod PricingInfo
  1009  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1010  }
  1011  
  1012  func (s *PricingInfo) UnmarshalJSON(data []byte) error {
  1013  	type NoMethod PricingInfo
  1014  	var s1 struct {
  1015  		CurrencyConversionRate gensupport.JSONFloat64 `json:"currencyConversionRate"`
  1016  		*NoMethod
  1017  	}
  1018  	s1.NoMethod = (*NoMethod)(s)
  1019  	if err := json.Unmarshal(data, &s1); err != nil {
  1020  		return err
  1021  	}
  1022  	s.CurrencyConversionRate = float64(s1.CurrencyConversionRate)
  1023  	return nil
  1024  }
  1025  
  1026  // ProjectBillingInfo: Encapsulation of billing information for a Google Cloud
  1027  // Console project. A project has at most one associated billing account at a
  1028  // time (but a billing account can be assigned to multiple projects).
  1029  type ProjectBillingInfo struct {
  1030  	// BillingAccountName: The resource name of the billing account associated with
  1031  	// the project, if any. For example, `billingAccounts/012345-567890-ABCDEF`.
  1032  	BillingAccountName string `json:"billingAccountName,omitempty"`
  1033  	// BillingEnabled: Output only. True if the project is associated with an open
  1034  	// billing account, to which usage on the project is charged. False if the
  1035  	// project is associated with a closed billing account, or no billing account
  1036  	// at all, and therefore cannot use paid services.
  1037  	BillingEnabled bool `json:"billingEnabled,omitempty"`
  1038  	// Name: Output only. The resource name for the `ProjectBillingInfo`; has the
  1039  	// form `projects/{project_id}/billingInfo`. For example, the resource name for
  1040  	// the billing information for project `tokyo-rain-123` would be
  1041  	// `projects/tokyo-rain-123/billingInfo`.
  1042  	Name string `json:"name,omitempty"`
  1043  	// ProjectId: Output only. The ID of the project that this `ProjectBillingInfo`
  1044  	// represents, such as `tokyo-rain-123`. This is a convenience field so that
  1045  	// you don't need to parse the `name` field to obtain a project ID.
  1046  	ProjectId string `json:"projectId,omitempty"`
  1047  
  1048  	// ServerResponse contains the HTTP response code and headers from the server.
  1049  	googleapi.ServerResponse `json:"-"`
  1050  	// ForceSendFields is a list of field names (e.g. "BillingAccountName") to
  1051  	// unconditionally include in API requests. By default, fields with empty or
  1052  	// default values are omitted from API requests. See
  1053  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1054  	// details.
  1055  	ForceSendFields []string `json:"-"`
  1056  	// NullFields is a list of field names (e.g. "BillingAccountName") to include
  1057  	// in API requests with the JSON null value. By default, fields with empty
  1058  	// values are omitted from API requests. See
  1059  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1060  	NullFields []string `json:"-"`
  1061  }
  1062  
  1063  func (s *ProjectBillingInfo) MarshalJSON() ([]byte, error) {
  1064  	type NoMethod ProjectBillingInfo
  1065  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1066  }
  1067  
  1068  // Service: Encapsulates a single service in Google Cloud Platform.
  1069  type Service struct {
  1070  	// BusinessEntityName: The business under which the service is offered. Ex.
  1071  	// "businessEntities/GCP", "businessEntities/Maps"
  1072  	BusinessEntityName string `json:"businessEntityName,omitempty"`
  1073  	// DisplayName: A human readable display name for this service.
  1074  	DisplayName string `json:"displayName,omitempty"`
  1075  	// Name: The resource name for the service. Example: "services/DA34-426B-A397"
  1076  	Name string `json:"name,omitempty"`
  1077  	// ServiceId: The identifier for the service. Example: "DA34-426B-A397"
  1078  	ServiceId string `json:"serviceId,omitempty"`
  1079  	// ForceSendFields is a list of field names (e.g. "BusinessEntityName") to
  1080  	// unconditionally include in API requests. By default, fields with empty or
  1081  	// default values are omitted from API requests. See
  1082  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1083  	// details.
  1084  	ForceSendFields []string `json:"-"`
  1085  	// NullFields is a list of field names (e.g. "BusinessEntityName") to include
  1086  	// in API requests with the JSON null value. By default, fields with empty
  1087  	// values are omitted from API requests. See
  1088  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1089  	NullFields []string `json:"-"`
  1090  }
  1091  
  1092  func (s *Service) MarshalJSON() ([]byte, error) {
  1093  	type NoMethod Service
  1094  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1095  }
  1096  
  1097  // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
  1098  type SetIamPolicyRequest struct {
  1099  	// Policy: REQUIRED: The complete policy to be applied to the `resource`. The
  1100  	// size of the policy is limited to a few 10s of KB. An empty policy is a valid
  1101  	// policy but certain Google Cloud services (such as Projects) might reject
  1102  	// them.
  1103  	Policy *Policy `json:"policy,omitempty"`
  1104  	// UpdateMask: OPTIONAL: A FieldMask specifying which fields of the policy to
  1105  	// modify. Only the fields in the mask will be modified. If no mask is
  1106  	// provided, the following default mask is used: `paths: "bindings, etag"
  1107  	UpdateMask string `json:"updateMask,omitempty"`
  1108  	// ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
  1109  	// include in API requests. By default, fields with empty or default values are
  1110  	// omitted from API requests. See
  1111  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1112  	// details.
  1113  	ForceSendFields []string `json:"-"`
  1114  	// NullFields is a list of field names (e.g. "Policy") to include in API
  1115  	// requests with the JSON null value. By default, fields with empty values are
  1116  	// omitted from API requests. See
  1117  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1118  	NullFields []string `json:"-"`
  1119  }
  1120  
  1121  func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  1122  	type NoMethod SetIamPolicyRequest
  1123  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1124  }
  1125  
  1126  // Sku: Encapsulates a single SKU in Google Cloud Platform
  1127  type Sku struct {
  1128  	// Category: The category hierarchy of this SKU, purely for organizational
  1129  	// purpose.
  1130  	Category *Category `json:"category,omitempty"`
  1131  	// Description: A human readable description of the SKU, has a maximum length
  1132  	// of 256 characters.
  1133  	Description string `json:"description,omitempty"`
  1134  	// GeoTaxonomy: The geographic taxonomy for this sku.
  1135  	GeoTaxonomy *GeoTaxonomy `json:"geoTaxonomy,omitempty"`
  1136  	// Name: The resource name for the SKU. Example:
  1137  	// "services/DA34-426B-A397/skus/AA95-CD31-42FE"
  1138  	Name string `json:"name,omitempty"`
  1139  	// PricingInfo: A timeline of pricing info for this SKU in chronological order.
  1140  	PricingInfo []*PricingInfo `json:"pricingInfo,omitempty"`
  1141  	// ServiceProviderName: Identifies the service provider. This is 'Google' for
  1142  	// first party services in Google Cloud Platform.
  1143  	ServiceProviderName string `json:"serviceProviderName,omitempty"`
  1144  	// ServiceRegions: List of service regions this SKU is offered at. Example:
  1145  	// "asia-east1" Service regions can be found at
  1146  	// https://cloud.google.com/about/locations/
  1147  	ServiceRegions []string `json:"serviceRegions,omitempty"`
  1148  	// SkuId: The identifier for the SKU. Example: "AA95-CD31-42FE"
  1149  	SkuId string `json:"skuId,omitempty"`
  1150  	// ForceSendFields is a list of field names (e.g. "Category") to
  1151  	// unconditionally include in API requests. By default, fields with empty or
  1152  	// default values are omitted from API requests. See
  1153  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1154  	// details.
  1155  	ForceSendFields []string `json:"-"`
  1156  	// NullFields is a list of field names (e.g. "Category") to include in API
  1157  	// requests with the JSON null value. By default, fields with empty values are
  1158  	// omitted from API requests. See
  1159  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1160  	NullFields []string `json:"-"`
  1161  }
  1162  
  1163  func (s *Sku) MarshalJSON() ([]byte, error) {
  1164  	type NoMethod Sku
  1165  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1166  }
  1167  
  1168  // TestIamPermissionsRequest: Request message for `TestIamPermissions` method.
  1169  type TestIamPermissionsRequest struct {
  1170  	// Permissions: The set of permissions to check for the `resource`. Permissions
  1171  	// with wildcards (such as `*` or `storage.*`) are not allowed. For more
  1172  	// information see IAM Overview
  1173  	// (https://cloud.google.com/iam/docs/overview#permissions).
  1174  	Permissions []string `json:"permissions,omitempty"`
  1175  	// ForceSendFields is a list of field names (e.g. "Permissions") to
  1176  	// unconditionally include in API requests. By default, fields with empty or
  1177  	// default values are omitted from API requests. See
  1178  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1179  	// details.
  1180  	ForceSendFields []string `json:"-"`
  1181  	// NullFields is a list of field names (e.g. "Permissions") to include in API
  1182  	// requests with the JSON null value. By default, fields with empty values are
  1183  	// omitted from API requests. See
  1184  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1185  	NullFields []string `json:"-"`
  1186  }
  1187  
  1188  func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  1189  	type NoMethod TestIamPermissionsRequest
  1190  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1191  }
  1192  
  1193  // TestIamPermissionsResponse: Response message for `TestIamPermissions`
  1194  // method.
  1195  type TestIamPermissionsResponse struct {
  1196  	// Permissions: A subset of `TestPermissionsRequest.permissions` that the
  1197  	// caller is allowed.
  1198  	Permissions []string `json:"permissions,omitempty"`
  1199  
  1200  	// ServerResponse contains the HTTP response code and headers from the server.
  1201  	googleapi.ServerResponse `json:"-"`
  1202  	// ForceSendFields is a list of field names (e.g. "Permissions") to
  1203  	// unconditionally include in API requests. By default, fields with empty or
  1204  	// default values are omitted from API requests. See
  1205  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1206  	// details.
  1207  	ForceSendFields []string `json:"-"`
  1208  	// NullFields is a list of field names (e.g. "Permissions") to include in API
  1209  	// requests with the JSON null value. By default, fields with empty values are
  1210  	// omitted from API requests. See
  1211  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1212  	NullFields []string `json:"-"`
  1213  }
  1214  
  1215  func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  1216  	type NoMethod TestIamPermissionsResponse
  1217  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1218  }
  1219  
  1220  // TierRate: The price rate indicating starting usage and its corresponding
  1221  // price.
  1222  type TierRate struct {
  1223  	// StartUsageAmount: Usage is priced at this rate only after this amount.
  1224  	// Example: start_usage_amount of 10 indicates that the usage will be priced at
  1225  	// the unit_price after the first 10 usage_units.
  1226  	StartUsageAmount float64 `json:"startUsageAmount,omitempty"`
  1227  	// UnitPrice: The price per unit of usage. Example: unit_price of amount $10
  1228  	// indicates that each unit will cost $10.
  1229  	UnitPrice *Money `json:"unitPrice,omitempty"`
  1230  	// ForceSendFields is a list of field names (e.g. "StartUsageAmount") to
  1231  	// unconditionally include in API requests. By default, fields with empty or
  1232  	// default values are omitted from API requests. See
  1233  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1234  	// details.
  1235  	ForceSendFields []string `json:"-"`
  1236  	// NullFields is a list of field names (e.g. "StartUsageAmount") to include in
  1237  	// API requests with the JSON null value. By default, fields with empty values
  1238  	// are omitted from API requests. See
  1239  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1240  	NullFields []string `json:"-"`
  1241  }
  1242  
  1243  func (s *TierRate) MarshalJSON() ([]byte, error) {
  1244  	type NoMethod TierRate
  1245  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1246  }
  1247  
  1248  func (s *TierRate) UnmarshalJSON(data []byte) error {
  1249  	type NoMethod TierRate
  1250  	var s1 struct {
  1251  		StartUsageAmount gensupport.JSONFloat64 `json:"startUsageAmount"`
  1252  		*NoMethod
  1253  	}
  1254  	s1.NoMethod = (*NoMethod)(s)
  1255  	if err := json.Unmarshal(data, &s1); err != nil {
  1256  		return err
  1257  	}
  1258  	s.StartUsageAmount = float64(s1.StartUsageAmount)
  1259  	return nil
  1260  }
  1261  
  1262  type BillingAccountsCreateCall struct {
  1263  	s              *APIService
  1264  	billingaccount *BillingAccount
  1265  	urlParams_     gensupport.URLParams
  1266  	ctx_           context.Context
  1267  	header_        http.Header
  1268  }
  1269  
  1270  // Create: This method creates billing subaccounts
  1271  // (https://cloud.google.com/billing/docs/concepts#subaccounts). Google Cloud
  1272  // resellers should use the Channel Services APIs, accounts.customers.create
  1273  // (https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers/create)
  1274  // and accounts.customers.entitlements.create
  1275  // (https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers.entitlements/create).
  1276  // When creating a subaccount, the current authenticated user must have the
  1277  // `billing.accounts.update` IAM permission on the parent account, which is
  1278  // typically given to billing account administrators
  1279  // (https://cloud.google.com/billing/docs/how-to/billing-access). This method
  1280  // will return an error if the parent account has not been provisioned for
  1281  // subaccounts.
  1282  func (r *BillingAccountsService) Create(billingaccount *BillingAccount) *BillingAccountsCreateCall {
  1283  	c := &BillingAccountsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1284  	c.billingaccount = billingaccount
  1285  	return c
  1286  }
  1287  
  1288  // Parent sets the optional parameter "parent": The parent to create a billing
  1289  // account from. Format: - `billingAccounts/{billing_account_id}`, for example,
  1290  // `billingAccounts/012345-567890-ABCDEF`
  1291  func (c *BillingAccountsCreateCall) Parent(parent string) *BillingAccountsCreateCall {
  1292  	c.urlParams_.Set("parent", parent)
  1293  	return c
  1294  }
  1295  
  1296  // Fields allows partial responses to be retrieved. See
  1297  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1298  // details.
  1299  func (c *BillingAccountsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsCreateCall {
  1300  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1301  	return c
  1302  }
  1303  
  1304  // Context sets the context to be used in this call's Do method.
  1305  func (c *BillingAccountsCreateCall) Context(ctx context.Context) *BillingAccountsCreateCall {
  1306  	c.ctx_ = ctx
  1307  	return c
  1308  }
  1309  
  1310  // Header returns a http.Header that can be modified by the caller to add
  1311  // headers to the request.
  1312  func (c *BillingAccountsCreateCall) Header() http.Header {
  1313  	if c.header_ == nil {
  1314  		c.header_ = make(http.Header)
  1315  	}
  1316  	return c.header_
  1317  }
  1318  
  1319  func (c *BillingAccountsCreateCall) doRequest(alt string) (*http.Response, error) {
  1320  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1321  	var body io.Reader = nil
  1322  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.billingaccount)
  1323  	if err != nil {
  1324  		return nil, err
  1325  	}
  1326  	c.urlParams_.Set("alt", alt)
  1327  	c.urlParams_.Set("prettyPrint", "false")
  1328  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/billingAccounts")
  1329  	urls += "?" + c.urlParams_.Encode()
  1330  	req, err := http.NewRequest("POST", urls, body)
  1331  	if err != nil {
  1332  		return nil, err
  1333  	}
  1334  	req.Header = reqHeaders
  1335  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1336  }
  1337  
  1338  // Do executes the "cloudbilling.billingAccounts.create" call.
  1339  // Any non-2xx status code is an error. Response headers are in either
  1340  // *BillingAccount.ServerResponse.Header or (if a response was returned at all)
  1341  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1342  // whether the returned error was because http.StatusNotModified was returned.
  1343  func (c *BillingAccountsCreateCall) Do(opts ...googleapi.CallOption) (*BillingAccount, error) {
  1344  	gensupport.SetOptions(c.urlParams_, opts...)
  1345  	res, err := c.doRequest("json")
  1346  	if res != nil && res.StatusCode == http.StatusNotModified {
  1347  		if res.Body != nil {
  1348  			res.Body.Close()
  1349  		}
  1350  		return nil, gensupport.WrapError(&googleapi.Error{
  1351  			Code:   res.StatusCode,
  1352  			Header: res.Header,
  1353  		})
  1354  	}
  1355  	if err != nil {
  1356  		return nil, err
  1357  	}
  1358  	defer googleapi.CloseBody(res)
  1359  	if err := googleapi.CheckResponse(res); err != nil {
  1360  		return nil, gensupport.WrapError(err)
  1361  	}
  1362  	ret := &BillingAccount{
  1363  		ServerResponse: googleapi.ServerResponse{
  1364  			Header:         res.Header,
  1365  			HTTPStatusCode: res.StatusCode,
  1366  		},
  1367  	}
  1368  	target := &ret
  1369  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1370  		return nil, err
  1371  	}
  1372  	return ret, nil
  1373  }
  1374  
  1375  type BillingAccountsGetCall struct {
  1376  	s            *APIService
  1377  	name         string
  1378  	urlParams_   gensupport.URLParams
  1379  	ifNoneMatch_ string
  1380  	ctx_         context.Context
  1381  	header_      http.Header
  1382  }
  1383  
  1384  // Get: Gets information about a billing account. The current authenticated
  1385  // user must be a viewer of the billing account
  1386  // (https://cloud.google.com/billing/docs/how-to/billing-access).
  1387  //
  1388  //   - name: The resource name of the billing account to retrieve. For example,
  1389  //     `billingAccounts/012345-567890-ABCDEF`.
  1390  func (r *BillingAccountsService) Get(name string) *BillingAccountsGetCall {
  1391  	c := &BillingAccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1392  	c.name = name
  1393  	return c
  1394  }
  1395  
  1396  // Fields allows partial responses to be retrieved. See
  1397  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1398  // details.
  1399  func (c *BillingAccountsGetCall) Fields(s ...googleapi.Field) *BillingAccountsGetCall {
  1400  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1401  	return c
  1402  }
  1403  
  1404  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1405  // object's ETag matches the given value. This is useful for getting updates
  1406  // only after the object has changed since the last request.
  1407  func (c *BillingAccountsGetCall) IfNoneMatch(entityTag string) *BillingAccountsGetCall {
  1408  	c.ifNoneMatch_ = entityTag
  1409  	return c
  1410  }
  1411  
  1412  // Context sets the context to be used in this call's Do method.
  1413  func (c *BillingAccountsGetCall) Context(ctx context.Context) *BillingAccountsGetCall {
  1414  	c.ctx_ = ctx
  1415  	return c
  1416  }
  1417  
  1418  // Header returns a http.Header that can be modified by the caller to add
  1419  // headers to the request.
  1420  func (c *BillingAccountsGetCall) Header() http.Header {
  1421  	if c.header_ == nil {
  1422  		c.header_ = make(http.Header)
  1423  	}
  1424  	return c.header_
  1425  }
  1426  
  1427  func (c *BillingAccountsGetCall) doRequest(alt string) (*http.Response, error) {
  1428  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1429  	if c.ifNoneMatch_ != "" {
  1430  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1431  	}
  1432  	var body io.Reader = nil
  1433  	c.urlParams_.Set("alt", alt)
  1434  	c.urlParams_.Set("prettyPrint", "false")
  1435  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1436  	urls += "?" + c.urlParams_.Encode()
  1437  	req, err := http.NewRequest("GET", urls, body)
  1438  	if err != nil {
  1439  		return nil, err
  1440  	}
  1441  	req.Header = reqHeaders
  1442  	googleapi.Expand(req.URL, map[string]string{
  1443  		"name": c.name,
  1444  	})
  1445  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1446  }
  1447  
  1448  // Do executes the "cloudbilling.billingAccounts.get" call.
  1449  // Any non-2xx status code is an error. Response headers are in either
  1450  // *BillingAccount.ServerResponse.Header or (if a response was returned at all)
  1451  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1452  // whether the returned error was because http.StatusNotModified was returned.
  1453  func (c *BillingAccountsGetCall) Do(opts ...googleapi.CallOption) (*BillingAccount, error) {
  1454  	gensupport.SetOptions(c.urlParams_, opts...)
  1455  	res, err := c.doRequest("json")
  1456  	if res != nil && res.StatusCode == http.StatusNotModified {
  1457  		if res.Body != nil {
  1458  			res.Body.Close()
  1459  		}
  1460  		return nil, gensupport.WrapError(&googleapi.Error{
  1461  			Code:   res.StatusCode,
  1462  			Header: res.Header,
  1463  		})
  1464  	}
  1465  	if err != nil {
  1466  		return nil, err
  1467  	}
  1468  	defer googleapi.CloseBody(res)
  1469  	if err := googleapi.CheckResponse(res); err != nil {
  1470  		return nil, gensupport.WrapError(err)
  1471  	}
  1472  	ret := &BillingAccount{
  1473  		ServerResponse: googleapi.ServerResponse{
  1474  			Header:         res.Header,
  1475  			HTTPStatusCode: res.StatusCode,
  1476  		},
  1477  	}
  1478  	target := &ret
  1479  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1480  		return nil, err
  1481  	}
  1482  	return ret, nil
  1483  }
  1484  
  1485  type BillingAccountsGetIamPolicyCall struct {
  1486  	s            *APIService
  1487  	resource     string
  1488  	urlParams_   gensupport.URLParams
  1489  	ifNoneMatch_ string
  1490  	ctx_         context.Context
  1491  	header_      http.Header
  1492  }
  1493  
  1494  // GetIamPolicy: Gets the access control policy for a billing account. The
  1495  // caller must have the `billing.accounts.getIamPolicy` permission on the
  1496  // account, which is often given to billing account viewers
  1497  // (https://cloud.google.com/billing/docs/how-to/billing-access).
  1498  //
  1499  //   - resource: REQUIRED: The resource for which the policy is being requested.
  1500  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  1501  //     for the appropriate value for this field.
  1502  func (r *BillingAccountsService) GetIamPolicy(resource string) *BillingAccountsGetIamPolicyCall {
  1503  	c := &BillingAccountsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1504  	c.resource = resource
  1505  	return c
  1506  }
  1507  
  1508  // OptionsRequestedPolicyVersion sets the optional parameter
  1509  // "options.requestedPolicyVersion": The maximum policy version that will be
  1510  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  1511  // an invalid value will be rejected. Requests for policies with any
  1512  // conditional role bindings must specify version 3. Policies with no
  1513  // conditional role bindings may specify any valid value or leave the field
  1514  // unset. The policy in the response might use the policy version that you
  1515  // specified, or it might use a lower policy version. For example, if you
  1516  // specify version 3, but the policy has no conditional role bindings, the
  1517  // response uses version 1. To learn which resources support conditions in
  1518  // their IAM policies, see the IAM documentation
  1519  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  1520  func (c *BillingAccountsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *BillingAccountsGetIamPolicyCall {
  1521  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  1522  	return c
  1523  }
  1524  
  1525  // Fields allows partial responses to be retrieved. See
  1526  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1527  // details.
  1528  func (c *BillingAccountsGetIamPolicyCall) Fields(s ...googleapi.Field) *BillingAccountsGetIamPolicyCall {
  1529  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1530  	return c
  1531  }
  1532  
  1533  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1534  // object's ETag matches the given value. This is useful for getting updates
  1535  // only after the object has changed since the last request.
  1536  func (c *BillingAccountsGetIamPolicyCall) IfNoneMatch(entityTag string) *BillingAccountsGetIamPolicyCall {
  1537  	c.ifNoneMatch_ = entityTag
  1538  	return c
  1539  }
  1540  
  1541  // Context sets the context to be used in this call's Do method.
  1542  func (c *BillingAccountsGetIamPolicyCall) Context(ctx context.Context) *BillingAccountsGetIamPolicyCall {
  1543  	c.ctx_ = ctx
  1544  	return c
  1545  }
  1546  
  1547  // Header returns a http.Header that can be modified by the caller to add
  1548  // headers to the request.
  1549  func (c *BillingAccountsGetIamPolicyCall) Header() http.Header {
  1550  	if c.header_ == nil {
  1551  		c.header_ = make(http.Header)
  1552  	}
  1553  	return c.header_
  1554  }
  1555  
  1556  func (c *BillingAccountsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  1557  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1558  	if c.ifNoneMatch_ != "" {
  1559  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1560  	}
  1561  	var body io.Reader = nil
  1562  	c.urlParams_.Set("alt", alt)
  1563  	c.urlParams_.Set("prettyPrint", "false")
  1564  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  1565  	urls += "?" + c.urlParams_.Encode()
  1566  	req, err := http.NewRequest("GET", urls, body)
  1567  	if err != nil {
  1568  		return nil, err
  1569  	}
  1570  	req.Header = reqHeaders
  1571  	googleapi.Expand(req.URL, map[string]string{
  1572  		"resource": c.resource,
  1573  	})
  1574  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1575  }
  1576  
  1577  // Do executes the "cloudbilling.billingAccounts.getIamPolicy" call.
  1578  // Any non-2xx status code is an error. Response headers are in either
  1579  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  1580  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1581  // whether the returned error was because http.StatusNotModified was returned.
  1582  func (c *BillingAccountsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  1583  	gensupport.SetOptions(c.urlParams_, opts...)
  1584  	res, err := c.doRequest("json")
  1585  	if res != nil && res.StatusCode == http.StatusNotModified {
  1586  		if res.Body != nil {
  1587  			res.Body.Close()
  1588  		}
  1589  		return nil, gensupport.WrapError(&googleapi.Error{
  1590  			Code:   res.StatusCode,
  1591  			Header: res.Header,
  1592  		})
  1593  	}
  1594  	if err != nil {
  1595  		return nil, err
  1596  	}
  1597  	defer googleapi.CloseBody(res)
  1598  	if err := googleapi.CheckResponse(res); err != nil {
  1599  		return nil, gensupport.WrapError(err)
  1600  	}
  1601  	ret := &Policy{
  1602  		ServerResponse: googleapi.ServerResponse{
  1603  			Header:         res.Header,
  1604  			HTTPStatusCode: res.StatusCode,
  1605  		},
  1606  	}
  1607  	target := &ret
  1608  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1609  		return nil, err
  1610  	}
  1611  	return ret, nil
  1612  }
  1613  
  1614  type BillingAccountsListCall struct {
  1615  	s            *APIService
  1616  	urlParams_   gensupport.URLParams
  1617  	ifNoneMatch_ string
  1618  	ctx_         context.Context
  1619  	header_      http.Header
  1620  }
  1621  
  1622  // List: Lists the billing accounts that the current authenticated user has
  1623  // permission to view
  1624  // (https://cloud.google.com/billing/docs/how-to/billing-access).
  1625  func (r *BillingAccountsService) List() *BillingAccountsListCall {
  1626  	c := &BillingAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1627  	return c
  1628  }
  1629  
  1630  // Filter sets the optional parameter "filter": Options for how to filter the
  1631  // returned billing accounts. This only supports filtering for subaccounts
  1632  // (https://cloud.google.com/billing/docs/concepts) under a single provided
  1633  // parent billing account. (for example,
  1634  // `master_billing_account=billingAccounts/012345-678901-ABCDEF`). Boolean
  1635  // algebra and other fields are not currently supported.
  1636  func (c *BillingAccountsListCall) Filter(filter string) *BillingAccountsListCall {
  1637  	c.urlParams_.Set("filter", filter)
  1638  	return c
  1639  }
  1640  
  1641  // PageSize sets the optional parameter "pageSize": Requested page size. The
  1642  // maximum page size is 100; this is also the default.
  1643  func (c *BillingAccountsListCall) PageSize(pageSize int64) *BillingAccountsListCall {
  1644  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1645  	return c
  1646  }
  1647  
  1648  // PageToken sets the optional parameter "pageToken": A token identifying a
  1649  // page of results to return. This should be a `next_page_token` value returned
  1650  // from a previous `ListBillingAccounts` call. If unspecified, the first page
  1651  // of results is returned.
  1652  func (c *BillingAccountsListCall) PageToken(pageToken string) *BillingAccountsListCall {
  1653  	c.urlParams_.Set("pageToken", pageToken)
  1654  	return c
  1655  }
  1656  
  1657  // Parent sets the optional parameter "parent": The parent resource to list
  1658  // billing accounts from. Format: - `organizations/{organization_id}`, for
  1659  // example, `organizations/12345678` - `billingAccounts/{billing_account_id}`,
  1660  // for example, `billingAccounts/012345-567890-ABCDEF`
  1661  func (c *BillingAccountsListCall) Parent(parent string) *BillingAccountsListCall {
  1662  	c.urlParams_.Set("parent", parent)
  1663  	return c
  1664  }
  1665  
  1666  // Fields allows partial responses to be retrieved. See
  1667  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1668  // details.
  1669  func (c *BillingAccountsListCall) Fields(s ...googleapi.Field) *BillingAccountsListCall {
  1670  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1671  	return c
  1672  }
  1673  
  1674  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1675  // object's ETag matches the given value. This is useful for getting updates
  1676  // only after the object has changed since the last request.
  1677  func (c *BillingAccountsListCall) IfNoneMatch(entityTag string) *BillingAccountsListCall {
  1678  	c.ifNoneMatch_ = entityTag
  1679  	return c
  1680  }
  1681  
  1682  // Context sets the context to be used in this call's Do method.
  1683  func (c *BillingAccountsListCall) Context(ctx context.Context) *BillingAccountsListCall {
  1684  	c.ctx_ = ctx
  1685  	return c
  1686  }
  1687  
  1688  // Header returns a http.Header that can be modified by the caller to add
  1689  // headers to the request.
  1690  func (c *BillingAccountsListCall) Header() http.Header {
  1691  	if c.header_ == nil {
  1692  		c.header_ = make(http.Header)
  1693  	}
  1694  	return c.header_
  1695  }
  1696  
  1697  func (c *BillingAccountsListCall) doRequest(alt string) (*http.Response, error) {
  1698  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1699  	if c.ifNoneMatch_ != "" {
  1700  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1701  	}
  1702  	var body io.Reader = nil
  1703  	c.urlParams_.Set("alt", alt)
  1704  	c.urlParams_.Set("prettyPrint", "false")
  1705  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/billingAccounts")
  1706  	urls += "?" + c.urlParams_.Encode()
  1707  	req, err := http.NewRequest("GET", urls, body)
  1708  	if err != nil {
  1709  		return nil, err
  1710  	}
  1711  	req.Header = reqHeaders
  1712  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1713  }
  1714  
  1715  // Do executes the "cloudbilling.billingAccounts.list" call.
  1716  // Any non-2xx status code is an error. Response headers are in either
  1717  // *ListBillingAccountsResponse.ServerResponse.Header or (if a response was
  1718  // returned at all) in error.(*googleapi.Error).Header. Use
  1719  // googleapi.IsNotModified to check whether the returned error was because
  1720  // http.StatusNotModified was returned.
  1721  func (c *BillingAccountsListCall) Do(opts ...googleapi.CallOption) (*ListBillingAccountsResponse, error) {
  1722  	gensupport.SetOptions(c.urlParams_, opts...)
  1723  	res, err := c.doRequest("json")
  1724  	if res != nil && res.StatusCode == http.StatusNotModified {
  1725  		if res.Body != nil {
  1726  			res.Body.Close()
  1727  		}
  1728  		return nil, gensupport.WrapError(&googleapi.Error{
  1729  			Code:   res.StatusCode,
  1730  			Header: res.Header,
  1731  		})
  1732  	}
  1733  	if err != nil {
  1734  		return nil, err
  1735  	}
  1736  	defer googleapi.CloseBody(res)
  1737  	if err := googleapi.CheckResponse(res); err != nil {
  1738  		return nil, gensupport.WrapError(err)
  1739  	}
  1740  	ret := &ListBillingAccountsResponse{
  1741  		ServerResponse: googleapi.ServerResponse{
  1742  			Header:         res.Header,
  1743  			HTTPStatusCode: res.StatusCode,
  1744  		},
  1745  	}
  1746  	target := &ret
  1747  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1748  		return nil, err
  1749  	}
  1750  	return ret, nil
  1751  }
  1752  
  1753  // Pages invokes f for each page of results.
  1754  // A non-nil error returned from f will halt the iteration.
  1755  // The provided context supersedes any context provided to the Context method.
  1756  func (c *BillingAccountsListCall) Pages(ctx context.Context, f func(*ListBillingAccountsResponse) error) error {
  1757  	c.ctx_ = ctx
  1758  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1759  	for {
  1760  		x, err := c.Do()
  1761  		if err != nil {
  1762  			return err
  1763  		}
  1764  		if err := f(x); err != nil {
  1765  			return err
  1766  		}
  1767  		if x.NextPageToken == "" {
  1768  			return nil
  1769  		}
  1770  		c.PageToken(x.NextPageToken)
  1771  	}
  1772  }
  1773  
  1774  type BillingAccountsMoveCall struct {
  1775  	s                         *APIService
  1776  	name                      string
  1777  	movebillingaccountrequest *MoveBillingAccountRequest
  1778  	urlParams_                gensupport.URLParams
  1779  	ctx_                      context.Context
  1780  	header_                   http.Header
  1781  }
  1782  
  1783  // Move: Changes which parent organization a billing account belongs to.
  1784  //
  1785  //   - name: The resource name of the billing account to move. Must be of the
  1786  //     form `billingAccounts/{billing_account_id}`. The specified billing account
  1787  //     cannot be a subaccount, since a subaccount always belongs to the same
  1788  //     organization as its parent account.
  1789  func (r *BillingAccountsService) Move(name string, movebillingaccountrequest *MoveBillingAccountRequest) *BillingAccountsMoveCall {
  1790  	c := &BillingAccountsMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1791  	c.name = name
  1792  	c.movebillingaccountrequest = movebillingaccountrequest
  1793  	return c
  1794  }
  1795  
  1796  // Fields allows partial responses to be retrieved. See
  1797  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1798  // details.
  1799  func (c *BillingAccountsMoveCall) Fields(s ...googleapi.Field) *BillingAccountsMoveCall {
  1800  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1801  	return c
  1802  }
  1803  
  1804  // Context sets the context to be used in this call's Do method.
  1805  func (c *BillingAccountsMoveCall) Context(ctx context.Context) *BillingAccountsMoveCall {
  1806  	c.ctx_ = ctx
  1807  	return c
  1808  }
  1809  
  1810  // Header returns a http.Header that can be modified by the caller to add
  1811  // headers to the request.
  1812  func (c *BillingAccountsMoveCall) Header() http.Header {
  1813  	if c.header_ == nil {
  1814  		c.header_ = make(http.Header)
  1815  	}
  1816  	return c.header_
  1817  }
  1818  
  1819  func (c *BillingAccountsMoveCall) doRequest(alt string) (*http.Response, error) {
  1820  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1821  	var body io.Reader = nil
  1822  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.movebillingaccountrequest)
  1823  	if err != nil {
  1824  		return nil, err
  1825  	}
  1826  	c.urlParams_.Set("alt", alt)
  1827  	c.urlParams_.Set("prettyPrint", "false")
  1828  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:move")
  1829  	urls += "?" + c.urlParams_.Encode()
  1830  	req, err := http.NewRequest("POST", urls, body)
  1831  	if err != nil {
  1832  		return nil, err
  1833  	}
  1834  	req.Header = reqHeaders
  1835  	googleapi.Expand(req.URL, map[string]string{
  1836  		"name": c.name,
  1837  	})
  1838  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1839  }
  1840  
  1841  // Do executes the "cloudbilling.billingAccounts.move" call.
  1842  // Any non-2xx status code is an error. Response headers are in either
  1843  // *BillingAccount.ServerResponse.Header or (if a response was returned at all)
  1844  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1845  // whether the returned error was because http.StatusNotModified was returned.
  1846  func (c *BillingAccountsMoveCall) Do(opts ...googleapi.CallOption) (*BillingAccount, error) {
  1847  	gensupport.SetOptions(c.urlParams_, opts...)
  1848  	res, err := c.doRequest("json")
  1849  	if res != nil && res.StatusCode == http.StatusNotModified {
  1850  		if res.Body != nil {
  1851  			res.Body.Close()
  1852  		}
  1853  		return nil, gensupport.WrapError(&googleapi.Error{
  1854  			Code:   res.StatusCode,
  1855  			Header: res.Header,
  1856  		})
  1857  	}
  1858  	if err != nil {
  1859  		return nil, err
  1860  	}
  1861  	defer googleapi.CloseBody(res)
  1862  	if err := googleapi.CheckResponse(res); err != nil {
  1863  		return nil, gensupport.WrapError(err)
  1864  	}
  1865  	ret := &BillingAccount{
  1866  		ServerResponse: googleapi.ServerResponse{
  1867  			Header:         res.Header,
  1868  			HTTPStatusCode: res.StatusCode,
  1869  		},
  1870  	}
  1871  	target := &ret
  1872  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1873  		return nil, err
  1874  	}
  1875  	return ret, nil
  1876  }
  1877  
  1878  type BillingAccountsPatchCall struct {
  1879  	s              *APIService
  1880  	name           string
  1881  	billingaccount *BillingAccount
  1882  	urlParams_     gensupport.URLParams
  1883  	ctx_           context.Context
  1884  	header_        http.Header
  1885  }
  1886  
  1887  // Patch: Updates a billing account's fields. Currently the only field that can
  1888  // be edited is `display_name`. The current authenticated user must have the
  1889  // `billing.accounts.update` IAM permission, which is typically given to the
  1890  // administrator (https://cloud.google.com/billing/docs/how-to/billing-access)
  1891  // of the billing account.
  1892  //
  1893  // - name: The name of the billing account resource to be updated.
  1894  func (r *BillingAccountsService) Patch(name string, billingaccount *BillingAccount) *BillingAccountsPatchCall {
  1895  	c := &BillingAccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1896  	c.name = name
  1897  	c.billingaccount = billingaccount
  1898  	return c
  1899  }
  1900  
  1901  // UpdateMask sets the optional parameter "updateMask": The update mask applied
  1902  // to the resource. Only "display_name" is currently supported.
  1903  func (c *BillingAccountsPatchCall) UpdateMask(updateMask string) *BillingAccountsPatchCall {
  1904  	c.urlParams_.Set("updateMask", updateMask)
  1905  	return c
  1906  }
  1907  
  1908  // Fields allows partial responses to be retrieved. See
  1909  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1910  // details.
  1911  func (c *BillingAccountsPatchCall) Fields(s ...googleapi.Field) *BillingAccountsPatchCall {
  1912  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1913  	return c
  1914  }
  1915  
  1916  // Context sets the context to be used in this call's Do method.
  1917  func (c *BillingAccountsPatchCall) Context(ctx context.Context) *BillingAccountsPatchCall {
  1918  	c.ctx_ = ctx
  1919  	return c
  1920  }
  1921  
  1922  // Header returns a http.Header that can be modified by the caller to add
  1923  // headers to the request.
  1924  func (c *BillingAccountsPatchCall) Header() http.Header {
  1925  	if c.header_ == nil {
  1926  		c.header_ = make(http.Header)
  1927  	}
  1928  	return c.header_
  1929  }
  1930  
  1931  func (c *BillingAccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  1932  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1933  	var body io.Reader = nil
  1934  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.billingaccount)
  1935  	if err != nil {
  1936  		return nil, err
  1937  	}
  1938  	c.urlParams_.Set("alt", alt)
  1939  	c.urlParams_.Set("prettyPrint", "false")
  1940  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1941  	urls += "?" + c.urlParams_.Encode()
  1942  	req, err := http.NewRequest("PATCH", urls, body)
  1943  	if err != nil {
  1944  		return nil, err
  1945  	}
  1946  	req.Header = reqHeaders
  1947  	googleapi.Expand(req.URL, map[string]string{
  1948  		"name": c.name,
  1949  	})
  1950  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1951  }
  1952  
  1953  // Do executes the "cloudbilling.billingAccounts.patch" call.
  1954  // Any non-2xx status code is an error. Response headers are in either
  1955  // *BillingAccount.ServerResponse.Header or (if a response was returned at all)
  1956  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1957  // whether the returned error was because http.StatusNotModified was returned.
  1958  func (c *BillingAccountsPatchCall) Do(opts ...googleapi.CallOption) (*BillingAccount, error) {
  1959  	gensupport.SetOptions(c.urlParams_, opts...)
  1960  	res, err := c.doRequest("json")
  1961  	if res != nil && res.StatusCode == http.StatusNotModified {
  1962  		if res.Body != nil {
  1963  			res.Body.Close()
  1964  		}
  1965  		return nil, gensupport.WrapError(&googleapi.Error{
  1966  			Code:   res.StatusCode,
  1967  			Header: res.Header,
  1968  		})
  1969  	}
  1970  	if err != nil {
  1971  		return nil, err
  1972  	}
  1973  	defer googleapi.CloseBody(res)
  1974  	if err := googleapi.CheckResponse(res); err != nil {
  1975  		return nil, gensupport.WrapError(err)
  1976  	}
  1977  	ret := &BillingAccount{
  1978  		ServerResponse: googleapi.ServerResponse{
  1979  			Header:         res.Header,
  1980  			HTTPStatusCode: res.StatusCode,
  1981  		},
  1982  	}
  1983  	target := &ret
  1984  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1985  		return nil, err
  1986  	}
  1987  	return ret, nil
  1988  }
  1989  
  1990  type BillingAccountsSetIamPolicyCall struct {
  1991  	s                   *APIService
  1992  	resource            string
  1993  	setiampolicyrequest *SetIamPolicyRequest
  1994  	urlParams_          gensupport.URLParams
  1995  	ctx_                context.Context
  1996  	header_             http.Header
  1997  }
  1998  
  1999  // SetIamPolicy: Sets the access control policy for a billing account. Replaces
  2000  // any existing policy. The caller must have the
  2001  // `billing.accounts.setIamPolicy` permission on the account, which is often
  2002  // given to billing account administrators
  2003  // (https://cloud.google.com/billing/docs/how-to/billing-access).
  2004  //
  2005  //   - resource: REQUIRED: The resource for which the policy is being specified.
  2006  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  2007  //     for the appropriate value for this field.
  2008  func (r *BillingAccountsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *BillingAccountsSetIamPolicyCall {
  2009  	c := &BillingAccountsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2010  	c.resource = resource
  2011  	c.setiampolicyrequest = setiampolicyrequest
  2012  	return c
  2013  }
  2014  
  2015  // Fields allows partial responses to be retrieved. See
  2016  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2017  // details.
  2018  func (c *BillingAccountsSetIamPolicyCall) Fields(s ...googleapi.Field) *BillingAccountsSetIamPolicyCall {
  2019  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2020  	return c
  2021  }
  2022  
  2023  // Context sets the context to be used in this call's Do method.
  2024  func (c *BillingAccountsSetIamPolicyCall) Context(ctx context.Context) *BillingAccountsSetIamPolicyCall {
  2025  	c.ctx_ = ctx
  2026  	return c
  2027  }
  2028  
  2029  // Header returns a http.Header that can be modified by the caller to add
  2030  // headers to the request.
  2031  func (c *BillingAccountsSetIamPolicyCall) Header() http.Header {
  2032  	if c.header_ == nil {
  2033  		c.header_ = make(http.Header)
  2034  	}
  2035  	return c.header_
  2036  }
  2037  
  2038  func (c *BillingAccountsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2039  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2040  	var body io.Reader = nil
  2041  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  2042  	if err != nil {
  2043  		return nil, err
  2044  	}
  2045  	c.urlParams_.Set("alt", alt)
  2046  	c.urlParams_.Set("prettyPrint", "false")
  2047  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  2048  	urls += "?" + c.urlParams_.Encode()
  2049  	req, err := http.NewRequest("POST", urls, body)
  2050  	if err != nil {
  2051  		return nil, err
  2052  	}
  2053  	req.Header = reqHeaders
  2054  	googleapi.Expand(req.URL, map[string]string{
  2055  		"resource": c.resource,
  2056  	})
  2057  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2058  }
  2059  
  2060  // Do executes the "cloudbilling.billingAccounts.setIamPolicy" call.
  2061  // Any non-2xx status code is an error. Response headers are in either
  2062  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  2063  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2064  // whether the returned error was because http.StatusNotModified was returned.
  2065  func (c *BillingAccountsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2066  	gensupport.SetOptions(c.urlParams_, opts...)
  2067  	res, err := c.doRequest("json")
  2068  	if res != nil && res.StatusCode == http.StatusNotModified {
  2069  		if res.Body != nil {
  2070  			res.Body.Close()
  2071  		}
  2072  		return nil, gensupport.WrapError(&googleapi.Error{
  2073  			Code:   res.StatusCode,
  2074  			Header: res.Header,
  2075  		})
  2076  	}
  2077  	if err != nil {
  2078  		return nil, err
  2079  	}
  2080  	defer googleapi.CloseBody(res)
  2081  	if err := googleapi.CheckResponse(res); err != nil {
  2082  		return nil, gensupport.WrapError(err)
  2083  	}
  2084  	ret := &Policy{
  2085  		ServerResponse: googleapi.ServerResponse{
  2086  			Header:         res.Header,
  2087  			HTTPStatusCode: res.StatusCode,
  2088  		},
  2089  	}
  2090  	target := &ret
  2091  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2092  		return nil, err
  2093  	}
  2094  	return ret, nil
  2095  }
  2096  
  2097  type BillingAccountsTestIamPermissionsCall struct {
  2098  	s                         *APIService
  2099  	resource                  string
  2100  	testiampermissionsrequest *TestIamPermissionsRequest
  2101  	urlParams_                gensupport.URLParams
  2102  	ctx_                      context.Context
  2103  	header_                   http.Header
  2104  }
  2105  
  2106  // TestIamPermissions: Tests the access control policy for a billing account.
  2107  // This method takes the resource and a set of permissions as input and returns
  2108  // the subset of the input permissions that the caller is allowed for that
  2109  // resource.
  2110  //
  2111  //   - resource: REQUIRED: The resource for which the policy detail is being
  2112  //     requested. See Resource names
  2113  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  2114  //     value for this field.
  2115  func (r *BillingAccountsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *BillingAccountsTestIamPermissionsCall {
  2116  	c := &BillingAccountsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2117  	c.resource = resource
  2118  	c.testiampermissionsrequest = testiampermissionsrequest
  2119  	return c
  2120  }
  2121  
  2122  // Fields allows partial responses to be retrieved. See
  2123  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2124  // details.
  2125  func (c *BillingAccountsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BillingAccountsTestIamPermissionsCall {
  2126  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2127  	return c
  2128  }
  2129  
  2130  // Context sets the context to be used in this call's Do method.
  2131  func (c *BillingAccountsTestIamPermissionsCall) Context(ctx context.Context) *BillingAccountsTestIamPermissionsCall {
  2132  	c.ctx_ = ctx
  2133  	return c
  2134  }
  2135  
  2136  // Header returns a http.Header that can be modified by the caller to add
  2137  // headers to the request.
  2138  func (c *BillingAccountsTestIamPermissionsCall) Header() http.Header {
  2139  	if c.header_ == nil {
  2140  		c.header_ = make(http.Header)
  2141  	}
  2142  	return c.header_
  2143  }
  2144  
  2145  func (c *BillingAccountsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  2146  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2147  	var body io.Reader = nil
  2148  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  2149  	if err != nil {
  2150  		return nil, err
  2151  	}
  2152  	c.urlParams_.Set("alt", alt)
  2153  	c.urlParams_.Set("prettyPrint", "false")
  2154  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  2155  	urls += "?" + c.urlParams_.Encode()
  2156  	req, err := http.NewRequest("POST", urls, body)
  2157  	if err != nil {
  2158  		return nil, err
  2159  	}
  2160  	req.Header = reqHeaders
  2161  	googleapi.Expand(req.URL, map[string]string{
  2162  		"resource": c.resource,
  2163  	})
  2164  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2165  }
  2166  
  2167  // Do executes the "cloudbilling.billingAccounts.testIamPermissions" call.
  2168  // Any non-2xx status code is an error. Response headers are in either
  2169  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  2170  // returned at all) in error.(*googleapi.Error).Header. Use
  2171  // googleapi.IsNotModified to check whether the returned error was because
  2172  // http.StatusNotModified was returned.
  2173  func (c *BillingAccountsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  2174  	gensupport.SetOptions(c.urlParams_, opts...)
  2175  	res, err := c.doRequest("json")
  2176  	if res != nil && res.StatusCode == http.StatusNotModified {
  2177  		if res.Body != nil {
  2178  			res.Body.Close()
  2179  		}
  2180  		return nil, gensupport.WrapError(&googleapi.Error{
  2181  			Code:   res.StatusCode,
  2182  			Header: res.Header,
  2183  		})
  2184  	}
  2185  	if err != nil {
  2186  		return nil, err
  2187  	}
  2188  	defer googleapi.CloseBody(res)
  2189  	if err := googleapi.CheckResponse(res); err != nil {
  2190  		return nil, gensupport.WrapError(err)
  2191  	}
  2192  	ret := &TestIamPermissionsResponse{
  2193  		ServerResponse: googleapi.ServerResponse{
  2194  			Header:         res.Header,
  2195  			HTTPStatusCode: res.StatusCode,
  2196  		},
  2197  	}
  2198  	target := &ret
  2199  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2200  		return nil, err
  2201  	}
  2202  	return ret, nil
  2203  }
  2204  
  2205  type BillingAccountsProjectsListCall struct {
  2206  	s            *APIService
  2207  	name         string
  2208  	urlParams_   gensupport.URLParams
  2209  	ifNoneMatch_ string
  2210  	ctx_         context.Context
  2211  	header_      http.Header
  2212  }
  2213  
  2214  // List: Lists the projects associated with a billing account. The current
  2215  // authenticated user must have the `billing.resourceAssociations.list` IAM
  2216  // permission, which is often given to billing account viewers
  2217  // (https://cloud.google.com/billing/docs/how-to/billing-access).
  2218  //
  2219  //   - name: The resource name of the billing account associated with the
  2220  //     projects that you want to list. For example,
  2221  //     `billingAccounts/012345-567890-ABCDEF`.
  2222  func (r *BillingAccountsProjectsService) List(name string) *BillingAccountsProjectsListCall {
  2223  	c := &BillingAccountsProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2224  	c.name = name
  2225  	return c
  2226  }
  2227  
  2228  // PageSize sets the optional parameter "pageSize": Requested page size. The
  2229  // maximum page size is 100; this is also the default.
  2230  func (c *BillingAccountsProjectsListCall) PageSize(pageSize int64) *BillingAccountsProjectsListCall {
  2231  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2232  	return c
  2233  }
  2234  
  2235  // PageToken sets the optional parameter "pageToken": A token identifying a
  2236  // page of results to be returned. This should be a `next_page_token` value
  2237  // returned from a previous `ListProjectBillingInfo` call. If unspecified, the
  2238  // first page of results is returned.
  2239  func (c *BillingAccountsProjectsListCall) PageToken(pageToken string) *BillingAccountsProjectsListCall {
  2240  	c.urlParams_.Set("pageToken", pageToken)
  2241  	return c
  2242  }
  2243  
  2244  // Fields allows partial responses to be retrieved. See
  2245  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2246  // details.
  2247  func (c *BillingAccountsProjectsListCall) Fields(s ...googleapi.Field) *BillingAccountsProjectsListCall {
  2248  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2249  	return c
  2250  }
  2251  
  2252  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2253  // object's ETag matches the given value. This is useful for getting updates
  2254  // only after the object has changed since the last request.
  2255  func (c *BillingAccountsProjectsListCall) IfNoneMatch(entityTag string) *BillingAccountsProjectsListCall {
  2256  	c.ifNoneMatch_ = entityTag
  2257  	return c
  2258  }
  2259  
  2260  // Context sets the context to be used in this call's Do method.
  2261  func (c *BillingAccountsProjectsListCall) Context(ctx context.Context) *BillingAccountsProjectsListCall {
  2262  	c.ctx_ = ctx
  2263  	return c
  2264  }
  2265  
  2266  // Header returns a http.Header that can be modified by the caller to add
  2267  // headers to the request.
  2268  func (c *BillingAccountsProjectsListCall) Header() http.Header {
  2269  	if c.header_ == nil {
  2270  		c.header_ = make(http.Header)
  2271  	}
  2272  	return c.header_
  2273  }
  2274  
  2275  func (c *BillingAccountsProjectsListCall) doRequest(alt string) (*http.Response, error) {
  2276  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2277  	if c.ifNoneMatch_ != "" {
  2278  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2279  	}
  2280  	var body io.Reader = nil
  2281  	c.urlParams_.Set("alt", alt)
  2282  	c.urlParams_.Set("prettyPrint", "false")
  2283  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/projects")
  2284  	urls += "?" + c.urlParams_.Encode()
  2285  	req, err := http.NewRequest("GET", urls, body)
  2286  	if err != nil {
  2287  		return nil, err
  2288  	}
  2289  	req.Header = reqHeaders
  2290  	googleapi.Expand(req.URL, map[string]string{
  2291  		"name": c.name,
  2292  	})
  2293  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2294  }
  2295  
  2296  // Do executes the "cloudbilling.billingAccounts.projects.list" call.
  2297  // Any non-2xx status code is an error. Response headers are in either
  2298  // *ListProjectBillingInfoResponse.ServerResponse.Header or (if a response was
  2299  // returned at all) in error.(*googleapi.Error).Header. Use
  2300  // googleapi.IsNotModified to check whether the returned error was because
  2301  // http.StatusNotModified was returned.
  2302  func (c *BillingAccountsProjectsListCall) Do(opts ...googleapi.CallOption) (*ListProjectBillingInfoResponse, error) {
  2303  	gensupport.SetOptions(c.urlParams_, opts...)
  2304  	res, err := c.doRequest("json")
  2305  	if res != nil && res.StatusCode == http.StatusNotModified {
  2306  		if res.Body != nil {
  2307  			res.Body.Close()
  2308  		}
  2309  		return nil, gensupport.WrapError(&googleapi.Error{
  2310  			Code:   res.StatusCode,
  2311  			Header: res.Header,
  2312  		})
  2313  	}
  2314  	if err != nil {
  2315  		return nil, err
  2316  	}
  2317  	defer googleapi.CloseBody(res)
  2318  	if err := googleapi.CheckResponse(res); err != nil {
  2319  		return nil, gensupport.WrapError(err)
  2320  	}
  2321  	ret := &ListProjectBillingInfoResponse{
  2322  		ServerResponse: googleapi.ServerResponse{
  2323  			Header:         res.Header,
  2324  			HTTPStatusCode: res.StatusCode,
  2325  		},
  2326  	}
  2327  	target := &ret
  2328  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2329  		return nil, err
  2330  	}
  2331  	return ret, nil
  2332  }
  2333  
  2334  // Pages invokes f for each page of results.
  2335  // A non-nil error returned from f will halt the iteration.
  2336  // The provided context supersedes any context provided to the Context method.
  2337  func (c *BillingAccountsProjectsListCall) Pages(ctx context.Context, f func(*ListProjectBillingInfoResponse) error) error {
  2338  	c.ctx_ = ctx
  2339  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2340  	for {
  2341  		x, err := c.Do()
  2342  		if err != nil {
  2343  			return err
  2344  		}
  2345  		if err := f(x); err != nil {
  2346  			return err
  2347  		}
  2348  		if x.NextPageToken == "" {
  2349  			return nil
  2350  		}
  2351  		c.PageToken(x.NextPageToken)
  2352  	}
  2353  }
  2354  
  2355  type BillingAccountsSubAccountsCreateCall struct {
  2356  	s              *APIService
  2357  	parent         string
  2358  	billingaccount *BillingAccount
  2359  	urlParams_     gensupport.URLParams
  2360  	ctx_           context.Context
  2361  	header_        http.Header
  2362  }
  2363  
  2364  // Create: This method creates billing subaccounts
  2365  // (https://cloud.google.com/billing/docs/concepts#subaccounts). Google Cloud
  2366  // resellers should use the Channel Services APIs, accounts.customers.create
  2367  // (https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers/create)
  2368  // and accounts.customers.entitlements.create
  2369  // (https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers.entitlements/create).
  2370  // When creating a subaccount, the current authenticated user must have the
  2371  // `billing.accounts.update` IAM permission on the parent account, which is
  2372  // typically given to billing account administrators
  2373  // (https://cloud.google.com/billing/docs/how-to/billing-access). This method
  2374  // will return an error if the parent account has not been provisioned for
  2375  // subaccounts.
  2376  //
  2377  //   - parent: Optional. The parent to create a billing account from. Format: -
  2378  //     `billingAccounts/{billing_account_id}`, for example,
  2379  //     `billingAccounts/012345-567890-ABCDEF`.
  2380  func (r *BillingAccountsSubAccountsService) Create(parent string, billingaccount *BillingAccount) *BillingAccountsSubAccountsCreateCall {
  2381  	c := &BillingAccountsSubAccountsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2382  	c.parent = parent
  2383  	c.billingaccount = billingaccount
  2384  	return c
  2385  }
  2386  
  2387  // Fields allows partial responses to be retrieved. See
  2388  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2389  // details.
  2390  func (c *BillingAccountsSubAccountsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsSubAccountsCreateCall {
  2391  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2392  	return c
  2393  }
  2394  
  2395  // Context sets the context to be used in this call's Do method.
  2396  func (c *BillingAccountsSubAccountsCreateCall) Context(ctx context.Context) *BillingAccountsSubAccountsCreateCall {
  2397  	c.ctx_ = ctx
  2398  	return c
  2399  }
  2400  
  2401  // Header returns a http.Header that can be modified by the caller to add
  2402  // headers to the request.
  2403  func (c *BillingAccountsSubAccountsCreateCall) Header() http.Header {
  2404  	if c.header_ == nil {
  2405  		c.header_ = make(http.Header)
  2406  	}
  2407  	return c.header_
  2408  }
  2409  
  2410  func (c *BillingAccountsSubAccountsCreateCall) doRequest(alt string) (*http.Response, error) {
  2411  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2412  	var body io.Reader = nil
  2413  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.billingaccount)
  2414  	if err != nil {
  2415  		return nil, err
  2416  	}
  2417  	c.urlParams_.Set("alt", alt)
  2418  	c.urlParams_.Set("prettyPrint", "false")
  2419  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/subAccounts")
  2420  	urls += "?" + c.urlParams_.Encode()
  2421  	req, err := http.NewRequest("POST", urls, body)
  2422  	if err != nil {
  2423  		return nil, err
  2424  	}
  2425  	req.Header = reqHeaders
  2426  	googleapi.Expand(req.URL, map[string]string{
  2427  		"parent": c.parent,
  2428  	})
  2429  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2430  }
  2431  
  2432  // Do executes the "cloudbilling.billingAccounts.subAccounts.create" call.
  2433  // Any non-2xx status code is an error. Response headers are in either
  2434  // *BillingAccount.ServerResponse.Header or (if a response was returned at all)
  2435  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2436  // whether the returned error was because http.StatusNotModified was returned.
  2437  func (c *BillingAccountsSubAccountsCreateCall) Do(opts ...googleapi.CallOption) (*BillingAccount, error) {
  2438  	gensupport.SetOptions(c.urlParams_, opts...)
  2439  	res, err := c.doRequest("json")
  2440  	if res != nil && res.StatusCode == http.StatusNotModified {
  2441  		if res.Body != nil {
  2442  			res.Body.Close()
  2443  		}
  2444  		return nil, gensupport.WrapError(&googleapi.Error{
  2445  			Code:   res.StatusCode,
  2446  			Header: res.Header,
  2447  		})
  2448  	}
  2449  	if err != nil {
  2450  		return nil, err
  2451  	}
  2452  	defer googleapi.CloseBody(res)
  2453  	if err := googleapi.CheckResponse(res); err != nil {
  2454  		return nil, gensupport.WrapError(err)
  2455  	}
  2456  	ret := &BillingAccount{
  2457  		ServerResponse: googleapi.ServerResponse{
  2458  			Header:         res.Header,
  2459  			HTTPStatusCode: res.StatusCode,
  2460  		},
  2461  	}
  2462  	target := &ret
  2463  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2464  		return nil, err
  2465  	}
  2466  	return ret, nil
  2467  }
  2468  
  2469  type BillingAccountsSubAccountsListCall struct {
  2470  	s            *APIService
  2471  	parent       string
  2472  	urlParams_   gensupport.URLParams
  2473  	ifNoneMatch_ string
  2474  	ctx_         context.Context
  2475  	header_      http.Header
  2476  }
  2477  
  2478  // List: Lists the billing accounts that the current authenticated user has
  2479  // permission to view
  2480  // (https://cloud.google.com/billing/docs/how-to/billing-access).
  2481  //
  2482  //   - parent: Optional. The parent resource to list billing accounts from.
  2483  //     Format: - `organizations/{organization_id}`, for example,
  2484  //     `organizations/12345678` - `billingAccounts/{billing_account_id}`, for
  2485  //     example, `billingAccounts/012345-567890-ABCDEF`.
  2486  func (r *BillingAccountsSubAccountsService) List(parent string) *BillingAccountsSubAccountsListCall {
  2487  	c := &BillingAccountsSubAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2488  	c.parent = parent
  2489  	return c
  2490  }
  2491  
  2492  // Filter sets the optional parameter "filter": Options for how to filter the
  2493  // returned billing accounts. This only supports filtering for subaccounts
  2494  // (https://cloud.google.com/billing/docs/concepts) under a single provided
  2495  // parent billing account. (for example,
  2496  // `master_billing_account=billingAccounts/012345-678901-ABCDEF`). Boolean
  2497  // algebra and other fields are not currently supported.
  2498  func (c *BillingAccountsSubAccountsListCall) Filter(filter string) *BillingAccountsSubAccountsListCall {
  2499  	c.urlParams_.Set("filter", filter)
  2500  	return c
  2501  }
  2502  
  2503  // PageSize sets the optional parameter "pageSize": Requested page size. The
  2504  // maximum page size is 100; this is also the default.
  2505  func (c *BillingAccountsSubAccountsListCall) PageSize(pageSize int64) *BillingAccountsSubAccountsListCall {
  2506  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2507  	return c
  2508  }
  2509  
  2510  // PageToken sets the optional parameter "pageToken": A token identifying a
  2511  // page of results to return. This should be a `next_page_token` value returned
  2512  // from a previous `ListBillingAccounts` call. If unspecified, the first page
  2513  // of results is returned.
  2514  func (c *BillingAccountsSubAccountsListCall) PageToken(pageToken string) *BillingAccountsSubAccountsListCall {
  2515  	c.urlParams_.Set("pageToken", pageToken)
  2516  	return c
  2517  }
  2518  
  2519  // Fields allows partial responses to be retrieved. See
  2520  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2521  // details.
  2522  func (c *BillingAccountsSubAccountsListCall) Fields(s ...googleapi.Field) *BillingAccountsSubAccountsListCall {
  2523  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2524  	return c
  2525  }
  2526  
  2527  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2528  // object's ETag matches the given value. This is useful for getting updates
  2529  // only after the object has changed since the last request.
  2530  func (c *BillingAccountsSubAccountsListCall) IfNoneMatch(entityTag string) *BillingAccountsSubAccountsListCall {
  2531  	c.ifNoneMatch_ = entityTag
  2532  	return c
  2533  }
  2534  
  2535  // Context sets the context to be used in this call's Do method.
  2536  func (c *BillingAccountsSubAccountsListCall) Context(ctx context.Context) *BillingAccountsSubAccountsListCall {
  2537  	c.ctx_ = ctx
  2538  	return c
  2539  }
  2540  
  2541  // Header returns a http.Header that can be modified by the caller to add
  2542  // headers to the request.
  2543  func (c *BillingAccountsSubAccountsListCall) Header() http.Header {
  2544  	if c.header_ == nil {
  2545  		c.header_ = make(http.Header)
  2546  	}
  2547  	return c.header_
  2548  }
  2549  
  2550  func (c *BillingAccountsSubAccountsListCall) doRequest(alt string) (*http.Response, error) {
  2551  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2552  	if c.ifNoneMatch_ != "" {
  2553  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2554  	}
  2555  	var body io.Reader = nil
  2556  	c.urlParams_.Set("alt", alt)
  2557  	c.urlParams_.Set("prettyPrint", "false")
  2558  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/subAccounts")
  2559  	urls += "?" + c.urlParams_.Encode()
  2560  	req, err := http.NewRequest("GET", urls, body)
  2561  	if err != nil {
  2562  		return nil, err
  2563  	}
  2564  	req.Header = reqHeaders
  2565  	googleapi.Expand(req.URL, map[string]string{
  2566  		"parent": c.parent,
  2567  	})
  2568  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2569  }
  2570  
  2571  // Do executes the "cloudbilling.billingAccounts.subAccounts.list" call.
  2572  // Any non-2xx status code is an error. Response headers are in either
  2573  // *ListBillingAccountsResponse.ServerResponse.Header or (if a response was
  2574  // returned at all) in error.(*googleapi.Error).Header. Use
  2575  // googleapi.IsNotModified to check whether the returned error was because
  2576  // http.StatusNotModified was returned.
  2577  func (c *BillingAccountsSubAccountsListCall) Do(opts ...googleapi.CallOption) (*ListBillingAccountsResponse, error) {
  2578  	gensupport.SetOptions(c.urlParams_, opts...)
  2579  	res, err := c.doRequest("json")
  2580  	if res != nil && res.StatusCode == http.StatusNotModified {
  2581  		if res.Body != nil {
  2582  			res.Body.Close()
  2583  		}
  2584  		return nil, gensupport.WrapError(&googleapi.Error{
  2585  			Code:   res.StatusCode,
  2586  			Header: res.Header,
  2587  		})
  2588  	}
  2589  	if err != nil {
  2590  		return nil, err
  2591  	}
  2592  	defer googleapi.CloseBody(res)
  2593  	if err := googleapi.CheckResponse(res); err != nil {
  2594  		return nil, gensupport.WrapError(err)
  2595  	}
  2596  	ret := &ListBillingAccountsResponse{
  2597  		ServerResponse: googleapi.ServerResponse{
  2598  			Header:         res.Header,
  2599  			HTTPStatusCode: res.StatusCode,
  2600  		},
  2601  	}
  2602  	target := &ret
  2603  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2604  		return nil, err
  2605  	}
  2606  	return ret, nil
  2607  }
  2608  
  2609  // Pages invokes f for each page of results.
  2610  // A non-nil error returned from f will halt the iteration.
  2611  // The provided context supersedes any context provided to the Context method.
  2612  func (c *BillingAccountsSubAccountsListCall) Pages(ctx context.Context, f func(*ListBillingAccountsResponse) error) error {
  2613  	c.ctx_ = ctx
  2614  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2615  	for {
  2616  		x, err := c.Do()
  2617  		if err != nil {
  2618  			return err
  2619  		}
  2620  		if err := f(x); err != nil {
  2621  			return err
  2622  		}
  2623  		if x.NextPageToken == "" {
  2624  			return nil
  2625  		}
  2626  		c.PageToken(x.NextPageToken)
  2627  	}
  2628  }
  2629  
  2630  type OrganizationsBillingAccountsCreateCall struct {
  2631  	s              *APIService
  2632  	parent         string
  2633  	billingaccount *BillingAccount
  2634  	urlParams_     gensupport.URLParams
  2635  	ctx_           context.Context
  2636  	header_        http.Header
  2637  }
  2638  
  2639  // Create: This method creates billing subaccounts
  2640  // (https://cloud.google.com/billing/docs/concepts#subaccounts). Google Cloud
  2641  // resellers should use the Channel Services APIs, accounts.customers.create
  2642  // (https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers/create)
  2643  // and accounts.customers.entitlements.create
  2644  // (https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers.entitlements/create).
  2645  // When creating a subaccount, the current authenticated user must have the
  2646  // `billing.accounts.update` IAM permission on the parent account, which is
  2647  // typically given to billing account administrators
  2648  // (https://cloud.google.com/billing/docs/how-to/billing-access). This method
  2649  // will return an error if the parent account has not been provisioned for
  2650  // subaccounts.
  2651  //
  2652  //   - parent: Optional. The parent to create a billing account from. Format: -
  2653  //     `billingAccounts/{billing_account_id}`, for example,
  2654  //     `billingAccounts/012345-567890-ABCDEF`.
  2655  func (r *OrganizationsBillingAccountsService) Create(parent string, billingaccount *BillingAccount) *OrganizationsBillingAccountsCreateCall {
  2656  	c := &OrganizationsBillingAccountsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2657  	c.parent = parent
  2658  	c.billingaccount = billingaccount
  2659  	return c
  2660  }
  2661  
  2662  // Fields allows partial responses to be retrieved. See
  2663  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2664  // details.
  2665  func (c *OrganizationsBillingAccountsCreateCall) Fields(s ...googleapi.Field) *OrganizationsBillingAccountsCreateCall {
  2666  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2667  	return c
  2668  }
  2669  
  2670  // Context sets the context to be used in this call's Do method.
  2671  func (c *OrganizationsBillingAccountsCreateCall) Context(ctx context.Context) *OrganizationsBillingAccountsCreateCall {
  2672  	c.ctx_ = ctx
  2673  	return c
  2674  }
  2675  
  2676  // Header returns a http.Header that can be modified by the caller to add
  2677  // headers to the request.
  2678  func (c *OrganizationsBillingAccountsCreateCall) Header() http.Header {
  2679  	if c.header_ == nil {
  2680  		c.header_ = make(http.Header)
  2681  	}
  2682  	return c.header_
  2683  }
  2684  
  2685  func (c *OrganizationsBillingAccountsCreateCall) doRequest(alt string) (*http.Response, error) {
  2686  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2687  	var body io.Reader = nil
  2688  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.billingaccount)
  2689  	if err != nil {
  2690  		return nil, err
  2691  	}
  2692  	c.urlParams_.Set("alt", alt)
  2693  	c.urlParams_.Set("prettyPrint", "false")
  2694  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/billingAccounts")
  2695  	urls += "?" + c.urlParams_.Encode()
  2696  	req, err := http.NewRequest("POST", urls, body)
  2697  	if err != nil {
  2698  		return nil, err
  2699  	}
  2700  	req.Header = reqHeaders
  2701  	googleapi.Expand(req.URL, map[string]string{
  2702  		"parent": c.parent,
  2703  	})
  2704  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2705  }
  2706  
  2707  // Do executes the "cloudbilling.organizations.billingAccounts.create" call.
  2708  // Any non-2xx status code is an error. Response headers are in either
  2709  // *BillingAccount.ServerResponse.Header or (if a response was returned at all)
  2710  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2711  // whether the returned error was because http.StatusNotModified was returned.
  2712  func (c *OrganizationsBillingAccountsCreateCall) Do(opts ...googleapi.CallOption) (*BillingAccount, error) {
  2713  	gensupport.SetOptions(c.urlParams_, opts...)
  2714  	res, err := c.doRequest("json")
  2715  	if res != nil && res.StatusCode == http.StatusNotModified {
  2716  		if res.Body != nil {
  2717  			res.Body.Close()
  2718  		}
  2719  		return nil, gensupport.WrapError(&googleapi.Error{
  2720  			Code:   res.StatusCode,
  2721  			Header: res.Header,
  2722  		})
  2723  	}
  2724  	if err != nil {
  2725  		return nil, err
  2726  	}
  2727  	defer googleapi.CloseBody(res)
  2728  	if err := googleapi.CheckResponse(res); err != nil {
  2729  		return nil, gensupport.WrapError(err)
  2730  	}
  2731  	ret := &BillingAccount{
  2732  		ServerResponse: googleapi.ServerResponse{
  2733  			Header:         res.Header,
  2734  			HTTPStatusCode: res.StatusCode,
  2735  		},
  2736  	}
  2737  	target := &ret
  2738  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2739  		return nil, err
  2740  	}
  2741  	return ret, nil
  2742  }
  2743  
  2744  type OrganizationsBillingAccountsListCall struct {
  2745  	s            *APIService
  2746  	parent       string
  2747  	urlParams_   gensupport.URLParams
  2748  	ifNoneMatch_ string
  2749  	ctx_         context.Context
  2750  	header_      http.Header
  2751  }
  2752  
  2753  // List: Lists the billing accounts that the current authenticated user has
  2754  // permission to view
  2755  // (https://cloud.google.com/billing/docs/how-to/billing-access).
  2756  //
  2757  //   - parent: Optional. The parent resource to list billing accounts from.
  2758  //     Format: - `organizations/{organization_id}`, for example,
  2759  //     `organizations/12345678` - `billingAccounts/{billing_account_id}`, for
  2760  //     example, `billingAccounts/012345-567890-ABCDEF`.
  2761  func (r *OrganizationsBillingAccountsService) List(parent string) *OrganizationsBillingAccountsListCall {
  2762  	c := &OrganizationsBillingAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2763  	c.parent = parent
  2764  	return c
  2765  }
  2766  
  2767  // Filter sets the optional parameter "filter": Options for how to filter the
  2768  // returned billing accounts. This only supports filtering for subaccounts
  2769  // (https://cloud.google.com/billing/docs/concepts) under a single provided
  2770  // parent billing account. (for example,
  2771  // `master_billing_account=billingAccounts/012345-678901-ABCDEF`). Boolean
  2772  // algebra and other fields are not currently supported.
  2773  func (c *OrganizationsBillingAccountsListCall) Filter(filter string) *OrganizationsBillingAccountsListCall {
  2774  	c.urlParams_.Set("filter", filter)
  2775  	return c
  2776  }
  2777  
  2778  // PageSize sets the optional parameter "pageSize": Requested page size. The
  2779  // maximum page size is 100; this is also the default.
  2780  func (c *OrganizationsBillingAccountsListCall) PageSize(pageSize int64) *OrganizationsBillingAccountsListCall {
  2781  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2782  	return c
  2783  }
  2784  
  2785  // PageToken sets the optional parameter "pageToken": A token identifying a
  2786  // page of results to return. This should be a `next_page_token` value returned
  2787  // from a previous `ListBillingAccounts` call. If unspecified, the first page
  2788  // of results is returned.
  2789  func (c *OrganizationsBillingAccountsListCall) PageToken(pageToken string) *OrganizationsBillingAccountsListCall {
  2790  	c.urlParams_.Set("pageToken", pageToken)
  2791  	return c
  2792  }
  2793  
  2794  // Fields allows partial responses to be retrieved. See
  2795  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2796  // details.
  2797  func (c *OrganizationsBillingAccountsListCall) Fields(s ...googleapi.Field) *OrganizationsBillingAccountsListCall {
  2798  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2799  	return c
  2800  }
  2801  
  2802  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2803  // object's ETag matches the given value. This is useful for getting updates
  2804  // only after the object has changed since the last request.
  2805  func (c *OrganizationsBillingAccountsListCall) IfNoneMatch(entityTag string) *OrganizationsBillingAccountsListCall {
  2806  	c.ifNoneMatch_ = entityTag
  2807  	return c
  2808  }
  2809  
  2810  // Context sets the context to be used in this call's Do method.
  2811  func (c *OrganizationsBillingAccountsListCall) Context(ctx context.Context) *OrganizationsBillingAccountsListCall {
  2812  	c.ctx_ = ctx
  2813  	return c
  2814  }
  2815  
  2816  // Header returns a http.Header that can be modified by the caller to add
  2817  // headers to the request.
  2818  func (c *OrganizationsBillingAccountsListCall) Header() http.Header {
  2819  	if c.header_ == nil {
  2820  		c.header_ = make(http.Header)
  2821  	}
  2822  	return c.header_
  2823  }
  2824  
  2825  func (c *OrganizationsBillingAccountsListCall) doRequest(alt string) (*http.Response, error) {
  2826  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2827  	if c.ifNoneMatch_ != "" {
  2828  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2829  	}
  2830  	var body io.Reader = nil
  2831  	c.urlParams_.Set("alt", alt)
  2832  	c.urlParams_.Set("prettyPrint", "false")
  2833  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/billingAccounts")
  2834  	urls += "?" + c.urlParams_.Encode()
  2835  	req, err := http.NewRequest("GET", urls, body)
  2836  	if err != nil {
  2837  		return nil, err
  2838  	}
  2839  	req.Header = reqHeaders
  2840  	googleapi.Expand(req.URL, map[string]string{
  2841  		"parent": c.parent,
  2842  	})
  2843  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2844  }
  2845  
  2846  // Do executes the "cloudbilling.organizations.billingAccounts.list" call.
  2847  // Any non-2xx status code is an error. Response headers are in either
  2848  // *ListBillingAccountsResponse.ServerResponse.Header or (if a response was
  2849  // returned at all) in error.(*googleapi.Error).Header. Use
  2850  // googleapi.IsNotModified to check whether the returned error was because
  2851  // http.StatusNotModified was returned.
  2852  func (c *OrganizationsBillingAccountsListCall) Do(opts ...googleapi.CallOption) (*ListBillingAccountsResponse, error) {
  2853  	gensupport.SetOptions(c.urlParams_, opts...)
  2854  	res, err := c.doRequest("json")
  2855  	if res != nil && res.StatusCode == http.StatusNotModified {
  2856  		if res.Body != nil {
  2857  			res.Body.Close()
  2858  		}
  2859  		return nil, gensupport.WrapError(&googleapi.Error{
  2860  			Code:   res.StatusCode,
  2861  			Header: res.Header,
  2862  		})
  2863  	}
  2864  	if err != nil {
  2865  		return nil, err
  2866  	}
  2867  	defer googleapi.CloseBody(res)
  2868  	if err := googleapi.CheckResponse(res); err != nil {
  2869  		return nil, gensupport.WrapError(err)
  2870  	}
  2871  	ret := &ListBillingAccountsResponse{
  2872  		ServerResponse: googleapi.ServerResponse{
  2873  			Header:         res.Header,
  2874  			HTTPStatusCode: res.StatusCode,
  2875  		},
  2876  	}
  2877  	target := &ret
  2878  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2879  		return nil, err
  2880  	}
  2881  	return ret, nil
  2882  }
  2883  
  2884  // Pages invokes f for each page of results.
  2885  // A non-nil error returned from f will halt the iteration.
  2886  // The provided context supersedes any context provided to the Context method.
  2887  func (c *OrganizationsBillingAccountsListCall) Pages(ctx context.Context, f func(*ListBillingAccountsResponse) error) error {
  2888  	c.ctx_ = ctx
  2889  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2890  	for {
  2891  		x, err := c.Do()
  2892  		if err != nil {
  2893  			return err
  2894  		}
  2895  		if err := f(x); err != nil {
  2896  			return err
  2897  		}
  2898  		if x.NextPageToken == "" {
  2899  			return nil
  2900  		}
  2901  		c.PageToken(x.NextPageToken)
  2902  	}
  2903  }
  2904  
  2905  type OrganizationsBillingAccountsMoveCall struct {
  2906  	s                 *APIService
  2907  	destinationParent string
  2908  	name              string
  2909  	urlParams_        gensupport.URLParams
  2910  	ifNoneMatch_      string
  2911  	ctx_              context.Context
  2912  	header_           http.Header
  2913  }
  2914  
  2915  // Move: Changes which parent organization a billing account belongs to.
  2916  //
  2917  //   - destinationParent: The resource name of the Organization to move the
  2918  //     billing account under. Must be of the form
  2919  //     `organizations/{organization_id}`.
  2920  //   - name: The resource name of the billing account to move. Must be of the
  2921  //     form `billingAccounts/{billing_account_id}`. The specified billing account
  2922  //     cannot be a subaccount, since a subaccount always belongs to the same
  2923  //     organization as its parent account.
  2924  func (r *OrganizationsBillingAccountsService) Move(destinationParent string, name string) *OrganizationsBillingAccountsMoveCall {
  2925  	c := &OrganizationsBillingAccountsMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2926  	c.destinationParent = destinationParent
  2927  	c.name = name
  2928  	return c
  2929  }
  2930  
  2931  // Fields allows partial responses to be retrieved. See
  2932  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2933  // details.
  2934  func (c *OrganizationsBillingAccountsMoveCall) Fields(s ...googleapi.Field) *OrganizationsBillingAccountsMoveCall {
  2935  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2936  	return c
  2937  }
  2938  
  2939  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2940  // object's ETag matches the given value. This is useful for getting updates
  2941  // only after the object has changed since the last request.
  2942  func (c *OrganizationsBillingAccountsMoveCall) IfNoneMatch(entityTag string) *OrganizationsBillingAccountsMoveCall {
  2943  	c.ifNoneMatch_ = entityTag
  2944  	return c
  2945  }
  2946  
  2947  // Context sets the context to be used in this call's Do method.
  2948  func (c *OrganizationsBillingAccountsMoveCall) Context(ctx context.Context) *OrganizationsBillingAccountsMoveCall {
  2949  	c.ctx_ = ctx
  2950  	return c
  2951  }
  2952  
  2953  // Header returns a http.Header that can be modified by the caller to add
  2954  // headers to the request.
  2955  func (c *OrganizationsBillingAccountsMoveCall) Header() http.Header {
  2956  	if c.header_ == nil {
  2957  		c.header_ = make(http.Header)
  2958  	}
  2959  	return c.header_
  2960  }
  2961  
  2962  func (c *OrganizationsBillingAccountsMoveCall) doRequest(alt string) (*http.Response, error) {
  2963  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2964  	if c.ifNoneMatch_ != "" {
  2965  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2966  	}
  2967  	var body io.Reader = nil
  2968  	c.urlParams_.Set("alt", alt)
  2969  	c.urlParams_.Set("prettyPrint", "false")
  2970  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+destinationParent}/{+name}:move")
  2971  	urls += "?" + c.urlParams_.Encode()
  2972  	req, err := http.NewRequest("GET", urls, body)
  2973  	if err != nil {
  2974  		return nil, err
  2975  	}
  2976  	req.Header = reqHeaders
  2977  	googleapi.Expand(req.URL, map[string]string{
  2978  		"destinationParent": c.destinationParent,
  2979  		"name":              c.name,
  2980  	})
  2981  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2982  }
  2983  
  2984  // Do executes the "cloudbilling.organizations.billingAccounts.move" call.
  2985  // Any non-2xx status code is an error. Response headers are in either
  2986  // *BillingAccount.ServerResponse.Header or (if a response was returned at all)
  2987  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2988  // whether the returned error was because http.StatusNotModified was returned.
  2989  func (c *OrganizationsBillingAccountsMoveCall) Do(opts ...googleapi.CallOption) (*BillingAccount, error) {
  2990  	gensupport.SetOptions(c.urlParams_, opts...)
  2991  	res, err := c.doRequest("json")
  2992  	if res != nil && res.StatusCode == http.StatusNotModified {
  2993  		if res.Body != nil {
  2994  			res.Body.Close()
  2995  		}
  2996  		return nil, gensupport.WrapError(&googleapi.Error{
  2997  			Code:   res.StatusCode,
  2998  			Header: res.Header,
  2999  		})
  3000  	}
  3001  	if err != nil {
  3002  		return nil, err
  3003  	}
  3004  	defer googleapi.CloseBody(res)
  3005  	if err := googleapi.CheckResponse(res); err != nil {
  3006  		return nil, gensupport.WrapError(err)
  3007  	}
  3008  	ret := &BillingAccount{
  3009  		ServerResponse: googleapi.ServerResponse{
  3010  			Header:         res.Header,
  3011  			HTTPStatusCode: res.StatusCode,
  3012  		},
  3013  	}
  3014  	target := &ret
  3015  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3016  		return nil, err
  3017  	}
  3018  	return ret, nil
  3019  }
  3020  
  3021  type ProjectsGetBillingInfoCall struct {
  3022  	s            *APIService
  3023  	name         string
  3024  	urlParams_   gensupport.URLParams
  3025  	ifNoneMatch_ string
  3026  	ctx_         context.Context
  3027  	header_      http.Header
  3028  }
  3029  
  3030  // GetBillingInfo: Gets the billing information for a project. The current
  3031  // authenticated user must have the `resourcemanager.projects.get` permission
  3032  // for the project, which can be granted by assigning the Project Viewer
  3033  // (https://cloud.google.com/iam/docs/understanding-roles#predefined_roles)
  3034  // role.
  3035  //
  3036  //   - name: The resource name of the project for which billing information is
  3037  //     retrieved. For example, `projects/tokyo-rain-123`.
  3038  func (r *ProjectsService) GetBillingInfo(name string) *ProjectsGetBillingInfoCall {
  3039  	c := &ProjectsGetBillingInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3040  	c.name = name
  3041  	return c
  3042  }
  3043  
  3044  // Fields allows partial responses to be retrieved. See
  3045  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3046  // details.
  3047  func (c *ProjectsGetBillingInfoCall) Fields(s ...googleapi.Field) *ProjectsGetBillingInfoCall {
  3048  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3049  	return c
  3050  }
  3051  
  3052  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3053  // object's ETag matches the given value. This is useful for getting updates
  3054  // only after the object has changed since the last request.
  3055  func (c *ProjectsGetBillingInfoCall) IfNoneMatch(entityTag string) *ProjectsGetBillingInfoCall {
  3056  	c.ifNoneMatch_ = entityTag
  3057  	return c
  3058  }
  3059  
  3060  // Context sets the context to be used in this call's Do method.
  3061  func (c *ProjectsGetBillingInfoCall) Context(ctx context.Context) *ProjectsGetBillingInfoCall {
  3062  	c.ctx_ = ctx
  3063  	return c
  3064  }
  3065  
  3066  // Header returns a http.Header that can be modified by the caller to add
  3067  // headers to the request.
  3068  func (c *ProjectsGetBillingInfoCall) Header() http.Header {
  3069  	if c.header_ == nil {
  3070  		c.header_ = make(http.Header)
  3071  	}
  3072  	return c.header_
  3073  }
  3074  
  3075  func (c *ProjectsGetBillingInfoCall) doRequest(alt string) (*http.Response, error) {
  3076  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3077  	if c.ifNoneMatch_ != "" {
  3078  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3079  	}
  3080  	var body io.Reader = nil
  3081  	c.urlParams_.Set("alt", alt)
  3082  	c.urlParams_.Set("prettyPrint", "false")
  3083  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/billingInfo")
  3084  	urls += "?" + c.urlParams_.Encode()
  3085  	req, err := http.NewRequest("GET", urls, body)
  3086  	if err != nil {
  3087  		return nil, err
  3088  	}
  3089  	req.Header = reqHeaders
  3090  	googleapi.Expand(req.URL, map[string]string{
  3091  		"name": c.name,
  3092  	})
  3093  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3094  }
  3095  
  3096  // Do executes the "cloudbilling.projects.getBillingInfo" call.
  3097  // Any non-2xx status code is an error. Response headers are in either
  3098  // *ProjectBillingInfo.ServerResponse.Header or (if a response was returned at
  3099  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3100  // check whether the returned error was because http.StatusNotModified was
  3101  // returned.
  3102  func (c *ProjectsGetBillingInfoCall) Do(opts ...googleapi.CallOption) (*ProjectBillingInfo, error) {
  3103  	gensupport.SetOptions(c.urlParams_, opts...)
  3104  	res, err := c.doRequest("json")
  3105  	if res != nil && res.StatusCode == http.StatusNotModified {
  3106  		if res.Body != nil {
  3107  			res.Body.Close()
  3108  		}
  3109  		return nil, gensupport.WrapError(&googleapi.Error{
  3110  			Code:   res.StatusCode,
  3111  			Header: res.Header,
  3112  		})
  3113  	}
  3114  	if err != nil {
  3115  		return nil, err
  3116  	}
  3117  	defer googleapi.CloseBody(res)
  3118  	if err := googleapi.CheckResponse(res); err != nil {
  3119  		return nil, gensupport.WrapError(err)
  3120  	}
  3121  	ret := &ProjectBillingInfo{
  3122  		ServerResponse: googleapi.ServerResponse{
  3123  			Header:         res.Header,
  3124  			HTTPStatusCode: res.StatusCode,
  3125  		},
  3126  	}
  3127  	target := &ret
  3128  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3129  		return nil, err
  3130  	}
  3131  	return ret, nil
  3132  }
  3133  
  3134  type ProjectsUpdateBillingInfoCall struct {
  3135  	s                  *APIService
  3136  	name               string
  3137  	projectbillinginfo *ProjectBillingInfo
  3138  	urlParams_         gensupport.URLParams
  3139  	ctx_               context.Context
  3140  	header_            http.Header
  3141  }
  3142  
  3143  // UpdateBillingInfo: Sets or updates the billing account associated with a
  3144  // project. You specify the new billing account by setting the
  3145  // `billing_account_name` in the `ProjectBillingInfo` resource to the resource
  3146  // name of a billing account. Associating a project with an open billing
  3147  // account enables billing on the project and allows charges for resource
  3148  // usage. If the project already had a billing account, this method changes the
  3149  // billing account used for resource usage charges. *Note:* Incurred charges
  3150  // that have not yet been reported in the transaction history of the Google
  3151  // Cloud Console might be billed to the new billing account, even if the charge
  3152  // occurred before the new billing account was assigned to the project. The
  3153  // current authenticated user must have ownership privileges for both the
  3154  // project (https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo )
  3155  // and the billing account
  3156  // (https://cloud.google.com/billing/docs/how-to/billing-access). You can
  3157  // disable billing on the project by setting the `billing_account_name` field
  3158  // to empty. This action disassociates the current billing account from the
  3159  // project. Any billable activity of your in-use services will stop, and your
  3160  // application could stop functioning as expected. Any unbilled charges to date
  3161  // will be billed to the previously associated account. The current
  3162  // authenticated user must be either an owner of the project or an owner of the
  3163  // billing account for the project. Note that associating a project with a
  3164  // *closed* billing account will have much the same effect as disabling billing
  3165  // on the project: any paid resources used by the project will be shut down.
  3166  // Thus, unless you wish to disable billing, you should always call this method
  3167  // with the name of an *open* billing account.
  3168  //
  3169  //   - name: The resource name of the project associated with the billing
  3170  //     information that you want to update. For example,
  3171  //     `projects/tokyo-rain-123`.
  3172  func (r *ProjectsService) UpdateBillingInfo(name string, projectbillinginfo *ProjectBillingInfo) *ProjectsUpdateBillingInfoCall {
  3173  	c := &ProjectsUpdateBillingInfoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3174  	c.name = name
  3175  	c.projectbillinginfo = projectbillinginfo
  3176  	return c
  3177  }
  3178  
  3179  // Fields allows partial responses to be retrieved. See
  3180  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3181  // details.
  3182  func (c *ProjectsUpdateBillingInfoCall) Fields(s ...googleapi.Field) *ProjectsUpdateBillingInfoCall {
  3183  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3184  	return c
  3185  }
  3186  
  3187  // Context sets the context to be used in this call's Do method.
  3188  func (c *ProjectsUpdateBillingInfoCall) Context(ctx context.Context) *ProjectsUpdateBillingInfoCall {
  3189  	c.ctx_ = ctx
  3190  	return c
  3191  }
  3192  
  3193  // Header returns a http.Header that can be modified by the caller to add
  3194  // headers to the request.
  3195  func (c *ProjectsUpdateBillingInfoCall) Header() http.Header {
  3196  	if c.header_ == nil {
  3197  		c.header_ = make(http.Header)
  3198  	}
  3199  	return c.header_
  3200  }
  3201  
  3202  func (c *ProjectsUpdateBillingInfoCall) doRequest(alt string) (*http.Response, error) {
  3203  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3204  	var body io.Reader = nil
  3205  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.projectbillinginfo)
  3206  	if err != nil {
  3207  		return nil, err
  3208  	}
  3209  	c.urlParams_.Set("alt", alt)
  3210  	c.urlParams_.Set("prettyPrint", "false")
  3211  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/billingInfo")
  3212  	urls += "?" + c.urlParams_.Encode()
  3213  	req, err := http.NewRequest("PUT", urls, body)
  3214  	if err != nil {
  3215  		return nil, err
  3216  	}
  3217  	req.Header = reqHeaders
  3218  	googleapi.Expand(req.URL, map[string]string{
  3219  		"name": c.name,
  3220  	})
  3221  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3222  }
  3223  
  3224  // Do executes the "cloudbilling.projects.updateBillingInfo" call.
  3225  // Any non-2xx status code is an error. Response headers are in either
  3226  // *ProjectBillingInfo.ServerResponse.Header or (if a response was returned at
  3227  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3228  // check whether the returned error was because http.StatusNotModified was
  3229  // returned.
  3230  func (c *ProjectsUpdateBillingInfoCall) Do(opts ...googleapi.CallOption) (*ProjectBillingInfo, error) {
  3231  	gensupport.SetOptions(c.urlParams_, opts...)
  3232  	res, err := c.doRequest("json")
  3233  	if res != nil && res.StatusCode == http.StatusNotModified {
  3234  		if res.Body != nil {
  3235  			res.Body.Close()
  3236  		}
  3237  		return nil, gensupport.WrapError(&googleapi.Error{
  3238  			Code:   res.StatusCode,
  3239  			Header: res.Header,
  3240  		})
  3241  	}
  3242  	if err != nil {
  3243  		return nil, err
  3244  	}
  3245  	defer googleapi.CloseBody(res)
  3246  	if err := googleapi.CheckResponse(res); err != nil {
  3247  		return nil, gensupport.WrapError(err)
  3248  	}
  3249  	ret := &ProjectBillingInfo{
  3250  		ServerResponse: googleapi.ServerResponse{
  3251  			Header:         res.Header,
  3252  			HTTPStatusCode: res.StatusCode,
  3253  		},
  3254  	}
  3255  	target := &ret
  3256  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3257  		return nil, err
  3258  	}
  3259  	return ret, nil
  3260  }
  3261  
  3262  type ServicesListCall struct {
  3263  	s            *APIService
  3264  	urlParams_   gensupport.URLParams
  3265  	ifNoneMatch_ string
  3266  	ctx_         context.Context
  3267  	header_      http.Header
  3268  }
  3269  
  3270  // List: Lists all public cloud services.
  3271  func (r *ServicesService) List() *ServicesListCall {
  3272  	c := &ServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3273  	return c
  3274  }
  3275  
  3276  // PageSize sets the optional parameter "pageSize": Requested page size.
  3277  // Defaults to 5000.
  3278  func (c *ServicesListCall) PageSize(pageSize int64) *ServicesListCall {
  3279  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3280  	return c
  3281  }
  3282  
  3283  // PageToken sets the optional parameter "pageToken": A token identifying a
  3284  // page of results to return. This should be a `next_page_token` value returned
  3285  // from a previous `ListServices` call. If unspecified, the first page of
  3286  // results is returned.
  3287  func (c *ServicesListCall) PageToken(pageToken string) *ServicesListCall {
  3288  	c.urlParams_.Set("pageToken", pageToken)
  3289  	return c
  3290  }
  3291  
  3292  // Fields allows partial responses to be retrieved. See
  3293  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3294  // details.
  3295  func (c *ServicesListCall) Fields(s ...googleapi.Field) *ServicesListCall {
  3296  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3297  	return c
  3298  }
  3299  
  3300  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3301  // object's ETag matches the given value. This is useful for getting updates
  3302  // only after the object has changed since the last request.
  3303  func (c *ServicesListCall) IfNoneMatch(entityTag string) *ServicesListCall {
  3304  	c.ifNoneMatch_ = entityTag
  3305  	return c
  3306  }
  3307  
  3308  // Context sets the context to be used in this call's Do method.
  3309  func (c *ServicesListCall) Context(ctx context.Context) *ServicesListCall {
  3310  	c.ctx_ = ctx
  3311  	return c
  3312  }
  3313  
  3314  // Header returns a http.Header that can be modified by the caller to add
  3315  // headers to the request.
  3316  func (c *ServicesListCall) Header() http.Header {
  3317  	if c.header_ == nil {
  3318  		c.header_ = make(http.Header)
  3319  	}
  3320  	return c.header_
  3321  }
  3322  
  3323  func (c *ServicesListCall) doRequest(alt string) (*http.Response, error) {
  3324  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3325  	if c.ifNoneMatch_ != "" {
  3326  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3327  	}
  3328  	var body io.Reader = nil
  3329  	c.urlParams_.Set("alt", alt)
  3330  	c.urlParams_.Set("prettyPrint", "false")
  3331  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/services")
  3332  	urls += "?" + c.urlParams_.Encode()
  3333  	req, err := http.NewRequest("GET", urls, body)
  3334  	if err != nil {
  3335  		return nil, err
  3336  	}
  3337  	req.Header = reqHeaders
  3338  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3339  }
  3340  
  3341  // Do executes the "cloudbilling.services.list" call.
  3342  // Any non-2xx status code is an error. Response headers are in either
  3343  // *ListServicesResponse.ServerResponse.Header or (if a response was returned
  3344  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3345  // check whether the returned error was because http.StatusNotModified was
  3346  // returned.
  3347  func (c *ServicesListCall) Do(opts ...googleapi.CallOption) (*ListServicesResponse, error) {
  3348  	gensupport.SetOptions(c.urlParams_, opts...)
  3349  	res, err := c.doRequest("json")
  3350  	if res != nil && res.StatusCode == http.StatusNotModified {
  3351  		if res.Body != nil {
  3352  			res.Body.Close()
  3353  		}
  3354  		return nil, gensupport.WrapError(&googleapi.Error{
  3355  			Code:   res.StatusCode,
  3356  			Header: res.Header,
  3357  		})
  3358  	}
  3359  	if err != nil {
  3360  		return nil, err
  3361  	}
  3362  	defer googleapi.CloseBody(res)
  3363  	if err := googleapi.CheckResponse(res); err != nil {
  3364  		return nil, gensupport.WrapError(err)
  3365  	}
  3366  	ret := &ListServicesResponse{
  3367  		ServerResponse: googleapi.ServerResponse{
  3368  			Header:         res.Header,
  3369  			HTTPStatusCode: res.StatusCode,
  3370  		},
  3371  	}
  3372  	target := &ret
  3373  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3374  		return nil, err
  3375  	}
  3376  	return ret, nil
  3377  }
  3378  
  3379  // Pages invokes f for each page of results.
  3380  // A non-nil error returned from f will halt the iteration.
  3381  // The provided context supersedes any context provided to the Context method.
  3382  func (c *ServicesListCall) Pages(ctx context.Context, f func(*ListServicesResponse) error) error {
  3383  	c.ctx_ = ctx
  3384  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3385  	for {
  3386  		x, err := c.Do()
  3387  		if err != nil {
  3388  			return err
  3389  		}
  3390  		if err := f(x); err != nil {
  3391  			return err
  3392  		}
  3393  		if x.NextPageToken == "" {
  3394  			return nil
  3395  		}
  3396  		c.PageToken(x.NextPageToken)
  3397  	}
  3398  }
  3399  
  3400  type ServicesSkusListCall struct {
  3401  	s            *APIService
  3402  	parent       string
  3403  	urlParams_   gensupport.URLParams
  3404  	ifNoneMatch_ string
  3405  	ctx_         context.Context
  3406  	header_      http.Header
  3407  }
  3408  
  3409  // List: Lists all publicly available SKUs for a given cloud service.
  3410  //
  3411  // - parent: The name of the service. Example: "services/DA34-426B-A397".
  3412  func (r *ServicesSkusService) List(parent string) *ServicesSkusListCall {
  3413  	c := &ServicesSkusListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3414  	c.parent = parent
  3415  	return c
  3416  }
  3417  
  3418  // CurrencyCode sets the optional parameter "currencyCode": The ISO 4217
  3419  // currency code for the pricing info in the response proto. Will use the
  3420  // conversion rate as of start_time.  If not specified USD will be used.
  3421  func (c *ServicesSkusListCall) CurrencyCode(currencyCode string) *ServicesSkusListCall {
  3422  	c.urlParams_.Set("currencyCode", currencyCode)
  3423  	return c
  3424  }
  3425  
  3426  // EndTime sets the optional parameter "endTime": Optional exclusive end time
  3427  // of the time range for which the pricing versions will be returned.
  3428  // Timestamps in the future are not allowed. The time range has to be within a
  3429  // single calendar month in America/Los_Angeles timezone. Time range as a whole
  3430  // is optional. If not specified, the latest pricing will be returned (up to 12
  3431  // hours old at most).
  3432  func (c *ServicesSkusListCall) EndTime(endTime string) *ServicesSkusListCall {
  3433  	c.urlParams_.Set("endTime", endTime)
  3434  	return c
  3435  }
  3436  
  3437  // PageSize sets the optional parameter "pageSize": Requested page size.
  3438  // Defaults to 5000.
  3439  func (c *ServicesSkusListCall) PageSize(pageSize int64) *ServicesSkusListCall {
  3440  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3441  	return c
  3442  }
  3443  
  3444  // PageToken sets the optional parameter "pageToken": A token identifying a
  3445  // page of results to return. This should be a `next_page_token` value returned
  3446  // from a previous `ListSkus` call. If unspecified, the first page of results
  3447  // is returned.
  3448  func (c *ServicesSkusListCall) PageToken(pageToken string) *ServicesSkusListCall {
  3449  	c.urlParams_.Set("pageToken", pageToken)
  3450  	return c
  3451  }
  3452  
  3453  // StartTime sets the optional parameter "startTime": Optional inclusive start
  3454  // time of the time range for which the pricing versions will be returned.
  3455  // Timestamps in the future are not allowed. The time range has to be within a
  3456  // single calendar month in America/Los_Angeles timezone. Time range as a whole
  3457  // is optional. If not specified, the latest pricing will be returned (up to 12
  3458  // hours old at most).
  3459  func (c *ServicesSkusListCall) StartTime(startTime string) *ServicesSkusListCall {
  3460  	c.urlParams_.Set("startTime", startTime)
  3461  	return c
  3462  }
  3463  
  3464  // Fields allows partial responses to be retrieved. See
  3465  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3466  // details.
  3467  func (c *ServicesSkusListCall) Fields(s ...googleapi.Field) *ServicesSkusListCall {
  3468  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3469  	return c
  3470  }
  3471  
  3472  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3473  // object's ETag matches the given value. This is useful for getting updates
  3474  // only after the object has changed since the last request.
  3475  func (c *ServicesSkusListCall) IfNoneMatch(entityTag string) *ServicesSkusListCall {
  3476  	c.ifNoneMatch_ = entityTag
  3477  	return c
  3478  }
  3479  
  3480  // Context sets the context to be used in this call's Do method.
  3481  func (c *ServicesSkusListCall) Context(ctx context.Context) *ServicesSkusListCall {
  3482  	c.ctx_ = ctx
  3483  	return c
  3484  }
  3485  
  3486  // Header returns a http.Header that can be modified by the caller to add
  3487  // headers to the request.
  3488  func (c *ServicesSkusListCall) Header() http.Header {
  3489  	if c.header_ == nil {
  3490  		c.header_ = make(http.Header)
  3491  	}
  3492  	return c.header_
  3493  }
  3494  
  3495  func (c *ServicesSkusListCall) doRequest(alt string) (*http.Response, error) {
  3496  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3497  	if c.ifNoneMatch_ != "" {
  3498  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3499  	}
  3500  	var body io.Reader = nil
  3501  	c.urlParams_.Set("alt", alt)
  3502  	c.urlParams_.Set("prettyPrint", "false")
  3503  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/skus")
  3504  	urls += "?" + c.urlParams_.Encode()
  3505  	req, err := http.NewRequest("GET", urls, body)
  3506  	if err != nil {
  3507  		return nil, err
  3508  	}
  3509  	req.Header = reqHeaders
  3510  	googleapi.Expand(req.URL, map[string]string{
  3511  		"parent": c.parent,
  3512  	})
  3513  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3514  }
  3515  
  3516  // Do executes the "cloudbilling.services.skus.list" call.
  3517  // Any non-2xx status code is an error. Response headers are in either
  3518  // *ListSkusResponse.ServerResponse.Header or (if a response was returned at
  3519  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3520  // check whether the returned error was because http.StatusNotModified was
  3521  // returned.
  3522  func (c *ServicesSkusListCall) Do(opts ...googleapi.CallOption) (*ListSkusResponse, error) {
  3523  	gensupport.SetOptions(c.urlParams_, opts...)
  3524  	res, err := c.doRequest("json")
  3525  	if res != nil && res.StatusCode == http.StatusNotModified {
  3526  		if res.Body != nil {
  3527  			res.Body.Close()
  3528  		}
  3529  		return nil, gensupport.WrapError(&googleapi.Error{
  3530  			Code:   res.StatusCode,
  3531  			Header: res.Header,
  3532  		})
  3533  	}
  3534  	if err != nil {
  3535  		return nil, err
  3536  	}
  3537  	defer googleapi.CloseBody(res)
  3538  	if err := googleapi.CheckResponse(res); err != nil {
  3539  		return nil, gensupport.WrapError(err)
  3540  	}
  3541  	ret := &ListSkusResponse{
  3542  		ServerResponse: googleapi.ServerResponse{
  3543  			Header:         res.Header,
  3544  			HTTPStatusCode: res.StatusCode,
  3545  		},
  3546  	}
  3547  	target := &ret
  3548  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3549  		return nil, err
  3550  	}
  3551  	return ret, nil
  3552  }
  3553  
  3554  // Pages invokes f for each page of results.
  3555  // A non-nil error returned from f will halt the iteration.
  3556  // The provided context supersedes any context provided to the Context method.
  3557  func (c *ServicesSkusListCall) Pages(ctx context.Context, f func(*ListSkusResponse) error) error {
  3558  	c.ctx_ = ctx
  3559  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3560  	for {
  3561  		x, err := c.Do()
  3562  		if err != nil {
  3563  			return err
  3564  		}
  3565  		if err := f(x); err != nil {
  3566  			return err
  3567  		}
  3568  		if x.NextPageToken == "" {
  3569  			return nil
  3570  		}
  3571  		c.PageToken(x.NextPageToken)
  3572  	}
  3573  }
  3574  

View as plain text