1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package assuredworkloads provides access to the Assured Workloads API. 8// 9// For product documentation, see: https://cloud.google.com 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/assuredworkloads/v1" 16// ... 17// ctx := context.Background() 18// assuredworkloadsService, err := assuredworkloads.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// assuredworkloadsService, err := assuredworkloads.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// assuredworkloadsService, err := assuredworkloads.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package assuredworkloads // import "google.golang.org/api/assuredworkloads/v1" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "assuredworkloads:v1" 75const apiName = "assuredworkloads" 76const apiVersion = "v1" 77const basePath = "https://assuredworkloads.googleapis.com/" 78const mtlsBasePath = "https://assuredworkloads.mtls.googleapis.com/" 79 80// OAuth2 scopes used by this API. 81const ( 82 // See, edit, configure, and delete your Google Cloud data and see the 83 // email address for your Google Account. 84 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 85) 86 87// NewService creates a new Service. 88func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 89 scopesOption := option.WithScopes( 90 "https://www.googleapis.com/auth/cloud-platform", 91 ) 92 // NOTE: prepend, so we don't override user-specified scopes. 93 opts = append([]option.ClientOption{scopesOption}, opts...) 94 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 95 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 96 client, endpoint, err := htransport.NewClient(ctx, opts...) 97 if err != nil { 98 return nil, err 99 } 100 s, err := New(client) 101 if err != nil { 102 return nil, err 103 } 104 if endpoint != "" { 105 s.BasePath = endpoint 106 } 107 return s, nil 108} 109 110// New creates a new Service. It uses the provided http.Client for requests. 111// 112// Deprecated: please use NewService instead. 113// To provide a custom HTTP client, use option.WithHTTPClient. 114// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 115func New(client *http.Client) (*Service, error) { 116 if client == nil { 117 return nil, errors.New("client is nil") 118 } 119 s := &Service{client: client, BasePath: basePath} 120 s.Organizations = NewOrganizationsService(s) 121 return s, nil 122} 123 124type Service struct { 125 client *http.Client 126 BasePath string // API endpoint base URL 127 UserAgent string // optional additional User-Agent fragment 128 129 Organizations *OrganizationsService 130} 131 132func (s *Service) userAgent() string { 133 if s.UserAgent == "" { 134 return googleapi.UserAgent 135 } 136 return googleapi.UserAgent + " " + s.UserAgent 137} 138 139func NewOrganizationsService(s *Service) *OrganizationsService { 140 rs := &OrganizationsService{s: s} 141 rs.Locations = NewOrganizationsLocationsService(s) 142 return rs 143} 144 145type OrganizationsService struct { 146 s *Service 147 148 Locations *OrganizationsLocationsService 149} 150 151func NewOrganizationsLocationsService(s *Service) *OrganizationsLocationsService { 152 rs := &OrganizationsLocationsService{s: s} 153 rs.Operations = NewOrganizationsLocationsOperationsService(s) 154 rs.Workloads = NewOrganizationsLocationsWorkloadsService(s) 155 return rs 156} 157 158type OrganizationsLocationsService struct { 159 s *Service 160 161 Operations *OrganizationsLocationsOperationsService 162 163 Workloads *OrganizationsLocationsWorkloadsService 164} 165 166func NewOrganizationsLocationsOperationsService(s *Service) *OrganizationsLocationsOperationsService { 167 rs := &OrganizationsLocationsOperationsService{s: s} 168 return rs 169} 170 171type OrganizationsLocationsOperationsService struct { 172 s *Service 173} 174 175func NewOrganizationsLocationsWorkloadsService(s *Service) *OrganizationsLocationsWorkloadsService { 176 rs := &OrganizationsLocationsWorkloadsService{s: s} 177 return rs 178} 179 180type OrganizationsLocationsWorkloadsService struct { 181 s *Service 182} 183 184// GoogleCloudAssuredworkloadsV1CreateWorkloadOperationMetadata: 185// Operation metadata to give request details of CreateWorkload. 186type GoogleCloudAssuredworkloadsV1CreateWorkloadOperationMetadata struct { 187 // ComplianceRegime: Optional. Compliance controls that should be 188 // applied to the resources managed by the workload. 189 // 190 // Possible values: 191 // "COMPLIANCE_REGIME_UNSPECIFIED" - Unknown compliance regime. 192 // "IL4" - Information protection as per DoD IL4 requirements. 193 // "CJIS" - Criminal Justice Information Services (CJIS) Security 194 // policies. 195 // "FEDRAMP_HIGH" - FedRAMP High data protection controls 196 // "FEDRAMP_MODERATE" - FedRAMP Moderate data protection controls 197 // "US_REGIONAL_ACCESS" - Assured Workloads For US Regions data 198 // protection controls 199 // "HIPAA" - Health Insurance Portability and Accountability Act 200 // controls 201 // "HITRUST" - Health Information Trust Alliance controls 202 // "EU_REGIONS_AND_SUPPORT" - Assured Workloads For EU Regions and 203 // Support controls 204 // "CA_REGIONS_AND_SUPPORT" - Assured Workloads For Canada Regions and 205 // Support controls 206 ComplianceRegime string `json:"complianceRegime,omitempty"` 207 208 // CreateTime: Optional. Time when the operation was created. 209 CreateTime string `json:"createTime,omitempty"` 210 211 // DisplayName: Optional. The display name of the workload. 212 DisplayName string `json:"displayName,omitempty"` 213 214 // Parent: Optional. The parent of the workload. 215 Parent string `json:"parent,omitempty"` 216 217 // ForceSendFields is a list of field names (e.g. "ComplianceRegime") to 218 // unconditionally include in API requests. By default, fields with 219 // empty or default values are omitted from API requests. However, any 220 // non-pointer, non-interface field appearing in ForceSendFields will be 221 // sent to the server regardless of whether the field is empty or not. 222 // This may be used to include empty fields in Patch requests. 223 ForceSendFields []string `json:"-"` 224 225 // NullFields is a list of field names (e.g. "ComplianceRegime") to 226 // include in API requests with the JSON null value. By default, fields 227 // with empty values are omitted from API requests. However, any field 228 // with an empty value appearing in NullFields will be sent to the 229 // server as null. It is an error if a field in this list has a 230 // non-empty value. This may be used to include null fields in Patch 231 // requests. 232 NullFields []string `json:"-"` 233} 234 235func (s *GoogleCloudAssuredworkloadsV1CreateWorkloadOperationMetadata) MarshalJSON() ([]byte, error) { 236 type NoMethod GoogleCloudAssuredworkloadsV1CreateWorkloadOperationMetadata 237 raw := NoMethod(*s) 238 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 239} 240 241// GoogleCloudAssuredworkloadsV1ListWorkloadsResponse: Response of 242// ListWorkloads endpoint. 243type GoogleCloudAssuredworkloadsV1ListWorkloadsResponse struct { 244 // NextPageToken: The next page token. Return empty if reached the last 245 // page. 246 NextPageToken string `json:"nextPageToken,omitempty"` 247 248 // Workloads: List of Workloads under a given parent. 249 Workloads []*GoogleCloudAssuredworkloadsV1Workload `json:"workloads,omitempty"` 250 251 // ServerResponse contains the HTTP response code and headers from the 252 // server. 253 googleapi.ServerResponse `json:"-"` 254 255 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 256 // unconditionally include in API requests. By default, fields with 257 // empty or default values are omitted from API requests. However, any 258 // non-pointer, non-interface field appearing in ForceSendFields will be 259 // sent to the server regardless of whether the field is empty or not. 260 // This may be used to include empty fields in Patch requests. 261 ForceSendFields []string `json:"-"` 262 263 // NullFields is a list of field names (e.g. "NextPageToken") to include 264 // in API requests with the JSON null value. By default, fields with 265 // empty values are omitted from API requests. However, any field with 266 // an empty value appearing in NullFields will be sent to the server as 267 // null. It is an error if a field in this list has a non-empty value. 268 // This may be used to include null fields in Patch requests. 269 NullFields []string `json:"-"` 270} 271 272func (s *GoogleCloudAssuredworkloadsV1ListWorkloadsResponse) MarshalJSON() ([]byte, error) { 273 type NoMethod GoogleCloudAssuredworkloadsV1ListWorkloadsResponse 274 raw := NoMethod(*s) 275 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 276} 277 278// GoogleCloudAssuredworkloadsV1Workload: An Workload object for 279// managing highly regulated workloads of cloud customers. 280type GoogleCloudAssuredworkloadsV1Workload struct { 281 // BillingAccount: Required. Input only. The billing account used for 282 // the resources which are direct children of workload. This billing 283 // account is initially associated with the resources created as part of 284 // Workload creation. After the initial creation of these resources, the 285 // customer can change the assigned billing account. The resource name 286 // has the form `billingAccounts/{billing_account_id}`. For example, 287 // `billingAccounts/012345-567890-ABCDEF`. 288 BillingAccount string `json:"billingAccount,omitempty"` 289 290 // ComplianceRegime: Required. Immutable. Compliance Regime associated 291 // with this workload. 292 // 293 // Possible values: 294 // "COMPLIANCE_REGIME_UNSPECIFIED" - Unknown compliance regime. 295 // "IL4" - Information protection as per DoD IL4 requirements. 296 // "CJIS" - Criminal Justice Information Services (CJIS) Security 297 // policies. 298 // "FEDRAMP_HIGH" - FedRAMP High data protection controls 299 // "FEDRAMP_MODERATE" - FedRAMP Moderate data protection controls 300 // "US_REGIONAL_ACCESS" - Assured Workloads For US Regions data 301 // protection controls 302 // "HIPAA" - Health Insurance Portability and Accountability Act 303 // controls 304 // "HITRUST" - Health Information Trust Alliance controls 305 // "EU_REGIONS_AND_SUPPORT" - Assured Workloads For EU Regions and 306 // Support controls 307 // "CA_REGIONS_AND_SUPPORT" - Assured Workloads For Canada Regions and 308 // Support controls 309 ComplianceRegime string `json:"complianceRegime,omitempty"` 310 311 // CreateTime: Output only. Immutable. The Workload creation timestamp. 312 CreateTime string `json:"createTime,omitempty"` 313 314 // DisplayName: Required. The user-assigned display name of the 315 // Workload. When present it must be between 4 to 30 characters. Allowed 316 // characters are: lowercase and uppercase letters, numbers, hyphen, and 317 // spaces. Example: My Workload 318 DisplayName string `json:"displayName,omitempty"` 319 320 // Etag: Optional. ETag of the workload, it is calculated on the basis 321 // of the Workload contents. It will be used in Update & Delete 322 // operations. 323 Etag string `json:"etag,omitempty"` 324 325 // KmsSettings: Input only. Settings used to create a CMEK crypto key. 326 // When set a project with a KMS CMEK key is provisioned. This field is 327 // mandatory for a subset of Compliance Regimes. 328 KmsSettings *GoogleCloudAssuredworkloadsV1WorkloadKMSSettings `json:"kmsSettings,omitempty"` 329 330 // Labels: Optional. Labels applied to the workload. 331 Labels map[string]string `json:"labels,omitempty"` 332 333 // Name: Optional. The resource name of the workload. Format: 334 // organizations/{organization}/locations/{location}/workloads/{workload} 335 // Read-only. 336 Name string `json:"name,omitempty"` 337 338 // ProvisionedResourcesParent: Input only. The parent resource for the 339 // resources managed by this Assured Workload. May be either empty or a 340 // folder resource which is a child of the Workload parent. If not 341 // specified all resources are created under the parent organization. 342 // Format: folders/{folder_id} 343 ProvisionedResourcesParent string `json:"provisionedResourcesParent,omitempty"` 344 345 // ResourceSettings: Input only. Resource properties that are used to 346 // customize workload resources. These properties (such as custom 347 // project id) will be used to create workload resources if possible. 348 // This field is optional. 349 ResourceSettings []*GoogleCloudAssuredworkloadsV1WorkloadResourceSettings `json:"resourceSettings,omitempty"` 350 351 // Resources: Output only. The resources associated with this workload. 352 // These resources will be created when creating the workload. If any of 353 // the projects already exist, the workload creation will fail. Always 354 // read only. 355 Resources []*GoogleCloudAssuredworkloadsV1WorkloadResourceInfo `json:"resources,omitempty"` 356 357 // ServerResponse contains the HTTP response code and headers from the 358 // server. 359 googleapi.ServerResponse `json:"-"` 360 361 // ForceSendFields is a list of field names (e.g. "BillingAccount") to 362 // unconditionally include in API requests. By default, fields with 363 // empty or default values are omitted from API requests. However, any 364 // non-pointer, non-interface field appearing in ForceSendFields will be 365 // sent to the server regardless of whether the field is empty or not. 366 // This may be used to include empty fields in Patch requests. 367 ForceSendFields []string `json:"-"` 368 369 // NullFields is a list of field names (e.g. "BillingAccount") to 370 // include in API requests with the JSON null value. By default, fields 371 // with empty values are omitted from API requests. However, any field 372 // with an empty value appearing in NullFields will be sent to the 373 // server as null. It is an error if a field in this list has a 374 // non-empty value. This may be used to include null fields in Patch 375 // requests. 376 NullFields []string `json:"-"` 377} 378 379func (s *GoogleCloudAssuredworkloadsV1Workload) MarshalJSON() ([]byte, error) { 380 type NoMethod GoogleCloudAssuredworkloadsV1Workload 381 raw := NoMethod(*s) 382 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 383} 384 385// GoogleCloudAssuredworkloadsV1WorkloadKMSSettings: Settings specific 386// to the Key Management Service. 387type GoogleCloudAssuredworkloadsV1WorkloadKMSSettings struct { 388 // NextRotationTime: Required. Input only. Immutable. The time at which 389 // the Key Management Service will automatically create a new version of 390 // the crypto key and mark it as the primary. 391 NextRotationTime string `json:"nextRotationTime,omitempty"` 392 393 // RotationPeriod: Required. Input only. Immutable. [next_rotation_time] 394 // will be advanced by this period when the Key Management Service 395 // automatically rotates a key. Must be at least 24 hours and at most 396 // 876,000 hours. 397 RotationPeriod string `json:"rotationPeriod,omitempty"` 398 399 // ForceSendFields is a list of field names (e.g. "NextRotationTime") to 400 // unconditionally include in API requests. By default, fields with 401 // empty or default values are omitted from API requests. However, any 402 // non-pointer, non-interface field appearing in ForceSendFields will be 403 // sent to the server regardless of whether the field is empty or not. 404 // This may be used to include empty fields in Patch requests. 405 ForceSendFields []string `json:"-"` 406 407 // NullFields is a list of field names (e.g. "NextRotationTime") to 408 // include in API requests with the JSON null value. By default, fields 409 // with empty values are omitted from API requests. However, any field 410 // with an empty value appearing in NullFields will be sent to the 411 // server as null. It is an error if a field in this list has a 412 // non-empty value. This may be used to include null fields in Patch 413 // requests. 414 NullFields []string `json:"-"` 415} 416 417func (s *GoogleCloudAssuredworkloadsV1WorkloadKMSSettings) MarshalJSON() ([]byte, error) { 418 type NoMethod GoogleCloudAssuredworkloadsV1WorkloadKMSSettings 419 raw := NoMethod(*s) 420 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 421} 422 423// GoogleCloudAssuredworkloadsV1WorkloadResourceInfo: Represent the 424// resources that are children of this Workload. 425type GoogleCloudAssuredworkloadsV1WorkloadResourceInfo struct { 426 // ResourceId: Resource identifier. For a project this represents 427 // project_number. 428 ResourceId int64 `json:"resourceId,omitempty,string"` 429 430 // ResourceType: Indicates the type of resource. 431 // 432 // Possible values: 433 // "RESOURCE_TYPE_UNSPECIFIED" - Unknown resource type. 434 // "CONSUMER_PROJECT" - Consumer project. 435 // "ENCRYPTION_KEYS_PROJECT" - Consumer project containing encryption 436 // keys. 437 // "KEYRING" - Keyring resource that hosts encryption keys. 438 ResourceType string `json:"resourceType,omitempty"` 439 440 // ForceSendFields is a list of field names (e.g. "ResourceId") to 441 // unconditionally include in API requests. By default, fields with 442 // empty or default values are omitted from API requests. However, any 443 // non-pointer, non-interface field appearing in ForceSendFields will be 444 // sent to the server regardless of whether the field is empty or not. 445 // This may be used to include empty fields in Patch requests. 446 ForceSendFields []string `json:"-"` 447 448 // NullFields is a list of field names (e.g. "ResourceId") to include in 449 // API requests with the JSON null value. By default, fields with empty 450 // values are omitted from API requests. However, any field with an 451 // empty value appearing in NullFields will be sent to the server as 452 // null. It is an error if a field in this list has a non-empty value. 453 // This may be used to include null fields in Patch requests. 454 NullFields []string `json:"-"` 455} 456 457func (s *GoogleCloudAssuredworkloadsV1WorkloadResourceInfo) MarshalJSON() ([]byte, error) { 458 type NoMethod GoogleCloudAssuredworkloadsV1WorkloadResourceInfo 459 raw := NoMethod(*s) 460 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 461} 462 463// GoogleCloudAssuredworkloadsV1WorkloadResourceSettings: Represent the 464// custom settings for the resources to be created. 465type GoogleCloudAssuredworkloadsV1WorkloadResourceSettings struct { 466 // DisplayName: User-assigned resource display name. If not empty it 467 // will be used to create a resource with the specified name. 468 DisplayName string `json:"displayName,omitempty"` 469 470 // ResourceId: Resource identifier. For a project this represents 471 // project_id. If the project is already taken, the workload creation 472 // will fail. 473 ResourceId string `json:"resourceId,omitempty"` 474 475 // ResourceType: Indicates the type of resource. This field should be 476 // specified to correspond the id to the right project type 477 // (CONSUMER_PROJECT or ENCRYPTION_KEYS_PROJECT) 478 // 479 // Possible values: 480 // "RESOURCE_TYPE_UNSPECIFIED" - Unknown resource type. 481 // "CONSUMER_PROJECT" - Consumer project. 482 // "ENCRYPTION_KEYS_PROJECT" - Consumer project containing encryption 483 // keys. 484 // "KEYRING" - Keyring resource that hosts encryption keys. 485 ResourceType string `json:"resourceType,omitempty"` 486 487 // ForceSendFields is a list of field names (e.g. "DisplayName") to 488 // unconditionally include in API requests. By default, fields with 489 // empty or default values are omitted from API requests. However, any 490 // non-pointer, non-interface field appearing in ForceSendFields will be 491 // sent to the server regardless of whether the field is empty or not. 492 // This may be used to include empty fields in Patch requests. 493 ForceSendFields []string `json:"-"` 494 495 // NullFields is a list of field names (e.g. "DisplayName") to include 496 // in API requests with the JSON null value. By default, fields with 497 // empty values are omitted from API requests. However, any field with 498 // an empty value appearing in NullFields will be sent to the server as 499 // null. It is an error if a field in this list has a non-empty value. 500 // This may be used to include null fields in Patch requests. 501 NullFields []string `json:"-"` 502} 503 504func (s *GoogleCloudAssuredworkloadsV1WorkloadResourceSettings) MarshalJSON() ([]byte, error) { 505 type NoMethod GoogleCloudAssuredworkloadsV1WorkloadResourceSettings 506 raw := NoMethod(*s) 507 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 508} 509 510// GoogleCloudAssuredworkloadsV1beta1CreateWorkloadOperationMetadata: 511// Operation metadata to give request details of CreateWorkload. 512type GoogleCloudAssuredworkloadsV1beta1CreateWorkloadOperationMetadata struct { 513 // ComplianceRegime: Optional. Compliance controls that should be 514 // applied to the resources managed by the workload. 515 // 516 // Possible values: 517 // "COMPLIANCE_REGIME_UNSPECIFIED" - Unknown compliance regime. 518 // "IL4" - Information protection as per DoD IL4 requirements. 519 // "CJIS" - Criminal Justice Information Services (CJIS) Security 520 // policies. 521 // "FEDRAMP_HIGH" - FedRAMP High data protection controls 522 // "FEDRAMP_MODERATE" - FedRAMP Moderate data protection controls 523 // "US_REGIONAL_ACCESS" - Assured Workloads For US Regions data 524 // protection controls 525 // "HIPAA" - Health Insurance Portability and Accountability Act 526 // controls 527 // "HITRUST" - Health Information Trust Alliance controls 528 // "EU_REGIONS_AND_SUPPORT" - Assured Workloads For EU Regions and 529 // Support controls 530 // "CA_REGIONS_AND_SUPPORT" - Assured Workloads For Canada Regions and 531 // Support controls 532 ComplianceRegime string `json:"complianceRegime,omitempty"` 533 534 // CreateTime: Optional. Time when the operation was created. 535 CreateTime string `json:"createTime,omitempty"` 536 537 // DisplayName: Optional. The display name of the workload. 538 DisplayName string `json:"displayName,omitempty"` 539 540 // Parent: Optional. The parent of the workload. 541 Parent string `json:"parent,omitempty"` 542 543 // ResourceSettings: Optional. Resource properties in the input that are 544 // used for creating/customizing workload resources. 545 ResourceSettings []*GoogleCloudAssuredworkloadsV1beta1WorkloadResourceSettings `json:"resourceSettings,omitempty"` 546 547 // ForceSendFields is a list of field names (e.g. "ComplianceRegime") to 548 // unconditionally include in API requests. By default, fields with 549 // empty or default values are omitted from API requests. However, any 550 // non-pointer, non-interface field appearing in ForceSendFields will be 551 // sent to the server regardless of whether the field is empty or not. 552 // This may be used to include empty fields in Patch requests. 553 ForceSendFields []string `json:"-"` 554 555 // NullFields is a list of field names (e.g. "ComplianceRegime") to 556 // include in API requests with the JSON null value. By default, fields 557 // with empty values are omitted from API requests. However, any field 558 // with an empty value appearing in NullFields will be sent to the 559 // server as null. It is an error if a field in this list has a 560 // non-empty value. This may be used to include null fields in Patch 561 // requests. 562 NullFields []string `json:"-"` 563} 564 565func (s *GoogleCloudAssuredworkloadsV1beta1CreateWorkloadOperationMetadata) MarshalJSON() ([]byte, error) { 566 type NoMethod GoogleCloudAssuredworkloadsV1beta1CreateWorkloadOperationMetadata 567 raw := NoMethod(*s) 568 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 569} 570 571// GoogleCloudAssuredworkloadsV1beta1Workload: An Workload object for 572// managing highly regulated workloads of cloud customers. 573type GoogleCloudAssuredworkloadsV1beta1Workload struct { 574 // BillingAccount: Input only. The billing account used for the 575 // resources which are direct children of workload. This billing account 576 // is initially associated with the resources created as part of 577 // Workload creation. After the initial creation of these resources, the 578 // customer can change the assigned billing account. The resource name 579 // has the form `billingAccounts/{billing_account_id}`. For example, 580 // `billingAccounts/012345-567890-ABCDEF`. 581 BillingAccount string `json:"billingAccount,omitempty"` 582 583 // CjisSettings: Required. Input only. Immutable. Settings specific to 584 // resources needed for CJIS. 585 CjisSettings *GoogleCloudAssuredworkloadsV1beta1WorkloadCJISSettings `json:"cjisSettings,omitempty"` 586 587 // ComplianceRegime: Required. Immutable. Compliance Regime associated 588 // with this workload. 589 // 590 // Possible values: 591 // "COMPLIANCE_REGIME_UNSPECIFIED" - Unknown compliance regime. 592 // "IL4" - Information protection as per DoD IL4 requirements. 593 // "CJIS" - Criminal Justice Information Services (CJIS) Security 594 // policies. 595 // "FEDRAMP_HIGH" - FedRAMP High data protection controls 596 // "FEDRAMP_MODERATE" - FedRAMP Moderate data protection controls 597 // "US_REGIONAL_ACCESS" - Assured Workloads For US Regions data 598 // protection controls 599 // "HIPAA" - Health Insurance Portability and Accountability Act 600 // controls 601 // "HITRUST" - Health Information Trust Alliance controls 602 // "EU_REGIONS_AND_SUPPORT" - Assured Workloads For EU Regions and 603 // Support controls 604 // "CA_REGIONS_AND_SUPPORT" - Assured Workloads For Canada Regions and 605 // Support controls 606 ComplianceRegime string `json:"complianceRegime,omitempty"` 607 608 // CreateTime: Output only. Immutable. The Workload creation timestamp. 609 CreateTime string `json:"createTime,omitempty"` 610 611 // DisplayName: Required. The user-assigned display name of the 612 // Workload. When present it must be between 4 to 30 characters. Allowed 613 // characters are: lowercase and uppercase letters, numbers, hyphen, and 614 // spaces. Example: My Workload 615 DisplayName string `json:"displayName,omitempty"` 616 617 // Etag: Optional. ETag of the workload, it is calculated on the basis 618 // of the Workload contents. It will be used in Update & Delete 619 // operations. 620 Etag string `json:"etag,omitempty"` 621 622 // FedrampHighSettings: Required. Input only. Immutable. Settings 623 // specific to resources needed for FedRAMP High. 624 FedrampHighSettings *GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampHighSettings `json:"fedrampHighSettings,omitempty"` 625 626 // FedrampModerateSettings: Required. Input only. Immutable. Settings 627 // specific to resources needed for FedRAMP Moderate. 628 FedrampModerateSettings *GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampModerateSettings `json:"fedrampModerateSettings,omitempty"` 629 630 // Il4Settings: Required. Input only. Immutable. Settings specific to 631 // resources needed for IL4. 632 Il4Settings *GoogleCloudAssuredworkloadsV1beta1WorkloadIL4Settings `json:"il4Settings,omitempty"` 633 634 // KmsSettings: Input only. Settings used to create a CMEK crypto key. 635 // When set a project with a KMS CMEK key is provisioned. This field is 636 // mandatory for a subset of Compliance Regimes. 637 KmsSettings *GoogleCloudAssuredworkloadsV1beta1WorkloadKMSSettings `json:"kmsSettings,omitempty"` 638 639 // Labels: Optional. Labels applied to the workload. 640 Labels map[string]string `json:"labels,omitempty"` 641 642 // Name: Optional. The resource name of the workload. Format: 643 // organizations/{organization}/locations/{location}/workloads/{workload} 644 // Read-only. 645 Name string `json:"name,omitempty"` 646 647 // ProvisionedResourcesParent: Input only. The parent resource for the 648 // resources managed by this Assured Workload. May be either empty or a 649 // folder resource which is a child of the Workload parent. If not 650 // specified all resources are created under the parent organization. 651 // Format: folders/{folder_id} 652 ProvisionedResourcesParent string `json:"provisionedResourcesParent,omitempty"` 653 654 // ResourceSettings: Input only. Resource properties that are used to 655 // customize workload resources. These properties (such as custom 656 // project id) will be used to create workload resources if possible. 657 // This field is optional. 658 ResourceSettings []*GoogleCloudAssuredworkloadsV1beta1WorkloadResourceSettings `json:"resourceSettings,omitempty"` 659 660 // Resources: Output only. The resources associated with this workload. 661 // These resources will be created when creating the workload. If any of 662 // the projects already exist, the workload creation will fail. Always 663 // read only. 664 Resources []*GoogleCloudAssuredworkloadsV1beta1WorkloadResourceInfo `json:"resources,omitempty"` 665 666 // ForceSendFields is a list of field names (e.g. "BillingAccount") to 667 // unconditionally include in API requests. By default, fields with 668 // empty or default values are omitted from API requests. However, any 669 // non-pointer, non-interface field appearing in ForceSendFields will be 670 // sent to the server regardless of whether the field is empty or not. 671 // This may be used to include empty fields in Patch requests. 672 ForceSendFields []string `json:"-"` 673 674 // NullFields is a list of field names (e.g. "BillingAccount") to 675 // include in API requests with the JSON null value. By default, fields 676 // with empty values are omitted from API requests. However, any field 677 // with an empty value appearing in NullFields will be sent to the 678 // server as null. It is an error if a field in this list has a 679 // non-empty value. This may be used to include null fields in Patch 680 // requests. 681 NullFields []string `json:"-"` 682} 683 684func (s *GoogleCloudAssuredworkloadsV1beta1Workload) MarshalJSON() ([]byte, error) { 685 type NoMethod GoogleCloudAssuredworkloadsV1beta1Workload 686 raw := NoMethod(*s) 687 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 688} 689 690// GoogleCloudAssuredworkloadsV1beta1WorkloadCJISSettings: Settings 691// specific to resources needed for CJIS. 692type GoogleCloudAssuredworkloadsV1beta1WorkloadCJISSettings struct { 693 // KmsSettings: Required. Input only. Immutable. Settings used to create 694 // a CMEK crypto key. 695 KmsSettings *GoogleCloudAssuredworkloadsV1beta1WorkloadKMSSettings `json:"kmsSettings,omitempty"` 696 697 // ForceSendFields is a list of field names (e.g. "KmsSettings") to 698 // unconditionally include in API requests. By default, fields with 699 // empty or default values are omitted from API requests. However, any 700 // non-pointer, non-interface field appearing in ForceSendFields will be 701 // sent to the server regardless of whether the field is empty or not. 702 // This may be used to include empty fields in Patch requests. 703 ForceSendFields []string `json:"-"` 704 705 // NullFields is a list of field names (e.g. "KmsSettings") to include 706 // in API requests with the JSON null value. By default, fields with 707 // empty values are omitted from API requests. However, any field with 708 // an empty value appearing in NullFields will be sent to the server as 709 // null. It is an error if a field in this list has a non-empty value. 710 // This may be used to include null fields in Patch requests. 711 NullFields []string `json:"-"` 712} 713 714func (s *GoogleCloudAssuredworkloadsV1beta1WorkloadCJISSettings) MarshalJSON() ([]byte, error) { 715 type NoMethod GoogleCloudAssuredworkloadsV1beta1WorkloadCJISSettings 716 raw := NoMethod(*s) 717 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 718} 719 720// GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampHighSettings: 721// Settings specific to resources needed for FedRAMP High. 722type GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampHighSettings struct { 723 // KmsSettings: Required. Input only. Immutable. Settings used to create 724 // a CMEK crypto key. 725 KmsSettings *GoogleCloudAssuredworkloadsV1beta1WorkloadKMSSettings `json:"kmsSettings,omitempty"` 726 727 // ForceSendFields is a list of field names (e.g. "KmsSettings") to 728 // unconditionally include in API requests. By default, fields with 729 // empty or default values are omitted from API requests. However, any 730 // non-pointer, non-interface field appearing in ForceSendFields will be 731 // sent to the server regardless of whether the field is empty or not. 732 // This may be used to include empty fields in Patch requests. 733 ForceSendFields []string `json:"-"` 734 735 // NullFields is a list of field names (e.g. "KmsSettings") to include 736 // in API requests with the JSON null value. By default, fields with 737 // empty values are omitted from API requests. However, any field with 738 // an empty value appearing in NullFields will be sent to the server as 739 // null. It is an error if a field in this list has a non-empty value. 740 // This may be used to include null fields in Patch requests. 741 NullFields []string `json:"-"` 742} 743 744func (s *GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampHighSettings) MarshalJSON() ([]byte, error) { 745 type NoMethod GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampHighSettings 746 raw := NoMethod(*s) 747 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 748} 749 750// GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampModerateSettings: 751// Settings specific to resources needed for FedRAMP Moderate. 752type GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampModerateSettings struct { 753 // KmsSettings: Required. Input only. Immutable. Settings used to create 754 // a CMEK crypto key. 755 KmsSettings *GoogleCloudAssuredworkloadsV1beta1WorkloadKMSSettings `json:"kmsSettings,omitempty"` 756 757 // ForceSendFields is a list of field names (e.g. "KmsSettings") to 758 // unconditionally include in API requests. By default, fields with 759 // empty or default values are omitted from API requests. However, any 760 // non-pointer, non-interface field appearing in ForceSendFields will be 761 // sent to the server regardless of whether the field is empty or not. 762 // This may be used to include empty fields in Patch requests. 763 ForceSendFields []string `json:"-"` 764 765 // NullFields is a list of field names (e.g. "KmsSettings") to include 766 // in API requests with the JSON null value. By default, fields with 767 // empty values are omitted from API requests. However, any field with 768 // an empty value appearing in NullFields will be sent to the server as 769 // null. It is an error if a field in this list has a non-empty value. 770 // This may be used to include null fields in Patch requests. 771 NullFields []string `json:"-"` 772} 773 774func (s *GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampModerateSettings) MarshalJSON() ([]byte, error) { 775 type NoMethod GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampModerateSettings 776 raw := NoMethod(*s) 777 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 778} 779 780// GoogleCloudAssuredworkloadsV1beta1WorkloadIL4Settings: Settings 781// specific to resources needed for IL4. 782type GoogleCloudAssuredworkloadsV1beta1WorkloadIL4Settings struct { 783 // KmsSettings: Required. Input only. Immutable. Settings used to create 784 // a CMEK crypto key. 785 KmsSettings *GoogleCloudAssuredworkloadsV1beta1WorkloadKMSSettings `json:"kmsSettings,omitempty"` 786 787 // ForceSendFields is a list of field names (e.g. "KmsSettings") to 788 // unconditionally include in API requests. By default, fields with 789 // empty or default values are omitted from API requests. However, any 790 // non-pointer, non-interface field appearing in ForceSendFields will be 791 // sent to the server regardless of whether the field is empty or not. 792 // This may be used to include empty fields in Patch requests. 793 ForceSendFields []string `json:"-"` 794 795 // NullFields is a list of field names (e.g. "KmsSettings") to include 796 // in API requests with the JSON null value. By default, fields with 797 // empty values are omitted from API requests. However, any field with 798 // an empty value appearing in NullFields will be sent to the server as 799 // null. It is an error if a field in this list has a non-empty value. 800 // This may be used to include null fields in Patch requests. 801 NullFields []string `json:"-"` 802} 803 804func (s *GoogleCloudAssuredworkloadsV1beta1WorkloadIL4Settings) MarshalJSON() ([]byte, error) { 805 type NoMethod GoogleCloudAssuredworkloadsV1beta1WorkloadIL4Settings 806 raw := NoMethod(*s) 807 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 808} 809 810// GoogleCloudAssuredworkloadsV1beta1WorkloadKMSSettings: Settings 811// specific to the Key Management Service. 812type GoogleCloudAssuredworkloadsV1beta1WorkloadKMSSettings struct { 813 // NextRotationTime: Required. Input only. Immutable. The time at which 814 // the Key Management Service will automatically create a new version of 815 // the crypto key and mark it as the primary. 816 NextRotationTime string `json:"nextRotationTime,omitempty"` 817 818 // RotationPeriod: Required. Input only. Immutable. [next_rotation_time] 819 // will be advanced by this period when the Key Management Service 820 // automatically rotates a key. Must be at least 24 hours and at most 821 // 876,000 hours. 822 RotationPeriod string `json:"rotationPeriod,omitempty"` 823 824 // ForceSendFields is a list of field names (e.g. "NextRotationTime") to 825 // unconditionally include in API requests. By default, fields with 826 // empty or default values are omitted from API requests. However, any 827 // non-pointer, non-interface field appearing in ForceSendFields will be 828 // sent to the server regardless of whether the field is empty or not. 829 // This may be used to include empty fields in Patch requests. 830 ForceSendFields []string `json:"-"` 831 832 // NullFields is a list of field names (e.g. "NextRotationTime") to 833 // include in API requests with the JSON null value. By default, fields 834 // with empty values are omitted from API requests. However, any field 835 // with an empty value appearing in NullFields will be sent to the 836 // server as null. It is an error if a field in this list has a 837 // non-empty value. This may be used to include null fields in Patch 838 // requests. 839 NullFields []string `json:"-"` 840} 841 842func (s *GoogleCloudAssuredworkloadsV1beta1WorkloadKMSSettings) MarshalJSON() ([]byte, error) { 843 type NoMethod GoogleCloudAssuredworkloadsV1beta1WorkloadKMSSettings 844 raw := NoMethod(*s) 845 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 846} 847 848// GoogleCloudAssuredworkloadsV1beta1WorkloadResourceInfo: Represent the 849// resources that are children of this Workload. 850type GoogleCloudAssuredworkloadsV1beta1WorkloadResourceInfo struct { 851 // ResourceId: Resource identifier. For a project this represents 852 // project_number. 853 ResourceId int64 `json:"resourceId,omitempty,string"` 854 855 // ResourceType: Indicates the type of resource. 856 // 857 // Possible values: 858 // "RESOURCE_TYPE_UNSPECIFIED" - Unknown resource type. 859 // "CONSUMER_PROJECT" - Deprecated. Existing workloads will continue 860 // to support this, but new CreateWorkloadRequests should not specify 861 // this as an input value. 862 // "CONSUMER_FOLDER" - Consumer Folder. 863 // "ENCRYPTION_KEYS_PROJECT" - Consumer project containing encryption 864 // keys. 865 // "KEYRING" - Keyring resource that hosts encryption keys. 866 ResourceType string `json:"resourceType,omitempty"` 867 868 // ForceSendFields is a list of field names (e.g. "ResourceId") to 869 // unconditionally include in API requests. By default, fields with 870 // empty or default values are omitted from API requests. However, any 871 // non-pointer, non-interface field appearing in ForceSendFields will be 872 // sent to the server regardless of whether the field is empty or not. 873 // This may be used to include empty fields in Patch requests. 874 ForceSendFields []string `json:"-"` 875 876 // NullFields is a list of field names (e.g. "ResourceId") to include in 877 // API requests with the JSON null value. By default, fields with empty 878 // values are omitted from API requests. However, any field with an 879 // empty value appearing in NullFields will be sent to the server as 880 // null. It is an error if a field in this list has a non-empty value. 881 // This may be used to include null fields in Patch requests. 882 NullFields []string `json:"-"` 883} 884 885func (s *GoogleCloudAssuredworkloadsV1beta1WorkloadResourceInfo) MarshalJSON() ([]byte, error) { 886 type NoMethod GoogleCloudAssuredworkloadsV1beta1WorkloadResourceInfo 887 raw := NoMethod(*s) 888 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 889} 890 891// GoogleCloudAssuredworkloadsV1beta1WorkloadResourceSettings: Represent 892// the custom settings for the resources to be created. 893type GoogleCloudAssuredworkloadsV1beta1WorkloadResourceSettings struct { 894 // DisplayName: User-assigned resource display name. If not empty it 895 // will be used to create a resource with the specified name. 896 DisplayName string `json:"displayName,omitempty"` 897 898 // ResourceId: Resource identifier. For a project this represents 899 // project_id. If the project is already taken, the workload creation 900 // will fail. 901 ResourceId string `json:"resourceId,omitempty"` 902 903 // ResourceType: Indicates the type of resource. This field should be 904 // specified to correspond the id to the right project type 905 // (CONSUMER_PROJECT or ENCRYPTION_KEYS_PROJECT) 906 // 907 // Possible values: 908 // "RESOURCE_TYPE_UNSPECIFIED" - Unknown resource type. 909 // "CONSUMER_PROJECT" - Deprecated. Existing workloads will continue 910 // to support this, but new CreateWorkloadRequests should not specify 911 // this as an input value. 912 // "CONSUMER_FOLDER" - Consumer Folder. 913 // "ENCRYPTION_KEYS_PROJECT" - Consumer project containing encryption 914 // keys. 915 // "KEYRING" - Keyring resource that hosts encryption keys. 916 ResourceType string `json:"resourceType,omitempty"` 917 918 // ForceSendFields is a list of field names (e.g. "DisplayName") to 919 // unconditionally include in API requests. By default, fields with 920 // empty or default values are omitted from API requests. However, any 921 // non-pointer, non-interface field appearing in ForceSendFields will be 922 // sent to the server regardless of whether the field is empty or not. 923 // This may be used to include empty fields in Patch requests. 924 ForceSendFields []string `json:"-"` 925 926 // NullFields is a list of field names (e.g. "DisplayName") to include 927 // in API requests with the JSON null value. By default, fields with 928 // empty values are omitted from API requests. However, any field with 929 // an empty value appearing in NullFields will be sent to the server as 930 // null. It is an error if a field in this list has a non-empty value. 931 // This may be used to include null fields in Patch requests. 932 NullFields []string `json:"-"` 933} 934 935func (s *GoogleCloudAssuredworkloadsV1beta1WorkloadResourceSettings) MarshalJSON() ([]byte, error) { 936 type NoMethod GoogleCloudAssuredworkloadsV1beta1WorkloadResourceSettings 937 raw := NoMethod(*s) 938 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 939} 940 941// GoogleLongrunningListOperationsResponse: The response message for 942// Operations.ListOperations. 943type GoogleLongrunningListOperationsResponse struct { 944 // NextPageToken: The standard List next-page token. 945 NextPageToken string `json:"nextPageToken,omitempty"` 946 947 // Operations: A list of operations that matches the specified filter in 948 // the request. 949 Operations []*GoogleLongrunningOperation `json:"operations,omitempty"` 950 951 // ServerResponse contains the HTTP response code and headers from the 952 // server. 953 googleapi.ServerResponse `json:"-"` 954 955 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 956 // unconditionally include in API requests. By default, fields with 957 // empty or default values are omitted from API requests. However, any 958 // non-pointer, non-interface field appearing in ForceSendFields will be 959 // sent to the server regardless of whether the field is empty or not. 960 // This may be used to include empty fields in Patch requests. 961 ForceSendFields []string `json:"-"` 962 963 // NullFields is a list of field names (e.g. "NextPageToken") to include 964 // in API requests with the JSON null value. By default, fields with 965 // empty values are omitted from API requests. However, any field with 966 // an empty value appearing in NullFields will be sent to the server as 967 // null. It is an error if a field in this list has a non-empty value. 968 // This may be used to include null fields in Patch requests. 969 NullFields []string `json:"-"` 970} 971 972func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) { 973 type NoMethod GoogleLongrunningListOperationsResponse 974 raw := NoMethod(*s) 975 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 976} 977 978// GoogleLongrunningOperation: This resource represents a long-running 979// operation that is the result of a network API call. 980type GoogleLongrunningOperation struct { 981 // Done: If the value is `false`, it means the operation is still in 982 // progress. If `true`, the operation is completed, and either `error` 983 // or `response` is available. 984 Done bool `json:"done,omitempty"` 985 986 // Error: The error result of the operation in case of failure or 987 // cancellation. 988 Error *GoogleRpcStatus `json:"error,omitempty"` 989 990 // Metadata: Service-specific metadata associated with the operation. It 991 // typically contains progress information and common metadata such as 992 // create time. Some services might not provide such metadata. Any 993 // method that returns a long-running operation should document the 994 // metadata type, if any. 995 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 996 997 // Name: The server-assigned name, which is only unique within the same 998 // service that originally returns it. If you use the default HTTP 999 // mapping, the `name` should be a resource name ending with 1000 // `operations/{unique_id}`. 1001 Name string `json:"name,omitempty"` 1002 1003 // Response: The normal response of the operation in case of success. If 1004 // the original method returns no data on success, such as `Delete`, the 1005 // response is `google.protobuf.Empty`. If the original method is 1006 // standard `Get`/`Create`/`Update`, the response should be the 1007 // resource. For other methods, the response should have the type 1008 // `XxxResponse`, where `Xxx` is the original method name. For example, 1009 // if the original method name is `TakeSnapshot()`, the inferred 1010 // response type is `TakeSnapshotResponse`. 1011 Response googleapi.RawMessage `json:"response,omitempty"` 1012 1013 // ServerResponse contains the HTTP response code and headers from the 1014 // server. 1015 googleapi.ServerResponse `json:"-"` 1016 1017 // ForceSendFields is a list of field names (e.g. "Done") to 1018 // unconditionally include in API requests. By default, fields with 1019 // empty or default values are omitted from API requests. However, any 1020 // non-pointer, non-interface field appearing in ForceSendFields will be 1021 // sent to the server regardless of whether the field is empty or not. 1022 // This may be used to include empty fields in Patch requests. 1023 ForceSendFields []string `json:"-"` 1024 1025 // NullFields is a list of field names (e.g. "Done") to include in API 1026 // requests with the JSON null value. By default, fields with empty 1027 // values are omitted from API requests. However, any field with an 1028 // empty value appearing in NullFields will be sent to the server as 1029 // null. It is an error if a field in this list has a non-empty value. 1030 // This may be used to include null fields in Patch requests. 1031 NullFields []string `json:"-"` 1032} 1033 1034func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) { 1035 type NoMethod GoogleLongrunningOperation 1036 raw := NoMethod(*s) 1037 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1038} 1039 1040// GoogleProtobufEmpty: A generic empty message that you can re-use to 1041// avoid defining duplicated empty messages in your APIs. A typical 1042// example is to use it as the request or the response type of an API 1043// method. For instance: service Foo { rpc Bar(google.protobuf.Empty) 1044// returns (google.protobuf.Empty); } The JSON representation for 1045// `Empty` is empty JSON object `{}`. 1046type GoogleProtobufEmpty struct { 1047 // ServerResponse contains the HTTP response code and headers from the 1048 // server. 1049 googleapi.ServerResponse `json:"-"` 1050} 1051 1052// GoogleRpcStatus: The `Status` type defines a logical error model that 1053// is suitable for different programming environments, including REST 1054// APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 1055// `Status` message contains three pieces of data: error code, error 1056// message, and error details. You can find out more about this error 1057// model and how to work with it in the API Design Guide 1058// (https://cloud.google.com/apis/design/errors). 1059type GoogleRpcStatus struct { 1060 // Code: The status code, which should be an enum value of 1061 // google.rpc.Code. 1062 Code int64 `json:"code,omitempty"` 1063 1064 // Details: A list of messages that carry the error details. There is a 1065 // common set of message types for APIs to use. 1066 Details []googleapi.RawMessage `json:"details,omitempty"` 1067 1068 // Message: A developer-facing error message, which should be in 1069 // English. Any user-facing error message should be localized and sent 1070 // in the google.rpc.Status.details field, or localized by the client. 1071 Message string `json:"message,omitempty"` 1072 1073 // ForceSendFields is a list of field names (e.g. "Code") to 1074 // unconditionally include in API requests. By default, fields with 1075 // empty or default values are omitted from API requests. However, any 1076 // non-pointer, non-interface field appearing in ForceSendFields will be 1077 // sent to the server regardless of whether the field is empty or not. 1078 // This may be used to include empty fields in Patch requests. 1079 ForceSendFields []string `json:"-"` 1080 1081 // NullFields is a list of field names (e.g. "Code") to include in API 1082 // requests with the JSON null value. By default, fields with empty 1083 // values are omitted from API requests. However, any field with an 1084 // empty value appearing in NullFields will be sent to the server as 1085 // null. It is an error if a field in this list has a non-empty value. 1086 // This may be used to include null fields in Patch requests. 1087 NullFields []string `json:"-"` 1088} 1089 1090func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) { 1091 type NoMethod GoogleRpcStatus 1092 raw := NoMethod(*s) 1093 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1094} 1095 1096// method id "assuredworkloads.organizations.locations.operations.get": 1097 1098type OrganizationsLocationsOperationsGetCall struct { 1099 s *Service 1100 name string 1101 urlParams_ gensupport.URLParams 1102 ifNoneMatch_ string 1103 ctx_ context.Context 1104 header_ http.Header 1105} 1106 1107// Get: Gets the latest state of a long-running operation. Clients can 1108// use this method to poll the operation result at intervals as 1109// recommended by the API service. 1110// 1111// - name: The name of the operation resource. 1112func (r *OrganizationsLocationsOperationsService) Get(name string) *OrganizationsLocationsOperationsGetCall { 1113 c := &OrganizationsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1114 c.name = name 1115 return c 1116} 1117 1118// Fields allows partial responses to be retrieved. See 1119// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1120// for more information. 1121func (c *OrganizationsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsGetCall { 1122 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1123 return c 1124} 1125 1126// IfNoneMatch sets the optional parameter which makes the operation 1127// fail if the object's ETag matches the given value. This is useful for 1128// getting updates only after the object has changed since the last 1129// request. Use googleapi.IsNotModified to check whether the response 1130// error from Do is the result of In-None-Match. 1131func (c *OrganizationsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOperationsGetCall { 1132 c.ifNoneMatch_ = entityTag 1133 return c 1134} 1135 1136// Context sets the context to be used in this call's Do method. Any 1137// pending HTTP request will be aborted if the provided context is 1138// canceled. 1139func (c *OrganizationsLocationsOperationsGetCall) Context(ctx context.Context) *OrganizationsLocationsOperationsGetCall { 1140 c.ctx_ = ctx 1141 return c 1142} 1143 1144// Header returns an http.Header that can be modified by the caller to 1145// add HTTP headers to the request. 1146func (c *OrganizationsLocationsOperationsGetCall) Header() http.Header { 1147 if c.header_ == nil { 1148 c.header_ = make(http.Header) 1149 } 1150 return c.header_ 1151} 1152 1153func (c *OrganizationsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 1154 reqHeaders := make(http.Header) 1155 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 1156 for k, v := range c.header_ { 1157 reqHeaders[k] = v 1158 } 1159 reqHeaders.Set("User-Agent", c.s.userAgent()) 1160 if c.ifNoneMatch_ != "" { 1161 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1162 } 1163 var body io.Reader = nil 1164 c.urlParams_.Set("alt", alt) 1165 c.urlParams_.Set("prettyPrint", "false") 1166 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 1167 urls += "?" + c.urlParams_.Encode() 1168 req, err := http.NewRequest("GET", urls, body) 1169 if err != nil { 1170 return nil, err 1171 } 1172 req.Header = reqHeaders 1173 googleapi.Expand(req.URL, map[string]string{ 1174 "name": c.name, 1175 }) 1176 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1177} 1178 1179// Do executes the "assuredworkloads.organizations.locations.operations.get" call. 1180// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 1181// Any non-2xx status code is an error. Response headers are in either 1182// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 1183// was returned at all) in error.(*googleapi.Error).Header. Use 1184// googleapi.IsNotModified to check whether the returned error was 1185// because http.StatusNotModified was returned. 1186func (c *OrganizationsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 1187 gensupport.SetOptions(c.urlParams_, opts...) 1188 res, err := c.doRequest("json") 1189 if res != nil && res.StatusCode == http.StatusNotModified { 1190 if res.Body != nil { 1191 res.Body.Close() 1192 } 1193 return nil, &googleapi.Error{ 1194 Code: res.StatusCode, 1195 Header: res.Header, 1196 } 1197 } 1198 if err != nil { 1199 return nil, err 1200 } 1201 defer googleapi.CloseBody(res) 1202 if err := googleapi.CheckResponse(res); err != nil { 1203 return nil, err 1204 } 1205 ret := &GoogleLongrunningOperation{ 1206 ServerResponse: googleapi.ServerResponse{ 1207 Header: res.Header, 1208 HTTPStatusCode: res.StatusCode, 1209 }, 1210 } 1211 target := &ret 1212 if err := gensupport.DecodeResponse(target, res); err != nil { 1213 return nil, err 1214 } 1215 return ret, nil 1216 // { 1217 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", 1218 // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/operations/{operationsId}", 1219 // "httpMethod": "GET", 1220 // "id": "assuredworkloads.organizations.locations.operations.get", 1221 // "parameterOrder": [ 1222 // "name" 1223 // ], 1224 // "parameters": { 1225 // "name": { 1226 // "description": "The name of the operation resource.", 1227 // "location": "path", 1228 // "pattern": "^organizations/[^/]+/locations/[^/]+/operations/[^/]+$", 1229 // "required": true, 1230 // "type": "string" 1231 // } 1232 // }, 1233 // "path": "v1/{+name}", 1234 // "response": { 1235 // "$ref": "GoogleLongrunningOperation" 1236 // }, 1237 // "scopes": [ 1238 // "https://www.googleapis.com/auth/cloud-platform" 1239 // ] 1240 // } 1241 1242} 1243 1244// method id "assuredworkloads.organizations.locations.operations.list": 1245 1246type OrganizationsLocationsOperationsListCall struct { 1247 s *Service 1248 name string 1249 urlParams_ gensupport.URLParams 1250 ifNoneMatch_ string 1251 ctx_ context.Context 1252 header_ http.Header 1253} 1254 1255// List: Lists operations that match the specified filter in the 1256// request. If the server doesn't support this method, it returns 1257// `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to 1258// override the binding to use different resource name schemes, such as 1259// `users/*/operations`. To override the binding, API services can add a 1260// binding such as "/v1/{name=users/*}/operations" to their service 1261// configuration. For backwards compatibility, the default name includes 1262// the operations collection id, however overriding users must ensure 1263// the name binding is the parent resource, without the operations 1264// collection id. 1265// 1266// - name: The name of the operation's parent resource. 1267func (r *OrganizationsLocationsOperationsService) List(name string) *OrganizationsLocationsOperationsListCall { 1268 c := &OrganizationsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1269 c.name = name 1270 return c 1271} 1272 1273// Filter sets the optional parameter "filter": The standard list 1274// filter. 1275func (c *OrganizationsLocationsOperationsListCall) Filter(filter string) *OrganizationsLocationsOperationsListCall { 1276 c.urlParams_.Set("filter", filter) 1277 return c 1278} 1279 1280// PageSize sets the optional parameter "pageSize": The standard list 1281// page size. 1282func (c *OrganizationsLocationsOperationsListCall) PageSize(pageSize int64) *OrganizationsLocationsOperationsListCall { 1283 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 1284 return c 1285} 1286 1287// PageToken sets the optional parameter "pageToken": The standard list 1288// page token. 1289func (c *OrganizationsLocationsOperationsListCall) PageToken(pageToken string) *OrganizationsLocationsOperationsListCall { 1290 c.urlParams_.Set("pageToken", pageToken) 1291 return c 1292} 1293 1294// Fields allows partial responses to be retrieved. See 1295// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1296// for more information. 1297func (c *OrganizationsLocationsOperationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsListCall { 1298 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1299 return c 1300} 1301 1302// IfNoneMatch sets the optional parameter which makes the operation 1303// fail if the object's ETag matches the given value. This is useful for 1304// getting updates only after the object has changed since the last 1305// request. Use googleapi.IsNotModified to check whether the response 1306// error from Do is the result of In-None-Match. 1307func (c *OrganizationsLocationsOperationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOperationsListCall { 1308 c.ifNoneMatch_ = entityTag 1309 return c 1310} 1311 1312// Context sets the context to be used in this call's Do method. Any 1313// pending HTTP request will be aborted if the provided context is 1314// canceled. 1315func (c *OrganizationsLocationsOperationsListCall) Context(ctx context.Context) *OrganizationsLocationsOperationsListCall { 1316 c.ctx_ = ctx 1317 return c 1318} 1319 1320// Header returns an http.Header that can be modified by the caller to 1321// add HTTP headers to the request. 1322func (c *OrganizationsLocationsOperationsListCall) Header() http.Header { 1323 if c.header_ == nil { 1324 c.header_ = make(http.Header) 1325 } 1326 return c.header_ 1327} 1328 1329func (c *OrganizationsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) { 1330 reqHeaders := make(http.Header) 1331 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 1332 for k, v := range c.header_ { 1333 reqHeaders[k] = v 1334 } 1335 reqHeaders.Set("User-Agent", c.s.userAgent()) 1336 if c.ifNoneMatch_ != "" { 1337 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1338 } 1339 var body io.Reader = nil 1340 c.urlParams_.Set("alt", alt) 1341 c.urlParams_.Set("prettyPrint", "false") 1342 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations") 1343 urls += "?" + c.urlParams_.Encode() 1344 req, err := http.NewRequest("GET", urls, body) 1345 if err != nil { 1346 return nil, err 1347 } 1348 req.Header = reqHeaders 1349 googleapi.Expand(req.URL, map[string]string{ 1350 "name": c.name, 1351 }) 1352 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1353} 1354 1355// Do executes the "assuredworkloads.organizations.locations.operations.list" call. 1356// Exactly one of *GoogleLongrunningListOperationsResponse or error will 1357// be non-nil. Any non-2xx status code is an error. Response headers are 1358// in either 1359// *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if 1360// a response was returned at all) in error.(*googleapi.Error).Header. 1361// Use googleapi.IsNotModified to check whether the returned error was 1362// because http.StatusNotModified was returned. 1363func (c *OrganizationsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) { 1364 gensupport.SetOptions(c.urlParams_, opts...) 1365 res, err := c.doRequest("json") 1366 if res != nil && res.StatusCode == http.StatusNotModified { 1367 if res.Body != nil { 1368 res.Body.Close() 1369 } 1370 return nil, &googleapi.Error{ 1371 Code: res.StatusCode, 1372 Header: res.Header, 1373 } 1374 } 1375 if err != nil { 1376 return nil, err 1377 } 1378 defer googleapi.CloseBody(res) 1379 if err := googleapi.CheckResponse(res); err != nil { 1380 return nil, err 1381 } 1382 ret := &GoogleLongrunningListOperationsResponse{ 1383 ServerResponse: googleapi.ServerResponse{ 1384 Header: res.Header, 1385 HTTPStatusCode: res.StatusCode, 1386 }, 1387 } 1388 target := &ret 1389 if err := gensupport.DecodeResponse(target, res); err != nil { 1390 return nil, err 1391 } 1392 return ret, nil 1393 // { 1394 // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", 1395 // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/operations", 1396 // "httpMethod": "GET", 1397 // "id": "assuredworkloads.organizations.locations.operations.list", 1398 // "parameterOrder": [ 1399 // "name" 1400 // ], 1401 // "parameters": { 1402 // "filter": { 1403 // "description": "The standard list filter.", 1404 // "location": "query", 1405 // "type": "string" 1406 // }, 1407 // "name": { 1408 // "description": "The name of the operation's parent resource.", 1409 // "location": "path", 1410 // "pattern": "^organizations/[^/]+/locations/[^/]+$", 1411 // "required": true, 1412 // "type": "string" 1413 // }, 1414 // "pageSize": { 1415 // "description": "The standard list page size.", 1416 // "format": "int32", 1417 // "location": "query", 1418 // "type": "integer" 1419 // }, 1420 // "pageToken": { 1421 // "description": "The standard list page token.", 1422 // "location": "query", 1423 // "type": "string" 1424 // } 1425 // }, 1426 // "path": "v1/{+name}/operations", 1427 // "response": { 1428 // "$ref": "GoogleLongrunningListOperationsResponse" 1429 // }, 1430 // "scopes": [ 1431 // "https://www.googleapis.com/auth/cloud-platform" 1432 // ] 1433 // } 1434 1435} 1436 1437// Pages invokes f for each page of results. 1438// A non-nil error returned from f will halt the iteration. 1439// The provided context supersedes any context provided to the Context method. 1440func (c *OrganizationsLocationsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error { 1441 c.ctx_ = ctx 1442 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 1443 for { 1444 x, err := c.Do() 1445 if err != nil { 1446 return err 1447 } 1448 if err := f(x); err != nil { 1449 return err 1450 } 1451 if x.NextPageToken == "" { 1452 return nil 1453 } 1454 c.PageToken(x.NextPageToken) 1455 } 1456} 1457 1458// method id "assuredworkloads.organizations.locations.workloads.create": 1459 1460type OrganizationsLocationsWorkloadsCreateCall struct { 1461 s *Service 1462 parent string 1463 googlecloudassuredworkloadsv1workload *GoogleCloudAssuredworkloadsV1Workload 1464 urlParams_ gensupport.URLParams 1465 ctx_ context.Context 1466 header_ http.Header 1467} 1468 1469// Create: Creates Assured Workload. 1470// 1471// - parent: The resource name of the new Workload's parent. Must be of 1472// the form `organizations/{org_id}/locations/{location_id}`. 1473func (r *OrganizationsLocationsWorkloadsService) Create(parent string, googlecloudassuredworkloadsv1workload *GoogleCloudAssuredworkloadsV1Workload) *OrganizationsLocationsWorkloadsCreateCall { 1474 c := &OrganizationsLocationsWorkloadsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1475 c.parent = parent 1476 c.googlecloudassuredworkloadsv1workload = googlecloudassuredworkloadsv1workload 1477 return c 1478} 1479 1480// ExternalId sets the optional parameter "externalId": A identifier 1481// associated with the workload and underlying projects which allows for 1482// the break down of billing costs for a workload. The value provided 1483// for the identifier will add a label to the workload and contained 1484// projects with the identifier as the value. 1485func (c *OrganizationsLocationsWorkloadsCreateCall) ExternalId(externalId string) *OrganizationsLocationsWorkloadsCreateCall { 1486 c.urlParams_.Set("externalId", externalId) 1487 return c 1488} 1489 1490// Fields allows partial responses to be retrieved. See 1491// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1492// for more information. 1493func (c *OrganizationsLocationsWorkloadsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsWorkloadsCreateCall { 1494 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1495 return c 1496} 1497 1498// Context sets the context to be used in this call's Do method. Any 1499// pending HTTP request will be aborted if the provided context is 1500// canceled. 1501func (c *OrganizationsLocationsWorkloadsCreateCall) Context(ctx context.Context) *OrganizationsLocationsWorkloadsCreateCall { 1502 c.ctx_ = ctx 1503 return c 1504} 1505 1506// Header returns an http.Header that can be modified by the caller to 1507// add HTTP headers to the request. 1508func (c *OrganizationsLocationsWorkloadsCreateCall) Header() http.Header { 1509 if c.header_ == nil { 1510 c.header_ = make(http.Header) 1511 } 1512 return c.header_ 1513} 1514 1515func (c *OrganizationsLocationsWorkloadsCreateCall) doRequest(alt string) (*http.Response, error) { 1516 reqHeaders := make(http.Header) 1517 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 1518 for k, v := range c.header_ { 1519 reqHeaders[k] = v 1520 } 1521 reqHeaders.Set("User-Agent", c.s.userAgent()) 1522 var body io.Reader = nil 1523 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudassuredworkloadsv1workload) 1524 if err != nil { 1525 return nil, err 1526 } 1527 reqHeaders.Set("Content-Type", "application/json") 1528 c.urlParams_.Set("alt", alt) 1529 c.urlParams_.Set("prettyPrint", "false") 1530 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workloads") 1531 urls += "?" + c.urlParams_.Encode() 1532 req, err := http.NewRequest("POST", urls, body) 1533 if err != nil { 1534 return nil, err 1535 } 1536 req.Header = reqHeaders 1537 googleapi.Expand(req.URL, map[string]string{ 1538 "parent": c.parent, 1539 }) 1540 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1541} 1542 1543// Do executes the "assuredworkloads.organizations.locations.workloads.create" call. 1544// Exactly one of *GoogleLongrunningOperation or error will be non-nil. 1545// Any non-2xx status code is an error. Response headers are in either 1546// *GoogleLongrunningOperation.ServerResponse.Header or (if a response 1547// was returned at all) in error.(*googleapi.Error).Header. Use 1548// googleapi.IsNotModified to check whether the returned error was 1549// because http.StatusNotModified was returned. 1550func (c *OrganizationsLocationsWorkloadsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 1551 gensupport.SetOptions(c.urlParams_, opts...) 1552 res, err := c.doRequest("json") 1553 if res != nil && res.StatusCode == http.StatusNotModified { 1554 if res.Body != nil { 1555 res.Body.Close() 1556 } 1557 return nil, &googleapi.Error{ 1558 Code: res.StatusCode, 1559 Header: res.Header, 1560 } 1561 } 1562 if err != nil { 1563 return nil, err 1564 } 1565 defer googleapi.CloseBody(res) 1566 if err := googleapi.CheckResponse(res); err != nil { 1567 return nil, err 1568 } 1569 ret := &GoogleLongrunningOperation{ 1570 ServerResponse: googleapi.ServerResponse{ 1571 Header: res.Header, 1572 HTTPStatusCode: res.StatusCode, 1573 }, 1574 } 1575 target := &ret 1576 if err := gensupport.DecodeResponse(target, res); err != nil { 1577 return nil, err 1578 } 1579 return ret, nil 1580 // { 1581 // "description": "Creates Assured Workload.", 1582 // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/workloads", 1583 // "httpMethod": "POST", 1584 // "id": "assuredworkloads.organizations.locations.workloads.create", 1585 // "parameterOrder": [ 1586 // "parent" 1587 // ], 1588 // "parameters": { 1589 // "externalId": { 1590 // "description": "Optional. A identifier associated with the workload and underlying projects which allows for the break down of billing costs for a workload. The value provided for the identifier will add a label to the workload and contained projects with the identifier as the value.", 1591 // "location": "query", 1592 // "type": "string" 1593 // }, 1594 // "parent": { 1595 // "description": "Required. The resource name of the new Workload's parent. Must be of the form `organizations/{org_id}/locations/{location_id}`.", 1596 // "location": "path", 1597 // "pattern": "^organizations/[^/]+/locations/[^/]+$", 1598 // "required": true, 1599 // "type": "string" 1600 // } 1601 // }, 1602 // "path": "v1/{+parent}/workloads", 1603 // "request": { 1604 // "$ref": "GoogleCloudAssuredworkloadsV1Workload" 1605 // }, 1606 // "response": { 1607 // "$ref": "GoogleLongrunningOperation" 1608 // }, 1609 // "scopes": [ 1610 // "https://www.googleapis.com/auth/cloud-platform" 1611 // ] 1612 // } 1613 1614} 1615 1616// method id "assuredworkloads.organizations.locations.workloads.delete": 1617 1618type OrganizationsLocationsWorkloadsDeleteCall struct { 1619 s *Service 1620 name string 1621 urlParams_ gensupport.URLParams 1622 ctx_ context.Context 1623 header_ http.Header 1624} 1625 1626// Delete: Deletes the workload. Make sure that workload's direct 1627// children are already in a deleted state, otherwise the request will 1628// fail with a FAILED_PRECONDITION error. 1629// 1630// - name: The `name` field is used to identify the workload. Format: 1631// organizations/{org_id}/locations/{location_id}/workloads/{workload_i 1632// d}. 1633func (r *OrganizationsLocationsWorkloadsService) Delete(name string) *OrganizationsLocationsWorkloadsDeleteCall { 1634 c := &OrganizationsLocationsWorkloadsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1635 c.name = name 1636 return c 1637} 1638 1639// Etag sets the optional parameter "etag": The etag of the workload. If 1640// this is provided, it must match the server's etag. 1641func (c *OrganizationsLocationsWorkloadsDeleteCall) Etag(etag string) *OrganizationsLocationsWorkloadsDeleteCall { 1642 c.urlParams_.Set("etag", etag) 1643 return c 1644} 1645 1646// Fields allows partial responses to be retrieved. See 1647// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1648// for more information. 1649func (c *OrganizationsLocationsWorkloadsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsWorkloadsDeleteCall { 1650 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1651 return c 1652} 1653 1654// Context sets the context to be used in this call's Do method. Any 1655// pending HTTP request will be aborted if the provided context is 1656// canceled. 1657func (c *OrganizationsLocationsWorkloadsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsWorkloadsDeleteCall { 1658 c.ctx_ = ctx 1659 return c 1660} 1661 1662// Header returns an http.Header that can be modified by the caller to 1663// add HTTP headers to the request. 1664func (c *OrganizationsLocationsWorkloadsDeleteCall) Header() http.Header { 1665 if c.header_ == nil { 1666 c.header_ = make(http.Header) 1667 } 1668 return c.header_ 1669} 1670 1671func (c *OrganizationsLocationsWorkloadsDeleteCall) doRequest(alt string) (*http.Response, error) { 1672 reqHeaders := make(http.Header) 1673 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 1674 for k, v := range c.header_ { 1675 reqHeaders[k] = v 1676 } 1677 reqHeaders.Set("User-Agent", c.s.userAgent()) 1678 var body io.Reader = nil 1679 c.urlParams_.Set("alt", alt) 1680 c.urlParams_.Set("prettyPrint", "false") 1681 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 1682 urls += "?" + c.urlParams_.Encode() 1683 req, err := http.NewRequest("DELETE", urls, body) 1684 if err != nil { 1685 return nil, err 1686 } 1687 req.Header = reqHeaders 1688 googleapi.Expand(req.URL, map[string]string{ 1689 "name": c.name, 1690 }) 1691 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1692} 1693 1694// Do executes the "assuredworkloads.organizations.locations.workloads.delete" call. 1695// Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any 1696// non-2xx status code is an error. Response headers are in either 1697// *GoogleProtobufEmpty.ServerResponse.Header or (if a response was 1698// returned at all) in error.(*googleapi.Error).Header. Use 1699// googleapi.IsNotModified to check whether the returned error was 1700// because http.StatusNotModified was returned. 1701func (c *OrganizationsLocationsWorkloadsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) { 1702 gensupport.SetOptions(c.urlParams_, opts...) 1703 res, err := c.doRequest("json") 1704 if res != nil && res.StatusCode == http.StatusNotModified { 1705 if res.Body != nil { 1706 res.Body.Close() 1707 } 1708 return nil, &googleapi.Error{ 1709 Code: res.StatusCode, 1710 Header: res.Header, 1711 } 1712 } 1713 if err != nil { 1714 return nil, err 1715 } 1716 defer googleapi.CloseBody(res) 1717 if err := googleapi.CheckResponse(res); err != nil { 1718 return nil, err 1719 } 1720 ret := &GoogleProtobufEmpty{ 1721 ServerResponse: googleapi.ServerResponse{ 1722 Header: res.Header, 1723 HTTPStatusCode: res.StatusCode, 1724 }, 1725 } 1726 target := &ret 1727 if err := gensupport.DecodeResponse(target, res); err != nil { 1728 return nil, err 1729 } 1730 return ret, nil 1731 // { 1732 // "description": "Deletes the workload. Make sure that workload's direct children are already in a deleted state, otherwise the request will fail with a FAILED_PRECONDITION error.", 1733 // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/workloads/{workloadsId}", 1734 // "httpMethod": "DELETE", 1735 // "id": "assuredworkloads.organizations.locations.workloads.delete", 1736 // "parameterOrder": [ 1737 // "name" 1738 // ], 1739 // "parameters": { 1740 // "etag": { 1741 // "description": "Optional. The etag of the workload. If this is provided, it must match the server's etag.", 1742 // "location": "query", 1743 // "type": "string" 1744 // }, 1745 // "name": { 1746 // "description": "Required. The `name` field is used to identify the workload. Format: organizations/{org_id}/locations/{location_id}/workloads/{workload_id}", 1747 // "location": "path", 1748 // "pattern": "^organizations/[^/]+/locations/[^/]+/workloads/[^/]+$", 1749 // "required": true, 1750 // "type": "string" 1751 // } 1752 // }, 1753 // "path": "v1/{+name}", 1754 // "response": { 1755 // "$ref": "GoogleProtobufEmpty" 1756 // }, 1757 // "scopes": [ 1758 // "https://www.googleapis.com/auth/cloud-platform" 1759 // ] 1760 // } 1761 1762} 1763 1764// method id "assuredworkloads.organizations.locations.workloads.get": 1765 1766type OrganizationsLocationsWorkloadsGetCall struct { 1767 s *Service 1768 name string 1769 urlParams_ gensupport.URLParams 1770 ifNoneMatch_ string 1771 ctx_ context.Context 1772 header_ http.Header 1773} 1774 1775// Get: Gets Assured Workload associated with a CRM Node 1776// 1777// - name: The resource name of the Workload to fetch. This is the 1778// workloads's relative path in the API, formatted as 1779// "organizations/{organization_id}/locations/{location_id}/workloads/{ 1780// workload_id}". For example, 1781// "organizations/123/locations/us-east1/workloads/assured-workload-1". 1782func (r *OrganizationsLocationsWorkloadsService) Get(name string) *OrganizationsLocationsWorkloadsGetCall { 1783 c := &OrganizationsLocationsWorkloadsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1784 c.name = name 1785 return c 1786} 1787 1788// Fields allows partial responses to be retrieved. See 1789// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1790// for more information. 1791func (c *OrganizationsLocationsWorkloadsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsWorkloadsGetCall { 1792 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1793 return c 1794} 1795 1796// IfNoneMatch sets the optional parameter which makes the operation 1797// fail if the object's ETag matches the given value. This is useful for 1798// getting updates only after the object has changed since the last 1799// request. Use googleapi.IsNotModified to check whether the response 1800// error from Do is the result of In-None-Match. 1801func (c *OrganizationsLocationsWorkloadsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsWorkloadsGetCall { 1802 c.ifNoneMatch_ = entityTag 1803 return c 1804} 1805 1806// Context sets the context to be used in this call's Do method. Any 1807// pending HTTP request will be aborted if the provided context is 1808// canceled. 1809func (c *OrganizationsLocationsWorkloadsGetCall) Context(ctx context.Context) *OrganizationsLocationsWorkloadsGetCall { 1810 c.ctx_ = ctx 1811 return c 1812} 1813 1814// Header returns an http.Header that can be modified by the caller to 1815// add HTTP headers to the request. 1816func (c *OrganizationsLocationsWorkloadsGetCall) Header() http.Header { 1817 if c.header_ == nil { 1818 c.header_ = make(http.Header) 1819 } 1820 return c.header_ 1821} 1822 1823func (c *OrganizationsLocationsWorkloadsGetCall) doRequest(alt string) (*http.Response, error) { 1824 reqHeaders := make(http.Header) 1825 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 1826 for k, v := range c.header_ { 1827 reqHeaders[k] = v 1828 } 1829 reqHeaders.Set("User-Agent", c.s.userAgent()) 1830 if c.ifNoneMatch_ != "" { 1831 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1832 } 1833 var body io.Reader = nil 1834 c.urlParams_.Set("alt", alt) 1835 c.urlParams_.Set("prettyPrint", "false") 1836 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 1837 urls += "?" + c.urlParams_.Encode() 1838 req, err := http.NewRequest("GET", urls, body) 1839 if err != nil { 1840 return nil, err 1841 } 1842 req.Header = reqHeaders 1843 googleapi.Expand(req.URL, map[string]string{ 1844 "name": c.name, 1845 }) 1846 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1847} 1848 1849// Do executes the "assuredworkloads.organizations.locations.workloads.get" call. 1850// Exactly one of *GoogleCloudAssuredworkloadsV1Workload or error will 1851// be non-nil. Any non-2xx status code is an error. Response headers are 1852// in either 1853// *GoogleCloudAssuredworkloadsV1Workload.ServerResponse.Header or (if a 1854// response was returned at all) in error.(*googleapi.Error).Header. Use 1855// googleapi.IsNotModified to check whether the returned error was 1856// because http.StatusNotModified was returned. 1857func (c *OrganizationsLocationsWorkloadsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAssuredworkloadsV1Workload, error) { 1858 gensupport.SetOptions(c.urlParams_, opts...) 1859 res, err := c.doRequest("json") 1860 if res != nil && res.StatusCode == http.StatusNotModified { 1861 if res.Body != nil { 1862 res.Body.Close() 1863 } 1864 return nil, &googleapi.Error{ 1865 Code: res.StatusCode, 1866 Header: res.Header, 1867 } 1868 } 1869 if err != nil { 1870 return nil, err 1871 } 1872 defer googleapi.CloseBody(res) 1873 if err := googleapi.CheckResponse(res); err != nil { 1874 return nil, err 1875 } 1876 ret := &GoogleCloudAssuredworkloadsV1Workload{ 1877 ServerResponse: googleapi.ServerResponse{ 1878 Header: res.Header, 1879 HTTPStatusCode: res.StatusCode, 1880 }, 1881 } 1882 target := &ret 1883 if err := gensupport.DecodeResponse(target, res); err != nil { 1884 return nil, err 1885 } 1886 return ret, nil 1887 // { 1888 // "description": "Gets Assured Workload associated with a CRM Node", 1889 // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/workloads/{workloadsId}", 1890 // "httpMethod": "GET", 1891 // "id": "assuredworkloads.organizations.locations.workloads.get", 1892 // "parameterOrder": [ 1893 // "name" 1894 // ], 1895 // "parameters": { 1896 // "name": { 1897 // "description": "Required. The resource name of the Workload to fetch. This is the workloads's relative path in the API, formatted as \"organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}\". For example, \"organizations/123/locations/us-east1/workloads/assured-workload-1\".", 1898 // "location": "path", 1899 // "pattern": "^organizations/[^/]+/locations/[^/]+/workloads/[^/]+$", 1900 // "required": true, 1901 // "type": "string" 1902 // } 1903 // }, 1904 // "path": "v1/{+name}", 1905 // "response": { 1906 // "$ref": "GoogleCloudAssuredworkloadsV1Workload" 1907 // }, 1908 // "scopes": [ 1909 // "https://www.googleapis.com/auth/cloud-platform" 1910 // ] 1911 // } 1912 1913} 1914 1915// method id "assuredworkloads.organizations.locations.workloads.list": 1916 1917type OrganizationsLocationsWorkloadsListCall struct { 1918 s *Service 1919 parent string 1920 urlParams_ gensupport.URLParams 1921 ifNoneMatch_ string 1922 ctx_ context.Context 1923 header_ http.Header 1924} 1925 1926// List: Lists Assured Workloads under a CRM Node. 1927// 1928// - parent: Parent Resource to list workloads from. Must be of the form 1929// `organizations/{org_id}/locations/{location}`. 1930func (r *OrganizationsLocationsWorkloadsService) List(parent string) *OrganizationsLocationsWorkloadsListCall { 1931 c := &OrganizationsLocationsWorkloadsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1932 c.parent = parent 1933 return c 1934} 1935 1936// Filter sets the optional parameter "filter": A custom filter for 1937// filtering by properties of a workload. At this time, only filtering 1938// by labels is supported. 1939func (c *OrganizationsLocationsWorkloadsListCall) Filter(filter string) *OrganizationsLocationsWorkloadsListCall { 1940 c.urlParams_.Set("filter", filter) 1941 return c 1942} 1943 1944// PageSize sets the optional parameter "pageSize": Page size. 1945func (c *OrganizationsLocationsWorkloadsListCall) PageSize(pageSize int64) *OrganizationsLocationsWorkloadsListCall { 1946 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 1947 return c 1948} 1949 1950// PageToken sets the optional parameter "pageToken": Page token 1951// returned from previous request. Page token contains context from 1952// previous request. Page token needs to be passed in the second and 1953// following requests. 1954func (c *OrganizationsLocationsWorkloadsListCall) PageToken(pageToken string) *OrganizationsLocationsWorkloadsListCall { 1955 c.urlParams_.Set("pageToken", pageToken) 1956 return c 1957} 1958 1959// Fields allows partial responses to be retrieved. See 1960// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1961// for more information. 1962func (c *OrganizationsLocationsWorkloadsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsWorkloadsListCall { 1963 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1964 return c 1965} 1966 1967// IfNoneMatch sets the optional parameter which makes the operation 1968// fail if the object's ETag matches the given value. This is useful for 1969// getting updates only after the object has changed since the last 1970// request. Use googleapi.IsNotModified to check whether the response 1971// error from Do is the result of In-None-Match. 1972func (c *OrganizationsLocationsWorkloadsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsWorkloadsListCall { 1973 c.ifNoneMatch_ = entityTag 1974 return c 1975} 1976 1977// Context sets the context to be used in this call's Do method. Any 1978// pending HTTP request will be aborted if the provided context is 1979// canceled. 1980func (c *OrganizationsLocationsWorkloadsListCall) Context(ctx context.Context) *OrganizationsLocationsWorkloadsListCall { 1981 c.ctx_ = ctx 1982 return c 1983} 1984 1985// Header returns an http.Header that can be modified by the caller to 1986// add HTTP headers to the request. 1987func (c *OrganizationsLocationsWorkloadsListCall) Header() http.Header { 1988 if c.header_ == nil { 1989 c.header_ = make(http.Header) 1990 } 1991 return c.header_ 1992} 1993 1994func (c *OrganizationsLocationsWorkloadsListCall) doRequest(alt string) (*http.Response, error) { 1995 reqHeaders := make(http.Header) 1996 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 1997 for k, v := range c.header_ { 1998 reqHeaders[k] = v 1999 } 2000 reqHeaders.Set("User-Agent", c.s.userAgent()) 2001 if c.ifNoneMatch_ != "" { 2002 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2003 } 2004 var body io.Reader = nil 2005 c.urlParams_.Set("alt", alt) 2006 c.urlParams_.Set("prettyPrint", "false") 2007 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workloads") 2008 urls += "?" + c.urlParams_.Encode() 2009 req, err := http.NewRequest("GET", urls, body) 2010 if err != nil { 2011 return nil, err 2012 } 2013 req.Header = reqHeaders 2014 googleapi.Expand(req.URL, map[string]string{ 2015 "parent": c.parent, 2016 }) 2017 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2018} 2019 2020// Do executes the "assuredworkloads.organizations.locations.workloads.list" call. 2021// Exactly one of *GoogleCloudAssuredworkloadsV1ListWorkloadsResponse or 2022// error will be non-nil. Any non-2xx status code is an error. Response 2023// headers are in either 2024// *GoogleCloudAssuredworkloadsV1ListWorkloadsResponse.ServerResponse.Hea 2025// der or (if a response was returned at all) in 2026// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2027// whether the returned error was because http.StatusNotModified was 2028// returned. 2029func (c *OrganizationsLocationsWorkloadsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAssuredworkloadsV1ListWorkloadsResponse, error) { 2030 gensupport.SetOptions(c.urlParams_, opts...) 2031 res, err := c.doRequest("json") 2032 if res != nil && res.StatusCode == http.StatusNotModified { 2033 if res.Body != nil { 2034 res.Body.Close() 2035 } 2036 return nil, &googleapi.Error{ 2037 Code: res.StatusCode, 2038 Header: res.Header, 2039 } 2040 } 2041 if err != nil { 2042 return nil, err 2043 } 2044 defer googleapi.CloseBody(res) 2045 if err := googleapi.CheckResponse(res); err != nil { 2046 return nil, err 2047 } 2048 ret := &GoogleCloudAssuredworkloadsV1ListWorkloadsResponse{ 2049 ServerResponse: googleapi.ServerResponse{ 2050 Header: res.Header, 2051 HTTPStatusCode: res.StatusCode, 2052 }, 2053 } 2054 target := &ret 2055 if err := gensupport.DecodeResponse(target, res); err != nil { 2056 return nil, err 2057 } 2058 return ret, nil 2059 // { 2060 // "description": "Lists Assured Workloads under a CRM Node.", 2061 // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/workloads", 2062 // "httpMethod": "GET", 2063 // "id": "assuredworkloads.organizations.locations.workloads.list", 2064 // "parameterOrder": [ 2065 // "parent" 2066 // ], 2067 // "parameters": { 2068 // "filter": { 2069 // "description": "A custom filter for filtering by properties of a workload. At this time, only filtering by labels is supported.", 2070 // "location": "query", 2071 // "type": "string" 2072 // }, 2073 // "pageSize": { 2074 // "description": "Page size.", 2075 // "format": "int32", 2076 // "location": "query", 2077 // "type": "integer" 2078 // }, 2079 // "pageToken": { 2080 // "description": "Page token returned from previous request. Page token contains context from previous request. Page token needs to be passed in the second and following requests.", 2081 // "location": "query", 2082 // "type": "string" 2083 // }, 2084 // "parent": { 2085 // "description": "Required. Parent Resource to list workloads from. Must be of the form `organizations/{org_id}/locations/{location}`.", 2086 // "location": "path", 2087 // "pattern": "^organizations/[^/]+/locations/[^/]+$", 2088 // "required": true, 2089 // "type": "string" 2090 // } 2091 // }, 2092 // "path": "v1/{+parent}/workloads", 2093 // "response": { 2094 // "$ref": "GoogleCloudAssuredworkloadsV1ListWorkloadsResponse" 2095 // }, 2096 // "scopes": [ 2097 // "https://www.googleapis.com/auth/cloud-platform" 2098 // ] 2099 // } 2100 2101} 2102 2103// Pages invokes f for each page of results. 2104// A non-nil error returned from f will halt the iteration. 2105// The provided context supersedes any context provided to the Context method. 2106func (c *OrganizationsLocationsWorkloadsListCall) Pages(ctx context.Context, f func(*GoogleCloudAssuredworkloadsV1ListWorkloadsResponse) error) error { 2107 c.ctx_ = ctx 2108 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2109 for { 2110 x, err := c.Do() 2111 if err != nil { 2112 return err 2113 } 2114 if err := f(x); err != nil { 2115 return err 2116 } 2117 if x.NextPageToken == "" { 2118 return nil 2119 } 2120 c.PageToken(x.NextPageToken) 2121 } 2122} 2123 2124// method id "assuredworkloads.organizations.locations.workloads.patch": 2125 2126type OrganizationsLocationsWorkloadsPatchCall struct { 2127 s *Service 2128 name string 2129 googlecloudassuredworkloadsv1workload *GoogleCloudAssuredworkloadsV1Workload 2130 urlParams_ gensupport.URLParams 2131 ctx_ context.Context 2132 header_ http.Header 2133} 2134 2135// Patch: Updates an existing workload. Currently allows updating of 2136// workload display_name and labels. For force updates don't set etag 2137// field in the Workload. Only one update operation per workload can be 2138// in progress. 2139// 2140// - name: Optional. The resource name of the workload. Format: 2141// organizations/{organization}/locations/{location}/workloads/{workloa 2142// d} Read-only. 2143func (r *OrganizationsLocationsWorkloadsService) Patch(name string, googlecloudassuredworkloadsv1workload *GoogleCloudAssuredworkloadsV1Workload) *OrganizationsLocationsWorkloadsPatchCall { 2144 c := &OrganizationsLocationsWorkloadsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2145 c.name = name 2146 c.googlecloudassuredworkloadsv1workload = googlecloudassuredworkloadsv1workload 2147 return c 2148} 2149 2150// UpdateMask sets the optional parameter "updateMask": Required. The 2151// list of fields to be updated. 2152func (c *OrganizationsLocationsWorkloadsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsWorkloadsPatchCall { 2153 c.urlParams_.Set("updateMask", updateMask) 2154 return c 2155} 2156 2157// Fields allows partial responses to be retrieved. See 2158// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2159// for more information. 2160func (c *OrganizationsLocationsWorkloadsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsWorkloadsPatchCall { 2161 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2162 return c 2163} 2164 2165// Context sets the context to be used in this call's Do method. Any 2166// pending HTTP request will be aborted if the provided context is 2167// canceled. 2168func (c *OrganizationsLocationsWorkloadsPatchCall) Context(ctx context.Context) *OrganizationsLocationsWorkloadsPatchCall { 2169 c.ctx_ = ctx 2170 return c 2171} 2172 2173// Header returns an http.Header that can be modified by the caller to 2174// add HTTP headers to the request. 2175func (c *OrganizationsLocationsWorkloadsPatchCall) Header() http.Header { 2176 if c.header_ == nil { 2177 c.header_ = make(http.Header) 2178 } 2179 return c.header_ 2180} 2181 2182func (c *OrganizationsLocationsWorkloadsPatchCall) doRequest(alt string) (*http.Response, error) { 2183 reqHeaders := make(http.Header) 2184 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 2185 for k, v := range c.header_ { 2186 reqHeaders[k] = v 2187 } 2188 reqHeaders.Set("User-Agent", c.s.userAgent()) 2189 var body io.Reader = nil 2190 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudassuredworkloadsv1workload) 2191 if err != nil { 2192 return nil, err 2193 } 2194 reqHeaders.Set("Content-Type", "application/json") 2195 c.urlParams_.Set("alt", alt) 2196 c.urlParams_.Set("prettyPrint", "false") 2197 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2198 urls += "?" + c.urlParams_.Encode() 2199 req, err := http.NewRequest("PATCH", urls, body) 2200 if err != nil { 2201 return nil, err 2202 } 2203 req.Header = reqHeaders 2204 googleapi.Expand(req.URL, map[string]string{ 2205 "name": c.name, 2206 }) 2207 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2208} 2209 2210// Do executes the "assuredworkloads.organizations.locations.workloads.patch" call. 2211// Exactly one of *GoogleCloudAssuredworkloadsV1Workload or error will 2212// be non-nil. Any non-2xx status code is an error. Response headers are 2213// in either 2214// *GoogleCloudAssuredworkloadsV1Workload.ServerResponse.Header or (if a 2215// response was returned at all) in error.(*googleapi.Error).Header. Use 2216// googleapi.IsNotModified to check whether the returned error was 2217// because http.StatusNotModified was returned. 2218func (c *OrganizationsLocationsWorkloadsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAssuredworkloadsV1Workload, error) { 2219 gensupport.SetOptions(c.urlParams_, opts...) 2220 res, err := c.doRequest("json") 2221 if res != nil && res.StatusCode == http.StatusNotModified { 2222 if res.Body != nil { 2223 res.Body.Close() 2224 } 2225 return nil, &googleapi.Error{ 2226 Code: res.StatusCode, 2227 Header: res.Header, 2228 } 2229 } 2230 if err != nil { 2231 return nil, err 2232 } 2233 defer googleapi.CloseBody(res) 2234 if err := googleapi.CheckResponse(res); err != nil { 2235 return nil, err 2236 } 2237 ret := &GoogleCloudAssuredworkloadsV1Workload{ 2238 ServerResponse: googleapi.ServerResponse{ 2239 Header: res.Header, 2240 HTTPStatusCode: res.StatusCode, 2241 }, 2242 } 2243 target := &ret 2244 if err := gensupport.DecodeResponse(target, res); err != nil { 2245 return nil, err 2246 } 2247 return ret, nil 2248 // { 2249 // "description": "Updates an existing workload. Currently allows updating of workload display_name and labels. For force updates don't set etag field in the Workload. Only one update operation per workload can be in progress.", 2250 // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/workloads/{workloadsId}", 2251 // "httpMethod": "PATCH", 2252 // "id": "assuredworkloads.organizations.locations.workloads.patch", 2253 // "parameterOrder": [ 2254 // "name" 2255 // ], 2256 // "parameters": { 2257 // "name": { 2258 // "description": "Optional. The resource name of the workload. Format: organizations/{organization}/locations/{location}/workloads/{workload} Read-only.", 2259 // "location": "path", 2260 // "pattern": "^organizations/[^/]+/locations/[^/]+/workloads/[^/]+$", 2261 // "required": true, 2262 // "type": "string" 2263 // }, 2264 // "updateMask": { 2265 // "description": "Required. The list of fields to be updated.", 2266 // "format": "google-fieldmask", 2267 // "location": "query", 2268 // "type": "string" 2269 // } 2270 // }, 2271 // "path": "v1/{+name}", 2272 // "request": { 2273 // "$ref": "GoogleCloudAssuredworkloadsV1Workload" 2274 // }, 2275 // "response": { 2276 // "$ref": "GoogleCloudAssuredworkloadsV1Workload" 2277 // }, 2278 // "scopes": [ 2279 // "https://www.googleapis.com/auth/cloud-platform" 2280 // ] 2281 // } 2282 2283} 2284