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