1 // Copyright 2024 Google LLC. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Code generated file. DO NOT EDIT. 6 7 // Package deploymentmanager provides access to the Cloud Deployment Manager V2 API. 8 // 9 // For product documentation, see: https://cloud.google.com/deployment-manager 10 // 11 // # Library status 12 // 13 // These client libraries are officially supported by Google. However, this 14 // library is considered complete and is in maintenance mode. This means 15 // that we will address critical bugs and security issues but will not add 16 // any new features. 17 // 18 // When possible, we recommend using our newer 19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) 20 // that are still actively being worked and iterated on. 21 // 22 // # Creating a client 23 // 24 // Usage example: 25 // 26 // import "google.golang.org/api/deploymentmanager/v2" 27 // ... 28 // ctx := context.Background() 29 // deploymentmanagerService, err := deploymentmanager.NewService(ctx) 30 // 31 // In this example, Google Application Default Credentials are used for 32 // authentication. For information on how to create and obtain Application 33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 34 // 35 // # Other authentication options 36 // 37 // By default, all available scopes (see "Constants") are used to authenticate. 38 // To restrict scopes, use [google.golang.org/api/option.WithScopes]: 39 // 40 // deploymentmanagerService, err := deploymentmanager.NewService(ctx, option.WithScopes(deploymentmanager.NdevCloudmanReadonlyScope)) 41 // 42 // To use an API key for authentication (note: some APIs do not support API 43 // keys), use [google.golang.org/api/option.WithAPIKey]: 44 // 45 // deploymentmanagerService, err := deploymentmanager.NewService(ctx, option.WithAPIKey("AIza...")) 46 // 47 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 48 // flow, use [google.golang.org/api/option.WithTokenSource]: 49 // 50 // config := &oauth2.Config{...} 51 // // ... 52 // token, err := config.Exchange(ctx, ...) 53 // deploymentmanagerService, err := deploymentmanager.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 54 // 55 // See [google.golang.org/api/option.ClientOption] for details on options. 56 package deploymentmanager // import "google.golang.org/api/deploymentmanager/v2" 57 58 import ( 59 "bytes" 60 "context" 61 "encoding/json" 62 "errors" 63 "fmt" 64 "io" 65 "net/http" 66 "net/url" 67 "strconv" 68 "strings" 69 70 googleapi "google.golang.org/api/googleapi" 71 internal "google.golang.org/api/internal" 72 gensupport "google.golang.org/api/internal/gensupport" 73 option "google.golang.org/api/option" 74 internaloption "google.golang.org/api/option/internaloption" 75 htransport "google.golang.org/api/transport/http" 76 ) 77 78 // Always reference these packages, just in case the auto-generated code 79 // below doesn't. 80 var _ = bytes.NewBuffer 81 var _ = strconv.Itoa 82 var _ = fmt.Sprintf 83 var _ = json.NewDecoder 84 var _ = io.Copy 85 var _ = url.Parse 86 var _ = gensupport.MarshalJSON 87 var _ = googleapi.Version 88 var _ = errors.New 89 var _ = strings.Replace 90 var _ = context.Canceled 91 var _ = internaloption.WithDefaultEndpoint 92 var _ = internal.Version 93 94 const apiId = "deploymentmanager:v2" 95 const apiName = "deploymentmanager" 96 const apiVersion = "v2" 97 const basePath = "https://deploymentmanager.googleapis.com/" 98 const basePathTemplate = "https://deploymentmanager.UNIVERSE_DOMAIN/" 99 const mtlsBasePath = "https://deploymentmanager.mtls.googleapis.com/" 100 101 // OAuth2 scopes used by this API. 102 const ( 103 // See, edit, configure, and delete your Google Cloud data and see the email 104 // address for your Google Account. 105 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 106 107 // View your data across Google Cloud services and see the email address of 108 // your Google Account 109 CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" 110 111 // View and manage your Google Cloud Platform management resources and 112 // deployment status information 113 NdevCloudmanScope = "https://www.googleapis.com/auth/ndev.cloudman" 114 115 // View your Google Cloud Platform management resources and deployment status 116 // information 117 NdevCloudmanReadonlyScope = "https://www.googleapis.com/auth/ndev.cloudman.readonly" 118 ) 119 120 // NewService creates a new Service. 121 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 122 scopesOption := internaloption.WithDefaultScopes( 123 "https://www.googleapis.com/auth/cloud-platform", 124 "https://www.googleapis.com/auth/cloud-platform.read-only", 125 "https://www.googleapis.com/auth/ndev.cloudman", 126 "https://www.googleapis.com/auth/ndev.cloudman.readonly", 127 ) 128 // NOTE: prepend, so we don't override user-specified scopes. 129 opts = append([]option.ClientOption{scopesOption}, opts...) 130 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 131 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 132 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 133 opts = append(opts, internaloption.EnableNewAuthLibrary()) 134 client, endpoint, err := htransport.NewClient(ctx, opts...) 135 if err != nil { 136 return nil, err 137 } 138 s, err := New(client) 139 if err != nil { 140 return nil, err 141 } 142 if endpoint != "" { 143 s.BasePath = endpoint 144 } 145 return s, nil 146 } 147 148 // New creates a new Service. It uses the provided http.Client for requests. 149 // 150 // Deprecated: please use NewService instead. 151 // To provide a custom HTTP client, use option.WithHTTPClient. 152 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 153 func New(client *http.Client) (*Service, error) { 154 if client == nil { 155 return nil, errors.New("client is nil") 156 } 157 s := &Service{client: client, BasePath: basePath} 158 s.Deployments = NewDeploymentsService(s) 159 s.Manifests = NewManifestsService(s) 160 s.Operations = NewOperationsService(s) 161 s.Resources = NewResourcesService(s) 162 s.Types = NewTypesService(s) 163 return s, nil 164 } 165 166 type Service struct { 167 client *http.Client 168 BasePath string // API endpoint base URL 169 UserAgent string // optional additional User-Agent fragment 170 171 Deployments *DeploymentsService 172 173 Manifests *ManifestsService 174 175 Operations *OperationsService 176 177 Resources *ResourcesService 178 179 Types *TypesService 180 } 181 182 func (s *Service) userAgent() string { 183 if s.UserAgent == "" { 184 return googleapi.UserAgent 185 } 186 return googleapi.UserAgent + " " + s.UserAgent 187 } 188 189 func NewDeploymentsService(s *Service) *DeploymentsService { 190 rs := &DeploymentsService{s: s} 191 return rs 192 } 193 194 type DeploymentsService struct { 195 s *Service 196 } 197 198 func NewManifestsService(s *Service) *ManifestsService { 199 rs := &ManifestsService{s: s} 200 return rs 201 } 202 203 type ManifestsService struct { 204 s *Service 205 } 206 207 func NewOperationsService(s *Service) *OperationsService { 208 rs := &OperationsService{s: s} 209 return rs 210 } 211 212 type OperationsService struct { 213 s *Service 214 } 215 216 func NewResourcesService(s *Service) *ResourcesService { 217 rs := &ResourcesService{s: s} 218 return rs 219 } 220 221 type ResourcesService struct { 222 s *Service 223 } 224 225 func NewTypesService(s *Service) *TypesService { 226 rs := &TypesService{s: s} 227 return rs 228 } 229 230 type TypesService struct { 231 s *Service 232 } 233 234 // AuditConfig: Specifies the audit configuration for a service. The 235 // configuration determines which permission types are logged, and what 236 // identities, if any, are exempted from logging. An AuditConfig must have one 237 // or more AuditLogConfigs. If there are AuditConfigs for both `allServices` 238 // and a specific service, the union of the two AuditConfigs is used for that 239 // service: the log_types specified in each AuditConfig are enabled, and the 240 // exempted_members in each AuditLogConfig are exempted. Example Policy with 241 // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices", 242 // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ 243 // "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": 244 // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", 245 // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": 246 // "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For 247 // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ 248 // logging. It also exempts `jose@example.com` from DATA_READ logging, and 249 // `aliya@example.com` from DATA_WRITE logging. 250 type AuditConfig struct { 251 // AuditLogConfigs: The configuration for logging of each type of permission. 252 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"` 253 // Service: Specifies a service that will be enabled for audit logging. For 254 // example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` 255 // is a special value that covers all services. 256 Service string `json:"service,omitempty"` 257 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to 258 // unconditionally include in API requests. By default, fields with empty or 259 // default values are omitted from API requests. See 260 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 261 // details. 262 ForceSendFields []string `json:"-"` 263 // NullFields is a list of field names (e.g. "AuditLogConfigs") to include in 264 // API requests with the JSON null value. By default, fields with empty values 265 // are omitted from API requests. See 266 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 267 NullFields []string `json:"-"` 268 } 269 270 func (s *AuditConfig) MarshalJSON() ([]byte, error) { 271 type NoMethod AuditConfig 272 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 273 } 274 275 // AuditLogConfig: Provides the configuration for logging a type of 276 // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ", 277 // "exempted_members": [ "user:jose@example.com" ] }, { "log_type": 278 // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while 279 // exempting jose@example.com from DATA_READ logging. 280 type AuditLogConfig struct { 281 // ExemptedMembers: Specifies the identities that do not cause logging for this 282 // type of permission. Follows the same format of Binding.members. 283 ExemptedMembers []string `json:"exemptedMembers,omitempty"` 284 // LogType: The log type that this config enables. 285 // 286 // Possible values: 287 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this. 288 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy 289 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create 290 // "DATA_READ" - Data reads. Example: CloudSQL Users list 291 LogType string `json:"logType,omitempty"` 292 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to 293 // unconditionally include in API requests. By default, fields with empty or 294 // default values are omitted from API requests. See 295 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 296 // details. 297 ForceSendFields []string `json:"-"` 298 // NullFields is a list of field names (e.g. "ExemptedMembers") to include in 299 // API requests with the JSON null value. By default, fields with empty values 300 // are omitted from API requests. See 301 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 302 NullFields []string `json:"-"` 303 } 304 305 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) { 306 type NoMethod AuditLogConfig 307 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 308 } 309 310 // Binding: Associates `members`, or principals, with a `role`. 311 type Binding struct { 312 // Condition: The condition that is associated with this binding. If the 313 // condition evaluates to `true`, then this binding applies to the current 314 // request. If the condition evaluates to `false`, then this binding does not 315 // apply to the current request. However, a different role binding might grant 316 // the same role to one or more of the principals in this binding. To learn 317 // which resources support conditions in their IAM policies, see the IAM 318 // documentation 319 // (https://cloud.google.com/iam/help/conditions/resource-policies). 320 Condition *Expr `json:"condition,omitempty"` 321 // Members: Specifies the principals requesting access for a Google Cloud 322 // resource. `members` can have the following values: * `allUsers`: A special 323 // identifier that represents anyone who is on the internet; with or without a 324 // Google account. * `allAuthenticatedUsers`: A special identifier that 325 // represents anyone who is authenticated with a Google account or a service 326 // account. Does not include identities that come from external identity 327 // providers (IdPs) through identity federation. * `user:{emailid}`: An email 328 // address that represents a specific Google account. For example, 329 // `alice@example.com` . * `serviceAccount:{emailid}`: An email address that 330 // represents a Google service account. For example, 331 // `my-other-app@appspot.gserviceaccount.com`. * 332 // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An 333 // identifier for a Kubernetes service account 334 // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). 335 // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * 336 // `group:{emailid}`: An email address that represents a Google group. For 337 // example, `admins@example.com`. * `domain:{domain}`: The G Suite domain 338 // (primary) that represents all the users of that domain. For example, 339 // `google.com` or `example.com`. * 340 // `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub 341 // ject/{subject_attribute_value}`: A single identity in a workforce identity 342 // pool. * 343 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/ 344 // group/{group_id}`: All workforce identities in a group. * 345 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/ 346 // attribute.{attribute_name}/{attribute_value}`: All workforce identities with 347 // a specific attribute value. * 348 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/ 349 // *`: All identities in a workforce identity pool. * 350 // `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo 351 // rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single 352 // identity in a workload identity pool. * 353 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global 354 // /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool 355 // group. * 356 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global 357 // /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value} 358 // `: All identities in a workload identity pool with a certain attribute. * 359 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global 360 // /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity 361 // pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus 362 // unique identifier) representing a user that has been recently deleted. For 363 // example, `alice@example.com?uid=123456789012345678901`. If the user is 364 // recovered, this value reverts to `user:{emailid}` and the recovered user 365 // retains the role in the binding. * 366 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 367 // unique identifier) representing a service account that has been recently 368 // deleted. For example, 369 // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the 370 // service account is undeleted, this value reverts to 371 // `serviceAccount:{emailid}` and the undeleted service account retains the 372 // role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email 373 // address (plus unique identifier) representing a Google group that has been 374 // recently deleted. For example, 375 // `admins@example.com?uid=123456789012345678901`. If the group is recovered, 376 // this value reverts to `group:{emailid}` and the recovered group retains the 377 // role in the binding. * 378 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool 379 // _id}/subject/{subject_attribute_value}`: Deleted single identity in a 380 // workforce identity pool. For example, 381 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po 382 // ol-id/subject/my-subject-attribute-value`. 383 Members []string `json:"members,omitempty"` 384 // Role: Role that is assigned to the list of `members`, or principals. For 385 // example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview 386 // of the IAM roles and permissions, see the IAM documentation 387 // (https://cloud.google.com/iam/docs/roles-overview). For a list of the 388 // available pre-defined roles, see here 389 // (https://cloud.google.com/iam/docs/understanding-roles). 390 Role string `json:"role,omitempty"` 391 // ForceSendFields is a list of field names (e.g. "Condition") to 392 // unconditionally include in API requests. By default, fields with empty or 393 // default values are omitted from API requests. See 394 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 395 // details. 396 ForceSendFields []string `json:"-"` 397 // NullFields is a list of field names (e.g. "Condition") to include in API 398 // requests with the JSON null value. By default, fields with empty values are 399 // omitted from API requests. See 400 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 401 NullFields []string `json:"-"` 402 } 403 404 func (s *Binding) MarshalJSON() ([]byte, error) { 405 type NoMethod Binding 406 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 407 } 408 409 type BulkInsertOperationStatus struct { 410 // CreatedVmCount: [Output Only] Count of VMs successfully created so far. 411 CreatedVmCount int64 `json:"createdVmCount,omitempty"` 412 // DeletedVmCount: [Output Only] Count of VMs that got deleted during rollback. 413 DeletedVmCount int64 `json:"deletedVmCount,omitempty"` 414 // FailedToCreateVmCount: [Output Only] Count of VMs that started creating but 415 // encountered an error. 416 FailedToCreateVmCount int64 `json:"failedToCreateVmCount,omitempty"` 417 // Status: [Output Only] Creation status of BulkInsert operation - information 418 // if the flow is rolling forward or rolling back. 419 // 420 // Possible values: 421 // "STATUS_UNSPECIFIED" 422 // "CREATING" - Rolling forward - creating VMs. 423 // "ROLLING_BACK" - Rolling back - cleaning up after an error. 424 // "DONE" - Done 425 Status string `json:"status,omitempty"` 426 // TargetVmCount: [Output Only] Count of VMs originally planned to be created. 427 TargetVmCount int64 `json:"targetVmCount,omitempty"` 428 // ForceSendFields is a list of field names (e.g. "CreatedVmCount") to 429 // unconditionally include in API requests. By default, fields with empty or 430 // default values are omitted from API requests. See 431 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 432 // details. 433 ForceSendFields []string `json:"-"` 434 // NullFields is a list of field names (e.g. "CreatedVmCount") to include in 435 // API requests with the JSON null value. By default, fields with empty values 436 // are omitted from API requests. See 437 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 438 NullFields []string `json:"-"` 439 } 440 441 func (s *BulkInsertOperationStatus) MarshalJSON() ([]byte, error) { 442 type NoMethod BulkInsertOperationStatus 443 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 444 } 445 446 type ConfigFile struct { 447 // Content: The contents of the file. 448 Content string `json:"content,omitempty"` 449 // ForceSendFields is a list of field names (e.g. "Content") to unconditionally 450 // include in API requests. By default, fields with empty or default values are 451 // omitted from API requests. See 452 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 453 // details. 454 ForceSendFields []string `json:"-"` 455 // NullFields is a list of field names (e.g. "Content") to include in API 456 // requests with the JSON null value. By default, fields with empty values are 457 // omitted from API requests. See 458 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 459 NullFields []string `json:"-"` 460 } 461 462 func (s *ConfigFile) MarshalJSON() ([]byte, error) { 463 type NoMethod ConfigFile 464 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 465 } 466 467 type Deployment struct { 468 // Description: An optional user-provided description of the deployment. 469 Description string `json:"description,omitempty"` 470 // Fingerprint: Provides a fingerprint to use in requests to modify a 471 // deployment, such as `update()`, `stop()`, and `cancelPreview()` requests. A 472 // fingerprint is a randomly generated value that must be provided with 473 // `update()`, `stop()`, and `cancelPreview()` requests to perform optimistic 474 // locking. This ensures optimistic concurrency so that only one request 475 // happens at a time. The fingerprint is initially generated by Deployment 476 // Manager and changes after every request to modify data. To get the latest 477 // fingerprint value, perform a `get()` request to a deployment. 478 Fingerprint string `json:"fingerprint,omitempty"` 479 Id uint64 `json:"id,omitempty,string"` 480 // InsertTime: Output only. Creation timestamp in RFC3339 text format. 481 InsertTime string `json:"insertTime,omitempty"` 482 // Labels: Map of One Platform labels; provided by the client when the resource 483 // is created or updated. Specifically: Label keys must be between 1 and 63 484 // characters long and must conform to the following regular expression: `a-z 485 // ([-a-z0-9]*[a-z0-9])?` Label values must be between 0 and 63 characters long 486 // and must conform to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. 487 Labels []*DeploymentLabelEntry `json:"labels,omitempty"` 488 // Manifest: Output only. URL of the manifest representing the last manifest 489 // that was successfully deployed. If no manifest has been successfully 490 // deployed, this field will be absent. 491 Manifest string `json:"manifest,omitempty"` 492 // Name: Name of the resource; provided by the client when the resource is 493 // created. The name must be 1-63 characters long, and comply with RFC1035. 494 // Specifically, the name must be 1-63 characters long and match the regular 495 // expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must 496 // be a lowercase letter, and all following characters must be a dash, 497 // lowercase letter, or digit, except the last character, which cannot be a 498 // dash. 499 Name string `json:"name,omitempty"` 500 // Operation: Output only. The Operation that most recently ran, or is 501 // currently running, on this deployment. 502 Operation *Operation `json:"operation,omitempty"` 503 // SelfLink: Output only. Server defined URL for the resource. 504 SelfLink string `json:"selfLink,omitempty"` 505 // Target: [Input Only] The parameters that define your deployment, including 506 // the deployment configuration and relevant templates. 507 Target *TargetConfiguration `json:"target,omitempty"` 508 // Update: Output only. If Deployment Manager is currently updating or 509 // previewing an update to this deployment, the updated configuration appears 510 // here. 511 Update *DeploymentUpdate `json:"update,omitempty"` 512 // UpdateTime: Output only. Update timestamp in RFC3339 text format. 513 UpdateTime string `json:"updateTime,omitempty"` 514 515 // ServerResponse contains the HTTP response code and headers from the server. 516 googleapi.ServerResponse `json:"-"` 517 // ForceSendFields is a list of field names (e.g. "Description") to 518 // unconditionally include in API requests. By default, fields with empty or 519 // default values are omitted from API requests. See 520 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 521 // details. 522 ForceSendFields []string `json:"-"` 523 // NullFields is a list of field names (e.g. "Description") to include in API 524 // requests with the JSON null value. By default, fields with empty values are 525 // omitted from API requests. See 526 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 527 NullFields []string `json:"-"` 528 } 529 530 func (s *Deployment) MarshalJSON() ([]byte, error) { 531 type NoMethod Deployment 532 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 533 } 534 535 // DeploymentLabelEntry: Label object for Deployments 536 type DeploymentLabelEntry struct { 537 // Key: Key of the label 538 Key string `json:"key,omitempty"` 539 // Value: Value of the label 540 Value string `json:"value,omitempty"` 541 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally 542 // include in API requests. By default, fields with empty or default values are 543 // omitted from API requests. See 544 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 545 // details. 546 ForceSendFields []string `json:"-"` 547 // NullFields is a list of field names (e.g. "Key") to include in API requests 548 // with the JSON null value. By default, fields with empty values are omitted 549 // from API requests. See 550 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 551 NullFields []string `json:"-"` 552 } 553 554 func (s *DeploymentLabelEntry) MarshalJSON() ([]byte, error) { 555 type NoMethod DeploymentLabelEntry 556 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 557 } 558 559 type DeploymentUpdate struct { 560 // Description: Output only. An optional user-provided description of the 561 // deployment after the current update has been applied. 562 Description string `json:"description,omitempty"` 563 // Labels: Map of One Platform labels; provided by the client when the resource 564 // is created or updated. Specifically: Label keys must be between 1 and 63 565 // characters long and must conform to the following regular expression: `a-z 566 // ([-a-z0-9]*[a-z0-9])?` Label values must be between 0 and 63 characters long 567 // and must conform to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. 568 Labels []*DeploymentUpdateLabelEntry `json:"labels,omitempty"` 569 // Manifest: Output only. URL of the manifest representing the update 570 // configuration of this deployment. 571 Manifest string `json:"manifest,omitempty"` 572 // ForceSendFields is a list of field names (e.g. "Description") to 573 // unconditionally include in API requests. By default, fields with empty or 574 // default values are omitted from API requests. See 575 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 576 // details. 577 ForceSendFields []string `json:"-"` 578 // NullFields is a list of field names (e.g. "Description") to include in API 579 // requests with the JSON null value. By default, fields with empty values are 580 // omitted from API requests. See 581 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 582 NullFields []string `json:"-"` 583 } 584 585 func (s *DeploymentUpdate) MarshalJSON() ([]byte, error) { 586 type NoMethod DeploymentUpdate 587 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 588 } 589 590 // DeploymentUpdateLabelEntry: Label object for DeploymentUpdate 591 type DeploymentUpdateLabelEntry struct { 592 // Key: Key of the label 593 Key string `json:"key,omitempty"` 594 // Value: Value of the label 595 Value string `json:"value,omitempty"` 596 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally 597 // include in API requests. By default, fields with empty or default values are 598 // omitted from API requests. See 599 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 600 // details. 601 ForceSendFields []string `json:"-"` 602 // NullFields is a list of field names (e.g. "Key") to include in API requests 603 // with the JSON null value. By default, fields with empty values are omitted 604 // from API requests. See 605 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 606 NullFields []string `json:"-"` 607 } 608 609 func (s *DeploymentUpdateLabelEntry) MarshalJSON() ([]byte, error) { 610 type NoMethod DeploymentUpdateLabelEntry 611 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 612 } 613 614 type DeploymentsCancelPreviewRequest struct { 615 // Fingerprint: Specifies a fingerprint for `cancelPreview()` requests. A 616 // fingerprint is a randomly generated value that must be provided in 617 // `cancelPreview()` requests to perform optimistic locking. This ensures 618 // optimistic concurrency so that the deployment does not have conflicting 619 // requests (e.g. if someone attempts to make a new update request while 620 // another user attempts to cancel a preview, this would prevent one of the 621 // requests). The fingerprint is initially generated by Deployment Manager and 622 // changes after every request to modify a deployment. To get the latest 623 // fingerprint value, perform a `get()` request on the deployment. 624 Fingerprint string `json:"fingerprint,omitempty"` 625 // ForceSendFields is a list of field names (e.g. "Fingerprint") to 626 // unconditionally include in API requests. By default, fields with empty or 627 // default values are omitted from API requests. See 628 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 629 // details. 630 ForceSendFields []string `json:"-"` 631 // NullFields is a list of field names (e.g. "Fingerprint") to include in API 632 // requests with the JSON null value. By default, fields with empty values are 633 // omitted from API requests. See 634 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 635 NullFields []string `json:"-"` 636 } 637 638 func (s *DeploymentsCancelPreviewRequest) MarshalJSON() ([]byte, error) { 639 type NoMethod DeploymentsCancelPreviewRequest 640 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 641 } 642 643 // DeploymentsListResponse: A response containing a partial list of deployments 644 // and a page token used to build the next request if the request has been 645 // truncated. 646 type DeploymentsListResponse struct { 647 // Deployments: Output only. The deployments contained in this response. 648 Deployments []*Deployment `json:"deployments,omitempty"` 649 // NextPageToken: Output only. A token used to continue a truncated list 650 // request. 651 NextPageToken string `json:"nextPageToken,omitempty"` 652 653 // ServerResponse contains the HTTP response code and headers from the server. 654 googleapi.ServerResponse `json:"-"` 655 // ForceSendFields is a list of field names (e.g. "Deployments") to 656 // unconditionally include in API requests. By default, fields with empty or 657 // default values are omitted from API requests. See 658 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 659 // details. 660 ForceSendFields []string `json:"-"` 661 // NullFields is a list of field names (e.g. "Deployments") to include in API 662 // requests with the JSON null value. By default, fields with empty values are 663 // omitted from API requests. See 664 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 665 NullFields []string `json:"-"` 666 } 667 668 func (s *DeploymentsListResponse) MarshalJSON() ([]byte, error) { 669 type NoMethod DeploymentsListResponse 670 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 671 } 672 673 type DeploymentsStopRequest struct { 674 // Fingerprint: Specifies a fingerprint for `stop()` requests. A fingerprint is 675 // a randomly generated value that must be provided in `stop()` requests to 676 // perform optimistic locking. This ensures optimistic concurrency so that the 677 // deployment does not have conflicting requests (e.g. if someone attempts to 678 // make a new update request while another user attempts to stop an ongoing 679 // update request, this would prevent a collision). The fingerprint is 680 // initially generated by Deployment Manager and changes after every request to 681 // modify a deployment. To get the latest fingerprint value, perform a `get()` 682 // request on the deployment. 683 Fingerprint string `json:"fingerprint,omitempty"` 684 // ForceSendFields is a list of field names (e.g. "Fingerprint") to 685 // unconditionally include in API requests. By default, fields with empty or 686 // default values are omitted from API requests. See 687 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 688 // details. 689 ForceSendFields []string `json:"-"` 690 // NullFields is a list of field names (e.g. "Fingerprint") to include in API 691 // requests with the JSON null value. By default, fields with empty values are 692 // omitted from API requests. See 693 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 694 NullFields []string `json:"-"` 695 } 696 697 func (s *DeploymentsStopRequest) MarshalJSON() ([]byte, error) { 698 type NoMethod DeploymentsStopRequest 699 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 700 } 701 702 // Expr: Represents a textual expression in the Common Expression Language 703 // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics 704 // of CEL are documented at https://github.com/google/cel-spec. Example 705 // (Comparison): title: "Summary size limit" description: "Determines if a 706 // summary is less than 100 chars" expression: "document.summary.size() < 100" 707 // Example (Equality): title: "Requestor is owner" description: "Determines if 708 // requestor is the document owner" expression: "document.owner == 709 // request.auth.claims.email" Example (Logic): title: "Public documents" 710 // description: "Determine whether the document should be publicly visible" 711 // expression: "document.type != 'private' && document.type != 'internal'" 712 // Example (Data Manipulation): title: "Notification string" description: 713 // "Create a notification string with a timestamp." expression: "'New message 714 // received at ' + string(document.create_time)" The exact variables and 715 // functions that may be referenced within an expression are determined by the 716 // service that evaluates it. See the service documentation for additional 717 // information. 718 type Expr struct { 719 // Description: Optional. Description of the expression. This is a longer text 720 // which describes the expression, e.g. when hovered over it in a UI. 721 Description string `json:"description,omitempty"` 722 // Expression: Textual representation of an expression in Common Expression 723 // Language syntax. 724 Expression string `json:"expression,omitempty"` 725 // Location: Optional. String indicating the location of the expression for 726 // error reporting, e.g. a file name and a position in the file. 727 Location string `json:"location,omitempty"` 728 // Title: Optional. Title for the expression, i.e. a short string describing 729 // its purpose. This can be used e.g. in UIs which allow to enter the 730 // expression. 731 Title string `json:"title,omitempty"` 732 // ForceSendFields is a list of field names (e.g. "Description") to 733 // unconditionally include in API requests. By default, fields with empty or 734 // default values are omitted from API requests. See 735 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 736 // details. 737 ForceSendFields []string `json:"-"` 738 // NullFields is a list of field names (e.g. "Description") to include in API 739 // requests with the JSON null value. By default, fields with empty values are 740 // omitted from API requests. See 741 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 742 NullFields []string `json:"-"` 743 } 744 745 func (s *Expr) MarshalJSON() ([]byte, error) { 746 type NoMethod Expr 747 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 748 } 749 750 type GlobalSetPolicyRequest struct { 751 // Bindings: Flatten Policy to create a backward compatible wire-format. 752 // Deprecated. Use 'policy' to specify bindings. 753 Bindings []*Binding `json:"bindings,omitempty"` 754 // Etag: Flatten Policy to create a backward compatible wire-format. 755 // Deprecated. Use 'policy' to specify the etag. 756 Etag string `json:"etag,omitempty"` 757 // Policy: REQUIRED: The complete policy to be applied to the 'resource'. The 758 // size of the policy is limited to a few 10s of KB. An empty policy is in 759 // general a valid policy but certain services (like Projects) might reject 760 // them. 761 Policy *Policy `json:"policy,omitempty"` 762 // ForceSendFields is a list of field names (e.g. "Bindings") to 763 // unconditionally include in API requests. By default, fields with empty or 764 // default values are omitted from API requests. See 765 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 766 // details. 767 ForceSendFields []string `json:"-"` 768 // NullFields is a list of field names (e.g. "Bindings") to include in API 769 // requests with the JSON null value. By default, fields with empty values are 770 // omitted from API requests. See 771 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 772 NullFields []string `json:"-"` 773 } 774 775 func (s *GlobalSetPolicyRequest) MarshalJSON() ([]byte, error) { 776 type NoMethod GlobalSetPolicyRequest 777 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 778 } 779 780 type ImportFile struct { 781 // Content: The contents of the file. 782 Content string `json:"content,omitempty"` 783 // Name: The name of the file. 784 Name string `json:"name,omitempty"` 785 // ForceSendFields is a list of field names (e.g. "Content") to unconditionally 786 // include in API requests. By default, fields with empty or default values are 787 // omitted from API requests. See 788 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 789 // details. 790 ForceSendFields []string `json:"-"` 791 // NullFields is a list of field names (e.g. "Content") to include in API 792 // requests with the JSON null value. By default, fields with empty values are 793 // omitted from API requests. See 794 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 795 NullFields []string `json:"-"` 796 } 797 798 func (s *ImportFile) MarshalJSON() ([]byte, error) { 799 type NoMethod ImportFile 800 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 801 } 802 803 type InstancesBulkInsertOperationMetadata struct { 804 // PerLocationStatus: Status information per location (location name is key). 805 // Example key: zones/us-central1-a 806 PerLocationStatus map[string]BulkInsertOperationStatus `json:"perLocationStatus,omitempty"` 807 // ForceSendFields is a list of field names (e.g. "PerLocationStatus") to 808 // unconditionally include in API requests. By default, fields with empty or 809 // default values are omitted from API requests. See 810 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 811 // details. 812 ForceSendFields []string `json:"-"` 813 // NullFields is a list of field names (e.g. "PerLocationStatus") to include in 814 // API requests with the JSON null value. By default, fields with empty values 815 // are omitted from API requests. See 816 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 817 NullFields []string `json:"-"` 818 } 819 820 func (s *InstancesBulkInsertOperationMetadata) MarshalJSON() ([]byte, error) { 821 type NoMethod InstancesBulkInsertOperationMetadata 822 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 823 } 824 825 type Manifest struct { 826 // Config: Output only. The YAML configuration for this manifest. 827 Config *ConfigFile `json:"config,omitempty"` 828 // ExpandedConfig: Output only. The fully-expanded configuration file, 829 // including any templates and references. 830 ExpandedConfig string `json:"expandedConfig,omitempty"` 831 Id uint64 `json:"id,omitempty,string"` 832 // Imports: Output only. The imported files for this manifest. 833 Imports []*ImportFile `json:"imports,omitempty"` 834 // InsertTime: Output only. Creation timestamp in RFC3339 text format. 835 InsertTime string `json:"insertTime,omitempty"` 836 // Layout: Output only. The YAML layout for this manifest. 837 Layout string `json:"layout,omitempty"` 838 // ManifestSizeBytes: Output only. The computed size of the fully expanded 839 // manifest. 840 ManifestSizeBytes int64 `json:"manifestSizeBytes,omitempty,string"` 841 // ManifestSizeLimitBytes: Output only. The size limit for expanded manifests 842 // in the project. 843 ManifestSizeLimitBytes int64 `json:"manifestSizeLimitBytes,omitempty,string"` 844 // Name: Output only. The name of the manifest. 845 Name string `json:"name,omitempty"` 846 // SelfLink: Output only. Self link for the manifest. 847 SelfLink string `json:"selfLink,omitempty"` 848 849 // ServerResponse contains the HTTP response code and headers from the server. 850 googleapi.ServerResponse `json:"-"` 851 // ForceSendFields is a list of field names (e.g. "Config") to unconditionally 852 // include in API requests. By default, fields with empty or default values are 853 // omitted from API requests. See 854 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 855 // details. 856 ForceSendFields []string `json:"-"` 857 // NullFields is a list of field names (e.g. "Config") to include in API 858 // requests with the JSON null value. By default, fields with empty values are 859 // omitted from API requests. See 860 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 861 NullFields []string `json:"-"` 862 } 863 864 func (s *Manifest) MarshalJSON() ([]byte, error) { 865 type NoMethod Manifest 866 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 867 } 868 869 // ManifestsListResponse: A response containing a partial list of manifests and 870 // a page token used to build the next request if the request has been 871 // truncated. 872 type ManifestsListResponse struct { 873 // Manifests: Output only. Manifests contained in this list response. 874 Manifests []*Manifest `json:"manifests,omitempty"` 875 // NextPageToken: Output only. A token used to continue a truncated list 876 // request. 877 NextPageToken string `json:"nextPageToken,omitempty"` 878 879 // ServerResponse contains the HTTP response code and headers from the server. 880 googleapi.ServerResponse `json:"-"` 881 // ForceSendFields is a list of field names (e.g. "Manifests") to 882 // unconditionally include in API requests. By default, fields with empty or 883 // default values are omitted from API requests. See 884 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 885 // details. 886 ForceSendFields []string `json:"-"` 887 // NullFields is a list of field names (e.g. "Manifests") to include in API 888 // requests with the JSON null value. By default, fields with empty values are 889 // omitted from API requests. See 890 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 891 NullFields []string `json:"-"` 892 } 893 894 func (s *ManifestsListResponse) MarshalJSON() ([]byte, error) { 895 type NoMethod ManifestsListResponse 896 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 897 } 898 899 // Operation: Represents an Operation resource. Google Compute Engine has three 900 // Operation resources: * Global 901 // (/compute/docs/reference/rest/{$api_version}/globalOperations) * Regional 902 // (/compute/docs/reference/rest/{$api_version}/regionOperations) * Zonal 903 // (/compute/docs/reference/rest/{$api_version}/zoneOperations) You can use an 904 // operation resource to manage asynchronous API requests. For more 905 // information, read Handling API responses. Operations can be global, regional 906 // or zonal. - For global operations, use the `globalOperations` resource. - 907 // For regional operations, use the `regionOperations` resource. - For zonal 908 // operations, use the `zoneOperations` resource. For more information, read 909 // Global, Regional, and Zonal Resources. Note that completed Operation 910 // resources have a limited retention period. 911 type Operation struct { 912 // ClientOperationId: [Output Only] The value of `requestId` if you provided it 913 // in the request. Not present otherwise. 914 ClientOperationId string `json:"clientOperationId,omitempty"` 915 // CreationTimestamp: [Deprecated] This field is deprecated. 916 CreationTimestamp string `json:"creationTimestamp,omitempty"` 917 // Description: [Output Only] A textual description of the operation, which is 918 // set when the operation is created. 919 Description string `json:"description,omitempty"` 920 // EndTime: [Output Only] The time that this operation was completed. This 921 // value is in RFC3339 text format. 922 EndTime string `json:"endTime,omitempty"` 923 // Error: [Output Only] If errors are generated during processing of the 924 // operation, this field will be populated. 925 Error *OperationError `json:"error,omitempty"` 926 // HttpErrorMessage: [Output Only] If the operation fails, this field contains 927 // the HTTP error message that was returned, such as `NOT FOUND`. 928 HttpErrorMessage string `json:"httpErrorMessage,omitempty"` 929 // HttpErrorStatusCode: [Output Only] If the operation fails, this field 930 // contains the HTTP error status code that was returned. For example, a `404` 931 // means the resource was not found. 932 HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"` 933 // Id: [Output Only] The unique identifier for the operation. This identifier 934 // is defined by the server. 935 Id uint64 `json:"id,omitempty,string"` 936 // InsertTime: [Output Only] The time that this operation was requested. This 937 // value is in RFC3339 text format. 938 InsertTime string `json:"insertTime,omitempty"` 939 InstancesBulkInsertOperationMetadata *InstancesBulkInsertOperationMetadata `json:"instancesBulkInsertOperationMetadata,omitempty"` 940 // Kind: [Output Only] Type of the resource. Always `compute#operation` for 941 // Operation resources. 942 Kind string `json:"kind,omitempty"` 943 // Name: [Output Only] Name of the operation. 944 Name string `json:"name,omitempty"` 945 // OperationGroupId: [Output Only] An ID that represents a group of operations, 946 // such as when a group of operations results from a `bulkInsert` API request. 947 OperationGroupId string `json:"operationGroupId,omitempty"` 948 // OperationType: [Output Only] The type of operation, such as `insert`, 949 // `update`, or `delete`, and so on. 950 OperationType string `json:"operationType,omitempty"` 951 // Progress: [Output Only] An optional progress indicator that ranges from 0 to 952 // 100. There is no requirement that this be linear or support any granularity 953 // of operations. This should not be used to guess when the operation will be 954 // complete. This number should monotonically increase as the operation 955 // progresses. 956 Progress int64 `json:"progress,omitempty"` 957 // Region: [Output Only] The URL of the region where the operation resides. 958 // Only applicable when performing regional operations. 959 Region string `json:"region,omitempty"` 960 // SelfLink: [Output Only] Server-defined URL for the resource. 961 SelfLink string `json:"selfLink,omitempty"` 962 // SetCommonInstanceMetadataOperationMetadata: [Output Only] If the operation 963 // is for projects.setCommonInstanceMetadata, this field will contain 964 // information on all underlying zonal actions and their state. 965 SetCommonInstanceMetadataOperationMetadata *SetCommonInstanceMetadataOperationMetadata `json:"setCommonInstanceMetadataOperationMetadata,omitempty"` 966 // StartTime: [Output Only] The time that this operation was started by the 967 // server. This value is in RFC3339 text format. 968 StartTime string `json:"startTime,omitempty"` 969 // Status: [Output Only] The status of the operation, which can be one of the 970 // following: `PENDING`, `RUNNING`, or `DONE`. 971 // 972 // Possible values: 973 // "PENDING" 974 // "RUNNING" 975 // "DONE" 976 Status string `json:"status,omitempty"` 977 // StatusMessage: [Output Only] An optional textual description of the current 978 // status of the operation. 979 StatusMessage string `json:"statusMessage,omitempty"` 980 // TargetId: [Output Only] The unique target ID, which identifies a specific 981 // incarnation of the target resource. 982 TargetId uint64 `json:"targetId,omitempty,string"` 983 // TargetLink: [Output Only] The URL of the resource that the operation 984 // modifies. For operations related to creating a snapshot, this points to the 985 // persistent disk that the snapshot was created from. 986 TargetLink string `json:"targetLink,omitempty"` 987 // User: [Output Only] User who requested the operation, for example: 988 // `user@example.com` or `alice_smith_identifier 989 // (global/workforcePools/example-com-us-employees)`. 990 User string `json:"user,omitempty"` 991 // Warnings: [Output Only] If warning messages are generated during processing 992 // of the operation, this field will be populated. 993 Warnings []*OperationWarnings `json:"warnings,omitempty"` 994 // Zone: [Output Only] The URL of the zone where the operation resides. Only 995 // applicable when performing per-zone operations. 996 Zone string `json:"zone,omitempty"` 997 998 // ServerResponse contains the HTTP response code and headers from the server. 999 googleapi.ServerResponse `json:"-"` 1000 // ForceSendFields is a list of field names (e.g. "ClientOperationId") to 1001 // unconditionally include in API requests. By default, fields with empty or 1002 // default values are omitted from API requests. See 1003 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1004 // details. 1005 ForceSendFields []string `json:"-"` 1006 // NullFields is a list of field names (e.g. "ClientOperationId") to include in 1007 // API requests with the JSON null value. By default, fields with empty values 1008 // are omitted from API requests. See 1009 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1010 NullFields []string `json:"-"` 1011 } 1012 1013 func (s *Operation) MarshalJSON() ([]byte, error) { 1014 type NoMethod Operation 1015 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1016 } 1017 1018 // OperationError: [Output Only] If errors are generated during processing of 1019 // the operation, this field will be populated. 1020 type OperationError struct { 1021 // Errors: [Output Only] The array of errors encountered while processing this 1022 // operation. 1023 Errors []*OperationErrorErrors `json:"errors,omitempty"` 1024 // ForceSendFields is a list of field names (e.g. "Errors") to unconditionally 1025 // include in API requests. By default, fields with empty or default values are 1026 // omitted from API requests. See 1027 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1028 // details. 1029 ForceSendFields []string `json:"-"` 1030 // NullFields is a list of field names (e.g. "Errors") to include in API 1031 // requests with the JSON null value. By default, fields with empty values are 1032 // omitted from API requests. See 1033 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1034 NullFields []string `json:"-"` 1035 } 1036 1037 func (s *OperationError) MarshalJSON() ([]byte, error) { 1038 type NoMethod OperationError 1039 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1040 } 1041 1042 type OperationErrorErrors struct { 1043 // Code: [Output Only] The error type identifier for this error. 1044 Code string `json:"code,omitempty"` 1045 // Location: [Output Only] Indicates the field in the request that caused the 1046 // error. This property is optional. 1047 Location string `json:"location,omitempty"` 1048 // Message: [Output Only] An optional, human-readable error message. 1049 Message string `json:"message,omitempty"` 1050 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 1051 // include in API requests. By default, fields with empty or default values are 1052 // omitted from API requests. See 1053 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1054 // details. 1055 ForceSendFields []string `json:"-"` 1056 // NullFields is a list of field names (e.g. "Code") to include in API requests 1057 // with the JSON null value. By default, fields with empty values are omitted 1058 // from API requests. See 1059 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1060 NullFields []string `json:"-"` 1061 } 1062 1063 func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) { 1064 type NoMethod OperationErrorErrors 1065 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1066 } 1067 1068 type OperationWarnings struct { 1069 // Code: [Output Only] A warning code, if applicable. For example, Compute 1070 // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. 1071 // 1072 // Possible values: 1073 // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created. 1074 // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. 1075 // "UNREACHABLE" - A given scope cannot be reached. 1076 // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not 1077 // assigned to an instance on the network. 1078 // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to 1079 // an instance that does not exist. 1080 // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL 1081 // refers to an instance that is not on the same network as the route. 1082 // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip 1083 // forward. 1084 // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a 1085 // status of RUNNING. 1086 // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected 1087 // kernel, which is deprecated. 1088 // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that 1089 // requires a TOS they have not accepted. 1090 // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is 1091 // larger than image size. 1092 // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete 1093 // could not be deleted because they were in use. 1094 // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance 1095 // group manager is valid as such, but its application does not make a lot of 1096 // sense, because it allows only single instance in instance group. 1097 // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue 1098 // the process despite the mentioned error. 1099 // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made 1100 // by a failed operation. 1101 // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been 1102 // overridden. Deprecated unused field. 1103 // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is 1104 // in use. 1105 // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type 1106 // "EXTERNAL_API_WARNING" - Warning that is present in an external api call 1107 // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is 1108 // ignored. 1109 // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are 1110 // present 1111 // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the 1112 // resources has a type marked as experimental 1113 // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources 1114 // has a type marked as deprecated 1115 // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing 1116 // due to errors 1117 // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a 1118 // exceedingly large number of resources 1119 // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance 1120 // URL refers to an instance that does not have an ipv6 interface on the same 1121 // network as the route. 1122 // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend 1123 // service is associated with a health check that is not of type 1124 // HTTP/HTTPS/HTTP2. 1125 // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list 1126 // overhead quota exceed which captures the amount of resources filtered out by 1127 // user-defined list filter. 1128 Code string `json:"code,omitempty"` 1129 // Data: [Output Only] Metadata about this warning in key: value format. For 1130 // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } 1131 Data []*OperationWarningsData `json:"data,omitempty"` 1132 // Message: [Output Only] A human-readable description of the warning code. 1133 Message string `json:"message,omitempty"` 1134 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 1135 // include in API requests. By default, fields with empty or default values are 1136 // omitted from API requests. See 1137 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1138 // details. 1139 ForceSendFields []string `json:"-"` 1140 // NullFields is a list of field names (e.g. "Code") to include in API requests 1141 // with the JSON null value. By default, fields with empty values are omitted 1142 // from API requests. See 1143 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1144 NullFields []string `json:"-"` 1145 } 1146 1147 func (s *OperationWarnings) MarshalJSON() ([]byte, error) { 1148 type NoMethod OperationWarnings 1149 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1150 } 1151 1152 type OperationWarningsData struct { 1153 // Key: [Output Only] A key that provides more detail on the warning being 1154 // returned. For example, for warnings where there are no results in a list 1155 // request for a particular zone, this key might be scope and the key value 1156 // might be the zone name. Other examples might be a key indicating a 1157 // deprecated resource and a suggested replacement, or a warning about invalid 1158 // network settings (for example, if an instance attempts to perform IP 1159 // forwarding but is not enabled for IP forwarding). 1160 Key string `json:"key,omitempty"` 1161 // Value: [Output Only] A warning data value corresponding to the key. 1162 Value string `json:"value,omitempty"` 1163 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally 1164 // include in API requests. By default, fields with empty or default values are 1165 // omitted from API requests. See 1166 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1167 // details. 1168 ForceSendFields []string `json:"-"` 1169 // NullFields is a list of field names (e.g. "Key") to include in API requests 1170 // with the JSON null value. By default, fields with empty values are omitted 1171 // from API requests. See 1172 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1173 NullFields []string `json:"-"` 1174 } 1175 1176 func (s *OperationWarningsData) MarshalJSON() ([]byte, error) { 1177 type NoMethod OperationWarningsData 1178 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1179 } 1180 1181 // OperationsListResponse: A response containing a partial list of operations 1182 // and a page token used to build the next request if the request has been 1183 // truncated. 1184 type OperationsListResponse struct { 1185 // NextPageToken: Output only. A token used to continue a truncated list 1186 // request. 1187 NextPageToken string `json:"nextPageToken,omitempty"` 1188 // Operations: Output only. Operations contained in this list response. 1189 Operations []*Operation `json:"operations,omitempty"` 1190 1191 // ServerResponse contains the HTTP response code and headers from the server. 1192 googleapi.ServerResponse `json:"-"` 1193 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1194 // unconditionally include in API requests. By default, fields with empty or 1195 // default values are omitted from API requests. See 1196 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1197 // details. 1198 ForceSendFields []string `json:"-"` 1199 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 1200 // requests with the JSON null value. By default, fields with empty values are 1201 // omitted from API requests. See 1202 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1203 NullFields []string `json:"-"` 1204 } 1205 1206 func (s *OperationsListResponse) MarshalJSON() ([]byte, error) { 1207 type NoMethod OperationsListResponse 1208 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1209 } 1210 1211 // Policy: An Identity and Access Management (IAM) policy, which specifies 1212 // access controls for Google Cloud resources. A `Policy` is a collection of 1213 // `bindings`. A `binding` binds one or more `members`, or principals, to a 1214 // single `role`. Principals can be user accounts, service accounts, Google 1215 // groups, and domains (such as G Suite). A `role` is a named list of 1216 // permissions; each `role` can be an IAM predefined role or a user-created 1217 // custom role. For some types of Google Cloud resources, a `binding` can also 1218 // specify a `condition`, which is a logical expression that allows access to a 1219 // resource only if the expression evaluates to `true`. A condition can add 1220 // constraints based on attributes of the request, the resource, or both. To 1221 // learn which resources support conditions in their IAM policies, see the IAM 1222 // documentation 1223 // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON 1224 // example:** ``` { "bindings": [ { "role": 1225 // "roles/resourcemanager.organizationAdmin", "members": [ 1226 // "user:mike@example.com", "group:admins@example.com", "domain:google.com", 1227 // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": 1228 // "roles/resourcemanager.organizationViewer", "members": [ 1229 // "user:eve@example.com" ], "condition": { "title": "expirable access", 1230 // "description": "Does not grant access after Sep 2020", "expression": 1231 // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": 1232 // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: - 1233 // members: - user:mike@example.com - group:admins@example.com - 1234 // domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com 1235 // role: roles/resourcemanager.organizationAdmin - members: - 1236 // user:eve@example.com role: roles/resourcemanager.organizationViewer 1237 // condition: title: expirable access description: Does not grant access after 1238 // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') 1239 // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features, 1240 // see the IAM documentation (https://cloud.google.com/iam/docs/). 1241 type Policy struct { 1242 // AuditConfigs: Specifies cloud audit logging configuration for this policy. 1243 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"` 1244 // Bindings: Associates a list of `members`, or principals, with a `role`. 1245 // Optionally, may specify a `condition` that determines how and when the 1246 // `bindings` are applied. Each of the `bindings` must contain at least one 1247 // principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; 1248 // up to 250 of these principals can be Google groups. Each occurrence of a 1249 // principal counts towards these limits. For example, if the `bindings` grant 1250 // 50 different roles to `user:alice@example.com`, and not to any other 1251 // principal, then you can add another 1,450 principals to the `bindings` in 1252 // the `Policy`. 1253 Bindings []*Binding `json:"bindings,omitempty"` 1254 // Etag: `etag` is used for optimistic concurrency control as a way to help 1255 // prevent simultaneous updates of a policy from overwriting each other. It is 1256 // strongly suggested that systems make use of the `etag` in the 1257 // read-modify-write cycle to perform policy updates in order to avoid race 1258 // conditions: An `etag` is returned in the response to `getIamPolicy`, and 1259 // systems are expected to put that etag in the request to `setIamPolicy` to 1260 // ensure that their change will be applied to the same version of the policy. 1261 // **Important:** If you use IAM Conditions, you must include the `etag` field 1262 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows 1263 // you to overwrite a version `3` policy with a version `1` policy, and all of 1264 // the conditions in the version `3` policy are lost. 1265 Etag string `json:"etag,omitempty"` 1266 // Version: Specifies the format of the policy. Valid values are `0`, `1`, and 1267 // `3`. Requests that specify an invalid value are rejected. Any operation that 1268 // affects conditional role bindings must specify version `3`. This requirement 1269 // applies to the following operations: * Getting a policy that includes a 1270 // conditional role binding * Adding a conditional role binding to a policy * 1271 // Changing a conditional role binding in a policy * Removing any role binding, 1272 // with or without a condition, from a policy that includes conditions 1273 // **Important:** If you use IAM Conditions, you must include the `etag` field 1274 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows 1275 // you to overwrite a version `3` policy with a version `1` policy, and all of 1276 // the conditions in the version `3` policy are lost. If a policy does not 1277 // include any conditions, operations on that policy may specify any valid 1278 // version or leave the field unset. To learn which resources support 1279 // conditions in their IAM policies, see the IAM documentation 1280 // (https://cloud.google.com/iam/help/conditions/resource-policies). 1281 Version int64 `json:"version,omitempty"` 1282 1283 // ServerResponse contains the HTTP response code and headers from the server. 1284 googleapi.ServerResponse `json:"-"` 1285 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to 1286 // unconditionally include in API requests. By default, fields with empty or 1287 // default values are omitted from API requests. See 1288 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1289 // details. 1290 ForceSendFields []string `json:"-"` 1291 // NullFields is a list of field names (e.g. "AuditConfigs") to include in API 1292 // requests with the JSON null value. By default, fields with empty values are 1293 // omitted from API requests. See 1294 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1295 NullFields []string `json:"-"` 1296 } 1297 1298 func (s *Policy) MarshalJSON() ([]byte, error) { 1299 type NoMethod Policy 1300 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1301 } 1302 1303 type Resource struct { 1304 // AccessControl: The Access Control Policy set on this resource. 1305 AccessControl *ResourceAccessControl `json:"accessControl,omitempty"` 1306 // FinalProperties: Output only. The evaluated properties of the resource with 1307 // references expanded. Returned as serialized YAML. 1308 FinalProperties string `json:"finalProperties,omitempty"` 1309 Id uint64 `json:"id,omitempty,string"` 1310 // InsertTime: Output only. Creation timestamp in RFC3339 text format. 1311 InsertTime string `json:"insertTime,omitempty"` 1312 // Manifest: Output only. URL of the manifest representing the current 1313 // configuration of this resource. 1314 Manifest string `json:"manifest,omitempty"` 1315 // Name: Output only. The name of the resource as it appears in the YAML 1316 // config. 1317 Name string `json:"name,omitempty"` 1318 // Properties: Output only. The current properties of the resource before any 1319 // references have been filled in. Returned as serialized YAML. 1320 Properties string `json:"properties,omitempty"` 1321 // Type: Output only. The type of the resource, for example 1322 // `compute.v1.instance`, or `cloudfunctions.v1beta1.function`. 1323 Type string `json:"type,omitempty"` 1324 // Update: Output only. If Deployment Manager is currently updating or 1325 // previewing an update to this resource, the updated configuration appears 1326 // here. 1327 Update *ResourceUpdate `json:"update,omitempty"` 1328 // UpdateTime: Output only. Update timestamp in RFC3339 text format. 1329 UpdateTime string `json:"updateTime,omitempty"` 1330 // Url: Output only. The URL of the actual resource. 1331 Url string `json:"url,omitempty"` 1332 // Warnings: Output only. If warning messages are generated during processing 1333 // of this resource, this field will be populated. 1334 Warnings []*ResourceWarnings `json:"warnings,omitempty"` 1335 1336 // ServerResponse contains the HTTP response code and headers from the server. 1337 googleapi.ServerResponse `json:"-"` 1338 // ForceSendFields is a list of field names (e.g. "AccessControl") to 1339 // unconditionally include in API requests. By default, fields with empty or 1340 // default values are omitted from API requests. See 1341 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1342 // details. 1343 ForceSendFields []string `json:"-"` 1344 // NullFields is a list of field names (e.g. "AccessControl") to include in API 1345 // requests with the JSON null value. By default, fields with empty values are 1346 // omitted from API requests. See 1347 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1348 NullFields []string `json:"-"` 1349 } 1350 1351 func (s *Resource) MarshalJSON() ([]byte, error) { 1352 type NoMethod Resource 1353 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1354 } 1355 1356 type ResourceWarnings struct { 1357 // Code: [Output Only] A warning code, if applicable. For example, Compute 1358 // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. 1359 // 1360 // Possible values: 1361 // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created. 1362 // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. 1363 // "UNREACHABLE" - A given scope cannot be reached. 1364 // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not 1365 // assigned to an instance on the network. 1366 // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to 1367 // an instance that does not exist. 1368 // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL 1369 // refers to an instance that is not on the same network as the route. 1370 // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip 1371 // forward. 1372 // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a 1373 // status of RUNNING. 1374 // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected 1375 // kernel, which is deprecated. 1376 // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that 1377 // requires a TOS they have not accepted. 1378 // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is 1379 // larger than image size. 1380 // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete 1381 // could not be deleted because they were in use. 1382 // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance 1383 // group manager is valid as such, but its application does not make a lot of 1384 // sense, because it allows only single instance in instance group. 1385 // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue 1386 // the process despite the mentioned error. 1387 // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made 1388 // by a failed operation. 1389 // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been 1390 // overridden. Deprecated unused field. 1391 // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is 1392 // in use. 1393 // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type 1394 // "EXTERNAL_API_WARNING" - Warning that is present in an external api call 1395 // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is 1396 // ignored. 1397 // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are 1398 // present 1399 // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the 1400 // resources has a type marked as experimental 1401 // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources 1402 // has a type marked as deprecated 1403 // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing 1404 // due to errors 1405 // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a 1406 // exceedingly large number of resources 1407 // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance 1408 // URL refers to an instance that does not have an ipv6 interface on the same 1409 // network as the route. 1410 // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend 1411 // service is associated with a health check that is not of type 1412 // HTTP/HTTPS/HTTP2. 1413 // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list 1414 // overhead quota exceed which captures the amount of resources filtered out by 1415 // user-defined list filter. 1416 Code string `json:"code,omitempty"` 1417 // Data: [Output Only] Metadata about this warning in key: value format. For 1418 // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } 1419 Data []*ResourceWarningsData `json:"data,omitempty"` 1420 // Message: [Output Only] A human-readable description of the warning code. 1421 Message string `json:"message,omitempty"` 1422 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 1423 // include in API requests. By default, fields with empty or default values are 1424 // omitted from API requests. See 1425 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1426 // details. 1427 ForceSendFields []string `json:"-"` 1428 // NullFields is a list of field names (e.g. "Code") to include in API requests 1429 // with the JSON null value. By default, fields with empty values are omitted 1430 // from API requests. See 1431 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1432 NullFields []string `json:"-"` 1433 } 1434 1435 func (s *ResourceWarnings) MarshalJSON() ([]byte, error) { 1436 type NoMethod ResourceWarnings 1437 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1438 } 1439 1440 type ResourceWarningsData struct { 1441 // Key: [Output Only] A key that provides more detail on the warning being 1442 // returned. For example, for warnings where there are no results in a list 1443 // request for a particular zone, this key might be scope and the key value 1444 // might be the zone name. Other examples might be a key indicating a 1445 // deprecated resource and a suggested replacement, or a warning about invalid 1446 // network settings (for example, if an instance attempts to perform IP 1447 // forwarding but is not enabled for IP forwarding). 1448 Key string `json:"key,omitempty"` 1449 // Value: [Output Only] A warning data value corresponding to the key. 1450 Value string `json:"value,omitempty"` 1451 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally 1452 // include in API requests. By default, fields with empty or default values are 1453 // omitted from API requests. See 1454 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1455 // details. 1456 ForceSendFields []string `json:"-"` 1457 // NullFields is a list of field names (e.g. "Key") to include in API requests 1458 // with the JSON null value. By default, fields with empty values are omitted 1459 // from API requests. See 1460 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1461 NullFields []string `json:"-"` 1462 } 1463 1464 func (s *ResourceWarningsData) MarshalJSON() ([]byte, error) { 1465 type NoMethod ResourceWarningsData 1466 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1467 } 1468 1469 // ResourceAccessControl: The access controls set on the resource. 1470 type ResourceAccessControl struct { 1471 // GcpIamPolicy: The GCP IAM Policy to set on the resource. 1472 GcpIamPolicy string `json:"gcpIamPolicy,omitempty"` 1473 // ForceSendFields is a list of field names (e.g. "GcpIamPolicy") to 1474 // unconditionally include in API requests. By default, fields with empty or 1475 // default values are omitted from API requests. See 1476 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1477 // details. 1478 ForceSendFields []string `json:"-"` 1479 // NullFields is a list of field names (e.g. "GcpIamPolicy") to include in API 1480 // requests with the JSON null value. By default, fields with empty values are 1481 // omitted from API requests. See 1482 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1483 NullFields []string `json:"-"` 1484 } 1485 1486 func (s *ResourceAccessControl) MarshalJSON() ([]byte, error) { 1487 type NoMethod ResourceAccessControl 1488 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1489 } 1490 1491 type ResourceUpdate struct { 1492 // AccessControl: The Access Control Policy to set on this resource after 1493 // updating the resource itself. 1494 AccessControl *ResourceAccessControl `json:"accessControl,omitempty"` 1495 // Error: Output only. If errors are generated during update of the resource, 1496 // this field will be populated. 1497 Error *ResourceUpdateError `json:"error,omitempty"` 1498 // FinalProperties: Output only. The expanded properties of the resource with 1499 // reference values expanded. Returned as serialized YAML. 1500 FinalProperties string `json:"finalProperties,omitempty"` 1501 // Intent: Output only. The intent of the resource: `PREVIEW`, `UPDATE`, or 1502 // `CANCEL`. 1503 // 1504 // Possible values: 1505 // "CREATE_OR_ACQUIRE" - The resource is scheduled to be created, or if it 1506 // already exists, acquired. 1507 // "DELETE" - The resource is scheduled to be deleted. 1508 // "ACQUIRE" - The resource is scheduled to be acquired. 1509 // "UPDATE" - The resource is scheduled to be updated via the UPDATE method. 1510 // "ABANDON" - The resource is scheduled to be abandoned. 1511 // "CREATE" - The resource is scheduled to be created. 1512 Intent string `json:"intent,omitempty"` 1513 // Manifest: Output only. URL of the manifest representing the update 1514 // configuration of this resource. 1515 Manifest string `json:"manifest,omitempty"` 1516 // Properties: Output only. The set of updated properties for this resource, 1517 // before references are expanded. Returned as serialized YAML. 1518 Properties string `json:"properties,omitempty"` 1519 // State: Output only. The state of the resource. 1520 // 1521 // Possible values: 1522 // "PENDING" - There are changes pending for this resource. 1523 // "IN_PROGRESS" - The service is executing changes on the resource. 1524 // "IN_PREVIEW" - The service is previewing changes on the resource. 1525 // "FAILED" - The service has failed to change the resource. 1526 // "ABORTED" - The service has aborted trying to change the resource. 1527 State string `json:"state,omitempty"` 1528 // Warnings: Output only. If warning messages are generated during processing 1529 // of this resource, this field will be populated. 1530 Warnings []*ResourceUpdateWarnings `json:"warnings,omitempty"` 1531 // ForceSendFields is a list of field names (e.g. "AccessControl") to 1532 // unconditionally include in API requests. By default, fields with empty or 1533 // default values are omitted from API requests. See 1534 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1535 // details. 1536 ForceSendFields []string `json:"-"` 1537 // NullFields is a list of field names (e.g. "AccessControl") to include in API 1538 // requests with the JSON null value. By default, fields with empty values are 1539 // omitted from API requests. See 1540 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1541 NullFields []string `json:"-"` 1542 } 1543 1544 func (s *ResourceUpdate) MarshalJSON() ([]byte, error) { 1545 type NoMethod ResourceUpdate 1546 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1547 } 1548 1549 // ResourceUpdateError: Output only. If errors are generated during update of 1550 // the resource, this field will be populated. 1551 type ResourceUpdateError struct { 1552 // Errors: [Output Only] The array of errors encountered while processing this 1553 // operation. 1554 Errors []*ResourceUpdateErrorErrors `json:"errors,omitempty"` 1555 // ForceSendFields is a list of field names (e.g. "Errors") to unconditionally 1556 // include in API requests. By default, fields with empty or default values are 1557 // omitted from API requests. See 1558 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1559 // details. 1560 ForceSendFields []string `json:"-"` 1561 // NullFields is a list of field names (e.g. "Errors") to include in API 1562 // requests with the JSON null value. By default, fields with empty values are 1563 // omitted from API requests. See 1564 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1565 NullFields []string `json:"-"` 1566 } 1567 1568 func (s *ResourceUpdateError) MarshalJSON() ([]byte, error) { 1569 type NoMethod ResourceUpdateError 1570 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1571 } 1572 1573 type ResourceUpdateErrorErrors struct { 1574 // Code: [Output Only] The error type identifier for this error. 1575 Code string `json:"code,omitempty"` 1576 // Location: [Output Only] Indicates the field in the request that caused the 1577 // error. This property is optional. 1578 Location string `json:"location,omitempty"` 1579 // Message: [Output Only] An optional, human-readable error message. 1580 Message string `json:"message,omitempty"` 1581 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 1582 // include in API requests. By default, fields with empty or default values are 1583 // omitted from API requests. See 1584 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1585 // details. 1586 ForceSendFields []string `json:"-"` 1587 // NullFields is a list of field names (e.g. "Code") to include in API requests 1588 // with the JSON null value. By default, fields with empty values are omitted 1589 // from API requests. See 1590 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1591 NullFields []string `json:"-"` 1592 } 1593 1594 func (s *ResourceUpdateErrorErrors) MarshalJSON() ([]byte, error) { 1595 type NoMethod ResourceUpdateErrorErrors 1596 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1597 } 1598 1599 type ResourceUpdateWarnings struct { 1600 // Code: [Output Only] A warning code, if applicable. For example, Compute 1601 // Engine returns NO_RESULTS_ON_PAGE if there are no results in the response. 1602 // 1603 // Possible values: 1604 // "DEPRECATED_RESOURCE_USED" - A link to a deprecated resource was created. 1605 // "NO_RESULTS_ON_PAGE" - No results are present on a particular list page. 1606 // "UNREACHABLE" - A given scope cannot be reached. 1607 // "NEXT_HOP_ADDRESS_NOT_ASSIGNED" - The route's nextHopIp address is not 1608 // assigned to an instance on the network. 1609 // "NEXT_HOP_INSTANCE_NOT_FOUND" - The route's nextHopInstance URL refers to 1610 // an instance that does not exist. 1611 // "NEXT_HOP_INSTANCE_NOT_ON_NETWORK" - The route's nextHopInstance URL 1612 // refers to an instance that is not on the same network as the route. 1613 // "NEXT_HOP_CANNOT_IP_FORWARD" - The route's next hop instance cannot ip 1614 // forward. 1615 // "NEXT_HOP_NOT_RUNNING" - The route's next hop instance does not have a 1616 // status of RUNNING. 1617 // "INJECTED_KERNELS_DEPRECATED" - The operation involved use of an injected 1618 // kernel, which is deprecated. 1619 // "REQUIRED_TOS_AGREEMENT" - The user attempted to use a resource that 1620 // requires a TOS they have not accepted. 1621 // "DISK_SIZE_LARGER_THAN_IMAGE_SIZE" - The user created a boot disk that is 1622 // larger than image size. 1623 // "RESOURCE_NOT_DELETED" - One or more of the resources set to auto-delete 1624 // could not be deleted because they were in use. 1625 // "SINGLE_INSTANCE_PROPERTY_TEMPLATE" - Instance template used in instance 1626 // group manager is valid as such, but its application does not make a lot of 1627 // sense, because it allows only single instance in instance group. 1628 // "NOT_CRITICAL_ERROR" - Error which is not critical. We decided to continue 1629 // the process despite the mentioned error. 1630 // "CLEANUP_FAILED" - Warning about failed cleanup of transient changes made 1631 // by a failed operation. 1632 // "FIELD_VALUE_OVERRIDEN" - Warning that value of a field has been 1633 // overridden. Deprecated unused field. 1634 // "RESOURCE_IN_USE_BY_OTHER_RESOURCE_WARNING" - Warning that a resource is 1635 // in use. 1636 // "MISSING_TYPE_DEPENDENCY" - A resource depends on a missing type 1637 // "EXTERNAL_API_WARNING" - Warning that is present in an external api call 1638 // "SCHEMA_VALIDATION_IGNORED" - When a resource schema validation is 1639 // ignored. 1640 // "UNDECLARED_PROPERTIES" - When undeclared properties in the schema are 1641 // present 1642 // "EXPERIMENTAL_TYPE_USED" - When deploying and at least one of the 1643 // resources has a type marked as experimental 1644 // "DEPRECATED_TYPE_USED" - When deploying and at least one of the resources 1645 // has a type marked as deprecated 1646 // "PARTIAL_SUCCESS" - Success is reported, but some results may be missing 1647 // due to errors 1648 // "LARGE_DEPLOYMENT_WARNING" - When deploying a deployment with a 1649 // exceedingly large number of resources 1650 // "NEXT_HOP_INSTANCE_HAS_NO_IPV6_INTERFACE" - The route's nextHopInstance 1651 // URL refers to an instance that does not have an ipv6 interface on the same 1652 // network as the route. 1653 // "INVALID_HEALTH_CHECK_FOR_DYNAMIC_WIEGHTED_LB" - A WEIGHTED_MAGLEV backend 1654 // service is associated with a health check that is not of type 1655 // HTTP/HTTPS/HTTP2. 1656 // "LIST_OVERHEAD_QUOTA_EXCEED" - Resource can't be retrieved due to list 1657 // overhead quota exceed which captures the amount of resources filtered out by 1658 // user-defined list filter. 1659 Code string `json:"code,omitempty"` 1660 // Data: [Output Only] Metadata about this warning in key: value format. For 1661 // example: "data": [ { "key": "scope", "value": "zones/us-east1-d" } 1662 Data []*ResourceUpdateWarningsData `json:"data,omitempty"` 1663 // Message: [Output Only] A human-readable description of the warning code. 1664 Message string `json:"message,omitempty"` 1665 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 1666 // include in API requests. By default, fields with empty or default values are 1667 // omitted from API requests. See 1668 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1669 // details. 1670 ForceSendFields []string `json:"-"` 1671 // NullFields is a list of field names (e.g. "Code") to include in API requests 1672 // with the JSON null value. By default, fields with empty values are omitted 1673 // from API requests. See 1674 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1675 NullFields []string `json:"-"` 1676 } 1677 1678 func (s *ResourceUpdateWarnings) MarshalJSON() ([]byte, error) { 1679 type NoMethod ResourceUpdateWarnings 1680 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1681 } 1682 1683 type ResourceUpdateWarningsData struct { 1684 // Key: [Output Only] A key that provides more detail on the warning being 1685 // returned. For example, for warnings where there are no results in a list 1686 // request for a particular zone, this key might be scope and the key value 1687 // might be the zone name. Other examples might be a key indicating a 1688 // deprecated resource and a suggested replacement, or a warning about invalid 1689 // network settings (for example, if an instance attempts to perform IP 1690 // forwarding but is not enabled for IP forwarding). 1691 Key string `json:"key,omitempty"` 1692 // Value: [Output Only] A warning data value corresponding to the key. 1693 Value string `json:"value,omitempty"` 1694 // ForceSendFields is a list of field names (e.g. "Key") to unconditionally 1695 // include in API requests. By default, fields with empty or default values are 1696 // omitted from API requests. See 1697 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1698 // details. 1699 ForceSendFields []string `json:"-"` 1700 // NullFields is a list of field names (e.g. "Key") to include in API requests 1701 // with the JSON null value. By default, fields with empty values are omitted 1702 // from API requests. See 1703 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1704 NullFields []string `json:"-"` 1705 } 1706 1707 func (s *ResourceUpdateWarningsData) MarshalJSON() ([]byte, error) { 1708 type NoMethod ResourceUpdateWarningsData 1709 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1710 } 1711 1712 // ResourcesListResponse: A response containing a partial list of resources and 1713 // a page token used to build the next request if the request has been 1714 // truncated. 1715 type ResourcesListResponse struct { 1716 // NextPageToken: A token used to continue a truncated list request. 1717 NextPageToken string `json:"nextPageToken,omitempty"` 1718 // Resources: Resources contained in this list response. 1719 Resources []*Resource `json:"resources,omitempty"` 1720 1721 // ServerResponse contains the HTTP response code and headers from the server. 1722 googleapi.ServerResponse `json:"-"` 1723 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1724 // unconditionally include in API requests. By default, fields with empty or 1725 // default values are omitted from API requests. See 1726 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1727 // details. 1728 ForceSendFields []string `json:"-"` 1729 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 1730 // requests with the JSON null value. By default, fields with empty values are 1731 // omitted from API requests. See 1732 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1733 NullFields []string `json:"-"` 1734 } 1735 1736 func (s *ResourcesListResponse) MarshalJSON() ([]byte, error) { 1737 type NoMethod ResourcesListResponse 1738 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1739 } 1740 1741 type SetCommonInstanceMetadataOperationMetadata struct { 1742 // ClientOperationId: [Output Only] The client operation id. 1743 ClientOperationId string `json:"clientOperationId,omitempty"` 1744 // PerLocationOperations: [Output Only] Status information per location 1745 // (location name is key). Example key: zones/us-central1-a 1746 PerLocationOperations map[string]SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo `json:"perLocationOperations,omitempty"` 1747 // ForceSendFields is a list of field names (e.g. "ClientOperationId") to 1748 // unconditionally include in API requests. By default, fields with empty or 1749 // default values are omitted from API requests. See 1750 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1751 // details. 1752 ForceSendFields []string `json:"-"` 1753 // NullFields is a list of field names (e.g. "ClientOperationId") to include in 1754 // API requests with the JSON null value. By default, fields with empty values 1755 // are omitted from API requests. See 1756 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1757 NullFields []string `json:"-"` 1758 } 1759 1760 func (s *SetCommonInstanceMetadataOperationMetadata) MarshalJSON() ([]byte, error) { 1761 type NoMethod SetCommonInstanceMetadataOperationMetadata 1762 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1763 } 1764 1765 type SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo struct { 1766 // Error: [Output Only] If state is `ABANDONED` or `FAILED`, this field is 1767 // populated. 1768 Error *Status `json:"error,omitempty"` 1769 // State: [Output Only] Status of the action, which can be one of the 1770 // following: `PROPAGATING`, `PROPAGATED`, `ABANDONED`, `FAILED`, or `DONE`. 1771 // 1772 // Possible values: 1773 // "UNSPECIFIED" 1774 // "PROPAGATING" - Operation is not yet confirmed to have been created in the 1775 // location. 1776 // "PROPAGATED" - Operation is confirmed to be in the location. 1777 // "ABANDONED" - Operation not tracked in this location e.g. zone is marked 1778 // as DOWN. 1779 // "FAILED" - Operation is in an error state. 1780 // "DONE" - Operation has completed successfully. 1781 State string `json:"state,omitempty"` 1782 // ForceSendFields is a list of field names (e.g. "Error") to unconditionally 1783 // include in API requests. By default, fields with empty or default values are 1784 // omitted from API requests. See 1785 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1786 // details. 1787 ForceSendFields []string `json:"-"` 1788 // NullFields is a list of field names (e.g. "Error") to include in API 1789 // requests with the JSON null value. By default, fields with empty values are 1790 // omitted from API requests. See 1791 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1792 NullFields []string `json:"-"` 1793 } 1794 1795 func (s *SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo) MarshalJSON() ([]byte, error) { 1796 type NoMethod SetCommonInstanceMetadataOperationMetadataPerLocationOperationInfo 1797 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1798 } 1799 1800 // Status: The `Status` type defines a logical error model that is suitable for 1801 // different programming environments, including REST APIs and RPC APIs. It is 1802 // used by gRPC (https://github.com/grpc). Each `Status` message contains three 1803 // pieces of data: error code, error message, and error details. You can find 1804 // out more about this error model and how to work with it in the API Design 1805 // Guide (https://cloud.google.com/apis/design/errors). 1806 type Status struct { 1807 // Code: The status code, which should be an enum value of google.rpc.Code. 1808 Code int64 `json:"code,omitempty"` 1809 // Details: A list of messages that carry the error details. There is a common 1810 // set of message types for APIs to use. 1811 Details []googleapi.RawMessage `json:"details,omitempty"` 1812 // Message: A developer-facing error message, which should be in English. Any 1813 // user-facing error message should be localized and sent in the 1814 // google.rpc.Status.details field, or localized by the client. 1815 Message string `json:"message,omitempty"` 1816 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 1817 // include in API requests. By default, fields with empty or default values are 1818 // omitted from API requests. See 1819 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1820 // details. 1821 ForceSendFields []string `json:"-"` 1822 // NullFields is a list of field names (e.g. "Code") to include in API requests 1823 // with the JSON null value. By default, fields with empty values are omitted 1824 // from API requests. See 1825 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1826 NullFields []string `json:"-"` 1827 } 1828 1829 func (s *Status) MarshalJSON() ([]byte, error) { 1830 type NoMethod Status 1831 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1832 } 1833 1834 type TargetConfiguration struct { 1835 // Config: The configuration to use for this deployment. 1836 Config *ConfigFile `json:"config,omitempty"` 1837 // Imports: Specifies any files to import for this configuration. This can be 1838 // used to import templates or other files. For example, you might import a 1839 // text file in order to use the file in a template. 1840 Imports []*ImportFile `json:"imports,omitempty"` 1841 // ForceSendFields is a list of field names (e.g. "Config") to unconditionally 1842 // include in API requests. By default, fields with empty or default values are 1843 // omitted from API requests. See 1844 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1845 // details. 1846 ForceSendFields []string `json:"-"` 1847 // NullFields is a list of field names (e.g. "Config") to include in API 1848 // requests with the JSON null value. By default, fields with empty values are 1849 // omitted from API requests. See 1850 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1851 NullFields []string `json:"-"` 1852 } 1853 1854 func (s *TargetConfiguration) MarshalJSON() ([]byte, error) { 1855 type NoMethod TargetConfiguration 1856 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1857 } 1858 1859 type TestPermissionsRequest struct { 1860 // Permissions: The set of permissions to check for the 'resource'. Permissions 1861 // with wildcards (such as '*' or 'storage.*') are not allowed. 1862 Permissions []string `json:"permissions,omitempty"` 1863 // ForceSendFields is a list of field names (e.g. "Permissions") to 1864 // unconditionally include in API requests. By default, fields with empty or 1865 // default values are omitted from API requests. See 1866 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1867 // details. 1868 ForceSendFields []string `json:"-"` 1869 // NullFields is a list of field names (e.g. "Permissions") to include in API 1870 // requests with the JSON null value. By default, fields with empty values are 1871 // omitted from API requests. See 1872 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1873 NullFields []string `json:"-"` 1874 } 1875 1876 func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) { 1877 type NoMethod TestPermissionsRequest 1878 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1879 } 1880 1881 type TestPermissionsResponse struct { 1882 // Permissions: A subset of `TestPermissionsRequest.permissions` that the 1883 // caller is allowed. 1884 Permissions []string `json:"permissions,omitempty"` 1885 1886 // ServerResponse contains the HTTP response code and headers from the server. 1887 googleapi.ServerResponse `json:"-"` 1888 // ForceSendFields is a list of field names (e.g. "Permissions") to 1889 // unconditionally include in API requests. By default, fields with empty or 1890 // default values are omitted from API requests. See 1891 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1892 // details. 1893 ForceSendFields []string `json:"-"` 1894 // NullFields is a list of field names (e.g. "Permissions") to include in API 1895 // requests with the JSON null value. By default, fields with empty values are 1896 // omitted from API requests. See 1897 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1898 NullFields []string `json:"-"` 1899 } 1900 1901 func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) { 1902 type NoMethod TestPermissionsResponse 1903 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1904 } 1905 1906 // Type: A resource type supported by Deployment Manager. 1907 type Type struct { 1908 Id uint64 `json:"id,omitempty,string"` 1909 // InsertTime: Output only. Creation timestamp in RFC3339 text format. 1910 InsertTime string `json:"insertTime,omitempty"` 1911 // Name: Name of the type. 1912 Name string `json:"name,omitempty"` 1913 // Operation: Output only. The Operation that most recently ran, or is 1914 // currently running, on this type. 1915 Operation *Operation `json:"operation,omitempty"` 1916 // SelfLink: Output only. Server defined URL for the resource. 1917 SelfLink string `json:"selfLink,omitempty"` 1918 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally 1919 // include in API requests. By default, fields with empty or default values are 1920 // omitted from API requests. See 1921 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1922 // details. 1923 ForceSendFields []string `json:"-"` 1924 // NullFields is a list of field names (e.g. "Id") to include in API requests 1925 // with the JSON null value. By default, fields with empty values are omitted 1926 // from API requests. See 1927 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1928 NullFields []string `json:"-"` 1929 } 1930 1931 func (s *Type) MarshalJSON() ([]byte, error) { 1932 type NoMethod Type 1933 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1934 } 1935 1936 // TypesListResponse: A response that returns all Types supported by Deployment 1937 // Manager 1938 type TypesListResponse struct { 1939 // NextPageToken: A token used to continue a truncated list request. 1940 NextPageToken string `json:"nextPageToken,omitempty"` 1941 // Types: Output only. A list of resource types supported by Deployment 1942 // Manager. 1943 Types []*Type `json:"types,omitempty"` 1944 1945 // ServerResponse contains the HTTP response code and headers from the server. 1946 googleapi.ServerResponse `json:"-"` 1947 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1948 // unconditionally include in API requests. By default, fields with empty or 1949 // default values are omitted from API requests. See 1950 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1951 // details. 1952 ForceSendFields []string `json:"-"` 1953 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 1954 // requests with the JSON null value. By default, fields with empty values are 1955 // omitted from API requests. See 1956 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1957 NullFields []string `json:"-"` 1958 } 1959 1960 func (s *TypesListResponse) MarshalJSON() ([]byte, error) { 1961 type NoMethod TypesListResponse 1962 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1963 } 1964 1965 type DeploymentsCancelPreviewCall struct { 1966 s *Service 1967 project string 1968 deployment string 1969 deploymentscancelpreviewrequest *DeploymentsCancelPreviewRequest 1970 urlParams_ gensupport.URLParams 1971 ctx_ context.Context 1972 header_ http.Header 1973 } 1974 1975 // CancelPreview: Cancels and removes the preview currently associated with the 1976 // deployment. 1977 // 1978 // - deployment: The name of the deployment for this request. 1979 // - project: The project ID for this request. 1980 func (r *DeploymentsService) CancelPreview(project string, deployment string, deploymentscancelpreviewrequest *DeploymentsCancelPreviewRequest) *DeploymentsCancelPreviewCall { 1981 c := &DeploymentsCancelPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1982 c.project = project 1983 c.deployment = deployment 1984 c.deploymentscancelpreviewrequest = deploymentscancelpreviewrequest 1985 return c 1986 } 1987 1988 // Fields allows partial responses to be retrieved. See 1989 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1990 // details. 1991 func (c *DeploymentsCancelPreviewCall) Fields(s ...googleapi.Field) *DeploymentsCancelPreviewCall { 1992 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1993 return c 1994 } 1995 1996 // Context sets the context to be used in this call's Do method. 1997 func (c *DeploymentsCancelPreviewCall) Context(ctx context.Context) *DeploymentsCancelPreviewCall { 1998 c.ctx_ = ctx 1999 return c 2000 } 2001 2002 // Header returns a http.Header that can be modified by the caller to add 2003 // headers to the request. 2004 func (c *DeploymentsCancelPreviewCall) Header() http.Header { 2005 if c.header_ == nil { 2006 c.header_ = make(http.Header) 2007 } 2008 return c.header_ 2009 } 2010 2011 func (c *DeploymentsCancelPreviewCall) doRequest(alt string) (*http.Response, error) { 2012 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2013 var body io.Reader = nil 2014 body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentscancelpreviewrequest) 2015 if err != nil { 2016 return nil, err 2017 } 2018 c.urlParams_.Set("alt", alt) 2019 c.urlParams_.Set("prettyPrint", "false") 2020 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/cancelPreview") 2021 urls += "?" + c.urlParams_.Encode() 2022 req, err := http.NewRequest("POST", urls, body) 2023 if err != nil { 2024 return nil, err 2025 } 2026 req.Header = reqHeaders 2027 googleapi.Expand(req.URL, map[string]string{ 2028 "project": c.project, 2029 "deployment": c.deployment, 2030 }) 2031 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2032 } 2033 2034 // Do executes the "deploymentmanager.deployments.cancelPreview" call. 2035 // Any non-2xx status code is an error. Response headers are in either 2036 // *Operation.ServerResponse.Header or (if a response was returned at all) in 2037 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2038 // whether the returned error was because http.StatusNotModified was returned. 2039 func (c *DeploymentsCancelPreviewCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2040 gensupport.SetOptions(c.urlParams_, opts...) 2041 res, err := c.doRequest("json") 2042 if res != nil && res.StatusCode == http.StatusNotModified { 2043 if res.Body != nil { 2044 res.Body.Close() 2045 } 2046 return nil, gensupport.WrapError(&googleapi.Error{ 2047 Code: res.StatusCode, 2048 Header: res.Header, 2049 }) 2050 } 2051 if err != nil { 2052 return nil, err 2053 } 2054 defer googleapi.CloseBody(res) 2055 if err := googleapi.CheckResponse(res); err != nil { 2056 return nil, gensupport.WrapError(err) 2057 } 2058 ret := &Operation{ 2059 ServerResponse: googleapi.ServerResponse{ 2060 Header: res.Header, 2061 HTTPStatusCode: res.StatusCode, 2062 }, 2063 } 2064 target := &ret 2065 if err := gensupport.DecodeResponse(target, res); err != nil { 2066 return nil, err 2067 } 2068 return ret, nil 2069 } 2070 2071 type DeploymentsDeleteCall struct { 2072 s *Service 2073 project string 2074 deployment string 2075 urlParams_ gensupport.URLParams 2076 ctx_ context.Context 2077 header_ http.Header 2078 } 2079 2080 // Delete: Deletes a deployment and all of the resources in the deployment. 2081 // 2082 // - deployment: The name of the deployment for this request. 2083 // - project: The project ID for this request. 2084 func (r *DeploymentsService) Delete(project string, deployment string) *DeploymentsDeleteCall { 2085 c := &DeploymentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2086 c.project = project 2087 c.deployment = deployment 2088 return c 2089 } 2090 2091 // DeletePolicy sets the optional parameter "deletePolicy": Sets the policy to 2092 // use for deleting resources. 2093 // 2094 // Possible values: 2095 // 2096 // "DELETE" (default) 2097 // "ABANDON" 2098 func (c *DeploymentsDeleteCall) DeletePolicy(deletePolicy string) *DeploymentsDeleteCall { 2099 c.urlParams_.Set("deletePolicy", deletePolicy) 2100 return c 2101 } 2102 2103 // Fields allows partial responses to be retrieved. See 2104 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2105 // details. 2106 func (c *DeploymentsDeleteCall) Fields(s ...googleapi.Field) *DeploymentsDeleteCall { 2107 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2108 return c 2109 } 2110 2111 // Context sets the context to be used in this call's Do method. 2112 func (c *DeploymentsDeleteCall) Context(ctx context.Context) *DeploymentsDeleteCall { 2113 c.ctx_ = ctx 2114 return c 2115 } 2116 2117 // Header returns a http.Header that can be modified by the caller to add 2118 // headers to the request. 2119 func (c *DeploymentsDeleteCall) Header() http.Header { 2120 if c.header_ == nil { 2121 c.header_ = make(http.Header) 2122 } 2123 return c.header_ 2124 } 2125 2126 func (c *DeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) { 2127 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2128 var body io.Reader = nil 2129 c.urlParams_.Set("alt", alt) 2130 c.urlParams_.Set("prettyPrint", "false") 2131 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}") 2132 urls += "?" + c.urlParams_.Encode() 2133 req, err := http.NewRequest("DELETE", urls, body) 2134 if err != nil { 2135 return nil, err 2136 } 2137 req.Header = reqHeaders 2138 googleapi.Expand(req.URL, map[string]string{ 2139 "project": c.project, 2140 "deployment": c.deployment, 2141 }) 2142 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2143 } 2144 2145 // Do executes the "deploymentmanager.deployments.delete" call. 2146 // Any non-2xx status code is an error. Response headers are in either 2147 // *Operation.ServerResponse.Header or (if a response was returned at all) in 2148 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2149 // whether the returned error was because http.StatusNotModified was returned. 2150 func (c *DeploymentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2151 gensupport.SetOptions(c.urlParams_, opts...) 2152 res, err := c.doRequest("json") 2153 if res != nil && res.StatusCode == http.StatusNotModified { 2154 if res.Body != nil { 2155 res.Body.Close() 2156 } 2157 return nil, gensupport.WrapError(&googleapi.Error{ 2158 Code: res.StatusCode, 2159 Header: res.Header, 2160 }) 2161 } 2162 if err != nil { 2163 return nil, err 2164 } 2165 defer googleapi.CloseBody(res) 2166 if err := googleapi.CheckResponse(res); err != nil { 2167 return nil, gensupport.WrapError(err) 2168 } 2169 ret := &Operation{ 2170 ServerResponse: googleapi.ServerResponse{ 2171 Header: res.Header, 2172 HTTPStatusCode: res.StatusCode, 2173 }, 2174 } 2175 target := &ret 2176 if err := gensupport.DecodeResponse(target, res); err != nil { 2177 return nil, err 2178 } 2179 return ret, nil 2180 } 2181 2182 type DeploymentsGetCall struct { 2183 s *Service 2184 project string 2185 deployment string 2186 urlParams_ gensupport.URLParams 2187 ifNoneMatch_ string 2188 ctx_ context.Context 2189 header_ http.Header 2190 } 2191 2192 // Get: Gets information about a specific deployment. 2193 // 2194 // - deployment: The name of the deployment for this request. 2195 // - project: The project ID for this request. 2196 func (r *DeploymentsService) Get(project string, deployment string) *DeploymentsGetCall { 2197 c := &DeploymentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2198 c.project = project 2199 c.deployment = deployment 2200 return c 2201 } 2202 2203 // Fields allows partial responses to be retrieved. See 2204 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2205 // details. 2206 func (c *DeploymentsGetCall) Fields(s ...googleapi.Field) *DeploymentsGetCall { 2207 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2208 return c 2209 } 2210 2211 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2212 // object's ETag matches the given value. This is useful for getting updates 2213 // only after the object has changed since the last request. 2214 func (c *DeploymentsGetCall) IfNoneMatch(entityTag string) *DeploymentsGetCall { 2215 c.ifNoneMatch_ = entityTag 2216 return c 2217 } 2218 2219 // Context sets the context to be used in this call's Do method. 2220 func (c *DeploymentsGetCall) Context(ctx context.Context) *DeploymentsGetCall { 2221 c.ctx_ = ctx 2222 return c 2223 } 2224 2225 // Header returns a http.Header that can be modified by the caller to add 2226 // headers to the request. 2227 func (c *DeploymentsGetCall) Header() http.Header { 2228 if c.header_ == nil { 2229 c.header_ = make(http.Header) 2230 } 2231 return c.header_ 2232 } 2233 2234 func (c *DeploymentsGetCall) doRequest(alt string) (*http.Response, error) { 2235 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2236 if c.ifNoneMatch_ != "" { 2237 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2238 } 2239 var body io.Reader = nil 2240 c.urlParams_.Set("alt", alt) 2241 c.urlParams_.Set("prettyPrint", "false") 2242 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}") 2243 urls += "?" + c.urlParams_.Encode() 2244 req, err := http.NewRequest("GET", urls, body) 2245 if err != nil { 2246 return nil, err 2247 } 2248 req.Header = reqHeaders 2249 googleapi.Expand(req.URL, map[string]string{ 2250 "project": c.project, 2251 "deployment": c.deployment, 2252 }) 2253 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2254 } 2255 2256 // Do executes the "deploymentmanager.deployments.get" call. 2257 // Any non-2xx status code is an error. Response headers are in either 2258 // *Deployment.ServerResponse.Header or (if a response was returned at all) in 2259 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2260 // whether the returned error was because http.StatusNotModified was returned. 2261 func (c *DeploymentsGetCall) Do(opts ...googleapi.CallOption) (*Deployment, 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, gensupport.WrapError(&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, gensupport.WrapError(err) 2279 } 2280 ret := &Deployment{ 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 2293 type DeploymentsGetIamPolicyCall struct { 2294 s *Service 2295 project string 2296 resource string 2297 urlParams_ gensupport.URLParams 2298 ifNoneMatch_ string 2299 ctx_ context.Context 2300 header_ http.Header 2301 } 2302 2303 // GetIamPolicy: Gets the access control policy for a resource. May be empty if 2304 // no such policy or resource exists. 2305 // 2306 // - project: Project ID for this request. 2307 // - resource: Name or id of the resource for this request. 2308 func (r *DeploymentsService) GetIamPolicy(project string, resource string) *DeploymentsGetIamPolicyCall { 2309 c := &DeploymentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2310 c.project = project 2311 c.resource = resource 2312 return c 2313 } 2314 2315 // OptionsRequestedPolicyVersion sets the optional parameter 2316 // "optionsRequestedPolicyVersion": Requested IAM Policy version. 2317 func (c *DeploymentsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *DeploymentsGetIamPolicyCall { 2318 c.urlParams_.Set("optionsRequestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 2319 return c 2320 } 2321 2322 // Fields allows partial responses to be retrieved. See 2323 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2324 // details. 2325 func (c *DeploymentsGetIamPolicyCall) Fields(s ...googleapi.Field) *DeploymentsGetIamPolicyCall { 2326 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2327 return c 2328 } 2329 2330 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2331 // object's ETag matches the given value. This is useful for getting updates 2332 // only after the object has changed since the last request. 2333 func (c *DeploymentsGetIamPolicyCall) IfNoneMatch(entityTag string) *DeploymentsGetIamPolicyCall { 2334 c.ifNoneMatch_ = entityTag 2335 return c 2336 } 2337 2338 // Context sets the context to be used in this call's Do method. 2339 func (c *DeploymentsGetIamPolicyCall) Context(ctx context.Context) *DeploymentsGetIamPolicyCall { 2340 c.ctx_ = ctx 2341 return c 2342 } 2343 2344 // Header returns a http.Header that can be modified by the caller to add 2345 // headers to the request. 2346 func (c *DeploymentsGetIamPolicyCall) Header() http.Header { 2347 if c.header_ == nil { 2348 c.header_ = make(http.Header) 2349 } 2350 return c.header_ 2351 } 2352 2353 func (c *DeploymentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 2354 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2355 if c.ifNoneMatch_ != "" { 2356 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2357 } 2358 var body io.Reader = nil 2359 c.urlParams_.Set("alt", alt) 2360 c.urlParams_.Set("prettyPrint", "false") 2361 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{resource}/getIamPolicy") 2362 urls += "?" + c.urlParams_.Encode() 2363 req, err := http.NewRequest("GET", urls, body) 2364 if err != nil { 2365 return nil, err 2366 } 2367 req.Header = reqHeaders 2368 googleapi.Expand(req.URL, map[string]string{ 2369 "project": c.project, 2370 "resource": c.resource, 2371 }) 2372 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2373 } 2374 2375 // Do executes the "deploymentmanager.deployments.getIamPolicy" call. 2376 // Any non-2xx status code is an error. Response headers are in either 2377 // *Policy.ServerResponse.Header or (if a response was returned at all) in 2378 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2379 // whether the returned error was because http.StatusNotModified was returned. 2380 func (c *DeploymentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 2381 gensupport.SetOptions(c.urlParams_, opts...) 2382 res, err := c.doRequest("json") 2383 if res != nil && res.StatusCode == http.StatusNotModified { 2384 if res.Body != nil { 2385 res.Body.Close() 2386 } 2387 return nil, gensupport.WrapError(&googleapi.Error{ 2388 Code: res.StatusCode, 2389 Header: res.Header, 2390 }) 2391 } 2392 if err != nil { 2393 return nil, err 2394 } 2395 defer googleapi.CloseBody(res) 2396 if err := googleapi.CheckResponse(res); err != nil { 2397 return nil, gensupport.WrapError(err) 2398 } 2399 ret := &Policy{ 2400 ServerResponse: googleapi.ServerResponse{ 2401 Header: res.Header, 2402 HTTPStatusCode: res.StatusCode, 2403 }, 2404 } 2405 target := &ret 2406 if err := gensupport.DecodeResponse(target, res); err != nil { 2407 return nil, err 2408 } 2409 return ret, nil 2410 } 2411 2412 type DeploymentsInsertCall struct { 2413 s *Service 2414 project string 2415 deployment *Deployment 2416 urlParams_ gensupport.URLParams 2417 ctx_ context.Context 2418 header_ http.Header 2419 } 2420 2421 // Insert: Creates a deployment and all of the resources described by the 2422 // deployment manifest. 2423 // 2424 // - project: The project ID for this request. 2425 func (r *DeploymentsService) Insert(project string, deployment *Deployment) *DeploymentsInsertCall { 2426 c := &DeploymentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2427 c.project = project 2428 c.deployment = deployment 2429 return c 2430 } 2431 2432 // CreatePolicy sets the optional parameter "createPolicy": Sets the policy to 2433 // use for creating new resources. 2434 // 2435 // Possible values: 2436 // 2437 // "CREATE_OR_ACQUIRE" (default) 2438 // "ACQUIRE" 2439 func (c *DeploymentsInsertCall) CreatePolicy(createPolicy string) *DeploymentsInsertCall { 2440 c.urlParams_.Set("createPolicy", createPolicy) 2441 return c 2442 } 2443 2444 // Preview sets the optional parameter "preview": If set to true, creates a 2445 // deployment and creates "shell" resources but does not actually instantiate 2446 // these resources. This allows you to preview what your deployment looks like. 2447 // After previewing a deployment, you can deploy your resources by making a 2448 // request with the `update()` method or you can use the `cancelPreview()` 2449 // method to cancel the preview altogether. Note that the deployment will still 2450 // exist after you cancel the preview and you must separately delete this 2451 // deployment if you want to remove it. 2452 func (c *DeploymentsInsertCall) Preview(preview bool) *DeploymentsInsertCall { 2453 c.urlParams_.Set("preview", fmt.Sprint(preview)) 2454 return c 2455 } 2456 2457 // Fields allows partial responses to be retrieved. See 2458 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2459 // details. 2460 func (c *DeploymentsInsertCall) Fields(s ...googleapi.Field) *DeploymentsInsertCall { 2461 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2462 return c 2463 } 2464 2465 // Context sets the context to be used in this call's Do method. 2466 func (c *DeploymentsInsertCall) Context(ctx context.Context) *DeploymentsInsertCall { 2467 c.ctx_ = ctx 2468 return c 2469 } 2470 2471 // Header returns a http.Header that can be modified by the caller to add 2472 // headers to the request. 2473 func (c *DeploymentsInsertCall) Header() http.Header { 2474 if c.header_ == nil { 2475 c.header_ = make(http.Header) 2476 } 2477 return c.header_ 2478 } 2479 2480 func (c *DeploymentsInsertCall) doRequest(alt string) (*http.Response, error) { 2481 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2482 var body io.Reader = nil 2483 body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment) 2484 if err != nil { 2485 return nil, err 2486 } 2487 c.urlParams_.Set("alt", alt) 2488 c.urlParams_.Set("prettyPrint", "false") 2489 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments") 2490 urls += "?" + c.urlParams_.Encode() 2491 req, err := http.NewRequest("POST", urls, body) 2492 if err != nil { 2493 return nil, err 2494 } 2495 req.Header = reqHeaders 2496 googleapi.Expand(req.URL, map[string]string{ 2497 "project": c.project, 2498 }) 2499 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2500 } 2501 2502 // Do executes the "deploymentmanager.deployments.insert" call. 2503 // Any non-2xx status code is an error. Response headers are in either 2504 // *Operation.ServerResponse.Header or (if a response was returned at all) in 2505 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2506 // whether the returned error was because http.StatusNotModified was returned. 2507 func (c *DeploymentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2508 gensupport.SetOptions(c.urlParams_, opts...) 2509 res, err := c.doRequest("json") 2510 if res != nil && res.StatusCode == http.StatusNotModified { 2511 if res.Body != nil { 2512 res.Body.Close() 2513 } 2514 return nil, gensupport.WrapError(&googleapi.Error{ 2515 Code: res.StatusCode, 2516 Header: res.Header, 2517 }) 2518 } 2519 if err != nil { 2520 return nil, err 2521 } 2522 defer googleapi.CloseBody(res) 2523 if err := googleapi.CheckResponse(res); err != nil { 2524 return nil, gensupport.WrapError(err) 2525 } 2526 ret := &Operation{ 2527 ServerResponse: googleapi.ServerResponse{ 2528 Header: res.Header, 2529 HTTPStatusCode: res.StatusCode, 2530 }, 2531 } 2532 target := &ret 2533 if err := gensupport.DecodeResponse(target, res); err != nil { 2534 return nil, err 2535 } 2536 return ret, nil 2537 } 2538 2539 type DeploymentsListCall struct { 2540 s *Service 2541 project string 2542 urlParams_ gensupport.URLParams 2543 ifNoneMatch_ string 2544 ctx_ context.Context 2545 header_ http.Header 2546 } 2547 2548 // List: Lists all deployments for a given project. 2549 // 2550 // - project: The project ID for this request. 2551 func (r *DeploymentsService) List(project string) *DeploymentsListCall { 2552 c := &DeploymentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2553 c.project = project 2554 return c 2555 } 2556 2557 // Filter sets the optional parameter "filter": A filter expression that 2558 // filters resources listed in the response. Most Compute resources support two 2559 // types of filter expressions: expressions that support regular expressions 2560 // and expressions that follow API improvement proposal AIP-160. These two 2561 // types of filter expressions cannot be mixed in one request. If you want to 2562 // use AIP-160, your expression must specify the field name, an operator, and 2563 // the value that you want to use for filtering. The value must be a string, a 2564 // number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, 2565 // `>=` or `:`. For example, if you are filtering Compute Engine instances, you 2566 // can exclude instances named `example-instance` by specifying `name != 2567 // example-instance`. The `:*` comparison can be used to test whether a key has 2568 // been defined. For example, to find all objects with `owner` label use: ``` 2569 // labels.owner:* ``` You can also filter nested fields. For example, you could 2570 // specify `scheduling.automaticRestart = false` to include instances only if 2571 // they are not scheduled for automatic restarts. You can use filtering on 2572 // nested fields to filter based on resource labels. To filter on multiple 2573 // expressions, provide each separate expression within parentheses. For 2574 // example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel 2575 // Skylake") ``` By default, each expression is an `AND` expression. However, 2576 // you can include `AND` and `OR` expressions explicitly. For example: ``` 2577 // (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND 2578 // (scheduling.automaticRestart = true) ``` If you want to use a regular 2579 // expression, use the `eq` (equal) or `ne` (not equal) operator against a 2580 // single un-parenthesized expression with or without quotes or against 2581 // multiple parenthesized expressions. Examples: `fieldname eq unquoted 2582 // literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted 2583 // literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal 2584 // value is interpreted as a regular expression using Google RE2 library 2585 // syntax. The literal value must match the entire field. For example, to 2586 // filter for instances that do not end with name "instance", you would use 2587 // `name ne .*instance`. You cannot combine constraints on multiple fields 2588 // using regular expressions. 2589 func (c *DeploymentsListCall) Filter(filter string) *DeploymentsListCall { 2590 c.urlParams_.Set("filter", filter) 2591 return c 2592 } 2593 2594 // MaxResults sets the optional parameter "maxResults": The maximum number of 2595 // results per page that should be returned. If the number of available results 2596 // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that 2597 // can be used to get the next page of results in subsequent list requests. 2598 // Acceptable values are `0` to `500`, inclusive. (Default: `500`) 2599 func (c *DeploymentsListCall) MaxResults(maxResults int64) *DeploymentsListCall { 2600 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 2601 return c 2602 } 2603 2604 // OrderBy sets the optional parameter "orderBy": Sorts list results by a 2605 // certain order. By default, results are returned in alphanumerical order 2606 // based on the resource name. You can also sort results in descending order 2607 // based on the creation timestamp using `orderBy="creationTimestamp desc". 2608 // This sorts results based on the `creationTimestamp` field in reverse 2609 // chronological order (newest result first). Use this to sort resources like 2610 // operations so that the newest operation is returned first. Currently, only 2611 // sorting by `name` or `creationTimestamp desc` is supported. 2612 func (c *DeploymentsListCall) OrderBy(orderBy string) *DeploymentsListCall { 2613 c.urlParams_.Set("orderBy", orderBy) 2614 return c 2615 } 2616 2617 // PageToken sets the optional parameter "pageToken": Specifies a page token to 2618 // use. Set `pageToken` to the `nextPageToken` returned by a previous list 2619 // request to get the next page of results. 2620 func (c *DeploymentsListCall) PageToken(pageToken string) *DeploymentsListCall { 2621 c.urlParams_.Set("pageToken", pageToken) 2622 return c 2623 } 2624 2625 // Fields allows partial responses to be retrieved. See 2626 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2627 // details. 2628 func (c *DeploymentsListCall) Fields(s ...googleapi.Field) *DeploymentsListCall { 2629 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2630 return c 2631 } 2632 2633 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2634 // object's ETag matches the given value. This is useful for getting updates 2635 // only after the object has changed since the last request. 2636 func (c *DeploymentsListCall) IfNoneMatch(entityTag string) *DeploymentsListCall { 2637 c.ifNoneMatch_ = entityTag 2638 return c 2639 } 2640 2641 // Context sets the context to be used in this call's Do method. 2642 func (c *DeploymentsListCall) Context(ctx context.Context) *DeploymentsListCall { 2643 c.ctx_ = ctx 2644 return c 2645 } 2646 2647 // Header returns a http.Header that can be modified by the caller to add 2648 // headers to the request. 2649 func (c *DeploymentsListCall) Header() http.Header { 2650 if c.header_ == nil { 2651 c.header_ = make(http.Header) 2652 } 2653 return c.header_ 2654 } 2655 2656 func (c *DeploymentsListCall) doRequest(alt string) (*http.Response, error) { 2657 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2658 if c.ifNoneMatch_ != "" { 2659 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2660 } 2661 var body io.Reader = nil 2662 c.urlParams_.Set("alt", alt) 2663 c.urlParams_.Set("prettyPrint", "false") 2664 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments") 2665 urls += "?" + c.urlParams_.Encode() 2666 req, err := http.NewRequest("GET", urls, body) 2667 if err != nil { 2668 return nil, err 2669 } 2670 req.Header = reqHeaders 2671 googleapi.Expand(req.URL, map[string]string{ 2672 "project": c.project, 2673 }) 2674 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2675 } 2676 2677 // Do executes the "deploymentmanager.deployments.list" call. 2678 // Any non-2xx status code is an error. Response headers are in either 2679 // *DeploymentsListResponse.ServerResponse.Header or (if a response was 2680 // returned at all) in error.(*googleapi.Error).Header. Use 2681 // googleapi.IsNotModified to check whether the returned error was because 2682 // http.StatusNotModified was returned. 2683 func (c *DeploymentsListCall) Do(opts ...googleapi.CallOption) (*DeploymentsListResponse, error) { 2684 gensupport.SetOptions(c.urlParams_, opts...) 2685 res, err := c.doRequest("json") 2686 if res != nil && res.StatusCode == http.StatusNotModified { 2687 if res.Body != nil { 2688 res.Body.Close() 2689 } 2690 return nil, gensupport.WrapError(&googleapi.Error{ 2691 Code: res.StatusCode, 2692 Header: res.Header, 2693 }) 2694 } 2695 if err != nil { 2696 return nil, err 2697 } 2698 defer googleapi.CloseBody(res) 2699 if err := googleapi.CheckResponse(res); err != nil { 2700 return nil, gensupport.WrapError(err) 2701 } 2702 ret := &DeploymentsListResponse{ 2703 ServerResponse: googleapi.ServerResponse{ 2704 Header: res.Header, 2705 HTTPStatusCode: res.StatusCode, 2706 }, 2707 } 2708 target := &ret 2709 if err := gensupport.DecodeResponse(target, res); err != nil { 2710 return nil, err 2711 } 2712 return ret, nil 2713 } 2714 2715 // Pages invokes f for each page of results. 2716 // A non-nil error returned from f will halt the iteration. 2717 // The provided context supersedes any context provided to the Context method. 2718 func (c *DeploymentsListCall) Pages(ctx context.Context, f func(*DeploymentsListResponse) error) error { 2719 c.ctx_ = ctx 2720 defer c.PageToken(c.urlParams_.Get("pageToken")) 2721 for { 2722 x, err := c.Do() 2723 if err != nil { 2724 return err 2725 } 2726 if err := f(x); err != nil { 2727 return err 2728 } 2729 if x.NextPageToken == "" { 2730 return nil 2731 } 2732 c.PageToken(x.NextPageToken) 2733 } 2734 } 2735 2736 type DeploymentsPatchCall struct { 2737 s *Service 2738 project string 2739 deployment string 2740 deployment2 *Deployment 2741 urlParams_ gensupport.URLParams 2742 ctx_ context.Context 2743 header_ http.Header 2744 } 2745 2746 // Patch: Patches a deployment and all of the resources described by the 2747 // deployment manifest. 2748 // 2749 // - deployment: The name of the deployment for this request. 2750 // - project: The project ID for this request. 2751 func (r *DeploymentsService) Patch(project string, deployment string, deployment2 *Deployment) *DeploymentsPatchCall { 2752 c := &DeploymentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2753 c.project = project 2754 c.deployment = deployment 2755 c.deployment2 = deployment2 2756 return c 2757 } 2758 2759 // CreatePolicy sets the optional parameter "createPolicy": Sets the policy to 2760 // use for creating new resources. 2761 // 2762 // Possible values: 2763 // 2764 // "CREATE_OR_ACQUIRE" (default) 2765 // "ACQUIRE" 2766 func (c *DeploymentsPatchCall) CreatePolicy(createPolicy string) *DeploymentsPatchCall { 2767 c.urlParams_.Set("createPolicy", createPolicy) 2768 return c 2769 } 2770 2771 // DeletePolicy sets the optional parameter "deletePolicy": Sets the policy to 2772 // use for deleting resources. 2773 // 2774 // Possible values: 2775 // 2776 // "DELETE" (default) 2777 // "ABANDON" 2778 func (c *DeploymentsPatchCall) DeletePolicy(deletePolicy string) *DeploymentsPatchCall { 2779 c.urlParams_.Set("deletePolicy", deletePolicy) 2780 return c 2781 } 2782 2783 // Preview sets the optional parameter "preview": If set to true, updates the 2784 // deployment and creates and updates the "shell" resources but does not 2785 // actually alter or instantiate these resources. This allows you to preview 2786 // what your deployment will look like. You can use this intent to preview how 2787 // an update would affect your deployment. You must provide a `target.config` 2788 // with a configuration if this is set to true. After previewing a deployment, 2789 // you can deploy your resources by making a request with the `update()` or you 2790 // can `cancelPreview()` to remove the preview altogether. Note that the 2791 // deployment will still exist after you cancel the preview and you must 2792 // separately delete this deployment if you want to remove it. 2793 func (c *DeploymentsPatchCall) Preview(preview bool) *DeploymentsPatchCall { 2794 c.urlParams_.Set("preview", fmt.Sprint(preview)) 2795 return c 2796 } 2797 2798 // Fields allows partial responses to be retrieved. See 2799 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2800 // details. 2801 func (c *DeploymentsPatchCall) Fields(s ...googleapi.Field) *DeploymentsPatchCall { 2802 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2803 return c 2804 } 2805 2806 // Context sets the context to be used in this call's Do method. 2807 func (c *DeploymentsPatchCall) Context(ctx context.Context) *DeploymentsPatchCall { 2808 c.ctx_ = ctx 2809 return c 2810 } 2811 2812 // Header returns a http.Header that can be modified by the caller to add 2813 // headers to the request. 2814 func (c *DeploymentsPatchCall) Header() http.Header { 2815 if c.header_ == nil { 2816 c.header_ = make(http.Header) 2817 } 2818 return c.header_ 2819 } 2820 2821 func (c *DeploymentsPatchCall) doRequest(alt string) (*http.Response, error) { 2822 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2823 var body io.Reader = nil 2824 body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2) 2825 if err != nil { 2826 return nil, err 2827 } 2828 c.urlParams_.Set("alt", alt) 2829 c.urlParams_.Set("prettyPrint", "false") 2830 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}") 2831 urls += "?" + c.urlParams_.Encode() 2832 req, err := http.NewRequest("PATCH", urls, body) 2833 if err != nil { 2834 return nil, err 2835 } 2836 req.Header = reqHeaders 2837 googleapi.Expand(req.URL, map[string]string{ 2838 "project": c.project, 2839 "deployment": c.deployment, 2840 }) 2841 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2842 } 2843 2844 // Do executes the "deploymentmanager.deployments.patch" call. 2845 // Any non-2xx status code is an error. Response headers are in either 2846 // *Operation.ServerResponse.Header or (if a response was returned at all) in 2847 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2848 // whether the returned error was because http.StatusNotModified was returned. 2849 func (c *DeploymentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2850 gensupport.SetOptions(c.urlParams_, opts...) 2851 res, err := c.doRequest("json") 2852 if res != nil && res.StatusCode == http.StatusNotModified { 2853 if res.Body != nil { 2854 res.Body.Close() 2855 } 2856 return nil, gensupport.WrapError(&googleapi.Error{ 2857 Code: res.StatusCode, 2858 Header: res.Header, 2859 }) 2860 } 2861 if err != nil { 2862 return nil, err 2863 } 2864 defer googleapi.CloseBody(res) 2865 if err := googleapi.CheckResponse(res); err != nil { 2866 return nil, gensupport.WrapError(err) 2867 } 2868 ret := &Operation{ 2869 ServerResponse: googleapi.ServerResponse{ 2870 Header: res.Header, 2871 HTTPStatusCode: res.StatusCode, 2872 }, 2873 } 2874 target := &ret 2875 if err := gensupport.DecodeResponse(target, res); err != nil { 2876 return nil, err 2877 } 2878 return ret, nil 2879 } 2880 2881 type DeploymentsSetIamPolicyCall struct { 2882 s *Service 2883 project string 2884 resource string 2885 globalsetpolicyrequest *GlobalSetPolicyRequest 2886 urlParams_ gensupport.URLParams 2887 ctx_ context.Context 2888 header_ http.Header 2889 } 2890 2891 // SetIamPolicy: Sets the access control policy on the specified resource. 2892 // Replaces any existing policy. 2893 // 2894 // - project: Project ID for this request. 2895 // - resource: Name or id of the resource for this request. 2896 func (r *DeploymentsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *DeploymentsSetIamPolicyCall { 2897 c := &DeploymentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2898 c.project = project 2899 c.resource = resource 2900 c.globalsetpolicyrequest = globalsetpolicyrequest 2901 return c 2902 } 2903 2904 // Fields allows partial responses to be retrieved. See 2905 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2906 // details. 2907 func (c *DeploymentsSetIamPolicyCall) Fields(s ...googleapi.Field) *DeploymentsSetIamPolicyCall { 2908 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2909 return c 2910 } 2911 2912 // Context sets the context to be used in this call's Do method. 2913 func (c *DeploymentsSetIamPolicyCall) Context(ctx context.Context) *DeploymentsSetIamPolicyCall { 2914 c.ctx_ = ctx 2915 return c 2916 } 2917 2918 // Header returns a http.Header that can be modified by the caller to add 2919 // headers to the request. 2920 func (c *DeploymentsSetIamPolicyCall) Header() http.Header { 2921 if c.header_ == nil { 2922 c.header_ = make(http.Header) 2923 } 2924 return c.header_ 2925 } 2926 2927 func (c *DeploymentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 2928 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2929 var body io.Reader = nil 2930 body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest) 2931 if err != nil { 2932 return nil, err 2933 } 2934 c.urlParams_.Set("alt", alt) 2935 c.urlParams_.Set("prettyPrint", "false") 2936 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{resource}/setIamPolicy") 2937 urls += "?" + c.urlParams_.Encode() 2938 req, err := http.NewRequest("POST", urls, body) 2939 if err != nil { 2940 return nil, err 2941 } 2942 req.Header = reqHeaders 2943 googleapi.Expand(req.URL, map[string]string{ 2944 "project": c.project, 2945 "resource": c.resource, 2946 }) 2947 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2948 } 2949 2950 // Do executes the "deploymentmanager.deployments.setIamPolicy" call. 2951 // Any non-2xx status code is an error. Response headers are in either 2952 // *Policy.ServerResponse.Header or (if a response was returned at all) in 2953 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2954 // whether the returned error was because http.StatusNotModified was returned. 2955 func (c *DeploymentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 2956 gensupport.SetOptions(c.urlParams_, opts...) 2957 res, err := c.doRequest("json") 2958 if res != nil && res.StatusCode == http.StatusNotModified { 2959 if res.Body != nil { 2960 res.Body.Close() 2961 } 2962 return nil, gensupport.WrapError(&googleapi.Error{ 2963 Code: res.StatusCode, 2964 Header: res.Header, 2965 }) 2966 } 2967 if err != nil { 2968 return nil, err 2969 } 2970 defer googleapi.CloseBody(res) 2971 if err := googleapi.CheckResponse(res); err != nil { 2972 return nil, gensupport.WrapError(err) 2973 } 2974 ret := &Policy{ 2975 ServerResponse: googleapi.ServerResponse{ 2976 Header: res.Header, 2977 HTTPStatusCode: res.StatusCode, 2978 }, 2979 } 2980 target := &ret 2981 if err := gensupport.DecodeResponse(target, res); err != nil { 2982 return nil, err 2983 } 2984 return ret, nil 2985 } 2986 2987 type DeploymentsStopCall struct { 2988 s *Service 2989 project string 2990 deployment string 2991 deploymentsstoprequest *DeploymentsStopRequest 2992 urlParams_ gensupport.URLParams 2993 ctx_ context.Context 2994 header_ http.Header 2995 } 2996 2997 // Stop: Stops an ongoing operation. This does not roll back any work that has 2998 // already been completed, but prevents any new work from being started. 2999 // 3000 // - deployment: The name of the deployment for this request. 3001 // - project: The project ID for this request. 3002 func (r *DeploymentsService) Stop(project string, deployment string, deploymentsstoprequest *DeploymentsStopRequest) *DeploymentsStopCall { 3003 c := &DeploymentsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3004 c.project = project 3005 c.deployment = deployment 3006 c.deploymentsstoprequest = deploymentsstoprequest 3007 return c 3008 } 3009 3010 // Fields allows partial responses to be retrieved. See 3011 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3012 // details. 3013 func (c *DeploymentsStopCall) Fields(s ...googleapi.Field) *DeploymentsStopCall { 3014 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3015 return c 3016 } 3017 3018 // Context sets the context to be used in this call's Do method. 3019 func (c *DeploymentsStopCall) Context(ctx context.Context) *DeploymentsStopCall { 3020 c.ctx_ = ctx 3021 return c 3022 } 3023 3024 // Header returns a http.Header that can be modified by the caller to add 3025 // headers to the request. 3026 func (c *DeploymentsStopCall) Header() http.Header { 3027 if c.header_ == nil { 3028 c.header_ = make(http.Header) 3029 } 3030 return c.header_ 3031 } 3032 3033 func (c *DeploymentsStopCall) doRequest(alt string) (*http.Response, error) { 3034 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3035 var body io.Reader = nil 3036 body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentsstoprequest) 3037 if err != nil { 3038 return nil, err 3039 } 3040 c.urlParams_.Set("alt", alt) 3041 c.urlParams_.Set("prettyPrint", "false") 3042 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/stop") 3043 urls += "?" + c.urlParams_.Encode() 3044 req, err := http.NewRequest("POST", urls, body) 3045 if err != nil { 3046 return nil, err 3047 } 3048 req.Header = reqHeaders 3049 googleapi.Expand(req.URL, map[string]string{ 3050 "project": c.project, 3051 "deployment": c.deployment, 3052 }) 3053 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3054 } 3055 3056 // Do executes the "deploymentmanager.deployments.stop" call. 3057 // Any non-2xx status code is an error. Response headers are in either 3058 // *Operation.ServerResponse.Header or (if a response was returned at all) in 3059 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3060 // whether the returned error was because http.StatusNotModified was returned. 3061 func (c *DeploymentsStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3062 gensupport.SetOptions(c.urlParams_, opts...) 3063 res, err := c.doRequest("json") 3064 if res != nil && res.StatusCode == http.StatusNotModified { 3065 if res.Body != nil { 3066 res.Body.Close() 3067 } 3068 return nil, gensupport.WrapError(&googleapi.Error{ 3069 Code: res.StatusCode, 3070 Header: res.Header, 3071 }) 3072 } 3073 if err != nil { 3074 return nil, err 3075 } 3076 defer googleapi.CloseBody(res) 3077 if err := googleapi.CheckResponse(res); err != nil { 3078 return nil, gensupport.WrapError(err) 3079 } 3080 ret := &Operation{ 3081 ServerResponse: googleapi.ServerResponse{ 3082 Header: res.Header, 3083 HTTPStatusCode: res.StatusCode, 3084 }, 3085 } 3086 target := &ret 3087 if err := gensupport.DecodeResponse(target, res); err != nil { 3088 return nil, err 3089 } 3090 return ret, nil 3091 } 3092 3093 type DeploymentsTestIamPermissionsCall struct { 3094 s *Service 3095 project string 3096 resource string 3097 testpermissionsrequest *TestPermissionsRequest 3098 urlParams_ gensupport.URLParams 3099 ctx_ context.Context 3100 header_ http.Header 3101 } 3102 3103 // TestIamPermissions: Returns permissions that a caller has on the specified 3104 // resource. 3105 // 3106 // - project: Project ID for this request. 3107 // - resource: Name or id of the resource for this request. 3108 func (r *DeploymentsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *DeploymentsTestIamPermissionsCall { 3109 c := &DeploymentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3110 c.project = project 3111 c.resource = resource 3112 c.testpermissionsrequest = testpermissionsrequest 3113 return c 3114 } 3115 3116 // Fields allows partial responses to be retrieved. See 3117 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3118 // details. 3119 func (c *DeploymentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *DeploymentsTestIamPermissionsCall { 3120 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3121 return c 3122 } 3123 3124 // Context sets the context to be used in this call's Do method. 3125 func (c *DeploymentsTestIamPermissionsCall) Context(ctx context.Context) *DeploymentsTestIamPermissionsCall { 3126 c.ctx_ = ctx 3127 return c 3128 } 3129 3130 // Header returns a http.Header that can be modified by the caller to add 3131 // headers to the request. 3132 func (c *DeploymentsTestIamPermissionsCall) Header() http.Header { 3133 if c.header_ == nil { 3134 c.header_ = make(http.Header) 3135 } 3136 return c.header_ 3137 } 3138 3139 func (c *DeploymentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 3140 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3141 var body io.Reader = nil 3142 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest) 3143 if err != nil { 3144 return nil, err 3145 } 3146 c.urlParams_.Set("alt", alt) 3147 c.urlParams_.Set("prettyPrint", "false") 3148 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{resource}/testIamPermissions") 3149 urls += "?" + c.urlParams_.Encode() 3150 req, err := http.NewRequest("POST", urls, body) 3151 if err != nil { 3152 return nil, err 3153 } 3154 req.Header = reqHeaders 3155 googleapi.Expand(req.URL, map[string]string{ 3156 "project": c.project, 3157 "resource": c.resource, 3158 }) 3159 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3160 } 3161 3162 // Do executes the "deploymentmanager.deployments.testIamPermissions" call. 3163 // Any non-2xx status code is an error. Response headers are in either 3164 // *TestPermissionsResponse.ServerResponse.Header or (if a response was 3165 // returned at all) in error.(*googleapi.Error).Header. Use 3166 // googleapi.IsNotModified to check whether the returned error was because 3167 // http.StatusNotModified was returned. 3168 func (c *DeploymentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) { 3169 gensupport.SetOptions(c.urlParams_, opts...) 3170 res, err := c.doRequest("json") 3171 if res != nil && res.StatusCode == http.StatusNotModified { 3172 if res.Body != nil { 3173 res.Body.Close() 3174 } 3175 return nil, gensupport.WrapError(&googleapi.Error{ 3176 Code: res.StatusCode, 3177 Header: res.Header, 3178 }) 3179 } 3180 if err != nil { 3181 return nil, err 3182 } 3183 defer googleapi.CloseBody(res) 3184 if err := googleapi.CheckResponse(res); err != nil { 3185 return nil, gensupport.WrapError(err) 3186 } 3187 ret := &TestPermissionsResponse{ 3188 ServerResponse: googleapi.ServerResponse{ 3189 Header: res.Header, 3190 HTTPStatusCode: res.StatusCode, 3191 }, 3192 } 3193 target := &ret 3194 if err := gensupport.DecodeResponse(target, res); err != nil { 3195 return nil, err 3196 } 3197 return ret, nil 3198 } 3199 3200 type DeploymentsUpdateCall struct { 3201 s *Service 3202 project string 3203 deployment string 3204 deployment2 *Deployment 3205 urlParams_ gensupport.URLParams 3206 ctx_ context.Context 3207 header_ http.Header 3208 } 3209 3210 // Update: Updates a deployment and all of the resources described by the 3211 // deployment manifest. 3212 // 3213 // - deployment: The name of the deployment for this request. 3214 // - project: The project ID for this request. 3215 func (r *DeploymentsService) Update(project string, deployment string, deployment2 *Deployment) *DeploymentsUpdateCall { 3216 c := &DeploymentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3217 c.project = project 3218 c.deployment = deployment 3219 c.deployment2 = deployment2 3220 return c 3221 } 3222 3223 // CreatePolicy sets the optional parameter "createPolicy": Sets the policy to 3224 // use for creating new resources. 3225 // 3226 // Possible values: 3227 // 3228 // "CREATE_OR_ACQUIRE" (default) 3229 // "ACQUIRE" 3230 func (c *DeploymentsUpdateCall) CreatePolicy(createPolicy string) *DeploymentsUpdateCall { 3231 c.urlParams_.Set("createPolicy", createPolicy) 3232 return c 3233 } 3234 3235 // DeletePolicy sets the optional parameter "deletePolicy": Sets the policy to 3236 // use for deleting resources. 3237 // 3238 // Possible values: 3239 // 3240 // "DELETE" (default) 3241 // "ABANDON" 3242 func (c *DeploymentsUpdateCall) DeletePolicy(deletePolicy string) *DeploymentsUpdateCall { 3243 c.urlParams_.Set("deletePolicy", deletePolicy) 3244 return c 3245 } 3246 3247 // Preview sets the optional parameter "preview": If set to true, updates the 3248 // deployment and creates and updates the "shell" resources but does not 3249 // actually alter or instantiate these resources. This allows you to preview 3250 // what your deployment will look like. You can use this intent to preview how 3251 // an update would affect your deployment. You must provide a `target.config` 3252 // with a configuration if this is set to true. After previewing a deployment, 3253 // you can deploy your resources by making a request with the `update()` or you 3254 // can `cancelPreview()` to remove the preview altogether. Note that the 3255 // deployment will still exist after you cancel the preview and you must 3256 // separately delete this deployment if you want to remove it. 3257 func (c *DeploymentsUpdateCall) Preview(preview bool) *DeploymentsUpdateCall { 3258 c.urlParams_.Set("preview", fmt.Sprint(preview)) 3259 return c 3260 } 3261 3262 // Fields allows partial responses to be retrieved. See 3263 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3264 // details. 3265 func (c *DeploymentsUpdateCall) Fields(s ...googleapi.Field) *DeploymentsUpdateCall { 3266 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3267 return c 3268 } 3269 3270 // Context sets the context to be used in this call's Do method. 3271 func (c *DeploymentsUpdateCall) Context(ctx context.Context) *DeploymentsUpdateCall { 3272 c.ctx_ = ctx 3273 return c 3274 } 3275 3276 // Header returns a http.Header that can be modified by the caller to add 3277 // headers to the request. 3278 func (c *DeploymentsUpdateCall) Header() http.Header { 3279 if c.header_ == nil { 3280 c.header_ = make(http.Header) 3281 } 3282 return c.header_ 3283 } 3284 3285 func (c *DeploymentsUpdateCall) doRequest(alt string) (*http.Response, error) { 3286 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3287 var body io.Reader = nil 3288 body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2) 3289 if err != nil { 3290 return nil, err 3291 } 3292 c.urlParams_.Set("alt", alt) 3293 c.urlParams_.Set("prettyPrint", "false") 3294 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}") 3295 urls += "?" + c.urlParams_.Encode() 3296 req, err := http.NewRequest("PUT", urls, body) 3297 if err != nil { 3298 return nil, err 3299 } 3300 req.Header = reqHeaders 3301 googleapi.Expand(req.URL, map[string]string{ 3302 "project": c.project, 3303 "deployment": c.deployment, 3304 }) 3305 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3306 } 3307 3308 // Do executes the "deploymentmanager.deployments.update" call. 3309 // Any non-2xx status code is an error. Response headers are in either 3310 // *Operation.ServerResponse.Header or (if a response was returned at all) in 3311 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3312 // whether the returned error was because http.StatusNotModified was returned. 3313 func (c *DeploymentsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3314 gensupport.SetOptions(c.urlParams_, opts...) 3315 res, err := c.doRequest("json") 3316 if res != nil && res.StatusCode == http.StatusNotModified { 3317 if res.Body != nil { 3318 res.Body.Close() 3319 } 3320 return nil, gensupport.WrapError(&googleapi.Error{ 3321 Code: res.StatusCode, 3322 Header: res.Header, 3323 }) 3324 } 3325 if err != nil { 3326 return nil, err 3327 } 3328 defer googleapi.CloseBody(res) 3329 if err := googleapi.CheckResponse(res); err != nil { 3330 return nil, gensupport.WrapError(err) 3331 } 3332 ret := &Operation{ 3333 ServerResponse: googleapi.ServerResponse{ 3334 Header: res.Header, 3335 HTTPStatusCode: res.StatusCode, 3336 }, 3337 } 3338 target := &ret 3339 if err := gensupport.DecodeResponse(target, res); err != nil { 3340 return nil, err 3341 } 3342 return ret, nil 3343 } 3344 3345 type ManifestsGetCall struct { 3346 s *Service 3347 project string 3348 deployment string 3349 manifest string 3350 urlParams_ gensupport.URLParams 3351 ifNoneMatch_ string 3352 ctx_ context.Context 3353 header_ http.Header 3354 } 3355 3356 // Get: Gets information about a specific manifest. 3357 // 3358 // - deployment: The name of the deployment for this request. 3359 // - manifest: The name of the manifest for this request. 3360 // - project: The project ID for this request. 3361 func (r *ManifestsService) Get(project string, deployment string, manifest string) *ManifestsGetCall { 3362 c := &ManifestsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3363 c.project = project 3364 c.deployment = deployment 3365 c.manifest = manifest 3366 return c 3367 } 3368 3369 // Fields allows partial responses to be retrieved. See 3370 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3371 // details. 3372 func (c *ManifestsGetCall) Fields(s ...googleapi.Field) *ManifestsGetCall { 3373 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3374 return c 3375 } 3376 3377 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3378 // object's ETag matches the given value. This is useful for getting updates 3379 // only after the object has changed since the last request. 3380 func (c *ManifestsGetCall) IfNoneMatch(entityTag string) *ManifestsGetCall { 3381 c.ifNoneMatch_ = entityTag 3382 return c 3383 } 3384 3385 // Context sets the context to be used in this call's Do method. 3386 func (c *ManifestsGetCall) Context(ctx context.Context) *ManifestsGetCall { 3387 c.ctx_ = ctx 3388 return c 3389 } 3390 3391 // Header returns a http.Header that can be modified by the caller to add 3392 // headers to the request. 3393 func (c *ManifestsGetCall) Header() http.Header { 3394 if c.header_ == nil { 3395 c.header_ = make(http.Header) 3396 } 3397 return c.header_ 3398 } 3399 3400 func (c *ManifestsGetCall) doRequest(alt string) (*http.Response, error) { 3401 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3402 if c.ifNoneMatch_ != "" { 3403 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3404 } 3405 var body io.Reader = nil 3406 c.urlParams_.Set("alt", alt) 3407 c.urlParams_.Set("prettyPrint", "false") 3408 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests/{manifest}") 3409 urls += "?" + c.urlParams_.Encode() 3410 req, err := http.NewRequest("GET", urls, body) 3411 if err != nil { 3412 return nil, err 3413 } 3414 req.Header = reqHeaders 3415 googleapi.Expand(req.URL, map[string]string{ 3416 "project": c.project, 3417 "deployment": c.deployment, 3418 "manifest": c.manifest, 3419 }) 3420 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3421 } 3422 3423 // Do executes the "deploymentmanager.manifests.get" call. 3424 // Any non-2xx status code is an error. Response headers are in either 3425 // *Manifest.ServerResponse.Header or (if a response was returned at all) in 3426 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3427 // whether the returned error was because http.StatusNotModified was returned. 3428 func (c *ManifestsGetCall) Do(opts ...googleapi.CallOption) (*Manifest, error) { 3429 gensupport.SetOptions(c.urlParams_, opts...) 3430 res, err := c.doRequest("json") 3431 if res != nil && res.StatusCode == http.StatusNotModified { 3432 if res.Body != nil { 3433 res.Body.Close() 3434 } 3435 return nil, gensupport.WrapError(&googleapi.Error{ 3436 Code: res.StatusCode, 3437 Header: res.Header, 3438 }) 3439 } 3440 if err != nil { 3441 return nil, err 3442 } 3443 defer googleapi.CloseBody(res) 3444 if err := googleapi.CheckResponse(res); err != nil { 3445 return nil, gensupport.WrapError(err) 3446 } 3447 ret := &Manifest{ 3448 ServerResponse: googleapi.ServerResponse{ 3449 Header: res.Header, 3450 HTTPStatusCode: res.StatusCode, 3451 }, 3452 } 3453 target := &ret 3454 if err := gensupport.DecodeResponse(target, res); err != nil { 3455 return nil, err 3456 } 3457 return ret, nil 3458 } 3459 3460 type ManifestsListCall struct { 3461 s *Service 3462 project string 3463 deployment string 3464 urlParams_ gensupport.URLParams 3465 ifNoneMatch_ string 3466 ctx_ context.Context 3467 header_ http.Header 3468 } 3469 3470 // List: Lists all manifests for a given deployment. 3471 // 3472 // - deployment: The name of the deployment for this request. 3473 // - project: The project ID for this request. 3474 func (r *ManifestsService) List(project string, deployment string) *ManifestsListCall { 3475 c := &ManifestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3476 c.project = project 3477 c.deployment = deployment 3478 return c 3479 } 3480 3481 // Filter sets the optional parameter "filter": A filter expression that 3482 // filters resources listed in the response. Most Compute resources support two 3483 // types of filter expressions: expressions that support regular expressions 3484 // and expressions that follow API improvement proposal AIP-160. These two 3485 // types of filter expressions cannot be mixed in one request. If you want to 3486 // use AIP-160, your expression must specify the field name, an operator, and 3487 // the value that you want to use for filtering. The value must be a string, a 3488 // number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, 3489 // `>=` or `:`. For example, if you are filtering Compute Engine instances, you 3490 // can exclude instances named `example-instance` by specifying `name != 3491 // example-instance`. The `:*` comparison can be used to test whether a key has 3492 // been defined. For example, to find all objects with `owner` label use: ``` 3493 // labels.owner:* ``` You can also filter nested fields. For example, you could 3494 // specify `scheduling.automaticRestart = false` to include instances only if 3495 // they are not scheduled for automatic restarts. You can use filtering on 3496 // nested fields to filter based on resource labels. To filter on multiple 3497 // expressions, provide each separate expression within parentheses. For 3498 // example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel 3499 // Skylake") ``` By default, each expression is an `AND` expression. However, 3500 // you can include `AND` and `OR` expressions explicitly. For example: ``` 3501 // (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND 3502 // (scheduling.automaticRestart = true) ``` If you want to use a regular 3503 // expression, use the `eq` (equal) or `ne` (not equal) operator against a 3504 // single un-parenthesized expression with or without quotes or against 3505 // multiple parenthesized expressions. Examples: `fieldname eq unquoted 3506 // literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted 3507 // literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal 3508 // value is interpreted as a regular expression using Google RE2 library 3509 // syntax. The literal value must match the entire field. For example, to 3510 // filter for instances that do not end with name "instance", you would use 3511 // `name ne .*instance`. You cannot combine constraints on multiple fields 3512 // using regular expressions. 3513 func (c *ManifestsListCall) Filter(filter string) *ManifestsListCall { 3514 c.urlParams_.Set("filter", filter) 3515 return c 3516 } 3517 3518 // MaxResults sets the optional parameter "maxResults": The maximum number of 3519 // results per page that should be returned. If the number of available results 3520 // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that 3521 // can be used to get the next page of results in subsequent list requests. 3522 // Acceptable values are `0` to `500`, inclusive. (Default: `500`) 3523 func (c *ManifestsListCall) MaxResults(maxResults int64) *ManifestsListCall { 3524 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 3525 return c 3526 } 3527 3528 // OrderBy sets the optional parameter "orderBy": Sorts list results by a 3529 // certain order. By default, results are returned in alphanumerical order 3530 // based on the resource name. You can also sort results in descending order 3531 // based on the creation timestamp using `orderBy="creationTimestamp desc". 3532 // This sorts results based on the `creationTimestamp` field in reverse 3533 // chronological order (newest result first). Use this to sort resources like 3534 // operations so that the newest operation is returned first. Currently, only 3535 // sorting by `name` or `creationTimestamp desc` is supported. 3536 func (c *ManifestsListCall) OrderBy(orderBy string) *ManifestsListCall { 3537 c.urlParams_.Set("orderBy", orderBy) 3538 return c 3539 } 3540 3541 // PageToken sets the optional parameter "pageToken": Specifies a page token to 3542 // use. Set `pageToken` to the `nextPageToken` returned by a previous list 3543 // request to get the next page of results. 3544 func (c *ManifestsListCall) PageToken(pageToken string) *ManifestsListCall { 3545 c.urlParams_.Set("pageToken", pageToken) 3546 return c 3547 } 3548 3549 // Fields allows partial responses to be retrieved. See 3550 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3551 // details. 3552 func (c *ManifestsListCall) Fields(s ...googleapi.Field) *ManifestsListCall { 3553 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3554 return c 3555 } 3556 3557 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3558 // object's ETag matches the given value. This is useful for getting updates 3559 // only after the object has changed since the last request. 3560 func (c *ManifestsListCall) IfNoneMatch(entityTag string) *ManifestsListCall { 3561 c.ifNoneMatch_ = entityTag 3562 return c 3563 } 3564 3565 // Context sets the context to be used in this call's Do method. 3566 func (c *ManifestsListCall) Context(ctx context.Context) *ManifestsListCall { 3567 c.ctx_ = ctx 3568 return c 3569 } 3570 3571 // Header returns a http.Header that can be modified by the caller to add 3572 // headers to the request. 3573 func (c *ManifestsListCall) Header() http.Header { 3574 if c.header_ == nil { 3575 c.header_ = make(http.Header) 3576 } 3577 return c.header_ 3578 } 3579 3580 func (c *ManifestsListCall) doRequest(alt string) (*http.Response, error) { 3581 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3582 if c.ifNoneMatch_ != "" { 3583 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3584 } 3585 var body io.Reader = nil 3586 c.urlParams_.Set("alt", alt) 3587 c.urlParams_.Set("prettyPrint", "false") 3588 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests") 3589 urls += "?" + c.urlParams_.Encode() 3590 req, err := http.NewRequest("GET", urls, body) 3591 if err != nil { 3592 return nil, err 3593 } 3594 req.Header = reqHeaders 3595 googleapi.Expand(req.URL, map[string]string{ 3596 "project": c.project, 3597 "deployment": c.deployment, 3598 }) 3599 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3600 } 3601 3602 // Do executes the "deploymentmanager.manifests.list" call. 3603 // Any non-2xx status code is an error. Response headers are in either 3604 // *ManifestsListResponse.ServerResponse.Header or (if a response was returned 3605 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3606 // check whether the returned error was because http.StatusNotModified was 3607 // returned. 3608 func (c *ManifestsListCall) Do(opts ...googleapi.CallOption) (*ManifestsListResponse, error) { 3609 gensupport.SetOptions(c.urlParams_, opts...) 3610 res, err := c.doRequest("json") 3611 if res != nil && res.StatusCode == http.StatusNotModified { 3612 if res.Body != nil { 3613 res.Body.Close() 3614 } 3615 return nil, gensupport.WrapError(&googleapi.Error{ 3616 Code: res.StatusCode, 3617 Header: res.Header, 3618 }) 3619 } 3620 if err != nil { 3621 return nil, err 3622 } 3623 defer googleapi.CloseBody(res) 3624 if err := googleapi.CheckResponse(res); err != nil { 3625 return nil, gensupport.WrapError(err) 3626 } 3627 ret := &ManifestsListResponse{ 3628 ServerResponse: googleapi.ServerResponse{ 3629 Header: res.Header, 3630 HTTPStatusCode: res.StatusCode, 3631 }, 3632 } 3633 target := &ret 3634 if err := gensupport.DecodeResponse(target, res); err != nil { 3635 return nil, err 3636 } 3637 return ret, nil 3638 } 3639 3640 // Pages invokes f for each page of results. 3641 // A non-nil error returned from f will halt the iteration. 3642 // The provided context supersedes any context provided to the Context method. 3643 func (c *ManifestsListCall) Pages(ctx context.Context, f func(*ManifestsListResponse) error) error { 3644 c.ctx_ = ctx 3645 defer c.PageToken(c.urlParams_.Get("pageToken")) 3646 for { 3647 x, err := c.Do() 3648 if err != nil { 3649 return err 3650 } 3651 if err := f(x); err != nil { 3652 return err 3653 } 3654 if x.NextPageToken == "" { 3655 return nil 3656 } 3657 c.PageToken(x.NextPageToken) 3658 } 3659 } 3660 3661 type OperationsGetCall struct { 3662 s *Service 3663 project string 3664 operation string 3665 urlParams_ gensupport.URLParams 3666 ifNoneMatch_ string 3667 ctx_ context.Context 3668 header_ http.Header 3669 } 3670 3671 // Get: Gets information about a specific operation. 3672 // 3673 // - operation: The name of the operation for this request. 3674 // - project: The project ID for this request. 3675 func (r *OperationsService) Get(project string, operation string) *OperationsGetCall { 3676 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3677 c.project = project 3678 c.operation = operation 3679 return c 3680 } 3681 3682 // Fields allows partial responses to be retrieved. See 3683 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3684 // details. 3685 func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 3686 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3687 return c 3688 } 3689 3690 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3691 // object's ETag matches the given value. This is useful for getting updates 3692 // only after the object has changed since the last request. 3693 func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 3694 c.ifNoneMatch_ = entityTag 3695 return c 3696 } 3697 3698 // Context sets the context to be used in this call's Do method. 3699 func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 3700 c.ctx_ = ctx 3701 return c 3702 } 3703 3704 // Header returns a http.Header that can be modified by the caller to add 3705 // headers to the request. 3706 func (c *OperationsGetCall) Header() http.Header { 3707 if c.header_ == nil { 3708 c.header_ = make(http.Header) 3709 } 3710 return c.header_ 3711 } 3712 3713 func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 3714 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3715 if c.ifNoneMatch_ != "" { 3716 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3717 } 3718 var body io.Reader = nil 3719 c.urlParams_.Set("alt", alt) 3720 c.urlParams_.Set("prettyPrint", "false") 3721 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/operations/{operation}") 3722 urls += "?" + c.urlParams_.Encode() 3723 req, err := http.NewRequest("GET", urls, body) 3724 if err != nil { 3725 return nil, err 3726 } 3727 req.Header = reqHeaders 3728 googleapi.Expand(req.URL, map[string]string{ 3729 "project": c.project, 3730 "operation": c.operation, 3731 }) 3732 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3733 } 3734 3735 // Do executes the "deploymentmanager.operations.get" call. 3736 // Any non-2xx status code is an error. Response headers are in either 3737 // *Operation.ServerResponse.Header or (if a response was returned at all) in 3738 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3739 // whether the returned error was because http.StatusNotModified was returned. 3740 func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3741 gensupport.SetOptions(c.urlParams_, opts...) 3742 res, err := c.doRequest("json") 3743 if res != nil && res.StatusCode == http.StatusNotModified { 3744 if res.Body != nil { 3745 res.Body.Close() 3746 } 3747 return nil, gensupport.WrapError(&googleapi.Error{ 3748 Code: res.StatusCode, 3749 Header: res.Header, 3750 }) 3751 } 3752 if err != nil { 3753 return nil, err 3754 } 3755 defer googleapi.CloseBody(res) 3756 if err := googleapi.CheckResponse(res); err != nil { 3757 return nil, gensupport.WrapError(err) 3758 } 3759 ret := &Operation{ 3760 ServerResponse: googleapi.ServerResponse{ 3761 Header: res.Header, 3762 HTTPStatusCode: res.StatusCode, 3763 }, 3764 } 3765 target := &ret 3766 if err := gensupport.DecodeResponse(target, res); err != nil { 3767 return nil, err 3768 } 3769 return ret, nil 3770 } 3771 3772 type OperationsListCall struct { 3773 s *Service 3774 project string 3775 urlParams_ gensupport.URLParams 3776 ifNoneMatch_ string 3777 ctx_ context.Context 3778 header_ http.Header 3779 } 3780 3781 // List: Lists all operations for a project. 3782 // 3783 // - project: The project ID for this request. 3784 func (r *OperationsService) List(project string) *OperationsListCall { 3785 c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3786 c.project = project 3787 return c 3788 } 3789 3790 // Filter sets the optional parameter "filter": A filter expression that 3791 // filters resources listed in the response. Most Compute resources support two 3792 // types of filter expressions: expressions that support regular expressions 3793 // and expressions that follow API improvement proposal AIP-160. These two 3794 // types of filter expressions cannot be mixed in one request. If you want to 3795 // use AIP-160, your expression must specify the field name, an operator, and 3796 // the value that you want to use for filtering. The value must be a string, a 3797 // number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, 3798 // `>=` or `:`. For example, if you are filtering Compute Engine instances, you 3799 // can exclude instances named `example-instance` by specifying `name != 3800 // example-instance`. The `:*` comparison can be used to test whether a key has 3801 // been defined. For example, to find all objects with `owner` label use: ``` 3802 // labels.owner:* ``` You can also filter nested fields. For example, you could 3803 // specify `scheduling.automaticRestart = false` to include instances only if 3804 // they are not scheduled for automatic restarts. You can use filtering on 3805 // nested fields to filter based on resource labels. To filter on multiple 3806 // expressions, provide each separate expression within parentheses. For 3807 // example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel 3808 // Skylake") ``` By default, each expression is an `AND` expression. However, 3809 // you can include `AND` and `OR` expressions explicitly. For example: ``` 3810 // (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND 3811 // (scheduling.automaticRestart = true) ``` If you want to use a regular 3812 // expression, use the `eq` (equal) or `ne` (not equal) operator against a 3813 // single un-parenthesized expression with or without quotes or against 3814 // multiple parenthesized expressions. Examples: `fieldname eq unquoted 3815 // literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted 3816 // literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal 3817 // value is interpreted as a regular expression using Google RE2 library 3818 // syntax. The literal value must match the entire field. For example, to 3819 // filter for instances that do not end with name "instance", you would use 3820 // `name ne .*instance`. You cannot combine constraints on multiple fields 3821 // using regular expressions. 3822 func (c *OperationsListCall) Filter(filter string) *OperationsListCall { 3823 c.urlParams_.Set("filter", filter) 3824 return c 3825 } 3826 3827 // MaxResults sets the optional parameter "maxResults": The maximum number of 3828 // results per page that should be returned. If the number of available results 3829 // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that 3830 // can be used to get the next page of results in subsequent list requests. 3831 // Acceptable values are `0` to `500`, inclusive. (Default: `500`) 3832 func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall { 3833 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 3834 return c 3835 } 3836 3837 // OrderBy sets the optional parameter "orderBy": Sorts list results by a 3838 // certain order. By default, results are returned in alphanumerical order 3839 // based on the resource name. You can also sort results in descending order 3840 // based on the creation timestamp using `orderBy="creationTimestamp desc". 3841 // This sorts results based on the `creationTimestamp` field in reverse 3842 // chronological order (newest result first). Use this to sort resources like 3843 // operations so that the newest operation is returned first. Currently, only 3844 // sorting by `name` or `creationTimestamp desc` is supported. 3845 func (c *OperationsListCall) OrderBy(orderBy string) *OperationsListCall { 3846 c.urlParams_.Set("orderBy", orderBy) 3847 return c 3848 } 3849 3850 // PageToken sets the optional parameter "pageToken": Specifies a page token to 3851 // use. Set `pageToken` to the `nextPageToken` returned by a previous list 3852 // request to get the next page of results. 3853 func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall { 3854 c.urlParams_.Set("pageToken", pageToken) 3855 return c 3856 } 3857 3858 // Fields allows partial responses to be retrieved. See 3859 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3860 // details. 3861 func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall { 3862 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3863 return c 3864 } 3865 3866 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3867 // object's ETag matches the given value. This is useful for getting updates 3868 // only after the object has changed since the last request. 3869 func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall { 3870 c.ifNoneMatch_ = entityTag 3871 return c 3872 } 3873 3874 // Context sets the context to be used in this call's Do method. 3875 func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall { 3876 c.ctx_ = ctx 3877 return c 3878 } 3879 3880 // Header returns a http.Header that can be modified by the caller to add 3881 // headers to the request. 3882 func (c *OperationsListCall) Header() http.Header { 3883 if c.header_ == nil { 3884 c.header_ = make(http.Header) 3885 } 3886 return c.header_ 3887 } 3888 3889 func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) { 3890 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3891 if c.ifNoneMatch_ != "" { 3892 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3893 } 3894 var body io.Reader = nil 3895 c.urlParams_.Set("alt", alt) 3896 c.urlParams_.Set("prettyPrint", "false") 3897 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/operations") 3898 urls += "?" + c.urlParams_.Encode() 3899 req, err := http.NewRequest("GET", urls, body) 3900 if err != nil { 3901 return nil, err 3902 } 3903 req.Header = reqHeaders 3904 googleapi.Expand(req.URL, map[string]string{ 3905 "project": c.project, 3906 }) 3907 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3908 } 3909 3910 // Do executes the "deploymentmanager.operations.list" call. 3911 // Any non-2xx status code is an error. Response headers are in either 3912 // *OperationsListResponse.ServerResponse.Header or (if a response was returned 3913 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3914 // check whether the returned error was because http.StatusNotModified was 3915 // returned. 3916 func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*OperationsListResponse, error) { 3917 gensupport.SetOptions(c.urlParams_, opts...) 3918 res, err := c.doRequest("json") 3919 if res != nil && res.StatusCode == http.StatusNotModified { 3920 if res.Body != nil { 3921 res.Body.Close() 3922 } 3923 return nil, gensupport.WrapError(&googleapi.Error{ 3924 Code: res.StatusCode, 3925 Header: res.Header, 3926 }) 3927 } 3928 if err != nil { 3929 return nil, err 3930 } 3931 defer googleapi.CloseBody(res) 3932 if err := googleapi.CheckResponse(res); err != nil { 3933 return nil, gensupport.WrapError(err) 3934 } 3935 ret := &OperationsListResponse{ 3936 ServerResponse: googleapi.ServerResponse{ 3937 Header: res.Header, 3938 HTTPStatusCode: res.StatusCode, 3939 }, 3940 } 3941 target := &ret 3942 if err := gensupport.DecodeResponse(target, res); err != nil { 3943 return nil, err 3944 } 3945 return ret, nil 3946 } 3947 3948 // Pages invokes f for each page of results. 3949 // A non-nil error returned from f will halt the iteration. 3950 // The provided context supersedes any context provided to the Context method. 3951 func (c *OperationsListCall) Pages(ctx context.Context, f func(*OperationsListResponse) error) error { 3952 c.ctx_ = ctx 3953 defer c.PageToken(c.urlParams_.Get("pageToken")) 3954 for { 3955 x, err := c.Do() 3956 if err != nil { 3957 return err 3958 } 3959 if err := f(x); err != nil { 3960 return err 3961 } 3962 if x.NextPageToken == "" { 3963 return nil 3964 } 3965 c.PageToken(x.NextPageToken) 3966 } 3967 } 3968 3969 type ResourcesGetCall struct { 3970 s *Service 3971 project string 3972 deployment string 3973 resource string 3974 urlParams_ gensupport.URLParams 3975 ifNoneMatch_ string 3976 ctx_ context.Context 3977 header_ http.Header 3978 } 3979 3980 // Get: Gets information about a single resource. 3981 // 3982 // - deployment: The name of the deployment for this request. 3983 // - project: The project ID for this request. 3984 // - resource: The name of the resource for this request. 3985 func (r *ResourcesService) Get(project string, deployment string, resource string) *ResourcesGetCall { 3986 c := &ResourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3987 c.project = project 3988 c.deployment = deployment 3989 c.resource = resource 3990 return c 3991 } 3992 3993 // Fields allows partial responses to be retrieved. See 3994 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3995 // details. 3996 func (c *ResourcesGetCall) Fields(s ...googleapi.Field) *ResourcesGetCall { 3997 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3998 return c 3999 } 4000 4001 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4002 // object's ETag matches the given value. This is useful for getting updates 4003 // only after the object has changed since the last request. 4004 func (c *ResourcesGetCall) IfNoneMatch(entityTag string) *ResourcesGetCall { 4005 c.ifNoneMatch_ = entityTag 4006 return c 4007 } 4008 4009 // Context sets the context to be used in this call's Do method. 4010 func (c *ResourcesGetCall) Context(ctx context.Context) *ResourcesGetCall { 4011 c.ctx_ = ctx 4012 return c 4013 } 4014 4015 // Header returns a http.Header that can be modified by the caller to add 4016 // headers to the request. 4017 func (c *ResourcesGetCall) Header() http.Header { 4018 if c.header_ == nil { 4019 c.header_ = make(http.Header) 4020 } 4021 return c.header_ 4022 } 4023 4024 func (c *ResourcesGetCall) doRequest(alt string) (*http.Response, error) { 4025 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4026 if c.ifNoneMatch_ != "" { 4027 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4028 } 4029 var body io.Reader = nil 4030 c.urlParams_.Set("alt", alt) 4031 c.urlParams_.Set("prettyPrint", "false") 4032 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources/{resource}") 4033 urls += "?" + c.urlParams_.Encode() 4034 req, err := http.NewRequest("GET", urls, body) 4035 if err != nil { 4036 return nil, err 4037 } 4038 req.Header = reqHeaders 4039 googleapi.Expand(req.URL, map[string]string{ 4040 "project": c.project, 4041 "deployment": c.deployment, 4042 "resource": c.resource, 4043 }) 4044 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4045 } 4046 4047 // Do executes the "deploymentmanager.resources.get" call. 4048 // Any non-2xx status code is an error. Response headers are in either 4049 // *Resource.ServerResponse.Header or (if a response was returned at all) in 4050 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4051 // whether the returned error was because http.StatusNotModified was returned. 4052 func (c *ResourcesGetCall) Do(opts ...googleapi.CallOption) (*Resource, error) { 4053 gensupport.SetOptions(c.urlParams_, opts...) 4054 res, err := c.doRequest("json") 4055 if res != nil && res.StatusCode == http.StatusNotModified { 4056 if res.Body != nil { 4057 res.Body.Close() 4058 } 4059 return nil, gensupport.WrapError(&googleapi.Error{ 4060 Code: res.StatusCode, 4061 Header: res.Header, 4062 }) 4063 } 4064 if err != nil { 4065 return nil, err 4066 } 4067 defer googleapi.CloseBody(res) 4068 if err := googleapi.CheckResponse(res); err != nil { 4069 return nil, gensupport.WrapError(err) 4070 } 4071 ret := &Resource{ 4072 ServerResponse: googleapi.ServerResponse{ 4073 Header: res.Header, 4074 HTTPStatusCode: res.StatusCode, 4075 }, 4076 } 4077 target := &ret 4078 if err := gensupport.DecodeResponse(target, res); err != nil { 4079 return nil, err 4080 } 4081 return ret, nil 4082 } 4083 4084 type ResourcesListCall struct { 4085 s *Service 4086 project string 4087 deployment string 4088 urlParams_ gensupport.URLParams 4089 ifNoneMatch_ string 4090 ctx_ context.Context 4091 header_ http.Header 4092 } 4093 4094 // List: Lists all resources in a given deployment. 4095 // 4096 // - deployment: The name of the deployment for this request. 4097 // - project: The project ID for this request. 4098 func (r *ResourcesService) List(project string, deployment string) *ResourcesListCall { 4099 c := &ResourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4100 c.project = project 4101 c.deployment = deployment 4102 return c 4103 } 4104 4105 // Filter sets the optional parameter "filter": A filter expression that 4106 // filters resources listed in the response. Most Compute resources support two 4107 // types of filter expressions: expressions that support regular expressions 4108 // and expressions that follow API improvement proposal AIP-160. These two 4109 // types of filter expressions cannot be mixed in one request. If you want to 4110 // use AIP-160, your expression must specify the field name, an operator, and 4111 // the value that you want to use for filtering. The value must be a string, a 4112 // number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, 4113 // `>=` or `:`. For example, if you are filtering Compute Engine instances, you 4114 // can exclude instances named `example-instance` by specifying `name != 4115 // example-instance`. The `:*` comparison can be used to test whether a key has 4116 // been defined. For example, to find all objects with `owner` label use: ``` 4117 // labels.owner:* ``` You can also filter nested fields. For example, you could 4118 // specify `scheduling.automaticRestart = false` to include instances only if 4119 // they are not scheduled for automatic restarts. You can use filtering on 4120 // nested fields to filter based on resource labels. To filter on multiple 4121 // expressions, provide each separate expression within parentheses. For 4122 // example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel 4123 // Skylake") ``` By default, each expression is an `AND` expression. However, 4124 // you can include `AND` and `OR` expressions explicitly. For example: ``` 4125 // (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND 4126 // (scheduling.automaticRestart = true) ``` If you want to use a regular 4127 // expression, use the `eq` (equal) or `ne` (not equal) operator against a 4128 // single un-parenthesized expression with or without quotes or against 4129 // multiple parenthesized expressions. Examples: `fieldname eq unquoted 4130 // literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted 4131 // literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal 4132 // value is interpreted as a regular expression using Google RE2 library 4133 // syntax. The literal value must match the entire field. For example, to 4134 // filter for instances that do not end with name "instance", you would use 4135 // `name ne .*instance`. You cannot combine constraints on multiple fields 4136 // using regular expressions. 4137 func (c *ResourcesListCall) Filter(filter string) *ResourcesListCall { 4138 c.urlParams_.Set("filter", filter) 4139 return c 4140 } 4141 4142 // MaxResults sets the optional parameter "maxResults": The maximum number of 4143 // results per page that should be returned. If the number of available results 4144 // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that 4145 // can be used to get the next page of results in subsequent list requests. 4146 // Acceptable values are `0` to `500`, inclusive. (Default: `500`) 4147 func (c *ResourcesListCall) MaxResults(maxResults int64) *ResourcesListCall { 4148 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 4149 return c 4150 } 4151 4152 // OrderBy sets the optional parameter "orderBy": Sorts list results by a 4153 // certain order. By default, results are returned in alphanumerical order 4154 // based on the resource name. You can also sort results in descending order 4155 // based on the creation timestamp using `orderBy="creationTimestamp desc". 4156 // This sorts results based on the `creationTimestamp` field in reverse 4157 // chronological order (newest result first). Use this to sort resources like 4158 // operations so that the newest operation is returned first. Currently, only 4159 // sorting by `name` or `creationTimestamp desc` is supported. 4160 func (c *ResourcesListCall) OrderBy(orderBy string) *ResourcesListCall { 4161 c.urlParams_.Set("orderBy", orderBy) 4162 return c 4163 } 4164 4165 // PageToken sets the optional parameter "pageToken": Specifies a page token to 4166 // use. Set `pageToken` to the `nextPageToken` returned by a previous list 4167 // request to get the next page of results. 4168 func (c *ResourcesListCall) PageToken(pageToken string) *ResourcesListCall { 4169 c.urlParams_.Set("pageToken", pageToken) 4170 return c 4171 } 4172 4173 // Fields allows partial responses to be retrieved. See 4174 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4175 // details. 4176 func (c *ResourcesListCall) Fields(s ...googleapi.Field) *ResourcesListCall { 4177 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4178 return c 4179 } 4180 4181 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4182 // object's ETag matches the given value. This is useful for getting updates 4183 // only after the object has changed since the last request. 4184 func (c *ResourcesListCall) IfNoneMatch(entityTag string) *ResourcesListCall { 4185 c.ifNoneMatch_ = entityTag 4186 return c 4187 } 4188 4189 // Context sets the context to be used in this call's Do method. 4190 func (c *ResourcesListCall) Context(ctx context.Context) *ResourcesListCall { 4191 c.ctx_ = ctx 4192 return c 4193 } 4194 4195 // Header returns a http.Header that can be modified by the caller to add 4196 // headers to the request. 4197 func (c *ResourcesListCall) Header() http.Header { 4198 if c.header_ == nil { 4199 c.header_ = make(http.Header) 4200 } 4201 return c.header_ 4202 } 4203 4204 func (c *ResourcesListCall) doRequest(alt string) (*http.Response, error) { 4205 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4206 if c.ifNoneMatch_ != "" { 4207 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4208 } 4209 var body io.Reader = nil 4210 c.urlParams_.Set("alt", alt) 4211 c.urlParams_.Set("prettyPrint", "false") 4212 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources") 4213 urls += "?" + c.urlParams_.Encode() 4214 req, err := http.NewRequest("GET", urls, body) 4215 if err != nil { 4216 return nil, err 4217 } 4218 req.Header = reqHeaders 4219 googleapi.Expand(req.URL, map[string]string{ 4220 "project": c.project, 4221 "deployment": c.deployment, 4222 }) 4223 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4224 } 4225 4226 // Do executes the "deploymentmanager.resources.list" call. 4227 // Any non-2xx status code is an error. Response headers are in either 4228 // *ResourcesListResponse.ServerResponse.Header or (if a response was returned 4229 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4230 // check whether the returned error was because http.StatusNotModified was 4231 // returned. 4232 func (c *ResourcesListCall) Do(opts ...googleapi.CallOption) (*ResourcesListResponse, error) { 4233 gensupport.SetOptions(c.urlParams_, opts...) 4234 res, err := c.doRequest("json") 4235 if res != nil && res.StatusCode == http.StatusNotModified { 4236 if res.Body != nil { 4237 res.Body.Close() 4238 } 4239 return nil, gensupport.WrapError(&googleapi.Error{ 4240 Code: res.StatusCode, 4241 Header: res.Header, 4242 }) 4243 } 4244 if err != nil { 4245 return nil, err 4246 } 4247 defer googleapi.CloseBody(res) 4248 if err := googleapi.CheckResponse(res); err != nil { 4249 return nil, gensupport.WrapError(err) 4250 } 4251 ret := &ResourcesListResponse{ 4252 ServerResponse: googleapi.ServerResponse{ 4253 Header: res.Header, 4254 HTTPStatusCode: res.StatusCode, 4255 }, 4256 } 4257 target := &ret 4258 if err := gensupport.DecodeResponse(target, res); err != nil { 4259 return nil, err 4260 } 4261 return ret, nil 4262 } 4263 4264 // Pages invokes f for each page of results. 4265 // A non-nil error returned from f will halt the iteration. 4266 // The provided context supersedes any context provided to the Context method. 4267 func (c *ResourcesListCall) Pages(ctx context.Context, f func(*ResourcesListResponse) error) error { 4268 c.ctx_ = ctx 4269 defer c.PageToken(c.urlParams_.Get("pageToken")) 4270 for { 4271 x, err := c.Do() 4272 if err != nil { 4273 return err 4274 } 4275 if err := f(x); err != nil { 4276 return err 4277 } 4278 if x.NextPageToken == "" { 4279 return nil 4280 } 4281 c.PageToken(x.NextPageToken) 4282 } 4283 } 4284 4285 type TypesListCall struct { 4286 s *Service 4287 project string 4288 urlParams_ gensupport.URLParams 4289 ifNoneMatch_ string 4290 ctx_ context.Context 4291 header_ http.Header 4292 } 4293 4294 // List: Lists all resource types for Deployment Manager. 4295 // 4296 // - project: The project ID for this request. 4297 func (r *TypesService) List(project string) *TypesListCall { 4298 c := &TypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4299 c.project = project 4300 return c 4301 } 4302 4303 // Filter sets the optional parameter "filter": A filter expression that 4304 // filters resources listed in the response. Most Compute resources support two 4305 // types of filter expressions: expressions that support regular expressions 4306 // and expressions that follow API improvement proposal AIP-160. These two 4307 // types of filter expressions cannot be mixed in one request. If you want to 4308 // use AIP-160, your expression must specify the field name, an operator, and 4309 // the value that you want to use for filtering. The value must be a string, a 4310 // number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, 4311 // `>=` or `:`. For example, if you are filtering Compute Engine instances, you 4312 // can exclude instances named `example-instance` by specifying `name != 4313 // example-instance`. The `:*` comparison can be used to test whether a key has 4314 // been defined. For example, to find all objects with `owner` label use: ``` 4315 // labels.owner:* ``` You can also filter nested fields. For example, you could 4316 // specify `scheduling.automaticRestart = false` to include instances only if 4317 // they are not scheduled for automatic restarts. You can use filtering on 4318 // nested fields to filter based on resource labels. To filter on multiple 4319 // expressions, provide each separate expression within parentheses. For 4320 // example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel 4321 // Skylake") ``` By default, each expression is an `AND` expression. However, 4322 // you can include `AND` and `OR` expressions explicitly. For example: ``` 4323 // (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND 4324 // (scheduling.automaticRestart = true) ``` If you want to use a regular 4325 // expression, use the `eq` (equal) or `ne` (not equal) operator against a 4326 // single un-parenthesized expression with or without quotes or against 4327 // multiple parenthesized expressions. Examples: `fieldname eq unquoted 4328 // literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted 4329 // literal" `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal 4330 // value is interpreted as a regular expression using Google RE2 library 4331 // syntax. The literal value must match the entire field. For example, to 4332 // filter for instances that do not end with name "instance", you would use 4333 // `name ne .*instance`. You cannot combine constraints on multiple fields 4334 // using regular expressions. 4335 func (c *TypesListCall) Filter(filter string) *TypesListCall { 4336 c.urlParams_.Set("filter", filter) 4337 return c 4338 } 4339 4340 // MaxResults sets the optional parameter "maxResults": The maximum number of 4341 // results per page that should be returned. If the number of available results 4342 // is larger than `maxResults`, Compute Engine returns a `nextPageToken` that 4343 // can be used to get the next page of results in subsequent list requests. 4344 // Acceptable values are `0` to `500`, inclusive. (Default: `500`) 4345 func (c *TypesListCall) MaxResults(maxResults int64) *TypesListCall { 4346 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 4347 return c 4348 } 4349 4350 // OrderBy sets the optional parameter "orderBy": Sorts list results by a 4351 // certain order. By default, results are returned in alphanumerical order 4352 // based on the resource name. You can also sort results in descending order 4353 // based on the creation timestamp using `orderBy="creationTimestamp desc". 4354 // This sorts results based on the `creationTimestamp` field in reverse 4355 // chronological order (newest result first). Use this to sort resources like 4356 // operations so that the newest operation is returned first. Currently, only 4357 // sorting by `name` or `creationTimestamp desc` is supported. 4358 func (c *TypesListCall) OrderBy(orderBy string) *TypesListCall { 4359 c.urlParams_.Set("orderBy", orderBy) 4360 return c 4361 } 4362 4363 // PageToken sets the optional parameter "pageToken": Specifies a page token to 4364 // use. Set `pageToken` to the `nextPageToken` returned by a previous list 4365 // request to get the next page of results. 4366 func (c *TypesListCall) PageToken(pageToken string) *TypesListCall { 4367 c.urlParams_.Set("pageToken", pageToken) 4368 return c 4369 } 4370 4371 // Fields allows partial responses to be retrieved. See 4372 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4373 // details. 4374 func (c *TypesListCall) Fields(s ...googleapi.Field) *TypesListCall { 4375 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4376 return c 4377 } 4378 4379 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4380 // object's ETag matches the given value. This is useful for getting updates 4381 // only after the object has changed since the last request. 4382 func (c *TypesListCall) IfNoneMatch(entityTag string) *TypesListCall { 4383 c.ifNoneMatch_ = entityTag 4384 return c 4385 } 4386 4387 // Context sets the context to be used in this call's Do method. 4388 func (c *TypesListCall) Context(ctx context.Context) *TypesListCall { 4389 c.ctx_ = ctx 4390 return c 4391 } 4392 4393 // Header returns a http.Header that can be modified by the caller to add 4394 // headers to the request. 4395 func (c *TypesListCall) Header() http.Header { 4396 if c.header_ == nil { 4397 c.header_ = make(http.Header) 4398 } 4399 return c.header_ 4400 } 4401 4402 func (c *TypesListCall) doRequest(alt string) (*http.Response, error) { 4403 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4404 if c.ifNoneMatch_ != "" { 4405 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4406 } 4407 var body io.Reader = nil 4408 c.urlParams_.Set("alt", alt) 4409 c.urlParams_.Set("prettyPrint", "false") 4410 urls := googleapi.ResolveRelative(c.s.BasePath, "deploymentmanager/v2/projects/{project}/global/types") 4411 urls += "?" + c.urlParams_.Encode() 4412 req, err := http.NewRequest("GET", urls, body) 4413 if err != nil { 4414 return nil, err 4415 } 4416 req.Header = reqHeaders 4417 googleapi.Expand(req.URL, map[string]string{ 4418 "project": c.project, 4419 }) 4420 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4421 } 4422 4423 // Do executes the "deploymentmanager.types.list" call. 4424 // Any non-2xx status code is an error. Response headers are in either 4425 // *TypesListResponse.ServerResponse.Header or (if a response was returned at 4426 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4427 // check whether the returned error was because http.StatusNotModified was 4428 // returned. 4429 func (c *TypesListCall) Do(opts ...googleapi.CallOption) (*TypesListResponse, error) { 4430 gensupport.SetOptions(c.urlParams_, opts...) 4431 res, err := c.doRequest("json") 4432 if res != nil && res.StatusCode == http.StatusNotModified { 4433 if res.Body != nil { 4434 res.Body.Close() 4435 } 4436 return nil, gensupport.WrapError(&googleapi.Error{ 4437 Code: res.StatusCode, 4438 Header: res.Header, 4439 }) 4440 } 4441 if err != nil { 4442 return nil, err 4443 } 4444 defer googleapi.CloseBody(res) 4445 if err := googleapi.CheckResponse(res); err != nil { 4446 return nil, gensupport.WrapError(err) 4447 } 4448 ret := &TypesListResponse{ 4449 ServerResponse: googleapi.ServerResponse{ 4450 Header: res.Header, 4451 HTTPStatusCode: res.StatusCode, 4452 }, 4453 } 4454 target := &ret 4455 if err := gensupport.DecodeResponse(target, res); err != nil { 4456 return nil, err 4457 } 4458 return ret, nil 4459 } 4460 4461 // Pages invokes f for each page of results. 4462 // A non-nil error returned from f will halt the iteration. 4463 // The provided context supersedes any context provided to the Context method. 4464 func (c *TypesListCall) Pages(ctx context.Context, f func(*TypesListResponse) error) error { 4465 c.ctx_ = ctx 4466 defer c.PageToken(c.urlParams_.Get("pageToken")) 4467 for { 4468 x, err := c.Do() 4469 if err != nil { 4470 return err 4471 } 4472 if err := f(x); err != nil { 4473 return err 4474 } 4475 if x.NextPageToken == "" { 4476 return nil 4477 } 4478 c.PageToken(x.NextPageToken) 4479 } 4480 } 4481