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