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/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 // 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// GoogleCloudAssuredworkloadsV1ListWorkloadsResponse: Response of 232// ListWorkloads endpoint. 233type GoogleCloudAssuredworkloadsV1ListWorkloadsResponse struct { 234 // NextPageToken: The next page token. Return empty if reached the last 235 // page. 236 NextPageToken string `json:"nextPageToken,omitempty"` 237 238 // Workloads: List of Workloads under a given parent. 239 Workloads []*GoogleCloudAssuredworkloadsV1Workload `json:"workloads,omitempty"` 240 241 // ServerResponse contains the HTTP response code and headers from the 242 // server. 243 googleapi.ServerResponse `json:"-"` 244 245 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 246 // unconditionally include in API requests. By default, fields with 247 // empty values are omitted from API requests. However, any non-pointer, 248 // non-interface field appearing in ForceSendFields will be sent to the 249 // server regardless of whether the field is empty or not. This may be 250 // used to include empty fields in Patch requests. 251 ForceSendFields []string `json:"-"` 252 253 // NullFields is a list of field names (e.g. "NextPageToken") to include 254 // in API requests with the JSON null value. By default, fields with 255 // empty values are omitted from API requests. However, any field with 256 // an empty value appearing in NullFields will be sent to the server as 257 // null. It is an error if a field in this list has a non-empty value. 258 // This may be used to include null fields in Patch requests. 259 NullFields []string `json:"-"` 260} 261 262func (s *GoogleCloudAssuredworkloadsV1ListWorkloadsResponse) MarshalJSON() ([]byte, error) { 263 type NoMethod GoogleCloudAssuredworkloadsV1ListWorkloadsResponse 264 raw := NoMethod(*s) 265 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 266} 267 268// GoogleCloudAssuredworkloadsV1Workload: An Workload object for 269// managing highly regulated workloads of cloud customers. 270type GoogleCloudAssuredworkloadsV1Workload struct { 271 // BillingAccount: Required. Input only. The billing account used for 272 // the resources which are direct children of workload. This billing 273 // account is initially associated with the resources created as part of 274 // Workload creation. After the initial creation of these resources, the 275 // customer can change the assigned billing account. The resource name 276 // has the form `billingAccounts/{billing_account_id}`. For example, 277 // `billingAccounts/012345-567890-ABCDEF`. 278 BillingAccount string `json:"billingAccount,omitempty"` 279 280 // ComplianceRegime: Required. Immutable. Compliance Regime associated 281 // with this workload. 282 // 283 // Possible values: 284 // "COMPLIANCE_REGIME_UNSPECIFIED" - Unknown compliance regime. 285 // "IL4" - Information protection as per DoD IL4 requirements. 286 // "CJIS" - Criminal Justice Information Services (CJIS) Security 287 // policies. 288 // "FEDRAMP_HIGH" - FedRAMP High data protection controls 289 // "FEDRAMP_MODERATE" - FedRAMP Moderate data protection controls 290 ComplianceRegime string `json:"complianceRegime,omitempty"` 291 292 // CreateTime: Output only. Immutable. The Workload creation timestamp. 293 CreateTime string `json:"createTime,omitempty"` 294 295 // DisplayName: Required. The user-assigned display name of the 296 // Workload. When present it must be between 4 to 30 characters. Allowed 297 // characters are: lowercase and uppercase letters, numbers, hyphen, and 298 // spaces. Example: My Workload 299 DisplayName string `json:"displayName,omitempty"` 300 301 // Etag: Optional. ETag of the workload, it is calculated on the basis 302 // of the Workload contents. It will be used in Update & Delete 303 // operations. 304 Etag string `json:"etag,omitempty"` 305 306 // KmsSettings: Input only. Settings used to create a CMEK crypto key. 307 // When set a project with a KMS CMEK key is provisioned. This field is 308 // mandatory for a subset of Compliance Regimes. 309 KmsSettings *GoogleCloudAssuredworkloadsV1WorkloadKMSSettings `json:"kmsSettings,omitempty"` 310 311 // Labels: Optional. Labels applied to the workload. 312 Labels map[string]string `json:"labels,omitempty"` 313 314 // Name: Optional. The resource name of the workload. Format: 315 // organizations/{organization}/locations/{location}/workloads/{workload} 316 // Read-only. 317 Name string `json:"name,omitempty"` 318 319 // ProvisionedResourcesParent: Input only. The parent resource for the 320 // resources managed by this Assured Workload. May be either an 321 // organization or a folder. Must be the same or a child of the Workload 322 // parent. If not specified all resources are created under the Workload 323 // parent. Formats: folders/{folder_id} organizations/{organization_id} 324 ProvisionedResourcesParent string `json:"provisionedResourcesParent,omitempty"` 325 326 // Resources: Output only. The resources associated with this workload. 327 // These resources will be created when creating the workload. If any of 328 // the projects already exist, the workload creation will fail. Always 329 // read only. 330 Resources []*GoogleCloudAssuredworkloadsV1WorkloadResourceInfo `json:"resources,omitempty"` 331 332 // ServerResponse contains the HTTP response code and headers from the 333 // server. 334 googleapi.ServerResponse `json:"-"` 335 336 // ForceSendFields is a list of field names (e.g. "BillingAccount") to 337 // unconditionally include in API requests. By default, fields with 338 // empty values are omitted from API requests. However, any non-pointer, 339 // non-interface field appearing in ForceSendFields will be sent to the 340 // server regardless of whether the field is empty or not. This may be 341 // used to include empty fields in Patch requests. 342 ForceSendFields []string `json:"-"` 343 344 // NullFields is a list of field names (e.g. "BillingAccount") to 345 // include in API requests with the JSON null value. By default, fields 346 // with empty values are omitted from API requests. However, any field 347 // with an empty value appearing in NullFields will be sent to the 348 // server as null. It is an error if a field in this list has a 349 // non-empty value. This may be used to include null fields in Patch 350 // requests. 351 NullFields []string `json:"-"` 352} 353 354func (s *GoogleCloudAssuredworkloadsV1Workload) MarshalJSON() ([]byte, error) { 355 type NoMethod GoogleCloudAssuredworkloadsV1Workload 356 raw := NoMethod(*s) 357 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 358} 359 360// GoogleCloudAssuredworkloadsV1WorkloadKMSSettings: Settings specific 361// to the Key Management Service. 362type GoogleCloudAssuredworkloadsV1WorkloadKMSSettings struct { 363 // NextRotationTime: Required. Input only. Immutable. The time at which 364 // the Key Management Service will automatically create a new version of 365 // the crypto key and mark it as the primary. 366 NextRotationTime string `json:"nextRotationTime,omitempty"` 367 368 // RotationPeriod: Required. Input only. Immutable. [next_rotation_time] 369 // will be advanced by this period when the Key Management Service 370 // automatically rotates a key. Must be at least 24 hours and at most 371 // 876,000 hours. 372 RotationPeriod string `json:"rotationPeriod,omitempty"` 373 374 // ForceSendFields is a list of field names (e.g. "NextRotationTime") to 375 // unconditionally include in API requests. By default, fields with 376 // empty values are omitted from API requests. However, any non-pointer, 377 // non-interface field appearing in ForceSendFields will be sent to the 378 // server regardless of whether the field is empty or not. This may be 379 // used to include empty fields in Patch requests. 380 ForceSendFields []string `json:"-"` 381 382 // NullFields is a list of field names (e.g. "NextRotationTime") to 383 // include in API requests with the JSON null value. By default, fields 384 // with empty values are omitted from API requests. However, any field 385 // with an empty value appearing in NullFields will be sent to the 386 // server as null. It is an error if a field in this list has a 387 // non-empty value. This may be used to include null fields in Patch 388 // requests. 389 NullFields []string `json:"-"` 390} 391 392func (s *GoogleCloudAssuredworkloadsV1WorkloadKMSSettings) MarshalJSON() ([]byte, error) { 393 type NoMethod GoogleCloudAssuredworkloadsV1WorkloadKMSSettings 394 raw := NoMethod(*s) 395 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 396} 397 398// GoogleCloudAssuredworkloadsV1WorkloadResourceInfo: Represent the 399// resources that are children of this Workload. 400type GoogleCloudAssuredworkloadsV1WorkloadResourceInfo struct { 401 // ResourceId: Resource identifier. For a project this represents 402 // project_number. 403 ResourceId int64 `json:"resourceId,omitempty,string"` 404 405 // ResourceType: Indicates the type of resource. 406 // 407 // Possible values: 408 // "RESOURCE_TYPE_UNSPECIFIED" - Unknown resource type. 409 // "CONSUMER_PROJECT" - Consumer project. 410 // "ENCRYPTION_KEYS_PROJECT" - Consumer project containing encryption 411 // keys. 412 ResourceType string `json:"resourceType,omitempty"` 413 414 // ForceSendFields is a list of field names (e.g. "ResourceId") to 415 // unconditionally include in API requests. By default, fields with 416 // empty values are omitted from API requests. However, any non-pointer, 417 // non-interface field appearing in ForceSendFields will be sent to the 418 // server regardless of whether the field is empty or not. This may be 419 // used to include empty fields in Patch requests. 420 ForceSendFields []string `json:"-"` 421 422 // NullFields is a list of field names (e.g. "ResourceId") to include in 423 // API requests with the JSON null value. By default, fields with empty 424 // values are omitted from API requests. However, any field with an 425 // empty value appearing in NullFields will be sent to the server as 426 // null. It is an error if a field in this list has a non-empty value. 427 // This may be used to include null fields in Patch requests. 428 NullFields []string `json:"-"` 429} 430 431func (s *GoogleCloudAssuredworkloadsV1WorkloadResourceInfo) MarshalJSON() ([]byte, error) { 432 type NoMethod GoogleCloudAssuredworkloadsV1WorkloadResourceInfo 433 raw := NoMethod(*s) 434 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 435} 436 437// GoogleCloudAssuredworkloadsV1beta1CreateWorkloadOperationMetadata: 438// Operation metadata to give request details of CreateWorkload. 439type GoogleCloudAssuredworkloadsV1beta1CreateWorkloadOperationMetadata struct { 440 // ComplianceRegime: Optional. Compliance controls that should be 441 // applied to the resources managed by the workload. 442 // 443 // Possible values: 444 // "COMPLIANCE_REGIME_UNSPECIFIED" - Unknown compliance regime. 445 // "IL4" - Information protection as per DoD IL4 requirements. 446 // "CJIS" - Criminal Justice Information Services (CJIS) Security 447 // policies. 448 // "FEDRAMP_HIGH" - FedRAMP High data protection controls 449 // "FEDRAMP_MODERATE" - FedRAMP Moderate data protection controls 450 ComplianceRegime string `json:"complianceRegime,omitempty"` 451 452 // CreateTime: Optional. Time when the operation was created. 453 CreateTime string `json:"createTime,omitempty"` 454 455 // DisplayName: Optional. The display name of the workload. 456 DisplayName string `json:"displayName,omitempty"` 457 458 // Parent: Optional. The parent of the workload. 459 Parent string `json:"parent,omitempty"` 460 461 // ForceSendFields is a list of field names (e.g. "ComplianceRegime") to 462 // unconditionally include in API requests. By default, fields with 463 // empty values are omitted from API requests. However, any non-pointer, 464 // non-interface field appearing in ForceSendFields will be sent to the 465 // server regardless of whether the field is empty or not. This may be 466 // used to include empty fields in Patch requests. 467 ForceSendFields []string `json:"-"` 468 469 // NullFields is a list of field names (e.g. "ComplianceRegime") to 470 // include in API requests with the JSON null value. By default, fields 471 // with empty values are omitted from API requests. However, any field 472 // with an empty value appearing in NullFields will be sent to the 473 // server as null. It is an error if a field in this list has a 474 // non-empty value. This may be used to include null fields in Patch 475 // requests. 476 NullFields []string `json:"-"` 477} 478 479func (s *GoogleCloudAssuredworkloadsV1beta1CreateWorkloadOperationMetadata) MarshalJSON() ([]byte, error) { 480 type NoMethod GoogleCloudAssuredworkloadsV1beta1CreateWorkloadOperationMetadata 481 raw := NoMethod(*s) 482 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 483} 484 485// GoogleCloudAssuredworkloadsV1beta1Workload: An Workload object for 486// managing highly regulated workloads of cloud customers. 487type GoogleCloudAssuredworkloadsV1beta1Workload struct { 488 // BillingAccount: Required. Input only. The billing account used for 489 // the resources which are direct children of workload. This billing 490 // account is initially associated with the resources created as part of 491 // Workload creation. After the initial creation of these resources, the 492 // customer can change the assigned billing account. The resource name 493 // has the form `billingAccounts/{billing_account_id}`. For example, 494 // `billingAccounts/012345-567890-ABCDEF`. 495 BillingAccount string `json:"billingAccount,omitempty"` 496 497 // CjisSettings: Required. Input only. Immutable. Settings specific to 498 // resources needed for CJIS. 499 CjisSettings *GoogleCloudAssuredworkloadsV1beta1WorkloadCJISSettings `json:"cjisSettings,omitempty"` 500 501 // ComplianceRegime: Required. Immutable. Compliance Regime associated 502 // with this workload. 503 // 504 // Possible values: 505 // "COMPLIANCE_REGIME_UNSPECIFIED" - Unknown compliance regime. 506 // "IL4" - Information protection as per DoD IL4 requirements. 507 // "CJIS" - Criminal Justice Information Services (CJIS) Security 508 // policies. 509 // "FEDRAMP_HIGH" - FedRAMP High data protection controls 510 // "FEDRAMP_MODERATE" - FedRAMP Moderate data protection controls 511 ComplianceRegime string `json:"complianceRegime,omitempty"` 512 513 // CreateTime: Output only. Immutable. The Workload creation timestamp. 514 CreateTime string `json:"createTime,omitempty"` 515 516 // DisplayName: Required. The user-assigned display name of the 517 // Workload. When present it must be between 4 to 30 characters. Allowed 518 // characters are: lowercase and uppercase letters, numbers, hyphen, and 519 // spaces. Example: My Workload 520 DisplayName string `json:"displayName,omitempty"` 521 522 // Etag: Optional. ETag of the workload, it is calculated on the basis 523 // of the Workload contents. It will be used in Update & Delete 524 // operations. 525 Etag string `json:"etag,omitempty"` 526 527 // FedrampHighSettings: Required. Input only. Immutable. Settings 528 // specific to resources needed for FedRAMP High. 529 FedrampHighSettings *GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampHighSettings `json:"fedrampHighSettings,omitempty"` 530 531 // FedrampModerateSettings: Required. Input only. Immutable. Settings 532 // specific to resources needed for FedRAMP Moderate. 533 FedrampModerateSettings *GoogleCloudAssuredworkloadsV1beta1WorkloadFedrampModerateSettings `json:"fedrampModerateSettings,omitempty"` 534 535 // Il4Settings: Required. Input only. Immutable. Settings specific to 536 // resources needed for IL4. 537 Il4Settings *GoogleCloudAssuredworkloadsV1beta1WorkloadIL4Settings `json:"il4Settings,omitempty"` 538 539 // KmsSettings: Input only. Settings used to create a CMEK crypto key. 540 // When set a project with a KMS CMEK key is provisioned. This field is 541 // mandatory for a subset of Compliance Regimes. 542 KmsSettings *GoogleCloudAssuredworkloadsV1beta1WorkloadKMSSettings `json:"kmsSettings,omitempty"` 543 544 // Labels: Optional. Labels applied to the workload. 545 Labels map[string]string `json:"labels,omitempty"` 546 547 // Name: Optional. The resource name of the workload. Format: 548 // organizations/{organization}/locations/{location}/workloads/{workload} 549 // Read-only. 550 Name string `json:"name,omitempty"` 551 552 // ProvisionedResourcesParent: Input only. The parent resource for the 553 // resources managed by this Assured Workload. May be either an 554 // organization or a folder. Must be the same or a child of the Workload 555 // parent. If not specified all resources are created under the Workload 556 // parent. Formats: folders/{folder_id} organizations/{organization_id} 557 ProvisionedResourcesParent string `json:"provisionedResourcesParent,omitempty"` 558 559 // Resources: Output only. The resources associated with this workload. 560 // These resources will be created when creating the workload. If any of 561 // the projects already exist, the workload creation will fail. Always 562 // read only. 563 Resources []*GoogleCloudAssuredworkloadsV1beta1WorkloadResourceInfo `json:"resources,omitempty"` 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/20201124") 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, "v1/{+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": "v1/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": "v1/{+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/20201124") 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, "v1/{+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": "v1/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": "v1/{+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 googlecloudassuredworkloadsv1workload *GoogleCloudAssuredworkloadsV1Workload 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, googlecloudassuredworkloadsv1workload *GoogleCloudAssuredworkloadsV1Workload) *OrganizationsLocationsWorkloadsCreateCall { 1312 c := &OrganizationsLocationsWorkloadsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1313 c.parent = parent 1314 c.googlecloudassuredworkloadsv1workload = googlecloudassuredworkloadsv1workload 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/20201124") 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.googlecloudassuredworkloadsv1workload) 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, "v1/{+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": "v1/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": "v1/{+parent}/workloads", 1441 // "request": { 1442 // "$ref": "GoogleCloudAssuredworkloadsV1Workload" 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/20201124") 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, "v1/{+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": "v1/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": "v1/{+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/20201124") 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, "v1/{+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 *GoogleCloudAssuredworkloadsV1Workload or error will 1679// be non-nil. Any non-2xx status code is an error. Response headers are 1680// in either 1681// *GoogleCloudAssuredworkloadsV1Workload.ServerResponse.Header or (if a 1682// response was returned at all) in error.(*googleapi.Error).Header. Use 1683// googleapi.IsNotModified to check whether the returned error was 1684// because http.StatusNotModified was returned. 1685func (c *OrganizationsLocationsWorkloadsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAssuredworkloadsV1Workload, error) { 1686 gensupport.SetOptions(c.urlParams_, opts...) 1687 res, err := c.doRequest("json") 1688 if res != nil && res.StatusCode == http.StatusNotModified { 1689 if res.Body != nil { 1690 res.Body.Close() 1691 } 1692 return nil, &googleapi.Error{ 1693 Code: res.StatusCode, 1694 Header: res.Header, 1695 } 1696 } 1697 if err != nil { 1698 return nil, err 1699 } 1700 defer googleapi.CloseBody(res) 1701 if err := googleapi.CheckResponse(res); err != nil { 1702 return nil, err 1703 } 1704 ret := &GoogleCloudAssuredworkloadsV1Workload{ 1705 ServerResponse: googleapi.ServerResponse{ 1706 Header: res.Header, 1707 HTTPStatusCode: res.StatusCode, 1708 }, 1709 } 1710 target := &ret 1711 if err := gensupport.DecodeResponse(target, res); err != nil { 1712 return nil, err 1713 } 1714 return ret, nil 1715 // { 1716 // "description": "Gets Assured Workload associated with a CRM Node", 1717 // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/workloads/{workloadsId}", 1718 // "httpMethod": "GET", 1719 // "id": "assuredworkloads.organizations.locations.workloads.get", 1720 // "parameterOrder": [ 1721 // "name" 1722 // ], 1723 // "parameters": { 1724 // "name": { 1725 // "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\".", 1726 // "location": "path", 1727 // "pattern": "^organizations/[^/]+/locations/[^/]+/workloads/[^/]+$", 1728 // "required": true, 1729 // "type": "string" 1730 // } 1731 // }, 1732 // "path": "v1/{+name}", 1733 // "response": { 1734 // "$ref": "GoogleCloudAssuredworkloadsV1Workload" 1735 // }, 1736 // "scopes": [ 1737 // "https://www.googleapis.com/auth/cloud-platform" 1738 // ] 1739 // } 1740 1741} 1742 1743// method id "assuredworkloads.organizations.locations.workloads.list": 1744 1745type OrganizationsLocationsWorkloadsListCall struct { 1746 s *Service 1747 parent string 1748 urlParams_ gensupport.URLParams 1749 ifNoneMatch_ string 1750 ctx_ context.Context 1751 header_ http.Header 1752} 1753 1754// List: Lists Assured Workloads under a CRM Node. 1755func (r *OrganizationsLocationsWorkloadsService) List(parent string) *OrganizationsLocationsWorkloadsListCall { 1756 c := &OrganizationsLocationsWorkloadsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1757 c.parent = parent 1758 return c 1759} 1760 1761// Filter sets the optional parameter "filter": A custom filter for 1762// filtering by properties of a workload. At this time, only filtering 1763// by labels is supported. 1764func (c *OrganizationsLocationsWorkloadsListCall) Filter(filter string) *OrganizationsLocationsWorkloadsListCall { 1765 c.urlParams_.Set("filter", filter) 1766 return c 1767} 1768 1769// PageSize sets the optional parameter "pageSize": Page size. 1770func (c *OrganizationsLocationsWorkloadsListCall) PageSize(pageSize int64) *OrganizationsLocationsWorkloadsListCall { 1771 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 1772 return c 1773} 1774 1775// PageToken sets the optional parameter "pageToken": Page token 1776// returned from previous request. Page token contains context from 1777// previous request. Page token needs to be passed in the second and 1778// following requests. 1779func (c *OrganizationsLocationsWorkloadsListCall) PageToken(pageToken string) *OrganizationsLocationsWorkloadsListCall { 1780 c.urlParams_.Set("pageToken", pageToken) 1781 return c 1782} 1783 1784// Fields allows partial responses to be retrieved. See 1785// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1786// for more information. 1787func (c *OrganizationsLocationsWorkloadsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsWorkloadsListCall { 1788 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1789 return c 1790} 1791 1792// IfNoneMatch sets the optional parameter which makes the operation 1793// fail if the object's ETag matches the given value. This is useful for 1794// getting updates only after the object has changed since the last 1795// request. Use googleapi.IsNotModified to check whether the response 1796// error from Do is the result of In-None-Match. 1797func (c *OrganizationsLocationsWorkloadsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsWorkloadsListCall { 1798 c.ifNoneMatch_ = entityTag 1799 return c 1800} 1801 1802// Context sets the context to be used in this call's Do method. Any 1803// pending HTTP request will be aborted if the provided context is 1804// canceled. 1805func (c *OrganizationsLocationsWorkloadsListCall) Context(ctx context.Context) *OrganizationsLocationsWorkloadsListCall { 1806 c.ctx_ = ctx 1807 return c 1808} 1809 1810// Header returns an http.Header that can be modified by the caller to 1811// add HTTP headers to the request. 1812func (c *OrganizationsLocationsWorkloadsListCall) Header() http.Header { 1813 if c.header_ == nil { 1814 c.header_ = make(http.Header) 1815 } 1816 return c.header_ 1817} 1818 1819func (c *OrganizationsLocationsWorkloadsListCall) doRequest(alt string) (*http.Response, error) { 1820 reqHeaders := make(http.Header) 1821 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 1822 for k, v := range c.header_ { 1823 reqHeaders[k] = v 1824 } 1825 reqHeaders.Set("User-Agent", c.s.userAgent()) 1826 if c.ifNoneMatch_ != "" { 1827 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1828 } 1829 var body io.Reader = nil 1830 c.urlParams_.Set("alt", alt) 1831 c.urlParams_.Set("prettyPrint", "false") 1832 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workloads") 1833 urls += "?" + c.urlParams_.Encode() 1834 req, err := http.NewRequest("GET", urls, body) 1835 if err != nil { 1836 return nil, err 1837 } 1838 req.Header = reqHeaders 1839 googleapi.Expand(req.URL, map[string]string{ 1840 "parent": c.parent, 1841 }) 1842 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1843} 1844 1845// Do executes the "assuredworkloads.organizations.locations.workloads.list" call. 1846// Exactly one of *GoogleCloudAssuredworkloadsV1ListWorkloadsResponse or 1847// error will be non-nil. Any non-2xx status code is an error. Response 1848// headers are in either 1849// *GoogleCloudAssuredworkloadsV1ListWorkloadsResponse.ServerResponse.Hea 1850// der or (if a response was returned at all) in 1851// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1852// whether the returned error was because http.StatusNotModified was 1853// returned. 1854func (c *OrganizationsLocationsWorkloadsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAssuredworkloadsV1ListWorkloadsResponse, error) { 1855 gensupport.SetOptions(c.urlParams_, opts...) 1856 res, err := c.doRequest("json") 1857 if res != nil && res.StatusCode == http.StatusNotModified { 1858 if res.Body != nil { 1859 res.Body.Close() 1860 } 1861 return nil, &googleapi.Error{ 1862 Code: res.StatusCode, 1863 Header: res.Header, 1864 } 1865 } 1866 if err != nil { 1867 return nil, err 1868 } 1869 defer googleapi.CloseBody(res) 1870 if err := googleapi.CheckResponse(res); err != nil { 1871 return nil, err 1872 } 1873 ret := &GoogleCloudAssuredworkloadsV1ListWorkloadsResponse{ 1874 ServerResponse: googleapi.ServerResponse{ 1875 Header: res.Header, 1876 HTTPStatusCode: res.StatusCode, 1877 }, 1878 } 1879 target := &ret 1880 if err := gensupport.DecodeResponse(target, res); err != nil { 1881 return nil, err 1882 } 1883 return ret, nil 1884 // { 1885 // "description": "Lists Assured Workloads under a CRM Node.", 1886 // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/workloads", 1887 // "httpMethod": "GET", 1888 // "id": "assuredworkloads.organizations.locations.workloads.list", 1889 // "parameterOrder": [ 1890 // "parent" 1891 // ], 1892 // "parameters": { 1893 // "filter": { 1894 // "description": "A custom filter for filtering by properties of a workload. At this time, only filtering by labels is supported.", 1895 // "location": "query", 1896 // "type": "string" 1897 // }, 1898 // "pageSize": { 1899 // "description": "Page size.", 1900 // "format": "int32", 1901 // "location": "query", 1902 // "type": "integer" 1903 // }, 1904 // "pageToken": { 1905 // "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.", 1906 // "location": "query", 1907 // "type": "string" 1908 // }, 1909 // "parent": { 1910 // "description": "Required. Parent Resource to list workloads from. Must be of the form `organizations/{org_id}/locations/{location}`.", 1911 // "location": "path", 1912 // "pattern": "^organizations/[^/]+/locations/[^/]+$", 1913 // "required": true, 1914 // "type": "string" 1915 // } 1916 // }, 1917 // "path": "v1/{+parent}/workloads", 1918 // "response": { 1919 // "$ref": "GoogleCloudAssuredworkloadsV1ListWorkloadsResponse" 1920 // }, 1921 // "scopes": [ 1922 // "https://www.googleapis.com/auth/cloud-platform" 1923 // ] 1924 // } 1925 1926} 1927 1928// Pages invokes f for each page of results. 1929// A non-nil error returned from f will halt the iteration. 1930// The provided context supersedes any context provided to the Context method. 1931func (c *OrganizationsLocationsWorkloadsListCall) Pages(ctx context.Context, f func(*GoogleCloudAssuredworkloadsV1ListWorkloadsResponse) error) error { 1932 c.ctx_ = ctx 1933 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 1934 for { 1935 x, err := c.Do() 1936 if err != nil { 1937 return err 1938 } 1939 if err := f(x); err != nil { 1940 return err 1941 } 1942 if x.NextPageToken == "" { 1943 return nil 1944 } 1945 c.PageToken(x.NextPageToken) 1946 } 1947} 1948 1949// method id "assuredworkloads.organizations.locations.workloads.patch": 1950 1951type OrganizationsLocationsWorkloadsPatchCall struct { 1952 s *Service 1953 name string 1954 googlecloudassuredworkloadsv1workload *GoogleCloudAssuredworkloadsV1Workload 1955 urlParams_ gensupport.URLParams 1956 ctx_ context.Context 1957 header_ http.Header 1958} 1959 1960// Patch: Updates an existing workload. Currently allows updating of 1961// workload display_name and labels. For force updates don't set etag 1962// field in the Workload. Only one update operation per workload can be 1963// in progress. 1964func (r *OrganizationsLocationsWorkloadsService) Patch(name string, googlecloudassuredworkloadsv1workload *GoogleCloudAssuredworkloadsV1Workload) *OrganizationsLocationsWorkloadsPatchCall { 1965 c := &OrganizationsLocationsWorkloadsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1966 c.name = name 1967 c.googlecloudassuredworkloadsv1workload = googlecloudassuredworkloadsv1workload 1968 return c 1969} 1970 1971// UpdateMask sets the optional parameter "updateMask": Required. The 1972// list of fields to be updated. 1973func (c *OrganizationsLocationsWorkloadsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsWorkloadsPatchCall { 1974 c.urlParams_.Set("updateMask", updateMask) 1975 return c 1976} 1977 1978// Fields allows partial responses to be retrieved. See 1979// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1980// for more information. 1981func (c *OrganizationsLocationsWorkloadsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsWorkloadsPatchCall { 1982 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1983 return c 1984} 1985 1986// Context sets the context to be used in this call's Do method. Any 1987// pending HTTP request will be aborted if the provided context is 1988// canceled. 1989func (c *OrganizationsLocationsWorkloadsPatchCall) Context(ctx context.Context) *OrganizationsLocationsWorkloadsPatchCall { 1990 c.ctx_ = ctx 1991 return c 1992} 1993 1994// Header returns an http.Header that can be modified by the caller to 1995// add HTTP headers to the request. 1996func (c *OrganizationsLocationsWorkloadsPatchCall) Header() http.Header { 1997 if c.header_ == nil { 1998 c.header_ = make(http.Header) 1999 } 2000 return c.header_ 2001} 2002 2003func (c *OrganizationsLocationsWorkloadsPatchCall) doRequest(alt string) (*http.Response, error) { 2004 reqHeaders := make(http.Header) 2005 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124") 2006 for k, v := range c.header_ { 2007 reqHeaders[k] = v 2008 } 2009 reqHeaders.Set("User-Agent", c.s.userAgent()) 2010 var body io.Reader = nil 2011 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudassuredworkloadsv1workload) 2012 if err != nil { 2013 return nil, err 2014 } 2015 reqHeaders.Set("Content-Type", "application/json") 2016 c.urlParams_.Set("alt", alt) 2017 c.urlParams_.Set("prettyPrint", "false") 2018 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2019 urls += "?" + c.urlParams_.Encode() 2020 req, err := http.NewRequest("PATCH", urls, body) 2021 if err != nil { 2022 return nil, err 2023 } 2024 req.Header = reqHeaders 2025 googleapi.Expand(req.URL, map[string]string{ 2026 "name": c.name, 2027 }) 2028 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2029} 2030 2031// Do executes the "assuredworkloads.organizations.locations.workloads.patch" call. 2032// Exactly one of *GoogleCloudAssuredworkloadsV1Workload or error will 2033// be non-nil. Any non-2xx status code is an error. Response headers are 2034// in either 2035// *GoogleCloudAssuredworkloadsV1Workload.ServerResponse.Header or (if a 2036// response was returned at all) in error.(*googleapi.Error).Header. Use 2037// googleapi.IsNotModified to check whether the returned error was 2038// because http.StatusNotModified was returned. 2039func (c *OrganizationsLocationsWorkloadsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudAssuredworkloadsV1Workload, error) { 2040 gensupport.SetOptions(c.urlParams_, opts...) 2041 res, err := c.doRequest("json") 2042 if res != nil && res.StatusCode == http.StatusNotModified { 2043 if res.Body != nil { 2044 res.Body.Close() 2045 } 2046 return nil, &googleapi.Error{ 2047 Code: res.StatusCode, 2048 Header: res.Header, 2049 } 2050 } 2051 if err != nil { 2052 return nil, err 2053 } 2054 defer googleapi.CloseBody(res) 2055 if err := googleapi.CheckResponse(res); err != nil { 2056 return nil, err 2057 } 2058 ret := &GoogleCloudAssuredworkloadsV1Workload{ 2059 ServerResponse: googleapi.ServerResponse{ 2060 Header: res.Header, 2061 HTTPStatusCode: res.StatusCode, 2062 }, 2063 } 2064 target := &ret 2065 if err := gensupport.DecodeResponse(target, res); err != nil { 2066 return nil, err 2067 } 2068 return ret, nil 2069 // { 2070 // "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.", 2071 // "flatPath": "v1/organizations/{organizationsId}/locations/{locationsId}/workloads/{workloadsId}", 2072 // "httpMethod": "PATCH", 2073 // "id": "assuredworkloads.organizations.locations.workloads.patch", 2074 // "parameterOrder": [ 2075 // "name" 2076 // ], 2077 // "parameters": { 2078 // "name": { 2079 // "description": "Optional. The resource name of the workload. Format: organizations/{organization}/locations/{location}/workloads/{workload} Read-only.", 2080 // "location": "path", 2081 // "pattern": "^organizations/[^/]+/locations/[^/]+/workloads/[^/]+$", 2082 // "required": true, 2083 // "type": "string" 2084 // }, 2085 // "updateMask": { 2086 // "description": "Required. The list of fields to be updated.", 2087 // "format": "google-fieldmask", 2088 // "location": "query", 2089 // "type": "string" 2090 // } 2091 // }, 2092 // "path": "v1/{+name}", 2093 // "request": { 2094 // "$ref": "GoogleCloudAssuredworkloadsV1Workload" 2095 // }, 2096 // "response": { 2097 // "$ref": "GoogleCloudAssuredworkloadsV1Workload" 2098 // }, 2099 // "scopes": [ 2100 // "https://www.googleapis.com/auth/cloud-platform" 2101 // ] 2102 // } 2103 2104} 2105