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 deploymentmanager provides access to the Cloud Deployment Manager V2 API. 8// 9// For product documentation, see: https://cloud.google.com/deployment-manager 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/deploymentmanager/v2" 16// ... 17// ctx := context.Background() 18// deploymentmanagerService, err := deploymentmanager.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// deploymentmanagerService, err := deploymentmanager.NewService(ctx, option.WithScopes(deploymentmanager.NdevCloudmanReadonlyScope)) 29// 30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31// 32// deploymentmanagerService, err := deploymentmanager.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// deploymentmanagerService, err := deploymentmanager.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40// 41// See https://godoc.org/google.golang.org/api/option/ for details on options. 42package deploymentmanager // import "google.golang.org/api/deploymentmanager/v2" 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 = "deploymentmanager:v2" 79const apiName = "deploymentmanager" 80const apiVersion = "v2" 81const basePath = "https://deploymentmanager.googleapis.com/" 82const mtlsBasePath = "https://deploymentmanager.mtls.googleapis.com/" 83 84// OAuth2 scopes used by this API. 85const ( 86 // See, edit, configure, and delete your Google Cloud Platform data 87 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 88 89 // View your data across Google Cloud Platform services 90 CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" 91 92 // View and manage your Google Cloud Platform management resources and 93 // deployment status information 94 NdevCloudmanScope = "https://www.googleapis.com/auth/ndev.cloudman" 95 96 // View your Google Cloud Platform management resources and deployment 97 // status information 98 NdevCloudmanReadonlyScope = "https://www.googleapis.com/auth/ndev.cloudman.readonly" 99) 100 101// NewService creates a new Service. 102func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 103 scopesOption := option.WithScopes( 104 "https://www.googleapis.com/auth/cloud-platform", 105 "https://www.googleapis.com/auth/cloud-platform.read-only", 106 "https://www.googleapis.com/auth/ndev.cloudman", 107 "https://www.googleapis.com/auth/ndev.cloudman.readonly", 108 ) 109 // NOTE: prepend, so we don't override user-specified scopes. 110 opts = append([]option.ClientOption{scopesOption}, opts...) 111 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 112 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 113 client, endpoint, err := htransport.NewClient(ctx, opts...) 114 if err != nil { 115 return nil, err 116 } 117 s, err := New(client) 118 if err != nil { 119 return nil, err 120 } 121 if endpoint != "" { 122 s.BasePath = endpoint 123 } 124 return s, nil 125} 126 127// New creates a new Service. It uses the provided http.Client for requests. 128// 129// Deprecated: please use NewService instead. 130// To provide a custom HTTP client, use option.WithHTTPClient. 131// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 132func New(client *http.Client) (*Service, error) { 133 if client == nil { 134 return nil, errors.New("client is nil") 135 } 136 s := &Service{client: client, BasePath: basePath} 137 s.Deployments = NewDeploymentsService(s) 138 s.Manifests = NewManifestsService(s) 139 s.Operations = NewOperationsService(s) 140 s.Resources = NewResourcesService(s) 141 s.Types = NewTypesService(s) 142 return s, nil 143} 144 145type Service struct { 146 client *http.Client 147 BasePath string // API endpoint base URL 148 UserAgent string // optional additional User-Agent fragment 149 150 Deployments *DeploymentsService 151 152 Manifests *ManifestsService 153 154 Operations *OperationsService 155 156 Resources *ResourcesService 157 158 Types *TypesService 159} 160 161func (s *Service) userAgent() string { 162 if s.UserAgent == "" { 163 return googleapi.UserAgent 164 } 165 return googleapi.UserAgent + " " + s.UserAgent 166} 167 168func NewDeploymentsService(s *Service) *DeploymentsService { 169 rs := &DeploymentsService{s: s} 170 return rs 171} 172 173type DeploymentsService struct { 174 s *Service 175} 176 177func NewManifestsService(s *Service) *ManifestsService { 178 rs := &ManifestsService{s: s} 179 return rs 180} 181 182type ManifestsService struct { 183 s *Service 184} 185 186func NewOperationsService(s *Service) *OperationsService { 187 rs := &OperationsService{s: s} 188 return rs 189} 190 191type OperationsService struct { 192 s *Service 193} 194 195func NewResourcesService(s *Service) *ResourcesService { 196 rs := &ResourcesService{s: s} 197 return rs 198} 199 200type ResourcesService struct { 201 s *Service 202} 203 204func NewTypesService(s *Service) *TypesService { 205 rs := &TypesService{s: s} 206 return rs 207} 208 209type TypesService struct { 210 s *Service 211} 212 213// AuditConfig: Specifies the audit configuration for a service. The 214// configuration determines which permission types are logged, and what 215// identities, if any, are exempted from logging. An AuditConfig must 216// have one or more AuditLogConfigs. If there are AuditConfigs for both 217// `allServices` and a specific service, the union of the two 218// AuditConfigs is used for that service: the log_types specified in 219// each AuditConfig are enabled, and the exempted_members in each 220// AuditLogConfig are exempted. Example Policy with multiple 221// AuditConfigs: { "audit_configs": [ { "service": "allServices", 222// "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": 223// [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { 224// "log_type": "ADMIN_READ" } ] }, { "service": 225// "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": 226// "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ 227// "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy 228// enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts 229// jose@example.com from DATA_READ logging, and aliya@example.com from 230// DATA_WRITE logging. 231type AuditConfig struct { 232 // AuditLogConfigs: The configuration for logging of each type of 233 // permission. 234 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"` 235 236 // Service: Specifies a service that will be enabled for audit logging. 237 // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. 238 // `allServices` is a special value that covers all services. 239 Service string `json:"service,omitempty"` 240 241 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to 242 // unconditionally include in API requests. By default, fields with 243 // empty values are omitted from API requests. However, any non-pointer, 244 // non-interface field appearing in ForceSendFields will be sent to the 245 // server regardless of whether the field is empty or not. This may be 246 // used to include empty fields in Patch requests. 247 ForceSendFields []string `json:"-"` 248 249 // NullFields is a list of field names (e.g. "AuditLogConfigs") to 250 // include in API requests with the JSON null value. By default, fields 251 // with empty values are omitted from API requests. However, any field 252 // with an empty value appearing in NullFields will be sent to the 253 // server as null. It is an error if a field in this list has a 254 // non-empty value. This may be used to include null fields in Patch 255 // requests. 256 NullFields []string `json:"-"` 257} 258 259func (s *AuditConfig) MarshalJSON() ([]byte, error) { 260 type NoMethod AuditConfig 261 raw := NoMethod(*s) 262 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 263} 264 265// AuditLogConfig: Provides the configuration for logging a type of 266// permissions. Example: { "audit_log_configs": [ { "log_type": 267// "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { 268// "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and 269// 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ 270// logging. 271type AuditLogConfig struct { 272 // ExemptedMembers: Specifies the identities that do not cause logging 273 // for this type of permission. Follows the same format of 274 // Binding.members. 275 ExemptedMembers []string `json:"exemptedMembers,omitempty"` 276 277 // LogType: The log type that this config enables. 278 // 279 // Possible values: 280 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this. 281 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy 282 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create 283 // "DATA_READ" - Data reads. Example: CloudSQL Users list 284 LogType string `json:"logType,omitempty"` 285 286 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to 287 // unconditionally include in API requests. By default, fields with 288 // empty values are omitted from API requests. However, any non-pointer, 289 // non-interface field appearing in ForceSendFields will be sent to the 290 // server regardless of whether the field is empty or not. This may be 291 // used to include empty fields in Patch requests. 292 ForceSendFields []string `json:"-"` 293 294 // NullFields is a list of field names (e.g. "ExemptedMembers") to 295 // include in API requests with the JSON null value. By default, fields 296 // with empty values are omitted from API requests. However, any field 297 // with an empty value appearing in NullFields will be sent to the 298 // server as null. It is an error if a field in this list has a 299 // non-empty value. This may be used to include null fields in Patch 300 // requests. 301 NullFields []string `json:"-"` 302} 303 304func (s *AuditLogConfig) MarshalJSON() ([]byte, error) { 305 type NoMethod AuditLogConfig 306 raw := NoMethod(*s) 307 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 308} 309 310// Binding: Associates `members` with a `role`. 311type Binding struct { 312 // Condition: The condition that is associated with this binding. If the 313 // condition evaluates to `true`, then this binding applies to the 314 // current request. If the condition evaluates to `false`, then this 315 // binding does not apply to the current request. However, a different 316 // role binding might grant the same role to one or more of the members 317 // in this binding. To learn which resources support conditions in their 318 // IAM policies, see the IAM documentation 319 // (https://cloud.google.com/iam/help/conditions/resource-policies). 320 Condition *Expr `json:"condition,omitempty"` 321 322 // Members: Specifies the identities requesting access for a Cloud 323 // Platform resource. `members` can have the following values: * 324 // `allUsers`: A special identifier that represents anyone who is on the 325 // internet; with or without a Google account. * 326 // `allAuthenticatedUsers`: A special identifier that represents anyone 327 // who is authenticated with a Google account or a service account. * 328 // `user:{emailid}`: An email address that represents a specific Google 329 // account. For example, `alice@example.com` . * 330 // `serviceAccount:{emailid}`: An email address that represents a 331 // service account. For example, 332 // `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An 333 // email address that represents a Google group. For example, 334 // `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An 335 // email address (plus unique identifier) representing a user that has 336 // been recently deleted. For example, 337 // `alice@example.com?uid=123456789012345678901`. If the user is 338 // recovered, this value reverts to `user:{emailid}` and the recovered 339 // user retains the role in the binding. * 340 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address 341 // (plus unique identifier) representing a service account that has been 342 // recently deleted. For example, 343 // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 344 // If the service account is undeleted, this value reverts to 345 // `serviceAccount:{emailid}` and the undeleted service account retains 346 // the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: 347 // An email address (plus unique identifier) representing a Google group 348 // that has been recently deleted. For example, 349 // `admins@example.com?uid=123456789012345678901`. If the group is 350 // recovered, this value reverts to `group:{emailid}` and the recovered 351 // group retains the role in the binding. * `domain:{domain}`: The G 352 // Suite domain (primary) that represents all the users of that domain. 353 // For example, `google.com` or `example.com`. 354 Members []string `json:"members,omitempty"` 355 356 // Role: Role that is assigned to `members`. For example, 357 // `roles/viewer`, `roles/editor`, or `roles/owner`. 358 Role string `json:"role,omitempty"` 359 360 // ForceSendFields is a list of field names (e.g. "Condition") to 361 // unconditionally include in API requests. By default, fields with 362 // empty values are omitted from API requests. However, any non-pointer, 363 // non-interface field appearing in ForceSendFields will be sent to the 364 // server regardless of whether the field is empty or not. This may be 365 // used to include empty fields in Patch requests. 366 ForceSendFields []string `json:"-"` 367 368 // NullFields is a list of field names (e.g. "Condition") to include in 369 // API requests with the JSON null value. By default, fields with empty 370 // values are omitted from API requests. However, any field with an 371 // empty value appearing in NullFields will be sent to the server as 372 // null. It is an error if a field in this list has a non-empty value. 373 // This may be used to include null fields in Patch requests. 374 NullFields []string `json:"-"` 375} 376 377func (s *Binding) MarshalJSON() ([]byte, error) { 378 type NoMethod Binding 379 raw := NoMethod(*s) 380 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 381} 382 383type ConfigFile struct { 384 // Content: The contents of the file. 385 Content string `json:"content,omitempty"` 386 387 // ForceSendFields is a list of field names (e.g. "Content") to 388 // unconditionally include in API requests. By default, fields with 389 // empty values are omitted from API requests. However, any non-pointer, 390 // non-interface field appearing in ForceSendFields will be sent to the 391 // server regardless of whether the field is empty or not. This may be 392 // used to include empty fields in Patch requests. 393 ForceSendFields []string `json:"-"` 394 395 // NullFields is a list of field names (e.g. "Content") to include in 396 // API requests with the JSON null value. By default, fields with empty 397 // values are omitted from API requests. However, any field with an 398 // empty value appearing in NullFields will be sent to the server as 399 // null. It is an error if a field in this list has a non-empty value. 400 // This may be used to include null fields in Patch requests. 401 NullFields []string `json:"-"` 402} 403 404func (s *ConfigFile) MarshalJSON() ([]byte, error) { 405 type NoMethod ConfigFile 406 raw := NoMethod(*s) 407 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 408} 409 410type Deployment struct { 411 // Description: An optional user-provided description of the deployment. 412 Description string `json:"description,omitempty"` 413 414 // Fingerprint: Provides a fingerprint to use in requests to modify a 415 // deployment, such as `update()`, `stop()`, and `cancelPreview()` 416 // requests. A fingerprint is a randomly generated value that must be 417 // provided with `update()`, `stop()`, and `cancelPreview()` requests to 418 // perform optimistic locking. This ensures optimistic concurrency so 419 // that only one request happens at a time. The fingerprint is initially 420 // generated by Deployment Manager and changes after every request to 421 // modify data. To get the latest fingerprint value, perform a `get()` 422 // request to a deployment. 423 Fingerprint string `json:"fingerprint,omitempty"` 424 425 Id uint64 `json:"id,omitempty,string"` 426 427 // InsertTime: Output only. Creation timestamp in RFC3339 text format. 428 InsertTime string `json:"insertTime,omitempty"` 429 430 // Labels: Map of One Platform labels; provided by the client when the 431 // resource is created or updated. Specifically: Label keys must be 432 // between 1 and 63 characters long and must conform to the following 433 // regular expression: `a-z ([-a-z0-9]*[a-z0-9])?` Label values must be 434 // between 0 and 63 characters long and must conform to the regular 435 // expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. 436 Labels []*DeploymentLabelEntry `json:"labels,omitempty"` 437 438 // Manifest: Output only. URL of the manifest representing the last 439 // manifest that was successfully deployed. If no manifest has been 440 // successfully deployed, this field will be absent. 441 Manifest string `json:"manifest,omitempty"` 442 443 // Name: Name of the resource; provided by the client when the resource 444 // is created. The name must be 1-63 characters long, and comply with 445 // RFC1035. Specifically, the name must be 1-63 characters long and 446 // match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means 447 // the first character must be a lowercase letter, and all following 448 // characters must be a dash, lowercase letter, or digit, except the 449 // last character, which cannot be a dash. 450 Name string `json:"name,omitempty"` 451 452 // Operation: Output only. The Operation that most recently ran, or is 453 // currently running, on this deployment. 454 Operation *Operation `json:"operation,omitempty"` 455 456 // SelfLink: Output only. Server defined URL for the resource. 457 SelfLink string `json:"selfLink,omitempty"` 458 459 // Target: [Input Only] The parameters that define your deployment, 460 // including the deployment configuration and relevant templates. 461 Target *TargetConfiguration `json:"target,omitempty"` 462 463 // Update: Output only. If Deployment Manager is currently updating or 464 // previewing an update to this deployment, the updated configuration 465 // appears here. 466 Update *DeploymentUpdate `json:"update,omitempty"` 467 468 // UpdateTime: Output only. Update timestamp in RFC3339 text format. 469 UpdateTime string `json:"updateTime,omitempty"` 470 471 // ServerResponse contains the HTTP response code and headers from the 472 // server. 473 googleapi.ServerResponse `json:"-"` 474 475 // ForceSendFields is a list of field names (e.g. "Description") to 476 // unconditionally include in API requests. By default, fields with 477 // empty values are omitted from API requests. However, any non-pointer, 478 // non-interface field appearing in ForceSendFields will be sent to the 479 // server regardless of whether the field is empty or not. This may be 480 // used to include empty fields in Patch requests. 481 ForceSendFields []string `json:"-"` 482 483 // NullFields is a list of field names (e.g. "Description") to include 484 // in API requests with the JSON null value. By default, fields with 485 // empty values are omitted from API requests. However, any field with 486 // an empty value appearing in NullFields will be sent to the server as 487 // null. It is an error if a field in this list has a non-empty value. 488 // This may be used to include null fields in Patch requests. 489 NullFields []string `json:"-"` 490} 491 492func (s *Deployment) MarshalJSON() ([]byte, error) { 493 type NoMethod Deployment 494 raw := NoMethod(*s) 495 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 496} 497 498// DeploymentLabelEntry: Label object for Deployments 499type DeploymentLabelEntry struct { 500 // Key: Key of the label 501 Key string `json:"key,omitempty"` 502 503 // Value: Value of the label 504 Value string `json:"value,omitempty"` 505 506 // ForceSendFields is a list of field names (e.g. "Key") to 507 // unconditionally include in API requests. By default, fields with 508 // empty values are omitted from API requests. However, any non-pointer, 509 // non-interface field appearing in ForceSendFields will be sent to the 510 // server regardless of whether the field is empty or not. This may be 511 // used to include empty fields in Patch requests. 512 ForceSendFields []string `json:"-"` 513 514 // NullFields is a list of field names (e.g. "Key") to include in API 515 // requests with the JSON null value. By default, fields with empty 516 // values are omitted from API requests. However, any field with an 517 // empty value appearing in NullFields will be sent to the server as 518 // null. It is an error if a field in this list has a non-empty value. 519 // This may be used to include null fields in Patch requests. 520 NullFields []string `json:"-"` 521} 522 523func (s *DeploymentLabelEntry) MarshalJSON() ([]byte, error) { 524 type NoMethod DeploymentLabelEntry 525 raw := NoMethod(*s) 526 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 527} 528 529type DeploymentUpdate struct { 530 // Description: Output only. An optional user-provided description of 531 // the deployment after the current update has been applied. 532 Description string `json:"description,omitempty"` 533 534 // Labels: Map of One Platform labels; provided by the client when the 535 // resource is created or updated. Specifically: Label keys must be 536 // between 1 and 63 characters long and must conform to the following 537 // regular expression: `a-z ([-a-z0-9]*[a-z0-9])?` Label values must be 538 // between 0 and 63 characters long and must conform to the regular 539 // expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. 540 Labels []*DeploymentUpdateLabelEntry `json:"labels,omitempty"` 541 542 // Manifest: Output only. URL of the manifest representing the update 543 // configuration of this deployment. 544 Manifest string `json:"manifest,omitempty"` 545 546 // ForceSendFields is a list of field names (e.g. "Description") to 547 // unconditionally include in API requests. By default, fields with 548 // empty values are omitted from API requests. However, any non-pointer, 549 // non-interface field appearing in ForceSendFields will be sent to the 550 // server regardless of whether the field is empty or not. This may be 551 // used to include empty fields in Patch requests. 552 ForceSendFields []string `json:"-"` 553 554 // NullFields is a list of field names (e.g. "Description") to include 555 // in API requests with the JSON null value. By default, fields with 556 // empty values are omitted from API requests. However, any field with 557 // an empty value appearing in NullFields will be sent to the server as 558 // null. It is an error if a field in this list has a non-empty value. 559 // This may be used to include null fields in Patch requests. 560 NullFields []string `json:"-"` 561} 562 563func (s *DeploymentUpdate) MarshalJSON() ([]byte, error) { 564 type NoMethod DeploymentUpdate 565 raw := NoMethod(*s) 566 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 567} 568 569// DeploymentUpdateLabelEntry: Label object for DeploymentUpdate 570type DeploymentUpdateLabelEntry struct { 571 // Key: Key of the label 572 Key string `json:"key,omitempty"` 573 574 // Value: Value of the label 575 Value string `json:"value,omitempty"` 576 577 // ForceSendFields is a list of field names (e.g. "Key") to 578 // unconditionally include in API requests. By default, fields with 579 // empty values are omitted from API requests. However, any non-pointer, 580 // non-interface field appearing in ForceSendFields will be sent to the 581 // server regardless of whether the field is empty or not. This may be 582 // used to include empty fields in Patch requests. 583 ForceSendFields []string `json:"-"` 584 585 // NullFields is a list of field names (e.g. "Key") to include in API 586 // requests with the JSON null value. By default, fields with empty 587 // values are omitted from API requests. However, any field with an 588 // empty value appearing in NullFields will be sent to the server as 589 // null. It is an error if a field in this list has a non-empty value. 590 // This may be used to include null fields in Patch requests. 591 NullFields []string `json:"-"` 592} 593 594func (s *DeploymentUpdateLabelEntry) MarshalJSON() ([]byte, error) { 595 type NoMethod DeploymentUpdateLabelEntry 596 raw := NoMethod(*s) 597 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 598} 599 600type DeploymentsCancelPreviewRequest struct { 601 // Fingerprint: Specifies a fingerprint for `cancelPreview()` requests. 602 // A fingerprint is a randomly generated value that must be provided in 603 // `cancelPreview()` requests to perform optimistic locking. This 604 // ensures optimistic concurrency so that the deployment does not have 605 // conflicting requests (e.g. if someone attempts to make a new update 606 // request while another user attempts to cancel a preview, this would 607 // prevent one of the requests). The fingerprint is initially generated 608 // by Deployment Manager and changes after every request to modify a 609 // deployment. To get the latest fingerprint value, perform a `get()` 610 // request on the deployment. 611 Fingerprint string `json:"fingerprint,omitempty"` 612 613 // ForceSendFields is a list of field names (e.g. "Fingerprint") to 614 // unconditionally include in API requests. By default, fields with 615 // empty values are omitted from API requests. However, any non-pointer, 616 // non-interface field appearing in ForceSendFields will be sent to the 617 // server regardless of whether the field is empty or not. This may be 618 // used to include empty fields in Patch requests. 619 ForceSendFields []string `json:"-"` 620 621 // NullFields is a list of field names (e.g. "Fingerprint") to include 622 // in API requests with the JSON null value. By default, fields with 623 // empty values are omitted from API requests. However, any field with 624 // an empty value appearing in NullFields will be sent to the server as 625 // null. It is an error if a field in this list has a non-empty value. 626 // This may be used to include null fields in Patch requests. 627 NullFields []string `json:"-"` 628} 629 630func (s *DeploymentsCancelPreviewRequest) MarshalJSON() ([]byte, error) { 631 type NoMethod DeploymentsCancelPreviewRequest 632 raw := NoMethod(*s) 633 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 634} 635 636// DeploymentsListResponse: A response containing a partial list of 637// deployments and a page token used to build the next request if the 638// request has been truncated. 639type DeploymentsListResponse struct { 640 // Deployments: Output only. The deployments contained in this response. 641 Deployments []*Deployment `json:"deployments,omitempty"` 642 643 // NextPageToken: Output only. A token used to continue a truncated list 644 // request. 645 NextPageToken string `json:"nextPageToken,omitempty"` 646 647 // ServerResponse contains the HTTP response code and headers from the 648 // server. 649 googleapi.ServerResponse `json:"-"` 650 651 // ForceSendFields is a list of field names (e.g. "Deployments") to 652 // unconditionally include in API requests. By default, fields with 653 // empty values are omitted from API requests. However, any non-pointer, 654 // non-interface field appearing in ForceSendFields will be sent to the 655 // server regardless of whether the field is empty or not. This may be 656 // used to include empty fields in Patch requests. 657 ForceSendFields []string `json:"-"` 658 659 // NullFields is a list of field names (e.g. "Deployments") to include 660 // in API requests with the JSON null value. By default, fields with 661 // empty values are omitted from API requests. However, any field with 662 // an empty value appearing in NullFields will be sent to the server as 663 // null. It is an error if a field in this list has a non-empty value. 664 // This may be used to include null fields in Patch requests. 665 NullFields []string `json:"-"` 666} 667 668func (s *DeploymentsListResponse) MarshalJSON() ([]byte, error) { 669 type NoMethod DeploymentsListResponse 670 raw := NoMethod(*s) 671 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 672} 673 674type DeploymentsStopRequest struct { 675 // Fingerprint: Specifies a fingerprint for `stop()` requests. A 676 // fingerprint is a randomly generated value that must be provided in 677 // `stop()` requests to perform optimistic locking. This ensures 678 // optimistic concurrency so that the deployment does not have 679 // conflicting requests (e.g. if someone attempts to make a new update 680 // request while another user attempts to stop an ongoing update 681 // request, this would prevent a collision). The fingerprint is 682 // initially generated by Deployment Manager and changes after every 683 // request to modify a deployment. To get the latest fingerprint value, 684 // perform a `get()` request on the deployment. 685 Fingerprint string `json:"fingerprint,omitempty"` 686 687 // ForceSendFields is a list of field names (e.g. "Fingerprint") to 688 // unconditionally include in API requests. By default, fields with 689 // empty values are omitted from API requests. However, any non-pointer, 690 // non-interface field appearing in ForceSendFields will be sent to the 691 // server regardless of whether the field is empty or not. This may be 692 // used to include empty fields in Patch requests. 693 ForceSendFields []string `json:"-"` 694 695 // NullFields is a list of field names (e.g. "Fingerprint") to include 696 // in API requests with the JSON null value. By default, fields with 697 // empty values are omitted from API requests. However, any field with 698 // an empty value appearing in NullFields will be sent to the server as 699 // null. It is an error if a field in this list has a non-empty value. 700 // This may be used to include null fields in Patch requests. 701 NullFields []string `json:"-"` 702} 703 704func (s *DeploymentsStopRequest) MarshalJSON() ([]byte, error) { 705 type NoMethod DeploymentsStopRequest 706 raw := NoMethod(*s) 707 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 708} 709 710// Expr: Represents a textual expression in the Common Expression 711// Language (CEL) syntax. CEL is a C-like expression language. The 712// syntax and semantics of CEL are documented at 713// https://github.com/google/cel-spec. Example (Comparison): title: 714// "Summary size limit" description: "Determines if a summary is less 715// than 100 chars" expression: "document.summary.size() < 100" Example 716// (Equality): title: "Requestor is owner" description: "Determines if 717// requestor is the document owner" expression: "document.owner == 718// request.auth.claims.email" Example (Logic): title: "Public documents" 719// description: "Determine whether the document should be publicly 720// visible" expression: "document.type != 'private' && document.type != 721// 'internal'" Example (Data Manipulation): title: "Notification string" 722// description: "Create a notification string with a timestamp." 723// expression: "'New message received at ' + 724// string(document.create_time)" The exact variables and functions that 725// may be referenced within an expression are determined by the service 726// that evaluates it. See the service documentation for additional 727// information. 728type Expr struct { 729 // Description: Optional. Description of the expression. This is a 730 // longer text which describes the expression, e.g. when hovered over it 731 // in a UI. 732 Description string `json:"description,omitempty"` 733 734 // Expression: Textual representation of an expression in Common 735 // Expression Language syntax. 736 Expression string `json:"expression,omitempty"` 737 738 // Location: Optional. String indicating the location of the expression 739 // for error reporting, e.g. a file name and a position in the file. 740 Location string `json:"location,omitempty"` 741 742 // Title: Optional. Title for the expression, i.e. a short string 743 // describing its purpose. This can be used e.g. in UIs which allow to 744 // enter the expression. 745 Title string `json:"title,omitempty"` 746 747 // ForceSendFields is a list of field names (e.g. "Description") to 748 // unconditionally include in API requests. By default, fields with 749 // empty values are omitted from API requests. However, any non-pointer, 750 // non-interface field appearing in ForceSendFields will be sent to the 751 // server regardless of whether the field is empty or not. This may be 752 // used to include empty fields in Patch requests. 753 ForceSendFields []string `json:"-"` 754 755 // NullFields is a list of field names (e.g. "Description") to include 756 // in API requests with the JSON null value. By default, fields with 757 // empty values are omitted from API requests. However, any field with 758 // an empty value appearing in NullFields will be sent to the server as 759 // null. It is an error if a field in this list has a non-empty value. 760 // This may be used to include null fields in Patch requests. 761 NullFields []string `json:"-"` 762} 763 764func (s *Expr) MarshalJSON() ([]byte, error) { 765 type NoMethod Expr 766 raw := NoMethod(*s) 767 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 768} 769 770type GlobalSetPolicyRequest struct { 771 // Bindings: Flatten Policy to create a backward compatible wire-format. 772 // Deprecated. Use 'policy' to specify bindings. 773 Bindings []*Binding `json:"bindings,omitempty"` 774 775 // Etag: Flatten Policy to create a backward compatible wire-format. 776 // Deprecated. Use 'policy' to specify the etag. 777 Etag string `json:"etag,omitempty"` 778 779 // Policy: REQUIRED: The complete policy to be applied to the 780 // 'resource'. The size of the policy is limited to a few 10s of KB. An 781 // empty policy is in general a valid policy but certain services (like 782 // Projects) might reject them. 783 Policy *Policy `json:"policy,omitempty"` 784 785 // ForceSendFields is a list of field names (e.g. "Bindings") to 786 // unconditionally include in API requests. By default, fields with 787 // empty values are omitted from API requests. However, any non-pointer, 788 // non-interface field appearing in ForceSendFields will be sent to the 789 // server regardless of whether the field is empty or not. This may be 790 // used to include empty fields in Patch requests. 791 ForceSendFields []string `json:"-"` 792 793 // NullFields is a list of field names (e.g. "Bindings") to include in 794 // API requests with the JSON null value. By default, fields with empty 795 // values are omitted from API requests. However, any field with an 796 // empty value appearing in NullFields will be sent to the server as 797 // null. It is an error if a field in this list has a non-empty value. 798 // This may be used to include null fields in Patch requests. 799 NullFields []string `json:"-"` 800} 801 802func (s *GlobalSetPolicyRequest) MarshalJSON() ([]byte, error) { 803 type NoMethod GlobalSetPolicyRequest 804 raw := NoMethod(*s) 805 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 806} 807 808type ImportFile struct { 809 // Content: The contents of the file. 810 Content string `json:"content,omitempty"` 811 812 // Name: The name of the file. 813 Name string `json:"name,omitempty"` 814 815 // ForceSendFields is a list of field names (e.g. "Content") to 816 // unconditionally include in API requests. By default, fields with 817 // empty values are omitted from API requests. However, any non-pointer, 818 // non-interface field appearing in ForceSendFields will be sent to the 819 // server regardless of whether the field is empty or not. This may be 820 // used to include empty fields in Patch requests. 821 ForceSendFields []string `json:"-"` 822 823 // NullFields is a list of field names (e.g. "Content") to include in 824 // API requests with the JSON null value. By default, fields with empty 825 // values are omitted from API requests. However, any field with an 826 // empty value appearing in NullFields will be sent to the server as 827 // null. It is an error if a field in this list has a non-empty value. 828 // This may be used to include null fields in Patch requests. 829 NullFields []string `json:"-"` 830} 831 832func (s *ImportFile) MarshalJSON() ([]byte, error) { 833 type NoMethod ImportFile 834 raw := NoMethod(*s) 835 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 836} 837 838type Manifest struct { 839 // Config: Output only. The YAML configuration for this manifest. 840 Config *ConfigFile `json:"config,omitempty"` 841 842 // ExpandedConfig: Output only. The fully-expanded configuration file, 843 // including any templates and references. 844 ExpandedConfig string `json:"expandedConfig,omitempty"` 845 846 Id uint64 `json:"id,omitempty,string"` 847 848 // Imports: Output only. The imported files for this manifest. 849 Imports []*ImportFile `json:"imports,omitempty"` 850 851 // InsertTime: Output only. Creation timestamp in RFC3339 text format. 852 InsertTime string `json:"insertTime,omitempty"` 853 854 // Layout: Output only. The YAML layout for this manifest. 855 Layout string `json:"layout,omitempty"` 856 857 // ManifestSizeBytes: Output only. The computed size of the fully 858 // expanded manifest. 859 ManifestSizeBytes int64 `json:"manifestSizeBytes,omitempty,string"` 860 861 // ManifestSizeLimitBytes: Output only. The size limit for expanded 862 // manifests in the project. 863 ManifestSizeLimitBytes int64 `json:"manifestSizeLimitBytes,omitempty,string"` 864 865 // Name: Output only. The name of the manifest. 866 Name string `json:"name,omitempty"` 867 868 // SelfLink: Output only. Self link for the manifest. 869 SelfLink string `json:"selfLink,omitempty"` 870 871 // ServerResponse contains the HTTP response code and headers from the 872 // server. 873 googleapi.ServerResponse `json:"-"` 874 875 // ForceSendFields is a list of field names (e.g. "Config") to 876 // unconditionally include in API requests. By default, fields with 877 // empty values are omitted from API requests. However, any non-pointer, 878 // non-interface field appearing in ForceSendFields will be sent to the 879 // server regardless of whether the field is empty or not. This may be 880 // used to include empty fields in Patch requests. 881 ForceSendFields []string `json:"-"` 882 883 // NullFields is a list of field names (e.g. "Config") to include in API 884 // requests with the JSON null value. By default, fields with empty 885 // values are omitted from API requests. However, any field with an 886 // empty value appearing in NullFields will be sent to the server as 887 // null. It is an error if a field in this list has a non-empty value. 888 // This may be used to include null fields in Patch requests. 889 NullFields []string `json:"-"` 890} 891 892func (s *Manifest) MarshalJSON() ([]byte, error) { 893 type NoMethod Manifest 894 raw := NoMethod(*s) 895 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 896} 897 898// ManifestsListResponse: A response containing a partial list of 899// manifests and a page token used to build the next request if the 900// request has been truncated. 901type ManifestsListResponse struct { 902 // Manifests: Output only. Manifests contained in this list response. 903 Manifests []*Manifest `json:"manifests,omitempty"` 904 905 // NextPageToken: Output only. A token used to continue a truncated list 906 // request. 907 NextPageToken string `json:"nextPageToken,omitempty"` 908 909 // ServerResponse contains the HTTP response code and headers from the 910 // server. 911 googleapi.ServerResponse `json:"-"` 912 913 // ForceSendFields is a list of field names (e.g. "Manifests") to 914 // unconditionally include in API requests. By default, fields with 915 // empty values are omitted from API requests. However, any non-pointer, 916 // non-interface field appearing in ForceSendFields will be sent to the 917 // server regardless of whether the field is empty or not. This may be 918 // used to include empty fields in Patch requests. 919 ForceSendFields []string `json:"-"` 920 921 // NullFields is a list of field names (e.g. "Manifests") to include in 922 // API requests with the JSON null value. By default, fields with empty 923 // values are omitted from API requests. However, any field with an 924 // empty value appearing in NullFields will be sent to the server as 925 // null. It is an error if a field in this list has a non-empty value. 926 // This may be used to include null fields in Patch requests. 927 NullFields []string `json:"-"` 928} 929 930func (s *ManifestsListResponse) MarshalJSON() ([]byte, error) { 931 type NoMethod ManifestsListResponse 932 raw := NoMethod(*s) 933 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 934} 935 936// Operation: Represents an Operation resource. Google Compute Engine 937// has three Operation resources: * Global 938// (/compute/docs/reference/rest/{$api_version}/globalOperations) * 939// Regional 940// (/compute/docs/reference/rest/{$api_version}/regionOperations) * 941// Zonal (/compute/docs/reference/rest/{$api_version}/zoneOperations) 942// You can use an operation resource to manage asynchronous API 943// requests. For more information, read Handling API responses. 944// Operations can be global, regional or zonal. - For global operations, 945// use the `globalOperations` resource. - For regional operations, use 946// the `regionOperations` resource. - For zonal operations, use the 947// `zonalOperations` resource. For more information, read Global, 948// Regional, and Zonal Resources. 949type Operation struct { 950 // ClientOperationId: [Output Only] The value of `requestId` if you 951 // provided it in the request. Not present otherwise. 952 ClientOperationId string `json:"clientOperationId,omitempty"` 953 954 // CreationTimestamp: [Deprecated] This field is deprecated. 955 CreationTimestamp string `json:"creationTimestamp,omitempty"` 956 957 // Description: [Output Only] A textual description of the operation, 958 // which is set when the operation is created. 959 Description string `json:"description,omitempty"` 960 961 // EndTime: [Output Only] The time that this operation was completed. 962 // This value is in RFC3339 text format. 963 EndTime string `json:"endTime,omitempty"` 964 965 // Error: [Output Only] If errors are generated during processing of the 966 // operation, this field will be populated. 967 Error *OperationError `json:"error,omitempty"` 968 969 // HttpErrorMessage: [Output Only] If the operation fails, this field 970 // contains the HTTP error message that was returned, such as `NOT 971 // FOUND`. 972 HttpErrorMessage string `json:"httpErrorMessage,omitempty"` 973 974 // HttpErrorStatusCode: [Output Only] If the operation fails, this field 975 // contains the HTTP error status code that was returned. For example, a 976 // `404` means the resource was not found. 977 HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` 978 979 // Id: [Output Only] The unique identifier for the operation. This 980 // identifier is defined by the server. 981 Id uint64 `json:"id,omitempty,string"` 982 983 // InsertTime: [Output Only] The time that this operation was requested. 984 // This value is in RFC3339 text format. 985 InsertTime string `json:"insertTime,omitempty"` 986 987 // Kind: [Output Only] Type of the resource. Always `compute#operation` 988 // for Operation resources. 989 Kind string `json:"kind,omitempty"` 990 991 // Name: [Output Only] Name of the operation. 992 Name string `json:"name,omitempty"` 993 994 // OperationGroupId: [Output Only] An ID that represents a group of 995 // operations, such as when a group of operations results from a 996 // `bulkInsert` API request. 997 OperationGroupId string `json:"operationGroupId,omitempty"` 998 999 // OperationType: [Output Only] The type of operation, such as `insert`, 1000 // `update`, or `delete`, and so on. 1001 OperationType string `json:"operationType,omitempty"` 1002 1003 // Progress: [Output Only] An optional progress indicator that ranges 1004 // from 0 to 100. There is no requirement that this be linear or support 1005 // any granularity of operations. This should not be used to guess when 1006 // the operation will be complete. This number should monotonically 1007 // increase as the operation progresses. 1008 Progress int64 `json:"progress,omitempty"` 1009 1010 // Region: [Output Only] The URL of the region where the operation 1011 // resides. Only applicable when performing regional operations. 1012 Region string `json:"region,omitempty"` 1013 1014 // SelfLink: [Output Only] Server-defined URL for the resource. 1015 SelfLink string `json:"selfLink,omitempty"` 1016 1017 // StartTime: [Output Only] The time that this operation was started by 1018 // the server. This value is in RFC3339 text format. 1019 StartTime string `json:"startTime,omitempty"` 1020 1021 // Status: [Output Only] The status of the operation, which can be one 1022 // of the following: `PENDING`, `RUNNING`, or `DONE`. 1023 // 1024 // Possible values: 1025 // "PENDING" 1026 // "RUNNING" 1027 // "DONE" 1028 Status string `json:"status,omitempty"` 1029 1030 // StatusMessage: [Output Only] An optional textual description of the 1031 // current status of the operation. 1032 StatusMessage string `json:"statusMessage,omitempty"` 1033 1034 // TargetId: [Output Only] The unique target ID, which identifies a 1035 // specific incarnation of the target resource. 1036 TargetId uint64 `json:"targetId,omitempty,string"` 1037 1038 // TargetLink: [Output Only] The URL of the resource that the operation 1039 // modifies. For operations related to creating a snapshot, this points 1040 // to the persistent disk that the snapshot was created from. 1041 TargetLink string `json:"targetLink,omitempty"` 1042 1043 // User: [Output Only] User who requested the operation, for example: 1044 // `user@example.com`. 1045 User string `json:"user,omitempty"` 1046 1047 // Warnings: [Output Only] If warning messages are generated during 1048 // processing of the operation, this field will be populated. 1049 Warnings []*OperationWarnings `json:"warnings,omitempty"` 1050 1051 // Zone: [Output Only] The URL of the zone where the operation resides. 1052 // Only applicable when performing per-zone operations. 1053 Zone string `json:"zone,omitempty"` 1054 1055 // ServerResponse contains the HTTP response code and headers from the 1056 // server. 1057 googleapi.ServerResponse `json:"-"` 1058 1059 // ForceSendFields is a list of field names (e.g. "ClientOperationId") 1060 // to unconditionally include in API requests. By default, fields with 1061 // empty values are omitted from API requests. However, any non-pointer, 1062 // non-interface field appearing in ForceSendFields will be sent to the 1063 // server regardless of whether the field is empty or not. This may be 1064 // used to include empty fields in Patch requests. 1065 ForceSendFields []string `json:"-"` 1066 1067 // NullFields is a list of field names (e.g. "ClientOperationId") to 1068 // include in API requests with the JSON null value. By default, fields 1069 // with empty values are omitted from API requests. However, any field 1070 // with an empty value appearing in NullFields will be sent to the 1071 // server as null. It is an error if a field in this list has a 1072 // non-empty value. This may be used to include null fields in Patch 1073 // requests. 1074 NullFields []string `json:"-"` 1075} 1076 1077func (s *Operation) MarshalJSON() ([]byte, error) { 1078 type NoMethod Operation 1079 raw := NoMethod(*s) 1080 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1081} 1082 1083// OperationError: [Output Only] If errors are generated during 1084// processing of the operation, this field will be populated. 1085type OperationError struct { 1086 // Errors: [Output Only] The array of errors encountered while 1087 // processing this operation. 1088 Errors []*OperationErrorErrors `json:"errors,omitempty"` 1089 1090 // ForceSendFields is a list of field names (e.g. "Errors") to 1091 // unconditionally include in API requests. By default, fields with 1092 // empty values are omitted from API requests. However, any non-pointer, 1093 // non-interface field appearing in ForceSendFields will be sent to the 1094 // server regardless of whether the field is empty or not. This may be 1095 // used to include empty fields in Patch requests. 1096 ForceSendFields []string `json:"-"` 1097 1098 // NullFields is a list of field names (e.g. "Errors") to include in API 1099 // requests with the JSON null value. By default, fields with empty 1100 // values are omitted from API requests. However, any field with an 1101 // empty value appearing in NullFields will be sent to the server as 1102 // null. It is an error if a field in this list has a non-empty value. 1103 // This may be used to include null fields in Patch requests. 1104 NullFields []string `json:"-"` 1105} 1106 1107func (s *OperationError) MarshalJSON() ([]byte, error) { 1108 type NoMethod OperationError 1109 raw := NoMethod(*s) 1110 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1111} 1112 1113type OperationErrorErrors struct { 1114 // Code: [Output Only] The error type identifier for this error. 1115 Code string `json:"code,omitempty"` 1116 1117 // Location: [Output Only] Indicates the field in the request that 1118 // caused the error. This property is optional. 1119 Location string `json:"location,omitempty"` 1120 1121 // Message: [Output Only] An optional, human-readable error message. 1122 Message string `json:"message,omitempty"` 1123 1124 // ForceSendFields is a list of field names (e.g. "Code") to 1125 // unconditionally include in API requests. By default, fields with 1126 // empty values are omitted from API requests. However, any non-pointer, 1127 // non-interface field appearing in ForceSendFields will be sent to the 1128 // server regardless of whether the field is empty or not. This may be 1129 // used to include empty fields in Patch requests. 1130 ForceSendFields []string `json:"-"` 1131 1132 // NullFields is a list of field names (e.g. "Code") to include in API 1133 // requests with the JSON null value. By default, fields with empty 1134 // values are omitted from API requests. However, any field with an 1135 // empty value appearing in NullFields will be sent to the server as 1136 // null. It is an error if a field in this list has a non-empty value. 1137 // This may be used to include null fields in Patch requests. 1138 NullFields []string `json:"-"` 1139} 1140 1141func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) { 1142 type NoMethod OperationErrorErrors 1143 raw := NoMethod(*s) 1144 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1145} 1146 1147type OperationWarnings struct { 1148 // Code: [Output Only] A warning code, if applicable. For example, 1149 // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in 1150 // the response. 1151 // 1152 // Possible values: 1153 // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was 1154 // created. 1155 // "NO_RESULTS_ON_PAGE" - No results are present on a particular list 1156 // page. 1157 // "UNREACHABLE" - A given scope cannot be reached. 1158 // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is 1159 // not assigned to an instance on the network. 1160 // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL 1161 // refers to an instance that does not exist. 1162 // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance 1163 // URL refers to an instance that is not on the same network as the 1164 // route. 1165 // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot 1166 // ip forward. 1167 // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not 1168 // have a status of RUNNING. 1169 // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an 1170 // injected kernel, which is deprecated. 1171 // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource 1172 // that requires a TOS they have not accepted. 1173 // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk 1174 // that is larger than image size. 1175 // "RESOURCE_NOT_DELETED" - One or more of the resources set to 1176 // auto-delete could not be deleted because they were in use. 1177 // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in 1178 // instance group manager is valid as such, but its application does not 1179 // make a lot of sense, because it allows only single instance in 1180 // instance group. 1181 // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to 1182 // continue the process despite the mentioned error. 1183 // "CLEANUP_FAILED" - Warning about failed cleanup of transient 1184 // changes made by a failed operation. 1185 // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been 1186 // overridden. Deprecated unused field. 1187 // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a 1188 // resource is in use. 1189 // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type 1190 // "EXTERNAL_API_WARNING" - Warning that is present in an external api 1191 // call 1192 // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is 1193 // ignored. 1194 // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema 1195 // are present 1196 // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the 1197 // resources has a type marked as experimental 1198 // "DEPRECATED_TYPE_USED" - When deploying and at least one of the 1199 // resources has a type marked as deprecated 1200 // "PARTIAL_SUCCESS" - Success is reported, but some results may be 1201 // missing due to errors 1202 // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a 1203 // exceedingly large number of resources 1204 Code string `json:"code,omitempty"` 1205 1206 // Data: [Output Only] Metadata about this warning in key: value format. 1207 // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" 1208 // } 1209 Data []*OperationWarningsData `json:"data,omitempty"` 1210 1211 // Message: [Output Only] A human-readable description of the warning 1212 // code. 1213 Message string `json:"message,omitempty"` 1214 1215 // ForceSendFields is a list of field names (e.g. "Code") to 1216 // unconditionally include in API requests. By default, fields with 1217 // empty values are omitted from API requests. However, any non-pointer, 1218 // non-interface field appearing in ForceSendFields will be sent to the 1219 // server regardless of whether the field is empty or not. This may be 1220 // used to include empty fields in Patch requests. 1221 ForceSendFields []string `json:"-"` 1222 1223 // NullFields is a list of field names (e.g. "Code") to include in API 1224 // requests with the JSON null value. By default, fields with empty 1225 // values are omitted from API requests. However, any field with an 1226 // empty value appearing in NullFields will be sent to the server as 1227 // null. It is an error if a field in this list has a non-empty value. 1228 // This may be used to include null fields in Patch requests. 1229 NullFields []string `json:"-"` 1230} 1231 1232func (s *OperationWarnings) MarshalJSON() ([]byte, error) { 1233 type NoMethod OperationWarnings 1234 raw := NoMethod(*s) 1235 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1236} 1237 1238type OperationWarningsData struct { 1239 // Key: [Output Only] A key that provides more detail on the warning 1240 // being returned. For example, for warnings where there are no results 1241 // in a list request for a particular zone, this key might be scope and 1242 // the key value might be the zone name. Other examples might be a key 1243 // indicating a deprecated resource and a suggested replacement, or a 1244 // warning about invalid network settings (for example, if an instance 1245 // attempts to perform IP forwarding but is not enabled for IP 1246 // forwarding). 1247 Key string `json:"key,omitempty"` 1248 1249 // Value: [Output Only] A warning data value corresponding to the key. 1250 Value string `json:"value,omitempty"` 1251 1252 // ForceSendFields is a list of field names (e.g. "Key") to 1253 // unconditionally include in API requests. By default, fields with 1254 // empty values are omitted from API requests. However, any non-pointer, 1255 // non-interface field appearing in ForceSendFields will be sent to the 1256 // server regardless of whether the field is empty or not. This may be 1257 // used to include empty fields in Patch requests. 1258 ForceSendFields []string `json:"-"` 1259 1260 // NullFields is a list of field names (e.g. "Key") to include in API 1261 // requests with the JSON null value. By default, fields with empty 1262 // values are omitted from API requests. However, any field with an 1263 // empty value appearing in NullFields will be sent to the server as 1264 // null. It is an error if a field in this list has a non-empty value. 1265 // This may be used to include null fields in Patch requests. 1266 NullFields []string `json:"-"` 1267} 1268 1269func (s *OperationWarningsData) MarshalJSON() ([]byte, error) { 1270 type NoMethod OperationWarningsData 1271 raw := NoMethod(*s) 1272 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1273} 1274 1275// OperationsListResponse: A response containing a partial list of 1276// operations and a page token used to build the next request if the 1277// request has been truncated. 1278type OperationsListResponse struct { 1279 // NextPageToken: Output only. A token used to continue a truncated list 1280 // request. 1281 NextPageToken string `json:"nextPageToken,omitempty"` 1282 1283 // Operations: Output only. Operations contained in this list response. 1284 Operations []*Operation `json:"operations,omitempty"` 1285 1286 // ServerResponse contains the HTTP response code and headers from the 1287 // server. 1288 googleapi.ServerResponse `json:"-"` 1289 1290 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1291 // unconditionally include in API requests. By default, fields with 1292 // empty values are omitted from API requests. However, any non-pointer, 1293 // non-interface field appearing in ForceSendFields will be sent to the 1294 // server regardless of whether the field is empty or not. This may be 1295 // used to include empty fields in Patch requests. 1296 ForceSendFields []string `json:"-"` 1297 1298 // NullFields is a list of field names (e.g. "NextPageToken") to include 1299 // in API requests with the JSON null value. By default, fields with 1300 // empty values are omitted from API requests. However, any field with 1301 // an empty value appearing in NullFields will be sent to the server as 1302 // null. It is an error if a field in this list has a non-empty value. 1303 // This may be used to include null fields in Patch requests. 1304 NullFields []string `json:"-"` 1305} 1306 1307func (s *OperationsListResponse) MarshalJSON() ([]byte, error) { 1308 type NoMethod OperationsListResponse 1309 raw := NoMethod(*s) 1310 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1311} 1312 1313// Policy: An Identity and Access Management (IAM) policy, which 1314// specifies access controls for Google Cloud resources. A `Policy` is a 1315// collection of `bindings`. A `binding` binds one or more `members` to 1316// a single `role`. Members can be user accounts, service accounts, 1317// Google groups, and domains (such as G Suite). A `role` is a named 1318// list of permissions; each `role` can be an IAM predefined role or a 1319// user-created custom role. For some types of Google Cloud resources, a 1320// `binding` can also specify a `condition`, which is a logical 1321// expression that allows access to a resource only if the expression 1322// evaluates to `true`. A condition can add constraints based on 1323// attributes of the request, the resource, or both. To learn which 1324// resources support conditions in their IAM policies, see the IAM 1325// documentation 1326// (https://cloud.google.com/iam/help/conditions/resource-policies). 1327// **JSON example:** { "bindings": [ { "role": 1328// "roles/resourcemanager.organizationAdmin", "members": [ 1329// "user:mike@example.com", "group:admins@example.com", 1330// "domain:google.com", 1331// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { 1332// "role": "roles/resourcemanager.organizationViewer", "members": [ 1333// "user:eve@example.com" ], "condition": { "title": "expirable access", 1334// "description": "Does not grant access after Sep 2020", "expression": 1335// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], 1336// "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - 1337// members: - user:mike@example.com - group:admins@example.com - 1338// domain:google.com - 1339// serviceAccount:my-project-id@appspot.gserviceaccount.com role: 1340// roles/resourcemanager.organizationAdmin - members: - 1341// user:eve@example.com role: roles/resourcemanager.organizationViewer 1342// condition: title: expirable access description: Does not grant access 1343// after Sep 2020 expression: request.time < 1344// timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 1345// 3 For a description of IAM and its features, see the IAM 1346// documentation (https://cloud.google.com/iam/docs/). 1347type Policy struct { 1348 // AuditConfigs: Specifies cloud audit logging configuration for this 1349 // policy. 1350 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"` 1351 1352 // Bindings: Associates a list of `members` to a `role`. Optionally, may 1353 // specify a `condition` that determines how and when the `bindings` are 1354 // applied. Each of the `bindings` must contain at least one member. 1355 Bindings []*Binding `json:"bindings,omitempty"` 1356 1357 // Etag: `etag` is used for optimistic concurrency control as a way to 1358 // help prevent simultaneous updates of a policy from overwriting each 1359 // other. It is strongly suggested that systems make use of the `etag` 1360 // in the read-modify-write cycle to perform policy updates in order to 1361 // avoid race conditions: An `etag` is returned in the response to 1362 // `getIamPolicy`, and systems are expected to put that etag in the 1363 // request to `setIamPolicy` to ensure that their change will be applied 1364 // to the same version of the policy. **Important:** If you use IAM 1365 // Conditions, you must include the `etag` field whenever you call 1366 // `setIamPolicy`. If you omit this field, then IAM allows you to 1367 // overwrite a version `3` policy with a version `1` policy, and all of 1368 // the conditions in the version `3` policy are lost. 1369 Etag string `json:"etag,omitempty"` 1370 1371 // Version: Specifies the format of the policy. Valid values are `0`, 1372 // `1`, and `3`. Requests that specify an invalid value are rejected. 1373 // Any operation that affects conditional role bindings must specify 1374 // version `3`. This requirement applies to the following operations: * 1375 // Getting a policy that includes a conditional role binding * Adding a 1376 // conditional role binding to a policy * Changing a conditional role 1377 // binding in a policy * Removing any role binding, with or without a 1378 // condition, from a policy that includes conditions **Important:** If 1379 // you use IAM Conditions, you must include the `etag` field whenever 1380 // you call `setIamPolicy`. If you omit this field, then IAM allows you 1381 // to overwrite a version `3` policy with a version `1` policy, and all 1382 // of the conditions in the version `3` policy are lost. If a policy 1383 // does not include any conditions, operations on that policy may 1384 // specify any valid version or leave the field unset. To learn which 1385 // resources support conditions in their IAM policies, see the IAM 1386 // documentation 1387 // (https://cloud.google.com/iam/help/conditions/resource-policies). 1388 Version int64 `json:"version,omitempty"` 1389 1390 // ServerResponse contains the HTTP response code and headers from the 1391 // server. 1392 googleapi.ServerResponse `json:"-"` 1393 1394 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to 1395 // unconditionally include in API requests. By default, fields with 1396 // empty values are omitted from API requests. However, any non-pointer, 1397 // non-interface field appearing in ForceSendFields will be sent to the 1398 // server regardless of whether the field is empty or not. This may be 1399 // used to include empty fields in Patch requests. 1400 ForceSendFields []string `json:"-"` 1401 1402 // NullFields is a list of field names (e.g. "AuditConfigs") to include 1403 // in API requests with the JSON null value. By default, fields with 1404 // empty values are omitted from API requests. However, any field with 1405 // an empty value appearing in NullFields will be sent to the server as 1406 // null. It is an error if a field in this list has a non-empty value. 1407 // This may be used to include null fields in Patch requests. 1408 NullFields []string `json:"-"` 1409} 1410 1411func (s *Policy) MarshalJSON() ([]byte, error) { 1412 type NoMethod Policy 1413 raw := NoMethod(*s) 1414 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1415} 1416 1417type Resource struct { 1418 // AccessControl: The Access Control Policy set on this resource. 1419 AccessControl *ResourceAccessControl `json:"accessControl,omitempty"` 1420 1421 // FinalProperties: Output only. The evaluated properties of the 1422 // resource with references expanded. Returned as serialized YAML. 1423 FinalProperties string `json:"finalProperties,omitempty"` 1424 1425 Id uint64 `json:"id,omitempty,string"` 1426 1427 // InsertTime: Output only. Creation timestamp in RFC3339 text format. 1428 InsertTime string `json:"insertTime,omitempty"` 1429 1430 // Manifest: Output only. URL of the manifest representing the current 1431 // configuration of this resource. 1432 Manifest string `json:"manifest,omitempty"` 1433 1434 // Name: Output only. The name of the resource as it appears in the YAML 1435 // config. 1436 Name string `json:"name,omitempty"` 1437 1438 // Properties: Output only. The current properties of the resource 1439 // before any references have been filled in. Returned as serialized 1440 // YAML. 1441 Properties string `json:"properties,omitempty"` 1442 1443 // Type: Output only. The type of the resource, for example 1444 // `compute.v1.instance`, or `cloudfunctions.v1beta1.function`. 1445 Type string `json:"type,omitempty"` 1446 1447 // Update: Output only. If Deployment Manager is currently updating or 1448 // previewing an update to this resource, the updated configuration 1449 // appears here. 1450 Update *ResourceUpdate `json:"update,omitempty"` 1451 1452 // UpdateTime: Output only. Update timestamp in RFC3339 text format. 1453 UpdateTime string `json:"updateTime,omitempty"` 1454 1455 // Url: Output only. The URL of the actual resource. 1456 Url string `json:"url,omitempty"` 1457 1458 // Warnings: Output only. If warning messages are generated during 1459 // processing of this resource, this field will be populated. 1460 Warnings []*ResourceWarnings `json:"warnings,omitempty"` 1461 1462 // ServerResponse contains the HTTP response code and headers from the 1463 // server. 1464 googleapi.ServerResponse `json:"-"` 1465 1466 // ForceSendFields is a list of field names (e.g. "AccessControl") to 1467 // unconditionally include in API requests. By default, fields with 1468 // empty values are omitted from API requests. However, any non-pointer, 1469 // non-interface field appearing in ForceSendFields will be sent to the 1470 // server regardless of whether the field is empty or not. This may be 1471 // used to include empty fields in Patch requests. 1472 ForceSendFields []string `json:"-"` 1473 1474 // NullFields is a list of field names (e.g. "AccessControl") to include 1475 // in API requests with the JSON null value. By default, fields with 1476 // empty values are omitted from API requests. However, any field with 1477 // an empty value appearing in NullFields will be sent to the server as 1478 // null. It is an error if a field in this list has a non-empty value. 1479 // This may be used to include null fields in Patch requests. 1480 NullFields []string `json:"-"` 1481} 1482 1483func (s *Resource) MarshalJSON() ([]byte, error) { 1484 type NoMethod Resource 1485 raw := NoMethod(*s) 1486 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1487} 1488 1489type ResourceWarnings struct { 1490 // Code: [Output Only] A warning code, if applicable. For example, 1491 // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in 1492 // the response. 1493 // 1494 // Possible values: 1495 // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was 1496 // created. 1497 // "NO_RESULTS_ON_PAGE" - No results are present on a particular list 1498 // page. 1499 // "UNREACHABLE" - A given scope cannot be reached. 1500 // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is 1501 // not assigned to an instance on the network. 1502 // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL 1503 // refers to an instance that does not exist. 1504 // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance 1505 // URL refers to an instance that is not on the same network as the 1506 // route. 1507 // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot 1508 // ip forward. 1509 // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not 1510 // have a status of RUNNING. 1511 // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an 1512 // injected kernel, which is deprecated. 1513 // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource 1514 // that requires a TOS they have not accepted. 1515 // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk 1516 // that is larger than image size. 1517 // "RESOURCE_NOT_DELETED" - One or more of the resources set to 1518 // auto-delete could not be deleted because they were in use. 1519 // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in 1520 // instance group manager is valid as such, but its application does not 1521 // make a lot of sense, because it allows only single instance in 1522 // instance group. 1523 // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to 1524 // continue the process despite the mentioned error. 1525 // "CLEANUP_FAILED" - Warning about failed cleanup of transient 1526 // changes made by a failed operation. 1527 // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been 1528 // overridden. Deprecated unused field. 1529 // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a 1530 // resource is in use. 1531 // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type 1532 // "EXTERNAL_API_WARNING" - Warning that is present in an external api 1533 // call 1534 // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is 1535 // ignored. 1536 // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema 1537 // are present 1538 // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the 1539 // resources has a type marked as experimental 1540 // "DEPRECATED_TYPE_USED" - When deploying and at least one of the 1541 // resources has a type marked as deprecated 1542 // "PARTIAL_SUCCESS" - Success is reported, but some results may be 1543 // missing due to errors 1544 // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a 1545 // exceedingly large number of resources 1546 Code string `json:"code,omitempty"` 1547 1548 // Data: [Output Only] Metadata about this warning in key: value format. 1549 // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" 1550 // } 1551 Data []*ResourceWarningsData `json:"data,omitempty"` 1552 1553 // Message: [Output Only] A human-readable description of the warning 1554 // code. 1555 Message string `json:"message,omitempty"` 1556 1557 // ForceSendFields is a list of field names (e.g. "Code") to 1558 // unconditionally include in API requests. By default, fields with 1559 // empty values are omitted from API requests. However, any non-pointer, 1560 // non-interface field appearing in ForceSendFields will be sent to the 1561 // server regardless of whether the field is empty or not. This may be 1562 // used to include empty fields in Patch requests. 1563 ForceSendFields []string `json:"-"` 1564 1565 // NullFields is a list of field names (e.g. "Code") to include in API 1566 // requests with the JSON null value. By default, fields with empty 1567 // values are omitted from API requests. However, any field with an 1568 // empty value appearing in NullFields will be sent to the server as 1569 // null. It is an error if a field in this list has a non-empty value. 1570 // This may be used to include null fields in Patch requests. 1571 NullFields []string `json:"-"` 1572} 1573 1574func (s *ResourceWarnings) MarshalJSON() ([]byte, error) { 1575 type NoMethod ResourceWarnings 1576 raw := NoMethod(*s) 1577 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1578} 1579 1580type ResourceWarningsData struct { 1581 // Key: [Output Only] A key that provides more detail on the warning 1582 // being returned. For example, for warnings where there are no results 1583 // in a list request for a particular zone, this key might be scope and 1584 // the key value might be the zone name. Other examples might be a key 1585 // indicating a deprecated resource and a suggested replacement, or a 1586 // warning about invalid network settings (for example, if an instance 1587 // attempts to perform IP forwarding but is not enabled for IP 1588 // forwarding). 1589 Key string `json:"key,omitempty"` 1590 1591 // Value: [Output Only] A warning data value corresponding to the key. 1592 Value string `json:"value,omitempty"` 1593 1594 // ForceSendFields is a list of field names (e.g. "Key") to 1595 // unconditionally include in API requests. By default, fields with 1596 // empty values are omitted from API requests. However, any non-pointer, 1597 // non-interface field appearing in ForceSendFields will be sent to the 1598 // server regardless of whether the field is empty or not. This may be 1599 // used to include empty fields in Patch requests. 1600 ForceSendFields []string `json:"-"` 1601 1602 // NullFields is a list of field names (e.g. "Key") to include in API 1603 // requests with the JSON null value. By default, fields with empty 1604 // values are omitted from API requests. However, any field with an 1605 // empty value appearing in NullFields will be sent to the server as 1606 // null. It is an error if a field in this list has a non-empty value. 1607 // This may be used to include null fields in Patch requests. 1608 NullFields []string `json:"-"` 1609} 1610 1611func (s *ResourceWarningsData) MarshalJSON() ([]byte, error) { 1612 type NoMethod ResourceWarningsData 1613 raw := NoMethod(*s) 1614 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1615} 1616 1617// ResourceAccessControl: The access controls set on the resource. 1618type ResourceAccessControl struct { 1619 // GcpIamPolicy: The GCP IAM Policy to set on the resource. 1620 GcpIamPolicy string `json:"gcpIamPolicy,omitempty"` 1621 1622 // ForceSendFields is a list of field names (e.g. "GcpIamPolicy") to 1623 // unconditionally include in API requests. By default, fields with 1624 // empty values are omitted from API requests. However, any non-pointer, 1625 // non-interface field appearing in ForceSendFields will be sent to the 1626 // server regardless of whether the field is empty or not. This may be 1627 // used to include empty fields in Patch requests. 1628 ForceSendFields []string `json:"-"` 1629 1630 // NullFields is a list of field names (e.g. "GcpIamPolicy") to include 1631 // in API requests with the JSON null value. By default, fields with 1632 // empty values are omitted from API requests. However, any field with 1633 // an empty value appearing in NullFields will be sent to the server as 1634 // null. It is an error if a field in this list has a non-empty value. 1635 // This may be used to include null fields in Patch requests. 1636 NullFields []string `json:"-"` 1637} 1638 1639func (s *ResourceAccessControl) MarshalJSON() ([]byte, error) { 1640 type NoMethod ResourceAccessControl 1641 raw := NoMethod(*s) 1642 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1643} 1644 1645type ResourceUpdate struct { 1646 // AccessControl: The Access Control Policy to set on this resource 1647 // after updating the resource itself. 1648 AccessControl *ResourceAccessControl `json:"accessControl,omitempty"` 1649 1650 // Error: Output only. If errors are generated during update of the 1651 // resource, this field will be populated. 1652 Error *ResourceUpdateError `json:"error,omitempty"` 1653 1654 // FinalProperties: Output only. The expanded properties of the resource 1655 // with reference values expanded. Returned as serialized YAML. 1656 FinalProperties string `json:"finalProperties,omitempty"` 1657 1658 // Intent: Output only. The intent of the resource: `PREVIEW`, `UPDATE`, 1659 // or `CANCEL`. 1660 // 1661 // Possible values: 1662 // "CREATE_OR_ACQUIRE" - The resource is scheduled to be created, or 1663 // if it already exists, acquired. 1664 // "DELETE" - The resource is scheduled to be deleted. 1665 // "ACQUIRE" - The resource is scheduled to be acquired. 1666 // "UPDATE" - The resource is scheduled to be updated via the UPDATE 1667 // method. 1668 // "ABANDON" - The resource is scheduled to be abandoned. 1669 // "CREATE" - The resource is scheduled to be created. 1670 Intent string `json:"intent,omitempty"` 1671 1672 // Manifest: Output only. URL of the manifest representing the update 1673 // configuration of this resource. 1674 Manifest string `json:"manifest,omitempty"` 1675 1676 // Properties: Output only. The set of updated properties for this 1677 // resource, before references are expanded. Returned as serialized 1678 // YAML. 1679 Properties string `json:"properties,omitempty"` 1680 1681 // State: Output only. The state of the resource. 1682 // 1683 // Possible values: 1684 // "PENDING" - There are changes pending for this resource. 1685 // "IN_PROGRESS" - The service is executing changes on the resource. 1686 // "IN_PREVIEW" - The service is previewing changes on the resource. 1687 // "FAILED" - The service has failed to change the resource. 1688 // "ABORTED" - The service has aborted trying to change the resource. 1689 State string `json:"state,omitempty"` 1690 1691 // Warnings: Output only. If warning messages are generated during 1692 // processing of this resource, this field will be populated. 1693 Warnings []*ResourceUpdateWarnings `json:"warnings,omitempty"` 1694 1695 // ForceSendFields is a list of field names (e.g. "AccessControl") to 1696 // unconditionally include in API requests. By default, fields with 1697 // empty values are omitted from API requests. However, any non-pointer, 1698 // non-interface field appearing in ForceSendFields will be sent to the 1699 // server regardless of whether the field is empty or not. This may be 1700 // used to include empty fields in Patch requests. 1701 ForceSendFields []string `json:"-"` 1702 1703 // NullFields is a list of field names (e.g. "AccessControl") to include 1704 // in API requests with the JSON null value. By default, fields with 1705 // empty values are omitted from API requests. However, any field with 1706 // an empty value appearing in NullFields will be sent to the server as 1707 // null. It is an error if a field in this list has a non-empty value. 1708 // This may be used to include null fields in Patch requests. 1709 NullFields []string `json:"-"` 1710} 1711 1712func (s *ResourceUpdate) MarshalJSON() ([]byte, error) { 1713 type NoMethod ResourceUpdate 1714 raw := NoMethod(*s) 1715 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1716} 1717 1718// ResourceUpdateError: Output only. If errors are generated during 1719// update of the resource, this field will be populated. 1720type ResourceUpdateError struct { 1721 // Errors: [Output Only] The array of errors encountered while 1722 // processing this operation. 1723 Errors []*ResourceUpdateErrorErrors `json:"errors,omitempty"` 1724 1725 // ForceSendFields is a list of field names (e.g. "Errors") to 1726 // unconditionally include in API requests. By default, fields with 1727 // empty values are omitted from API requests. However, any non-pointer, 1728 // non-interface field appearing in ForceSendFields will be sent to the 1729 // server regardless of whether the field is empty or not. This may be 1730 // used to include empty fields in Patch requests. 1731 ForceSendFields []string `json:"-"` 1732 1733 // NullFields is a list of field names (e.g. "Errors") to include in API 1734 // requests with the JSON null value. By default, fields with empty 1735 // values are omitted from API requests. However, any field with an 1736 // empty value appearing in NullFields will be sent to the server as 1737 // null. It is an error if a field in this list has a non-empty value. 1738 // This may be used to include null fields in Patch requests. 1739 NullFields []string `json:"-"` 1740} 1741 1742func (s *ResourceUpdateError) MarshalJSON() ([]byte, error) { 1743 type NoMethod ResourceUpdateError 1744 raw := NoMethod(*s) 1745 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1746} 1747 1748type ResourceUpdateErrorErrors struct { 1749 // Code: [Output Only] The error type identifier for this error. 1750 Code string `json:"code,omitempty"` 1751 1752 // Location: [Output Only] Indicates the field in the request that 1753 // caused the error. This property is optional. 1754 Location string `json:"location,omitempty"` 1755 1756 // Message: [Output Only] An optional, human-readable error message. 1757 Message string `json:"message,omitempty"` 1758 1759 // ForceSendFields is a list of field names (e.g. "Code") to 1760 // unconditionally include in API requests. By default, fields with 1761 // empty values are omitted from API requests. However, any non-pointer, 1762 // non-interface field appearing in ForceSendFields will be sent to the 1763 // server regardless of whether the field is empty or not. This may be 1764 // used to include empty fields in Patch requests. 1765 ForceSendFields []string `json:"-"` 1766 1767 // NullFields is a list of field names (e.g. "Code") to include in API 1768 // requests with the JSON null value. By default, fields with empty 1769 // values are omitted from API requests. However, any field with an 1770 // empty value appearing in NullFields will be sent to the server as 1771 // null. It is an error if a field in this list has a non-empty value. 1772 // This may be used to include null fields in Patch requests. 1773 NullFields []string `json:"-"` 1774} 1775 1776func (s *ResourceUpdateErrorErrors) MarshalJSON() ([]byte, error) { 1777 type NoMethod ResourceUpdateErrorErrors 1778 raw := NoMethod(*s) 1779 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1780} 1781 1782type ResourceUpdateWarnings struct { 1783 // Code: [Output Only] A warning code, if applicable. For example, 1784 // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in 1785 // the response. 1786 // 1787 // Possible values: 1788 // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was 1789 // created. 1790 // "NO_RESULTS_ON_PAGE" - No results are present on a particular list 1791 // page. 1792 // "UNREACHABLE" - A given scope cannot be reached. 1793 // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is 1794 // not assigned to an instance on the network. 1795 // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL 1796 // refers to an instance that does not exist. 1797 // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance 1798 // URL refers to an instance that is not on the same network as the 1799 // route. 1800 // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot 1801 // ip forward. 1802 // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not 1803 // have a status of RUNNING. 1804 // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an 1805 // injected kernel, which is deprecated. 1806 // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource 1807 // that requires a TOS they have not accepted. 1808 // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk 1809 // that is larger than image size. 1810 // "RESOURCE_NOT_DELETED" - One or more of the resources set to 1811 // auto-delete could not be deleted because they were in use. 1812 // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in 1813 // instance group manager is valid as such, but its application does not 1814 // make a lot of sense, because it allows only single instance in 1815 // instance group. 1816 // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to 1817 // continue the process despite the mentioned error. 1818 // "CLEANUP_FAILED" - Warning about failed cleanup of transient 1819 // changes made by a failed operation. 1820 // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been 1821 // overridden. Deprecated unused field. 1822 // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a 1823 // resource is in use. 1824 // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type 1825 // "EXTERNAL_API_WARNING" - Warning that is present in an external api 1826 // call 1827 // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is 1828 // ignored. 1829 // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema 1830 // are present 1831 // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the 1832 // resources has a type marked as experimental 1833 // "DEPRECATED_TYPE_USED" - When deploying and at least one of the 1834 // resources has a type marked as deprecated 1835 // "PARTIAL_SUCCESS" - Success is reported, but some results may be 1836 // missing due to errors 1837 // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a 1838 // exceedingly large number of resources 1839 Code string `json:"code,omitempty"` 1840 1841 // Data: [Output Only] Metadata about this warning in key: value format. 1842 // For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" 1843 // } 1844 Data []*ResourceUpdateWarningsData `json:"data,omitempty"` 1845 1846 // Message: [Output Only] A human-readable description of the warning 1847 // code. 1848 Message string `json:"message,omitempty"` 1849 1850 // ForceSendFields is a list of field names (e.g. "Code") to 1851 // unconditionally include in API requests. By default, fields with 1852 // empty values are omitted from API requests. However, any non-pointer, 1853 // non-interface field appearing in ForceSendFields will be sent to the 1854 // server regardless of whether the field is empty or not. This may be 1855 // used to include empty fields in Patch requests. 1856 ForceSendFields []string `json:"-"` 1857 1858 // NullFields is a list of field names (e.g. "Code") to include in API 1859 // requests with the JSON null value. By default, fields with empty 1860 // values are omitted from API requests. However, any field with an 1861 // empty value appearing in NullFields will be sent to the server as 1862 // null. It is an error if a field in this list has a non-empty value. 1863 // This may be used to include null fields in Patch requests. 1864 NullFields []string `json:"-"` 1865} 1866 1867func (s *ResourceUpdateWarnings) MarshalJSON() ([]byte, error) { 1868 type NoMethod ResourceUpdateWarnings 1869 raw := NoMethod(*s) 1870 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1871} 1872 1873type ResourceUpdateWarningsData struct { 1874 // Key: [Output Only] A key that provides more detail on the warning 1875 // being returned. For example, for warnings where there are no results 1876 // in a list request for a particular zone, this key might be scope and 1877 // the key value might be the zone name. Other examples might be a key 1878 // indicating a deprecated resource and a suggested replacement, or a 1879 // warning about invalid network settings (for example, if an instance 1880 // attempts to perform IP forwarding but is not enabled for IP 1881 // forwarding). 1882 Key string `json:"key,omitempty"` 1883 1884 // Value: [Output Only] A warning data value corresponding to the key. 1885 Value string `json:"value,omitempty"` 1886 1887 // ForceSendFields is a list of field names (e.g. "Key") to 1888 // unconditionally include in API requests. By default, fields with 1889 // empty values are omitted from API requests. However, any non-pointer, 1890 // non-interface field appearing in ForceSendFields will be sent to the 1891 // server regardless of whether the field is empty or not. This may be 1892 // used to include empty fields in Patch requests. 1893 ForceSendFields []string `json:"-"` 1894 1895 // NullFields is a list of field names (e.g. "Key") to include in API 1896 // requests with the JSON null value. By default, fields with empty 1897 // values are omitted from API requests. However, any field with an 1898 // empty value appearing in NullFields will be sent to the server as 1899 // null. It is an error if a field in this list has a non-empty value. 1900 // This may be used to include null fields in Patch requests. 1901 NullFields []string `json:"-"` 1902} 1903 1904func (s *ResourceUpdateWarningsData) MarshalJSON() ([]byte, error) { 1905 type NoMethod ResourceUpdateWarningsData 1906 raw := NoMethod(*s) 1907 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1908} 1909 1910// ResourcesListResponse: A response containing a partial list of 1911// resources and a page token used to build the next request if the 1912// request has been truncated. 1913type ResourcesListResponse struct { 1914 // NextPageToken: A token used to continue a truncated list request. 1915 NextPageToken string `json:"nextPageToken,omitempty"` 1916 1917 // Resources: Resources contained in this list response. 1918 Resources []*Resource `json:"resources,omitempty"` 1919 1920 // ServerResponse contains the HTTP response code and headers from the 1921 // server. 1922 googleapi.ServerResponse `json:"-"` 1923 1924 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1925 // unconditionally include in API requests. By default, fields with 1926 // empty values are omitted from API requests. However, any non-pointer, 1927 // non-interface field appearing in ForceSendFields will be sent to the 1928 // server regardless of whether the field is empty or not. This may be 1929 // used to include empty fields in Patch requests. 1930 ForceSendFields []string `json:"-"` 1931 1932 // NullFields is a list of field names (e.g. "NextPageToken") to include 1933 // in API requests with the JSON null value. By default, fields with 1934 // empty values are omitted from API requests. However, any field with 1935 // an empty value appearing in NullFields will be sent to the server as 1936 // null. It is an error if a field in this list has a non-empty value. 1937 // This may be used to include null fields in Patch requests. 1938 NullFields []string `json:"-"` 1939} 1940 1941func (s *ResourcesListResponse) MarshalJSON() ([]byte, error) { 1942 type NoMethod ResourcesListResponse 1943 raw := NoMethod(*s) 1944 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1945} 1946 1947type TargetConfiguration struct { 1948 // Config: The configuration to use for this deployment. 1949 Config *ConfigFile `json:"config,omitempty"` 1950 1951 // Imports: Specifies any files to import for this configuration. This 1952 // can be used to import templates or other files. For example, you 1953 // might import a text file in order to use the file in a template. 1954 Imports []*ImportFile `json:"imports,omitempty"` 1955 1956 // ForceSendFields is a list of field names (e.g. "Config") to 1957 // unconditionally include in API requests. By default, fields with 1958 // empty values are omitted from API requests. However, any non-pointer, 1959 // non-interface field appearing in ForceSendFields will be sent to the 1960 // server regardless of whether the field is empty or not. This may be 1961 // used to include empty fields in Patch requests. 1962 ForceSendFields []string `json:"-"` 1963 1964 // NullFields is a list of field names (e.g. "Config") to include in API 1965 // requests with the JSON null value. By default, fields with empty 1966 // values are omitted from API requests. However, any field with an 1967 // empty value appearing in NullFields will be sent to the server as 1968 // null. It is an error if a field in this list has a non-empty value. 1969 // This may be used to include null fields in Patch requests. 1970 NullFields []string `json:"-"` 1971} 1972 1973func (s *TargetConfiguration) MarshalJSON() ([]byte, error) { 1974 type NoMethod TargetConfiguration 1975 raw := NoMethod(*s) 1976 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1977} 1978 1979type TestPermissionsRequest struct { 1980 // Permissions: The set of permissions to check for the 'resource'. 1981 // Permissions with wildcards (such as '*' or 'storage.*') are not 1982 // allowed. 1983 Permissions []string `json:"permissions,omitempty"` 1984 1985 // ForceSendFields is a list of field names (e.g. "Permissions") to 1986 // unconditionally include in API requests. By default, fields with 1987 // empty values are omitted from API requests. However, any non-pointer, 1988 // non-interface field appearing in ForceSendFields will be sent to the 1989 // server regardless of whether the field is empty or not. This may be 1990 // used to include empty fields in Patch requests. 1991 ForceSendFields []string `json:"-"` 1992 1993 // NullFields is a list of field names (e.g. "Permissions") to include 1994 // in API requests with the JSON null value. By default, fields with 1995 // empty values are omitted from API requests. However, any field with 1996 // an empty value appearing in NullFields will be sent to the server as 1997 // null. It is an error if a field in this list has a non-empty value. 1998 // This may be used to include null fields in Patch requests. 1999 NullFields []string `json:"-"` 2000} 2001 2002func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) { 2003 type NoMethod TestPermissionsRequest 2004 raw := NoMethod(*s) 2005 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2006} 2007 2008type TestPermissionsResponse struct { 2009 // Permissions: A subset of `TestPermissionsRequest.permissions` that 2010 // the caller is allowed. 2011 Permissions []string `json:"permissions,omitempty"` 2012 2013 // ServerResponse contains the HTTP response code and headers from the 2014 // server. 2015 googleapi.ServerResponse `json:"-"` 2016 2017 // ForceSendFields is a list of field names (e.g. "Permissions") to 2018 // unconditionally include in API requests. By default, fields with 2019 // empty values are omitted from API requests. However, any non-pointer, 2020 // non-interface field appearing in ForceSendFields will be sent to the 2021 // server regardless of whether the field is empty or not. This may be 2022 // used to include empty fields in Patch requests. 2023 ForceSendFields []string `json:"-"` 2024 2025 // NullFields is a list of field names (e.g. "Permissions") to include 2026 // in API requests with the JSON null value. By default, fields with 2027 // empty values are omitted from API requests. However, any field with 2028 // an empty value appearing in NullFields will be sent to the server as 2029 // null. It is an error if a field in this list has a non-empty value. 2030 // This may be used to include null fields in Patch requests. 2031 NullFields []string `json:"-"` 2032} 2033 2034func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) { 2035 type NoMethod TestPermissionsResponse 2036 raw := NoMethod(*s) 2037 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2038} 2039 2040// Type: A resource type supported by Deployment Manager. 2041type Type struct { 2042 Id uint64 `json:"id,omitempty,string"` 2043 2044 // InsertTime: Output only. Creation timestamp in RFC3339 text format. 2045 InsertTime string `json:"insertTime,omitempty"` 2046 2047 // Name: Name of the type. 2048 Name string `json:"name,omitempty"` 2049 2050 // Operation: Output only. The Operation that most recently ran, or is 2051 // currently running, on this type. 2052 Operation *Operation `json:"operation,omitempty"` 2053 2054 // SelfLink: Output only. Server defined URL for the resource. 2055 SelfLink string `json:"selfLink,omitempty"` 2056 2057 // ForceSendFields is a list of field names (e.g. "Id") to 2058 // unconditionally include in API requests. By default, fields with 2059 // empty values are omitted from API requests. However, any non-pointer, 2060 // non-interface field appearing in ForceSendFields will be sent to the 2061 // server regardless of whether the field is empty or not. This may be 2062 // used to include empty fields in Patch requests. 2063 ForceSendFields []string `json:"-"` 2064 2065 // NullFields is a list of field names (e.g. "Id") to include in API 2066 // requests with the JSON null value. By default, fields with empty 2067 // values are omitted from API requests. However, any field with an 2068 // empty value appearing in NullFields will be sent to the server as 2069 // null. It is an error if a field in this list has a non-empty value. 2070 // This may be used to include null fields in Patch requests. 2071 NullFields []string `json:"-"` 2072} 2073 2074func (s *Type) MarshalJSON() ([]byte, error) { 2075 type NoMethod Type 2076 raw := NoMethod(*s) 2077 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2078} 2079 2080// TypesListResponse: A response that returns all Types supported by 2081// Deployment Manager 2082type TypesListResponse struct { 2083 // NextPageToken: A token used to continue a truncated list request. 2084 NextPageToken string `json:"nextPageToken,omitempty"` 2085 2086 // Types: Output only. A list of resource types supported by Deployment 2087 // Manager. 2088 Types []*Type `json:"types,omitempty"` 2089 2090 // ServerResponse contains the HTTP response code and headers from the 2091 // server. 2092 googleapi.ServerResponse `json:"-"` 2093 2094 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2095 // unconditionally include in API requests. By default, fields with 2096 // empty values are omitted from API requests. However, any non-pointer, 2097 // non-interface field appearing in ForceSendFields will be sent to the 2098 // server regardless of whether the field is empty or not. This may be 2099 // used to include empty fields in Patch requests. 2100 ForceSendFields []string `json:"-"` 2101 2102 // NullFields is a list of field names (e.g. "NextPageToken") to include 2103 // in API requests with the JSON null value. By default, fields with 2104 // empty values are omitted from API requests. However, any field with 2105 // an empty value appearing in NullFields will be sent to the server as 2106 // null. It is an error if a field in this list has a non-empty value. 2107 // This may be used to include null fields in Patch requests. 2108 NullFields []string `json:"-"` 2109} 2110 2111func (s *TypesListResponse) MarshalJSON() ([]byte, error) { 2112 type NoMethod TypesListResponse 2113 raw := NoMethod(*s) 2114 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2115} 2116 2117// method id "deploymentmanager.deployments.cancelPreview": 2118 2119type DeploymentsCancelPreviewCall struct { 2120 s *Service 2121 project string 2122 deployment string 2123 deploymentscancelpreviewrequest *DeploymentsCancelPreviewRequest 2124 urlParams_ gensupport.URLParams 2125 ctx_ context.Context 2126 header_ http.Header 2127} 2128 2129// CancelPreview: Cancels and removes the preview currently associated 2130// with the deployment. 2131// 2132// - deployment: The name of the deployment for this request. 2133// - project: The project ID for this request. 2134func (r *DeploymentsService) CancelPreview(project string, deployment string, deploymentscancelpreviewrequest *DeploymentsCancelPreviewRequest) *DeploymentsCancelPreviewCall { 2135 c := &DeploymentsCancelPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2136 c.project = project 2137 c.deployment = deployment 2138 c.deploymentscancelpreviewrequest = deploymentscancelpreviewrequest 2139 return c 2140} 2141 2142// Fields allows partial responses to be retrieved. See 2143// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2144// for more information. 2145func (c *DeploymentsCancelPreviewCall) Fields(s ...googleapi.Field) *DeploymentsCancelPreviewCall { 2146 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2147 return c 2148} 2149 2150// Context sets the context to be used in this call's Do method. Any 2151// pending HTTP request will be aborted if the provided context is 2152// canceled. 2153func (c *DeploymentsCancelPreviewCall) Context(ctx context.Context) *DeploymentsCancelPreviewCall { 2154 c.ctx_ = ctx 2155 return c 2156} 2157 2158// Header returns an http.Header that can be modified by the caller to 2159// add HTTP headers to the request. 2160func (c *DeploymentsCancelPreviewCall) Header() http.Header { 2161 if c.header_ == nil { 2162 c.header_ = make(http.Header) 2163 } 2164 return c.header_ 2165} 2166 2167func (c *DeploymentsCancelPreviewCall) doRequest(alt string) (*http.Response, error) { 2168 reqHeaders := make(http.Header) 2169 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 2170 for k, v := range c.header_ { 2171 reqHeaders[k] = v 2172 } 2173 reqHeaders.Set("User-Agent", c.s.userAgent()) 2174 var body io.Reader = nil 2175 body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentscancelpreviewrequest) 2176 if err != nil { 2177 return nil, err 2178 } 2179 reqHeaders.Set("Content-Type", "application/json") 2180 c.urlParams_.Set("alt", alt) 2181 c.urlParams_.Set("prettyPrint", "false") 2182 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/cancelPreview") 2183 urls += "?" + c.urlParams_.Encode() 2184 req, err := http.NewRequest("POST", urls, body) 2185 if err != nil { 2186 return nil, err 2187 } 2188 req.Header = reqHeaders 2189 googleapi.Expand(req.URL, map[string]string{ 2190 "project": c.project, 2191 "deployment": c.deployment, 2192 }) 2193 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2194} 2195 2196// Do executes the "deploymentmanager.deployments.cancelPreview" call. 2197// Exactly one of *Operation or error will be non-nil. Any non-2xx 2198// status code is an error. Response headers are in either 2199// *Operation.ServerResponse.Header or (if a response was returned at 2200// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2201// to check whether the returned error was because 2202// http.StatusNotModified was returned. 2203func (c *DeploymentsCancelPreviewCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2204 gensupport.SetOptions(c.urlParams_, opts...) 2205 res, err := c.doRequest("json") 2206 if res != nil && res.StatusCode == http.StatusNotModified { 2207 if res.Body != nil { 2208 res.Body.Close() 2209 } 2210 return nil, &googleapi.Error{ 2211 Code: res.StatusCode, 2212 Header: res.Header, 2213 } 2214 } 2215 if err != nil { 2216 return nil, err 2217 } 2218 defer googleapi.CloseBody(res) 2219 if err := googleapi.CheckResponse(res); err != nil { 2220 return nil, err 2221 } 2222 ret := &Operation{ 2223 ServerResponse: googleapi.ServerResponse{ 2224 Header: res.Header, 2225 HTTPStatusCode: res.StatusCode, 2226 }, 2227 } 2228 target := &ret 2229 if err := gensupport.DecodeResponse(target, res); err != nil { 2230 return nil, err 2231 } 2232 return ret, nil 2233 // { 2234 // "description": "Cancels and removes the preview currently associated with the deployment.", 2235 // "flatPath": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/cancelPreview", 2236 // "httpMethod": "POST", 2237 // "id": "deploymentmanager.deployments.cancelPreview", 2238 // "parameterOrder": [ 2239 // "project", 2240 // "deployment" 2241 // ], 2242 // "parameters": { 2243 // "deployment": { 2244 // "description": "The name of the deployment for this request.", 2245 // "location": "path", 2246 // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", 2247 // "required": true, 2248 // "type": "string" 2249 // }, 2250 // "project": { 2251 // "description": "The project ID for this request.", 2252 // "location": "path", 2253 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", 2254 // "required": true, 2255 // "type": "string" 2256 // } 2257 // }, 2258 // "path": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/cancelPreview", 2259 // "request": { 2260 // "$ref": "DeploymentsCancelPreviewRequest" 2261 // }, 2262 // "response": { 2263 // "$ref": "Operation" 2264 // }, 2265 // "scopes": [ 2266 // "https://www.googleapis.com/auth/cloud-platform", 2267 // "https://www.googleapis.com/auth/ndev.cloudman" 2268 // ] 2269 // } 2270 2271} 2272 2273// method id "deploymentmanager.deployments.delete": 2274 2275type DeploymentsDeleteCall struct { 2276 s *Service 2277 project string 2278 deployment string 2279 urlParams_ gensupport.URLParams 2280 ctx_ context.Context 2281 header_ http.Header 2282} 2283 2284// Delete: Deletes a deployment and all of the resources in the 2285// deployment. 2286// 2287// - deployment: The name of the deployment for this request. 2288// - project: The project ID for this request. 2289func (r *DeploymentsService) Delete(project string, deployment string) *DeploymentsDeleteCall { 2290 c := &DeploymentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2291 c.project = project 2292 c.deployment = deployment 2293 return c 2294} 2295 2296// DeletePolicy sets the optional parameter "deletePolicy": Sets the 2297// policy to use for deleting resources. 2298// 2299// Possible values: 2300// "DELETE" (default) 2301// "ABANDON" 2302func (c *DeploymentsDeleteCall) DeletePolicy(deletePolicy string) *DeploymentsDeleteCall { 2303 c.urlParams_.Set("deletePolicy", deletePolicy) 2304 return c 2305} 2306 2307// Fields allows partial responses to be retrieved. See 2308// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2309// for more information. 2310func (c *DeploymentsDeleteCall) Fields(s ...googleapi.Field) *DeploymentsDeleteCall { 2311 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2312 return c 2313} 2314 2315// Context sets the context to be used in this call's Do method. Any 2316// pending HTTP request will be aborted if the provided context is 2317// canceled. 2318func (c *DeploymentsDeleteCall) Context(ctx context.Context) *DeploymentsDeleteCall { 2319 c.ctx_ = ctx 2320 return c 2321} 2322 2323// Header returns an http.Header that can be modified by the caller to 2324// add HTTP headers to the request. 2325func (c *DeploymentsDeleteCall) Header() http.Header { 2326 if c.header_ == nil { 2327 c.header_ = make(http.Header) 2328 } 2329 return c.header_ 2330} 2331 2332func (c *DeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { 2333 reqHeaders := make(http.Header) 2334 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 2335 for k, v := range c.header_ { 2336 reqHeaders[k] = v 2337 } 2338 reqHeaders.Set("User-Agent", c.s.userAgent()) 2339 var body io.Reader = nil 2340 c.urlParams_.Set("alt", alt) 2341 c.urlParams_.Set("prettyPrint", "false") 2342 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}") 2343 urls += "?" + c.urlParams_.Encode() 2344 req, err := http.NewRequest("DELETE", urls, body) 2345 if err != nil { 2346 return nil, err 2347 } 2348 req.Header = reqHeaders 2349 googleapi.Expand(req.URL, map[string]string{ 2350 "project": c.project, 2351 "deployment": c.deployment, 2352 }) 2353 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2354} 2355 2356// Do executes the "deploymentmanager.deployments.delete" call. 2357// Exactly one of *Operation or error will be non-nil. Any non-2xx 2358// status code is an error. Response headers are in either 2359// *Operation.ServerResponse.Header or (if a response was returned at 2360// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2361// to check whether the returned error was because 2362// http.StatusNotModified was returned. 2363func (c *DeploymentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2364 gensupport.SetOptions(c.urlParams_, opts...) 2365 res, err := c.doRequest("json") 2366 if res != nil && res.StatusCode == http.StatusNotModified { 2367 if res.Body != nil { 2368 res.Body.Close() 2369 } 2370 return nil, &googleapi.Error{ 2371 Code: res.StatusCode, 2372 Header: res.Header, 2373 } 2374 } 2375 if err != nil { 2376 return nil, err 2377 } 2378 defer googleapi.CloseBody(res) 2379 if err := googleapi.CheckResponse(res); err != nil { 2380 return nil, err 2381 } 2382 ret := &Operation{ 2383 ServerResponse: googleapi.ServerResponse{ 2384 Header: res.Header, 2385 HTTPStatusCode: res.StatusCode, 2386 }, 2387 } 2388 target := &ret 2389 if err := gensupport.DecodeResponse(target, res); err != nil { 2390 return nil, err 2391 } 2392 return ret, nil 2393 // { 2394 // "description": "Deletes a deployment and all of the resources in the deployment.", 2395 // "flatPath": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}", 2396 // "httpMethod": "DELETE", 2397 // "id": "deploymentmanager.deployments.delete", 2398 // "parameterOrder": [ 2399 // "project", 2400 // "deployment" 2401 // ], 2402 // "parameters": { 2403 // "deletePolicy": { 2404 // "default": "DELETE", 2405 // "description": "Sets the policy to use for deleting resources.", 2406 // "enum": [ 2407 // "DELETE", 2408 // "ABANDON" 2409 // ], 2410 // "enumDescriptions": [ 2411 // "", 2412 // "" 2413 // ], 2414 // "location": "query", 2415 // "type": "string" 2416 // }, 2417 // "deployment": { 2418 // "description": "The name of the deployment for this request.", 2419 // "location": "path", 2420 // "required": true, 2421 // "type": "string" 2422 // }, 2423 // "project": { 2424 // "description": "The project ID for this request.", 2425 // "location": "path", 2426 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", 2427 // "required": true, 2428 // "type": "string" 2429 // } 2430 // }, 2431 // "path": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}", 2432 // "response": { 2433 // "$ref": "Operation" 2434 // }, 2435 // "scopes": [ 2436 // "https://www.googleapis.com/auth/cloud-platform", 2437 // "https://www.googleapis.com/auth/ndev.cloudman" 2438 // ] 2439 // } 2440 2441} 2442 2443// method id "deploymentmanager.deployments.get": 2444 2445type DeploymentsGetCall struct { 2446 s *Service 2447 project string 2448 deployment string 2449 urlParams_ gensupport.URLParams 2450 ifNoneMatch_ string 2451 ctx_ context.Context 2452 header_ http.Header 2453} 2454 2455// Get: Gets information about a specific deployment. 2456// 2457// - deployment: The name of the deployment for this request. 2458// - project: The project ID for this request. 2459func (r *DeploymentsService) Get(project string, deployment string) *DeploymentsGetCall { 2460 c := &DeploymentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2461 c.project = project 2462 c.deployment = deployment 2463 return c 2464} 2465 2466// Fields allows partial responses to be retrieved. See 2467// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2468// for more information. 2469func (c *DeploymentsGetCall) Fields(s ...googleapi.Field) *DeploymentsGetCall { 2470 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2471 return c 2472} 2473 2474// IfNoneMatch sets the optional parameter which makes the operation 2475// fail if the object's ETag matches the given value. This is useful for 2476// getting updates only after the object has changed since the last 2477// request. Use googleapi.IsNotModified to check whether the response 2478// error from Do is the result of In-None-Match. 2479func (c *DeploymentsGetCall) IfNoneMatch(entityTag string) *DeploymentsGetCall { 2480 c.ifNoneMatch_ = entityTag 2481 return c 2482} 2483 2484// Context sets the context to be used in this call's Do method. Any 2485// pending HTTP request will be aborted if the provided context is 2486// canceled. 2487func (c *DeploymentsGetCall) Context(ctx context.Context) *DeploymentsGetCall { 2488 c.ctx_ = ctx 2489 return c 2490} 2491 2492// Header returns an http.Header that can be modified by the caller to 2493// add HTTP headers to the request. 2494func (c *DeploymentsGetCall) Header() http.Header { 2495 if c.header_ == nil { 2496 c.header_ = make(http.Header) 2497 } 2498 return c.header_ 2499} 2500 2501func (c *DeploymentsGetCall) doRequest(alt string) (*http.Response, error) { 2502 reqHeaders := make(http.Header) 2503 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 2504 for k, v := range c.header_ { 2505 reqHeaders[k] = v 2506 } 2507 reqHeaders.Set("User-Agent", c.s.userAgent()) 2508 if c.ifNoneMatch_ != "" { 2509 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2510 } 2511 var body io.Reader = nil 2512 c.urlParams_.Set("alt", alt) 2513 c.urlParams_.Set("prettyPrint", "false") 2514 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}") 2515 urls += "?" + c.urlParams_.Encode() 2516 req, err := http.NewRequest("GET", urls, body) 2517 if err != nil { 2518 return nil, err 2519 } 2520 req.Header = reqHeaders 2521 googleapi.Expand(req.URL, map[string]string{ 2522 "project": c.project, 2523 "deployment": c.deployment, 2524 }) 2525 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2526} 2527 2528// Do executes the "deploymentmanager.deployments.get" call. 2529// Exactly one of *Deployment or error will be non-nil. Any non-2xx 2530// status code is an error. Response headers are in either 2531// *Deployment.ServerResponse.Header or (if a response was returned at 2532// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2533// to check whether the returned error was because 2534// http.StatusNotModified was returned. 2535func (c *DeploymentsGetCall) Do(opts ...googleapi.CallOption) (*Deployment, error) { 2536 gensupport.SetOptions(c.urlParams_, opts...) 2537 res, err := c.doRequest("json") 2538 if res != nil && res.StatusCode == http.StatusNotModified { 2539 if res.Body != nil { 2540 res.Body.Close() 2541 } 2542 return nil, &googleapi.Error{ 2543 Code: res.StatusCode, 2544 Header: res.Header, 2545 } 2546 } 2547 if err != nil { 2548 return nil, err 2549 } 2550 defer googleapi.CloseBody(res) 2551 if err := googleapi.CheckResponse(res); err != nil { 2552 return nil, err 2553 } 2554 ret := &Deployment{ 2555 ServerResponse: googleapi.ServerResponse{ 2556 Header: res.Header, 2557 HTTPStatusCode: res.StatusCode, 2558 }, 2559 } 2560 target := &ret 2561 if err := gensupport.DecodeResponse(target, res); err != nil { 2562 return nil, err 2563 } 2564 return ret, nil 2565 // { 2566 // "description": "Gets information about a specific deployment.", 2567 // "flatPath": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}", 2568 // "httpMethod": "GET", 2569 // "id": "deploymentmanager.deployments.get", 2570 // "parameterOrder": [ 2571 // "project", 2572 // "deployment" 2573 // ], 2574 // "parameters": { 2575 // "deployment": { 2576 // "description": "The name of the deployment for this request.", 2577 // "location": "path", 2578 // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", 2579 // "required": true, 2580 // "type": "string" 2581 // }, 2582 // "project": { 2583 // "description": "The project ID for this request.", 2584 // "location": "path", 2585 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", 2586 // "required": true, 2587 // "type": "string" 2588 // } 2589 // }, 2590 // "path": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}", 2591 // "response": { 2592 // "$ref": "Deployment" 2593 // }, 2594 // "scopes": [ 2595 // "https://www.googleapis.com/auth/cloud-platform", 2596 // "https://www.googleapis.com/auth/cloud-platform.read-only", 2597 // "https://www.googleapis.com/auth/ndev.cloudman", 2598 // "https://www.googleapis.com/auth/ndev.cloudman.readonly" 2599 // ] 2600 // } 2601 2602} 2603 2604// method id "deploymentmanager.deployments.getIamPolicy": 2605 2606type DeploymentsGetIamPolicyCall struct { 2607 s *Service 2608 project string 2609 resource string 2610 urlParams_ gensupport.URLParams 2611 ifNoneMatch_ string 2612 ctx_ context.Context 2613 header_ http.Header 2614} 2615 2616// GetIamPolicy: Gets the access control policy for a resource. May be 2617// empty if no such policy or resource exists. 2618// 2619// - project: Project ID for this request. 2620// - resource: Name or id of the resource for this request. 2621func (r *DeploymentsService) GetIamPolicy(project string, resource string) *DeploymentsGetIamPolicyCall { 2622 c := &DeploymentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2623 c.project = project 2624 c.resource = resource 2625 return c 2626} 2627 2628// OptionsRequestedPolicyVersion sets the optional parameter 2629// "optionsRequestedPolicyVersion": Requested IAM Policy version. 2630func (c *DeploymentsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *DeploymentsGetIamPolicyCall { 2631 c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 2632 return c 2633} 2634 2635// Fields allows partial responses to be retrieved. See 2636// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2637// for more information. 2638func (c *DeploymentsGetIamPolicyCall) Fields(s ...googleapi.Field) *DeploymentsGetIamPolicyCall { 2639 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2640 return c 2641} 2642 2643// IfNoneMatch sets the optional parameter which makes the operation 2644// fail if the object's ETag matches the given value. This is useful for 2645// getting updates only after the object has changed since the last 2646// request. Use googleapi.IsNotModified to check whether the response 2647// error from Do is the result of In-None-Match. 2648func (c *DeploymentsGetIamPolicyCall) IfNoneMatch(entityTag string) *DeploymentsGetIamPolicyCall { 2649 c.ifNoneMatch_ = entityTag 2650 return c 2651} 2652 2653// Context sets the context to be used in this call's Do method. Any 2654// pending HTTP request will be aborted if the provided context is 2655// canceled. 2656func (c *DeploymentsGetIamPolicyCall) Context(ctx context.Context) *DeploymentsGetIamPolicyCall { 2657 c.ctx_ = ctx 2658 return c 2659} 2660 2661// Header returns an http.Header that can be modified by the caller to 2662// add HTTP headers to the request. 2663func (c *DeploymentsGetIamPolicyCall) Header() http.Header { 2664 if c.header_ == nil { 2665 c.header_ = make(http.Header) 2666 } 2667 return c.header_ 2668} 2669 2670func (c *DeploymentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 2671 reqHeaders := make(http.Header) 2672 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 2673 for k, v := range c.header_ { 2674 reqHeaders[k] = v 2675 } 2676 reqHeaders.Set("User-Agent", c.s.userAgent()) 2677 if c.ifNoneMatch_ != "" { 2678 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2679 } 2680 var body io.Reader = nil 2681 c.urlParams_.Set("alt", alt) 2682 c.urlParams_.Set("prettyPrint", "false") 2683 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{resource}/getIamPolicy") 2684 urls += "?" + c.urlParams_.Encode() 2685 req, err := http.NewRequest("GET", urls, body) 2686 if err != nil { 2687 return nil, err 2688 } 2689 req.Header = reqHeaders 2690 googleapi.Expand(req.URL, map[string]string{ 2691 "project": c.project, 2692 "resource": c.resource, 2693 }) 2694 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2695} 2696 2697// Do executes the "deploymentmanager.deployments.getIamPolicy" call. 2698// Exactly one of *Policy or error will be non-nil. Any non-2xx status 2699// code is an error. Response headers are in either 2700// *Policy.ServerResponse.Header or (if a response was returned at all) 2701// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2702// check whether the returned error was because http.StatusNotModified 2703// was returned. 2704func (c *DeploymentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 2705 gensupport.SetOptions(c.urlParams_, opts...) 2706 res, err := c.doRequest("json") 2707 if res != nil && res.StatusCode == http.StatusNotModified { 2708 if res.Body != nil { 2709 res.Body.Close() 2710 } 2711 return nil, &googleapi.Error{ 2712 Code: res.StatusCode, 2713 Header: res.Header, 2714 } 2715 } 2716 if err != nil { 2717 return nil, err 2718 } 2719 defer googleapi.CloseBody(res) 2720 if err := googleapi.CheckResponse(res); err != nil { 2721 return nil, err 2722 } 2723 ret := &Policy{ 2724 ServerResponse: googleapi.ServerResponse{ 2725 Header: res.Header, 2726 HTTPStatusCode: res.StatusCode, 2727 }, 2728 } 2729 target := &ret 2730 if err := gensupport.DecodeResponse(target, res); err != nil { 2731 return nil, err 2732 } 2733 return ret, nil 2734 // { 2735 // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.", 2736 // "flatPath": "deploymentmanager/v2/projects/{project}/global/deployments/{resource}/getIamPolicy", 2737 // "httpMethod": "GET", 2738 // "id": "deploymentmanager.deployments.getIamPolicy", 2739 // "parameterOrder": [ 2740 // "project", 2741 // "resource" 2742 // ], 2743 // "parameters": { 2744 // "optionsRequestedPolicyVersion": { 2745 // "description": "Requested IAM Policy version.", 2746 // "format": "int32", 2747 // "location": "query", 2748 // "type": "integer" 2749 // }, 2750 // "project": { 2751 // "description": "Project ID for this request.", 2752 // "location": "path", 2753 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", 2754 // "required": true, 2755 // "type": "string" 2756 // }, 2757 // "resource": { 2758 // "description": "Name or id of the resource for this request.", 2759 // "location": "path", 2760 // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}", 2761 // "required": true, 2762 // "type": "string" 2763 // } 2764 // }, 2765 // "path": "deploymentmanager/v2/projects/{project}/global/deployments/{resource}/getIamPolicy", 2766 // "response": { 2767 // "$ref": "Policy" 2768 // }, 2769 // "scopes": [ 2770 // "https://www.googleapis.com/auth/cloud-platform", 2771 // "https://www.googleapis.com/auth/ndev.cloudman" 2772 // ] 2773 // } 2774 2775} 2776 2777// method id "deploymentmanager.deployments.insert": 2778 2779type DeploymentsInsertCall struct { 2780 s *Service 2781 project string 2782 deployment *Deployment 2783 urlParams_ gensupport.URLParams 2784 ctx_ context.Context 2785 header_ http.Header 2786} 2787 2788// Insert: Creates a deployment and all of the resources described by 2789// the deployment manifest. 2790// 2791// - project: The project ID for this request. 2792func (r *DeploymentsService) Insert(project string, deployment *Deployment) *DeploymentsInsertCall { 2793 c := &DeploymentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2794 c.project = project 2795 c.deployment = deployment 2796 return c 2797} 2798 2799// CreatePolicy sets the optional parameter "createPolicy": Sets the 2800// policy to use for creating new resources. 2801// 2802// Possible values: 2803// "CREATE_OR_ACQUIRE" (default) 2804// "ACQUIRE" 2805func (c *DeploymentsInsertCall) CreatePolicy(createPolicy string) *DeploymentsInsertCall { 2806 c.urlParams_.Set("createPolicy", createPolicy) 2807 return c 2808} 2809 2810// Preview sets the optional parameter "preview": If set to true, 2811// creates a deployment and creates "shell" resources but does not 2812// actually instantiate these resources. This allows you to preview what 2813// your deployment looks like. After previewing a deployment, you can 2814// deploy your resources by making a request with the `update()` method 2815// or you can use the `cancelPreview()` method to cancel the preview 2816// altogether. Note that the deployment will still exist after you 2817// cancel the preview and you must separately delete this deployment if 2818// you want to remove it. 2819func (c *DeploymentsInsertCall) Preview(preview bool) *DeploymentsInsertCall { 2820 c.urlParams_.Set("preview", fmt.Sprint(preview)) 2821 return c 2822} 2823 2824// Fields allows partial responses to be retrieved. See 2825// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2826// for more information. 2827func (c *DeploymentsInsertCall) Fields(s ...googleapi.Field) *DeploymentsInsertCall { 2828 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2829 return c 2830} 2831 2832// Context sets the context to be used in this call's Do method. Any 2833// pending HTTP request will be aborted if the provided context is 2834// canceled. 2835func (c *DeploymentsInsertCall) Context(ctx context.Context) *DeploymentsInsertCall { 2836 c.ctx_ = ctx 2837 return c 2838} 2839 2840// Header returns an http.Header that can be modified by the caller to 2841// add HTTP headers to the request. 2842func (c *DeploymentsInsertCall) Header() http.Header { 2843 if c.header_ == nil { 2844 c.header_ = make(http.Header) 2845 } 2846 return c.header_ 2847} 2848 2849func (c *DeploymentsInsertCall) doRequest(alt string) (*http.Response, error) { 2850 reqHeaders := make(http.Header) 2851 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 2852 for k, v := range c.header_ { 2853 reqHeaders[k] = v 2854 } 2855 reqHeaders.Set("User-Agent", c.s.userAgent()) 2856 var body io.Reader = nil 2857 body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment) 2858 if err != nil { 2859 return nil, err 2860 } 2861 reqHeaders.Set("Content-Type", "application/json") 2862 c.urlParams_.Set("alt", alt) 2863 c.urlParams_.Set("prettyPrint", "false") 2864 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments") 2865 urls += "?" + c.urlParams_.Encode() 2866 req, err := http.NewRequest("POST", urls, body) 2867 if err != nil { 2868 return nil, err 2869 } 2870 req.Header = reqHeaders 2871 googleapi.Expand(req.URL, map[string]string{ 2872 "project": c.project, 2873 }) 2874 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2875} 2876 2877// Do executes the "deploymentmanager.deployments.insert" call. 2878// Exactly one of *Operation or error will be non-nil. Any non-2xx 2879// status code is an error. Response headers are in either 2880// *Operation.ServerResponse.Header or (if a response was returned at 2881// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2882// to check whether the returned error was because 2883// http.StatusNotModified was returned. 2884func (c *DeploymentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2885 gensupport.SetOptions(c.urlParams_, opts...) 2886 res, err := c.doRequest("json") 2887 if res != nil && res.StatusCode == http.StatusNotModified { 2888 if res.Body != nil { 2889 res.Body.Close() 2890 } 2891 return nil, &googleapi.Error{ 2892 Code: res.StatusCode, 2893 Header: res.Header, 2894 } 2895 } 2896 if err != nil { 2897 return nil, err 2898 } 2899 defer googleapi.CloseBody(res) 2900 if err := googleapi.CheckResponse(res); err != nil { 2901 return nil, err 2902 } 2903 ret := &Operation{ 2904 ServerResponse: googleapi.ServerResponse{ 2905 Header: res.Header, 2906 HTTPStatusCode: res.StatusCode, 2907 }, 2908 } 2909 target := &ret 2910 if err := gensupport.DecodeResponse(target, res); err != nil { 2911 return nil, err 2912 } 2913 return ret, nil 2914 // { 2915 // "description": "Creates a deployment and all of the resources described by the deployment manifest.", 2916 // "flatPath": "deploymentmanager/v2/projects/{project}/global/deployments", 2917 // "httpMethod": "POST", 2918 // "id": "deploymentmanager.deployments.insert", 2919 // "parameterOrder": [ 2920 // "project" 2921 // ], 2922 // "parameters": { 2923 // "createPolicy": { 2924 // "default": "CREATE_OR_ACQUIRE", 2925 // "description": "Sets the policy to use for creating new resources.", 2926 // "enum": [ 2927 // "CREATE_OR_ACQUIRE", 2928 // "ACQUIRE" 2929 // ], 2930 // "enumDescriptions": [ 2931 // "", 2932 // "" 2933 // ], 2934 // "location": "query", 2935 // "type": "string" 2936 // }, 2937 // "preview": { 2938 // "description": "If set to true, creates a deployment and creates \"shell\" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the `update()` method or you can use the `cancelPreview()` method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.", 2939 // "location": "query", 2940 // "type": "boolean" 2941 // }, 2942 // "project": { 2943 // "description": "The project ID for this request.", 2944 // "location": "path", 2945 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", 2946 // "required": true, 2947 // "type": "string" 2948 // } 2949 // }, 2950 // "path": "deploymentmanager/v2/projects/{project}/global/deployments", 2951 // "request": { 2952 // "$ref": "Deployment" 2953 // }, 2954 // "response": { 2955 // "$ref": "Operation" 2956 // }, 2957 // "scopes": [ 2958 // "https://www.googleapis.com/auth/cloud-platform", 2959 // "https://www.googleapis.com/auth/ndev.cloudman" 2960 // ] 2961 // } 2962 2963} 2964 2965// method id "deploymentmanager.deployments.list": 2966 2967type DeploymentsListCall struct { 2968 s *Service 2969 project string 2970 urlParams_ gensupport.URLParams 2971 ifNoneMatch_ string 2972 ctx_ context.Context 2973 header_ http.Header 2974} 2975 2976// List: Lists all deployments for a given project. 2977// 2978// - project: The project ID for this request. 2979func (r *DeploymentsService) List(project string) *DeploymentsListCall { 2980 c := &DeploymentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2981 c.project = project 2982 return c 2983} 2984 2985// Filter sets the optional parameter "filter": A filter expression that 2986// filters resources listed in the response. The expression must specify 2987// the field name, a comparison operator, and the value that you want to 2988// use for filtering. The value must be a string, a number, or a 2989// boolean. The comparison operator must be either `=`, `!=`, `>`, or 2990// `<`. For example, if you are filtering Compute Engine instances, you 2991// can exclude instances named `example-instance` by specifying `name != 2992// example-instance`. You can also filter nested fields. For example, 2993// you could specify `scheduling.automaticRestart = false` to include 2994// instances only if they are not scheduled for automatic restarts. You 2995// can use filtering on nested fields to filter based on resource 2996// labels. To filter on multiple expressions, provide each separate 2997// expression within parentheses. For example: ``` 2998// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") 2999// ``` By default, each expression is an `AND` expression. However, you 3000// can include `AND` and `OR` expressions explicitly. For example: ``` 3001// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") 3002// AND (scheduling.automaticRestart = true) ``` 3003func (c *DeploymentsListCall) Filter(filter string) *DeploymentsListCall { 3004 c.urlParams_.Set("filter", filter) 3005 return c 3006} 3007 3008// MaxResults sets the optional parameter "maxResults": The maximum 3009// number of results per page that should be returned. If the number of 3010// available results is larger than `maxResults`, Compute Engine returns 3011// a `nextPageToken` that can be used to get the next page of results in 3012// subsequent list requests. Acceptable values are `0` to `500`, 3013// inclusive. (Default: `500`) 3014func (c *DeploymentsListCall) MaxResults(maxResults int64) *DeploymentsListCall { 3015 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 3016 return c 3017} 3018 3019// OrderBy sets the optional parameter "orderBy": Sorts list results by 3020// a certain order. By default, results are returned in alphanumerical 3021// order based on the resource name. You can also sort results in 3022// descending order based on the creation timestamp using 3023// `orderBy="creationTimestamp desc". This sorts results based on the 3024// `creationTimestamp` field in reverse chronological order (newest 3025// result first). Use this to sort resources like operations so that the 3026// newest operation is returned first. Currently, only sorting by `name` 3027// or `creationTimestamp desc` is supported. 3028func (c *DeploymentsListCall) OrderBy(orderBy string) *DeploymentsListCall { 3029 c.urlParams_.Set("orderBy", orderBy) 3030 return c 3031} 3032 3033// PageToken sets the optional parameter "pageToken": Specifies a page 3034// token to use. Set `pageToken` to the `nextPageToken` returned by a 3035// previous list request to get the next page of results. 3036func (c *DeploymentsListCall) PageToken(pageToken string) *DeploymentsListCall { 3037 c.urlParams_.Set("pageToken", pageToken) 3038 return c 3039} 3040 3041// Fields allows partial responses to be retrieved. See 3042// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3043// for more information. 3044func (c *DeploymentsListCall) Fields(s ...googleapi.Field) *DeploymentsListCall { 3045 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3046 return c 3047} 3048 3049// IfNoneMatch sets the optional parameter which makes the operation 3050// fail if the object's ETag matches the given value. This is useful for 3051// getting updates only after the object has changed since the last 3052// request. Use googleapi.IsNotModified to check whether the response 3053// error from Do is the result of In-None-Match. 3054func (c *DeploymentsListCall) IfNoneMatch(entityTag string) *DeploymentsListCall { 3055 c.ifNoneMatch_ = entityTag 3056 return c 3057} 3058 3059// Context sets the context to be used in this call's Do method. Any 3060// pending HTTP request will be aborted if the provided context is 3061// canceled. 3062func (c *DeploymentsListCall) Context(ctx context.Context) *DeploymentsListCall { 3063 c.ctx_ = ctx 3064 return c 3065} 3066 3067// Header returns an http.Header that can be modified by the caller to 3068// add HTTP headers to the request. 3069func (c *DeploymentsListCall) Header() http.Header { 3070 if c.header_ == nil { 3071 c.header_ = make(http.Header) 3072 } 3073 return c.header_ 3074} 3075 3076func (c *DeploymentsListCall) doRequest(alt string) (*http.Response, error) { 3077 reqHeaders := make(http.Header) 3078 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 3079 for k, v := range c.header_ { 3080 reqHeaders[k] = v 3081 } 3082 reqHeaders.Set("User-Agent", c.s.userAgent()) 3083 if c.ifNoneMatch_ != "" { 3084 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3085 } 3086 var body io.Reader = nil 3087 c.urlParams_.Set("alt", alt) 3088 c.urlParams_.Set("prettyPrint", "false") 3089 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments") 3090 urls += "?" + c.urlParams_.Encode() 3091 req, err := http.NewRequest("GET", urls, body) 3092 if err != nil { 3093 return nil, err 3094 } 3095 req.Header = reqHeaders 3096 googleapi.Expand(req.URL, map[string]string{ 3097 "project": c.project, 3098 }) 3099 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3100} 3101 3102// Do executes the "deploymentmanager.deployments.list" call. 3103// Exactly one of *DeploymentsListResponse or error will be non-nil. Any 3104// non-2xx status code is an error. Response headers are in either 3105// *DeploymentsListResponse.ServerResponse.Header or (if a response was 3106// returned at all) in error.(*googleapi.Error).Header. Use 3107// googleapi.IsNotModified to check whether the returned error was 3108// because http.StatusNotModified was returned. 3109func (c *DeploymentsListCall) Do(opts ...googleapi.CallOption) (*DeploymentsListResponse, error) { 3110 gensupport.SetOptions(c.urlParams_, opts...) 3111 res, err := c.doRequest("json") 3112 if res != nil && res.StatusCode == http.StatusNotModified { 3113 if res.Body != nil { 3114 res.Body.Close() 3115 } 3116 return nil, &googleapi.Error{ 3117 Code: res.StatusCode, 3118 Header: res.Header, 3119 } 3120 } 3121 if err != nil { 3122 return nil, err 3123 } 3124 defer googleapi.CloseBody(res) 3125 if err := googleapi.CheckResponse(res); err != nil { 3126 return nil, err 3127 } 3128 ret := &DeploymentsListResponse{ 3129 ServerResponse: googleapi.ServerResponse{ 3130 Header: res.Header, 3131 HTTPStatusCode: res.StatusCode, 3132 }, 3133 } 3134 target := &ret 3135 if err := gensupport.DecodeResponse(target, res); err != nil { 3136 return nil, err 3137 } 3138 return ret, nil 3139 // { 3140 // "description": "Lists all deployments for a given project.", 3141 // "flatPath": "deploymentmanager/v2/projects/{project}/global/deployments", 3142 // "httpMethod": "GET", 3143 // "id": "deploymentmanager.deployments.list", 3144 // "parameterOrder": [ 3145 // "project" 3146 // ], 3147 // "parameters": { 3148 // "filter": { 3149 // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `\u003e`, or `\u003c`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ```", 3150 // "location": "query", 3151 // "type": "string" 3152 // }, 3153 // "maxResults": { 3154 // "default": "500", 3155 // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)", 3156 // "format": "uint32", 3157 // "location": "query", 3158 // "minimum": "0", 3159 // "type": "integer" 3160 // }, 3161 // "orderBy": { 3162 // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.", 3163 // "location": "query", 3164 // "type": "string" 3165 // }, 3166 // "pageToken": { 3167 // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.", 3168 // "location": "query", 3169 // "type": "string" 3170 // }, 3171 // "project": { 3172 // "description": "The project ID for this request.", 3173 // "location": "path", 3174 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", 3175 // "required": true, 3176 // "type": "string" 3177 // } 3178 // }, 3179 // "path": "deploymentmanager/v2/projects/{project}/global/deployments", 3180 // "response": { 3181 // "$ref": "DeploymentsListResponse" 3182 // }, 3183 // "scopes": [ 3184 // "https://www.googleapis.com/auth/cloud-platform", 3185 // "https://www.googleapis.com/auth/cloud-platform.read-only", 3186 // "https://www.googleapis.com/auth/ndev.cloudman", 3187 // "https://www.googleapis.com/auth/ndev.cloudman.readonly" 3188 // ] 3189 // } 3190 3191} 3192 3193// Pages invokes f for each page of results. 3194// A non-nil error returned from f will halt the iteration. 3195// The provided context supersedes any context provided to the Context method. 3196func (c *DeploymentsListCall) Pages(ctx context.Context, f func(*DeploymentsListResponse) error) error { 3197 c.ctx_ = ctx 3198 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3199 for { 3200 x, err := c.Do() 3201 if err != nil { 3202 return err 3203 } 3204 if err := f(x); err != nil { 3205 return err 3206 } 3207 if x.NextPageToken == "" { 3208 return nil 3209 } 3210 c.PageToken(x.NextPageToken) 3211 } 3212} 3213 3214// method id "deploymentmanager.deployments.patch": 3215 3216type DeploymentsPatchCall struct { 3217 s *Service 3218 project string 3219 deployment string 3220 deployment2 *Deployment 3221 urlParams_ gensupport.URLParams 3222 ctx_ context.Context 3223 header_ http.Header 3224} 3225 3226// Patch: Patches a deployment and all of the resources described by the 3227// deployment manifest. 3228// 3229// - deployment: The name of the deployment for this request. 3230// - project: The project ID for this request. 3231func (r *DeploymentsService) Patch(project string, deployment string, deployment2 *Deployment) *DeploymentsPatchCall { 3232 c := &DeploymentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3233 c.project = project 3234 c.deployment = deployment 3235 c.deployment2 = deployment2 3236 return c 3237} 3238 3239// CreatePolicy sets the optional parameter "createPolicy": Sets the 3240// policy to use for creating new resources. 3241// 3242// Possible values: 3243// "CREATE_OR_ACQUIRE" (default) 3244// "ACQUIRE" 3245func (c *DeploymentsPatchCall) CreatePolicy(createPolicy string) *DeploymentsPatchCall { 3246 c.urlParams_.Set("createPolicy", createPolicy) 3247 return c 3248} 3249 3250// DeletePolicy sets the optional parameter "deletePolicy": Sets the 3251// policy to use for deleting resources. 3252// 3253// Possible values: 3254// "DELETE" (default) 3255// "ABANDON" 3256func (c *DeploymentsPatchCall) DeletePolicy(deletePolicy string) *DeploymentsPatchCall { 3257 c.urlParams_.Set("deletePolicy", deletePolicy) 3258 return c 3259} 3260 3261// Preview sets the optional parameter "preview": If set to true, 3262// updates the deployment and creates and updates the "shell" resources 3263// but does not actually alter or instantiate these resources. This 3264// allows you to preview what your deployment will look like. You can 3265// use this intent to preview how an update would affect your 3266// deployment. You must provide a `target.config` with a configuration 3267// if this is set to true. After previewing a deployment, you can deploy 3268// your resources by making a request with the `update()` or you can 3269// `cancelPreview()` to remove the preview altogether. Note that the 3270// deployment will still exist after you cancel the preview and you must 3271// separately delete this deployment if you want to remove it. 3272func (c *DeploymentsPatchCall) Preview(preview bool) *DeploymentsPatchCall { 3273 c.urlParams_.Set("preview", fmt.Sprint(preview)) 3274 return c 3275} 3276 3277// Fields allows partial responses to be retrieved. See 3278// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3279// for more information. 3280func (c *DeploymentsPatchCall) Fields(s ...googleapi.Field) *DeploymentsPatchCall { 3281 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3282 return c 3283} 3284 3285// Context sets the context to be used in this call's Do method. Any 3286// pending HTTP request will be aborted if the provided context is 3287// canceled. 3288func (c *DeploymentsPatchCall) Context(ctx context.Context) *DeploymentsPatchCall { 3289 c.ctx_ = ctx 3290 return c 3291} 3292 3293// Header returns an http.Header that can be modified by the caller to 3294// add HTTP headers to the request. 3295func (c *DeploymentsPatchCall) Header() http.Header { 3296 if c.header_ == nil { 3297 c.header_ = make(http.Header) 3298 } 3299 return c.header_ 3300} 3301 3302func (c *DeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { 3303 reqHeaders := make(http.Header) 3304 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 3305 for k, v := range c.header_ { 3306 reqHeaders[k] = v 3307 } 3308 reqHeaders.Set("User-Agent", c.s.userAgent()) 3309 var body io.Reader = nil 3310 body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2) 3311 if err != nil { 3312 return nil, err 3313 } 3314 reqHeaders.Set("Content-Type", "application/json") 3315 c.urlParams_.Set("alt", alt) 3316 c.urlParams_.Set("prettyPrint", "false") 3317 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}") 3318 urls += "?" + c.urlParams_.Encode() 3319 req, err := http.NewRequest("PATCH", urls, body) 3320 if err != nil { 3321 return nil, err 3322 } 3323 req.Header = reqHeaders 3324 googleapi.Expand(req.URL, map[string]string{ 3325 "project": c.project, 3326 "deployment": c.deployment, 3327 }) 3328 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3329} 3330 3331// Do executes the "deploymentmanager.deployments.patch" call. 3332// Exactly one of *Operation or error will be non-nil. Any non-2xx 3333// status code is an error. Response headers are in either 3334// *Operation.ServerResponse.Header or (if a response was returned at 3335// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3336// to check whether the returned error was because 3337// http.StatusNotModified was returned. 3338func (c *DeploymentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3339 gensupport.SetOptions(c.urlParams_, opts...) 3340 res, err := c.doRequest("json") 3341 if res != nil && res.StatusCode == http.StatusNotModified { 3342 if res.Body != nil { 3343 res.Body.Close() 3344 } 3345 return nil, &googleapi.Error{ 3346 Code: res.StatusCode, 3347 Header: res.Header, 3348 } 3349 } 3350 if err != nil { 3351 return nil, err 3352 } 3353 defer googleapi.CloseBody(res) 3354 if err := googleapi.CheckResponse(res); err != nil { 3355 return nil, err 3356 } 3357 ret := &Operation{ 3358 ServerResponse: googleapi.ServerResponse{ 3359 Header: res.Header, 3360 HTTPStatusCode: res.StatusCode, 3361 }, 3362 } 3363 target := &ret 3364 if err := gensupport.DecodeResponse(target, res); err != nil { 3365 return nil, err 3366 } 3367 return ret, nil 3368 // { 3369 // "description": "Patches a deployment and all of the resources described by the deployment manifest.", 3370 // "flatPath": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}", 3371 // "httpMethod": "PATCH", 3372 // "id": "deploymentmanager.deployments.patch", 3373 // "parameterOrder": [ 3374 // "project", 3375 // "deployment" 3376 // ], 3377 // "parameters": { 3378 // "createPolicy": { 3379 // "default": "CREATE_OR_ACQUIRE", 3380 // "description": "Sets the policy to use for creating new resources.", 3381 // "enum": [ 3382 // "CREATE_OR_ACQUIRE", 3383 // "ACQUIRE" 3384 // ], 3385 // "enumDescriptions": [ 3386 // "", 3387 // "" 3388 // ], 3389 // "location": "query", 3390 // "type": "string" 3391 // }, 3392 // "deletePolicy": { 3393 // "default": "DELETE", 3394 // "description": "Sets the policy to use for deleting resources.", 3395 // "enum": [ 3396 // "DELETE", 3397 // "ABANDON" 3398 // ], 3399 // "enumDescriptions": [ 3400 // "", 3401 // "" 3402 // ], 3403 // "location": "query", 3404 // "type": "string" 3405 // }, 3406 // "deployment": { 3407 // "description": "The name of the deployment for this request.", 3408 // "location": "path", 3409 // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", 3410 // "required": true, 3411 // "type": "string" 3412 // }, 3413 // "preview": { 3414 // "default": "false", 3415 // "description": "If set to true, updates the deployment and creates and updates the \"shell\" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a `target.config` with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the `update()` or you can `cancelPreview()` to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.", 3416 // "location": "query", 3417 // "type": "boolean" 3418 // }, 3419 // "project": { 3420 // "description": "The project ID for this request.", 3421 // "location": "path", 3422 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", 3423 // "required": true, 3424 // "type": "string" 3425 // } 3426 // }, 3427 // "path": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}", 3428 // "request": { 3429 // "$ref": "Deployment" 3430 // }, 3431 // "response": { 3432 // "$ref": "Operation" 3433 // }, 3434 // "scopes": [ 3435 // "https://www.googleapis.com/auth/cloud-platform", 3436 // "https://www.googleapis.com/auth/ndev.cloudman" 3437 // ] 3438 // } 3439 3440} 3441 3442// method id "deploymentmanager.deployments.setIamPolicy": 3443 3444type DeploymentsSetIamPolicyCall struct { 3445 s *Service 3446 project string 3447 resource string 3448 globalsetpolicyrequest *GlobalSetPolicyRequest 3449 urlParams_ gensupport.URLParams 3450 ctx_ context.Context 3451 header_ http.Header 3452} 3453 3454// SetIamPolicy: Sets the access control policy on the specified 3455// resource. Replaces any existing policy. 3456// 3457// - project: Project ID for this request. 3458// - resource: Name or id of the resource for this request. 3459func (r *DeploymentsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *DeploymentsSetIamPolicyCall { 3460 c := &DeploymentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3461 c.project = project 3462 c.resource = resource 3463 c.globalsetpolicyrequest = globalsetpolicyrequest 3464 return c 3465} 3466 3467// Fields allows partial responses to be retrieved. See 3468// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3469// for more information. 3470func (c *DeploymentsSetIamPolicyCall) Fields(s ...googleapi.Field) *DeploymentsSetIamPolicyCall { 3471 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3472 return c 3473} 3474 3475// Context sets the context to be used in this call's Do method. Any 3476// pending HTTP request will be aborted if the provided context is 3477// canceled. 3478func (c *DeploymentsSetIamPolicyCall) Context(ctx context.Context) *DeploymentsSetIamPolicyCall { 3479 c.ctx_ = ctx 3480 return c 3481} 3482 3483// Header returns an http.Header that can be modified by the caller to 3484// add HTTP headers to the request. 3485func (c *DeploymentsSetIamPolicyCall) Header() http.Header { 3486 if c.header_ == nil { 3487 c.header_ = make(http.Header) 3488 } 3489 return c.header_ 3490} 3491 3492func (c *DeploymentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 3493 reqHeaders := make(http.Header) 3494 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 3495 for k, v := range c.header_ { 3496 reqHeaders[k] = v 3497 } 3498 reqHeaders.Set("User-Agent", c.s.userAgent()) 3499 var body io.Reader = nil 3500 body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) 3501 if err != nil { 3502 return nil, err 3503 } 3504 reqHeaders.Set("Content-Type", "application/json") 3505 c.urlParams_.Set("alt", alt) 3506 c.urlParams_.Set("prettyPrint", "false") 3507 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{resource}/setIamPolicy") 3508 urls += "?" + c.urlParams_.Encode() 3509 req, err := http.NewRequest("POST", urls, body) 3510 if err != nil { 3511 return nil, err 3512 } 3513 req.Header = reqHeaders 3514 googleapi.Expand(req.URL, map[string]string{ 3515 "project": c.project, 3516 "resource": c.resource, 3517 }) 3518 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3519} 3520 3521// Do executes the "deploymentmanager.deployments.setIamPolicy" call. 3522// Exactly one of *Policy or error will be non-nil. Any non-2xx status 3523// code is an error. Response headers are in either 3524// *Policy.ServerResponse.Header or (if a response was returned at all) 3525// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3526// check whether the returned error was because http.StatusNotModified 3527// was returned. 3528func (c *DeploymentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 3529 gensupport.SetOptions(c.urlParams_, opts...) 3530 res, err := c.doRequest("json") 3531 if res != nil && res.StatusCode == http.StatusNotModified { 3532 if res.Body != nil { 3533 res.Body.Close() 3534 } 3535 return nil, &googleapi.Error{ 3536 Code: res.StatusCode, 3537 Header: res.Header, 3538 } 3539 } 3540 if err != nil { 3541 return nil, err 3542 } 3543 defer googleapi.CloseBody(res) 3544 if err := googleapi.CheckResponse(res); err != nil { 3545 return nil, err 3546 } 3547 ret := &Policy{ 3548 ServerResponse: googleapi.ServerResponse{ 3549 Header: res.Header, 3550 HTTPStatusCode: res.StatusCode, 3551 }, 3552 } 3553 target := &ret 3554 if err := gensupport.DecodeResponse(target, res); err != nil { 3555 return nil, err 3556 } 3557 return ret, nil 3558 // { 3559 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.", 3560 // "flatPath": "deploymentmanager/v2/projects/{project}/global/deployments/{resource}/setIamPolicy", 3561 // "httpMethod": "POST", 3562 // "id": "deploymentmanager.deployments.setIamPolicy", 3563 // "parameterOrder": [ 3564 // "project", 3565 // "resource" 3566 // ], 3567 // "parameters": { 3568 // "project": { 3569 // "description": "Project ID for this request.", 3570 // "location": "path", 3571 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", 3572 // "required": true, 3573 // "type": "string" 3574 // }, 3575 // "resource": { 3576 // "description": "Name or id of the resource for this request.", 3577 // "location": "path", 3578 // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}", 3579 // "required": true, 3580 // "type": "string" 3581 // } 3582 // }, 3583 // "path": "deploymentmanager/v2/projects/{project}/global/deployments/{resource}/setIamPolicy", 3584 // "request": { 3585 // "$ref": "GlobalSetPolicyRequest" 3586 // }, 3587 // "response": { 3588 // "$ref": "Policy" 3589 // }, 3590 // "scopes": [ 3591 // "https://www.googleapis.com/auth/cloud-platform", 3592 // "https://www.googleapis.com/auth/ndev.cloudman" 3593 // ] 3594 // } 3595 3596} 3597 3598// method id "deploymentmanager.deployments.stop": 3599 3600type DeploymentsStopCall struct { 3601 s *Service 3602 project string 3603 deployment string 3604 deploymentsstoprequest *DeploymentsStopRequest 3605 urlParams_ gensupport.URLParams 3606 ctx_ context.Context 3607 header_ http.Header 3608} 3609 3610// Stop: Stops an ongoing operation. This does not roll back any work 3611// that has already been completed, but prevents any new work from being 3612// started. 3613// 3614// - deployment: The name of the deployment for this request. 3615// - project: The project ID for this request. 3616func (r *DeploymentsService) Stop(project string, deployment string, deploymentsstoprequest *DeploymentsStopRequest) *DeploymentsStopCall { 3617 c := &DeploymentsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3618 c.project = project 3619 c.deployment = deployment 3620 c.deploymentsstoprequest = deploymentsstoprequest 3621 return c 3622} 3623 3624// Fields allows partial responses to be retrieved. See 3625// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3626// for more information. 3627func (c *DeploymentsStopCall) Fields(s ...googleapi.Field) *DeploymentsStopCall { 3628 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3629 return c 3630} 3631 3632// Context sets the context to be used in this call's Do method. Any 3633// pending HTTP request will be aborted if the provided context is 3634// canceled. 3635func (c *DeploymentsStopCall) Context(ctx context.Context) *DeploymentsStopCall { 3636 c.ctx_ = ctx 3637 return c 3638} 3639 3640// Header returns an http.Header that can be modified by the caller to 3641// add HTTP headers to the request. 3642func (c *DeploymentsStopCall) Header() http.Header { 3643 if c.header_ == nil { 3644 c.header_ = make(http.Header) 3645 } 3646 return c.header_ 3647} 3648 3649func (c *DeploymentsStopCall) doRequest(alt string) (*http.Response, error) { 3650 reqHeaders := make(http.Header) 3651 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 3652 for k, v := range c.header_ { 3653 reqHeaders[k] = v 3654 } 3655 reqHeaders.Set("User-Agent", c.s.userAgent()) 3656 var body io.Reader = nil 3657 body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentsstoprequest) 3658 if err != nil { 3659 return nil, err 3660 } 3661 reqHeaders.Set("Content-Type", "application/json") 3662 c.urlParams_.Set("alt", alt) 3663 c.urlParams_.Set("prettyPrint", "false") 3664 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/stop") 3665 urls += "?" + c.urlParams_.Encode() 3666 req, err := http.NewRequest("POST", urls, body) 3667 if err != nil { 3668 return nil, err 3669 } 3670 req.Header = reqHeaders 3671 googleapi.Expand(req.URL, map[string]string{ 3672 "project": c.project, 3673 "deployment": c.deployment, 3674 }) 3675 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3676} 3677 3678// Do executes the "deploymentmanager.deployments.stop" call. 3679// Exactly one of *Operation or error will be non-nil. Any non-2xx 3680// status code is an error. Response headers are in either 3681// *Operation.ServerResponse.Header or (if a response was returned at 3682// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3683// to check whether the returned error was because 3684// http.StatusNotModified was returned. 3685func (c *DeploymentsStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3686 gensupport.SetOptions(c.urlParams_, opts...) 3687 res, err := c.doRequest("json") 3688 if res != nil && res.StatusCode == http.StatusNotModified { 3689 if res.Body != nil { 3690 res.Body.Close() 3691 } 3692 return nil, &googleapi.Error{ 3693 Code: res.StatusCode, 3694 Header: res.Header, 3695 } 3696 } 3697 if err != nil { 3698 return nil, err 3699 } 3700 defer googleapi.CloseBody(res) 3701 if err := googleapi.CheckResponse(res); err != nil { 3702 return nil, err 3703 } 3704 ret := &Operation{ 3705 ServerResponse: googleapi.ServerResponse{ 3706 Header: res.Header, 3707 HTTPStatusCode: res.StatusCode, 3708 }, 3709 } 3710 target := &ret 3711 if err := gensupport.DecodeResponse(target, res); err != nil { 3712 return nil, err 3713 } 3714 return ret, nil 3715 // { 3716 // "description": "Stops an ongoing operation. This does not roll back any work that has already been completed, but prevents any new work from being started.", 3717 // "flatPath": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/stop", 3718 // "httpMethod": "POST", 3719 // "id": "deploymentmanager.deployments.stop", 3720 // "parameterOrder": [ 3721 // "project", 3722 // "deployment" 3723 // ], 3724 // "parameters": { 3725 // "deployment": { 3726 // "description": "The name of the deployment for this request.", 3727 // "location": "path", 3728 // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", 3729 // "required": true, 3730 // "type": "string" 3731 // }, 3732 // "project": { 3733 // "description": "The project ID for this request.", 3734 // "location": "path", 3735 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", 3736 // "required": true, 3737 // "type": "string" 3738 // } 3739 // }, 3740 // "path": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/stop", 3741 // "request": { 3742 // "$ref": "DeploymentsStopRequest" 3743 // }, 3744 // "response": { 3745 // "$ref": "Operation" 3746 // }, 3747 // "scopes": [ 3748 // "https://www.googleapis.com/auth/cloud-platform", 3749 // "https://www.googleapis.com/auth/ndev.cloudman" 3750 // ] 3751 // } 3752 3753} 3754 3755// method id "deploymentmanager.deployments.testIamPermissions": 3756 3757type DeploymentsTestIamPermissionsCall struct { 3758 s *Service 3759 project string 3760 resource string 3761 testpermissionsrequest *TestPermissionsRequest 3762 urlParams_ gensupport.URLParams 3763 ctx_ context.Context 3764 header_ http.Header 3765} 3766 3767// TestIamPermissions: Returns permissions that a caller has on the 3768// specified resource. 3769// 3770// - project: Project ID for this request. 3771// - resource: Name or id of the resource for this request. 3772func (r *DeploymentsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *DeploymentsTestIamPermissionsCall { 3773 c := &DeploymentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3774 c.project = project 3775 c.resource = resource 3776 c.testpermissionsrequest = testpermissionsrequest 3777 return c 3778} 3779 3780// Fields allows partial responses to be retrieved. See 3781// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3782// for more information. 3783func (c *DeploymentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *DeploymentsTestIamPermissionsCall { 3784 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3785 return c 3786} 3787 3788// Context sets the context to be used in this call's Do method. Any 3789// pending HTTP request will be aborted if the provided context is 3790// canceled. 3791func (c *DeploymentsTestIamPermissionsCall) Context(ctx context.Context) *DeploymentsTestIamPermissionsCall { 3792 c.ctx_ = ctx 3793 return c 3794} 3795 3796// Header returns an http.Header that can be modified by the caller to 3797// add HTTP headers to the request. 3798func (c *DeploymentsTestIamPermissionsCall) Header() http.Header { 3799 if c.header_ == nil { 3800 c.header_ = make(http.Header) 3801 } 3802 return c.header_ 3803} 3804 3805func (c *DeploymentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 3806 reqHeaders := make(http.Header) 3807 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 3808 for k, v := range c.header_ { 3809 reqHeaders[k] = v 3810 } 3811 reqHeaders.Set("User-Agent", c.s.userAgent()) 3812 var body io.Reader = nil 3813 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) 3814 if err != nil { 3815 return nil, err 3816 } 3817 reqHeaders.Set("Content-Type", "application/json") 3818 c.urlParams_.Set("alt", alt) 3819 c.urlParams_.Set("prettyPrint", "false") 3820 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{resource}/testIamPermissions") 3821 urls += "?" + c.urlParams_.Encode() 3822 req, err := http.NewRequest("POST", urls, body) 3823 if err != nil { 3824 return nil, err 3825 } 3826 req.Header = reqHeaders 3827 googleapi.Expand(req.URL, map[string]string{ 3828 "project": c.project, 3829 "resource": c.resource, 3830 }) 3831 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3832} 3833 3834// Do executes the "deploymentmanager.deployments.testIamPermissions" call. 3835// Exactly one of *TestPermissionsResponse or error will be non-nil. Any 3836// non-2xx status code is an error. Response headers are in either 3837// *TestPermissionsResponse.ServerResponse.Header or (if a response was 3838// returned at all) in error.(*googleapi.Error).Header. Use 3839// googleapi.IsNotModified to check whether the returned error was 3840// because http.StatusNotModified was returned. 3841func (c *DeploymentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { 3842 gensupport.SetOptions(c.urlParams_, opts...) 3843 res, err := c.doRequest("json") 3844 if res != nil && res.StatusCode == http.StatusNotModified { 3845 if res.Body != nil { 3846 res.Body.Close() 3847 } 3848 return nil, &googleapi.Error{ 3849 Code: res.StatusCode, 3850 Header: res.Header, 3851 } 3852 } 3853 if err != nil { 3854 return nil, err 3855 } 3856 defer googleapi.CloseBody(res) 3857 if err := googleapi.CheckResponse(res); err != nil { 3858 return nil, err 3859 } 3860 ret := &TestPermissionsResponse{ 3861 ServerResponse: googleapi.ServerResponse{ 3862 Header: res.Header, 3863 HTTPStatusCode: res.StatusCode, 3864 }, 3865 } 3866 target := &ret 3867 if err := gensupport.DecodeResponse(target, res); err != nil { 3868 return nil, err 3869 } 3870 return ret, nil 3871 // { 3872 // "description": "Returns permissions that a caller has on the specified resource.", 3873 // "flatPath": "deploymentmanager/v2/projects/{project}/global/deployments/{resource}/testIamPermissions", 3874 // "httpMethod": "POST", 3875 // "id": "deploymentmanager.deployments.testIamPermissions", 3876 // "parameterOrder": [ 3877 // "project", 3878 // "resource" 3879 // ], 3880 // "parameters": { 3881 // "project": { 3882 // "description": "Project ID for this request.", 3883 // "location": "path", 3884 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))", 3885 // "required": true, 3886 // "type": "string" 3887 // }, 3888 // "resource": { 3889 // "description": "Name or id of the resource for this request.", 3890 // "location": "path", 3891 // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}", 3892 // "required": true, 3893 // "type": "string" 3894 // } 3895 // }, 3896 // "path": "deploymentmanager/v2/projects/{project}/global/deployments/{resource}/testIamPermissions", 3897 // "request": { 3898 // "$ref": "TestPermissionsRequest" 3899 // }, 3900 // "response": { 3901 // "$ref": "TestPermissionsResponse" 3902 // }, 3903 // "scopes": [ 3904 // "https://www.googleapis.com/auth/cloud-platform", 3905 // "https://www.googleapis.com/auth/ndev.cloudman" 3906 // ] 3907 // } 3908 3909} 3910 3911// method id "deploymentmanager.deployments.update": 3912 3913type DeploymentsUpdateCall struct { 3914 s *Service 3915 project string 3916 deployment string 3917 deployment2 *Deployment 3918 urlParams_ gensupport.URLParams 3919 ctx_ context.Context 3920 header_ http.Header 3921} 3922 3923// Update: Updates a deployment and all of the resources described by 3924// the deployment manifest. 3925// 3926// - deployment: The name of the deployment for this request. 3927// - project: The project ID for this request. 3928func (r *DeploymentsService) Update(project string, deployment string, deployment2 *Deployment) *DeploymentsUpdateCall { 3929 c := &DeploymentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3930 c.project = project 3931 c.deployment = deployment 3932 c.deployment2 = deployment2 3933 return c 3934} 3935 3936// CreatePolicy sets the optional parameter "createPolicy": Sets the 3937// policy to use for creating new resources. 3938// 3939// Possible values: 3940// "CREATE_OR_ACQUIRE" (default) 3941// "ACQUIRE" 3942func (c *DeploymentsUpdateCall) CreatePolicy(createPolicy string) *DeploymentsUpdateCall { 3943 c.urlParams_.Set("createPolicy", createPolicy) 3944 return c 3945} 3946 3947// DeletePolicy sets the optional parameter "deletePolicy": Sets the 3948// policy to use for deleting resources. 3949// 3950// Possible values: 3951// "DELETE" (default) 3952// "ABANDON" 3953func (c *DeploymentsUpdateCall) DeletePolicy(deletePolicy string) *DeploymentsUpdateCall { 3954 c.urlParams_.Set("deletePolicy", deletePolicy) 3955 return c 3956} 3957 3958// Preview sets the optional parameter "preview": If set to true, 3959// updates the deployment and creates and updates the "shell" resources 3960// but does not actually alter or instantiate these resources. This 3961// allows you to preview what your deployment will look like. You can 3962// use this intent to preview how an update would affect your 3963// deployment. You must provide a `target.config` with a configuration 3964// if this is set to true. After previewing a deployment, you can deploy 3965// your resources by making a request with the `update()` or you can 3966// `cancelPreview()` to remove the preview altogether. Note that the 3967// deployment will still exist after you cancel the preview and you must 3968// separately delete this deployment if you want to remove it. 3969func (c *DeploymentsUpdateCall) Preview(preview bool) *DeploymentsUpdateCall { 3970 c.urlParams_.Set("preview", fmt.Sprint(preview)) 3971 return c 3972} 3973 3974// Fields allows partial responses to be retrieved. See 3975// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3976// for more information. 3977func (c *DeploymentsUpdateCall) Fields(s ...googleapi.Field) *DeploymentsUpdateCall { 3978 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3979 return c 3980} 3981 3982// Context sets the context to be used in this call's Do method. Any 3983// pending HTTP request will be aborted if the provided context is 3984// canceled. 3985func (c *DeploymentsUpdateCall) Context(ctx context.Context) *DeploymentsUpdateCall { 3986 c.ctx_ = ctx 3987 return c 3988} 3989 3990// Header returns an http.Header that can be modified by the caller to 3991// add HTTP headers to the request. 3992func (c *DeploymentsUpdateCall) Header() http.Header { 3993 if c.header_ == nil { 3994 c.header_ = make(http.Header) 3995 } 3996 return c.header_ 3997} 3998 3999func (c *DeploymentsUpdateCall) doRequest(alt string) (*http.Response, error) { 4000 reqHeaders := make(http.Header) 4001 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 4002 for k, v := range c.header_ { 4003 reqHeaders[k] = v 4004 } 4005 reqHeaders.Set("User-Agent", c.s.userAgent()) 4006 var body io.Reader = nil 4007 body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2) 4008 if err != nil { 4009 return nil, err 4010 } 4011 reqHeaders.Set("Content-Type", "application/json") 4012 c.urlParams_.Set("alt", alt) 4013 c.urlParams_.Set("prettyPrint", "false") 4014 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}") 4015 urls += "?" + c.urlParams_.Encode() 4016 req, err := http.NewRequest("PUT", urls, body) 4017 if err != nil { 4018 return nil, err 4019 } 4020 req.Header = reqHeaders 4021 googleapi.Expand(req.URL, map[string]string{ 4022 "project": c.project, 4023 "deployment": c.deployment, 4024 }) 4025 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4026} 4027 4028// Do executes the "deploymentmanager.deployments.update" call. 4029// Exactly one of *Operation or error will be non-nil. Any non-2xx 4030// status code is an error. Response headers are in either 4031// *Operation.ServerResponse.Header or (if a response was returned at 4032// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4033// to check whether the returned error was because 4034// http.StatusNotModified was returned. 4035func (c *DeploymentsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4036 gensupport.SetOptions(c.urlParams_, opts...) 4037 res, err := c.doRequest("json") 4038 if res != nil && res.StatusCode == http.StatusNotModified { 4039 if res.Body != nil { 4040 res.Body.Close() 4041 } 4042 return nil, &googleapi.Error{ 4043 Code: res.StatusCode, 4044 Header: res.Header, 4045 } 4046 } 4047 if err != nil { 4048 return nil, err 4049 } 4050 defer googleapi.CloseBody(res) 4051 if err := googleapi.CheckResponse(res); err != nil { 4052 return nil, err 4053 } 4054 ret := &Operation{ 4055 ServerResponse: googleapi.ServerResponse{ 4056 Header: res.Header, 4057 HTTPStatusCode: res.StatusCode, 4058 }, 4059 } 4060 target := &ret 4061 if err := gensupport.DecodeResponse(target, res); err != nil { 4062 return nil, err 4063 } 4064 return ret, nil 4065 // { 4066 // "description": "Updates a deployment and all of the resources described by the deployment manifest.", 4067 // "flatPath": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}", 4068 // "httpMethod": "PUT", 4069 // "id": "deploymentmanager.deployments.update", 4070 // "parameterOrder": [ 4071 // "project", 4072 // "deployment" 4073 // ], 4074 // "parameters": { 4075 // "createPolicy": { 4076 // "default": "CREATE_OR_ACQUIRE", 4077 // "description": "Sets the policy to use for creating new resources.", 4078 // "enum": [ 4079 // "CREATE_OR_ACQUIRE", 4080 // "ACQUIRE" 4081 // ], 4082 // "enumDescriptions": [ 4083 // "", 4084 // "" 4085 // ], 4086 // "location": "query", 4087 // "type": "string" 4088 // }, 4089 // "deletePolicy": { 4090 // "default": "DELETE", 4091 // "description": "Sets the policy to use for deleting resources.", 4092 // "enum": [ 4093 // "DELETE", 4094 // "ABANDON" 4095 // ], 4096 // "enumDescriptions": [ 4097 // "", 4098 // "" 4099 // ], 4100 // "location": "query", 4101 // "type": "string" 4102 // }, 4103 // "deployment": { 4104 // "description": "The name of the deployment for this request.", 4105 // "location": "path", 4106 // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", 4107 // "required": true, 4108 // "type": "string" 4109 // }, 4110 // "preview": { 4111 // "default": "false", 4112 // "description": "If set to true, updates the deployment and creates and updates the \"shell\" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a `target.config` with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the `update()` or you can `cancelPreview()` to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.", 4113 // "location": "query", 4114 // "type": "boolean" 4115 // }, 4116 // "project": { 4117 // "description": "The project ID for this request.", 4118 // "location": "path", 4119 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", 4120 // "required": true, 4121 // "type": "string" 4122 // } 4123 // }, 4124 // "path": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}", 4125 // "request": { 4126 // "$ref": "Deployment" 4127 // }, 4128 // "response": { 4129 // "$ref": "Operation" 4130 // }, 4131 // "scopes": [ 4132 // "https://www.googleapis.com/auth/cloud-platform", 4133 // "https://www.googleapis.com/auth/ndev.cloudman" 4134 // ] 4135 // } 4136 4137} 4138 4139// method id "deploymentmanager.manifests.get": 4140 4141type ManifestsGetCall struct { 4142 s *Service 4143 project string 4144 deployment string 4145 manifest string 4146 urlParams_ gensupport.URLParams 4147 ifNoneMatch_ string 4148 ctx_ context.Context 4149 header_ http.Header 4150} 4151 4152// Get: Gets information about a specific manifest. 4153// 4154// - deployment: The name of the deployment for this request. 4155// - manifest: The name of the manifest for this request. 4156// - project: The project ID for this request. 4157func (r *ManifestsService) Get(project string, deployment string, manifest string) *ManifestsGetCall { 4158 c := &ManifestsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4159 c.project = project 4160 c.deployment = deployment 4161 c.manifest = manifest 4162 return c 4163} 4164 4165// Fields allows partial responses to be retrieved. See 4166// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4167// for more information. 4168func (c *ManifestsGetCall) Fields(s ...googleapi.Field) *ManifestsGetCall { 4169 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4170 return c 4171} 4172 4173// IfNoneMatch sets the optional parameter which makes the operation 4174// fail if the object's ETag matches the given value. This is useful for 4175// getting updates only after the object has changed since the last 4176// request. Use googleapi.IsNotModified to check whether the response 4177// error from Do is the result of In-None-Match. 4178func (c *ManifestsGetCall) IfNoneMatch(entityTag string) *ManifestsGetCall { 4179 c.ifNoneMatch_ = entityTag 4180 return c 4181} 4182 4183// Context sets the context to be used in this call's Do method. Any 4184// pending HTTP request will be aborted if the provided context is 4185// canceled. 4186func (c *ManifestsGetCall) Context(ctx context.Context) *ManifestsGetCall { 4187 c.ctx_ = ctx 4188 return c 4189} 4190 4191// Header returns an http.Header that can be modified by the caller to 4192// add HTTP headers to the request. 4193func (c *ManifestsGetCall) Header() http.Header { 4194 if c.header_ == nil { 4195 c.header_ = make(http.Header) 4196 } 4197 return c.header_ 4198} 4199 4200func (c *ManifestsGetCall) doRequest(alt string) (*http.Response, error) { 4201 reqHeaders := make(http.Header) 4202 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 4203 for k, v := range c.header_ { 4204 reqHeaders[k] = v 4205 } 4206 reqHeaders.Set("User-Agent", c.s.userAgent()) 4207 if c.ifNoneMatch_ != "" { 4208 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4209 } 4210 var body io.Reader = nil 4211 c.urlParams_.Set("alt", alt) 4212 c.urlParams_.Set("prettyPrint", "false") 4213 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests/{manifest}") 4214 urls += "?" + c.urlParams_.Encode() 4215 req, err := http.NewRequest("GET", urls, body) 4216 if err != nil { 4217 return nil, err 4218 } 4219 req.Header = reqHeaders 4220 googleapi.Expand(req.URL, map[string]string{ 4221 "project": c.project, 4222 "deployment": c.deployment, 4223 "manifest": c.manifest, 4224 }) 4225 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4226} 4227 4228// Do executes the "deploymentmanager.manifests.get" call. 4229// Exactly one of *Manifest or error will be non-nil. Any non-2xx status 4230// code is an error. Response headers are in either 4231// *Manifest.ServerResponse.Header or (if a response was returned at 4232// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4233// to check whether the returned error was because 4234// http.StatusNotModified was returned. 4235func (c *ManifestsGetCall) Do(opts ...googleapi.CallOption) (*Manifest, error) { 4236 gensupport.SetOptions(c.urlParams_, opts...) 4237 res, err := c.doRequest("json") 4238 if res != nil && res.StatusCode == http.StatusNotModified { 4239 if res.Body != nil { 4240 res.Body.Close() 4241 } 4242 return nil, &googleapi.Error{ 4243 Code: res.StatusCode, 4244 Header: res.Header, 4245 } 4246 } 4247 if err != nil { 4248 return nil, err 4249 } 4250 defer googleapi.CloseBody(res) 4251 if err := googleapi.CheckResponse(res); err != nil { 4252 return nil, err 4253 } 4254 ret := &Manifest{ 4255 ServerResponse: googleapi.ServerResponse{ 4256 Header: res.Header, 4257 HTTPStatusCode: res.StatusCode, 4258 }, 4259 } 4260 target := &ret 4261 if err := gensupport.DecodeResponse(target, res); err != nil { 4262 return nil, err 4263 } 4264 return ret, nil 4265 // { 4266 // "description": "Gets information about a specific manifest.", 4267 // "flatPath": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests/{manifest}", 4268 // "httpMethod": "GET", 4269 // "id": "deploymentmanager.manifests.get", 4270 // "parameterOrder": [ 4271 // "project", 4272 // "deployment", 4273 // "manifest" 4274 // ], 4275 // "parameters": { 4276 // "deployment": { 4277 // "description": "The name of the deployment for this request.", 4278 // "location": "path", 4279 // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", 4280 // "required": true, 4281 // "type": "string" 4282 // }, 4283 // "manifest": { 4284 // "description": "The name of the manifest for this request.", 4285 // "location": "path", 4286 // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", 4287 // "required": true, 4288 // "type": "string" 4289 // }, 4290 // "project": { 4291 // "description": "The project ID for this request.", 4292 // "location": "path", 4293 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", 4294 // "required": true, 4295 // "type": "string" 4296 // } 4297 // }, 4298 // "path": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests/{manifest}", 4299 // "response": { 4300 // "$ref": "Manifest" 4301 // }, 4302 // "scopes": [ 4303 // "https://www.googleapis.com/auth/cloud-platform", 4304 // "https://www.googleapis.com/auth/cloud-platform.read-only", 4305 // "https://www.googleapis.com/auth/ndev.cloudman", 4306 // "https://www.googleapis.com/auth/ndev.cloudman.readonly" 4307 // ] 4308 // } 4309 4310} 4311 4312// method id "deploymentmanager.manifests.list": 4313 4314type ManifestsListCall struct { 4315 s *Service 4316 project string 4317 deployment string 4318 urlParams_ gensupport.URLParams 4319 ifNoneMatch_ string 4320 ctx_ context.Context 4321 header_ http.Header 4322} 4323 4324// List: Lists all manifests for a given deployment. 4325// 4326// - deployment: The name of the deployment for this request. 4327// - project: The project ID for this request. 4328func (r *ManifestsService) List(project string, deployment string) *ManifestsListCall { 4329 c := &ManifestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4330 c.project = project 4331 c.deployment = deployment 4332 return c 4333} 4334 4335// Filter sets the optional parameter "filter": A filter expression that 4336// filters resources listed in the response. The expression must specify 4337// the field name, a comparison operator, and the value that you want to 4338// use for filtering. The value must be a string, a number, or a 4339// boolean. The comparison operator must be either `=`, `!=`, `>`, or 4340// `<`. For example, if you are filtering Compute Engine instances, you 4341// can exclude instances named `example-instance` by specifying `name != 4342// example-instance`. You can also filter nested fields. For example, 4343// you could specify `scheduling.automaticRestart = false` to include 4344// instances only if they are not scheduled for automatic restarts. You 4345// can use filtering on nested fields to filter based on resource 4346// labels. To filter on multiple expressions, provide each separate 4347// expression within parentheses. For example: ``` 4348// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") 4349// ``` By default, each expression is an `AND` expression. However, you 4350// can include `AND` and `OR` expressions explicitly. For example: ``` 4351// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") 4352// AND (scheduling.automaticRestart = true) ``` 4353func (c *ManifestsListCall) Filter(filter string) *ManifestsListCall { 4354 c.urlParams_.Set("filter", filter) 4355 return c 4356} 4357 4358// MaxResults sets the optional parameter "maxResults": The maximum 4359// number of results per page that should be returned. If the number of 4360// available results is larger than `maxResults`, Compute Engine returns 4361// a `nextPageToken` that can be used to get the next page of results in 4362// subsequent list requests. Acceptable values are `0` to `500`, 4363// inclusive. (Default: `500`) 4364func (c *ManifestsListCall) MaxResults(maxResults int64) *ManifestsListCall { 4365 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 4366 return c 4367} 4368 4369// OrderBy sets the optional parameter "orderBy": Sorts list results by 4370// a certain order. By default, results are returned in alphanumerical 4371// order based on the resource name. You can also sort results in 4372// descending order based on the creation timestamp using 4373// `orderBy="creationTimestamp desc". This sorts results based on the 4374// `creationTimestamp` field in reverse chronological order (newest 4375// result first). Use this to sort resources like operations so that the 4376// newest operation is returned first. Currently, only sorting by `name` 4377// or `creationTimestamp desc` is supported. 4378func (c *ManifestsListCall) OrderBy(orderBy string) *ManifestsListCall { 4379 c.urlParams_.Set("orderBy", orderBy) 4380 return c 4381} 4382 4383// PageToken sets the optional parameter "pageToken": Specifies a page 4384// token to use. Set `pageToken` to the `nextPageToken` returned by a 4385// previous list request to get the next page of results. 4386func (c *ManifestsListCall) PageToken(pageToken string) *ManifestsListCall { 4387 c.urlParams_.Set("pageToken", pageToken) 4388 return c 4389} 4390 4391// Fields allows partial responses to be retrieved. See 4392// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4393// for more information. 4394func (c *ManifestsListCall) Fields(s ...googleapi.Field) *ManifestsListCall { 4395 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4396 return c 4397} 4398 4399// IfNoneMatch sets the optional parameter which makes the operation 4400// fail if the object's ETag matches the given value. This is useful for 4401// getting updates only after the object has changed since the last 4402// request. Use googleapi.IsNotModified to check whether the response 4403// error from Do is the result of In-None-Match. 4404func (c *ManifestsListCall) IfNoneMatch(entityTag string) *ManifestsListCall { 4405 c.ifNoneMatch_ = entityTag 4406 return c 4407} 4408 4409// Context sets the context to be used in this call's Do method. Any 4410// pending HTTP request will be aborted if the provided context is 4411// canceled. 4412func (c *ManifestsListCall) Context(ctx context.Context) *ManifestsListCall { 4413 c.ctx_ = ctx 4414 return c 4415} 4416 4417// Header returns an http.Header that can be modified by the caller to 4418// add HTTP headers to the request. 4419func (c *ManifestsListCall) Header() http.Header { 4420 if c.header_ == nil { 4421 c.header_ = make(http.Header) 4422 } 4423 return c.header_ 4424} 4425 4426func (c *ManifestsListCall) doRequest(alt string) (*http.Response, error) { 4427 reqHeaders := make(http.Header) 4428 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 4429 for k, v := range c.header_ { 4430 reqHeaders[k] = v 4431 } 4432 reqHeaders.Set("User-Agent", c.s.userAgent()) 4433 if c.ifNoneMatch_ != "" { 4434 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4435 } 4436 var body io.Reader = nil 4437 c.urlParams_.Set("alt", alt) 4438 c.urlParams_.Set("prettyPrint", "false") 4439 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests") 4440 urls += "?" + c.urlParams_.Encode() 4441 req, err := http.NewRequest("GET", urls, body) 4442 if err != nil { 4443 return nil, err 4444 } 4445 req.Header = reqHeaders 4446 googleapi.Expand(req.URL, map[string]string{ 4447 "project": c.project, 4448 "deployment": c.deployment, 4449 }) 4450 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4451} 4452 4453// Do executes the "deploymentmanager.manifests.list" call. 4454// Exactly one of *ManifestsListResponse or error will be non-nil. Any 4455// non-2xx status code is an error. Response headers are in either 4456// *ManifestsListResponse.ServerResponse.Header or (if a response was 4457// returned at all) in error.(*googleapi.Error).Header. Use 4458// googleapi.IsNotModified to check whether the returned error was 4459// because http.StatusNotModified was returned. 4460func (c *ManifestsListCall) Do(opts ...googleapi.CallOption) (*ManifestsListResponse, error) { 4461 gensupport.SetOptions(c.urlParams_, opts...) 4462 res, err := c.doRequest("json") 4463 if res != nil && res.StatusCode == http.StatusNotModified { 4464 if res.Body != nil { 4465 res.Body.Close() 4466 } 4467 return nil, &googleapi.Error{ 4468 Code: res.StatusCode, 4469 Header: res.Header, 4470 } 4471 } 4472 if err != nil { 4473 return nil, err 4474 } 4475 defer googleapi.CloseBody(res) 4476 if err := googleapi.CheckResponse(res); err != nil { 4477 return nil, err 4478 } 4479 ret := &ManifestsListResponse{ 4480 ServerResponse: googleapi.ServerResponse{ 4481 Header: res.Header, 4482 HTTPStatusCode: res.StatusCode, 4483 }, 4484 } 4485 target := &ret 4486 if err := gensupport.DecodeResponse(target, res); err != nil { 4487 return nil, err 4488 } 4489 return ret, nil 4490 // { 4491 // "description": "Lists all manifests for a given deployment.", 4492 // "flatPath": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests", 4493 // "httpMethod": "GET", 4494 // "id": "deploymentmanager.manifests.list", 4495 // "parameterOrder": [ 4496 // "project", 4497 // "deployment" 4498 // ], 4499 // "parameters": { 4500 // "deployment": { 4501 // "description": "The name of the deployment for this request.", 4502 // "location": "path", 4503 // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", 4504 // "required": true, 4505 // "type": "string" 4506 // }, 4507 // "filter": { 4508 // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `\u003e`, or `\u003c`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ```", 4509 // "location": "query", 4510 // "type": "string" 4511 // }, 4512 // "maxResults": { 4513 // "default": "500", 4514 // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)", 4515 // "format": "uint32", 4516 // "location": "query", 4517 // "minimum": "0", 4518 // "type": "integer" 4519 // }, 4520 // "orderBy": { 4521 // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.", 4522 // "location": "query", 4523 // "type": "string" 4524 // }, 4525 // "pageToken": { 4526 // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.", 4527 // "location": "query", 4528 // "type": "string" 4529 // }, 4530 // "project": { 4531 // "description": "The project ID for this request.", 4532 // "location": "path", 4533 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", 4534 // "required": true, 4535 // "type": "string" 4536 // } 4537 // }, 4538 // "path": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests", 4539 // "response": { 4540 // "$ref": "ManifestsListResponse" 4541 // }, 4542 // "scopes": [ 4543 // "https://www.googleapis.com/auth/cloud-platform", 4544 // "https://www.googleapis.com/auth/cloud-platform.read-only", 4545 // "https://www.googleapis.com/auth/ndev.cloudman", 4546 // "https://www.googleapis.com/auth/ndev.cloudman.readonly" 4547 // ] 4548 // } 4549 4550} 4551 4552// Pages invokes f for each page of results. 4553// A non-nil error returned from f will halt the iteration. 4554// The provided context supersedes any context provided to the Context method. 4555func (c *ManifestsListCall) Pages(ctx context.Context, f func(*ManifestsListResponse) error) error { 4556 c.ctx_ = ctx 4557 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4558 for { 4559 x, err := c.Do() 4560 if err != nil { 4561 return err 4562 } 4563 if err := f(x); err != nil { 4564 return err 4565 } 4566 if x.NextPageToken == "" { 4567 return nil 4568 } 4569 c.PageToken(x.NextPageToken) 4570 } 4571} 4572 4573// method id "deploymentmanager.operations.get": 4574 4575type OperationsGetCall struct { 4576 s *Service 4577 project string 4578 operation string 4579 urlParams_ gensupport.URLParams 4580 ifNoneMatch_ string 4581 ctx_ context.Context 4582 header_ http.Header 4583} 4584 4585// Get: Gets information about a specific operation. 4586// 4587// - operation: The name of the operation for this request. 4588// - project: The project ID for this request. 4589func (r *OperationsService) Get(project string, operation string) *OperationsGetCall { 4590 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4591 c.project = project 4592 c.operation = operation 4593 return c 4594} 4595 4596// Fields allows partial responses to be retrieved. See 4597// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4598// for more information. 4599func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 4600 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4601 return c 4602} 4603 4604// IfNoneMatch sets the optional parameter which makes the operation 4605// fail if the object's ETag matches the given value. This is useful for 4606// getting updates only after the object has changed since the last 4607// request. Use googleapi.IsNotModified to check whether the response 4608// error from Do is the result of In-None-Match. 4609func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 4610 c.ifNoneMatch_ = entityTag 4611 return c 4612} 4613 4614// Context sets the context to be used in this call's Do method. Any 4615// pending HTTP request will be aborted if the provided context is 4616// canceled. 4617func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 4618 c.ctx_ = ctx 4619 return c 4620} 4621 4622// Header returns an http.Header that can be modified by the caller to 4623// add HTTP headers to the request. 4624func (c *OperationsGetCall) Header() http.Header { 4625 if c.header_ == nil { 4626 c.header_ = make(http.Header) 4627 } 4628 return c.header_ 4629} 4630 4631func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 4632 reqHeaders := make(http.Header) 4633 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 4634 for k, v := range c.header_ { 4635 reqHeaders[k] = v 4636 } 4637 reqHeaders.Set("User-Agent", c.s.userAgent()) 4638 if c.ifNoneMatch_ != "" { 4639 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4640 } 4641 var body io.Reader = nil 4642 c.urlParams_.Set("alt", alt) 4643 c.urlParams_.Set("prettyPrint", "false") 4644 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/operations/{operation}") 4645 urls += "?" + c.urlParams_.Encode() 4646 req, err := http.NewRequest("GET", urls, body) 4647 if err != nil { 4648 return nil, err 4649 } 4650 req.Header = reqHeaders 4651 googleapi.Expand(req.URL, map[string]string{ 4652 "project": c.project, 4653 "operation": c.operation, 4654 }) 4655 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4656} 4657 4658// Do executes the "deploymentmanager.operations.get" call. 4659// Exactly one of *Operation or error will be non-nil. Any non-2xx 4660// status code is an error. Response headers are in either 4661// *Operation.ServerResponse.Header or (if a response was returned at 4662// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4663// to check whether the returned error was because 4664// http.StatusNotModified was returned. 4665func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4666 gensupport.SetOptions(c.urlParams_, opts...) 4667 res, err := c.doRequest("json") 4668 if res != nil && res.StatusCode == http.StatusNotModified { 4669 if res.Body != nil { 4670 res.Body.Close() 4671 } 4672 return nil, &googleapi.Error{ 4673 Code: res.StatusCode, 4674 Header: res.Header, 4675 } 4676 } 4677 if err != nil { 4678 return nil, err 4679 } 4680 defer googleapi.CloseBody(res) 4681 if err := googleapi.CheckResponse(res); err != nil { 4682 return nil, err 4683 } 4684 ret := &Operation{ 4685 ServerResponse: googleapi.ServerResponse{ 4686 Header: res.Header, 4687 HTTPStatusCode: res.StatusCode, 4688 }, 4689 } 4690 target := &ret 4691 if err := gensupport.DecodeResponse(target, res); err != nil { 4692 return nil, err 4693 } 4694 return ret, nil 4695 // { 4696 // "description": "Gets information about a specific operation.", 4697 // "flatPath": "deploymentmanager/v2/projects/{project}/global/operations/{operation}", 4698 // "httpMethod": "GET", 4699 // "id": "deploymentmanager.operations.get", 4700 // "parameterOrder": [ 4701 // "project", 4702 // "operation" 4703 // ], 4704 // "parameters": { 4705 // "operation": { 4706 // "description": "The name of the operation for this request.", 4707 // "location": "path", 4708 // "required": true, 4709 // "type": "string" 4710 // }, 4711 // "project": { 4712 // "description": "The project ID for this request.", 4713 // "location": "path", 4714 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", 4715 // "required": true, 4716 // "type": "string" 4717 // } 4718 // }, 4719 // "path": "deploymentmanager/v2/projects/{project}/global/operations/{operation}", 4720 // "response": { 4721 // "$ref": "Operation" 4722 // }, 4723 // "scopes": [ 4724 // "https://www.googleapis.com/auth/cloud-platform", 4725 // "https://www.googleapis.com/auth/cloud-platform.read-only", 4726 // "https://www.googleapis.com/auth/ndev.cloudman", 4727 // "https://www.googleapis.com/auth/ndev.cloudman.readonly" 4728 // ] 4729 // } 4730 4731} 4732 4733// method id "deploymentmanager.operations.list": 4734 4735type OperationsListCall struct { 4736 s *Service 4737 project string 4738 urlParams_ gensupport.URLParams 4739 ifNoneMatch_ string 4740 ctx_ context.Context 4741 header_ http.Header 4742} 4743 4744// List: Lists all operations for a project. 4745// 4746// - project: The project ID for this request. 4747func (r *OperationsService) List(project string) *OperationsListCall { 4748 c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4749 c.project = project 4750 return c 4751} 4752 4753// Filter sets the optional parameter "filter": A filter expression that 4754// filters resources listed in the response. The expression must specify 4755// the field name, a comparison operator, and the value that you want to 4756// use for filtering. The value must be a string, a number, or a 4757// boolean. The comparison operator must be either `=`, `!=`, `>`, or 4758// `<`. For example, if you are filtering Compute Engine instances, you 4759// can exclude instances named `example-instance` by specifying `name != 4760// example-instance`. You can also filter nested fields. For example, 4761// you could specify `scheduling.automaticRestart = false` to include 4762// instances only if they are not scheduled for automatic restarts. You 4763// can use filtering on nested fields to filter based on resource 4764// labels. To filter on multiple expressions, provide each separate 4765// expression within parentheses. For example: ``` 4766// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") 4767// ``` By default, each expression is an `AND` expression. However, you 4768// can include `AND` and `OR` expressions explicitly. For example: ``` 4769// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") 4770// AND (scheduling.automaticRestart = true) ``` 4771func (c *OperationsListCall) Filter(filter string) *OperationsListCall { 4772 c.urlParams_.Set("filter", filter) 4773 return c 4774} 4775 4776// MaxResults sets the optional parameter "maxResults": The maximum 4777// number of results per page that should be returned. If the number of 4778// available results is larger than `maxResults`, Compute Engine returns 4779// a `nextPageToken` that can be used to get the next page of results in 4780// subsequent list requests. Acceptable values are `0` to `500`, 4781// inclusive. (Default: `500`) 4782func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall { 4783 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 4784 return c 4785} 4786 4787// OrderBy sets the optional parameter "orderBy": Sorts list results by 4788// a certain order. By default, results are returned in alphanumerical 4789// order based on the resource name. You can also sort results in 4790// descending order based on the creation timestamp using 4791// `orderBy="creationTimestamp desc". This sorts results based on the 4792// `creationTimestamp` field in reverse chronological order (newest 4793// result first). Use this to sort resources like operations so that the 4794// newest operation is returned first. Currently, only sorting by `name` 4795// or `creationTimestamp desc` is supported. 4796func (c *OperationsListCall) OrderBy(orderBy string) *OperationsListCall { 4797 c.urlParams_.Set("orderBy", orderBy) 4798 return c 4799} 4800 4801// PageToken sets the optional parameter "pageToken": Specifies a page 4802// token to use. Set `pageToken` to the `nextPageToken` returned by a 4803// previous list request to get the next page of results. 4804func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { 4805 c.urlParams_.Set("pageToken", pageToken) 4806 return c 4807} 4808 4809// Fields allows partial responses to be retrieved. See 4810// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4811// for more information. 4812func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { 4813 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4814 return c 4815} 4816 4817// IfNoneMatch sets the optional parameter which makes the operation 4818// fail if the object's ETag matches the given value. This is useful for 4819// getting updates only after the object has changed since the last 4820// request. Use googleapi.IsNotModified to check whether the response 4821// error from Do is the result of In-None-Match. 4822func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { 4823 c.ifNoneMatch_ = entityTag 4824 return c 4825} 4826 4827// Context sets the context to be used in this call's Do method. Any 4828// pending HTTP request will be aborted if the provided context is 4829// canceled. 4830func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { 4831 c.ctx_ = ctx 4832 return c 4833} 4834 4835// Header returns an http.Header that can be modified by the caller to 4836// add HTTP headers to the request. 4837func (c *OperationsListCall) Header() http.Header { 4838 if c.header_ == nil { 4839 c.header_ = make(http.Header) 4840 } 4841 return c.header_ 4842} 4843 4844func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { 4845 reqHeaders := make(http.Header) 4846 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 4847 for k, v := range c.header_ { 4848 reqHeaders[k] = v 4849 } 4850 reqHeaders.Set("User-Agent", c.s.userAgent()) 4851 if c.ifNoneMatch_ != "" { 4852 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4853 } 4854 var body io.Reader = nil 4855 c.urlParams_.Set("alt", alt) 4856 c.urlParams_.Set("prettyPrint", "false") 4857 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/operations") 4858 urls += "?" + c.urlParams_.Encode() 4859 req, err := http.NewRequest("GET", urls, body) 4860 if err != nil { 4861 return nil, err 4862 } 4863 req.Header = reqHeaders 4864 googleapi.Expand(req.URL, map[string]string{ 4865 "project": c.project, 4866 }) 4867 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4868} 4869 4870// Do executes the "deploymentmanager.operations.list" call. 4871// Exactly one of *OperationsListResponse or error will be non-nil. Any 4872// non-2xx status code is an error. Response headers are in either 4873// *OperationsListResponse.ServerResponse.Header or (if a response was 4874// returned at all) in error.(*googleapi.Error).Header. Use 4875// googleapi.IsNotModified to check whether the returned error was 4876// because http.StatusNotModified was returned. 4877func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*OperationsListResponse, error) { 4878 gensupport.SetOptions(c.urlParams_, opts...) 4879 res, err := c.doRequest("json") 4880 if res != nil && res.StatusCode == http.StatusNotModified { 4881 if res.Body != nil { 4882 res.Body.Close() 4883 } 4884 return nil, &googleapi.Error{ 4885 Code: res.StatusCode, 4886 Header: res.Header, 4887 } 4888 } 4889 if err != nil { 4890 return nil, err 4891 } 4892 defer googleapi.CloseBody(res) 4893 if err := googleapi.CheckResponse(res); err != nil { 4894 return nil, err 4895 } 4896 ret := &OperationsListResponse{ 4897 ServerResponse: googleapi.ServerResponse{ 4898 Header: res.Header, 4899 HTTPStatusCode: res.StatusCode, 4900 }, 4901 } 4902 target := &ret 4903 if err := gensupport.DecodeResponse(target, res); err != nil { 4904 return nil, err 4905 } 4906 return ret, nil 4907 // { 4908 // "description": "Lists all operations for a project.", 4909 // "flatPath": "deploymentmanager/v2/projects/{project}/global/operations", 4910 // "httpMethod": "GET", 4911 // "id": "deploymentmanager.operations.list", 4912 // "parameterOrder": [ 4913 // "project" 4914 // ], 4915 // "parameters": { 4916 // "filter": { 4917 // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `\u003e`, or `\u003c`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ```", 4918 // "location": "query", 4919 // "type": "string" 4920 // }, 4921 // "maxResults": { 4922 // "default": "500", 4923 // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)", 4924 // "format": "uint32", 4925 // "location": "query", 4926 // "minimum": "0", 4927 // "type": "integer" 4928 // }, 4929 // "orderBy": { 4930 // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.", 4931 // "location": "query", 4932 // "type": "string" 4933 // }, 4934 // "pageToken": { 4935 // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.", 4936 // "location": "query", 4937 // "type": "string" 4938 // }, 4939 // "project": { 4940 // "description": "The project ID for this request.", 4941 // "location": "path", 4942 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", 4943 // "required": true, 4944 // "type": "string" 4945 // } 4946 // }, 4947 // "path": "deploymentmanager/v2/projects/{project}/global/operations", 4948 // "response": { 4949 // "$ref": "OperationsListResponse" 4950 // }, 4951 // "scopes": [ 4952 // "https://www.googleapis.com/auth/cloud-platform", 4953 // "https://www.googleapis.com/auth/cloud-platform.read-only", 4954 // "https://www.googleapis.com/auth/ndev.cloudman", 4955 // "https://www.googleapis.com/auth/ndev.cloudman.readonly" 4956 // ] 4957 // } 4958 4959} 4960 4961// Pages invokes f for each page of results. 4962// A non-nil error returned from f will halt the iteration. 4963// The provided context supersedes any context provided to the Context method. 4964func (c *OperationsListCall) Pages(ctx context.Context, f func(*OperationsListResponse) error) error { 4965 c.ctx_ = ctx 4966 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4967 for { 4968 x, err := c.Do() 4969 if err != nil { 4970 return err 4971 } 4972 if err := f(x); err != nil { 4973 return err 4974 } 4975 if x.NextPageToken == "" { 4976 return nil 4977 } 4978 c.PageToken(x.NextPageToken) 4979 } 4980} 4981 4982// method id "deploymentmanager.resources.get": 4983 4984type ResourcesGetCall struct { 4985 s *Service 4986 project string 4987 deployment string 4988 resource string 4989 urlParams_ gensupport.URLParams 4990 ifNoneMatch_ string 4991 ctx_ context.Context 4992 header_ http.Header 4993} 4994 4995// Get: Gets information about a single resource. 4996// 4997// - deployment: The name of the deployment for this request. 4998// - project: The project ID for this request. 4999// - resource: The name of the resource for this request. 5000func (r *ResourcesService) Get(project string, deployment string, resource string) *ResourcesGetCall { 5001 c := &ResourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5002 c.project = project 5003 c.deployment = deployment 5004 c.resource = resource 5005 return c 5006} 5007 5008// Fields allows partial responses to be retrieved. See 5009// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5010// for more information. 5011func (c *ResourcesGetCall) Fields(s ...googleapi.Field) *ResourcesGetCall { 5012 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5013 return c 5014} 5015 5016// IfNoneMatch sets the optional parameter which makes the operation 5017// fail if the object's ETag matches the given value. This is useful for 5018// getting updates only after the object has changed since the last 5019// request. Use googleapi.IsNotModified to check whether the response 5020// error from Do is the result of In-None-Match. 5021func (c *ResourcesGetCall) IfNoneMatch(entityTag string) *ResourcesGetCall { 5022 c.ifNoneMatch_ = entityTag 5023 return c 5024} 5025 5026// Context sets the context to be used in this call's Do method. Any 5027// pending HTTP request will be aborted if the provided context is 5028// canceled. 5029func (c *ResourcesGetCall) Context(ctx context.Context) *ResourcesGetCall { 5030 c.ctx_ = ctx 5031 return c 5032} 5033 5034// Header returns an http.Header that can be modified by the caller to 5035// add HTTP headers to the request. 5036func (c *ResourcesGetCall) Header() http.Header { 5037 if c.header_ == nil { 5038 c.header_ = make(http.Header) 5039 } 5040 return c.header_ 5041} 5042 5043func (c *ResourcesGetCall) doRequest(alt string) (*http.Response, error) { 5044 reqHeaders := make(http.Header) 5045 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 5046 for k, v := range c.header_ { 5047 reqHeaders[k] = v 5048 } 5049 reqHeaders.Set("User-Agent", c.s.userAgent()) 5050 if c.ifNoneMatch_ != "" { 5051 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5052 } 5053 var body io.Reader = nil 5054 c.urlParams_.Set("alt", alt) 5055 c.urlParams_.Set("prettyPrint", "false") 5056 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources/{resource}") 5057 urls += "?" + c.urlParams_.Encode() 5058 req, err := http.NewRequest("GET", urls, body) 5059 if err != nil { 5060 return nil, err 5061 } 5062 req.Header = reqHeaders 5063 googleapi.Expand(req.URL, map[string]string{ 5064 "project": c.project, 5065 "deployment": c.deployment, 5066 "resource": c.resource, 5067 }) 5068 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5069} 5070 5071// Do executes the "deploymentmanager.resources.get" call. 5072// Exactly one of *Resource or error will be non-nil. Any non-2xx status 5073// code is an error. Response headers are in either 5074// *Resource.ServerResponse.Header or (if a response was returned at 5075// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5076// to check whether the returned error was because 5077// http.StatusNotModified was returned. 5078func (c *ResourcesGetCall) Do(opts ...googleapi.CallOption) (*Resource, error) { 5079 gensupport.SetOptions(c.urlParams_, opts...) 5080 res, err := c.doRequest("json") 5081 if res != nil && res.StatusCode == http.StatusNotModified { 5082 if res.Body != nil { 5083 res.Body.Close() 5084 } 5085 return nil, &googleapi.Error{ 5086 Code: res.StatusCode, 5087 Header: res.Header, 5088 } 5089 } 5090 if err != nil { 5091 return nil, err 5092 } 5093 defer googleapi.CloseBody(res) 5094 if err := googleapi.CheckResponse(res); err != nil { 5095 return nil, err 5096 } 5097 ret := &Resource{ 5098 ServerResponse: googleapi.ServerResponse{ 5099 Header: res.Header, 5100 HTTPStatusCode: res.StatusCode, 5101 }, 5102 } 5103 target := &ret 5104 if err := gensupport.DecodeResponse(target, res); err != nil { 5105 return nil, err 5106 } 5107 return ret, nil 5108 // { 5109 // "description": "Gets information about a single resource.", 5110 // "flatPath": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources/{resource}", 5111 // "httpMethod": "GET", 5112 // "id": "deploymentmanager.resources.get", 5113 // "parameterOrder": [ 5114 // "project", 5115 // "deployment", 5116 // "resource" 5117 // ], 5118 // "parameters": { 5119 // "deployment": { 5120 // "description": "The name of the deployment for this request.", 5121 // "location": "path", 5122 // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", 5123 // "required": true, 5124 // "type": "string" 5125 // }, 5126 // "project": { 5127 // "description": "The project ID for this request.", 5128 // "location": "path", 5129 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", 5130 // "required": true, 5131 // "type": "string" 5132 // }, 5133 // "resource": { 5134 // "description": "The name of the resource for this request.", 5135 // "location": "path", 5136 // "required": true, 5137 // "type": "string" 5138 // } 5139 // }, 5140 // "path": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources/{resource}", 5141 // "response": { 5142 // "$ref": "Resource" 5143 // }, 5144 // "scopes": [ 5145 // "https://www.googleapis.com/auth/cloud-platform", 5146 // "https://www.googleapis.com/auth/cloud-platform.read-only", 5147 // "https://www.googleapis.com/auth/ndev.cloudman", 5148 // "https://www.googleapis.com/auth/ndev.cloudman.readonly" 5149 // ] 5150 // } 5151 5152} 5153 5154// method id "deploymentmanager.resources.list": 5155 5156type ResourcesListCall struct { 5157 s *Service 5158 project string 5159 deployment string 5160 urlParams_ gensupport.URLParams 5161 ifNoneMatch_ string 5162 ctx_ context.Context 5163 header_ http.Header 5164} 5165 5166// List: Lists all resources in a given deployment. 5167// 5168// - deployment: The name of the deployment for this request. 5169// - project: The project ID for this request. 5170func (r *ResourcesService) List(project string, deployment string) *ResourcesListCall { 5171 c := &ResourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5172 c.project = project 5173 c.deployment = deployment 5174 return c 5175} 5176 5177// Filter sets the optional parameter "filter": A filter expression that 5178// filters resources listed in the response. The expression must specify 5179// the field name, a comparison operator, and the value that you want to 5180// use for filtering. The value must be a string, a number, or a 5181// boolean. The comparison operator must be either `=`, `!=`, `>`, or 5182// `<`. For example, if you are filtering Compute Engine instances, you 5183// can exclude instances named `example-instance` by specifying `name != 5184// example-instance`. You can also filter nested fields. For example, 5185// you could specify `scheduling.automaticRestart = false` to include 5186// instances only if they are not scheduled for automatic restarts. You 5187// can use filtering on nested fields to filter based on resource 5188// labels. To filter on multiple expressions, provide each separate 5189// expression within parentheses. For example: ``` 5190// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") 5191// ``` By default, each expression is an `AND` expression. However, you 5192// can include `AND` and `OR` expressions explicitly. For example: ``` 5193// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") 5194// AND (scheduling.automaticRestart = true) ``` 5195func (c *ResourcesListCall) Filter(filter string) *ResourcesListCall { 5196 c.urlParams_.Set("filter", filter) 5197 return c 5198} 5199 5200// MaxResults sets the optional parameter "maxResults": The maximum 5201// number of results per page that should be returned. If the number of 5202// available results is larger than `maxResults`, Compute Engine returns 5203// a `nextPageToken` that can be used to get the next page of results in 5204// subsequent list requests. Acceptable values are `0` to `500`, 5205// inclusive. (Default: `500`) 5206func (c *ResourcesListCall) MaxResults(maxResults int64) *ResourcesListCall { 5207 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 5208 return c 5209} 5210 5211// OrderBy sets the optional parameter "orderBy": Sorts list results by 5212// a certain order. By default, results are returned in alphanumerical 5213// order based on the resource name. You can also sort results in 5214// descending order based on the creation timestamp using 5215// `orderBy="creationTimestamp desc". This sorts results based on the 5216// `creationTimestamp` field in reverse chronological order (newest 5217// result first). Use this to sort resources like operations so that the 5218// newest operation is returned first. Currently, only sorting by `name` 5219// or `creationTimestamp desc` is supported. 5220func (c *ResourcesListCall) OrderBy(orderBy string) *ResourcesListCall { 5221 c.urlParams_.Set("orderBy", orderBy) 5222 return c 5223} 5224 5225// PageToken sets the optional parameter "pageToken": Specifies a page 5226// token to use. Set `pageToken` to the `nextPageToken` returned by a 5227// previous list request to get the next page of results. 5228func (c *ResourcesListCall) PageToken(pageToken string) *ResourcesListCall { 5229 c.urlParams_.Set("pageToken", pageToken) 5230 return c 5231} 5232 5233// Fields allows partial responses to be retrieved. See 5234// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5235// for more information. 5236func (c *ResourcesListCall) Fields(s ...googleapi.Field) *ResourcesListCall { 5237 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5238 return c 5239} 5240 5241// IfNoneMatch sets the optional parameter which makes the operation 5242// fail if the object's ETag matches the given value. This is useful for 5243// getting updates only after the object has changed since the last 5244// request. Use googleapi.IsNotModified to check whether the response 5245// error from Do is the result of In-None-Match. 5246func (c *ResourcesListCall) IfNoneMatch(entityTag string) *ResourcesListCall { 5247 c.ifNoneMatch_ = entityTag 5248 return c 5249} 5250 5251// Context sets the context to be used in this call's Do method. Any 5252// pending HTTP request will be aborted if the provided context is 5253// canceled. 5254func (c *ResourcesListCall) Context(ctx context.Context) *ResourcesListCall { 5255 c.ctx_ = ctx 5256 return c 5257} 5258 5259// Header returns an http.Header that can be modified by the caller to 5260// add HTTP headers to the request. 5261func (c *ResourcesListCall) Header() http.Header { 5262 if c.header_ == nil { 5263 c.header_ = make(http.Header) 5264 } 5265 return c.header_ 5266} 5267 5268func (c *ResourcesListCall) doRequest(alt string) (*http.Response, error) { 5269 reqHeaders := make(http.Header) 5270 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 5271 for k, v := range c.header_ { 5272 reqHeaders[k] = v 5273 } 5274 reqHeaders.Set("User-Agent", c.s.userAgent()) 5275 if c.ifNoneMatch_ != "" { 5276 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5277 } 5278 var body io.Reader = nil 5279 c.urlParams_.Set("alt", alt) 5280 c.urlParams_.Set("prettyPrint", "false") 5281 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources") 5282 urls += "?" + c.urlParams_.Encode() 5283 req, err := http.NewRequest("GET", urls, body) 5284 if err != nil { 5285 return nil, err 5286 } 5287 req.Header = reqHeaders 5288 googleapi.Expand(req.URL, map[string]string{ 5289 "project": c.project, 5290 "deployment": c.deployment, 5291 }) 5292 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5293} 5294 5295// Do executes the "deploymentmanager.resources.list" call. 5296// Exactly one of *ResourcesListResponse or error will be non-nil. Any 5297// non-2xx status code is an error. Response headers are in either 5298// *ResourcesListResponse.ServerResponse.Header or (if a response was 5299// returned at all) in error.(*googleapi.Error).Header. Use 5300// googleapi.IsNotModified to check whether the returned error was 5301// because http.StatusNotModified was returned. 5302func (c *ResourcesListCall) Do(opts ...googleapi.CallOption) (*ResourcesListResponse, error) { 5303 gensupport.SetOptions(c.urlParams_, opts...) 5304 res, err := c.doRequest("json") 5305 if res != nil && res.StatusCode == http.StatusNotModified { 5306 if res.Body != nil { 5307 res.Body.Close() 5308 } 5309 return nil, &googleapi.Error{ 5310 Code: res.StatusCode, 5311 Header: res.Header, 5312 } 5313 } 5314 if err != nil { 5315 return nil, err 5316 } 5317 defer googleapi.CloseBody(res) 5318 if err := googleapi.CheckResponse(res); err != nil { 5319 return nil, err 5320 } 5321 ret := &ResourcesListResponse{ 5322 ServerResponse: googleapi.ServerResponse{ 5323 Header: res.Header, 5324 HTTPStatusCode: res.StatusCode, 5325 }, 5326 } 5327 target := &ret 5328 if err := gensupport.DecodeResponse(target, res); err != nil { 5329 return nil, err 5330 } 5331 return ret, nil 5332 // { 5333 // "description": "Lists all resources in a given deployment.", 5334 // "flatPath": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources", 5335 // "httpMethod": "GET", 5336 // "id": "deploymentmanager.resources.list", 5337 // "parameterOrder": [ 5338 // "project", 5339 // "deployment" 5340 // ], 5341 // "parameters": { 5342 // "deployment": { 5343 // "description": "The name of the deployment for this request.", 5344 // "location": "path", 5345 // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?", 5346 // "required": true, 5347 // "type": "string" 5348 // }, 5349 // "filter": { 5350 // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `\u003e`, or `\u003c`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ```", 5351 // "location": "query", 5352 // "type": "string" 5353 // }, 5354 // "maxResults": { 5355 // "default": "500", 5356 // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)", 5357 // "format": "uint32", 5358 // "location": "query", 5359 // "minimum": "0", 5360 // "type": "integer" 5361 // }, 5362 // "orderBy": { 5363 // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.", 5364 // "location": "query", 5365 // "type": "string" 5366 // }, 5367 // "pageToken": { 5368 // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.", 5369 // "location": "query", 5370 // "type": "string" 5371 // }, 5372 // "project": { 5373 // "description": "The project ID for this request.", 5374 // "location": "path", 5375 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", 5376 // "required": true, 5377 // "type": "string" 5378 // } 5379 // }, 5380 // "path": "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources", 5381 // "response": { 5382 // "$ref": "ResourcesListResponse" 5383 // }, 5384 // "scopes": [ 5385 // "https://www.googleapis.com/auth/cloud-platform", 5386 // "https://www.googleapis.com/auth/cloud-platform.read-only", 5387 // "https://www.googleapis.com/auth/ndev.cloudman", 5388 // "https://www.googleapis.com/auth/ndev.cloudman.readonly" 5389 // ] 5390 // } 5391 5392} 5393 5394// Pages invokes f for each page of results. 5395// A non-nil error returned from f will halt the iteration. 5396// The provided context supersedes any context provided to the Context method. 5397func (c *ResourcesListCall) Pages(ctx context.Context, f func(*ResourcesListResponse) error) error { 5398 c.ctx_ = ctx 5399 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5400 for { 5401 x, err := c.Do() 5402 if err != nil { 5403 return err 5404 } 5405 if err := f(x); err != nil { 5406 return err 5407 } 5408 if x.NextPageToken == "" { 5409 return nil 5410 } 5411 c.PageToken(x.NextPageToken) 5412 } 5413} 5414 5415// method id "deploymentmanager.types.list": 5416 5417type TypesListCall struct { 5418 s *Service 5419 project string 5420 urlParams_ gensupport.URLParams 5421 ifNoneMatch_ string 5422 ctx_ context.Context 5423 header_ http.Header 5424} 5425 5426// List: Lists all resource types for Deployment Manager. 5427// 5428// - project: The project ID for this request. 5429func (r *TypesService) List(project string) *TypesListCall { 5430 c := &TypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5431 c.project = project 5432 return c 5433} 5434 5435// Filter sets the optional parameter "filter": A filter expression that 5436// filters resources listed in the response. The expression must specify 5437// the field name, a comparison operator, and the value that you want to 5438// use for filtering. The value must be a string, a number, or a 5439// boolean. The comparison operator must be either `=`, `!=`, `>`, or 5440// `<`. For example, if you are filtering Compute Engine instances, you 5441// can exclude instances named `example-instance` by specifying `name != 5442// example-instance`. You can also filter nested fields. For example, 5443// you could specify `scheduling.automaticRestart = false` to include 5444// instances only if they are not scheduled for automatic restarts. You 5445// can use filtering on nested fields to filter based on resource 5446// labels. To filter on multiple expressions, provide each separate 5447// expression within parentheses. For example: ``` 5448// (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") 5449// ``` By default, each expression is an `AND` expression. However, you 5450// can include `AND` and `OR` expressions explicitly. For example: ``` 5451// (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") 5452// AND (scheduling.automaticRestart = true) ``` 5453func (c *TypesListCall) Filter(filter string) *TypesListCall { 5454 c.urlParams_.Set("filter", filter) 5455 return c 5456} 5457 5458// MaxResults sets the optional parameter "maxResults": The maximum 5459// number of results per page that should be returned. If the number of 5460// available results is larger than `maxResults`, Compute Engine returns 5461// a `nextPageToken` that can be used to get the next page of results in 5462// subsequent list requests. Acceptable values are `0` to `500`, 5463// inclusive. (Default: `500`) 5464func (c *TypesListCall) MaxResults(maxResults int64) *TypesListCall { 5465 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 5466 return c 5467} 5468 5469// OrderBy sets the optional parameter "orderBy": Sorts list results by 5470// a certain order. By default, results are returned in alphanumerical 5471// order based on the resource name. You can also sort results in 5472// descending order based on the creation timestamp using 5473// `orderBy="creationTimestamp desc". This sorts results based on the 5474// `creationTimestamp` field in reverse chronological order (newest 5475// result first). Use this to sort resources like operations so that the 5476// newest operation is returned first. Currently, only sorting by `name` 5477// or `creationTimestamp desc` is supported. 5478func (c *TypesListCall) OrderBy(orderBy string) *TypesListCall { 5479 c.urlParams_.Set("orderBy", orderBy) 5480 return c 5481} 5482 5483// PageToken sets the optional parameter "pageToken": Specifies a page 5484// token to use. Set `pageToken` to the `nextPageToken` returned by a 5485// previous list request to get the next page of results. 5486func (c *TypesListCall) PageToken(pageToken string) *TypesListCall { 5487 c.urlParams_.Set("pageToken", pageToken) 5488 return c 5489} 5490 5491// Fields allows partial responses to be retrieved. See 5492// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5493// for more information. 5494func (c *TypesListCall) Fields(s ...googleapi.Field) *TypesListCall { 5495 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5496 return c 5497} 5498 5499// IfNoneMatch sets the optional parameter which makes the operation 5500// fail if the object's ETag matches the given value. This is useful for 5501// getting updates only after the object has changed since the last 5502// request. Use googleapi.IsNotModified to check whether the response 5503// error from Do is the result of In-None-Match. 5504func (c *TypesListCall) IfNoneMatch(entityTag string) *TypesListCall { 5505 c.ifNoneMatch_ = entityTag 5506 return c 5507} 5508 5509// Context sets the context to be used in this call's Do method. Any 5510// pending HTTP request will be aborted if the provided context is 5511// canceled. 5512func (c *TypesListCall) Context(ctx context.Context) *TypesListCall { 5513 c.ctx_ = ctx 5514 return c 5515} 5516 5517// Header returns an http.Header that can be modified by the caller to 5518// add HTTP headers to the request. 5519func (c *TypesListCall) Header() http.Header { 5520 if c.header_ == nil { 5521 c.header_ = make(http.Header) 5522 } 5523 return c.header_ 5524} 5525 5526func (c *TypesListCall) doRequest(alt string) (*http.Response, error) { 5527 reqHeaders := make(http.Header) 5528 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210629") 5529 for k, v := range c.header_ { 5530 reqHeaders[k] = v 5531 } 5532 reqHeaders.Set("User-Agent", c.s.userAgent()) 5533 if c.ifNoneMatch_ != "" { 5534 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5535 } 5536 var body io.Reader = nil 5537 c.urlParams_.Set("alt", alt) 5538 c.urlParams_.Set("prettyPrint", "false") 5539 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/types") 5540 urls += "?" + c.urlParams_.Encode() 5541 req, err := http.NewRequest("GET", urls, body) 5542 if err != nil { 5543 return nil, err 5544 } 5545 req.Header = reqHeaders 5546 googleapi.Expand(req.URL, map[string]string{ 5547 "project": c.project, 5548 }) 5549 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5550} 5551 5552// Do executes the "deploymentmanager.types.list" call. 5553// Exactly one of *TypesListResponse or error will be non-nil. Any 5554// non-2xx status code is an error. Response headers are in either 5555// *TypesListResponse.ServerResponse.Header or (if a response was 5556// returned at all) in error.(*googleapi.Error).Header. Use 5557// googleapi.IsNotModified to check whether the returned error was 5558// because http.StatusNotModified was returned. 5559func (c *TypesListCall) Do(opts ...googleapi.CallOption) (*TypesListResponse, error) { 5560 gensupport.SetOptions(c.urlParams_, opts...) 5561 res, err := c.doRequest("json") 5562 if res != nil && res.StatusCode == http.StatusNotModified { 5563 if res.Body != nil { 5564 res.Body.Close() 5565 } 5566 return nil, &googleapi.Error{ 5567 Code: res.StatusCode, 5568 Header: res.Header, 5569 } 5570 } 5571 if err != nil { 5572 return nil, err 5573 } 5574 defer googleapi.CloseBody(res) 5575 if err := googleapi.CheckResponse(res); err != nil { 5576 return nil, err 5577 } 5578 ret := &TypesListResponse{ 5579 ServerResponse: googleapi.ServerResponse{ 5580 Header: res.Header, 5581 HTTPStatusCode: res.StatusCode, 5582 }, 5583 } 5584 target := &ret 5585 if err := gensupport.DecodeResponse(target, res); err != nil { 5586 return nil, err 5587 } 5588 return ret, nil 5589 // { 5590 // "description": "Lists all resource types for Deployment Manager.", 5591 // "flatPath": "deploymentmanager/v2/projects/{project}/global/types", 5592 // "httpMethod": "GET", 5593 // "id": "deploymentmanager.types.list", 5594 // "parameterOrder": [ 5595 // "project" 5596 // ], 5597 // "parameters": { 5598 // "filter": { 5599 // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `\u003e`, or `\u003c`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true) ```", 5600 // "location": "query", 5601 // "type": "string" 5602 // }, 5603 // "maxResults": { 5604 // "default": "500", 5605 // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)", 5606 // "format": "uint32", 5607 // "location": "query", 5608 // "minimum": "0", 5609 // "type": "integer" 5610 // }, 5611 // "orderBy": { 5612 // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy=\"creationTimestamp desc\"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.", 5613 // "location": "query", 5614 // "type": "string" 5615 // }, 5616 // "pageToken": { 5617 // "description": "Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.", 5618 // "location": "query", 5619 // "type": "string" 5620 // }, 5621 // "project": { 5622 // "description": "The project ID for this request.", 5623 // "location": "path", 5624 // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))", 5625 // "required": true, 5626 // "type": "string" 5627 // } 5628 // }, 5629 // "path": "deploymentmanager/v2/projects/{project}/global/types", 5630 // "response": { 5631 // "$ref": "TypesListResponse" 5632 // }, 5633 // "scopes": [ 5634 // "https://www.googleapis.com/auth/cloud-platform", 5635 // "https://www.googleapis.com/auth/cloud-platform.read-only", 5636 // "https://www.googleapis.com/auth/ndev.cloudman", 5637 // "https://www.googleapis.com/auth/ndev.cloudman.readonly" 5638 // ] 5639 // } 5640 5641} 5642 5643// Pages invokes f for each page of results. 5644// A non-nil error returned from f will halt the iteration. 5645// The provided context supersedes any context provided to the Context method. 5646func (c *TypesListCall) Pages(ctx context.Context, f func(*TypesListResponse) error) error { 5647 c.ctx_ = ctx 5648 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5649 for { 5650 x, err := c.Do() 5651 if err != nil { 5652 return err 5653 } 5654 if err := f(x); err != nil { 5655 return err 5656 } 5657 if x.NextPageToken == "" { 5658 return nil 5659 } 5660 c.PageToken(x.NextPageToken) 5661 } 5662} 5663