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