1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package cloudresourcemanager provides access to the Cloud Resource Manager API. 8// 9// For product documentation, see: https://cloud.google.com/resource-manager 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/cloudresourcemanager/v1" 16// ... 17// ctx := context.Background() 18// cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: 27// 28// cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx, option.WithScopes(cloudresourcemanager.CloudPlatformReadOnlyScope)) 29// 30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31// 32// cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx, option.WithAPIKey("AIza...")) 33// 34// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 35// 36// config := &oauth2.Config{...} 37// // ... 38// token, err := config.Exchange(ctx, ...) 39// cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40// 41// See https://godoc.org/google.golang.org/api/option/ for details on options. 42package cloudresourcemanager // import "google.golang.org/api/cloudresourcemanager/v1" 43 44import ( 45 "bytes" 46 "context" 47 "encoding/json" 48 "errors" 49 "fmt" 50 "io" 51 "net/http" 52 "net/url" 53 "strconv" 54 "strings" 55 56 googleapi "google.golang.org/api/googleapi" 57 gensupport "google.golang.org/api/internal/gensupport" 58 option "google.golang.org/api/option" 59 internaloption "google.golang.org/api/option/internaloption" 60 htransport "google.golang.org/api/transport/http" 61) 62 63// Always reference these packages, just in case the auto-generated code 64// below doesn't. 65var _ = bytes.NewBuffer 66var _ = strconv.Itoa 67var _ = fmt.Sprintf 68var _ = json.NewDecoder 69var _ = io.Copy 70var _ = url.Parse 71var _ = gensupport.MarshalJSON 72var _ = googleapi.Version 73var _ = errors.New 74var _ = strings.Replace 75var _ = context.Canceled 76var _ = internaloption.WithDefaultEndpoint 77 78const apiId = "cloudresourcemanager:v1" 79const apiName = "cloudresourcemanager" 80const apiVersion = "v1" 81const basePath = "https://cloudresourcemanager.googleapis.com/" 82const mtlsBasePath = "https://cloudresourcemanager.mtls.googleapis.com/" 83 84// OAuth2 scopes used by this API. 85const ( 86 // See, edit, configure, and delete your Google Cloud data and see the 87 // email address for your Google Account. 88 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 89 90 // View your data across Google Cloud services and see the email address 91 // of your Google Account 92 CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" 93) 94 95// NewService creates a new Service. 96func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 97 scopesOption := option.WithScopes( 98 "https://www.googleapis.com/auth/cloud-platform", 99 "https://www.googleapis.com/auth/cloud-platform.read-only", 100 ) 101 // NOTE: prepend, so we don't override user-specified scopes. 102 opts = append([]option.ClientOption{scopesOption}, opts...) 103 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 104 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 105 client, endpoint, err := htransport.NewClient(ctx, opts...) 106 if err != nil { 107 return nil, err 108 } 109 s, err := New(client) 110 if err != nil { 111 return nil, err 112 } 113 if endpoint != "" { 114 s.BasePath = endpoint 115 } 116 return s, nil 117} 118 119// New creates a new Service. It uses the provided http.Client for requests. 120// 121// Deprecated: please use NewService instead. 122// To provide a custom HTTP client, use option.WithHTTPClient. 123// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 124func New(client *http.Client) (*Service, error) { 125 if client == nil { 126 return nil, errors.New("client is nil") 127 } 128 s := &Service{client: client, BasePath: basePath} 129 s.Folders = NewFoldersService(s) 130 s.Liens = NewLiensService(s) 131 s.Operations = NewOperationsService(s) 132 s.Organizations = NewOrganizationsService(s) 133 s.Projects = NewProjectsService(s) 134 return s, nil 135} 136 137type Service struct { 138 client *http.Client 139 BasePath string // API endpoint base URL 140 UserAgent string // optional additional User-Agent fragment 141 142 Folders *FoldersService 143 144 Liens *LiensService 145 146 Operations *OperationsService 147 148 Organizations *OrganizationsService 149 150 Projects *ProjectsService 151} 152 153func (s *Service) userAgent() string { 154 if s.UserAgent == "" { 155 return googleapi.UserAgent 156 } 157 return googleapi.UserAgent + " " + s.UserAgent 158} 159 160func NewFoldersService(s *Service) *FoldersService { 161 rs := &FoldersService{s: s} 162 return rs 163} 164 165type FoldersService struct { 166 s *Service 167} 168 169func NewLiensService(s *Service) *LiensService { 170 rs := &LiensService{s: s} 171 return rs 172} 173 174type LiensService struct { 175 s *Service 176} 177 178func NewOperationsService(s *Service) *OperationsService { 179 rs := &OperationsService{s: s} 180 return rs 181} 182 183type OperationsService struct { 184 s *Service 185} 186 187func NewOrganizationsService(s *Service) *OrganizationsService { 188 rs := &OrganizationsService{s: s} 189 return rs 190} 191 192type OrganizationsService struct { 193 s *Service 194} 195 196func NewProjectsService(s *Service) *ProjectsService { 197 rs := &ProjectsService{s: s} 198 return rs 199} 200 201type ProjectsService struct { 202 s *Service 203} 204 205// Ancestor: Identifying information for a single ancestor of a project. 206type Ancestor struct { 207 // ResourceId: Resource id of the ancestor. 208 ResourceId *ResourceId `json:"resourceId,omitempty"` 209 210 // ForceSendFields is a list of field names (e.g. "ResourceId") to 211 // unconditionally include in API requests. By default, fields with 212 // empty or default values are omitted from API requests. However, any 213 // non-pointer, non-interface field appearing in ForceSendFields will be 214 // sent to the server regardless of whether the field is empty or not. 215 // This may be used to include empty fields in Patch requests. 216 ForceSendFields []string `json:"-"` 217 218 // NullFields is a list of field names (e.g. "ResourceId") to include in 219 // API requests with the JSON null value. By default, fields with empty 220 // values are omitted from API requests. However, any field with an 221 // empty value appearing in NullFields will be sent to the server as 222 // null. It is an error if a field in this list has a non-empty value. 223 // This may be used to include null fields in Patch requests. 224 NullFields []string `json:"-"` 225} 226 227func (s *Ancestor) MarshalJSON() ([]byte, error) { 228 type NoMethod Ancestor 229 raw := NoMethod(*s) 230 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 231} 232 233// AuditConfig: Specifies the audit configuration for a service. The 234// configuration determines which permission types are logged, and what 235// identities, if any, are exempted from logging. An AuditConfig must 236// have one or more AuditLogConfigs. If there are AuditConfigs for both 237// `allServices` and a specific service, the union of the two 238// AuditConfigs is used for that service: the log_types specified in 239// each AuditConfig are enabled, and the exempted_members in each 240// AuditLogConfig are exempted. Example Policy with multiple 241// AuditConfigs: { "audit_configs": [ { "service": "allServices", 242// "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": 243// [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { 244// "log_type": "ADMIN_READ" } ] }, { "service": 245// "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": 246// "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ 247// "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy 248// enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts 249// jose@example.com from DATA_READ logging, and aliya@example.com from 250// DATA_WRITE logging. 251type AuditConfig struct { 252 // AuditLogConfigs: The configuration for logging of each type of 253 // permission. 254 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"` 255 256 // Service: Specifies a service that will be enabled for audit logging. 257 // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. 258 // `allServices` is a special value that covers all services. 259 Service string `json:"service,omitempty"` 260 261 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to 262 // unconditionally include in API requests. By default, fields with 263 // empty or default values are omitted from API requests. However, any 264 // non-pointer, non-interface field appearing in ForceSendFields will be 265 // sent to the server regardless of whether the field is empty or not. 266 // This may be used to include empty fields in Patch requests. 267 ForceSendFields []string `json:"-"` 268 269 // NullFields is a list of field names (e.g. "AuditLogConfigs") to 270 // include in API requests with the JSON null value. By default, fields 271 // with empty values are omitted from API requests. However, any field 272 // with an empty value appearing in NullFields will be sent to the 273 // server as null. It is an error if a field in this list has a 274 // non-empty value. This may be used to include null fields in Patch 275 // requests. 276 NullFields []string `json:"-"` 277} 278 279func (s *AuditConfig) MarshalJSON() ([]byte, error) { 280 type NoMethod AuditConfig 281 raw := NoMethod(*s) 282 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 283} 284 285// AuditLogConfig: Provides the configuration for logging a type of 286// permissions. Example: { "audit_log_configs": [ { "log_type": 287// "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { 288// "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and 289// 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ 290// logging. 291type AuditLogConfig struct { 292 // ExemptedMembers: Specifies the identities that do not cause logging 293 // for this type of permission. Follows the same format of 294 // Binding.members. 295 ExemptedMembers []string `json:"exemptedMembers,omitempty"` 296 297 // LogType: The log type that this config enables. 298 // 299 // Possible values: 300 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this. 301 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy 302 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create 303 // "DATA_READ" - Data reads. Example: CloudSQL Users list 304 LogType string `json:"logType,omitempty"` 305 306 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to 307 // unconditionally include in API requests. By default, fields with 308 // empty or default values are omitted from API requests. However, any 309 // non-pointer, non-interface field appearing in ForceSendFields will be 310 // sent to the server regardless of whether the field is empty or not. 311 // This may be used to include empty fields in Patch requests. 312 ForceSendFields []string `json:"-"` 313 314 // NullFields is a list of field names (e.g. "ExemptedMembers") to 315 // include in API requests with the JSON null value. By default, fields 316 // with empty values are omitted from API requests. However, any field 317 // with an empty value appearing in NullFields will be sent to the 318 // server as null. It is an error if a field in this list has a 319 // non-empty value. This may be used to include null fields in Patch 320 // requests. 321 NullFields []string `json:"-"` 322} 323 324func (s *AuditLogConfig) MarshalJSON() ([]byte, error) { 325 type NoMethod AuditLogConfig 326 raw := NoMethod(*s) 327 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 328} 329 330// Binding: Associates `members` with a `role`. 331type Binding struct { 332 // Condition: The condition that is associated with this binding. If the 333 // condition evaluates to `true`, then this binding applies to the 334 // current request. If the condition evaluates to `false`, then this 335 // binding does not apply to the current request. However, a different 336 // role binding might grant the same role to one or more of the members 337 // in this binding. To learn which resources support conditions in their 338 // IAM policies, see the IAM documentation 339 // (https://cloud.google.com/iam/help/conditions/resource-policies). 340 Condition *Expr `json:"condition,omitempty"` 341 342 // Members: Specifies the identities requesting access for a Cloud 343 // Platform resource. `members` can have the following values: * 344 // `allUsers`: A special identifier that represents anyone who is on the 345 // internet; with or without a Google account. * 346 // `allAuthenticatedUsers`: A special identifier that represents anyone 347 // who is authenticated with a Google account or a service account. * 348 // `user:{emailid}`: An email address that represents a specific Google 349 // account. For example, `alice@example.com` . * 350 // `serviceAccount:{emailid}`: An email address that represents a 351 // service account. For example, 352 // `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An 353 // email address that represents a Google group. For example, 354 // `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An 355 // email address (plus unique identifier) representing a user that has 356 // been recently deleted. For example, 357 // `alice@example.com?uid=123456789012345678901`. If the user is 358 // recovered, this value reverts to `user:{emailid}` and the recovered 359 // user retains the role in the binding. * 360 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address 361 // (plus unique identifier) representing a service account that has been 362 // recently deleted. For example, 363 // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 364 // If the service account is undeleted, this value reverts to 365 // `serviceAccount:{emailid}` and the undeleted service account retains 366 // the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: 367 // An email address (plus unique identifier) representing a Google group 368 // that has been recently deleted. For example, 369 // `admins@example.com?uid=123456789012345678901`. If the group is 370 // recovered, this value reverts to `group:{emailid}` and the recovered 371 // group retains the role in the binding. * `domain:{domain}`: The G 372 // Suite domain (primary) that represents all the users of that domain. 373 // For example, `google.com` or `example.com`. 374 Members []string `json:"members,omitempty"` 375 376 // Role: Role that is assigned to `members`. For example, 377 // `roles/viewer`, `roles/editor`, or `roles/owner`. 378 Role string `json:"role,omitempty"` 379 380 // ForceSendFields is a list of field names (e.g. "Condition") to 381 // unconditionally include in API requests. By default, fields with 382 // empty or default values are omitted from API requests. However, any 383 // non-pointer, non-interface field appearing in ForceSendFields will be 384 // sent to the server regardless of whether the field is empty or not. 385 // This may be used to include empty fields in Patch requests. 386 ForceSendFields []string `json:"-"` 387 388 // NullFields is a list of field names (e.g. "Condition") to include in 389 // API requests with the JSON null value. By default, fields with empty 390 // values are omitted from API requests. However, any field with an 391 // empty value appearing in NullFields will be sent to the server as 392 // null. It is an error if a field in this list has a non-empty value. 393 // This may be used to include null fields in Patch requests. 394 NullFields []string `json:"-"` 395} 396 397func (s *Binding) MarshalJSON() ([]byte, error) { 398 type NoMethod Binding 399 raw := NoMethod(*s) 400 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 401} 402 403// BooleanConstraint: A `Constraint` that is either enforced or not. For 404// example a constraint `constraints/compute.disableSerialPortAccess`. 405// If it is enforced on a VM instance, serial port connections will not 406// be opened to that instance. 407type BooleanConstraint struct { 408} 409 410// BooleanPolicy: Used in `policy_type` to specify how `boolean_policy` 411// will behave at this resource. 412type BooleanPolicy struct { 413 // Enforced: If `true`, then the `Policy` is enforced. If `false`, then 414 // any configuration is acceptable. Suppose you have a `Constraint` 415 // `constraints/compute.disableSerialPortAccess` with 416 // `constraint_default` set to `ALLOW`. A `Policy` for that `Constraint` 417 // exhibits the following behavior: - If the `Policy` at this resource 418 // has enforced set to `false`, serial port connection attempts will be 419 // allowed. - If the `Policy` at this resource has enforced set to 420 // `true`, serial port connection attempts will be refused. - If the 421 // `Policy` at this resource is `RestoreDefault`, serial port connection 422 // attempts will be allowed. - If no `Policy` is set at this resource or 423 // anywhere higher in the resource hierarchy, serial port connection 424 // attempts will be allowed. - If no `Policy` is set at this resource, 425 // but one exists higher in the resource hierarchy, the behavior is as 426 // if the`Policy` were set at this resource. The following examples 427 // demonstrate the different possible layerings: Example 1 (nearest 428 // `Constraint` wins): `organizations/foo` has a `Policy` with: 429 // {enforced: false} `projects/bar` has no `Policy` set. The constraint 430 // at `projects/bar` and `organizations/foo` will not be enforced. 431 // Example 2 (enforcement gets replaced): `organizations/foo` has a 432 // `Policy` with: {enforced: false} `projects/bar` has a `Policy` with: 433 // {enforced: true} The constraint at `organizations/foo` is not 434 // enforced. The constraint at `projects/bar` is enforced. Example 3 435 // (RestoreDefault): `organizations/foo` has a `Policy` with: {enforced: 436 // true} `projects/bar` has a `Policy` with: {RestoreDefault: {}} The 437 // constraint at `organizations/foo` is enforced. The constraint at 438 // `projects/bar` is not enforced, because `constraint_default` for the 439 // `Constraint` is `ALLOW`. 440 Enforced bool `json:"enforced,omitempty"` 441 442 // ForceSendFields is a list of field names (e.g. "Enforced") to 443 // unconditionally include in API requests. By default, fields with 444 // empty or default values are omitted from API requests. However, any 445 // non-pointer, non-interface field appearing in ForceSendFields will be 446 // sent to the server regardless of whether the field is empty or not. 447 // This may be used to include empty fields in Patch requests. 448 ForceSendFields []string `json:"-"` 449 450 // NullFields is a list of field names (e.g. "Enforced") to include in 451 // API requests with the JSON null value. By default, fields with empty 452 // values are omitted from API requests. However, any field with an 453 // empty value appearing in NullFields will be sent to the server as 454 // null. It is an error if a field in this list has a non-empty value. 455 // This may be used to include null fields in Patch requests. 456 NullFields []string `json:"-"` 457} 458 459func (s *BooleanPolicy) MarshalJSON() ([]byte, error) { 460 type NoMethod BooleanPolicy 461 raw := NoMethod(*s) 462 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 463} 464 465// ClearOrgPolicyRequest: The request sent to the ClearOrgPolicy method. 466type ClearOrgPolicyRequest struct { 467 // Constraint: Name of the `Constraint` of the `Policy` to clear. 468 Constraint string `json:"constraint,omitempty"` 469 470 // Etag: The current version, for concurrency control. Not sending an 471 // `etag` will cause the `Policy` to be cleared blindly. 472 Etag string `json:"etag,omitempty"` 473 474 // ForceSendFields is a list of field names (e.g. "Constraint") to 475 // unconditionally include in API requests. By default, fields with 476 // empty or default values are omitted from API requests. However, any 477 // non-pointer, non-interface field appearing in ForceSendFields will be 478 // sent to the server regardless of whether the field is empty or not. 479 // This may be used to include empty fields in Patch requests. 480 ForceSendFields []string `json:"-"` 481 482 // NullFields is a list of field names (e.g. "Constraint") to include in 483 // API requests with the JSON null value. By default, fields with empty 484 // values are omitted from API requests. However, any field with an 485 // empty value appearing in NullFields will be sent to the server as 486 // null. It is an error if a field in this list has a non-empty value. 487 // This may be used to include null fields in Patch requests. 488 NullFields []string `json:"-"` 489} 490 491func (s *ClearOrgPolicyRequest) MarshalJSON() ([]byte, error) { 492 type NoMethod ClearOrgPolicyRequest 493 raw := NoMethod(*s) 494 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 495} 496 497// CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation: 498// Metadata describing a long running folder operation 499type CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation struct { 500 // DestinationParent: The resource name of the folder or organization we 501 // are either creating the folder under or moving the folder to. 502 DestinationParent string `json:"destinationParent,omitempty"` 503 504 // DisplayName: The display name of the folder. 505 DisplayName string `json:"displayName,omitempty"` 506 507 // OperationType: The type of this operation. 508 // 509 // Possible values: 510 // "OPERATION_TYPE_UNSPECIFIED" - Operation type not specified. 511 // "CREATE" - A create folder operation. 512 // "MOVE" - A move folder operation. 513 OperationType string `json:"operationType,omitempty"` 514 515 // SourceParent: The resource name of the folder's parent. Only 516 // applicable when the operation_type is MOVE. 517 SourceParent string `json:"sourceParent,omitempty"` 518 519 // ForceSendFields is a list of field names (e.g. "DestinationParent") 520 // to unconditionally include in API requests. By default, fields with 521 // empty or default values are omitted from API requests. However, any 522 // non-pointer, non-interface field appearing in ForceSendFields will be 523 // sent to the server regardless of whether the field is empty or not. 524 // This may be used to include empty fields in Patch requests. 525 ForceSendFields []string `json:"-"` 526 527 // NullFields is a list of field names (e.g. "DestinationParent") to 528 // include in API requests with the JSON null value. By default, fields 529 // with empty values are omitted from API requests. However, any field 530 // with an empty value appearing in NullFields will be sent to the 531 // server as null. It is an error if a field in this list has a 532 // non-empty value. This may be used to include null fields in Patch 533 // requests. 534 NullFields []string `json:"-"` 535} 536 537func (s *CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation) MarshalJSON() ([]byte, error) { 538 type NoMethod CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation 539 raw := NoMethod(*s) 540 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 541} 542 543// CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation: 544// Metadata describing a long running folder operation 545type CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation struct { 546 // DestinationParent: The resource name of the folder or organization we 547 // are either creating the folder under or moving the folder to. 548 DestinationParent string `json:"destinationParent,omitempty"` 549 550 // DisplayName: The display name of the folder. 551 DisplayName string `json:"displayName,omitempty"` 552 553 // OperationType: The type of this operation. 554 // 555 // Possible values: 556 // "OPERATION_TYPE_UNSPECIFIED" - Operation type not specified. 557 // "CREATE" - A create folder operation. 558 // "MOVE" - A move folder operation. 559 OperationType string `json:"operationType,omitempty"` 560 561 // SourceParent: The resource name of the folder's parent. Only 562 // applicable when the operation_type is MOVE. 563 SourceParent string `json:"sourceParent,omitempty"` 564 565 // ForceSendFields is a list of field names (e.g. "DestinationParent") 566 // to unconditionally include in API requests. By default, fields with 567 // empty or default values are omitted from API requests. However, any 568 // non-pointer, non-interface field appearing in ForceSendFields will be 569 // sent to the server regardless of whether the field is empty or not. 570 // This may be used to include empty fields in Patch requests. 571 ForceSendFields []string `json:"-"` 572 573 // NullFields is a list of field names (e.g. "DestinationParent") 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 *CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation) MarshalJSON() ([]byte, error) { 584 type NoMethod CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation 585 raw := NoMethod(*s) 586 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 587} 588 589// Constraint: A `Constraint` describes a way in which a resource's 590// configuration can be restricted. For example, it controls which cloud 591// services can be activated across an organization, or whether a 592// Compute Engine instance can have serial port connections established. 593// `Constraints` can be configured by the organization's policy 594// administrator to fit the needs of the organzation by setting Policies 595// for `Constraints` at different locations in the organization's 596// resource hierarchy. Policies are inherited down the resource 597// hierarchy from higher levels, but can also be overridden. For details 598// about the inheritance rules please read about Policies 599// (/resource-manager/reference/rest/v1/Policy). `Constraints` have a 600// default behavior determined by the `constraint_default` field, which 601// is the enforcement behavior that is used in the absence of a `Policy` 602// being defined or inherited for the resource in question. 603type Constraint struct { 604 // BooleanConstraint: Defines this constraint as being a 605 // BooleanConstraint. 606 BooleanConstraint *BooleanConstraint `json:"booleanConstraint,omitempty"` 607 608 // ConstraintDefault: The evaluation behavior of this constraint in the 609 // absence of 'Policy'. 610 // 611 // Possible values: 612 // "CONSTRAINT_DEFAULT_UNSPECIFIED" - This is only used for 613 // distinguishing unset values and should never be used. 614 // "ALLOW" - Indicate that all values are allowed for list 615 // constraints. Indicate that enforcement is off for boolean 616 // constraints. 617 // "DENY" - Indicate that all values are denied for list constraints. 618 // Indicate that enforcement is on for boolean constraints. 619 ConstraintDefault string `json:"constraintDefault,omitempty"` 620 621 // Description: Detailed description of what this `Constraint` controls 622 // as well as how and where it is enforced. Mutable. 623 Description string `json:"description,omitempty"` 624 625 // DisplayName: The human readable name. Mutable. 626 DisplayName string `json:"displayName,omitempty"` 627 628 // ListConstraint: Defines this constraint as being a ListConstraint. 629 ListConstraint *ListConstraint `json:"listConstraint,omitempty"` 630 631 // Name: Immutable value, required to globally be unique. For example, 632 // `constraints/serviceuser.services` 633 Name string `json:"name,omitempty"` 634 635 // Version: Version of the `Constraint`. Default version is 0; 636 Version int64 `json:"version,omitempty"` 637 638 // ForceSendFields is a list of field names (e.g. "BooleanConstraint") 639 // to unconditionally include in API requests. By default, fields with 640 // empty or default values are omitted from API requests. However, any 641 // non-pointer, non-interface field appearing in ForceSendFields will be 642 // sent to the server regardless of whether the field is empty or not. 643 // This may be used to include empty fields in Patch requests. 644 ForceSendFields []string `json:"-"` 645 646 // NullFields is a list of field names (e.g. "BooleanConstraint") to 647 // include in API requests with the JSON null value. By default, fields 648 // with empty values are omitted from API requests. However, any field 649 // with an empty value appearing in NullFields will be sent to the 650 // server as null. It is an error if a field in this list has a 651 // non-empty value. This may be used to include null fields in Patch 652 // requests. 653 NullFields []string `json:"-"` 654} 655 656func (s *Constraint) MarshalJSON() ([]byte, error) { 657 type NoMethod Constraint 658 raw := NoMethod(*s) 659 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 660} 661 662// CreateFolderMetadata: Metadata pertaining to the Folder creation 663// process. 664type CreateFolderMetadata struct { 665 // DisplayName: The display name of the folder. 666 DisplayName string `json:"displayName,omitempty"` 667 668 // Parent: The resource name of the folder or organization we are 669 // creating the folder under. 670 Parent string `json:"parent,omitempty"` 671 672 // ForceSendFields is a list of field names (e.g. "DisplayName") to 673 // unconditionally include in API requests. By default, fields with 674 // empty or default values are omitted from API requests. However, any 675 // non-pointer, non-interface field appearing in ForceSendFields will be 676 // sent to the server regardless of whether the field is empty or not. 677 // This may be used to include empty fields in Patch requests. 678 ForceSendFields []string `json:"-"` 679 680 // NullFields is a list of field names (e.g. "DisplayName") to include 681 // in API requests with the JSON null value. By default, fields with 682 // empty values are omitted from API requests. However, any field with 683 // an empty value appearing in NullFields will be sent to the server as 684 // null. It is an error if a field in this list has a non-empty value. 685 // This may be used to include null fields in Patch requests. 686 NullFields []string `json:"-"` 687} 688 689func (s *CreateFolderMetadata) MarshalJSON() ([]byte, error) { 690 type NoMethod CreateFolderMetadata 691 raw := NoMethod(*s) 692 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 693} 694 695// CreateProjectMetadata: A status object which is used as the 696// `metadata` field for the Operation returned by CreateProject. It 697// provides insight for when significant phases of Project creation have 698// completed. 699type CreateProjectMetadata struct { 700 // CreateTime: Creation time of the project creation workflow. 701 CreateTime string `json:"createTime,omitempty"` 702 703 // Gettable: True if the project can be retrieved using `GetProject`. No 704 // other operations on the project are guaranteed to work until the 705 // project creation is complete. 706 Gettable bool `json:"gettable,omitempty"` 707 708 // Ready: True if the project creation process is complete. 709 Ready bool `json:"ready,omitempty"` 710 711 // ForceSendFields is a list of field names (e.g. "CreateTime") to 712 // unconditionally include in API requests. By default, fields with 713 // empty or default values are omitted from API requests. However, any 714 // non-pointer, non-interface field appearing in ForceSendFields will be 715 // sent to the server regardless of whether the field is empty or not. 716 // This may be used to include empty fields in Patch requests. 717 ForceSendFields []string `json:"-"` 718 719 // NullFields is a list of field names (e.g. "CreateTime") to include in 720 // API requests with the JSON null value. By default, fields with empty 721 // values are omitted from API requests. However, any field with an 722 // empty value appearing in NullFields will be sent to the server as 723 // null. It is an error if a field in this list has a non-empty value. 724 // This may be used to include null fields in Patch requests. 725 NullFields []string `json:"-"` 726} 727 728func (s *CreateProjectMetadata) MarshalJSON() ([]byte, error) { 729 type NoMethod CreateProjectMetadata 730 raw := NoMethod(*s) 731 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 732} 733 734// CreateTagBindingMetadata: Runtime operation information for creating 735// a TagValue. 736type CreateTagBindingMetadata struct { 737} 738 739// CreateTagKeyMetadata: Runtime operation information for creating a 740// TagKey. 741type CreateTagKeyMetadata struct { 742} 743 744// CreateTagValueMetadata: Runtime operation information for creating a 745// TagValue. 746type CreateTagValueMetadata struct { 747} 748 749// DeleteFolderMetadata: A status object which is used as the `metadata` 750// field for the `Operation` returned by `DeleteFolder`. 751type DeleteFolderMetadata struct { 752} 753 754// DeleteOrganizationMetadata: A status object which is used as the 755// `metadata` field for the operation returned by DeleteOrganization. 756type DeleteOrganizationMetadata struct { 757} 758 759// DeleteProjectMetadata: A status object which is used as the 760// `metadata` field for the Operation returned by `DeleteProject`. 761type DeleteProjectMetadata struct { 762} 763 764// DeleteTagBindingMetadata: Runtime operation information for deleting 765// a TagBinding. 766type DeleteTagBindingMetadata struct { 767} 768 769// DeleteTagKeyMetadata: Runtime operation information for deleting a 770// TagKey. 771type DeleteTagKeyMetadata struct { 772} 773 774// DeleteTagValueMetadata: Runtime operation information for deleting a 775// TagValue. 776type DeleteTagValueMetadata struct { 777} 778 779// Empty: A generic empty message that you can re-use to avoid defining 780// duplicated empty messages in your APIs. A typical example is to use 781// it as the request or the response type of an API method. For 782// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 783// (google.protobuf.Empty); } The JSON representation for `Empty` is 784// empty JSON object `{}`. 785type Empty struct { 786 // ServerResponse contains the HTTP response code and headers from the 787 // server. 788 googleapi.ServerResponse `json:"-"` 789} 790 791// Expr: Represents a textual expression in the Common Expression 792// Language (CEL) syntax. CEL is a C-like expression language. The 793// syntax and semantics of CEL are documented at 794// https://github.com/google/cel-spec. Example (Comparison): title: 795// "Summary size limit" description: "Determines if a summary is less 796// than 100 chars" expression: "document.summary.size() < 100" Example 797// (Equality): title: "Requestor is owner" description: "Determines if 798// requestor is the document owner" expression: "document.owner == 799// request.auth.claims.email" Example (Logic): title: "Public documents" 800// description: "Determine whether the document should be publicly 801// visible" expression: "document.type != 'private' && document.type != 802// 'internal'" Example (Data Manipulation): title: "Notification string" 803// description: "Create a notification string with a timestamp." 804// expression: "'New message received at ' + 805// string(document.create_time)" The exact variables and functions that 806// may be referenced within an expression are determined by the service 807// that evaluates it. See the service documentation for additional 808// information. 809type Expr struct { 810 // Description: Optional. Description of the expression. This is a 811 // longer text which describes the expression, e.g. when hovered over it 812 // in a UI. 813 Description string `json:"description,omitempty"` 814 815 // Expression: Textual representation of an expression in Common 816 // Expression Language syntax. 817 Expression string `json:"expression,omitempty"` 818 819 // Location: Optional. String indicating the location of the expression 820 // for error reporting, e.g. a file name and a position in the file. 821 Location string `json:"location,omitempty"` 822 823 // Title: Optional. Title for the expression, i.e. a short string 824 // describing its purpose. This can be used e.g. in UIs which allow to 825 // enter the expression. 826 Title string `json:"title,omitempty"` 827 828 // ForceSendFields is a list of field names (e.g. "Description") to 829 // unconditionally include in API requests. By default, fields with 830 // empty or default values are omitted from API requests. However, any 831 // non-pointer, non-interface field appearing in ForceSendFields will be 832 // sent to the server regardless of whether the field is empty or not. 833 // This may be used to include empty fields in Patch requests. 834 ForceSendFields []string `json:"-"` 835 836 // NullFields is a list of field names (e.g. "Description") to include 837 // in API requests with the JSON null value. By default, fields with 838 // empty values are omitted from API requests. However, any field with 839 // an empty value appearing in NullFields will be sent to the server as 840 // null. It is an error if a field in this list has a non-empty value. 841 // This may be used to include null fields in Patch requests. 842 NullFields []string `json:"-"` 843} 844 845func (s *Expr) MarshalJSON() ([]byte, error) { 846 type NoMethod Expr 847 raw := NoMethod(*s) 848 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 849} 850 851// FolderOperation: Metadata describing a long running folder operation 852type FolderOperation struct { 853 // DestinationParent: The resource name of the folder or organization we 854 // are either creating the folder under or moving the folder to. 855 DestinationParent string `json:"destinationParent,omitempty"` 856 857 // DisplayName: The display name of the folder. 858 DisplayName string `json:"displayName,omitempty"` 859 860 // OperationType: The type of this operation. 861 // 862 // Possible values: 863 // "OPERATION_TYPE_UNSPECIFIED" - Operation type not specified. 864 // "CREATE" - A create folder operation. 865 // "MOVE" - A move folder operation. 866 OperationType string `json:"operationType,omitempty"` 867 868 // SourceParent: The resource name of the folder's parent. Only 869 // applicable when the operation_type is MOVE. 870 SourceParent string `json:"sourceParent,omitempty"` 871 872 // ForceSendFields is a list of field names (e.g. "DestinationParent") 873 // to unconditionally include in API requests. By default, fields with 874 // empty or default values are omitted from API requests. However, any 875 // non-pointer, non-interface field appearing in ForceSendFields will be 876 // sent to the server regardless of whether the field is empty or not. 877 // This may be used to include empty fields in Patch requests. 878 ForceSendFields []string `json:"-"` 879 880 // NullFields is a list of field names (e.g. "DestinationParent") to 881 // include in API requests with the JSON null value. By default, fields 882 // with empty values are omitted from API requests. However, any field 883 // with an empty value appearing in NullFields will be sent to the 884 // server as null. It is an error if a field in this list has a 885 // non-empty value. This may be used to include null fields in Patch 886 // requests. 887 NullFields []string `json:"-"` 888} 889 890func (s *FolderOperation) MarshalJSON() ([]byte, error) { 891 type NoMethod FolderOperation 892 raw := NoMethod(*s) 893 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 894} 895 896// FolderOperationError: A classification of the Folder Operation error. 897type FolderOperationError struct { 898 // ErrorMessageId: The type of operation error experienced. 899 // 900 // Possible values: 901 // "ERROR_TYPE_UNSPECIFIED" - The error type was unrecognized or 902 // unspecified. 903 // "ACTIVE_FOLDER_HEIGHT_VIOLATION" - The attempted action would 904 // violate the max folder depth constraint. 905 // "MAX_CHILD_FOLDERS_VIOLATION" - The attempted action would violate 906 // the max child folders constraint. 907 // "FOLDER_NAME_UNIQUENESS_VIOLATION" - The attempted action would 908 // violate the locally-unique folder display_name constraint. 909 // "RESOURCE_DELETED_VIOLATION" - The resource being moved has been 910 // deleted. 911 // "PARENT_DELETED_VIOLATION" - The resource a folder was being added 912 // to has been deleted. 913 // "CYCLE_INTRODUCED_VIOLATION" - The attempted action would introduce 914 // cycle in resource path. 915 // "FOLDER_BEING_MOVED_VIOLATION" - The attempted action would move a 916 // folder that is already being moved. 917 // "FOLDER_TO_DELETE_NON_EMPTY_VIOLATION" - The folder the caller is 918 // trying to delete contains active resources. 919 // "DELETED_FOLDER_HEIGHT_VIOLATION" - The attempted action would 920 // violate the max deleted folder depth constraint. 921 ErrorMessageId string `json:"errorMessageId,omitempty"` 922 923 // ForceSendFields is a list of field names (e.g. "ErrorMessageId") to 924 // unconditionally include in API requests. By default, fields with 925 // empty or default values are omitted from API requests. However, any 926 // non-pointer, non-interface field appearing in ForceSendFields will be 927 // sent to the server regardless of whether the field is empty or not. 928 // This may be used to include empty fields in Patch requests. 929 ForceSendFields []string `json:"-"` 930 931 // NullFields is a list of field names (e.g. "ErrorMessageId") to 932 // include in API requests with the JSON null value. By default, fields 933 // with empty values are omitted from API requests. However, any field 934 // with an empty value appearing in NullFields will be sent to the 935 // server as null. It is an error if a field in this list has a 936 // non-empty value. This may be used to include null fields in Patch 937 // requests. 938 NullFields []string `json:"-"` 939} 940 941func (s *FolderOperationError) MarshalJSON() ([]byte, error) { 942 type NoMethod FolderOperationError 943 raw := NoMethod(*s) 944 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 945} 946 947// GetAncestryRequest: The request sent to the GetAncestry method. 948type GetAncestryRequest struct { 949} 950 951// GetAncestryResponse: Response from the projects.getAncestry method. 952type GetAncestryResponse struct { 953 // Ancestor: Ancestors are ordered from bottom to top of the resource 954 // hierarchy. The first ancestor is the project itself, followed by the 955 // project's parent, etc.. 956 Ancestor []*Ancestor `json:"ancestor,omitempty"` 957 958 // ServerResponse contains the HTTP response code and headers from the 959 // server. 960 googleapi.ServerResponse `json:"-"` 961 962 // ForceSendFields is a list of field names (e.g. "Ancestor") to 963 // unconditionally include in API requests. By default, fields with 964 // empty or default values are omitted from API requests. However, any 965 // non-pointer, non-interface field appearing in ForceSendFields will be 966 // sent to the server regardless of whether the field is empty or not. 967 // This may be used to include empty fields in Patch requests. 968 ForceSendFields []string `json:"-"` 969 970 // NullFields is a list of field names (e.g. "Ancestor") to include in 971 // API requests with the JSON null value. By default, fields with empty 972 // values are omitted from API requests. However, any field with an 973 // empty value appearing in NullFields will be sent to the server as 974 // null. It is an error if a field in this list has a non-empty value. 975 // This may be used to include null fields in Patch requests. 976 NullFields []string `json:"-"` 977} 978 979func (s *GetAncestryResponse) MarshalJSON() ([]byte, error) { 980 type NoMethod GetAncestryResponse 981 raw := NoMethod(*s) 982 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 983} 984 985// GetEffectiveOrgPolicyRequest: The request sent to the 986// GetEffectiveOrgPolicy method. 987type GetEffectiveOrgPolicyRequest struct { 988 // Constraint: The name of the `Constraint` to compute the effective 989 // `Policy`. 990 Constraint string `json:"constraint,omitempty"` 991 992 // ForceSendFields is a list of field names (e.g. "Constraint") to 993 // unconditionally include in API requests. By default, fields with 994 // empty or default values are omitted from API requests. However, any 995 // non-pointer, non-interface field appearing in ForceSendFields will be 996 // sent to the server regardless of whether the field is empty or not. 997 // This may be used to include empty fields in Patch requests. 998 ForceSendFields []string `json:"-"` 999 1000 // NullFields is a list of field names (e.g. "Constraint") to include in 1001 // API requests with the JSON null value. By default, fields with empty 1002 // values are omitted from API requests. However, any field with an 1003 // empty value appearing in NullFields will be sent to the server as 1004 // null. It is an error if a field in this list has a non-empty value. 1005 // This may be used to include null fields in Patch requests. 1006 NullFields []string `json:"-"` 1007} 1008 1009func (s *GetEffectiveOrgPolicyRequest) MarshalJSON() ([]byte, error) { 1010 type NoMethod GetEffectiveOrgPolicyRequest 1011 raw := NoMethod(*s) 1012 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1013} 1014 1015// GetIamPolicyRequest: Request message for `GetIamPolicy` method. 1016type GetIamPolicyRequest struct { 1017 // Options: OPTIONAL: A `GetPolicyOptions` object for specifying options 1018 // to `GetIamPolicy`. 1019 Options *GetPolicyOptions `json:"options,omitempty"` 1020 1021 // ForceSendFields is a list of field names (e.g. "Options") to 1022 // unconditionally include in API requests. By default, fields with 1023 // empty or default values are omitted from API requests. However, any 1024 // non-pointer, non-interface field appearing in ForceSendFields will be 1025 // sent to the server regardless of whether the field is empty or not. 1026 // This may be used to include empty fields in Patch requests. 1027 ForceSendFields []string `json:"-"` 1028 1029 // NullFields is a list of field names (e.g. "Options") to include in 1030 // API requests with the JSON null value. By default, fields with empty 1031 // values are omitted from API requests. However, any field with an 1032 // empty value appearing in NullFields will be sent to the server as 1033 // null. It is an error if a field in this list has a non-empty value. 1034 // This may be used to include null fields in Patch requests. 1035 NullFields []string `json:"-"` 1036} 1037 1038func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) { 1039 type NoMethod GetIamPolicyRequest 1040 raw := NoMethod(*s) 1041 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1042} 1043 1044// GetOrgPolicyRequest: The request sent to the GetOrgPolicy method. 1045type GetOrgPolicyRequest struct { 1046 // Constraint: Name of the `Constraint` to get the `Policy`. 1047 Constraint string `json:"constraint,omitempty"` 1048 1049 // ForceSendFields is a list of field names (e.g. "Constraint") to 1050 // unconditionally include in API requests. By default, fields with 1051 // empty or default values are omitted from API requests. However, any 1052 // non-pointer, non-interface field appearing in ForceSendFields will be 1053 // sent to the server regardless of whether the field is empty or not. 1054 // This may be used to include empty fields in Patch requests. 1055 ForceSendFields []string `json:"-"` 1056 1057 // NullFields is a list of field names (e.g. "Constraint") to include in 1058 // API requests with the JSON null value. By default, fields with empty 1059 // values are omitted from API requests. However, any field with an 1060 // empty value appearing in NullFields will be sent to the server as 1061 // null. It is an error if a field in this list has a non-empty value. 1062 // This may be used to include null fields in Patch requests. 1063 NullFields []string `json:"-"` 1064} 1065 1066func (s *GetOrgPolicyRequest) MarshalJSON() ([]byte, error) { 1067 type NoMethod GetOrgPolicyRequest 1068 raw := NoMethod(*s) 1069 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1070} 1071 1072// GetPolicyOptions: Encapsulates settings provided to GetIamPolicy. 1073type GetPolicyOptions struct { 1074 // RequestedPolicyVersion: Optional. The policy format version to be 1075 // returned. Valid values are 0, 1, and 3. Requests specifying an 1076 // invalid value will be rejected. Requests for policies with any 1077 // conditional bindings must specify version 3. Policies without any 1078 // conditional bindings may specify any valid value or leave the field 1079 // unset. To learn which resources support conditions in their IAM 1080 // policies, see the IAM documentation 1081 // (https://cloud.google.com/iam/help/conditions/resource-policies). 1082 RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"` 1083 1084 // ForceSendFields is a list of field names (e.g. 1085 // "RequestedPolicyVersion") to unconditionally include in API requests. 1086 // By default, fields with empty or default values are omitted from API 1087 // requests. However, any non-pointer, non-interface field appearing in 1088 // ForceSendFields will be sent to the server regardless of whether the 1089 // field is empty or not. This may be used to include empty fields in 1090 // Patch requests. 1091 ForceSendFields []string `json:"-"` 1092 1093 // NullFields is a list of field names (e.g. "RequestedPolicyVersion") 1094 // to include in API requests with the JSON null value. By default, 1095 // fields with empty values are omitted from API requests. However, any 1096 // field with an empty value appearing in NullFields will be sent to the 1097 // server as null. It is an error if a field in this list has a 1098 // non-empty value. This may be used to include null fields in Patch 1099 // requests. 1100 NullFields []string `json:"-"` 1101} 1102 1103func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) { 1104 type NoMethod GetPolicyOptions 1105 raw := NoMethod(*s) 1106 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1107} 1108 1109// Lien: A Lien represents an encumbrance on the actions that can be 1110// performed on a resource. 1111type Lien struct { 1112 // CreateTime: The creation time of this Lien. 1113 CreateTime string `json:"createTime,omitempty"` 1114 1115 // Name: A system-generated unique identifier for this Lien. Example: 1116 // `liens/1234abcd` 1117 Name string `json:"name,omitempty"` 1118 1119 // Origin: A stable, user-visible/meaningful string identifying the 1120 // origin of the Lien, intended to be inspected programmatically. 1121 // Maximum length of 200 characters. Example: 'compute.googleapis.com' 1122 Origin string `json:"origin,omitempty"` 1123 1124 // Parent: A reference to the resource this Lien is attached to. The 1125 // server will validate the parent against those for which Liens are 1126 // supported. Example: `projects/1234` 1127 Parent string `json:"parent,omitempty"` 1128 1129 // Reason: Concise user-visible strings indicating why an action cannot 1130 // be performed on a resource. Maximum length of 200 characters. 1131 // Example: 'Holds production API key' 1132 Reason string `json:"reason,omitempty"` 1133 1134 // Restrictions: The types of operations which should be blocked as a 1135 // result of this Lien. Each value should correspond to an IAM 1136 // permission. The server will validate the permissions against those 1137 // for which Liens are supported. An empty list is meaningless and will 1138 // be rejected. Example: ['resourcemanager.projects.delete'] 1139 Restrictions []string `json:"restrictions,omitempty"` 1140 1141 // ServerResponse contains the HTTP response code and headers from the 1142 // server. 1143 googleapi.ServerResponse `json:"-"` 1144 1145 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1146 // unconditionally include in API requests. By default, fields with 1147 // empty or default values are omitted from API requests. However, any 1148 // non-pointer, non-interface field appearing in ForceSendFields will be 1149 // sent to the server regardless of whether the field is empty or not. 1150 // This may be used to include empty fields in Patch requests. 1151 ForceSendFields []string `json:"-"` 1152 1153 // NullFields is a list of field names (e.g. "CreateTime") to include in 1154 // API requests with the JSON null value. By default, fields with empty 1155 // values are omitted from API requests. However, any field with an 1156 // empty value appearing in NullFields will be sent to the server as 1157 // null. It is an error if a field in this list has a non-empty value. 1158 // This may be used to include null fields in Patch requests. 1159 NullFields []string `json:"-"` 1160} 1161 1162func (s *Lien) MarshalJSON() ([]byte, error) { 1163 type NoMethod Lien 1164 raw := NoMethod(*s) 1165 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1166} 1167 1168// ListAvailableOrgPolicyConstraintsRequest: The request sent to the 1169// `ListAvailableOrgPolicyConstraints` method on the project, folder, or 1170// organization. 1171type ListAvailableOrgPolicyConstraintsRequest struct { 1172 // PageSize: Size of the pages to be returned. This is currently 1173 // unsupported and will be ignored. The server may at any point start 1174 // using this field to limit page size. 1175 PageSize int64 `json:"pageSize,omitempty"` 1176 1177 // PageToken: Page token used to retrieve the next page. This is 1178 // currently unsupported and will be ignored. The server may at any 1179 // point start using this field. 1180 PageToken string `json:"pageToken,omitempty"` 1181 1182 // ForceSendFields is a list of field names (e.g. "PageSize") to 1183 // unconditionally include in API requests. By default, fields with 1184 // empty or default values are omitted from API requests. However, any 1185 // non-pointer, non-interface field appearing in ForceSendFields will be 1186 // sent to the server regardless of whether the field is empty or not. 1187 // This may be used to include empty fields in Patch requests. 1188 ForceSendFields []string `json:"-"` 1189 1190 // NullFields is a list of field names (e.g. "PageSize") to include in 1191 // API requests with the JSON null value. By default, fields with empty 1192 // values are omitted from API requests. However, any field with an 1193 // empty value appearing in NullFields will be sent to the server as 1194 // null. It is an error if a field in this list has a non-empty value. 1195 // This may be used to include null fields in Patch requests. 1196 NullFields []string `json:"-"` 1197} 1198 1199func (s *ListAvailableOrgPolicyConstraintsRequest) MarshalJSON() ([]byte, error) { 1200 type NoMethod ListAvailableOrgPolicyConstraintsRequest 1201 raw := NoMethod(*s) 1202 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1203} 1204 1205// ListAvailableOrgPolicyConstraintsResponse: The response returned from 1206// the `ListAvailableOrgPolicyConstraints` method. Returns all 1207// `Constraints` that could be set at this level of the hierarchy 1208// (contrast with the response from `ListPolicies`, which returns all 1209// policies which are set). 1210type ListAvailableOrgPolicyConstraintsResponse struct { 1211 // Constraints: The collection of constraints that are settable on the 1212 // request resource. 1213 Constraints []*Constraint `json:"constraints,omitempty"` 1214 1215 // NextPageToken: Page token used to retrieve the next page. This is 1216 // currently not used. 1217 NextPageToken string `json:"nextPageToken,omitempty"` 1218 1219 // ServerResponse contains the HTTP response code and headers from the 1220 // server. 1221 googleapi.ServerResponse `json:"-"` 1222 1223 // ForceSendFields is a list of field names (e.g. "Constraints") to 1224 // unconditionally include in API requests. By default, fields with 1225 // empty or default values are omitted from API requests. However, any 1226 // non-pointer, non-interface field appearing in ForceSendFields will be 1227 // sent to the server regardless of whether the field is empty or not. 1228 // This may be used to include empty fields in Patch requests. 1229 ForceSendFields []string `json:"-"` 1230 1231 // NullFields is a list of field names (e.g. "Constraints") to include 1232 // in API requests with the JSON null value. By default, fields with 1233 // empty values are omitted from API requests. However, any field with 1234 // an empty value appearing in NullFields will be sent to the server as 1235 // null. It is an error if a field in this list has a non-empty value. 1236 // This may be used to include null fields in Patch requests. 1237 NullFields []string `json:"-"` 1238} 1239 1240func (s *ListAvailableOrgPolicyConstraintsResponse) MarshalJSON() ([]byte, error) { 1241 type NoMethod ListAvailableOrgPolicyConstraintsResponse 1242 raw := NoMethod(*s) 1243 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1244} 1245 1246// ListConstraint: A `Constraint` that allows or disallows a list of 1247// string values, which are configured by an Organization's policy 1248// administrator with a `Policy`. 1249type ListConstraint struct { 1250 // SuggestedValue: Optional. The Google Cloud Console will try to 1251 // default to a configuration that matches the value specified in this 1252 // `Constraint`. 1253 SuggestedValue string `json:"suggestedValue,omitempty"` 1254 1255 // SupportsUnder: Indicates whether subtrees of Cloud Resource Manager 1256 // resource hierarchy can be used in `Policy.allowed_values` and 1257 // `Policy.denied_values`. For example, "under:folders/123" would 1258 // match any resource under the 'folders/123' folder. 1259 SupportsUnder bool `json:"supportsUnder,omitempty"` 1260 1261 // ForceSendFields is a list of field names (e.g. "SuggestedValue") to 1262 // unconditionally include in API requests. By default, fields with 1263 // empty or default values are omitted from API requests. However, any 1264 // non-pointer, non-interface field appearing in ForceSendFields will be 1265 // sent to the server regardless of whether the field is empty or not. 1266 // This may be used to include empty fields in Patch requests. 1267 ForceSendFields []string `json:"-"` 1268 1269 // NullFields is a list of field names (e.g. "SuggestedValue") to 1270 // include in API requests with the JSON null value. By default, fields 1271 // with empty values are omitted from API requests. However, any field 1272 // with an empty value appearing in NullFields will be sent to the 1273 // server as null. It is an error if a field in this list has a 1274 // non-empty value. This may be used to include null fields in Patch 1275 // requests. 1276 NullFields []string `json:"-"` 1277} 1278 1279func (s *ListConstraint) MarshalJSON() ([]byte, error) { 1280 type NoMethod ListConstraint 1281 raw := NoMethod(*s) 1282 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1283} 1284 1285// ListLiensResponse: The response message for Liens.ListLiens. 1286type ListLiensResponse struct { 1287 // Liens: A list of Liens. 1288 Liens []*Lien `json:"liens,omitempty"` 1289 1290 // NextPageToken: Token to retrieve the next page of results, or empty 1291 // if there are no more results in the list. 1292 NextPageToken string `json:"nextPageToken,omitempty"` 1293 1294 // ServerResponse contains the HTTP response code and headers from the 1295 // server. 1296 googleapi.ServerResponse `json:"-"` 1297 1298 // ForceSendFields is a list of field names (e.g. "Liens") to 1299 // unconditionally include in API requests. By default, fields with 1300 // empty or default values are omitted from API requests. However, any 1301 // non-pointer, non-interface field appearing in ForceSendFields will be 1302 // sent to the server regardless of whether the field is empty or not. 1303 // This may be used to include empty fields in Patch requests. 1304 ForceSendFields []string `json:"-"` 1305 1306 // NullFields is a list of field names (e.g. "Liens") to include in API 1307 // requests with the JSON null value. By default, fields with empty 1308 // values are omitted from API requests. However, any field with an 1309 // empty value appearing in NullFields will be sent to the server as 1310 // null. It is an error if a field in this list has a non-empty value. 1311 // This may be used to include null fields in Patch requests. 1312 NullFields []string `json:"-"` 1313} 1314 1315func (s *ListLiensResponse) MarshalJSON() ([]byte, error) { 1316 type NoMethod ListLiensResponse 1317 raw := NoMethod(*s) 1318 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1319} 1320 1321// ListOrgPoliciesRequest: The request sent to the ListOrgPolicies 1322// method. 1323type ListOrgPoliciesRequest struct { 1324 // PageSize: Size of the pages to be returned. This is currently 1325 // unsupported and will be ignored. The server may at any point start 1326 // using this field to limit page size. 1327 PageSize int64 `json:"pageSize,omitempty"` 1328 1329 // PageToken: Page token used to retrieve the next page. This is 1330 // currently unsupported and will be ignored. The server may at any 1331 // point start using this field. 1332 PageToken string `json:"pageToken,omitempty"` 1333 1334 // ForceSendFields is a list of field names (e.g. "PageSize") to 1335 // unconditionally include in API requests. By default, fields with 1336 // empty or default values are omitted from API requests. However, any 1337 // non-pointer, non-interface field appearing in ForceSendFields will be 1338 // sent to the server regardless of whether the field is empty or not. 1339 // This may be used to include empty fields in Patch requests. 1340 ForceSendFields []string `json:"-"` 1341 1342 // NullFields is a list of field names (e.g. "PageSize") to include in 1343 // API requests with the JSON null value. By default, fields with empty 1344 // values are omitted from API requests. However, any field with an 1345 // empty value appearing in NullFields will be sent to the server as 1346 // null. It is an error if a field in this list has a non-empty value. 1347 // This may be used to include null fields in Patch requests. 1348 NullFields []string `json:"-"` 1349} 1350 1351func (s *ListOrgPoliciesRequest) MarshalJSON() ([]byte, error) { 1352 type NoMethod ListOrgPoliciesRequest 1353 raw := NoMethod(*s) 1354 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1355} 1356 1357// ListOrgPoliciesResponse: The response returned from the 1358// `ListOrgPolicies` method. It will be empty if no `Policies` are set 1359// on the resource. 1360type ListOrgPoliciesResponse struct { 1361 // NextPageToken: Page token used to retrieve the next page. This is 1362 // currently not used, but the server may at any point start supplying a 1363 // valid token. 1364 NextPageToken string `json:"nextPageToken,omitempty"` 1365 1366 // Policies: The `Policies` that are set on the resource. It will be 1367 // empty if no `Policies` are set. 1368 Policies []*OrgPolicy `json:"policies,omitempty"` 1369 1370 // ServerResponse contains the HTTP response code and headers from the 1371 // server. 1372 googleapi.ServerResponse `json:"-"` 1373 1374 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1375 // unconditionally include in API requests. By default, fields with 1376 // empty or default values are omitted from API requests. However, any 1377 // non-pointer, non-interface field appearing in ForceSendFields will be 1378 // sent to the server regardless of whether the field is empty or not. 1379 // This may be used to include empty fields in Patch requests. 1380 ForceSendFields []string `json:"-"` 1381 1382 // NullFields is a list of field names (e.g. "NextPageToken") to include 1383 // in API requests with the JSON null value. By default, fields with 1384 // empty values are omitted from API requests. However, any field with 1385 // an empty value appearing in NullFields will be sent to the server as 1386 // null. It is an error if a field in this list has a non-empty value. 1387 // This may be used to include null fields in Patch requests. 1388 NullFields []string `json:"-"` 1389} 1390 1391func (s *ListOrgPoliciesResponse) MarshalJSON() ([]byte, error) { 1392 type NoMethod ListOrgPoliciesResponse 1393 raw := NoMethod(*s) 1394 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1395} 1396 1397// ListPolicy: Used in `policy_type` to specify how `list_policy` 1398// behaves at this resource. `ListPolicy` can define specific values and 1399// subtrees of Cloud Resource Manager resource hierarchy 1400// (`Organizations`, `Folders`, `Projects`) that are allowed or denied 1401// by setting the `allowed_values` and `denied_values` fields. This is 1402// achieved by using the `under:` and optional `is:` prefixes. The 1403// `under:` prefix is used to denote resource subtree values. The `is:` 1404// prefix is used to denote specific values, and is required only if the 1405// value contains a ":". Values prefixed with "is:" are treated the same 1406// as values with no prefix. Ancestry subtrees must be in one of the 1407// following formats: - "projects/", e.g. "projects/tokyo-rain-123" - 1408// "folders/", e.g. "folders/1234" - "organizations/", e.g. 1409// "organizations/1234" The `supports_under` field of the associated 1410// `Constraint` defines whether ancestry prefixes can be used. You can 1411// set `allowed_values` and `denied_values` in the same `Policy` if 1412// `all_values` is `ALL_VALUES_UNSPECIFIED`. `ALLOW` or `DENY` are used 1413// to allow or deny all values. If `all_values` is set to either `ALLOW` 1414// or `DENY`, `allowed_values` and `denied_values` must be unset. 1415type ListPolicy struct { 1416 // AllValues: The policy all_values state. 1417 // 1418 // Possible values: 1419 // "ALL_VALUES_UNSPECIFIED" - Indicates that allowed_values or 1420 // denied_values must be set. 1421 // "ALLOW" - A policy with this set allows all values. 1422 // "DENY" - A policy with this set denies all values. 1423 AllValues string `json:"allValues,omitempty"` 1424 1425 // AllowedValues: List of values allowed at this resource. Can only be 1426 // set if `all_values` is set to `ALL_VALUES_UNSPECIFIED`. 1427 AllowedValues []string `json:"allowedValues,omitempty"` 1428 1429 // DeniedValues: List of values denied at this resource. Can only be set 1430 // if `all_values` is set to `ALL_VALUES_UNSPECIFIED`. 1431 DeniedValues []string `json:"deniedValues,omitempty"` 1432 1433 // InheritFromParent: Determines the inheritance behavior for this 1434 // `Policy`. By default, a `ListPolicy` set at a resource supersedes any 1435 // `Policy` set anywhere up the resource hierarchy. However, if 1436 // `inherit_from_parent` is set to `true`, then the values from the 1437 // effective `Policy` of the parent resource are inherited, meaning the 1438 // values set in this `Policy` are added to the values inherited up the 1439 // hierarchy. Setting `Policy` hierarchies that inherit both allowed 1440 // values and denied values isn't recommended in most circumstances to 1441 // keep the configuration simple and understandable. However, it is 1442 // possible to set a `Policy` with `allowed_values` set that inherits a 1443 // `Policy` with `denied_values` set. In this case, the values that are 1444 // allowed must be in `allowed_values` and not present in 1445 // `denied_values`. For example, suppose you have a `Constraint` 1446 // `constraints/serviceuser.services`, which has a `constraint_type` of 1447 // `list_constraint`, and with `constraint_default` set to `ALLOW`. 1448 // Suppose that at the Organization level, a `Policy` is applied that 1449 // restricts the allowed API activations to {`E1`, `E2`}. Then, if a 1450 // `Policy` is applied to a project below the Organization that has 1451 // `inherit_from_parent` set to `false` and field all_values set to 1452 // DENY, then an attempt to activate any API will be denied. The 1453 // following examples demonstrate different possible layerings for 1454 // `projects/bar` parented by `organizations/foo`: Example 1 (no 1455 // inherited values): `organizations/foo` has a `Policy` with values: 1456 // {allowed_values: "E1" allowed_values:"E2"} `projects/bar` has 1457 // `inherit_from_parent` `false` and values: {allowed_values: "E3" 1458 // allowed_values: "E4"} The accepted values at `organizations/foo` are 1459 // `E1`, `E2`. The accepted values at `projects/bar` are `E3`, and `E4`. 1460 // Example 2 (inherited values): `organizations/foo` has a `Policy` with 1461 // values: {allowed_values: "E1" allowed_values:"E2"} `projects/bar` has 1462 // a `Policy` with values: {value: "E3" value: "E4" inherit_from_parent: 1463 // true} The accepted values at `organizations/foo` are `E1`, `E2`. The 1464 // accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`. 1465 // Example 3 (inheriting both allowed and denied values): 1466 // `organizations/foo` has a `Policy` with values: {allowed_values: "E1" 1467 // allowed_values: "E2"} `projects/bar` has a `Policy` with: 1468 // {denied_values: "E1"} The accepted values at `organizations/foo` are 1469 // `E1`, `E2`. The value accepted at `projects/bar` is `E2`. Example 4 1470 // (RestoreDefault): `organizations/foo` has a `Policy` with values: 1471 // {allowed_values: "E1" allowed_values:"E2"} `projects/bar` has a 1472 // `Policy` with values: {RestoreDefault: {}} The accepted values at 1473 // `organizations/foo` are `E1`, `E2`. The accepted values at 1474 // `projects/bar` are either all or none depending on the value of 1475 // `constraint_default` (if `ALLOW`, all; if `DENY`, none). Example 5 1476 // (no policy inherits parent policy): `organizations/foo` has no 1477 // `Policy` set. `projects/bar` has no `Policy` set. The accepted values 1478 // at both levels are either all or none depending on the value of 1479 // `constraint_default` (if `ALLOW`, all; if `DENY`, none). Example 6 1480 // (ListConstraint allowing all): `organizations/foo` has a `Policy` 1481 // with values: {allowed_values: "E1" allowed_values: "E2"} 1482 // `projects/bar` has a `Policy` with: {all: ALLOW} The accepted values 1483 // at `organizations/foo` are `E1`, E2`. Any value is accepted at 1484 // `projects/bar`. Example 7 (ListConstraint allowing none): 1485 // `organizations/foo` has a `Policy` with values: {allowed_values: "E1" 1486 // allowed_values: "E2"} `projects/bar` has a `Policy` with: {all: DENY} 1487 // The accepted values at `organizations/foo` are `E1`, E2`. No value is 1488 // accepted at `projects/bar`. Example 10 (allowed and denied subtrees 1489 // of Resource Manager hierarchy): Given the following resource 1490 // hierarchy O1->{F1, F2}; F1->{P1}; F2->{P2, P3}, `organizations/foo` 1491 // has a `Policy` with values: {allowed_values: 1492 // "under:organizations/O1"} `projects/bar` has a `Policy` with: 1493 // {allowed_values: "under:projects/P3"} {denied_values: 1494 // "under:folders/F2"} The accepted values at `organizations/foo` are 1495 // `organizations/O1`, `folders/F1`, `folders/F2`, `projects/P1`, 1496 // `projects/P2`, `projects/P3`. The accepted values at `projects/bar` 1497 // are `organizations/O1`, `folders/F1`, `projects/P1`. 1498 InheritFromParent bool `json:"inheritFromParent,omitempty"` 1499 1500 // SuggestedValue: Optional. The Google Cloud Console will try to 1501 // default to a configuration that matches the value specified in this 1502 // `Policy`. If `suggested_value` is not set, it will inherit the value 1503 // specified higher in the hierarchy, unless `inherit_from_parent` is 1504 // `false`. 1505 SuggestedValue string `json:"suggestedValue,omitempty"` 1506 1507 // ForceSendFields is a list of field names (e.g. "AllValues") to 1508 // unconditionally include in API requests. By default, fields with 1509 // empty or default values are omitted from API requests. However, any 1510 // non-pointer, non-interface field appearing in ForceSendFields will be 1511 // sent to the server regardless of whether the field is empty or not. 1512 // This may be used to include empty fields in Patch requests. 1513 ForceSendFields []string `json:"-"` 1514 1515 // NullFields is a list of field names (e.g. "AllValues") to include in 1516 // API requests with the JSON null value. By default, fields with empty 1517 // values are omitted from API requests. However, any field with an 1518 // empty value appearing in NullFields will be sent to the server as 1519 // null. It is an error if a field in this list has a non-empty value. 1520 // This may be used to include null fields in Patch requests. 1521 NullFields []string `json:"-"` 1522} 1523 1524func (s *ListPolicy) MarshalJSON() ([]byte, error) { 1525 type NoMethod ListPolicy 1526 raw := NoMethod(*s) 1527 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1528} 1529 1530// ListProjectsResponse: A page of the response received from the 1531// ListProjects method. A paginated response where more pages are 1532// available has `next_page_token` set. This token can be used in a 1533// subsequent request to retrieve the next request page. 1534type ListProjectsResponse struct { 1535 // NextPageToken: Pagination token. If the result set is too large to 1536 // fit in a single response, this token is returned. It encodes the 1537 // position of the current result cursor. Feeding this value into a new 1538 // list request with the `page_token` parameter gives the next page of 1539 // the results. When `next_page_token` is not filled in, there is no 1540 // next page and the list returned is the last page in the result set. 1541 // Pagination tokens have a limited lifetime. 1542 NextPageToken string `json:"nextPageToken,omitempty"` 1543 1544 // Projects: The list of Projects that matched the list filter. This 1545 // list can be paginated. 1546 Projects []*Project `json:"projects,omitempty"` 1547 1548 // ServerResponse contains the HTTP response code and headers from the 1549 // server. 1550 googleapi.ServerResponse `json:"-"` 1551 1552 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1553 // unconditionally include in API requests. By default, fields with 1554 // empty or default values are omitted from API requests. However, any 1555 // non-pointer, non-interface field appearing in ForceSendFields will be 1556 // sent to the server regardless of whether the field is empty or not. 1557 // This may be used to include empty fields in Patch requests. 1558 ForceSendFields []string `json:"-"` 1559 1560 // NullFields is a list of field names (e.g. "NextPageToken") to include 1561 // in API requests with the JSON null value. By default, fields with 1562 // empty values are omitted from API requests. However, any field with 1563 // an empty value appearing in NullFields will be sent to the server as 1564 // null. It is an error if a field in this list has a non-empty value. 1565 // This may be used to include null fields in Patch requests. 1566 NullFields []string `json:"-"` 1567} 1568 1569func (s *ListProjectsResponse) MarshalJSON() ([]byte, error) { 1570 type NoMethod ListProjectsResponse 1571 raw := NoMethod(*s) 1572 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1573} 1574 1575// MoveFolderMetadata: Metadata pertaining to the folder move process. 1576type MoveFolderMetadata struct { 1577 // DestinationParent: The resource name of the folder or organization to 1578 // move the folder to. 1579 DestinationParent string `json:"destinationParent,omitempty"` 1580 1581 // DisplayName: The display name of the folder. 1582 DisplayName string `json:"displayName,omitempty"` 1583 1584 // SourceParent: The resource name of the folder's parent. 1585 SourceParent string `json:"sourceParent,omitempty"` 1586 1587 // ForceSendFields is a list of field names (e.g. "DestinationParent") 1588 // to unconditionally include in API requests. By default, fields with 1589 // empty or default values are omitted from API requests. However, any 1590 // non-pointer, non-interface field appearing in ForceSendFields will be 1591 // sent to the server regardless of whether the field is empty or not. 1592 // This may be used to include empty fields in Patch requests. 1593 ForceSendFields []string `json:"-"` 1594 1595 // NullFields is a list of field names (e.g. "DestinationParent") to 1596 // include in API requests with the JSON null value. By default, fields 1597 // with empty values are omitted from API requests. However, any field 1598 // with an empty value appearing in NullFields will be sent to the 1599 // server as null. It is an error if a field in this list has a 1600 // non-empty value. This may be used to include null fields in Patch 1601 // requests. 1602 NullFields []string `json:"-"` 1603} 1604 1605func (s *MoveFolderMetadata) MarshalJSON() ([]byte, error) { 1606 type NoMethod MoveFolderMetadata 1607 raw := NoMethod(*s) 1608 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1609} 1610 1611// MoveProjectMetadata: A status object which is used as the `metadata` 1612// field for the Operation returned by MoveProject. 1613type MoveProjectMetadata struct { 1614} 1615 1616// Operation: This resource represents a long-running operation that is 1617// the result of a network API call. 1618type Operation struct { 1619 // Done: If the value is `false`, it means the operation is still in 1620 // progress. If `true`, the operation is completed, and either `error` 1621 // or `response` is available. 1622 Done bool `json:"done,omitempty"` 1623 1624 // Error: The error result of the operation in case of failure or 1625 // cancellation. 1626 Error *Status `json:"error,omitempty"` 1627 1628 // Metadata: Service-specific metadata associated with the operation. It 1629 // typically contains progress information and common metadata such as 1630 // create time. Some services might not provide such metadata. Any 1631 // method that returns a long-running operation should document the 1632 // metadata type, if any. 1633 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1634 1635 // Name: The server-assigned name, which is only unique within the same 1636 // service that originally returns it. If you use the default HTTP 1637 // mapping, the `name` should be a resource name ending with 1638 // `operations/{unique_id}`. 1639 Name string `json:"name,omitempty"` 1640 1641 // Response: The normal response of the operation in case of success. If 1642 // the original method returns no data on success, such as `Delete`, the 1643 // response is `google.protobuf.Empty`. If the original method is 1644 // standard `Get`/`Create`/`Update`, the response should be the 1645 // resource. For other methods, the response should have the type 1646 // `XxxResponse`, where `Xxx` is the original method name. For example, 1647 // if the original method name is `TakeSnapshot()`, the inferred 1648 // response type is `TakeSnapshotResponse`. 1649 Response googleapi.RawMessage `json:"response,omitempty"` 1650 1651 // ServerResponse contains the HTTP response code and headers from the 1652 // server. 1653 googleapi.ServerResponse `json:"-"` 1654 1655 // ForceSendFields is a list of field names (e.g. "Done") to 1656 // unconditionally include in API requests. By default, fields with 1657 // empty or default values are omitted from API requests. However, any 1658 // non-pointer, non-interface field appearing in ForceSendFields will be 1659 // sent to the server regardless of whether the field is empty or not. 1660 // This may be used to include empty fields in Patch requests. 1661 ForceSendFields []string `json:"-"` 1662 1663 // NullFields is a list of field names (e.g. "Done") to include in API 1664 // requests with the JSON null value. By default, fields with empty 1665 // values are omitted from API requests. However, any field with an 1666 // empty value appearing in NullFields will be sent to the server as 1667 // null. It is an error if a field in this list has a non-empty value. 1668 // This may be used to include null fields in Patch requests. 1669 NullFields []string `json:"-"` 1670} 1671 1672func (s *Operation) MarshalJSON() ([]byte, error) { 1673 type NoMethod Operation 1674 raw := NoMethod(*s) 1675 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1676} 1677 1678// OrgPolicy: Defines a Cloud Organization `Policy` which is used to 1679// specify `Constraints` for configurations of Cloud Platform resources. 1680type OrgPolicy struct { 1681 // BooleanPolicy: For boolean `Constraints`, whether to enforce the 1682 // `Constraint` or not. 1683 BooleanPolicy *BooleanPolicy `json:"booleanPolicy,omitempty"` 1684 1685 // Constraint: The name of the `Constraint` the `Policy` is configuring, 1686 // for example, `constraints/serviceuser.services`. A list of available 1687 // constraints 1688 // (/resource-manager/docs/organization-policy/org-policy-constraints) 1689 // is available. Immutable after creation. 1690 Constraint string `json:"constraint,omitempty"` 1691 1692 // Etag: An opaque tag indicating the current version of the `Policy`, 1693 // used for concurrency control. When the `Policy` is returned from 1694 // either a `GetPolicy` or a `ListOrgPolicy` request, this `etag` 1695 // indicates the version of the current `Policy` to use when executing a 1696 // read-modify-write loop. When the `Policy` is returned from a 1697 // `GetEffectivePolicy` request, the `etag` will be unset. When the 1698 // `Policy` is used in a `SetOrgPolicy` method, use the `etag` value 1699 // that was returned from a `GetOrgPolicy` request as part of a 1700 // read-modify-write loop for concurrency control. Not setting the 1701 // `etag`in a `SetOrgPolicy` request will result in an unconditional 1702 // write of the `Policy`. 1703 Etag string `json:"etag,omitempty"` 1704 1705 // ListPolicy: List of values either allowed or disallowed. 1706 ListPolicy *ListPolicy `json:"listPolicy,omitempty"` 1707 1708 // RestoreDefault: Restores the default behavior of the constraint; 1709 // independent of `Constraint` type. 1710 RestoreDefault *RestoreDefault `json:"restoreDefault,omitempty"` 1711 1712 // UpdateTime: The time stamp the `Policy` was previously updated. This 1713 // is set by the server, not specified by the caller, and represents the 1714 // last time a call to `SetOrgPolicy` was made for that `Policy`. Any 1715 // value set by the client will be ignored. 1716 UpdateTime string `json:"updateTime,omitempty"` 1717 1718 // Version: Version of the `Policy`. Default version is 0; 1719 Version int64 `json:"version,omitempty"` 1720 1721 // ServerResponse contains the HTTP response code and headers from the 1722 // server. 1723 googleapi.ServerResponse `json:"-"` 1724 1725 // ForceSendFields is a list of field names (e.g. "BooleanPolicy") to 1726 // unconditionally include in API requests. By default, fields with 1727 // empty or default values are omitted from API requests. However, any 1728 // non-pointer, non-interface field appearing in ForceSendFields will be 1729 // sent to the server regardless of whether the field is empty or not. 1730 // This may be used to include empty fields in Patch requests. 1731 ForceSendFields []string `json:"-"` 1732 1733 // NullFields is a list of field names (e.g. "BooleanPolicy") to include 1734 // in API requests with the JSON null value. By default, fields with 1735 // empty values are omitted from API requests. However, any field with 1736 // an empty value appearing in NullFields will be sent to the server as 1737 // null. It is an error if a field in this list has a non-empty value. 1738 // This may be used to include null fields in Patch requests. 1739 NullFields []string `json:"-"` 1740} 1741 1742func (s *OrgPolicy) MarshalJSON() ([]byte, error) { 1743 type NoMethod OrgPolicy 1744 raw := NoMethod(*s) 1745 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1746} 1747 1748// Organization: The root node in the resource hierarchy to which a 1749// particular entity's (e.g., company) resources belong. 1750type Organization struct { 1751 // CreationTime: Timestamp when the Organization was created. Assigned 1752 // by the server. 1753 CreationTime string `json:"creationTime,omitempty"` 1754 1755 // DisplayName: A human-readable string that refers to the Organization 1756 // in the GCP Console UI. This string is set by the server and cannot be 1757 // changed. The string will be set to the primary domain (for example, 1758 // "google.com") of the G Suite customer that owns the organization. 1759 DisplayName string `json:"displayName,omitempty"` 1760 1761 // LifecycleState: The organization's current lifecycle state. Assigned 1762 // by the server. 1763 // 1764 // Possible values: 1765 // "LIFECYCLE_STATE_UNSPECIFIED" - Unspecified state. This is only 1766 // useful for distinguishing unset values. 1767 // "ACTIVE" - The normal and active state. 1768 // "DELETE_REQUESTED" - The organization has been marked for deletion 1769 // by the user. 1770 LifecycleState string `json:"lifecycleState,omitempty"` 1771 1772 // Name: Output only. The resource name of the organization. This is the 1773 // organization's relative path in the API. Its format is 1774 // "organizations/[organization_id]". For example, "organizations/1234". 1775 Name string `json:"name,omitempty"` 1776 1777 // Owner: The owner of this Organization. The owner should be specified 1778 // on creation. Once set, it cannot be changed. This field is required. 1779 Owner *OrganizationOwner `json:"owner,omitempty"` 1780 1781 // ServerResponse contains the HTTP response code and headers from the 1782 // server. 1783 googleapi.ServerResponse `json:"-"` 1784 1785 // ForceSendFields is a list of field names (e.g. "CreationTime") to 1786 // unconditionally include in API requests. By default, fields with 1787 // empty or default values are omitted from API requests. However, any 1788 // non-pointer, non-interface field appearing in ForceSendFields will be 1789 // sent to the server regardless of whether the field is empty or not. 1790 // This may be used to include empty fields in Patch requests. 1791 ForceSendFields []string `json:"-"` 1792 1793 // NullFields is a list of field names (e.g. "CreationTime") to include 1794 // in API requests with the JSON null value. By default, fields with 1795 // empty values are omitted from API requests. However, any field with 1796 // an empty value appearing in NullFields will be sent to the server as 1797 // null. It is an error if a field in this list has a non-empty value. 1798 // This may be used to include null fields in Patch requests. 1799 NullFields []string `json:"-"` 1800} 1801 1802func (s *Organization) MarshalJSON() ([]byte, error) { 1803 type NoMethod Organization 1804 raw := NoMethod(*s) 1805 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1806} 1807 1808// OrganizationOwner: The entity that owns an Organization. The lifetime 1809// of the Organization and all of its descendants are bound to the 1810// `OrganizationOwner`. If the `OrganizationOwner` is deleted, the 1811// Organization and all its descendants will be deleted. 1812type OrganizationOwner struct { 1813 // DirectoryCustomerId: The G Suite customer id used in the Directory 1814 // API. 1815 DirectoryCustomerId string `json:"directoryCustomerId,omitempty"` 1816 1817 // ForceSendFields is a list of field names (e.g. "DirectoryCustomerId") 1818 // to unconditionally include in API requests. By default, fields with 1819 // empty or default values are omitted from API requests. However, any 1820 // non-pointer, non-interface field appearing in ForceSendFields will be 1821 // sent to the server regardless of whether the field is empty or not. 1822 // This may be used to include empty fields in Patch requests. 1823 ForceSendFields []string `json:"-"` 1824 1825 // NullFields is a list of field names (e.g. "DirectoryCustomerId") to 1826 // include in API requests with the JSON null value. By default, fields 1827 // with empty values are omitted from API requests. However, any field 1828 // with an empty value appearing in NullFields will be sent to the 1829 // server as null. It is an error if a field in this list has a 1830 // non-empty value. This may be used to include null fields in Patch 1831 // requests. 1832 NullFields []string `json:"-"` 1833} 1834 1835func (s *OrganizationOwner) MarshalJSON() ([]byte, error) { 1836 type NoMethod OrganizationOwner 1837 raw := NoMethod(*s) 1838 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1839} 1840 1841// Policy: An Identity and Access Management (IAM) policy, which 1842// specifies access controls for Google Cloud resources. A `Policy` is a 1843// collection of `bindings`. A `binding` binds one or more `members` to 1844// a single `role`. Members can be user accounts, service accounts, 1845// Google groups, and domains (such as G Suite). A `role` is a named 1846// list of permissions; each `role` can be an IAM predefined role or a 1847// user-created custom role. For some types of Google Cloud resources, a 1848// `binding` can also specify a `condition`, which is a logical 1849// expression that allows access to a resource only if the expression 1850// evaluates to `true`. A condition can add constraints based on 1851// attributes of the request, the resource, or both. To learn which 1852// resources support conditions in their IAM policies, see the IAM 1853// documentation 1854// (https://cloud.google.com/iam/help/conditions/resource-policies). 1855// **JSON example:** { "bindings": [ { "role": 1856// "roles/resourcemanager.organizationAdmin", "members": [ 1857// "user:mike@example.com", "group:admins@example.com", 1858// "domain:google.com", 1859// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { 1860// "role": "roles/resourcemanager.organizationViewer", "members": [ 1861// "user:eve@example.com" ], "condition": { "title": "expirable access", 1862// "description": "Does not grant access after Sep 2020", "expression": 1863// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], 1864// "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - 1865// members: - user:mike@example.com - group:admins@example.com - 1866// domain:google.com - 1867// serviceAccount:my-project-id@appspot.gserviceaccount.com role: 1868// roles/resourcemanager.organizationAdmin - members: - 1869// user:eve@example.com role: roles/resourcemanager.organizationViewer 1870// condition: title: expirable access description: Does not grant access 1871// after Sep 2020 expression: request.time < 1872// timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 1873// For a description of IAM and its features, see the IAM documentation 1874// (https://cloud.google.com/iam/docs/). 1875type Policy struct { 1876 // AuditConfigs: Specifies cloud audit logging configuration for this 1877 // policy. 1878 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"` 1879 1880 // Bindings: Associates a list of `members` to a `role`. Optionally, may 1881 // specify a `condition` that determines how and when the `bindings` are 1882 // applied. Each of the `bindings` must contain at least one member. 1883 Bindings []*Binding `json:"bindings,omitempty"` 1884 1885 // Etag: `etag` is used for optimistic concurrency control as a way to 1886 // help prevent simultaneous updates of a policy from overwriting each 1887 // other. It is strongly suggested that systems make use of the `etag` 1888 // in the read-modify-write cycle to perform policy updates in order to 1889 // avoid race conditions: An `etag` is returned in the response to 1890 // `getIamPolicy`, and systems are expected to put that etag in the 1891 // request to `setIamPolicy` to ensure that their change will be applied 1892 // to the same version of the policy. **Important:** If you use IAM 1893 // Conditions, you must include the `etag` field whenever you call 1894 // `setIamPolicy`. If you omit this field, then IAM allows you to 1895 // overwrite a version `3` policy with a version `1` policy, and all of 1896 // the conditions in the version `3` policy are lost. 1897 Etag string `json:"etag,omitempty"` 1898 1899 // Version: Specifies the format of the policy. Valid values are `0`, 1900 // `1`, and `3`. Requests that specify an invalid value are rejected. 1901 // Any operation that affects conditional role bindings must specify 1902 // version `3`. This requirement applies to the following operations: * 1903 // Getting a policy that includes a conditional role binding * Adding a 1904 // conditional role binding to a policy * Changing a conditional role 1905 // binding in a policy * Removing any role binding, with or without a 1906 // condition, from a policy that includes conditions **Important:** If 1907 // you use IAM Conditions, you must include the `etag` field whenever 1908 // you call `setIamPolicy`. If you omit this field, then IAM allows you 1909 // to overwrite a version `3` policy with a version `1` policy, and all 1910 // of the conditions in the version `3` policy are lost. If a policy 1911 // does not include any conditions, operations on that policy may 1912 // specify any valid version or leave the field unset. To learn which 1913 // resources support conditions in their IAM policies, see the IAM 1914 // documentation 1915 // (https://cloud.google.com/iam/help/conditions/resource-policies). 1916 Version int64 `json:"version,omitempty"` 1917 1918 // ServerResponse contains the HTTP response code and headers from the 1919 // server. 1920 googleapi.ServerResponse `json:"-"` 1921 1922 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to 1923 // unconditionally include in API requests. By default, fields with 1924 // empty or default values are omitted from API requests. However, any 1925 // non-pointer, non-interface field appearing in ForceSendFields will be 1926 // sent to the server regardless of whether the field is empty or not. 1927 // This may be used to include empty fields in Patch requests. 1928 ForceSendFields []string `json:"-"` 1929 1930 // NullFields is a list of field names (e.g. "AuditConfigs") to include 1931 // in API requests with the JSON null value. By default, fields with 1932 // empty values are omitted from API requests. However, any field with 1933 // an empty value appearing in NullFields will be sent to the server as 1934 // null. It is an error if a field in this list has a non-empty value. 1935 // This may be used to include null fields in Patch requests. 1936 NullFields []string `json:"-"` 1937} 1938 1939func (s *Policy) MarshalJSON() ([]byte, error) { 1940 type NoMethod Policy 1941 raw := NoMethod(*s) 1942 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1943} 1944 1945// Project: A Project is a high-level Google Cloud Platform entity. It 1946// is a container for ACLs, APIs, App Engine Apps, VMs, and other Google 1947// Cloud Platform resources. 1948type Project struct { 1949 // CreateTime: Creation time. Read-only. 1950 CreateTime string `json:"createTime,omitempty"` 1951 1952 // Labels: The labels associated with this Project. Label keys must be 1953 // between 1 and 63 characters long and must conform to the following 1954 // regular expression: a-z{0,62}. Label values must be between 0 and 63 1955 // characters long and must conform to the regular expression 1956 // [a-z0-9_-]{0,63}. A label value can be empty. No more than 256 labels 1957 // can be associated with a given resource. Clients should store labels 1958 // in a representation such as JSON that does not depend on specific 1959 // characters being disallowed. Example: "environment" : "dev" 1960 // Read-write. 1961 Labels map[string]string `json:"labels,omitempty"` 1962 1963 // LifecycleState: The Project lifecycle state. Read-only. 1964 // 1965 // Possible values: 1966 // "LIFECYCLE_STATE_UNSPECIFIED" - Unspecified state. This is only 1967 // used/useful for distinguishing unset values. 1968 // "ACTIVE" - The normal and active state. 1969 // "DELETE_REQUESTED" - The project has been marked for deletion by 1970 // the user (by invoking DeleteProject) or by the system (Google Cloud 1971 // Platform). This can generally be reversed by invoking 1972 // UndeleteProject. 1973 // "DELETE_IN_PROGRESS" - This lifecycle state is no longer used and 1974 // not returned by the API. 1975 LifecycleState string `json:"lifecycleState,omitempty"` 1976 1977 // Name: The optional user-assigned display name of the Project. When 1978 // present it must be between 4 to 30 characters. Allowed characters 1979 // are: lowercase and uppercase letters, numbers, hyphen, single-quote, 1980 // double-quote, space, and exclamation point. Example: `My Project` 1981 // Read-write. 1982 Name string `json:"name,omitempty"` 1983 1984 // Parent: An optional reference to a parent Resource. Supported parent 1985 // types include "organization" and "folder". Once set, the parent 1986 // cannot be cleared. The `parent` can be set on creation or using the 1987 // `UpdateProject` method; the end user must have the 1988 // `resourcemanager.projects.create` permission on the parent. 1989 Parent *ResourceId `json:"parent,omitempty"` 1990 1991 // ProjectId: The unique, user-assigned ID of the Project. It must be 6 1992 // to 30 lowercase letters, digits, or hyphens. It must start with a 1993 // letter. Trailing hyphens are prohibited. Example: `tokyo-rain-123` 1994 // Read-only after creation. 1995 ProjectId string `json:"projectId,omitempty"` 1996 1997 // ProjectNumber: The number uniquely identifying the project. Example: 1998 // `415104041262` Read-only. 1999 ProjectNumber int64 `json:"projectNumber,omitempty,string"` 2000 2001 // ServerResponse contains the HTTP response code and headers from the 2002 // server. 2003 googleapi.ServerResponse `json:"-"` 2004 2005 // ForceSendFields is a list of field names (e.g. "CreateTime") to 2006 // unconditionally include in API requests. By default, fields with 2007 // empty or default values are omitted from API requests. However, any 2008 // non-pointer, non-interface field appearing in ForceSendFields will be 2009 // sent to the server regardless of whether the field is empty or not. 2010 // This may be used to include empty fields in Patch requests. 2011 ForceSendFields []string `json:"-"` 2012 2013 // NullFields is a list of field names (e.g. "CreateTime") to include in 2014 // API requests with the JSON null value. By default, fields with empty 2015 // values are omitted from API requests. However, any field with an 2016 // empty value appearing in NullFields will be sent to the server as 2017 // null. It is an error if a field in this list has a non-empty value. 2018 // This may be used to include null fields in Patch requests. 2019 NullFields []string `json:"-"` 2020} 2021 2022func (s *Project) MarshalJSON() ([]byte, error) { 2023 type NoMethod Project 2024 raw := NoMethod(*s) 2025 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2026} 2027 2028// ProjectCreationStatus: A status object which is used as the 2029// `metadata` field for the Operation returned by CreateProject. It 2030// provides insight for when significant phases of Project creation have 2031// completed. 2032type ProjectCreationStatus struct { 2033 // CreateTime: Creation time of the project creation workflow. 2034 CreateTime string `json:"createTime,omitempty"` 2035 2036 // Gettable: True if the project can be retrieved using GetProject. No 2037 // other operations on the project are guaranteed to work until the 2038 // project creation is complete. 2039 Gettable bool `json:"gettable,omitempty"` 2040 2041 // Ready: True if the project creation process is complete. 2042 Ready bool `json:"ready,omitempty"` 2043 2044 // ForceSendFields is a list of field names (e.g. "CreateTime") to 2045 // unconditionally include in API requests. By default, fields with 2046 // empty or default values are omitted from API requests. However, any 2047 // non-pointer, non-interface field appearing in ForceSendFields will be 2048 // sent to the server regardless of whether the field is empty or not. 2049 // This may be used to include empty fields in Patch requests. 2050 ForceSendFields []string `json:"-"` 2051 2052 // NullFields is a list of field names (e.g. "CreateTime") to include in 2053 // API requests with the JSON null value. By default, fields with empty 2054 // values are omitted from API requests. However, any field with an 2055 // empty value appearing in NullFields will be sent to the server as 2056 // null. It is an error if a field in this list has a non-empty value. 2057 // This may be used to include null fields in Patch requests. 2058 NullFields []string `json:"-"` 2059} 2060 2061func (s *ProjectCreationStatus) MarshalJSON() ([]byte, error) { 2062 type NoMethod ProjectCreationStatus 2063 raw := NoMethod(*s) 2064 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2065} 2066 2067// ResourceId: A container to reference an id for any resource type. A 2068// `resource` in Google Cloud Platform is a generic term for something 2069// you (a developer) may want to interact with through one of our API's. 2070// Some examples are an App Engine app, a Compute Engine instance, a 2071// Cloud SQL database, and so on. 2072type ResourceId struct { 2073 // Id: The type-specific id. This should correspond to the id used in 2074 // the type-specific API's. 2075 Id string `json:"id,omitempty"` 2076 2077 // Type: The resource type this id is for. At present, the valid types 2078 // are: "organization", "folder", and "project". 2079 Type string `json:"type,omitempty"` 2080 2081 // ForceSendFields is a list of field names (e.g. "Id") to 2082 // unconditionally include in API requests. By default, fields with 2083 // empty or default values are omitted from API requests. However, any 2084 // non-pointer, non-interface field appearing in ForceSendFields will be 2085 // sent to the server regardless of whether the field is empty or not. 2086 // This may be used to include empty fields in Patch requests. 2087 ForceSendFields []string `json:"-"` 2088 2089 // NullFields is a list of field names (e.g. "Id") to include in API 2090 // requests with the JSON null value. By default, fields with empty 2091 // values are omitted from API requests. However, any field with an 2092 // empty value appearing in NullFields will be sent to the server as 2093 // null. It is an error if a field in this list has a non-empty value. 2094 // This may be used to include null fields in Patch requests. 2095 NullFields []string `json:"-"` 2096} 2097 2098func (s *ResourceId) MarshalJSON() ([]byte, error) { 2099 type NoMethod ResourceId 2100 raw := NoMethod(*s) 2101 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2102} 2103 2104// RestoreDefault: Ignores policies set above this resource and restores 2105// the `constraint_default` enforcement behavior of the specific 2106// `Constraint` at this resource. Suppose that `constraint_default` is 2107// set to `ALLOW` for the `Constraint` 2108// `constraints/serviceuser.services`. Suppose that organization foo.com 2109// sets a `Policy` at their Organization resource node that restricts 2110// the allowed service activations to deny all service activations. They 2111// could then set a `Policy` with the `policy_type` `restore_default` on 2112// several experimental projects, restoring the `constraint_default` 2113// enforcement of the `Constraint` for only those projects, allowing 2114// those projects to have all services activated. 2115type RestoreDefault struct { 2116} 2117 2118// SearchOrganizationsRequest: The request sent to the 2119// `SearchOrganizations` method. 2120type SearchOrganizationsRequest struct { 2121 // Filter: An optional query string used to filter the Organizations to 2122 // return in the response. Filter rules are case-insensitive. 2123 // Organizations may be filtered by `owner.directoryCustomerId` or by 2124 // `domain`, where the domain is a G Suite domain, for example: * Filter 2125 // `owner.directorycustomerid:123456789` returns Organization resources 2126 // with `owner.directory_customer_id` equal to `123456789`. * Filter 2127 // `domain:google.com` returns Organization resources corresponding to 2128 // the domain `google.com`. This field is optional. 2129 Filter string `json:"filter,omitempty"` 2130 2131 // PageSize: The maximum number of Organizations to return in the 2132 // response. The server can return fewer organizations than requested. 2133 // If unspecified, server picks an appropriate default. 2134 PageSize int64 `json:"pageSize,omitempty"` 2135 2136 // PageToken: A pagination token returned from a previous call to 2137 // `SearchOrganizations` that indicates from where listing should 2138 // continue. This field is optional. 2139 PageToken string `json:"pageToken,omitempty"` 2140 2141 // ForceSendFields is a list of field names (e.g. "Filter") to 2142 // unconditionally include in API requests. By default, fields with 2143 // empty or default values are omitted from API requests. However, any 2144 // non-pointer, non-interface field appearing in ForceSendFields will be 2145 // sent to the server regardless of whether the field is empty or not. 2146 // This may be used to include empty fields in Patch requests. 2147 ForceSendFields []string `json:"-"` 2148 2149 // NullFields is a list of field names (e.g. "Filter") to include in API 2150 // requests with the JSON null value. By default, fields with empty 2151 // values are omitted from API requests. However, any field with an 2152 // empty value appearing in NullFields will be sent to the server as 2153 // null. It is an error if a field in this list has a non-empty value. 2154 // This may be used to include null fields in Patch requests. 2155 NullFields []string `json:"-"` 2156} 2157 2158func (s *SearchOrganizationsRequest) MarshalJSON() ([]byte, error) { 2159 type NoMethod SearchOrganizationsRequest 2160 raw := NoMethod(*s) 2161 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2162} 2163 2164// SearchOrganizationsResponse: The response returned from the 2165// `SearchOrganizations` method. 2166type SearchOrganizationsResponse struct { 2167 // NextPageToken: A pagination token to be used to retrieve the next 2168 // page of results. If the result is too large to fit within the page 2169 // size specified in the request, this field will be set with a token 2170 // that can be used to fetch the next page of results. If this field is 2171 // empty, it indicates that this response contains the last page of 2172 // results. 2173 NextPageToken string `json:"nextPageToken,omitempty"` 2174 2175 // Organizations: The list of Organizations that matched the search 2176 // query, possibly paginated. 2177 Organizations []*Organization `json:"organizations,omitempty"` 2178 2179 // ServerResponse contains the HTTP response code and headers from the 2180 // server. 2181 googleapi.ServerResponse `json:"-"` 2182 2183 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2184 // unconditionally include in API requests. By default, fields with 2185 // empty or default values are omitted from API requests. However, any 2186 // non-pointer, non-interface field appearing in ForceSendFields will be 2187 // sent to the server regardless of whether the field is empty or not. 2188 // This may be used to include empty fields in Patch requests. 2189 ForceSendFields []string `json:"-"` 2190 2191 // NullFields is a list of field names (e.g. "NextPageToken") to include 2192 // in API requests with the JSON null value. By default, fields with 2193 // empty values are omitted from API requests. However, any field with 2194 // an empty value appearing in NullFields will be sent to the server as 2195 // null. It is an error if a field in this list has a non-empty value. 2196 // This may be used to include null fields in Patch requests. 2197 NullFields []string `json:"-"` 2198} 2199 2200func (s *SearchOrganizationsResponse) MarshalJSON() ([]byte, error) { 2201 type NoMethod SearchOrganizationsResponse 2202 raw := NoMethod(*s) 2203 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2204} 2205 2206// SetIamPolicyRequest: Request message for `SetIamPolicy` method. 2207type SetIamPolicyRequest struct { 2208 // Policy: REQUIRED: The complete policy to be applied to the 2209 // `resource`. The size of the policy is limited to a few 10s of KB. An 2210 // empty policy is a valid policy but certain Cloud Platform services 2211 // (such as Projects) might reject them. 2212 Policy *Policy `json:"policy,omitempty"` 2213 2214 // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the 2215 // policy to modify. Only the fields in the mask will be modified. If no 2216 // mask is provided, the following default mask is used: `paths: 2217 // "bindings, etag" 2218 UpdateMask string `json:"updateMask,omitempty"` 2219 2220 // ForceSendFields is a list of field names (e.g. "Policy") to 2221 // unconditionally include in API requests. By default, fields with 2222 // empty or default values are omitted from API requests. However, any 2223 // non-pointer, non-interface field appearing in ForceSendFields will be 2224 // sent to the server regardless of whether the field is empty or not. 2225 // This may be used to include empty fields in Patch requests. 2226 ForceSendFields []string `json:"-"` 2227 2228 // NullFields is a list of field names (e.g. "Policy") to include in API 2229 // requests with the JSON null value. By default, fields with empty 2230 // values are omitted from API requests. However, any field with an 2231 // empty value appearing in NullFields will be sent to the server as 2232 // null. It is an error if a field in this list has a non-empty value. 2233 // This may be used to include null fields in Patch requests. 2234 NullFields []string `json:"-"` 2235} 2236 2237func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { 2238 type NoMethod SetIamPolicyRequest 2239 raw := NoMethod(*s) 2240 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2241} 2242 2243// SetOrgPolicyRequest: The request sent to the SetOrgPolicyRequest 2244// method. 2245type SetOrgPolicyRequest struct { 2246 // Policy: `Policy` to set on the resource. 2247 Policy *OrgPolicy `json:"policy,omitempty"` 2248 2249 // ForceSendFields is a list of field names (e.g. "Policy") to 2250 // unconditionally include in API requests. By default, fields with 2251 // empty or default values are omitted from API requests. However, any 2252 // non-pointer, non-interface field appearing in ForceSendFields will be 2253 // sent to the server regardless of whether the field is empty or not. 2254 // This may be used to include empty fields in Patch requests. 2255 ForceSendFields []string `json:"-"` 2256 2257 // NullFields is a list of field names (e.g. "Policy") to include in API 2258 // requests with the JSON null value. By default, fields with empty 2259 // values are omitted from API requests. However, any field with an 2260 // empty value appearing in NullFields will be sent to the server as 2261 // null. It is an error if a field in this list has a non-empty value. 2262 // This may be used to include null fields in Patch requests. 2263 NullFields []string `json:"-"` 2264} 2265 2266func (s *SetOrgPolicyRequest) MarshalJSON() ([]byte, error) { 2267 type NoMethod SetOrgPolicyRequest 2268 raw := NoMethod(*s) 2269 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2270} 2271 2272// Status: The `Status` type defines a logical error model that is 2273// suitable for different programming environments, including REST APIs 2274// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 2275// `Status` message contains three pieces of data: error code, error 2276// message, and error details. You can find out more about this error 2277// model and how to work with it in the API Design Guide 2278// (https://cloud.google.com/apis/design/errors). 2279type Status struct { 2280 // Code: The status code, which should be an enum value of 2281 // google.rpc.Code. 2282 Code int64 `json:"code,omitempty"` 2283 2284 // Details: A list of messages that carry the error details. There is a 2285 // common set of message types for APIs to use. 2286 Details []googleapi.RawMessage `json:"details,omitempty"` 2287 2288 // Message: A developer-facing error message, which should be in 2289 // English. Any user-facing error message should be localized and sent 2290 // in the google.rpc.Status.details field, or localized by the client. 2291 Message string `json:"message,omitempty"` 2292 2293 // ForceSendFields is a list of field names (e.g. "Code") to 2294 // unconditionally include in API requests. By default, fields with 2295 // empty or default values are omitted from API requests. However, any 2296 // non-pointer, non-interface field appearing in ForceSendFields will be 2297 // sent to the server regardless of whether the field is empty or not. 2298 // This may be used to include empty fields in Patch requests. 2299 ForceSendFields []string `json:"-"` 2300 2301 // NullFields is a list of field names (e.g. "Code") to include in API 2302 // requests with the JSON null value. By default, fields with empty 2303 // values are omitted from API requests. However, any field with an 2304 // empty value appearing in NullFields will be sent to the server as 2305 // null. It is an error if a field in this list has a non-empty value. 2306 // This may be used to include null fields in Patch requests. 2307 NullFields []string `json:"-"` 2308} 2309 2310func (s *Status) MarshalJSON() ([]byte, error) { 2311 type NoMethod Status 2312 raw := NoMethod(*s) 2313 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2314} 2315 2316// TestIamPermissionsRequest: Request message for `TestIamPermissions` 2317// method. 2318type TestIamPermissionsRequest struct { 2319 // Permissions: The set of permissions to check for the `resource`. 2320 // Permissions with wildcards (such as '*' or 'storage.*') are not 2321 // allowed. For more information see IAM Overview 2322 // (https://cloud.google.com/iam/docs/overview#permissions). 2323 Permissions []string `json:"permissions,omitempty"` 2324 2325 // ForceSendFields is a list of field names (e.g. "Permissions") to 2326 // unconditionally include in API requests. By default, fields with 2327 // empty or default values are omitted from API requests. However, any 2328 // non-pointer, non-interface field appearing in ForceSendFields will be 2329 // sent to the server regardless of whether the field is empty or not. 2330 // This may be used to include empty fields in Patch requests. 2331 ForceSendFields []string `json:"-"` 2332 2333 // NullFields is a list of field names (e.g. "Permissions") to include 2334 // in API requests with the JSON null value. By default, fields with 2335 // empty values are omitted from API requests. However, any field with 2336 // an empty value appearing in NullFields will be sent to the server as 2337 // null. It is an error if a field in this list has a non-empty value. 2338 // This may be used to include null fields in Patch requests. 2339 NullFields []string `json:"-"` 2340} 2341 2342func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { 2343 type NoMethod TestIamPermissionsRequest 2344 raw := NoMethod(*s) 2345 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2346} 2347 2348// TestIamPermissionsResponse: Response message for `TestIamPermissions` 2349// method. 2350type TestIamPermissionsResponse struct { 2351 // Permissions: A subset of `TestPermissionsRequest.permissions` that 2352 // the caller is allowed. 2353 Permissions []string `json:"permissions,omitempty"` 2354 2355 // ServerResponse contains the HTTP response code and headers from the 2356 // server. 2357 googleapi.ServerResponse `json:"-"` 2358 2359 // ForceSendFields is a list of field names (e.g. "Permissions") to 2360 // unconditionally include in API requests. By default, fields with 2361 // empty or default values are omitted from API requests. However, any 2362 // non-pointer, non-interface field appearing in ForceSendFields will be 2363 // sent to the server regardless of whether the field is empty or not. 2364 // This may be used to include empty fields in Patch requests. 2365 ForceSendFields []string `json:"-"` 2366 2367 // NullFields is a list of field names (e.g. "Permissions") to include 2368 // in API requests with the JSON null value. By default, fields with 2369 // empty values are omitted from API requests. However, any field with 2370 // an empty value appearing in NullFields will be sent to the server as 2371 // null. It is an error if a field in this list has a non-empty value. 2372 // This may be used to include null fields in Patch requests. 2373 NullFields []string `json:"-"` 2374} 2375 2376func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 2377 type NoMethod TestIamPermissionsResponse 2378 raw := NoMethod(*s) 2379 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2380} 2381 2382// UndeleteFolderMetadata: A status object which is used as the 2383// `metadata` field for the `Operation` returned by `UndeleteFolder`. 2384type UndeleteFolderMetadata struct { 2385} 2386 2387// UndeleteOrganizationMetadata: A status object which is used as the 2388// `metadata` field for the Operation returned by UndeleteOrganization. 2389type UndeleteOrganizationMetadata struct { 2390} 2391 2392// UndeleteProjectMetadata: A status object which is used as the 2393// `metadata` field for the Operation returned by `UndeleteProject`. 2394type UndeleteProjectMetadata struct { 2395} 2396 2397// UndeleteProjectRequest: The request sent to the UndeleteProject 2398// method. 2399type UndeleteProjectRequest struct { 2400} 2401 2402// UpdateFolderMetadata: A status object which is used as the `metadata` 2403// field for the Operation returned by UpdateFolder. 2404type UpdateFolderMetadata struct { 2405} 2406 2407// UpdateProjectMetadata: A status object which is used as the 2408// `metadata` field for the Operation returned by UpdateProject. 2409type UpdateProjectMetadata struct { 2410} 2411 2412// UpdateTagKeyMetadata: Runtime operation information for updating a 2413// TagKey. 2414type UpdateTagKeyMetadata struct { 2415} 2416 2417// UpdateTagValueMetadata: Runtime operation information for updating a 2418// TagValue. 2419type UpdateTagValueMetadata struct { 2420} 2421 2422// method id "cloudresourcemanager.folders.clearOrgPolicy": 2423 2424type FoldersClearOrgPolicyCall struct { 2425 s *Service 2426 resource string 2427 clearorgpolicyrequest *ClearOrgPolicyRequest 2428 urlParams_ gensupport.URLParams 2429 ctx_ context.Context 2430 header_ http.Header 2431} 2432 2433// ClearOrgPolicy: Clears a `Policy` from a resource. 2434// 2435// - resource: Name of the resource for the `Policy` to clear. 2436func (r *FoldersService) ClearOrgPolicy(resource string, clearorgpolicyrequest *ClearOrgPolicyRequest) *FoldersClearOrgPolicyCall { 2437 c := &FoldersClearOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2438 c.resource = resource 2439 c.clearorgpolicyrequest = clearorgpolicyrequest 2440 return c 2441} 2442 2443// Fields allows partial responses to be retrieved. See 2444// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2445// for more information. 2446func (c *FoldersClearOrgPolicyCall) Fields(s ...googleapi.Field) *FoldersClearOrgPolicyCall { 2447 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2448 return c 2449} 2450 2451// Context sets the context to be used in this call's Do method. Any 2452// pending HTTP request will be aborted if the provided context is 2453// canceled. 2454func (c *FoldersClearOrgPolicyCall) Context(ctx context.Context) *FoldersClearOrgPolicyCall { 2455 c.ctx_ = ctx 2456 return c 2457} 2458 2459// Header returns an http.Header that can be modified by the caller to 2460// add HTTP headers to the request. 2461func (c *FoldersClearOrgPolicyCall) Header() http.Header { 2462 if c.header_ == nil { 2463 c.header_ = make(http.Header) 2464 } 2465 return c.header_ 2466} 2467 2468func (c *FoldersClearOrgPolicyCall) doRequest(alt string) (*http.Response, error) { 2469 reqHeaders := make(http.Header) 2470 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 2471 for k, v := range c.header_ { 2472 reqHeaders[k] = v 2473 } 2474 reqHeaders.Set("User-Agent", c.s.userAgent()) 2475 var body io.Reader = nil 2476 body, err := googleapi.WithoutDataWrapper.JSONReader(c.clearorgpolicyrequest) 2477 if err != nil { 2478 return nil, err 2479 } 2480 reqHeaders.Set("Content-Type", "application/json") 2481 c.urlParams_.Set("alt", alt) 2482 c.urlParams_.Set("prettyPrint", "false") 2483 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:clearOrgPolicy") 2484 urls += "?" + c.urlParams_.Encode() 2485 req, err := http.NewRequest("POST", urls, body) 2486 if err != nil { 2487 return nil, err 2488 } 2489 req.Header = reqHeaders 2490 googleapi.Expand(req.URL, map[string]string{ 2491 "resource": c.resource, 2492 }) 2493 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2494} 2495 2496// Do executes the "cloudresourcemanager.folders.clearOrgPolicy" call. 2497// Exactly one of *Empty or error will be non-nil. Any non-2xx status 2498// code is an error. Response headers are in either 2499// *Empty.ServerResponse.Header or (if a response was returned at all) 2500// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2501// check whether the returned error was because http.StatusNotModified 2502// was returned. 2503func (c *FoldersClearOrgPolicyCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 2504 gensupport.SetOptions(c.urlParams_, opts...) 2505 res, err := c.doRequest("json") 2506 if res != nil && res.StatusCode == http.StatusNotModified { 2507 if res.Body != nil { 2508 res.Body.Close() 2509 } 2510 return nil, &googleapi.Error{ 2511 Code: res.StatusCode, 2512 Header: res.Header, 2513 } 2514 } 2515 if err != nil { 2516 return nil, err 2517 } 2518 defer googleapi.CloseBody(res) 2519 if err := googleapi.CheckResponse(res); err != nil { 2520 return nil, err 2521 } 2522 ret := &Empty{ 2523 ServerResponse: googleapi.ServerResponse{ 2524 Header: res.Header, 2525 HTTPStatusCode: res.StatusCode, 2526 }, 2527 } 2528 target := &ret 2529 if err := gensupport.DecodeResponse(target, res); err != nil { 2530 return nil, err 2531 } 2532 return ret, nil 2533 // { 2534 // "description": "Clears a `Policy` from a resource.", 2535 // "flatPath": "v1/folders/{foldersId}:clearOrgPolicy", 2536 // "httpMethod": "POST", 2537 // "id": "cloudresourcemanager.folders.clearOrgPolicy", 2538 // "parameterOrder": [ 2539 // "resource" 2540 // ], 2541 // "parameters": { 2542 // "resource": { 2543 // "description": "Name of the resource for the `Policy` to clear.", 2544 // "location": "path", 2545 // "pattern": "^folders/[^/]+$", 2546 // "required": true, 2547 // "type": "string" 2548 // } 2549 // }, 2550 // "path": "v1/{+resource}:clearOrgPolicy", 2551 // "request": { 2552 // "$ref": "ClearOrgPolicyRequest" 2553 // }, 2554 // "response": { 2555 // "$ref": "Empty" 2556 // }, 2557 // "scopes": [ 2558 // "https://www.googleapis.com/auth/cloud-platform" 2559 // ] 2560 // } 2561 2562} 2563 2564// method id "cloudresourcemanager.folders.getEffectiveOrgPolicy": 2565 2566type FoldersGetEffectiveOrgPolicyCall struct { 2567 s *Service 2568 resource string 2569 geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest 2570 urlParams_ gensupport.URLParams 2571 ctx_ context.Context 2572 header_ http.Header 2573} 2574 2575// GetEffectiveOrgPolicy: Gets the effective `Policy` on a resource. 2576// This is the result of merging `Policies` in the resource hierarchy. 2577// The returned `Policy` will not have an `etag`set because it is a 2578// computed `Policy` across multiple resources. Subtrees of Resource 2579// Manager resource hierarchy with 'under:' prefix will not be expanded. 2580// 2581// - resource: The name of the resource to start computing the effective 2582// `Policy`. 2583func (r *FoldersService) GetEffectiveOrgPolicy(resource string, geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest) *FoldersGetEffectiveOrgPolicyCall { 2584 c := &FoldersGetEffectiveOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2585 c.resource = resource 2586 c.geteffectiveorgpolicyrequest = geteffectiveorgpolicyrequest 2587 return c 2588} 2589 2590// Fields allows partial responses to be retrieved. See 2591// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2592// for more information. 2593func (c *FoldersGetEffectiveOrgPolicyCall) Fields(s ...googleapi.Field) *FoldersGetEffectiveOrgPolicyCall { 2594 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2595 return c 2596} 2597 2598// Context sets the context to be used in this call's Do method. Any 2599// pending HTTP request will be aborted if the provided context is 2600// canceled. 2601func (c *FoldersGetEffectiveOrgPolicyCall) Context(ctx context.Context) *FoldersGetEffectiveOrgPolicyCall { 2602 c.ctx_ = ctx 2603 return c 2604} 2605 2606// Header returns an http.Header that can be modified by the caller to 2607// add HTTP headers to the request. 2608func (c *FoldersGetEffectiveOrgPolicyCall) Header() http.Header { 2609 if c.header_ == nil { 2610 c.header_ = make(http.Header) 2611 } 2612 return c.header_ 2613} 2614 2615func (c *FoldersGetEffectiveOrgPolicyCall) doRequest(alt string) (*http.Response, error) { 2616 reqHeaders := make(http.Header) 2617 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 2618 for k, v := range c.header_ { 2619 reqHeaders[k] = v 2620 } 2621 reqHeaders.Set("User-Agent", c.s.userAgent()) 2622 var body io.Reader = nil 2623 body, err := googleapi.WithoutDataWrapper.JSONReader(c.geteffectiveorgpolicyrequest) 2624 if err != nil { 2625 return nil, err 2626 } 2627 reqHeaders.Set("Content-Type", "application/json") 2628 c.urlParams_.Set("alt", alt) 2629 c.urlParams_.Set("prettyPrint", "false") 2630 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getEffectiveOrgPolicy") 2631 urls += "?" + c.urlParams_.Encode() 2632 req, err := http.NewRequest("POST", urls, body) 2633 if err != nil { 2634 return nil, err 2635 } 2636 req.Header = reqHeaders 2637 googleapi.Expand(req.URL, map[string]string{ 2638 "resource": c.resource, 2639 }) 2640 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2641} 2642 2643// Do executes the "cloudresourcemanager.folders.getEffectiveOrgPolicy" call. 2644// Exactly one of *OrgPolicy or error will be non-nil. Any non-2xx 2645// status code is an error. Response headers are in either 2646// *OrgPolicy.ServerResponse.Header or (if a response was returned at 2647// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2648// to check whether the returned error was because 2649// http.StatusNotModified was returned. 2650func (c *FoldersGetEffectiveOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) { 2651 gensupport.SetOptions(c.urlParams_, opts...) 2652 res, err := c.doRequest("json") 2653 if res != nil && res.StatusCode == http.StatusNotModified { 2654 if res.Body != nil { 2655 res.Body.Close() 2656 } 2657 return nil, &googleapi.Error{ 2658 Code: res.StatusCode, 2659 Header: res.Header, 2660 } 2661 } 2662 if err != nil { 2663 return nil, err 2664 } 2665 defer googleapi.CloseBody(res) 2666 if err := googleapi.CheckResponse(res); err != nil { 2667 return nil, err 2668 } 2669 ret := &OrgPolicy{ 2670 ServerResponse: googleapi.ServerResponse{ 2671 Header: res.Header, 2672 HTTPStatusCode: res.StatusCode, 2673 }, 2674 } 2675 target := &ret 2676 if err := gensupport.DecodeResponse(target, res); err != nil { 2677 return nil, err 2678 } 2679 return ret, nil 2680 // { 2681 // "description": "Gets the effective `Policy` on a resource. This is the result of merging `Policies` in the resource hierarchy. The returned `Policy` will not have an `etag`set because it is a computed `Policy` across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be expanded.", 2682 // "flatPath": "v1/folders/{foldersId}:getEffectiveOrgPolicy", 2683 // "httpMethod": "POST", 2684 // "id": "cloudresourcemanager.folders.getEffectiveOrgPolicy", 2685 // "parameterOrder": [ 2686 // "resource" 2687 // ], 2688 // "parameters": { 2689 // "resource": { 2690 // "description": "The name of the resource to start computing the effective `Policy`.", 2691 // "location": "path", 2692 // "pattern": "^folders/[^/]+$", 2693 // "required": true, 2694 // "type": "string" 2695 // } 2696 // }, 2697 // "path": "v1/{+resource}:getEffectiveOrgPolicy", 2698 // "request": { 2699 // "$ref": "GetEffectiveOrgPolicyRequest" 2700 // }, 2701 // "response": { 2702 // "$ref": "OrgPolicy" 2703 // }, 2704 // "scopes": [ 2705 // "https://www.googleapis.com/auth/cloud-platform", 2706 // "https://www.googleapis.com/auth/cloud-platform.read-only" 2707 // ] 2708 // } 2709 2710} 2711 2712// method id "cloudresourcemanager.folders.getOrgPolicy": 2713 2714type FoldersGetOrgPolicyCall struct { 2715 s *Service 2716 resource string 2717 getorgpolicyrequest *GetOrgPolicyRequest 2718 urlParams_ gensupport.URLParams 2719 ctx_ context.Context 2720 header_ http.Header 2721} 2722 2723// GetOrgPolicy: Gets a `Policy` on a resource. If no `Policy` is set on 2724// the resource, a `Policy` is returned with default values including 2725// `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value 2726// can be used with `SetOrgPolicy()` to create or update a `Policy` 2727// during read-modify-write. 2728// 2729// - resource: Name of the resource the `Policy` is set on. 2730func (r *FoldersService) GetOrgPolicy(resource string, getorgpolicyrequest *GetOrgPolicyRequest) *FoldersGetOrgPolicyCall { 2731 c := &FoldersGetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2732 c.resource = resource 2733 c.getorgpolicyrequest = getorgpolicyrequest 2734 return c 2735} 2736 2737// Fields allows partial responses to be retrieved. See 2738// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2739// for more information. 2740func (c *FoldersGetOrgPolicyCall) Fields(s ...googleapi.Field) *FoldersGetOrgPolicyCall { 2741 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2742 return c 2743} 2744 2745// Context sets the context to be used in this call's Do method. Any 2746// pending HTTP request will be aborted if the provided context is 2747// canceled. 2748func (c *FoldersGetOrgPolicyCall) Context(ctx context.Context) *FoldersGetOrgPolicyCall { 2749 c.ctx_ = ctx 2750 return c 2751} 2752 2753// Header returns an http.Header that can be modified by the caller to 2754// add HTTP headers to the request. 2755func (c *FoldersGetOrgPolicyCall) Header() http.Header { 2756 if c.header_ == nil { 2757 c.header_ = make(http.Header) 2758 } 2759 return c.header_ 2760} 2761 2762func (c *FoldersGetOrgPolicyCall) doRequest(alt string) (*http.Response, error) { 2763 reqHeaders := make(http.Header) 2764 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 2765 for k, v := range c.header_ { 2766 reqHeaders[k] = v 2767 } 2768 reqHeaders.Set("User-Agent", c.s.userAgent()) 2769 var body io.Reader = nil 2770 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getorgpolicyrequest) 2771 if err != nil { 2772 return nil, err 2773 } 2774 reqHeaders.Set("Content-Type", "application/json") 2775 c.urlParams_.Set("alt", alt) 2776 c.urlParams_.Set("prettyPrint", "false") 2777 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getOrgPolicy") 2778 urls += "?" + c.urlParams_.Encode() 2779 req, err := http.NewRequest("POST", urls, body) 2780 if err != nil { 2781 return nil, err 2782 } 2783 req.Header = reqHeaders 2784 googleapi.Expand(req.URL, map[string]string{ 2785 "resource": c.resource, 2786 }) 2787 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2788} 2789 2790// Do executes the "cloudresourcemanager.folders.getOrgPolicy" call. 2791// Exactly one of *OrgPolicy or error will be non-nil. Any non-2xx 2792// status code is an error. Response headers are in either 2793// *OrgPolicy.ServerResponse.Header or (if a response was returned at 2794// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2795// to check whether the returned error was because 2796// http.StatusNotModified was returned. 2797func (c *FoldersGetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) { 2798 gensupport.SetOptions(c.urlParams_, opts...) 2799 res, err := c.doRequest("json") 2800 if res != nil && res.StatusCode == http.StatusNotModified { 2801 if res.Body != nil { 2802 res.Body.Close() 2803 } 2804 return nil, &googleapi.Error{ 2805 Code: res.StatusCode, 2806 Header: res.Header, 2807 } 2808 } 2809 if err != nil { 2810 return nil, err 2811 } 2812 defer googleapi.CloseBody(res) 2813 if err := googleapi.CheckResponse(res); err != nil { 2814 return nil, err 2815 } 2816 ret := &OrgPolicy{ 2817 ServerResponse: googleapi.ServerResponse{ 2818 Header: res.Header, 2819 HTTPStatusCode: res.StatusCode, 2820 }, 2821 } 2822 target := &ret 2823 if err := gensupport.DecodeResponse(target, res); err != nil { 2824 return nil, err 2825 } 2826 return ret, nil 2827 // { 2828 // "description": "Gets a `Policy` on a resource. If no `Policy` is set on the resource, a `Policy` is returned with default values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can be used with `SetOrgPolicy()` to create or update a `Policy` during read-modify-write.", 2829 // "flatPath": "v1/folders/{foldersId}:getOrgPolicy", 2830 // "httpMethod": "POST", 2831 // "id": "cloudresourcemanager.folders.getOrgPolicy", 2832 // "parameterOrder": [ 2833 // "resource" 2834 // ], 2835 // "parameters": { 2836 // "resource": { 2837 // "description": "Name of the resource the `Policy` is set on.", 2838 // "location": "path", 2839 // "pattern": "^folders/[^/]+$", 2840 // "required": true, 2841 // "type": "string" 2842 // } 2843 // }, 2844 // "path": "v1/{+resource}:getOrgPolicy", 2845 // "request": { 2846 // "$ref": "GetOrgPolicyRequest" 2847 // }, 2848 // "response": { 2849 // "$ref": "OrgPolicy" 2850 // }, 2851 // "scopes": [ 2852 // "https://www.googleapis.com/auth/cloud-platform", 2853 // "https://www.googleapis.com/auth/cloud-platform.read-only" 2854 // ] 2855 // } 2856 2857} 2858 2859// method id "cloudresourcemanager.folders.listAvailableOrgPolicyConstraints": 2860 2861type FoldersListAvailableOrgPolicyConstraintsCall struct { 2862 s *Service 2863 resource string 2864 listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest 2865 urlParams_ gensupport.URLParams 2866 ctx_ context.Context 2867 header_ http.Header 2868} 2869 2870// ListAvailableOrgPolicyConstraints: Lists `Constraints` that could be 2871// applied on the specified resource. 2872// 2873// - resource: Name of the resource to list `Constraints` for. 2874func (r *FoldersService) ListAvailableOrgPolicyConstraints(resource string, listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest) *FoldersListAvailableOrgPolicyConstraintsCall { 2875 c := &FoldersListAvailableOrgPolicyConstraintsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2876 c.resource = resource 2877 c.listavailableorgpolicyconstraintsrequest = listavailableorgpolicyconstraintsrequest 2878 return c 2879} 2880 2881// Fields allows partial responses to be retrieved. See 2882// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2883// for more information. 2884func (c *FoldersListAvailableOrgPolicyConstraintsCall) Fields(s ...googleapi.Field) *FoldersListAvailableOrgPolicyConstraintsCall { 2885 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2886 return c 2887} 2888 2889// Context sets the context to be used in this call's Do method. Any 2890// pending HTTP request will be aborted if the provided context is 2891// canceled. 2892func (c *FoldersListAvailableOrgPolicyConstraintsCall) Context(ctx context.Context) *FoldersListAvailableOrgPolicyConstraintsCall { 2893 c.ctx_ = ctx 2894 return c 2895} 2896 2897// Header returns an http.Header that can be modified by the caller to 2898// add HTTP headers to the request. 2899func (c *FoldersListAvailableOrgPolicyConstraintsCall) Header() http.Header { 2900 if c.header_ == nil { 2901 c.header_ = make(http.Header) 2902 } 2903 return c.header_ 2904} 2905 2906func (c *FoldersListAvailableOrgPolicyConstraintsCall) doRequest(alt string) (*http.Response, error) { 2907 reqHeaders := make(http.Header) 2908 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 2909 for k, v := range c.header_ { 2910 reqHeaders[k] = v 2911 } 2912 reqHeaders.Set("User-Agent", c.s.userAgent()) 2913 var body io.Reader = nil 2914 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listavailableorgpolicyconstraintsrequest) 2915 if err != nil { 2916 return nil, err 2917 } 2918 reqHeaders.Set("Content-Type", "application/json") 2919 c.urlParams_.Set("alt", alt) 2920 c.urlParams_.Set("prettyPrint", "false") 2921 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listAvailableOrgPolicyConstraints") 2922 urls += "?" + c.urlParams_.Encode() 2923 req, err := http.NewRequest("POST", urls, body) 2924 if err != nil { 2925 return nil, err 2926 } 2927 req.Header = reqHeaders 2928 googleapi.Expand(req.URL, map[string]string{ 2929 "resource": c.resource, 2930 }) 2931 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2932} 2933 2934// Do executes the "cloudresourcemanager.folders.listAvailableOrgPolicyConstraints" call. 2935// Exactly one of *ListAvailableOrgPolicyConstraintsResponse or error 2936// will be non-nil. Any non-2xx status code is an error. Response 2937// headers are in either 2938// *ListAvailableOrgPolicyConstraintsResponse.ServerResponse.Header or 2939// (if a response was returned at all) in 2940// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2941// whether the returned error was because http.StatusNotModified was 2942// returned. 2943func (c *FoldersListAvailableOrgPolicyConstraintsCall) Do(opts ...googleapi.CallOption) (*ListAvailableOrgPolicyConstraintsResponse, error) { 2944 gensupport.SetOptions(c.urlParams_, opts...) 2945 res, err := c.doRequest("json") 2946 if res != nil && res.StatusCode == http.StatusNotModified { 2947 if res.Body != nil { 2948 res.Body.Close() 2949 } 2950 return nil, &googleapi.Error{ 2951 Code: res.StatusCode, 2952 Header: res.Header, 2953 } 2954 } 2955 if err != nil { 2956 return nil, err 2957 } 2958 defer googleapi.CloseBody(res) 2959 if err := googleapi.CheckResponse(res); err != nil { 2960 return nil, err 2961 } 2962 ret := &ListAvailableOrgPolicyConstraintsResponse{ 2963 ServerResponse: googleapi.ServerResponse{ 2964 Header: res.Header, 2965 HTTPStatusCode: res.StatusCode, 2966 }, 2967 } 2968 target := &ret 2969 if err := gensupport.DecodeResponse(target, res); err != nil { 2970 return nil, err 2971 } 2972 return ret, nil 2973 // { 2974 // "description": "Lists `Constraints` that could be applied on the specified resource.", 2975 // "flatPath": "v1/folders/{foldersId}:listAvailableOrgPolicyConstraints", 2976 // "httpMethod": "POST", 2977 // "id": "cloudresourcemanager.folders.listAvailableOrgPolicyConstraints", 2978 // "parameterOrder": [ 2979 // "resource" 2980 // ], 2981 // "parameters": { 2982 // "resource": { 2983 // "description": "Name of the resource to list `Constraints` for.", 2984 // "location": "path", 2985 // "pattern": "^folders/[^/]+$", 2986 // "required": true, 2987 // "type": "string" 2988 // } 2989 // }, 2990 // "path": "v1/{+resource}:listAvailableOrgPolicyConstraints", 2991 // "request": { 2992 // "$ref": "ListAvailableOrgPolicyConstraintsRequest" 2993 // }, 2994 // "response": { 2995 // "$ref": "ListAvailableOrgPolicyConstraintsResponse" 2996 // }, 2997 // "scopes": [ 2998 // "https://www.googleapis.com/auth/cloud-platform", 2999 // "https://www.googleapis.com/auth/cloud-platform.read-only" 3000 // ] 3001 // } 3002 3003} 3004 3005// Pages invokes f for each page of results. 3006// A non-nil error returned from f will halt the iteration. 3007// The provided context supersedes any context provided to the Context method. 3008func (c *FoldersListAvailableOrgPolicyConstraintsCall) Pages(ctx context.Context, f func(*ListAvailableOrgPolicyConstraintsResponse) error) error { 3009 c.ctx_ = ctx 3010 defer func(pt string) { c.listavailableorgpolicyconstraintsrequest.PageToken = pt }(c.listavailableorgpolicyconstraintsrequest.PageToken) // reset paging to original point 3011 for { 3012 x, err := c.Do() 3013 if err != nil { 3014 return err 3015 } 3016 if err := f(x); err != nil { 3017 return err 3018 } 3019 if x.NextPageToken == "" { 3020 return nil 3021 } 3022 c.listavailableorgpolicyconstraintsrequest.PageToken = x.NextPageToken 3023 } 3024} 3025 3026// method id "cloudresourcemanager.folders.listOrgPolicies": 3027 3028type FoldersListOrgPoliciesCall struct { 3029 s *Service 3030 resource string 3031 listorgpoliciesrequest *ListOrgPoliciesRequest 3032 urlParams_ gensupport.URLParams 3033 ctx_ context.Context 3034 header_ http.Header 3035} 3036 3037// ListOrgPolicies: Lists all the `Policies` set for a particular 3038// resource. 3039// 3040// - resource: Name of the resource to list Policies for. 3041func (r *FoldersService) ListOrgPolicies(resource string, listorgpoliciesrequest *ListOrgPoliciesRequest) *FoldersListOrgPoliciesCall { 3042 c := &FoldersListOrgPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3043 c.resource = resource 3044 c.listorgpoliciesrequest = listorgpoliciesrequest 3045 return c 3046} 3047 3048// Fields allows partial responses to be retrieved. See 3049// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3050// for more information. 3051func (c *FoldersListOrgPoliciesCall) Fields(s ...googleapi.Field) *FoldersListOrgPoliciesCall { 3052 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3053 return c 3054} 3055 3056// Context sets the context to be used in this call's Do method. Any 3057// pending HTTP request will be aborted if the provided context is 3058// canceled. 3059func (c *FoldersListOrgPoliciesCall) Context(ctx context.Context) *FoldersListOrgPoliciesCall { 3060 c.ctx_ = ctx 3061 return c 3062} 3063 3064// Header returns an http.Header that can be modified by the caller to 3065// add HTTP headers to the request. 3066func (c *FoldersListOrgPoliciesCall) Header() http.Header { 3067 if c.header_ == nil { 3068 c.header_ = make(http.Header) 3069 } 3070 return c.header_ 3071} 3072 3073func (c *FoldersListOrgPoliciesCall) doRequest(alt string) (*http.Response, error) { 3074 reqHeaders := make(http.Header) 3075 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3076 for k, v := range c.header_ { 3077 reqHeaders[k] = v 3078 } 3079 reqHeaders.Set("User-Agent", c.s.userAgent()) 3080 var body io.Reader = nil 3081 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listorgpoliciesrequest) 3082 if err != nil { 3083 return nil, err 3084 } 3085 reqHeaders.Set("Content-Type", "application/json") 3086 c.urlParams_.Set("alt", alt) 3087 c.urlParams_.Set("prettyPrint", "false") 3088 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listOrgPolicies") 3089 urls += "?" + c.urlParams_.Encode() 3090 req, err := http.NewRequest("POST", urls, body) 3091 if err != nil { 3092 return nil, err 3093 } 3094 req.Header = reqHeaders 3095 googleapi.Expand(req.URL, map[string]string{ 3096 "resource": c.resource, 3097 }) 3098 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3099} 3100 3101// Do executes the "cloudresourcemanager.folders.listOrgPolicies" call. 3102// Exactly one of *ListOrgPoliciesResponse or error will be non-nil. Any 3103// non-2xx status code is an error. Response headers are in either 3104// *ListOrgPoliciesResponse.ServerResponse.Header or (if a response was 3105// returned at all) in error.(*googleapi.Error).Header. Use 3106// googleapi.IsNotModified to check whether the returned error was 3107// because http.StatusNotModified was returned. 3108func (c *FoldersListOrgPoliciesCall) Do(opts ...googleapi.CallOption) (*ListOrgPoliciesResponse, error) { 3109 gensupport.SetOptions(c.urlParams_, opts...) 3110 res, err := c.doRequest("json") 3111 if res != nil && res.StatusCode == http.StatusNotModified { 3112 if res.Body != nil { 3113 res.Body.Close() 3114 } 3115 return nil, &googleapi.Error{ 3116 Code: res.StatusCode, 3117 Header: res.Header, 3118 } 3119 } 3120 if err != nil { 3121 return nil, err 3122 } 3123 defer googleapi.CloseBody(res) 3124 if err := googleapi.CheckResponse(res); err != nil { 3125 return nil, err 3126 } 3127 ret := &ListOrgPoliciesResponse{ 3128 ServerResponse: googleapi.ServerResponse{ 3129 Header: res.Header, 3130 HTTPStatusCode: res.StatusCode, 3131 }, 3132 } 3133 target := &ret 3134 if err := gensupport.DecodeResponse(target, res); err != nil { 3135 return nil, err 3136 } 3137 return ret, nil 3138 // { 3139 // "description": "Lists all the `Policies` set for a particular resource.", 3140 // "flatPath": "v1/folders/{foldersId}:listOrgPolicies", 3141 // "httpMethod": "POST", 3142 // "id": "cloudresourcemanager.folders.listOrgPolicies", 3143 // "parameterOrder": [ 3144 // "resource" 3145 // ], 3146 // "parameters": { 3147 // "resource": { 3148 // "description": "Name of the resource to list Policies for.", 3149 // "location": "path", 3150 // "pattern": "^folders/[^/]+$", 3151 // "required": true, 3152 // "type": "string" 3153 // } 3154 // }, 3155 // "path": "v1/{+resource}:listOrgPolicies", 3156 // "request": { 3157 // "$ref": "ListOrgPoliciesRequest" 3158 // }, 3159 // "response": { 3160 // "$ref": "ListOrgPoliciesResponse" 3161 // }, 3162 // "scopes": [ 3163 // "https://www.googleapis.com/auth/cloud-platform", 3164 // "https://www.googleapis.com/auth/cloud-platform.read-only" 3165 // ] 3166 // } 3167 3168} 3169 3170// Pages invokes f for each page of results. 3171// A non-nil error returned from f will halt the iteration. 3172// The provided context supersedes any context provided to the Context method. 3173func (c *FoldersListOrgPoliciesCall) Pages(ctx context.Context, f func(*ListOrgPoliciesResponse) error) error { 3174 c.ctx_ = ctx 3175 defer func(pt string) { c.listorgpoliciesrequest.PageToken = pt }(c.listorgpoliciesrequest.PageToken) // reset paging to original point 3176 for { 3177 x, err := c.Do() 3178 if err != nil { 3179 return err 3180 } 3181 if err := f(x); err != nil { 3182 return err 3183 } 3184 if x.NextPageToken == "" { 3185 return nil 3186 } 3187 c.listorgpoliciesrequest.PageToken = x.NextPageToken 3188 } 3189} 3190 3191// method id "cloudresourcemanager.folders.setOrgPolicy": 3192 3193type FoldersSetOrgPolicyCall struct { 3194 s *Service 3195 resource string 3196 setorgpolicyrequest *SetOrgPolicyRequest 3197 urlParams_ gensupport.URLParams 3198 ctx_ context.Context 3199 header_ http.Header 3200} 3201 3202// SetOrgPolicy: Updates the specified `Policy` on the resource. Creates 3203// a new `Policy` for that `Constraint` on the resource if one does not 3204// exist. Not supplying an `etag` on the request `Policy` results in an 3205// unconditional write of the `Policy`. 3206// 3207// - resource: Resource name of the resource to attach the `Policy`. 3208func (r *FoldersService) SetOrgPolicy(resource string, setorgpolicyrequest *SetOrgPolicyRequest) *FoldersSetOrgPolicyCall { 3209 c := &FoldersSetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3210 c.resource = resource 3211 c.setorgpolicyrequest = setorgpolicyrequest 3212 return c 3213} 3214 3215// Fields allows partial responses to be retrieved. See 3216// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3217// for more information. 3218func (c *FoldersSetOrgPolicyCall) Fields(s ...googleapi.Field) *FoldersSetOrgPolicyCall { 3219 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3220 return c 3221} 3222 3223// Context sets the context to be used in this call's Do method. Any 3224// pending HTTP request will be aborted if the provided context is 3225// canceled. 3226func (c *FoldersSetOrgPolicyCall) Context(ctx context.Context) *FoldersSetOrgPolicyCall { 3227 c.ctx_ = ctx 3228 return c 3229} 3230 3231// Header returns an http.Header that can be modified by the caller to 3232// add HTTP headers to the request. 3233func (c *FoldersSetOrgPolicyCall) Header() http.Header { 3234 if c.header_ == nil { 3235 c.header_ = make(http.Header) 3236 } 3237 return c.header_ 3238} 3239 3240func (c *FoldersSetOrgPolicyCall) doRequest(alt string) (*http.Response, error) { 3241 reqHeaders := make(http.Header) 3242 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3243 for k, v := range c.header_ { 3244 reqHeaders[k] = v 3245 } 3246 reqHeaders.Set("User-Agent", c.s.userAgent()) 3247 var body io.Reader = nil 3248 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setorgpolicyrequest) 3249 if err != nil { 3250 return nil, err 3251 } 3252 reqHeaders.Set("Content-Type", "application/json") 3253 c.urlParams_.Set("alt", alt) 3254 c.urlParams_.Set("prettyPrint", "false") 3255 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setOrgPolicy") 3256 urls += "?" + c.urlParams_.Encode() 3257 req, err := http.NewRequest("POST", urls, body) 3258 if err != nil { 3259 return nil, err 3260 } 3261 req.Header = reqHeaders 3262 googleapi.Expand(req.URL, map[string]string{ 3263 "resource": c.resource, 3264 }) 3265 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3266} 3267 3268// Do executes the "cloudresourcemanager.folders.setOrgPolicy" call. 3269// Exactly one of *OrgPolicy or error will be non-nil. Any non-2xx 3270// status code is an error. Response headers are in either 3271// *OrgPolicy.ServerResponse.Header or (if a response was returned at 3272// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3273// to check whether the returned error was because 3274// http.StatusNotModified was returned. 3275func (c *FoldersSetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) { 3276 gensupport.SetOptions(c.urlParams_, opts...) 3277 res, err := c.doRequest("json") 3278 if res != nil && res.StatusCode == http.StatusNotModified { 3279 if res.Body != nil { 3280 res.Body.Close() 3281 } 3282 return nil, &googleapi.Error{ 3283 Code: res.StatusCode, 3284 Header: res.Header, 3285 } 3286 } 3287 if err != nil { 3288 return nil, err 3289 } 3290 defer googleapi.CloseBody(res) 3291 if err := googleapi.CheckResponse(res); err != nil { 3292 return nil, err 3293 } 3294 ret := &OrgPolicy{ 3295 ServerResponse: googleapi.ServerResponse{ 3296 Header: res.Header, 3297 HTTPStatusCode: res.StatusCode, 3298 }, 3299 } 3300 target := &ret 3301 if err := gensupport.DecodeResponse(target, res); err != nil { 3302 return nil, err 3303 } 3304 return ret, nil 3305 // { 3306 // "description": "Updates the specified `Policy` on the resource. Creates a new `Policy` for that `Constraint` on the resource if one does not exist. Not supplying an `etag` on the request `Policy` results in an unconditional write of the `Policy`.", 3307 // "flatPath": "v1/folders/{foldersId}:setOrgPolicy", 3308 // "httpMethod": "POST", 3309 // "id": "cloudresourcemanager.folders.setOrgPolicy", 3310 // "parameterOrder": [ 3311 // "resource" 3312 // ], 3313 // "parameters": { 3314 // "resource": { 3315 // "description": "Resource name of the resource to attach the `Policy`.", 3316 // "location": "path", 3317 // "pattern": "^folders/[^/]+$", 3318 // "required": true, 3319 // "type": "string" 3320 // } 3321 // }, 3322 // "path": "v1/{+resource}:setOrgPolicy", 3323 // "request": { 3324 // "$ref": "SetOrgPolicyRequest" 3325 // }, 3326 // "response": { 3327 // "$ref": "OrgPolicy" 3328 // }, 3329 // "scopes": [ 3330 // "https://www.googleapis.com/auth/cloud-platform" 3331 // ] 3332 // } 3333 3334} 3335 3336// method id "cloudresourcemanager.liens.create": 3337 3338type LiensCreateCall struct { 3339 s *Service 3340 lien *Lien 3341 urlParams_ gensupport.URLParams 3342 ctx_ context.Context 3343 header_ http.Header 3344} 3345 3346// Create: Create a Lien which applies to the resource denoted by the 3347// `parent` field. Callers of this method will require permission on the 3348// `parent` resource. For example, applying to `projects/1234` requires 3349// permission `resourcemanager.projects.updateLiens`. NOTE: Some 3350// resources may limit the number of Liens which may be applied. 3351func (r *LiensService) Create(lien *Lien) *LiensCreateCall { 3352 c := &LiensCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3353 c.lien = lien 3354 return c 3355} 3356 3357// Fields allows partial responses to be retrieved. See 3358// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3359// for more information. 3360func (c *LiensCreateCall) Fields(s ...googleapi.Field) *LiensCreateCall { 3361 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3362 return c 3363} 3364 3365// Context sets the context to be used in this call's Do method. Any 3366// pending HTTP request will be aborted if the provided context is 3367// canceled. 3368func (c *LiensCreateCall) Context(ctx context.Context) *LiensCreateCall { 3369 c.ctx_ = ctx 3370 return c 3371} 3372 3373// Header returns an http.Header that can be modified by the caller to 3374// add HTTP headers to the request. 3375func (c *LiensCreateCall) Header() http.Header { 3376 if c.header_ == nil { 3377 c.header_ = make(http.Header) 3378 } 3379 return c.header_ 3380} 3381 3382func (c *LiensCreateCall) doRequest(alt string) (*http.Response, error) { 3383 reqHeaders := make(http.Header) 3384 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3385 for k, v := range c.header_ { 3386 reqHeaders[k] = v 3387 } 3388 reqHeaders.Set("User-Agent", c.s.userAgent()) 3389 var body io.Reader = nil 3390 body, err := googleapi.WithoutDataWrapper.JSONReader(c.lien) 3391 if err != nil { 3392 return nil, err 3393 } 3394 reqHeaders.Set("Content-Type", "application/json") 3395 c.urlParams_.Set("alt", alt) 3396 c.urlParams_.Set("prettyPrint", "false") 3397 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/liens") 3398 urls += "?" + c.urlParams_.Encode() 3399 req, err := http.NewRequest("POST", urls, body) 3400 if err != nil { 3401 return nil, err 3402 } 3403 req.Header = reqHeaders 3404 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3405} 3406 3407// Do executes the "cloudresourcemanager.liens.create" call. 3408// Exactly one of *Lien or error will be non-nil. Any non-2xx status 3409// code is an error. Response headers are in either 3410// *Lien.ServerResponse.Header or (if a response was returned at all) in 3411// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3412// whether the returned error was because http.StatusNotModified was 3413// returned. 3414func (c *LiensCreateCall) Do(opts ...googleapi.CallOption) (*Lien, error) { 3415 gensupport.SetOptions(c.urlParams_, opts...) 3416 res, err := c.doRequest("json") 3417 if res != nil && res.StatusCode == http.StatusNotModified { 3418 if res.Body != nil { 3419 res.Body.Close() 3420 } 3421 return nil, &googleapi.Error{ 3422 Code: res.StatusCode, 3423 Header: res.Header, 3424 } 3425 } 3426 if err != nil { 3427 return nil, err 3428 } 3429 defer googleapi.CloseBody(res) 3430 if err := googleapi.CheckResponse(res); err != nil { 3431 return nil, err 3432 } 3433 ret := &Lien{ 3434 ServerResponse: googleapi.ServerResponse{ 3435 Header: res.Header, 3436 HTTPStatusCode: res.StatusCode, 3437 }, 3438 } 3439 target := &ret 3440 if err := gensupport.DecodeResponse(target, res); err != nil { 3441 return nil, err 3442 } 3443 return ret, nil 3444 // { 3445 // "description": "Create a Lien which applies to the resource denoted by the `parent` field. Callers of this method will require permission on the `parent` resource. For example, applying to `projects/1234` requires permission `resourcemanager.projects.updateLiens`. NOTE: Some resources may limit the number of Liens which may be applied.", 3446 // "flatPath": "v1/liens", 3447 // "httpMethod": "POST", 3448 // "id": "cloudresourcemanager.liens.create", 3449 // "parameterOrder": [], 3450 // "parameters": {}, 3451 // "path": "v1/liens", 3452 // "request": { 3453 // "$ref": "Lien" 3454 // }, 3455 // "response": { 3456 // "$ref": "Lien" 3457 // }, 3458 // "scopes": [ 3459 // "https://www.googleapis.com/auth/cloud-platform", 3460 // "https://www.googleapis.com/auth/cloud-platform.read-only" 3461 // ] 3462 // } 3463 3464} 3465 3466// method id "cloudresourcemanager.liens.delete": 3467 3468type LiensDeleteCall struct { 3469 s *Service 3470 nameid string 3471 urlParams_ gensupport.URLParams 3472 ctx_ context.Context 3473 header_ http.Header 3474} 3475 3476// Delete: Delete a Lien by `name`. Callers of this method will require 3477// permission on the `parent` resource. For example, a Lien with a 3478// `parent` of `projects/1234` requires permission 3479// `resourcemanager.projects.updateLiens`. 3480// 3481// - name: The name/identifier of the Lien to delete. 3482func (r *LiensService) Delete(nameid string) *LiensDeleteCall { 3483 c := &LiensDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3484 c.nameid = nameid 3485 return c 3486} 3487 3488// Fields allows partial responses to be retrieved. See 3489// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3490// for more information. 3491func (c *LiensDeleteCall) Fields(s ...googleapi.Field) *LiensDeleteCall { 3492 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3493 return c 3494} 3495 3496// Context sets the context to be used in this call's Do method. Any 3497// pending HTTP request will be aborted if the provided context is 3498// canceled. 3499func (c *LiensDeleteCall) Context(ctx context.Context) *LiensDeleteCall { 3500 c.ctx_ = ctx 3501 return c 3502} 3503 3504// Header returns an http.Header that can be modified by the caller to 3505// add HTTP headers to the request. 3506func (c *LiensDeleteCall) Header() http.Header { 3507 if c.header_ == nil { 3508 c.header_ = make(http.Header) 3509 } 3510 return c.header_ 3511} 3512 3513func (c *LiensDeleteCall) doRequest(alt string) (*http.Response, error) { 3514 reqHeaders := make(http.Header) 3515 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3516 for k, v := range c.header_ { 3517 reqHeaders[k] = v 3518 } 3519 reqHeaders.Set("User-Agent", c.s.userAgent()) 3520 var body io.Reader = nil 3521 c.urlParams_.Set("alt", alt) 3522 c.urlParams_.Set("prettyPrint", "false") 3523 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 3524 urls += "?" + c.urlParams_.Encode() 3525 req, err := http.NewRequest("DELETE", urls, body) 3526 if err != nil { 3527 return nil, err 3528 } 3529 req.Header = reqHeaders 3530 googleapi.Expand(req.URL, map[string]string{ 3531 "name": c.nameid, 3532 }) 3533 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3534} 3535 3536// Do executes the "cloudresourcemanager.liens.delete" call. 3537// Exactly one of *Empty or error will be non-nil. Any non-2xx status 3538// code is an error. Response headers are in either 3539// *Empty.ServerResponse.Header or (if a response was returned at all) 3540// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3541// check whether the returned error was because http.StatusNotModified 3542// was returned. 3543func (c *LiensDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 3544 gensupport.SetOptions(c.urlParams_, opts...) 3545 res, err := c.doRequest("json") 3546 if res != nil && res.StatusCode == http.StatusNotModified { 3547 if res.Body != nil { 3548 res.Body.Close() 3549 } 3550 return nil, &googleapi.Error{ 3551 Code: res.StatusCode, 3552 Header: res.Header, 3553 } 3554 } 3555 if err != nil { 3556 return nil, err 3557 } 3558 defer googleapi.CloseBody(res) 3559 if err := googleapi.CheckResponse(res); err != nil { 3560 return nil, err 3561 } 3562 ret := &Empty{ 3563 ServerResponse: googleapi.ServerResponse{ 3564 Header: res.Header, 3565 HTTPStatusCode: res.StatusCode, 3566 }, 3567 } 3568 target := &ret 3569 if err := gensupport.DecodeResponse(target, res); err != nil { 3570 return nil, err 3571 } 3572 return ret, nil 3573 // { 3574 // "description": "Delete a Lien by `name`. Callers of this method will require permission on the `parent` resource. For example, a Lien with a `parent` of `projects/1234` requires permission `resourcemanager.projects.updateLiens`.", 3575 // "flatPath": "v1/liens/{liensId}", 3576 // "httpMethod": "DELETE", 3577 // "id": "cloudresourcemanager.liens.delete", 3578 // "parameterOrder": [ 3579 // "name" 3580 // ], 3581 // "parameters": { 3582 // "name": { 3583 // "description": "Required. The name/identifier of the Lien to delete.", 3584 // "location": "path", 3585 // "pattern": "^liens/.*$", 3586 // "required": true, 3587 // "type": "string" 3588 // } 3589 // }, 3590 // "path": "v1/{+name}", 3591 // "response": { 3592 // "$ref": "Empty" 3593 // }, 3594 // "scopes": [ 3595 // "https://www.googleapis.com/auth/cloud-platform", 3596 // "https://www.googleapis.com/auth/cloud-platform.read-only" 3597 // ] 3598 // } 3599 3600} 3601 3602// method id "cloudresourcemanager.liens.get": 3603 3604type LiensGetCall struct { 3605 s *Service 3606 nameid string 3607 urlParams_ gensupport.URLParams 3608 ifNoneMatch_ string 3609 ctx_ context.Context 3610 header_ http.Header 3611} 3612 3613// Get: Retrieve a Lien by `name`. Callers of this method will require 3614// permission on the `parent` resource. For example, a Lien with a 3615// `parent` of `projects/1234` requires permission 3616// `resourcemanager.projects.get` 3617// 3618// - name: The name/identifier of the Lien. 3619func (r *LiensService) Get(nameid string) *LiensGetCall { 3620 c := &LiensGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3621 c.nameid = nameid 3622 return c 3623} 3624 3625// Fields allows partial responses to be retrieved. See 3626// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3627// for more information. 3628func (c *LiensGetCall) Fields(s ...googleapi.Field) *LiensGetCall { 3629 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3630 return c 3631} 3632 3633// IfNoneMatch sets the optional parameter which makes the operation 3634// fail if the object's ETag matches the given value. This is useful for 3635// getting updates only after the object has changed since the last 3636// request. Use googleapi.IsNotModified to check whether the response 3637// error from Do is the result of In-None-Match. 3638func (c *LiensGetCall) IfNoneMatch(entityTag string) *LiensGetCall { 3639 c.ifNoneMatch_ = entityTag 3640 return c 3641} 3642 3643// Context sets the context to be used in this call's Do method. Any 3644// pending HTTP request will be aborted if the provided context is 3645// canceled. 3646func (c *LiensGetCall) Context(ctx context.Context) *LiensGetCall { 3647 c.ctx_ = ctx 3648 return c 3649} 3650 3651// Header returns an http.Header that can be modified by the caller to 3652// add HTTP headers to the request. 3653func (c *LiensGetCall) Header() http.Header { 3654 if c.header_ == nil { 3655 c.header_ = make(http.Header) 3656 } 3657 return c.header_ 3658} 3659 3660func (c *LiensGetCall) doRequest(alt string) (*http.Response, error) { 3661 reqHeaders := make(http.Header) 3662 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3663 for k, v := range c.header_ { 3664 reqHeaders[k] = v 3665 } 3666 reqHeaders.Set("User-Agent", c.s.userAgent()) 3667 if c.ifNoneMatch_ != "" { 3668 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3669 } 3670 var body io.Reader = nil 3671 c.urlParams_.Set("alt", alt) 3672 c.urlParams_.Set("prettyPrint", "false") 3673 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 3674 urls += "?" + c.urlParams_.Encode() 3675 req, err := http.NewRequest("GET", urls, body) 3676 if err != nil { 3677 return nil, err 3678 } 3679 req.Header = reqHeaders 3680 googleapi.Expand(req.URL, map[string]string{ 3681 "name": c.nameid, 3682 }) 3683 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3684} 3685 3686// Do executes the "cloudresourcemanager.liens.get" call. 3687// Exactly one of *Lien or error will be non-nil. Any non-2xx status 3688// code is an error. Response headers are in either 3689// *Lien.ServerResponse.Header or (if a response was returned at all) in 3690// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3691// whether the returned error was because http.StatusNotModified was 3692// returned. 3693func (c *LiensGetCall) Do(opts ...googleapi.CallOption) (*Lien, error) { 3694 gensupport.SetOptions(c.urlParams_, opts...) 3695 res, err := c.doRequest("json") 3696 if res != nil && res.StatusCode == http.StatusNotModified { 3697 if res.Body != nil { 3698 res.Body.Close() 3699 } 3700 return nil, &googleapi.Error{ 3701 Code: res.StatusCode, 3702 Header: res.Header, 3703 } 3704 } 3705 if err != nil { 3706 return nil, err 3707 } 3708 defer googleapi.CloseBody(res) 3709 if err := googleapi.CheckResponse(res); err != nil { 3710 return nil, err 3711 } 3712 ret := &Lien{ 3713 ServerResponse: googleapi.ServerResponse{ 3714 Header: res.Header, 3715 HTTPStatusCode: res.StatusCode, 3716 }, 3717 } 3718 target := &ret 3719 if err := gensupport.DecodeResponse(target, res); err != nil { 3720 return nil, err 3721 } 3722 return ret, nil 3723 // { 3724 // "description": "Retrieve a Lien by `name`. Callers of this method will require permission on the `parent` resource. For example, a Lien with a `parent` of `projects/1234` requires permission `resourcemanager.projects.get`", 3725 // "flatPath": "v1/liens/{liensId}", 3726 // "httpMethod": "GET", 3727 // "id": "cloudresourcemanager.liens.get", 3728 // "parameterOrder": [ 3729 // "name" 3730 // ], 3731 // "parameters": { 3732 // "name": { 3733 // "description": "Required. The name/identifier of the Lien.", 3734 // "location": "path", 3735 // "pattern": "^liens/.*$", 3736 // "required": true, 3737 // "type": "string" 3738 // } 3739 // }, 3740 // "path": "v1/{+name}", 3741 // "response": { 3742 // "$ref": "Lien" 3743 // }, 3744 // "scopes": [ 3745 // "https://www.googleapis.com/auth/cloud-platform", 3746 // "https://www.googleapis.com/auth/cloud-platform.read-only" 3747 // ] 3748 // } 3749 3750} 3751 3752// method id "cloudresourcemanager.liens.list": 3753 3754type LiensListCall struct { 3755 s *Service 3756 urlParams_ gensupport.URLParams 3757 ifNoneMatch_ string 3758 ctx_ context.Context 3759 header_ http.Header 3760} 3761 3762// List: List all Liens applied to the `parent` resource. Callers of 3763// this method will require permission on the `parent` resource. For 3764// example, a Lien with a `parent` of `projects/1234` requires 3765// permission `resourcemanager.projects.get`. 3766func (r *LiensService) List() *LiensListCall { 3767 c := &LiensListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3768 return c 3769} 3770 3771// PageSize sets the optional parameter "pageSize": The maximum number 3772// of items to return. This is a suggestion for the server. The server 3773// can return fewer liens than requested. If unspecified, server picks 3774// an appropriate default. 3775func (c *LiensListCall) PageSize(pageSize int64) *LiensListCall { 3776 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3777 return c 3778} 3779 3780// PageToken sets the optional parameter "pageToken": The 3781// `next_page_token` value returned from a previous List request, if 3782// any. 3783func (c *LiensListCall) PageToken(pageToken string) *LiensListCall { 3784 c.urlParams_.Set("pageToken", pageToken) 3785 return c 3786} 3787 3788// Parent sets the optional parameter "parent": Required. The name of 3789// the resource to list all attached Liens. For example, 3790// `projects/1234`. (google.api.field_policy).resource_type annotation 3791// is not set since the parent depends on the meta api implementation. 3792// This field could be a project or other sub project resources. 3793func (c *LiensListCall) Parent(parent string) *LiensListCall { 3794 c.urlParams_.Set("parent", parent) 3795 return c 3796} 3797 3798// Fields allows partial responses to be retrieved. See 3799// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3800// for more information. 3801func (c *LiensListCall) Fields(s ...googleapi.Field) *LiensListCall { 3802 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3803 return c 3804} 3805 3806// IfNoneMatch sets the optional parameter which makes the operation 3807// fail if the object's ETag matches the given value. This is useful for 3808// getting updates only after the object has changed since the last 3809// request. Use googleapi.IsNotModified to check whether the response 3810// error from Do is the result of In-None-Match. 3811func (c *LiensListCall) IfNoneMatch(entityTag string) *LiensListCall { 3812 c.ifNoneMatch_ = entityTag 3813 return c 3814} 3815 3816// Context sets the context to be used in this call's Do method. Any 3817// pending HTTP request will be aborted if the provided context is 3818// canceled. 3819func (c *LiensListCall) Context(ctx context.Context) *LiensListCall { 3820 c.ctx_ = ctx 3821 return c 3822} 3823 3824// Header returns an http.Header that can be modified by the caller to 3825// add HTTP headers to the request. 3826func (c *LiensListCall) Header() http.Header { 3827 if c.header_ == nil { 3828 c.header_ = make(http.Header) 3829 } 3830 return c.header_ 3831} 3832 3833func (c *LiensListCall) doRequest(alt string) (*http.Response, error) { 3834 reqHeaders := make(http.Header) 3835 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3836 for k, v := range c.header_ { 3837 reqHeaders[k] = v 3838 } 3839 reqHeaders.Set("User-Agent", c.s.userAgent()) 3840 if c.ifNoneMatch_ != "" { 3841 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3842 } 3843 var body io.Reader = nil 3844 c.urlParams_.Set("alt", alt) 3845 c.urlParams_.Set("prettyPrint", "false") 3846 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/liens") 3847 urls += "?" + c.urlParams_.Encode() 3848 req, err := http.NewRequest("GET", urls, body) 3849 if err != nil { 3850 return nil, err 3851 } 3852 req.Header = reqHeaders 3853 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3854} 3855 3856// Do executes the "cloudresourcemanager.liens.list" call. 3857// Exactly one of *ListLiensResponse or error will be non-nil. Any 3858// non-2xx status code is an error. Response headers are in either 3859// *ListLiensResponse.ServerResponse.Header or (if a response was 3860// returned at all) in error.(*googleapi.Error).Header. Use 3861// googleapi.IsNotModified to check whether the returned error was 3862// because http.StatusNotModified was returned. 3863func (c *LiensListCall) Do(opts ...googleapi.CallOption) (*ListLiensResponse, error) { 3864 gensupport.SetOptions(c.urlParams_, opts...) 3865 res, err := c.doRequest("json") 3866 if res != nil && res.StatusCode == http.StatusNotModified { 3867 if res.Body != nil { 3868 res.Body.Close() 3869 } 3870 return nil, &googleapi.Error{ 3871 Code: res.StatusCode, 3872 Header: res.Header, 3873 } 3874 } 3875 if err != nil { 3876 return nil, err 3877 } 3878 defer googleapi.CloseBody(res) 3879 if err := googleapi.CheckResponse(res); err != nil { 3880 return nil, err 3881 } 3882 ret := &ListLiensResponse{ 3883 ServerResponse: googleapi.ServerResponse{ 3884 Header: res.Header, 3885 HTTPStatusCode: res.StatusCode, 3886 }, 3887 } 3888 target := &ret 3889 if err := gensupport.DecodeResponse(target, res); err != nil { 3890 return nil, err 3891 } 3892 return ret, nil 3893 // { 3894 // "description": "List all Liens applied to the `parent` resource. Callers of this method will require permission on the `parent` resource. For example, a Lien with a `parent` of `projects/1234` requires permission `resourcemanager.projects.get`.", 3895 // "flatPath": "v1/liens", 3896 // "httpMethod": "GET", 3897 // "id": "cloudresourcemanager.liens.list", 3898 // "parameterOrder": [], 3899 // "parameters": { 3900 // "pageSize": { 3901 // "description": "The maximum number of items to return. This is a suggestion for the server. The server can return fewer liens than requested. If unspecified, server picks an appropriate default.", 3902 // "format": "int32", 3903 // "location": "query", 3904 // "type": "integer" 3905 // }, 3906 // "pageToken": { 3907 // "description": "The `next_page_token` value returned from a previous List request, if any.", 3908 // "location": "query", 3909 // "type": "string" 3910 // }, 3911 // "parent": { 3912 // "description": "Required. The name of the resource to list all attached Liens. For example, `projects/1234`. (google.api.field_policy).resource_type annotation is not set since the parent depends on the meta api implementation. This field could be a project or other sub project resources.", 3913 // "location": "query", 3914 // "type": "string" 3915 // } 3916 // }, 3917 // "path": "v1/liens", 3918 // "response": { 3919 // "$ref": "ListLiensResponse" 3920 // }, 3921 // "scopes": [ 3922 // "https://www.googleapis.com/auth/cloud-platform", 3923 // "https://www.googleapis.com/auth/cloud-platform.read-only" 3924 // ] 3925 // } 3926 3927} 3928 3929// Pages invokes f for each page of results. 3930// A non-nil error returned from f will halt the iteration. 3931// The provided context supersedes any context provided to the Context method. 3932func (c *LiensListCall) Pages(ctx context.Context, f func(*ListLiensResponse) error) error { 3933 c.ctx_ = ctx 3934 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3935 for { 3936 x, err := c.Do() 3937 if err != nil { 3938 return err 3939 } 3940 if err := f(x); err != nil { 3941 return err 3942 } 3943 if x.NextPageToken == "" { 3944 return nil 3945 } 3946 c.PageToken(x.NextPageToken) 3947 } 3948} 3949 3950// method id "cloudresourcemanager.operations.get": 3951 3952type OperationsGetCall struct { 3953 s *Service 3954 name string 3955 urlParams_ gensupport.URLParams 3956 ifNoneMatch_ string 3957 ctx_ context.Context 3958 header_ http.Header 3959} 3960 3961// Get: Gets the latest state of a long-running operation. Clients can 3962// use this method to poll the operation result at intervals as 3963// recommended by the API service. 3964// 3965// - name: The name of the operation resource. 3966func (r *OperationsService) Get(name string) *OperationsGetCall { 3967 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3968 c.name = name 3969 return c 3970} 3971 3972// Fields allows partial responses to be retrieved. See 3973// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3974// for more information. 3975func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 3976 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3977 return c 3978} 3979 3980// IfNoneMatch sets the optional parameter which makes the operation 3981// fail if the object's ETag matches the given value. This is useful for 3982// getting updates only after the object has changed since the last 3983// request. Use googleapi.IsNotModified to check whether the response 3984// error from Do is the result of In-None-Match. 3985func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 3986 c.ifNoneMatch_ = entityTag 3987 return c 3988} 3989 3990// Context sets the context to be used in this call's Do method. Any 3991// pending HTTP request will be aborted if the provided context is 3992// canceled. 3993func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 3994 c.ctx_ = ctx 3995 return c 3996} 3997 3998// Header returns an http.Header that can be modified by the caller to 3999// add HTTP headers to the request. 4000func (c *OperationsGetCall) Header() http.Header { 4001 if c.header_ == nil { 4002 c.header_ = make(http.Header) 4003 } 4004 return c.header_ 4005} 4006 4007func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 4008 reqHeaders := make(http.Header) 4009 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 4010 for k, v := range c.header_ { 4011 reqHeaders[k] = v 4012 } 4013 reqHeaders.Set("User-Agent", c.s.userAgent()) 4014 if c.ifNoneMatch_ != "" { 4015 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4016 } 4017 var body io.Reader = nil 4018 c.urlParams_.Set("alt", alt) 4019 c.urlParams_.Set("prettyPrint", "false") 4020 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 4021 urls += "?" + c.urlParams_.Encode() 4022 req, err := http.NewRequest("GET", urls, body) 4023 if err != nil { 4024 return nil, err 4025 } 4026 req.Header = reqHeaders 4027 googleapi.Expand(req.URL, map[string]string{ 4028 "name": c.name, 4029 }) 4030 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4031} 4032 4033// Do executes the "cloudresourcemanager.operations.get" call. 4034// Exactly one of *Operation or error will be non-nil. Any non-2xx 4035// status code is an error. Response headers are in either 4036// *Operation.ServerResponse.Header or (if a response was returned at 4037// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4038// to check whether the returned error was because 4039// http.StatusNotModified was returned. 4040func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4041 gensupport.SetOptions(c.urlParams_, opts...) 4042 res, err := c.doRequest("json") 4043 if res != nil && res.StatusCode == http.StatusNotModified { 4044 if res.Body != nil { 4045 res.Body.Close() 4046 } 4047 return nil, &googleapi.Error{ 4048 Code: res.StatusCode, 4049 Header: res.Header, 4050 } 4051 } 4052 if err != nil { 4053 return nil, err 4054 } 4055 defer googleapi.CloseBody(res) 4056 if err := googleapi.CheckResponse(res); err != nil { 4057 return nil, err 4058 } 4059 ret := &Operation{ 4060 ServerResponse: googleapi.ServerResponse{ 4061 Header: res.Header, 4062 HTTPStatusCode: res.StatusCode, 4063 }, 4064 } 4065 target := &ret 4066 if err := gensupport.DecodeResponse(target, res); err != nil { 4067 return nil, err 4068 } 4069 return ret, nil 4070 // { 4071 // "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.", 4072 // "flatPath": "v1/operations/{operationsId}", 4073 // "httpMethod": "GET", 4074 // "id": "cloudresourcemanager.operations.get", 4075 // "parameterOrder": [ 4076 // "name" 4077 // ], 4078 // "parameters": { 4079 // "name": { 4080 // "description": "The name of the operation resource.", 4081 // "location": "path", 4082 // "pattern": "^operations/.*$", 4083 // "required": true, 4084 // "type": "string" 4085 // } 4086 // }, 4087 // "path": "v1/{+name}", 4088 // "response": { 4089 // "$ref": "Operation" 4090 // }, 4091 // "scopes": [ 4092 // "https://www.googleapis.com/auth/cloud-platform", 4093 // "https://www.googleapis.com/auth/cloud-platform.read-only" 4094 // ] 4095 // } 4096 4097} 4098 4099// method id "cloudresourcemanager.organizations.clearOrgPolicy": 4100 4101type OrganizationsClearOrgPolicyCall struct { 4102 s *Service 4103 resource string 4104 clearorgpolicyrequest *ClearOrgPolicyRequest 4105 urlParams_ gensupport.URLParams 4106 ctx_ context.Context 4107 header_ http.Header 4108} 4109 4110// ClearOrgPolicy: Clears a `Policy` from a resource. 4111// 4112// - resource: Name of the resource for the `Policy` to clear. 4113func (r *OrganizationsService) ClearOrgPolicy(resource string, clearorgpolicyrequest *ClearOrgPolicyRequest) *OrganizationsClearOrgPolicyCall { 4114 c := &OrganizationsClearOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4115 c.resource = resource 4116 c.clearorgpolicyrequest = clearorgpolicyrequest 4117 return c 4118} 4119 4120// Fields allows partial responses to be retrieved. See 4121// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4122// for more information. 4123func (c *OrganizationsClearOrgPolicyCall) Fields(s ...googleapi.Field) *OrganizationsClearOrgPolicyCall { 4124 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4125 return c 4126} 4127 4128// Context sets the context to be used in this call's Do method. Any 4129// pending HTTP request will be aborted if the provided context is 4130// canceled. 4131func (c *OrganizationsClearOrgPolicyCall) Context(ctx context.Context) *OrganizationsClearOrgPolicyCall { 4132 c.ctx_ = ctx 4133 return c 4134} 4135 4136// Header returns an http.Header that can be modified by the caller to 4137// add HTTP headers to the request. 4138func (c *OrganizationsClearOrgPolicyCall) Header() http.Header { 4139 if c.header_ == nil { 4140 c.header_ = make(http.Header) 4141 } 4142 return c.header_ 4143} 4144 4145func (c *OrganizationsClearOrgPolicyCall) doRequest(alt string) (*http.Response, error) { 4146 reqHeaders := make(http.Header) 4147 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 4148 for k, v := range c.header_ { 4149 reqHeaders[k] = v 4150 } 4151 reqHeaders.Set("User-Agent", c.s.userAgent()) 4152 var body io.Reader = nil 4153 body, err := googleapi.WithoutDataWrapper.JSONReader(c.clearorgpolicyrequest) 4154 if err != nil { 4155 return nil, err 4156 } 4157 reqHeaders.Set("Content-Type", "application/json") 4158 c.urlParams_.Set("alt", alt) 4159 c.urlParams_.Set("prettyPrint", "false") 4160 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:clearOrgPolicy") 4161 urls += "?" + c.urlParams_.Encode() 4162 req, err := http.NewRequest("POST", urls, body) 4163 if err != nil { 4164 return nil, err 4165 } 4166 req.Header = reqHeaders 4167 googleapi.Expand(req.URL, map[string]string{ 4168 "resource": c.resource, 4169 }) 4170 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4171} 4172 4173// Do executes the "cloudresourcemanager.organizations.clearOrgPolicy" call. 4174// Exactly one of *Empty or error will be non-nil. Any non-2xx status 4175// code is an error. Response headers are in either 4176// *Empty.ServerResponse.Header or (if a response was returned at all) 4177// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4178// check whether the returned error was because http.StatusNotModified 4179// was returned. 4180func (c *OrganizationsClearOrgPolicyCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 4181 gensupport.SetOptions(c.urlParams_, opts...) 4182 res, err := c.doRequest("json") 4183 if res != nil && res.StatusCode == http.StatusNotModified { 4184 if res.Body != nil { 4185 res.Body.Close() 4186 } 4187 return nil, &googleapi.Error{ 4188 Code: res.StatusCode, 4189 Header: res.Header, 4190 } 4191 } 4192 if err != nil { 4193 return nil, err 4194 } 4195 defer googleapi.CloseBody(res) 4196 if err := googleapi.CheckResponse(res); err != nil { 4197 return nil, err 4198 } 4199 ret := &Empty{ 4200 ServerResponse: googleapi.ServerResponse{ 4201 Header: res.Header, 4202 HTTPStatusCode: res.StatusCode, 4203 }, 4204 } 4205 target := &ret 4206 if err := gensupport.DecodeResponse(target, res); err != nil { 4207 return nil, err 4208 } 4209 return ret, nil 4210 // { 4211 // "description": "Clears a `Policy` from a resource.", 4212 // "flatPath": "v1/organizations/{organizationsId}:clearOrgPolicy", 4213 // "httpMethod": "POST", 4214 // "id": "cloudresourcemanager.organizations.clearOrgPolicy", 4215 // "parameterOrder": [ 4216 // "resource" 4217 // ], 4218 // "parameters": { 4219 // "resource": { 4220 // "description": "Name of the resource for the `Policy` to clear.", 4221 // "location": "path", 4222 // "pattern": "^organizations/[^/]+$", 4223 // "required": true, 4224 // "type": "string" 4225 // } 4226 // }, 4227 // "path": "v1/{+resource}:clearOrgPolicy", 4228 // "request": { 4229 // "$ref": "ClearOrgPolicyRequest" 4230 // }, 4231 // "response": { 4232 // "$ref": "Empty" 4233 // }, 4234 // "scopes": [ 4235 // "https://www.googleapis.com/auth/cloud-platform" 4236 // ] 4237 // } 4238 4239} 4240 4241// method id "cloudresourcemanager.organizations.get": 4242 4243type OrganizationsGetCall struct { 4244 s *Service 4245 name string 4246 urlParams_ gensupport.URLParams 4247 ifNoneMatch_ string 4248 ctx_ context.Context 4249 header_ http.Header 4250} 4251 4252// Get: Fetches an Organization resource identified by the specified 4253// resource name. 4254// 4255// - name: The resource name of the Organization to fetch. This is the 4256// organization's relative path in the API, formatted as 4257// "organizations/[organizationId]". For example, 4258// "organizations/1234". 4259func (r *OrganizationsService) Get(name string) *OrganizationsGetCall { 4260 c := &OrganizationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4261 c.name = name 4262 return c 4263} 4264 4265// Fields allows partial responses to be retrieved. See 4266// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4267// for more information. 4268func (c *OrganizationsGetCall) Fields(s ...googleapi.Field) *OrganizationsGetCall { 4269 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4270 return c 4271} 4272 4273// IfNoneMatch sets the optional parameter which makes the operation 4274// fail if the object's ETag matches the given value. This is useful for 4275// getting updates only after the object has changed since the last 4276// request. Use googleapi.IsNotModified to check whether the response 4277// error from Do is the result of In-None-Match. 4278func (c *OrganizationsGetCall) IfNoneMatch(entityTag string) *OrganizationsGetCall { 4279 c.ifNoneMatch_ = entityTag 4280 return c 4281} 4282 4283// Context sets the context to be used in this call's Do method. Any 4284// pending HTTP request will be aborted if the provided context is 4285// canceled. 4286func (c *OrganizationsGetCall) Context(ctx context.Context) *OrganizationsGetCall { 4287 c.ctx_ = ctx 4288 return c 4289} 4290 4291// Header returns an http.Header that can be modified by the caller to 4292// add HTTP headers to the request. 4293func (c *OrganizationsGetCall) Header() http.Header { 4294 if c.header_ == nil { 4295 c.header_ = make(http.Header) 4296 } 4297 return c.header_ 4298} 4299 4300func (c *OrganizationsGetCall) doRequest(alt string) (*http.Response, error) { 4301 reqHeaders := make(http.Header) 4302 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 4303 for k, v := range c.header_ { 4304 reqHeaders[k] = v 4305 } 4306 reqHeaders.Set("User-Agent", c.s.userAgent()) 4307 if c.ifNoneMatch_ != "" { 4308 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4309 } 4310 var body io.Reader = nil 4311 c.urlParams_.Set("alt", alt) 4312 c.urlParams_.Set("prettyPrint", "false") 4313 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 4314 urls += "?" + c.urlParams_.Encode() 4315 req, err := http.NewRequest("GET", urls, body) 4316 if err != nil { 4317 return nil, err 4318 } 4319 req.Header = reqHeaders 4320 googleapi.Expand(req.URL, map[string]string{ 4321 "name": c.name, 4322 }) 4323 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4324} 4325 4326// Do executes the "cloudresourcemanager.organizations.get" call. 4327// Exactly one of *Organization or error will be non-nil. Any non-2xx 4328// status code is an error. Response headers are in either 4329// *Organization.ServerResponse.Header or (if a response was returned at 4330// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4331// to check whether the returned error was because 4332// http.StatusNotModified was returned. 4333func (c *OrganizationsGetCall) Do(opts ...googleapi.CallOption) (*Organization, error) { 4334 gensupport.SetOptions(c.urlParams_, opts...) 4335 res, err := c.doRequest("json") 4336 if res != nil && res.StatusCode == http.StatusNotModified { 4337 if res.Body != nil { 4338 res.Body.Close() 4339 } 4340 return nil, &googleapi.Error{ 4341 Code: res.StatusCode, 4342 Header: res.Header, 4343 } 4344 } 4345 if err != nil { 4346 return nil, err 4347 } 4348 defer googleapi.CloseBody(res) 4349 if err := googleapi.CheckResponse(res); err != nil { 4350 return nil, err 4351 } 4352 ret := &Organization{ 4353 ServerResponse: googleapi.ServerResponse{ 4354 Header: res.Header, 4355 HTTPStatusCode: res.StatusCode, 4356 }, 4357 } 4358 target := &ret 4359 if err := gensupport.DecodeResponse(target, res); err != nil { 4360 return nil, err 4361 } 4362 return ret, nil 4363 // { 4364 // "description": "Fetches an Organization resource identified by the specified resource name.", 4365 // "flatPath": "v1/organizations/{organizationsId}", 4366 // "httpMethod": "GET", 4367 // "id": "cloudresourcemanager.organizations.get", 4368 // "parameterOrder": [ 4369 // "name" 4370 // ], 4371 // "parameters": { 4372 // "name": { 4373 // "description": "The resource name of the Organization to fetch. This is the organization's relative path in the API, formatted as \"organizations/[organizationId]\". For example, \"organizations/1234\".", 4374 // "location": "path", 4375 // "pattern": "^organizations/[^/]+$", 4376 // "required": true, 4377 // "type": "string" 4378 // } 4379 // }, 4380 // "path": "v1/{+name}", 4381 // "response": { 4382 // "$ref": "Organization" 4383 // }, 4384 // "scopes": [ 4385 // "https://www.googleapis.com/auth/cloud-platform", 4386 // "https://www.googleapis.com/auth/cloud-platform.read-only" 4387 // ] 4388 // } 4389 4390} 4391 4392// method id "cloudresourcemanager.organizations.getEffectiveOrgPolicy": 4393 4394type OrganizationsGetEffectiveOrgPolicyCall struct { 4395 s *Service 4396 resource string 4397 geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest 4398 urlParams_ gensupport.URLParams 4399 ctx_ context.Context 4400 header_ http.Header 4401} 4402 4403// GetEffectiveOrgPolicy: Gets the effective `Policy` on a resource. 4404// This is the result of merging `Policies` in the resource hierarchy. 4405// The returned `Policy` will not have an `etag`set because it is a 4406// computed `Policy` across multiple resources. Subtrees of Resource 4407// Manager resource hierarchy with 'under:' prefix will not be expanded. 4408// 4409// - resource: The name of the resource to start computing the effective 4410// `Policy`. 4411func (r *OrganizationsService) GetEffectiveOrgPolicy(resource string, geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest) *OrganizationsGetEffectiveOrgPolicyCall { 4412 c := &OrganizationsGetEffectiveOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4413 c.resource = resource 4414 c.geteffectiveorgpolicyrequest = geteffectiveorgpolicyrequest 4415 return c 4416} 4417 4418// Fields allows partial responses to be retrieved. See 4419// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4420// for more information. 4421func (c *OrganizationsGetEffectiveOrgPolicyCall) Fields(s ...googleapi.Field) *OrganizationsGetEffectiveOrgPolicyCall { 4422 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4423 return c 4424} 4425 4426// Context sets the context to be used in this call's Do method. Any 4427// pending HTTP request will be aborted if the provided context is 4428// canceled. 4429func (c *OrganizationsGetEffectiveOrgPolicyCall) Context(ctx context.Context) *OrganizationsGetEffectiveOrgPolicyCall { 4430 c.ctx_ = ctx 4431 return c 4432} 4433 4434// Header returns an http.Header that can be modified by the caller to 4435// add HTTP headers to the request. 4436func (c *OrganizationsGetEffectiveOrgPolicyCall) Header() http.Header { 4437 if c.header_ == nil { 4438 c.header_ = make(http.Header) 4439 } 4440 return c.header_ 4441} 4442 4443func (c *OrganizationsGetEffectiveOrgPolicyCall) doRequest(alt string) (*http.Response, error) { 4444 reqHeaders := make(http.Header) 4445 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 4446 for k, v := range c.header_ { 4447 reqHeaders[k] = v 4448 } 4449 reqHeaders.Set("User-Agent", c.s.userAgent()) 4450 var body io.Reader = nil 4451 body, err := googleapi.WithoutDataWrapper.JSONReader(c.geteffectiveorgpolicyrequest) 4452 if err != nil { 4453 return nil, err 4454 } 4455 reqHeaders.Set("Content-Type", "application/json") 4456 c.urlParams_.Set("alt", alt) 4457 c.urlParams_.Set("prettyPrint", "false") 4458 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getEffectiveOrgPolicy") 4459 urls += "?" + c.urlParams_.Encode() 4460 req, err := http.NewRequest("POST", urls, body) 4461 if err != nil { 4462 return nil, err 4463 } 4464 req.Header = reqHeaders 4465 googleapi.Expand(req.URL, map[string]string{ 4466 "resource": c.resource, 4467 }) 4468 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4469} 4470 4471// Do executes the "cloudresourcemanager.organizations.getEffectiveOrgPolicy" call. 4472// Exactly one of *OrgPolicy or error will be non-nil. Any non-2xx 4473// status code is an error. Response headers are in either 4474// *OrgPolicy.ServerResponse.Header or (if a response was returned at 4475// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4476// to check whether the returned error was because 4477// http.StatusNotModified was returned. 4478func (c *OrganizationsGetEffectiveOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) { 4479 gensupport.SetOptions(c.urlParams_, opts...) 4480 res, err := c.doRequest("json") 4481 if res != nil && res.StatusCode == http.StatusNotModified { 4482 if res.Body != nil { 4483 res.Body.Close() 4484 } 4485 return nil, &googleapi.Error{ 4486 Code: res.StatusCode, 4487 Header: res.Header, 4488 } 4489 } 4490 if err != nil { 4491 return nil, err 4492 } 4493 defer googleapi.CloseBody(res) 4494 if err := googleapi.CheckResponse(res); err != nil { 4495 return nil, err 4496 } 4497 ret := &OrgPolicy{ 4498 ServerResponse: googleapi.ServerResponse{ 4499 Header: res.Header, 4500 HTTPStatusCode: res.StatusCode, 4501 }, 4502 } 4503 target := &ret 4504 if err := gensupport.DecodeResponse(target, res); err != nil { 4505 return nil, err 4506 } 4507 return ret, nil 4508 // { 4509 // "description": "Gets the effective `Policy` on a resource. This is the result of merging `Policies` in the resource hierarchy. The returned `Policy` will not have an `etag`set because it is a computed `Policy` across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be expanded.", 4510 // "flatPath": "v1/organizations/{organizationsId}:getEffectiveOrgPolicy", 4511 // "httpMethod": "POST", 4512 // "id": "cloudresourcemanager.organizations.getEffectiveOrgPolicy", 4513 // "parameterOrder": [ 4514 // "resource" 4515 // ], 4516 // "parameters": { 4517 // "resource": { 4518 // "description": "The name of the resource to start computing the effective `Policy`.", 4519 // "location": "path", 4520 // "pattern": "^organizations/[^/]+$", 4521 // "required": true, 4522 // "type": "string" 4523 // } 4524 // }, 4525 // "path": "v1/{+resource}:getEffectiveOrgPolicy", 4526 // "request": { 4527 // "$ref": "GetEffectiveOrgPolicyRequest" 4528 // }, 4529 // "response": { 4530 // "$ref": "OrgPolicy" 4531 // }, 4532 // "scopes": [ 4533 // "https://www.googleapis.com/auth/cloud-platform", 4534 // "https://www.googleapis.com/auth/cloud-platform.read-only" 4535 // ] 4536 // } 4537 4538} 4539 4540// method id "cloudresourcemanager.organizations.getIamPolicy": 4541 4542type OrganizationsGetIamPolicyCall struct { 4543 s *Service 4544 resource string 4545 getiampolicyrequest *GetIamPolicyRequest 4546 urlParams_ gensupport.URLParams 4547 ctx_ context.Context 4548 header_ http.Header 4549} 4550 4551// GetIamPolicy: Gets the access control policy for an Organization 4552// resource. May be empty if no such policy or resource exists. The 4553// `resource` field should be the organization's resource name, e.g. 4554// "organizations/123". Authorization requires the Google IAM permission 4555// `resourcemanager.organizations.getIamPolicy` on the specified 4556// organization 4557// 4558// - resource: REQUIRED: The resource for which the policy is being 4559// requested. See the operation documentation for the appropriate 4560// value for this field. 4561func (r *OrganizationsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *OrganizationsGetIamPolicyCall { 4562 c := &OrganizationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4563 c.resource = resource 4564 c.getiampolicyrequest = getiampolicyrequest 4565 return c 4566} 4567 4568// Fields allows partial responses to be retrieved. See 4569// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4570// for more information. 4571func (c *OrganizationsGetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsGetIamPolicyCall { 4572 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4573 return c 4574} 4575 4576// Context sets the context to be used in this call's Do method. Any 4577// pending HTTP request will be aborted if the provided context is 4578// canceled. 4579func (c *OrganizationsGetIamPolicyCall) Context(ctx context.Context) *OrganizationsGetIamPolicyCall { 4580 c.ctx_ = ctx 4581 return c 4582} 4583 4584// Header returns an http.Header that can be modified by the caller to 4585// add HTTP headers to the request. 4586func (c *OrganizationsGetIamPolicyCall) Header() http.Header { 4587 if c.header_ == nil { 4588 c.header_ = make(http.Header) 4589 } 4590 return c.header_ 4591} 4592 4593func (c *OrganizationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 4594 reqHeaders := make(http.Header) 4595 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 4596 for k, v := range c.header_ { 4597 reqHeaders[k] = v 4598 } 4599 reqHeaders.Set("User-Agent", c.s.userAgent()) 4600 var body io.Reader = nil 4601 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 4602 if err != nil { 4603 return nil, err 4604 } 4605 reqHeaders.Set("Content-Type", "application/json") 4606 c.urlParams_.Set("alt", alt) 4607 c.urlParams_.Set("prettyPrint", "false") 4608 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") 4609 urls += "?" + c.urlParams_.Encode() 4610 req, err := http.NewRequest("POST", urls, body) 4611 if err != nil { 4612 return nil, err 4613 } 4614 req.Header = reqHeaders 4615 googleapi.Expand(req.URL, map[string]string{ 4616 "resource": c.resource, 4617 }) 4618 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4619} 4620 4621// Do executes the "cloudresourcemanager.organizations.getIamPolicy" call. 4622// Exactly one of *Policy or error will be non-nil. Any non-2xx status 4623// code is an error. Response headers are in either 4624// *Policy.ServerResponse.Header or (if a response was returned at all) 4625// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4626// check whether the returned error was because http.StatusNotModified 4627// was returned. 4628func (c *OrganizationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 4629 gensupport.SetOptions(c.urlParams_, opts...) 4630 res, err := c.doRequest("json") 4631 if res != nil && res.StatusCode == http.StatusNotModified { 4632 if res.Body != nil { 4633 res.Body.Close() 4634 } 4635 return nil, &googleapi.Error{ 4636 Code: res.StatusCode, 4637 Header: res.Header, 4638 } 4639 } 4640 if err != nil { 4641 return nil, err 4642 } 4643 defer googleapi.CloseBody(res) 4644 if err := googleapi.CheckResponse(res); err != nil { 4645 return nil, err 4646 } 4647 ret := &Policy{ 4648 ServerResponse: googleapi.ServerResponse{ 4649 Header: res.Header, 4650 HTTPStatusCode: res.StatusCode, 4651 }, 4652 } 4653 target := &ret 4654 if err := gensupport.DecodeResponse(target, res); err != nil { 4655 return nil, err 4656 } 4657 return ret, nil 4658 // { 4659 // "description": "Gets the access control policy for an Organization resource. May be empty if no such policy or resource exists. The `resource` field should be the organization's resource name, e.g. \"organizations/123\". Authorization requires the Google IAM permission `resourcemanager.organizations.getIamPolicy` on the specified organization", 4660 // "flatPath": "v1/organizations/{organizationsId}:getIamPolicy", 4661 // "httpMethod": "POST", 4662 // "id": "cloudresourcemanager.organizations.getIamPolicy", 4663 // "parameterOrder": [ 4664 // "resource" 4665 // ], 4666 // "parameters": { 4667 // "resource": { 4668 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 4669 // "location": "path", 4670 // "pattern": "^organizations/[^/]+$", 4671 // "required": true, 4672 // "type": "string" 4673 // } 4674 // }, 4675 // "path": "v1/{+resource}:getIamPolicy", 4676 // "request": { 4677 // "$ref": "GetIamPolicyRequest" 4678 // }, 4679 // "response": { 4680 // "$ref": "Policy" 4681 // }, 4682 // "scopes": [ 4683 // "https://www.googleapis.com/auth/cloud-platform", 4684 // "https://www.googleapis.com/auth/cloud-platform.read-only" 4685 // ] 4686 // } 4687 4688} 4689 4690// method id "cloudresourcemanager.organizations.getOrgPolicy": 4691 4692type OrganizationsGetOrgPolicyCall struct { 4693 s *Service 4694 resource string 4695 getorgpolicyrequest *GetOrgPolicyRequest 4696 urlParams_ gensupport.URLParams 4697 ctx_ context.Context 4698 header_ http.Header 4699} 4700 4701// GetOrgPolicy: Gets a `Policy` on a resource. If no `Policy` is set on 4702// the resource, a `Policy` is returned with default values including 4703// `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value 4704// can be used with `SetOrgPolicy()` to create or update a `Policy` 4705// during read-modify-write. 4706// 4707// - resource: Name of the resource the `Policy` is set on. 4708func (r *OrganizationsService) GetOrgPolicy(resource string, getorgpolicyrequest *GetOrgPolicyRequest) *OrganizationsGetOrgPolicyCall { 4709 c := &OrganizationsGetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4710 c.resource = resource 4711 c.getorgpolicyrequest = getorgpolicyrequest 4712 return c 4713} 4714 4715// Fields allows partial responses to be retrieved. See 4716// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4717// for more information. 4718func (c *OrganizationsGetOrgPolicyCall) Fields(s ...googleapi.Field) *OrganizationsGetOrgPolicyCall { 4719 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4720 return c 4721} 4722 4723// Context sets the context to be used in this call's Do method. Any 4724// pending HTTP request will be aborted if the provided context is 4725// canceled. 4726func (c *OrganizationsGetOrgPolicyCall) Context(ctx context.Context) *OrganizationsGetOrgPolicyCall { 4727 c.ctx_ = ctx 4728 return c 4729} 4730 4731// Header returns an http.Header that can be modified by the caller to 4732// add HTTP headers to the request. 4733func (c *OrganizationsGetOrgPolicyCall) Header() http.Header { 4734 if c.header_ == nil { 4735 c.header_ = make(http.Header) 4736 } 4737 return c.header_ 4738} 4739 4740func (c *OrganizationsGetOrgPolicyCall) doRequest(alt string) (*http.Response, error) { 4741 reqHeaders := make(http.Header) 4742 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 4743 for k, v := range c.header_ { 4744 reqHeaders[k] = v 4745 } 4746 reqHeaders.Set("User-Agent", c.s.userAgent()) 4747 var body io.Reader = nil 4748 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getorgpolicyrequest) 4749 if err != nil { 4750 return nil, err 4751 } 4752 reqHeaders.Set("Content-Type", "application/json") 4753 c.urlParams_.Set("alt", alt) 4754 c.urlParams_.Set("prettyPrint", "false") 4755 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getOrgPolicy") 4756 urls += "?" + c.urlParams_.Encode() 4757 req, err := http.NewRequest("POST", urls, body) 4758 if err != nil { 4759 return nil, err 4760 } 4761 req.Header = reqHeaders 4762 googleapi.Expand(req.URL, map[string]string{ 4763 "resource": c.resource, 4764 }) 4765 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4766} 4767 4768// Do executes the "cloudresourcemanager.organizations.getOrgPolicy" call. 4769// Exactly one of *OrgPolicy or error will be non-nil. Any non-2xx 4770// status code is an error. Response headers are in either 4771// *OrgPolicy.ServerResponse.Header or (if a response was returned at 4772// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4773// to check whether the returned error was because 4774// http.StatusNotModified was returned. 4775func (c *OrganizationsGetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) { 4776 gensupport.SetOptions(c.urlParams_, opts...) 4777 res, err := c.doRequest("json") 4778 if res != nil && res.StatusCode == http.StatusNotModified { 4779 if res.Body != nil { 4780 res.Body.Close() 4781 } 4782 return nil, &googleapi.Error{ 4783 Code: res.StatusCode, 4784 Header: res.Header, 4785 } 4786 } 4787 if err != nil { 4788 return nil, err 4789 } 4790 defer googleapi.CloseBody(res) 4791 if err := googleapi.CheckResponse(res); err != nil { 4792 return nil, err 4793 } 4794 ret := &OrgPolicy{ 4795 ServerResponse: googleapi.ServerResponse{ 4796 Header: res.Header, 4797 HTTPStatusCode: res.StatusCode, 4798 }, 4799 } 4800 target := &ret 4801 if err := gensupport.DecodeResponse(target, res); err != nil { 4802 return nil, err 4803 } 4804 return ret, nil 4805 // { 4806 // "description": "Gets a `Policy` on a resource. If no `Policy` is set on the resource, a `Policy` is returned with default values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can be used with `SetOrgPolicy()` to create or update a `Policy` during read-modify-write.", 4807 // "flatPath": "v1/organizations/{organizationsId}:getOrgPolicy", 4808 // "httpMethod": "POST", 4809 // "id": "cloudresourcemanager.organizations.getOrgPolicy", 4810 // "parameterOrder": [ 4811 // "resource" 4812 // ], 4813 // "parameters": { 4814 // "resource": { 4815 // "description": "Name of the resource the `Policy` is set on.", 4816 // "location": "path", 4817 // "pattern": "^organizations/[^/]+$", 4818 // "required": true, 4819 // "type": "string" 4820 // } 4821 // }, 4822 // "path": "v1/{+resource}:getOrgPolicy", 4823 // "request": { 4824 // "$ref": "GetOrgPolicyRequest" 4825 // }, 4826 // "response": { 4827 // "$ref": "OrgPolicy" 4828 // }, 4829 // "scopes": [ 4830 // "https://www.googleapis.com/auth/cloud-platform", 4831 // "https://www.googleapis.com/auth/cloud-platform.read-only" 4832 // ] 4833 // } 4834 4835} 4836 4837// method id "cloudresourcemanager.organizations.listAvailableOrgPolicyConstraints": 4838 4839type OrganizationsListAvailableOrgPolicyConstraintsCall struct { 4840 s *Service 4841 resource string 4842 listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest 4843 urlParams_ gensupport.URLParams 4844 ctx_ context.Context 4845 header_ http.Header 4846} 4847 4848// ListAvailableOrgPolicyConstraints: Lists `Constraints` that could be 4849// applied on the specified resource. 4850// 4851// - resource: Name of the resource to list `Constraints` for. 4852func (r *OrganizationsService) ListAvailableOrgPolicyConstraints(resource string, listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest) *OrganizationsListAvailableOrgPolicyConstraintsCall { 4853 c := &OrganizationsListAvailableOrgPolicyConstraintsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4854 c.resource = resource 4855 c.listavailableorgpolicyconstraintsrequest = listavailableorgpolicyconstraintsrequest 4856 return c 4857} 4858 4859// Fields allows partial responses to be retrieved. See 4860// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4861// for more information. 4862func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) Fields(s ...googleapi.Field) *OrganizationsListAvailableOrgPolicyConstraintsCall { 4863 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4864 return c 4865} 4866 4867// Context sets the context to be used in this call's Do method. Any 4868// pending HTTP request will be aborted if the provided context is 4869// canceled. 4870func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) Context(ctx context.Context) *OrganizationsListAvailableOrgPolicyConstraintsCall { 4871 c.ctx_ = ctx 4872 return c 4873} 4874 4875// Header returns an http.Header that can be modified by the caller to 4876// add HTTP headers to the request. 4877func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) Header() http.Header { 4878 if c.header_ == nil { 4879 c.header_ = make(http.Header) 4880 } 4881 return c.header_ 4882} 4883 4884func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) doRequest(alt string) (*http.Response, error) { 4885 reqHeaders := make(http.Header) 4886 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 4887 for k, v := range c.header_ { 4888 reqHeaders[k] = v 4889 } 4890 reqHeaders.Set("User-Agent", c.s.userAgent()) 4891 var body io.Reader = nil 4892 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listavailableorgpolicyconstraintsrequest) 4893 if err != nil { 4894 return nil, err 4895 } 4896 reqHeaders.Set("Content-Type", "application/json") 4897 c.urlParams_.Set("alt", alt) 4898 c.urlParams_.Set("prettyPrint", "false") 4899 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listAvailableOrgPolicyConstraints") 4900 urls += "?" + c.urlParams_.Encode() 4901 req, err := http.NewRequest("POST", urls, body) 4902 if err != nil { 4903 return nil, err 4904 } 4905 req.Header = reqHeaders 4906 googleapi.Expand(req.URL, map[string]string{ 4907 "resource": c.resource, 4908 }) 4909 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4910} 4911 4912// Do executes the "cloudresourcemanager.organizations.listAvailableOrgPolicyConstraints" call. 4913// Exactly one of *ListAvailableOrgPolicyConstraintsResponse or error 4914// will be non-nil. Any non-2xx status code is an error. Response 4915// headers are in either 4916// *ListAvailableOrgPolicyConstraintsResponse.ServerResponse.Header or 4917// (if a response was returned at all) in 4918// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4919// whether the returned error was because http.StatusNotModified was 4920// returned. 4921func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) Do(opts ...googleapi.CallOption) (*ListAvailableOrgPolicyConstraintsResponse, error) { 4922 gensupport.SetOptions(c.urlParams_, opts...) 4923 res, err := c.doRequest("json") 4924 if res != nil && res.StatusCode == http.StatusNotModified { 4925 if res.Body != nil { 4926 res.Body.Close() 4927 } 4928 return nil, &googleapi.Error{ 4929 Code: res.StatusCode, 4930 Header: res.Header, 4931 } 4932 } 4933 if err != nil { 4934 return nil, err 4935 } 4936 defer googleapi.CloseBody(res) 4937 if err := googleapi.CheckResponse(res); err != nil { 4938 return nil, err 4939 } 4940 ret := &ListAvailableOrgPolicyConstraintsResponse{ 4941 ServerResponse: googleapi.ServerResponse{ 4942 Header: res.Header, 4943 HTTPStatusCode: res.StatusCode, 4944 }, 4945 } 4946 target := &ret 4947 if err := gensupport.DecodeResponse(target, res); err != nil { 4948 return nil, err 4949 } 4950 return ret, nil 4951 // { 4952 // "description": "Lists `Constraints` that could be applied on the specified resource.", 4953 // "flatPath": "v1/organizations/{organizationsId}:listAvailableOrgPolicyConstraints", 4954 // "httpMethod": "POST", 4955 // "id": "cloudresourcemanager.organizations.listAvailableOrgPolicyConstraints", 4956 // "parameterOrder": [ 4957 // "resource" 4958 // ], 4959 // "parameters": { 4960 // "resource": { 4961 // "description": "Name of the resource to list `Constraints` for.", 4962 // "location": "path", 4963 // "pattern": "^organizations/[^/]+$", 4964 // "required": true, 4965 // "type": "string" 4966 // } 4967 // }, 4968 // "path": "v1/{+resource}:listAvailableOrgPolicyConstraints", 4969 // "request": { 4970 // "$ref": "ListAvailableOrgPolicyConstraintsRequest" 4971 // }, 4972 // "response": { 4973 // "$ref": "ListAvailableOrgPolicyConstraintsResponse" 4974 // }, 4975 // "scopes": [ 4976 // "https://www.googleapis.com/auth/cloud-platform", 4977 // "https://www.googleapis.com/auth/cloud-platform.read-only" 4978 // ] 4979 // } 4980 4981} 4982 4983// Pages invokes f for each page of results. 4984// A non-nil error returned from f will halt the iteration. 4985// The provided context supersedes any context provided to the Context method. 4986func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) Pages(ctx context.Context, f func(*ListAvailableOrgPolicyConstraintsResponse) error) error { 4987 c.ctx_ = ctx 4988 defer func(pt string) { c.listavailableorgpolicyconstraintsrequest.PageToken = pt }(c.listavailableorgpolicyconstraintsrequest.PageToken) // reset paging to original point 4989 for { 4990 x, err := c.Do() 4991 if err != nil { 4992 return err 4993 } 4994 if err := f(x); err != nil { 4995 return err 4996 } 4997 if x.NextPageToken == "" { 4998 return nil 4999 } 5000 c.listavailableorgpolicyconstraintsrequest.PageToken = x.NextPageToken 5001 } 5002} 5003 5004// method id "cloudresourcemanager.organizations.listOrgPolicies": 5005 5006type OrganizationsListOrgPoliciesCall struct { 5007 s *Service 5008 resource string 5009 listorgpoliciesrequest *ListOrgPoliciesRequest 5010 urlParams_ gensupport.URLParams 5011 ctx_ context.Context 5012 header_ http.Header 5013} 5014 5015// ListOrgPolicies: Lists all the `Policies` set for a particular 5016// resource. 5017// 5018// - resource: Name of the resource to list Policies for. 5019func (r *OrganizationsService) ListOrgPolicies(resource string, listorgpoliciesrequest *ListOrgPoliciesRequest) *OrganizationsListOrgPoliciesCall { 5020 c := &OrganizationsListOrgPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5021 c.resource = resource 5022 c.listorgpoliciesrequest = listorgpoliciesrequest 5023 return c 5024} 5025 5026// Fields allows partial responses to be retrieved. See 5027// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5028// for more information. 5029func (c *OrganizationsListOrgPoliciesCall) Fields(s ...googleapi.Field) *OrganizationsListOrgPoliciesCall { 5030 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5031 return c 5032} 5033 5034// Context sets the context to be used in this call's Do method. Any 5035// pending HTTP request will be aborted if the provided context is 5036// canceled. 5037func (c *OrganizationsListOrgPoliciesCall) Context(ctx context.Context) *OrganizationsListOrgPoliciesCall { 5038 c.ctx_ = ctx 5039 return c 5040} 5041 5042// Header returns an http.Header that can be modified by the caller to 5043// add HTTP headers to the request. 5044func (c *OrganizationsListOrgPoliciesCall) Header() http.Header { 5045 if c.header_ == nil { 5046 c.header_ = make(http.Header) 5047 } 5048 return c.header_ 5049} 5050 5051func (c *OrganizationsListOrgPoliciesCall) doRequest(alt string) (*http.Response, error) { 5052 reqHeaders := make(http.Header) 5053 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 5054 for k, v := range c.header_ { 5055 reqHeaders[k] = v 5056 } 5057 reqHeaders.Set("User-Agent", c.s.userAgent()) 5058 var body io.Reader = nil 5059 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listorgpoliciesrequest) 5060 if err != nil { 5061 return nil, err 5062 } 5063 reqHeaders.Set("Content-Type", "application/json") 5064 c.urlParams_.Set("alt", alt) 5065 c.urlParams_.Set("prettyPrint", "false") 5066 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listOrgPolicies") 5067 urls += "?" + c.urlParams_.Encode() 5068 req, err := http.NewRequest("POST", urls, body) 5069 if err != nil { 5070 return nil, err 5071 } 5072 req.Header = reqHeaders 5073 googleapi.Expand(req.URL, map[string]string{ 5074 "resource": c.resource, 5075 }) 5076 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5077} 5078 5079// Do executes the "cloudresourcemanager.organizations.listOrgPolicies" call. 5080// Exactly one of *ListOrgPoliciesResponse or error will be non-nil. Any 5081// non-2xx status code is an error. Response headers are in either 5082// *ListOrgPoliciesResponse.ServerResponse.Header or (if a response was 5083// returned at all) in error.(*googleapi.Error).Header. Use 5084// googleapi.IsNotModified to check whether the returned error was 5085// because http.StatusNotModified was returned. 5086func (c *OrganizationsListOrgPoliciesCall) Do(opts ...googleapi.CallOption) (*ListOrgPoliciesResponse, error) { 5087 gensupport.SetOptions(c.urlParams_, opts...) 5088 res, err := c.doRequest("json") 5089 if res != nil && res.StatusCode == http.StatusNotModified { 5090 if res.Body != nil { 5091 res.Body.Close() 5092 } 5093 return nil, &googleapi.Error{ 5094 Code: res.StatusCode, 5095 Header: res.Header, 5096 } 5097 } 5098 if err != nil { 5099 return nil, err 5100 } 5101 defer googleapi.CloseBody(res) 5102 if err := googleapi.CheckResponse(res); err != nil { 5103 return nil, err 5104 } 5105 ret := &ListOrgPoliciesResponse{ 5106 ServerResponse: googleapi.ServerResponse{ 5107 Header: res.Header, 5108 HTTPStatusCode: res.StatusCode, 5109 }, 5110 } 5111 target := &ret 5112 if err := gensupport.DecodeResponse(target, res); err != nil { 5113 return nil, err 5114 } 5115 return ret, nil 5116 // { 5117 // "description": "Lists all the `Policies` set for a particular resource.", 5118 // "flatPath": "v1/organizations/{organizationsId}:listOrgPolicies", 5119 // "httpMethod": "POST", 5120 // "id": "cloudresourcemanager.organizations.listOrgPolicies", 5121 // "parameterOrder": [ 5122 // "resource" 5123 // ], 5124 // "parameters": { 5125 // "resource": { 5126 // "description": "Name of the resource to list Policies for.", 5127 // "location": "path", 5128 // "pattern": "^organizations/[^/]+$", 5129 // "required": true, 5130 // "type": "string" 5131 // } 5132 // }, 5133 // "path": "v1/{+resource}:listOrgPolicies", 5134 // "request": { 5135 // "$ref": "ListOrgPoliciesRequest" 5136 // }, 5137 // "response": { 5138 // "$ref": "ListOrgPoliciesResponse" 5139 // }, 5140 // "scopes": [ 5141 // "https://www.googleapis.com/auth/cloud-platform", 5142 // "https://www.googleapis.com/auth/cloud-platform.read-only" 5143 // ] 5144 // } 5145 5146} 5147 5148// Pages invokes f for each page of results. 5149// A non-nil error returned from f will halt the iteration. 5150// The provided context supersedes any context provided to the Context method. 5151func (c *OrganizationsListOrgPoliciesCall) Pages(ctx context.Context, f func(*ListOrgPoliciesResponse) error) error { 5152 c.ctx_ = ctx 5153 defer func(pt string) { c.listorgpoliciesrequest.PageToken = pt }(c.listorgpoliciesrequest.PageToken) // reset paging to original point 5154 for { 5155 x, err := c.Do() 5156 if err != nil { 5157 return err 5158 } 5159 if err := f(x); err != nil { 5160 return err 5161 } 5162 if x.NextPageToken == "" { 5163 return nil 5164 } 5165 c.listorgpoliciesrequest.PageToken = x.NextPageToken 5166 } 5167} 5168 5169// method id "cloudresourcemanager.organizations.search": 5170 5171type OrganizationsSearchCall struct { 5172 s *Service 5173 searchorganizationsrequest *SearchOrganizationsRequest 5174 urlParams_ gensupport.URLParams 5175 ctx_ context.Context 5176 header_ http.Header 5177} 5178 5179// Search: Searches Organization resources that are visible to the user 5180// and satisfy the specified filter. This method returns Organizations 5181// in an unspecified order. New Organizations do not necessarily appear 5182// at the end of the results. Search will only return organizations on 5183// which the user has the permission `resourcemanager.organizations.get` 5184func (r *OrganizationsService) Search(searchorganizationsrequest *SearchOrganizationsRequest) *OrganizationsSearchCall { 5185 c := &OrganizationsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5186 c.searchorganizationsrequest = searchorganizationsrequest 5187 return c 5188} 5189 5190// Fields allows partial responses to be retrieved. See 5191// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5192// for more information. 5193func (c *OrganizationsSearchCall) Fields(s ...googleapi.Field) *OrganizationsSearchCall { 5194 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5195 return c 5196} 5197 5198// Context sets the context to be used in this call's Do method. Any 5199// pending HTTP request will be aborted if the provided context is 5200// canceled. 5201func (c *OrganizationsSearchCall) Context(ctx context.Context) *OrganizationsSearchCall { 5202 c.ctx_ = ctx 5203 return c 5204} 5205 5206// Header returns an http.Header that can be modified by the caller to 5207// add HTTP headers to the request. 5208func (c *OrganizationsSearchCall) Header() http.Header { 5209 if c.header_ == nil { 5210 c.header_ = make(http.Header) 5211 } 5212 return c.header_ 5213} 5214 5215func (c *OrganizationsSearchCall) doRequest(alt string) (*http.Response, error) { 5216 reqHeaders := make(http.Header) 5217 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 5218 for k, v := range c.header_ { 5219 reqHeaders[k] = v 5220 } 5221 reqHeaders.Set("User-Agent", c.s.userAgent()) 5222 var body io.Reader = nil 5223 body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchorganizationsrequest) 5224 if err != nil { 5225 return nil, err 5226 } 5227 reqHeaders.Set("Content-Type", "application/json") 5228 c.urlParams_.Set("alt", alt) 5229 c.urlParams_.Set("prettyPrint", "false") 5230 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/organizations:search") 5231 urls += "?" + c.urlParams_.Encode() 5232 req, err := http.NewRequest("POST", urls, body) 5233 if err != nil { 5234 return nil, err 5235 } 5236 req.Header = reqHeaders 5237 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5238} 5239 5240// Do executes the "cloudresourcemanager.organizations.search" call. 5241// Exactly one of *SearchOrganizationsResponse or error will be non-nil. 5242// Any non-2xx status code is an error. Response headers are in either 5243// *SearchOrganizationsResponse.ServerResponse.Header or (if a response 5244// was returned at all) in error.(*googleapi.Error).Header. Use 5245// googleapi.IsNotModified to check whether the returned error was 5246// because http.StatusNotModified was returned. 5247func (c *OrganizationsSearchCall) Do(opts ...googleapi.CallOption) (*SearchOrganizationsResponse, error) { 5248 gensupport.SetOptions(c.urlParams_, opts...) 5249 res, err := c.doRequest("json") 5250 if res != nil && res.StatusCode == http.StatusNotModified { 5251 if res.Body != nil { 5252 res.Body.Close() 5253 } 5254 return nil, &googleapi.Error{ 5255 Code: res.StatusCode, 5256 Header: res.Header, 5257 } 5258 } 5259 if err != nil { 5260 return nil, err 5261 } 5262 defer googleapi.CloseBody(res) 5263 if err := googleapi.CheckResponse(res); err != nil { 5264 return nil, err 5265 } 5266 ret := &SearchOrganizationsResponse{ 5267 ServerResponse: googleapi.ServerResponse{ 5268 Header: res.Header, 5269 HTTPStatusCode: res.StatusCode, 5270 }, 5271 } 5272 target := &ret 5273 if err := gensupport.DecodeResponse(target, res); err != nil { 5274 return nil, err 5275 } 5276 return ret, nil 5277 // { 5278 // "description": "Searches Organization resources that are visible to the user and satisfy the specified filter. This method returns Organizations in an unspecified order. New Organizations do not necessarily appear at the end of the results. Search will only return organizations on which the user has the permission `resourcemanager.organizations.get`", 5279 // "flatPath": "v1/organizations:search", 5280 // "httpMethod": "POST", 5281 // "id": "cloudresourcemanager.organizations.search", 5282 // "parameterOrder": [], 5283 // "parameters": {}, 5284 // "path": "v1/organizations:search", 5285 // "request": { 5286 // "$ref": "SearchOrganizationsRequest" 5287 // }, 5288 // "response": { 5289 // "$ref": "SearchOrganizationsResponse" 5290 // }, 5291 // "scopes": [ 5292 // "https://www.googleapis.com/auth/cloud-platform", 5293 // "https://www.googleapis.com/auth/cloud-platform.read-only" 5294 // ] 5295 // } 5296 5297} 5298 5299// Pages invokes f for each page of results. 5300// A non-nil error returned from f will halt the iteration. 5301// The provided context supersedes any context provided to the Context method. 5302func (c *OrganizationsSearchCall) Pages(ctx context.Context, f func(*SearchOrganizationsResponse) error) error { 5303 c.ctx_ = ctx 5304 defer func(pt string) { c.searchorganizationsrequest.PageToken = pt }(c.searchorganizationsrequest.PageToken) // reset paging to original point 5305 for { 5306 x, err := c.Do() 5307 if err != nil { 5308 return err 5309 } 5310 if err := f(x); err != nil { 5311 return err 5312 } 5313 if x.NextPageToken == "" { 5314 return nil 5315 } 5316 c.searchorganizationsrequest.PageToken = x.NextPageToken 5317 } 5318} 5319 5320// method id "cloudresourcemanager.organizations.setIamPolicy": 5321 5322type OrganizationsSetIamPolicyCall struct { 5323 s *Service 5324 resource string 5325 setiampolicyrequest *SetIamPolicyRequest 5326 urlParams_ gensupport.URLParams 5327 ctx_ context.Context 5328 header_ http.Header 5329} 5330 5331// SetIamPolicy: Sets the access control policy on an Organization 5332// resource. Replaces any existing policy. The `resource` field should 5333// be the organization's resource name, e.g. "organizations/123". 5334// Authorization requires the Google IAM permission 5335// `resourcemanager.organizations.setIamPolicy` on the specified 5336// organization 5337// 5338// - resource: REQUIRED: The resource for which the policy is being 5339// specified. See the operation documentation for the appropriate 5340// value for this field. 5341func (r *OrganizationsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *OrganizationsSetIamPolicyCall { 5342 c := &OrganizationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5343 c.resource = resource 5344 c.setiampolicyrequest = setiampolicyrequest 5345 return c 5346} 5347 5348// Fields allows partial responses to be retrieved. See 5349// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5350// for more information. 5351func (c *OrganizationsSetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSetIamPolicyCall { 5352 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5353 return c 5354} 5355 5356// Context sets the context to be used in this call's Do method. Any 5357// pending HTTP request will be aborted if the provided context is 5358// canceled. 5359func (c *OrganizationsSetIamPolicyCall) Context(ctx context.Context) *OrganizationsSetIamPolicyCall { 5360 c.ctx_ = ctx 5361 return c 5362} 5363 5364// Header returns an http.Header that can be modified by the caller to 5365// add HTTP headers to the request. 5366func (c *OrganizationsSetIamPolicyCall) Header() http.Header { 5367 if c.header_ == nil { 5368 c.header_ = make(http.Header) 5369 } 5370 return c.header_ 5371} 5372 5373func (c *OrganizationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 5374 reqHeaders := make(http.Header) 5375 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 5376 for k, v := range c.header_ { 5377 reqHeaders[k] = v 5378 } 5379 reqHeaders.Set("User-Agent", c.s.userAgent()) 5380 var body io.Reader = nil 5381 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 5382 if err != nil { 5383 return nil, err 5384 } 5385 reqHeaders.Set("Content-Type", "application/json") 5386 c.urlParams_.Set("alt", alt) 5387 c.urlParams_.Set("prettyPrint", "false") 5388 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") 5389 urls += "?" + c.urlParams_.Encode() 5390 req, err := http.NewRequest("POST", urls, body) 5391 if err != nil { 5392 return nil, err 5393 } 5394 req.Header = reqHeaders 5395 googleapi.Expand(req.URL, map[string]string{ 5396 "resource": c.resource, 5397 }) 5398 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5399} 5400 5401// Do executes the "cloudresourcemanager.organizations.setIamPolicy" call. 5402// Exactly one of *Policy or error will be non-nil. Any non-2xx status 5403// code is an error. Response headers are in either 5404// *Policy.ServerResponse.Header or (if a response was returned at all) 5405// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5406// check whether the returned error was because http.StatusNotModified 5407// was returned. 5408func (c *OrganizationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 5409 gensupport.SetOptions(c.urlParams_, opts...) 5410 res, err := c.doRequest("json") 5411 if res != nil && res.StatusCode == http.StatusNotModified { 5412 if res.Body != nil { 5413 res.Body.Close() 5414 } 5415 return nil, &googleapi.Error{ 5416 Code: res.StatusCode, 5417 Header: res.Header, 5418 } 5419 } 5420 if err != nil { 5421 return nil, err 5422 } 5423 defer googleapi.CloseBody(res) 5424 if err := googleapi.CheckResponse(res); err != nil { 5425 return nil, err 5426 } 5427 ret := &Policy{ 5428 ServerResponse: googleapi.ServerResponse{ 5429 Header: res.Header, 5430 HTTPStatusCode: res.StatusCode, 5431 }, 5432 } 5433 target := &ret 5434 if err := gensupport.DecodeResponse(target, res); err != nil { 5435 return nil, err 5436 } 5437 return ret, nil 5438 // { 5439 // "description": "Sets the access control policy on an Organization resource. Replaces any existing policy. The `resource` field should be the organization's resource name, e.g. \"organizations/123\". Authorization requires the Google IAM permission `resourcemanager.organizations.setIamPolicy` on the specified organization", 5440 // "flatPath": "v1/organizations/{organizationsId}:setIamPolicy", 5441 // "httpMethod": "POST", 5442 // "id": "cloudresourcemanager.organizations.setIamPolicy", 5443 // "parameterOrder": [ 5444 // "resource" 5445 // ], 5446 // "parameters": { 5447 // "resource": { 5448 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 5449 // "location": "path", 5450 // "pattern": "^organizations/[^/]+$", 5451 // "required": true, 5452 // "type": "string" 5453 // } 5454 // }, 5455 // "path": "v1/{+resource}:setIamPolicy", 5456 // "request": { 5457 // "$ref": "SetIamPolicyRequest" 5458 // }, 5459 // "response": { 5460 // "$ref": "Policy" 5461 // }, 5462 // "scopes": [ 5463 // "https://www.googleapis.com/auth/cloud-platform" 5464 // ] 5465 // } 5466 5467} 5468 5469// method id "cloudresourcemanager.organizations.setOrgPolicy": 5470 5471type OrganizationsSetOrgPolicyCall struct { 5472 s *Service 5473 resource string 5474 setorgpolicyrequest *SetOrgPolicyRequest 5475 urlParams_ gensupport.URLParams 5476 ctx_ context.Context 5477 header_ http.Header 5478} 5479 5480// SetOrgPolicy: Updates the specified `Policy` on the resource. Creates 5481// a new `Policy` for that `Constraint` on the resource if one does not 5482// exist. Not supplying an `etag` on the request `Policy` results in an 5483// unconditional write of the `Policy`. 5484// 5485// - resource: Resource name of the resource to attach the `Policy`. 5486func (r *OrganizationsService) SetOrgPolicy(resource string, setorgpolicyrequest *SetOrgPolicyRequest) *OrganizationsSetOrgPolicyCall { 5487 c := &OrganizationsSetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5488 c.resource = resource 5489 c.setorgpolicyrequest = setorgpolicyrequest 5490 return c 5491} 5492 5493// Fields allows partial responses to be retrieved. See 5494// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5495// for more information. 5496func (c *OrganizationsSetOrgPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSetOrgPolicyCall { 5497 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5498 return c 5499} 5500 5501// Context sets the context to be used in this call's Do method. Any 5502// pending HTTP request will be aborted if the provided context is 5503// canceled. 5504func (c *OrganizationsSetOrgPolicyCall) Context(ctx context.Context) *OrganizationsSetOrgPolicyCall { 5505 c.ctx_ = ctx 5506 return c 5507} 5508 5509// Header returns an http.Header that can be modified by the caller to 5510// add HTTP headers to the request. 5511func (c *OrganizationsSetOrgPolicyCall) Header() http.Header { 5512 if c.header_ == nil { 5513 c.header_ = make(http.Header) 5514 } 5515 return c.header_ 5516} 5517 5518func (c *OrganizationsSetOrgPolicyCall) doRequest(alt string) (*http.Response, error) { 5519 reqHeaders := make(http.Header) 5520 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 5521 for k, v := range c.header_ { 5522 reqHeaders[k] = v 5523 } 5524 reqHeaders.Set("User-Agent", c.s.userAgent()) 5525 var body io.Reader = nil 5526 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setorgpolicyrequest) 5527 if err != nil { 5528 return nil, err 5529 } 5530 reqHeaders.Set("Content-Type", "application/json") 5531 c.urlParams_.Set("alt", alt) 5532 c.urlParams_.Set("prettyPrint", "false") 5533 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setOrgPolicy") 5534 urls += "?" + c.urlParams_.Encode() 5535 req, err := http.NewRequest("POST", urls, body) 5536 if err != nil { 5537 return nil, err 5538 } 5539 req.Header = reqHeaders 5540 googleapi.Expand(req.URL, map[string]string{ 5541 "resource": c.resource, 5542 }) 5543 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5544} 5545 5546// Do executes the "cloudresourcemanager.organizations.setOrgPolicy" call. 5547// Exactly one of *OrgPolicy or error will be non-nil. Any non-2xx 5548// status code is an error. Response headers are in either 5549// *OrgPolicy.ServerResponse.Header or (if a response was returned at 5550// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5551// to check whether the returned error was because 5552// http.StatusNotModified was returned. 5553func (c *OrganizationsSetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) { 5554 gensupport.SetOptions(c.urlParams_, opts...) 5555 res, err := c.doRequest("json") 5556 if res != nil && res.StatusCode == http.StatusNotModified { 5557 if res.Body != nil { 5558 res.Body.Close() 5559 } 5560 return nil, &googleapi.Error{ 5561 Code: res.StatusCode, 5562 Header: res.Header, 5563 } 5564 } 5565 if err != nil { 5566 return nil, err 5567 } 5568 defer googleapi.CloseBody(res) 5569 if err := googleapi.CheckResponse(res); err != nil { 5570 return nil, err 5571 } 5572 ret := &OrgPolicy{ 5573 ServerResponse: googleapi.ServerResponse{ 5574 Header: res.Header, 5575 HTTPStatusCode: res.StatusCode, 5576 }, 5577 } 5578 target := &ret 5579 if err := gensupport.DecodeResponse(target, res); err != nil { 5580 return nil, err 5581 } 5582 return ret, nil 5583 // { 5584 // "description": "Updates the specified `Policy` on the resource. Creates a new `Policy` for that `Constraint` on the resource if one does not exist. Not supplying an `etag` on the request `Policy` results in an unconditional write of the `Policy`.", 5585 // "flatPath": "v1/organizations/{organizationsId}:setOrgPolicy", 5586 // "httpMethod": "POST", 5587 // "id": "cloudresourcemanager.organizations.setOrgPolicy", 5588 // "parameterOrder": [ 5589 // "resource" 5590 // ], 5591 // "parameters": { 5592 // "resource": { 5593 // "description": "Resource name of the resource to attach the `Policy`.", 5594 // "location": "path", 5595 // "pattern": "^organizations/[^/]+$", 5596 // "required": true, 5597 // "type": "string" 5598 // } 5599 // }, 5600 // "path": "v1/{+resource}:setOrgPolicy", 5601 // "request": { 5602 // "$ref": "SetOrgPolicyRequest" 5603 // }, 5604 // "response": { 5605 // "$ref": "OrgPolicy" 5606 // }, 5607 // "scopes": [ 5608 // "https://www.googleapis.com/auth/cloud-platform" 5609 // ] 5610 // } 5611 5612} 5613 5614// method id "cloudresourcemanager.organizations.testIamPermissions": 5615 5616type OrganizationsTestIamPermissionsCall struct { 5617 s *Service 5618 resource string 5619 testiampermissionsrequest *TestIamPermissionsRequest 5620 urlParams_ gensupport.URLParams 5621 ctx_ context.Context 5622 header_ http.Header 5623} 5624 5625// TestIamPermissions: Returns permissions that a caller has on the 5626// specified Organization. The `resource` field should be the 5627// organization's resource name, e.g. "organizations/123". There are no 5628// permissions required for making this API call. 5629// 5630// - resource: REQUIRED: The resource for which the policy detail is 5631// being requested. See the operation documentation for the 5632// appropriate value for this field. 5633func (r *OrganizationsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *OrganizationsTestIamPermissionsCall { 5634 c := &OrganizationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5635 c.resource = resource 5636 c.testiampermissionsrequest = testiampermissionsrequest 5637 return c 5638} 5639 5640// Fields allows partial responses to be retrieved. See 5641// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5642// for more information. 5643func (c *OrganizationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *OrganizationsTestIamPermissionsCall { 5644 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5645 return c 5646} 5647 5648// Context sets the context to be used in this call's Do method. Any 5649// pending HTTP request will be aborted if the provided context is 5650// canceled. 5651func (c *OrganizationsTestIamPermissionsCall) Context(ctx context.Context) *OrganizationsTestIamPermissionsCall { 5652 c.ctx_ = ctx 5653 return c 5654} 5655 5656// Header returns an http.Header that can be modified by the caller to 5657// add HTTP headers to the request. 5658func (c *OrganizationsTestIamPermissionsCall) Header() http.Header { 5659 if c.header_ == nil { 5660 c.header_ = make(http.Header) 5661 } 5662 return c.header_ 5663} 5664 5665func (c *OrganizationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 5666 reqHeaders := make(http.Header) 5667 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 5668 for k, v := range c.header_ { 5669 reqHeaders[k] = v 5670 } 5671 reqHeaders.Set("User-Agent", c.s.userAgent()) 5672 var body io.Reader = nil 5673 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 5674 if err != nil { 5675 return nil, err 5676 } 5677 reqHeaders.Set("Content-Type", "application/json") 5678 c.urlParams_.Set("alt", alt) 5679 c.urlParams_.Set("prettyPrint", "false") 5680 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") 5681 urls += "?" + c.urlParams_.Encode() 5682 req, err := http.NewRequest("POST", urls, body) 5683 if err != nil { 5684 return nil, err 5685 } 5686 req.Header = reqHeaders 5687 googleapi.Expand(req.URL, map[string]string{ 5688 "resource": c.resource, 5689 }) 5690 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5691} 5692 5693// Do executes the "cloudresourcemanager.organizations.testIamPermissions" call. 5694// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 5695// Any non-2xx status code is an error. Response headers are in either 5696// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 5697// was returned at all) in error.(*googleapi.Error).Header. Use 5698// googleapi.IsNotModified to check whether the returned error was 5699// because http.StatusNotModified was returned. 5700func (c *OrganizationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 5701 gensupport.SetOptions(c.urlParams_, opts...) 5702 res, err := c.doRequest("json") 5703 if res != nil && res.StatusCode == http.StatusNotModified { 5704 if res.Body != nil { 5705 res.Body.Close() 5706 } 5707 return nil, &googleapi.Error{ 5708 Code: res.StatusCode, 5709 Header: res.Header, 5710 } 5711 } 5712 if err != nil { 5713 return nil, err 5714 } 5715 defer googleapi.CloseBody(res) 5716 if err := googleapi.CheckResponse(res); err != nil { 5717 return nil, err 5718 } 5719 ret := &TestIamPermissionsResponse{ 5720 ServerResponse: googleapi.ServerResponse{ 5721 Header: res.Header, 5722 HTTPStatusCode: res.StatusCode, 5723 }, 5724 } 5725 target := &ret 5726 if err := gensupport.DecodeResponse(target, res); err != nil { 5727 return nil, err 5728 } 5729 return ret, nil 5730 // { 5731 // "description": "Returns permissions that a caller has on the specified Organization. The `resource` field should be the organization's resource name, e.g. \"organizations/123\". There are no permissions required for making this API call.", 5732 // "flatPath": "v1/organizations/{organizationsId}:testIamPermissions", 5733 // "httpMethod": "POST", 5734 // "id": "cloudresourcemanager.organizations.testIamPermissions", 5735 // "parameterOrder": [ 5736 // "resource" 5737 // ], 5738 // "parameters": { 5739 // "resource": { 5740 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 5741 // "location": "path", 5742 // "pattern": "^organizations/[^/]+$", 5743 // "required": true, 5744 // "type": "string" 5745 // } 5746 // }, 5747 // "path": "v1/{+resource}:testIamPermissions", 5748 // "request": { 5749 // "$ref": "TestIamPermissionsRequest" 5750 // }, 5751 // "response": { 5752 // "$ref": "TestIamPermissionsResponse" 5753 // }, 5754 // "scopes": [ 5755 // "https://www.googleapis.com/auth/cloud-platform", 5756 // "https://www.googleapis.com/auth/cloud-platform.read-only" 5757 // ] 5758 // } 5759 5760} 5761 5762// method id "cloudresourcemanager.projects.clearOrgPolicy": 5763 5764type ProjectsClearOrgPolicyCall struct { 5765 s *Service 5766 resource string 5767 clearorgpolicyrequest *ClearOrgPolicyRequest 5768 urlParams_ gensupport.URLParams 5769 ctx_ context.Context 5770 header_ http.Header 5771} 5772 5773// ClearOrgPolicy: Clears a `Policy` from a resource. 5774// 5775// - resource: Name of the resource for the `Policy` to clear. 5776func (r *ProjectsService) ClearOrgPolicy(resource string, clearorgpolicyrequest *ClearOrgPolicyRequest) *ProjectsClearOrgPolicyCall { 5777 c := &ProjectsClearOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5778 c.resource = resource 5779 c.clearorgpolicyrequest = clearorgpolicyrequest 5780 return c 5781} 5782 5783// Fields allows partial responses to be retrieved. See 5784// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5785// for more information. 5786func (c *ProjectsClearOrgPolicyCall) Fields(s ...googleapi.Field) *ProjectsClearOrgPolicyCall { 5787 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5788 return c 5789} 5790 5791// Context sets the context to be used in this call's Do method. Any 5792// pending HTTP request will be aborted if the provided context is 5793// canceled. 5794func (c *ProjectsClearOrgPolicyCall) Context(ctx context.Context) *ProjectsClearOrgPolicyCall { 5795 c.ctx_ = ctx 5796 return c 5797} 5798 5799// Header returns an http.Header that can be modified by the caller to 5800// add HTTP headers to the request. 5801func (c *ProjectsClearOrgPolicyCall) Header() http.Header { 5802 if c.header_ == nil { 5803 c.header_ = make(http.Header) 5804 } 5805 return c.header_ 5806} 5807 5808func (c *ProjectsClearOrgPolicyCall) doRequest(alt string) (*http.Response, error) { 5809 reqHeaders := make(http.Header) 5810 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 5811 for k, v := range c.header_ { 5812 reqHeaders[k] = v 5813 } 5814 reqHeaders.Set("User-Agent", c.s.userAgent()) 5815 var body io.Reader = nil 5816 body, err := googleapi.WithoutDataWrapper.JSONReader(c.clearorgpolicyrequest) 5817 if err != nil { 5818 return nil, err 5819 } 5820 reqHeaders.Set("Content-Type", "application/json") 5821 c.urlParams_.Set("alt", alt) 5822 c.urlParams_.Set("prettyPrint", "false") 5823 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:clearOrgPolicy") 5824 urls += "?" + c.urlParams_.Encode() 5825 req, err := http.NewRequest("POST", urls, body) 5826 if err != nil { 5827 return nil, err 5828 } 5829 req.Header = reqHeaders 5830 googleapi.Expand(req.URL, map[string]string{ 5831 "resource": c.resource, 5832 }) 5833 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5834} 5835 5836// Do executes the "cloudresourcemanager.projects.clearOrgPolicy" call. 5837// Exactly one of *Empty or error will be non-nil. Any non-2xx status 5838// code is an error. Response headers are in either 5839// *Empty.ServerResponse.Header or (if a response was returned at all) 5840// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5841// check whether the returned error was because http.StatusNotModified 5842// was returned. 5843func (c *ProjectsClearOrgPolicyCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 5844 gensupport.SetOptions(c.urlParams_, opts...) 5845 res, err := c.doRequest("json") 5846 if res != nil && res.StatusCode == http.StatusNotModified { 5847 if res.Body != nil { 5848 res.Body.Close() 5849 } 5850 return nil, &googleapi.Error{ 5851 Code: res.StatusCode, 5852 Header: res.Header, 5853 } 5854 } 5855 if err != nil { 5856 return nil, err 5857 } 5858 defer googleapi.CloseBody(res) 5859 if err := googleapi.CheckResponse(res); err != nil { 5860 return nil, err 5861 } 5862 ret := &Empty{ 5863 ServerResponse: googleapi.ServerResponse{ 5864 Header: res.Header, 5865 HTTPStatusCode: res.StatusCode, 5866 }, 5867 } 5868 target := &ret 5869 if err := gensupport.DecodeResponse(target, res); err != nil { 5870 return nil, err 5871 } 5872 return ret, nil 5873 // { 5874 // "description": "Clears a `Policy` from a resource.", 5875 // "flatPath": "v1/projects/{projectsId}:clearOrgPolicy", 5876 // "httpMethod": "POST", 5877 // "id": "cloudresourcemanager.projects.clearOrgPolicy", 5878 // "parameterOrder": [ 5879 // "resource" 5880 // ], 5881 // "parameters": { 5882 // "resource": { 5883 // "description": "Name of the resource for the `Policy` to clear.", 5884 // "location": "path", 5885 // "pattern": "^projects/[^/]+$", 5886 // "required": true, 5887 // "type": "string" 5888 // } 5889 // }, 5890 // "path": "v1/{+resource}:clearOrgPolicy", 5891 // "request": { 5892 // "$ref": "ClearOrgPolicyRequest" 5893 // }, 5894 // "response": { 5895 // "$ref": "Empty" 5896 // }, 5897 // "scopes": [ 5898 // "https://www.googleapis.com/auth/cloud-platform" 5899 // ] 5900 // } 5901 5902} 5903 5904// method id "cloudresourcemanager.projects.create": 5905 5906type ProjectsCreateCall struct { 5907 s *Service 5908 project *Project 5909 urlParams_ gensupport.URLParams 5910 ctx_ context.Context 5911 header_ http.Header 5912} 5913 5914// Create: Request that a new Project be created. The result is an 5915// Operation which can be used to track the creation process. This 5916// process usually takes a few seconds, but can sometimes take much 5917// longer. The tracking Operation is automatically deleted after a few 5918// hours, so there is no need to call DeleteOperation. Authorization 5919// requires the Google IAM permission `resourcemanager.projects.create` 5920// on the specified parent for the new project. The parent is identified 5921// by a specified ResourceId, which must include both an ID and a type, 5922// such as organization. This method does not associate the new project 5923// with a billing account. You can set or update the billing account 5924// associated with a project using the [`projects.updateBillingInfo`] 5925// (/billing/reference/rest/v1/projects/updateBillingInfo) method. 5926func (r *ProjectsService) Create(project *Project) *ProjectsCreateCall { 5927 c := &ProjectsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5928 c.project = project 5929 return c 5930} 5931 5932// Fields allows partial responses to be retrieved. See 5933// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5934// for more information. 5935func (c *ProjectsCreateCall) Fields(s ...googleapi.Field) *ProjectsCreateCall { 5936 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5937 return c 5938} 5939 5940// Context sets the context to be used in this call's Do method. Any 5941// pending HTTP request will be aborted if the provided context is 5942// canceled. 5943func (c *ProjectsCreateCall) Context(ctx context.Context) *ProjectsCreateCall { 5944 c.ctx_ = ctx 5945 return c 5946} 5947 5948// Header returns an http.Header that can be modified by the caller to 5949// add HTTP headers to the request. 5950func (c *ProjectsCreateCall) Header() http.Header { 5951 if c.header_ == nil { 5952 c.header_ = make(http.Header) 5953 } 5954 return c.header_ 5955} 5956 5957func (c *ProjectsCreateCall) doRequest(alt string) (*http.Response, error) { 5958 reqHeaders := make(http.Header) 5959 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 5960 for k, v := range c.header_ { 5961 reqHeaders[k] = v 5962 } 5963 reqHeaders.Set("User-Agent", c.s.userAgent()) 5964 var body io.Reader = nil 5965 body, err := googleapi.WithoutDataWrapper.JSONReader(c.project) 5966 if err != nil { 5967 return nil, err 5968 } 5969 reqHeaders.Set("Content-Type", "application/json") 5970 c.urlParams_.Set("alt", alt) 5971 c.urlParams_.Set("prettyPrint", "false") 5972 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects") 5973 urls += "?" + c.urlParams_.Encode() 5974 req, err := http.NewRequest("POST", urls, body) 5975 if err != nil { 5976 return nil, err 5977 } 5978 req.Header = reqHeaders 5979 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5980} 5981 5982// Do executes the "cloudresourcemanager.projects.create" call. 5983// Exactly one of *Operation or error will be non-nil. Any non-2xx 5984// status code is an error. Response headers are in either 5985// *Operation.ServerResponse.Header or (if a response was returned at 5986// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5987// to check whether the returned error was because 5988// http.StatusNotModified was returned. 5989func (c *ProjectsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5990 gensupport.SetOptions(c.urlParams_, opts...) 5991 res, err := c.doRequest("json") 5992 if res != nil && res.StatusCode == http.StatusNotModified { 5993 if res.Body != nil { 5994 res.Body.Close() 5995 } 5996 return nil, &googleapi.Error{ 5997 Code: res.StatusCode, 5998 Header: res.Header, 5999 } 6000 } 6001 if err != nil { 6002 return nil, err 6003 } 6004 defer googleapi.CloseBody(res) 6005 if err := googleapi.CheckResponse(res); err != nil { 6006 return nil, err 6007 } 6008 ret := &Operation{ 6009 ServerResponse: googleapi.ServerResponse{ 6010 Header: res.Header, 6011 HTTPStatusCode: res.StatusCode, 6012 }, 6013 } 6014 target := &ret 6015 if err := gensupport.DecodeResponse(target, res); err != nil { 6016 return nil, err 6017 } 6018 return ret, nil 6019 // { 6020 // "description": "Request that a new Project be created. The result is an Operation which can be used to track the creation process. This process usually takes a few seconds, but can sometimes take much longer. The tracking Operation is automatically deleted after a few hours, so there is no need to call DeleteOperation. Authorization requires the Google IAM permission `resourcemanager.projects.create` on the specified parent for the new project. The parent is identified by a specified ResourceId, which must include both an ID and a type, such as organization. This method does not associate the new project with a billing account. You can set or update the billing account associated with a project using the [`projects.updateBillingInfo`] (/billing/reference/rest/v1/projects/updateBillingInfo) method.", 6021 // "flatPath": "v1/projects", 6022 // "httpMethod": "POST", 6023 // "id": "cloudresourcemanager.projects.create", 6024 // "parameterOrder": [], 6025 // "parameters": {}, 6026 // "path": "v1/projects", 6027 // "request": { 6028 // "$ref": "Project" 6029 // }, 6030 // "response": { 6031 // "$ref": "Operation" 6032 // }, 6033 // "scopes": [ 6034 // "https://www.googleapis.com/auth/cloud-platform" 6035 // ] 6036 // } 6037 6038} 6039 6040// method id "cloudresourcemanager.projects.delete": 6041 6042type ProjectsDeleteCall struct { 6043 s *Service 6044 projectId string 6045 urlParams_ gensupport.URLParams 6046 ctx_ context.Context 6047 header_ http.Header 6048} 6049 6050// Delete: Marks the Project identified by the specified `project_id` 6051// (for example, `my-project-123`) for deletion. This method will only 6052// affect the Project if it has a lifecycle state of ACTIVE. This method 6053// changes the Project's lifecycle state from ACTIVE to 6054// DELETE_REQUESTED. The deletion starts at an unspecified time, at 6055// which point the Project is no longer accessible. Until the deletion 6056// completes, you can check the lifecycle state checked by retrieving 6057// the Project with GetProject, and the Project remains visible to 6058// ListProjects. However, you cannot update the project. After the 6059// deletion completes, the Project is not retrievable by the GetProject 6060// and ListProjects methods. The caller must have delete permissions for 6061// this Project. 6062// 6063// - projectId: The Project ID (for example, `foo-bar-123`). 6064func (r *ProjectsService) Delete(projectId string) *ProjectsDeleteCall { 6065 c := &ProjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6066 c.projectId = projectId 6067 return c 6068} 6069 6070// Fields allows partial responses to be retrieved. See 6071// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6072// for more information. 6073func (c *ProjectsDeleteCall) Fields(s ...googleapi.Field) *ProjectsDeleteCall { 6074 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6075 return c 6076} 6077 6078// Context sets the context to be used in this call's Do method. Any 6079// pending HTTP request will be aborted if the provided context is 6080// canceled. 6081func (c *ProjectsDeleteCall) Context(ctx context.Context) *ProjectsDeleteCall { 6082 c.ctx_ = ctx 6083 return c 6084} 6085 6086// Header returns an http.Header that can be modified by the caller to 6087// add HTTP headers to the request. 6088func (c *ProjectsDeleteCall) Header() http.Header { 6089 if c.header_ == nil { 6090 c.header_ = make(http.Header) 6091 } 6092 return c.header_ 6093} 6094 6095func (c *ProjectsDeleteCall) doRequest(alt string) (*http.Response, error) { 6096 reqHeaders := make(http.Header) 6097 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 6098 for k, v := range c.header_ { 6099 reqHeaders[k] = v 6100 } 6101 reqHeaders.Set("User-Agent", c.s.userAgent()) 6102 var body io.Reader = nil 6103 c.urlParams_.Set("alt", alt) 6104 c.urlParams_.Set("prettyPrint", "false") 6105 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}") 6106 urls += "?" + c.urlParams_.Encode() 6107 req, err := http.NewRequest("DELETE", urls, body) 6108 if err != nil { 6109 return nil, err 6110 } 6111 req.Header = reqHeaders 6112 googleapi.Expand(req.URL, map[string]string{ 6113 "projectId": c.projectId, 6114 }) 6115 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6116} 6117 6118// Do executes the "cloudresourcemanager.projects.delete" call. 6119// Exactly one of *Empty or error will be non-nil. Any non-2xx status 6120// code is an error. Response headers are in either 6121// *Empty.ServerResponse.Header or (if a response was returned at all) 6122// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6123// check whether the returned error was because http.StatusNotModified 6124// was returned. 6125func (c *ProjectsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 6126 gensupport.SetOptions(c.urlParams_, opts...) 6127 res, err := c.doRequest("json") 6128 if res != nil && res.StatusCode == http.StatusNotModified { 6129 if res.Body != nil { 6130 res.Body.Close() 6131 } 6132 return nil, &googleapi.Error{ 6133 Code: res.StatusCode, 6134 Header: res.Header, 6135 } 6136 } 6137 if err != nil { 6138 return nil, err 6139 } 6140 defer googleapi.CloseBody(res) 6141 if err := googleapi.CheckResponse(res); err != nil { 6142 return nil, err 6143 } 6144 ret := &Empty{ 6145 ServerResponse: googleapi.ServerResponse{ 6146 Header: res.Header, 6147 HTTPStatusCode: res.StatusCode, 6148 }, 6149 } 6150 target := &ret 6151 if err := gensupport.DecodeResponse(target, res); err != nil { 6152 return nil, err 6153 } 6154 return ret, nil 6155 // { 6156 // "description": "Marks the Project identified by the specified `project_id` (for example, `my-project-123`) for deletion. This method will only affect the Project if it has a lifecycle state of ACTIVE. This method changes the Project's lifecycle state from ACTIVE to DELETE_REQUESTED. The deletion starts at an unspecified time, at which point the Project is no longer accessible. Until the deletion completes, you can check the lifecycle state checked by retrieving the Project with GetProject, and the Project remains visible to ListProjects. However, you cannot update the project. After the deletion completes, the Project is not retrievable by the GetProject and ListProjects methods. The caller must have delete permissions for this Project.", 6157 // "flatPath": "v1/projects/{projectId}", 6158 // "httpMethod": "DELETE", 6159 // "id": "cloudresourcemanager.projects.delete", 6160 // "parameterOrder": [ 6161 // "projectId" 6162 // ], 6163 // "parameters": { 6164 // "projectId": { 6165 // "description": "The Project ID (for example, `foo-bar-123`). Required.", 6166 // "location": "path", 6167 // "required": true, 6168 // "type": "string" 6169 // } 6170 // }, 6171 // "path": "v1/projects/{projectId}", 6172 // "response": { 6173 // "$ref": "Empty" 6174 // }, 6175 // "scopes": [ 6176 // "https://www.googleapis.com/auth/cloud-platform" 6177 // ] 6178 // } 6179 6180} 6181 6182// method id "cloudresourcemanager.projects.get": 6183 6184type ProjectsGetCall struct { 6185 s *Service 6186 projectId string 6187 urlParams_ gensupport.URLParams 6188 ifNoneMatch_ string 6189 ctx_ context.Context 6190 header_ http.Header 6191} 6192 6193// Get: Retrieves the Project identified by the specified `project_id` 6194// (for example, `my-project-123`). The caller must have read 6195// permissions for this Project. 6196// 6197// - projectId: The Project ID (for example, `my-project-123`). 6198func (r *ProjectsService) Get(projectId string) *ProjectsGetCall { 6199 c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6200 c.projectId = projectId 6201 return c 6202} 6203 6204// Fields allows partial responses to be retrieved. See 6205// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6206// for more information. 6207func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall { 6208 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6209 return c 6210} 6211 6212// IfNoneMatch sets the optional parameter which makes the operation 6213// fail if the object's ETag matches the given value. This is useful for 6214// getting updates only after the object has changed since the last 6215// request. Use googleapi.IsNotModified to check whether the response 6216// error from Do is the result of In-None-Match. 6217func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall { 6218 c.ifNoneMatch_ = entityTag 6219 return c 6220} 6221 6222// Context sets the context to be used in this call's Do method. Any 6223// pending HTTP request will be aborted if the provided context is 6224// canceled. 6225func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall { 6226 c.ctx_ = ctx 6227 return c 6228} 6229 6230// Header returns an http.Header that can be modified by the caller to 6231// add HTTP headers to the request. 6232func (c *ProjectsGetCall) Header() http.Header { 6233 if c.header_ == nil { 6234 c.header_ = make(http.Header) 6235 } 6236 return c.header_ 6237} 6238 6239func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { 6240 reqHeaders := make(http.Header) 6241 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 6242 for k, v := range c.header_ { 6243 reqHeaders[k] = v 6244 } 6245 reqHeaders.Set("User-Agent", c.s.userAgent()) 6246 if c.ifNoneMatch_ != "" { 6247 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6248 } 6249 var body io.Reader = nil 6250 c.urlParams_.Set("alt", alt) 6251 c.urlParams_.Set("prettyPrint", "false") 6252 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}") 6253 urls += "?" + c.urlParams_.Encode() 6254 req, err := http.NewRequest("GET", urls, body) 6255 if err != nil { 6256 return nil, err 6257 } 6258 req.Header = reqHeaders 6259 googleapi.Expand(req.URL, map[string]string{ 6260 "projectId": c.projectId, 6261 }) 6262 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6263} 6264 6265// Do executes the "cloudresourcemanager.projects.get" call. 6266// Exactly one of *Project or error will be non-nil. Any non-2xx status 6267// code is an error. Response headers are in either 6268// *Project.ServerResponse.Header or (if a response was returned at all) 6269// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6270// check whether the returned error was because http.StatusNotModified 6271// was returned. 6272func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) { 6273 gensupport.SetOptions(c.urlParams_, opts...) 6274 res, err := c.doRequest("json") 6275 if res != nil && res.StatusCode == http.StatusNotModified { 6276 if res.Body != nil { 6277 res.Body.Close() 6278 } 6279 return nil, &googleapi.Error{ 6280 Code: res.StatusCode, 6281 Header: res.Header, 6282 } 6283 } 6284 if err != nil { 6285 return nil, err 6286 } 6287 defer googleapi.CloseBody(res) 6288 if err := googleapi.CheckResponse(res); err != nil { 6289 return nil, err 6290 } 6291 ret := &Project{ 6292 ServerResponse: googleapi.ServerResponse{ 6293 Header: res.Header, 6294 HTTPStatusCode: res.StatusCode, 6295 }, 6296 } 6297 target := &ret 6298 if err := gensupport.DecodeResponse(target, res); err != nil { 6299 return nil, err 6300 } 6301 return ret, nil 6302 // { 6303 // "description": "Retrieves the Project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this Project.", 6304 // "flatPath": "v1/projects/{projectId}", 6305 // "httpMethod": "GET", 6306 // "id": "cloudresourcemanager.projects.get", 6307 // "parameterOrder": [ 6308 // "projectId" 6309 // ], 6310 // "parameters": { 6311 // "projectId": { 6312 // "description": "Required. The Project ID (for example, `my-project-123`).", 6313 // "location": "path", 6314 // "required": true, 6315 // "type": "string" 6316 // } 6317 // }, 6318 // "path": "v1/projects/{projectId}", 6319 // "response": { 6320 // "$ref": "Project" 6321 // }, 6322 // "scopes": [ 6323 // "https://www.googleapis.com/auth/cloud-platform", 6324 // "https://www.googleapis.com/auth/cloud-platform.read-only" 6325 // ] 6326 // } 6327 6328} 6329 6330// method id "cloudresourcemanager.projects.getAncestry": 6331 6332type ProjectsGetAncestryCall struct { 6333 s *Service 6334 projectId string 6335 getancestryrequest *GetAncestryRequest 6336 urlParams_ gensupport.URLParams 6337 ctx_ context.Context 6338 header_ http.Header 6339} 6340 6341// GetAncestry: Gets a list of ancestors in the resource hierarchy for 6342// the Project identified by the specified `project_id` (for example, 6343// `my-project-123`). The caller must have read permissions for this 6344// Project. 6345// 6346// - projectId: The Project ID (for example, `my-project-123`). 6347func (r *ProjectsService) GetAncestry(projectId string, getancestryrequest *GetAncestryRequest) *ProjectsGetAncestryCall { 6348 c := &ProjectsGetAncestryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6349 c.projectId = projectId 6350 c.getancestryrequest = getancestryrequest 6351 return c 6352} 6353 6354// Fields allows partial responses to be retrieved. See 6355// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6356// for more information. 6357func (c *ProjectsGetAncestryCall) Fields(s ...googleapi.Field) *ProjectsGetAncestryCall { 6358 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6359 return c 6360} 6361 6362// Context sets the context to be used in this call's Do method. Any 6363// pending HTTP request will be aborted if the provided context is 6364// canceled. 6365func (c *ProjectsGetAncestryCall) Context(ctx context.Context) *ProjectsGetAncestryCall { 6366 c.ctx_ = ctx 6367 return c 6368} 6369 6370// Header returns an http.Header that can be modified by the caller to 6371// add HTTP headers to the request. 6372func (c *ProjectsGetAncestryCall) Header() http.Header { 6373 if c.header_ == nil { 6374 c.header_ = make(http.Header) 6375 } 6376 return c.header_ 6377} 6378 6379func (c *ProjectsGetAncestryCall) doRequest(alt string) (*http.Response, error) { 6380 reqHeaders := make(http.Header) 6381 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 6382 for k, v := range c.header_ { 6383 reqHeaders[k] = v 6384 } 6385 reqHeaders.Set("User-Agent", c.s.userAgent()) 6386 var body io.Reader = nil 6387 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getancestryrequest) 6388 if err != nil { 6389 return nil, err 6390 } 6391 reqHeaders.Set("Content-Type", "application/json") 6392 c.urlParams_.Set("alt", alt) 6393 c.urlParams_.Set("prettyPrint", "false") 6394 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}:getAncestry") 6395 urls += "?" + c.urlParams_.Encode() 6396 req, err := http.NewRequest("POST", urls, body) 6397 if err != nil { 6398 return nil, err 6399 } 6400 req.Header = reqHeaders 6401 googleapi.Expand(req.URL, map[string]string{ 6402 "projectId": c.projectId, 6403 }) 6404 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6405} 6406 6407// Do executes the "cloudresourcemanager.projects.getAncestry" call. 6408// Exactly one of *GetAncestryResponse or error will be non-nil. Any 6409// non-2xx status code is an error. Response headers are in either 6410// *GetAncestryResponse.ServerResponse.Header or (if a response was 6411// returned at all) in error.(*googleapi.Error).Header. Use 6412// googleapi.IsNotModified to check whether the returned error was 6413// because http.StatusNotModified was returned. 6414func (c *ProjectsGetAncestryCall) Do(opts ...googleapi.CallOption) (*GetAncestryResponse, error) { 6415 gensupport.SetOptions(c.urlParams_, opts...) 6416 res, err := c.doRequest("json") 6417 if res != nil && res.StatusCode == http.StatusNotModified { 6418 if res.Body != nil { 6419 res.Body.Close() 6420 } 6421 return nil, &googleapi.Error{ 6422 Code: res.StatusCode, 6423 Header: res.Header, 6424 } 6425 } 6426 if err != nil { 6427 return nil, err 6428 } 6429 defer googleapi.CloseBody(res) 6430 if err := googleapi.CheckResponse(res); err != nil { 6431 return nil, err 6432 } 6433 ret := &GetAncestryResponse{ 6434 ServerResponse: googleapi.ServerResponse{ 6435 Header: res.Header, 6436 HTTPStatusCode: res.StatusCode, 6437 }, 6438 } 6439 target := &ret 6440 if err := gensupport.DecodeResponse(target, res); err != nil { 6441 return nil, err 6442 } 6443 return ret, nil 6444 // { 6445 // "description": "Gets a list of ancestors in the resource hierarchy for the Project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this Project.", 6446 // "flatPath": "v1/projects/{projectId}:getAncestry", 6447 // "httpMethod": "POST", 6448 // "id": "cloudresourcemanager.projects.getAncestry", 6449 // "parameterOrder": [ 6450 // "projectId" 6451 // ], 6452 // "parameters": { 6453 // "projectId": { 6454 // "description": "Required. The Project ID (for example, `my-project-123`).", 6455 // "location": "path", 6456 // "required": true, 6457 // "type": "string" 6458 // } 6459 // }, 6460 // "path": "v1/projects/{projectId}:getAncestry", 6461 // "request": { 6462 // "$ref": "GetAncestryRequest" 6463 // }, 6464 // "response": { 6465 // "$ref": "GetAncestryResponse" 6466 // }, 6467 // "scopes": [ 6468 // "https://www.googleapis.com/auth/cloud-platform", 6469 // "https://www.googleapis.com/auth/cloud-platform.read-only" 6470 // ] 6471 // } 6472 6473} 6474 6475// method id "cloudresourcemanager.projects.getEffectiveOrgPolicy": 6476 6477type ProjectsGetEffectiveOrgPolicyCall struct { 6478 s *Service 6479 resource string 6480 geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest 6481 urlParams_ gensupport.URLParams 6482 ctx_ context.Context 6483 header_ http.Header 6484} 6485 6486// GetEffectiveOrgPolicy: Gets the effective `Policy` on a resource. 6487// This is the result of merging `Policies` in the resource hierarchy. 6488// The returned `Policy` will not have an `etag`set because it is a 6489// computed `Policy` across multiple resources. Subtrees of Resource 6490// Manager resource hierarchy with 'under:' prefix will not be expanded. 6491// 6492// - resource: The name of the resource to start computing the effective 6493// `Policy`. 6494func (r *ProjectsService) GetEffectiveOrgPolicy(resource string, geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest) *ProjectsGetEffectiveOrgPolicyCall { 6495 c := &ProjectsGetEffectiveOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6496 c.resource = resource 6497 c.geteffectiveorgpolicyrequest = geteffectiveorgpolicyrequest 6498 return c 6499} 6500 6501// Fields allows partial responses to be retrieved. See 6502// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6503// for more information. 6504func (c *ProjectsGetEffectiveOrgPolicyCall) Fields(s ...googleapi.Field) *ProjectsGetEffectiveOrgPolicyCall { 6505 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6506 return c 6507} 6508 6509// Context sets the context to be used in this call's Do method. Any 6510// pending HTTP request will be aborted if the provided context is 6511// canceled. 6512func (c *ProjectsGetEffectiveOrgPolicyCall) Context(ctx context.Context) *ProjectsGetEffectiveOrgPolicyCall { 6513 c.ctx_ = ctx 6514 return c 6515} 6516 6517// Header returns an http.Header that can be modified by the caller to 6518// add HTTP headers to the request. 6519func (c *ProjectsGetEffectiveOrgPolicyCall) Header() http.Header { 6520 if c.header_ == nil { 6521 c.header_ = make(http.Header) 6522 } 6523 return c.header_ 6524} 6525 6526func (c *ProjectsGetEffectiveOrgPolicyCall) doRequest(alt string) (*http.Response, error) { 6527 reqHeaders := make(http.Header) 6528 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 6529 for k, v := range c.header_ { 6530 reqHeaders[k] = v 6531 } 6532 reqHeaders.Set("User-Agent", c.s.userAgent()) 6533 var body io.Reader = nil 6534 body, err := googleapi.WithoutDataWrapper.JSONReader(c.geteffectiveorgpolicyrequest) 6535 if err != nil { 6536 return nil, err 6537 } 6538 reqHeaders.Set("Content-Type", "application/json") 6539 c.urlParams_.Set("alt", alt) 6540 c.urlParams_.Set("prettyPrint", "false") 6541 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getEffectiveOrgPolicy") 6542 urls += "?" + c.urlParams_.Encode() 6543 req, err := http.NewRequest("POST", urls, body) 6544 if err != nil { 6545 return nil, err 6546 } 6547 req.Header = reqHeaders 6548 googleapi.Expand(req.URL, map[string]string{ 6549 "resource": c.resource, 6550 }) 6551 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6552} 6553 6554// Do executes the "cloudresourcemanager.projects.getEffectiveOrgPolicy" call. 6555// Exactly one of *OrgPolicy or error will be non-nil. Any non-2xx 6556// status code is an error. Response headers are in either 6557// *OrgPolicy.ServerResponse.Header or (if a response was returned at 6558// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6559// to check whether the returned error was because 6560// http.StatusNotModified was returned. 6561func (c *ProjectsGetEffectiveOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) { 6562 gensupport.SetOptions(c.urlParams_, opts...) 6563 res, err := c.doRequest("json") 6564 if res != nil && res.StatusCode == http.StatusNotModified { 6565 if res.Body != nil { 6566 res.Body.Close() 6567 } 6568 return nil, &googleapi.Error{ 6569 Code: res.StatusCode, 6570 Header: res.Header, 6571 } 6572 } 6573 if err != nil { 6574 return nil, err 6575 } 6576 defer googleapi.CloseBody(res) 6577 if err := googleapi.CheckResponse(res); err != nil { 6578 return nil, err 6579 } 6580 ret := &OrgPolicy{ 6581 ServerResponse: googleapi.ServerResponse{ 6582 Header: res.Header, 6583 HTTPStatusCode: res.StatusCode, 6584 }, 6585 } 6586 target := &ret 6587 if err := gensupport.DecodeResponse(target, res); err != nil { 6588 return nil, err 6589 } 6590 return ret, nil 6591 // { 6592 // "description": "Gets the effective `Policy` on a resource. This is the result of merging `Policies` in the resource hierarchy. The returned `Policy` will not have an `etag`set because it is a computed `Policy` across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be expanded.", 6593 // "flatPath": "v1/projects/{projectsId}:getEffectiveOrgPolicy", 6594 // "httpMethod": "POST", 6595 // "id": "cloudresourcemanager.projects.getEffectiveOrgPolicy", 6596 // "parameterOrder": [ 6597 // "resource" 6598 // ], 6599 // "parameters": { 6600 // "resource": { 6601 // "description": "The name of the resource to start computing the effective `Policy`.", 6602 // "location": "path", 6603 // "pattern": "^projects/[^/]+$", 6604 // "required": true, 6605 // "type": "string" 6606 // } 6607 // }, 6608 // "path": "v1/{+resource}:getEffectiveOrgPolicy", 6609 // "request": { 6610 // "$ref": "GetEffectiveOrgPolicyRequest" 6611 // }, 6612 // "response": { 6613 // "$ref": "OrgPolicy" 6614 // }, 6615 // "scopes": [ 6616 // "https://www.googleapis.com/auth/cloud-platform", 6617 // "https://www.googleapis.com/auth/cloud-platform.read-only" 6618 // ] 6619 // } 6620 6621} 6622 6623// method id "cloudresourcemanager.projects.getIamPolicy": 6624 6625type ProjectsGetIamPolicyCall struct { 6626 s *Service 6627 resource string 6628 getiampolicyrequest *GetIamPolicyRequest 6629 urlParams_ gensupport.URLParams 6630 ctx_ context.Context 6631 header_ http.Header 6632} 6633 6634// GetIamPolicy: Returns the IAM access control policy for the specified 6635// Project. Permission is denied if the policy or the resource does not 6636// exist. Authorization requires the Google IAM permission 6637// `resourcemanager.projects.getIamPolicy` on the project. For 6638// additional information about `resource` (e.g. my-project-id) 6639// structure and identification, see Resource Names 6640// (https://cloud.google.com/apis/design/resource_names). 6641// 6642// - resource: REQUIRED: The resource for which the policy is being 6643// requested. See the operation documentation for the appropriate 6644// value for this field. 6645func (r *ProjectsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsGetIamPolicyCall { 6646 c := &ProjectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6647 c.resource = resource 6648 c.getiampolicyrequest = getiampolicyrequest 6649 return c 6650} 6651 6652// Fields allows partial responses to be retrieved. See 6653// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6654// for more information. 6655func (c *ProjectsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsGetIamPolicyCall { 6656 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6657 return c 6658} 6659 6660// Context sets the context to be used in this call's Do method. Any 6661// pending HTTP request will be aborted if the provided context is 6662// canceled. 6663func (c *ProjectsGetIamPolicyCall) Context(ctx context.Context) *ProjectsGetIamPolicyCall { 6664 c.ctx_ = ctx 6665 return c 6666} 6667 6668// Header returns an http.Header that can be modified by the caller to 6669// add HTTP headers to the request. 6670func (c *ProjectsGetIamPolicyCall) Header() http.Header { 6671 if c.header_ == nil { 6672 c.header_ = make(http.Header) 6673 } 6674 return c.header_ 6675} 6676 6677func (c *ProjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 6678 reqHeaders := make(http.Header) 6679 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 6680 for k, v := range c.header_ { 6681 reqHeaders[k] = v 6682 } 6683 reqHeaders.Set("User-Agent", c.s.userAgent()) 6684 var body io.Reader = nil 6685 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 6686 if err != nil { 6687 return nil, err 6688 } 6689 reqHeaders.Set("Content-Type", "application/json") 6690 c.urlParams_.Set("alt", alt) 6691 c.urlParams_.Set("prettyPrint", "false") 6692 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{resource}:getIamPolicy") 6693 urls += "?" + c.urlParams_.Encode() 6694 req, err := http.NewRequest("POST", urls, body) 6695 if err != nil { 6696 return nil, err 6697 } 6698 req.Header = reqHeaders 6699 googleapi.Expand(req.URL, map[string]string{ 6700 "resource": c.resource, 6701 }) 6702 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6703} 6704 6705// Do executes the "cloudresourcemanager.projects.getIamPolicy" call. 6706// Exactly one of *Policy or error will be non-nil. Any non-2xx status 6707// code is an error. Response headers are in either 6708// *Policy.ServerResponse.Header or (if a response was returned at all) 6709// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6710// check whether the returned error was because http.StatusNotModified 6711// was returned. 6712func (c *ProjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 6713 gensupport.SetOptions(c.urlParams_, opts...) 6714 res, err := c.doRequest("json") 6715 if res != nil && res.StatusCode == http.StatusNotModified { 6716 if res.Body != nil { 6717 res.Body.Close() 6718 } 6719 return nil, &googleapi.Error{ 6720 Code: res.StatusCode, 6721 Header: res.Header, 6722 } 6723 } 6724 if err != nil { 6725 return nil, err 6726 } 6727 defer googleapi.CloseBody(res) 6728 if err := googleapi.CheckResponse(res); err != nil { 6729 return nil, err 6730 } 6731 ret := &Policy{ 6732 ServerResponse: googleapi.ServerResponse{ 6733 Header: res.Header, 6734 HTTPStatusCode: res.StatusCode, 6735 }, 6736 } 6737 target := &ret 6738 if err := gensupport.DecodeResponse(target, res); err != nil { 6739 return nil, err 6740 } 6741 return ret, nil 6742 // { 6743 // "description": "Returns the IAM access control policy for the specified Project. Permission is denied if the policy or the resource does not exist. Authorization requires the Google IAM permission `resourcemanager.projects.getIamPolicy` on the project. For additional information about `resource` (e.g. my-project-id) structure and identification, see [Resource Names](https://cloud.google.com/apis/design/resource_names).", 6744 // "flatPath": "v1/projects/{resource}:getIamPolicy", 6745 // "httpMethod": "POST", 6746 // "id": "cloudresourcemanager.projects.getIamPolicy", 6747 // "parameterOrder": [ 6748 // "resource" 6749 // ], 6750 // "parameters": { 6751 // "resource": { 6752 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 6753 // "location": "path", 6754 // "required": true, 6755 // "type": "string" 6756 // } 6757 // }, 6758 // "path": "v1/projects/{resource}:getIamPolicy", 6759 // "request": { 6760 // "$ref": "GetIamPolicyRequest" 6761 // }, 6762 // "response": { 6763 // "$ref": "Policy" 6764 // }, 6765 // "scopes": [ 6766 // "https://www.googleapis.com/auth/cloud-platform", 6767 // "https://www.googleapis.com/auth/cloud-platform.read-only" 6768 // ] 6769 // } 6770 6771} 6772 6773// method id "cloudresourcemanager.projects.getOrgPolicy": 6774 6775type ProjectsGetOrgPolicyCall struct { 6776 s *Service 6777 resource string 6778 getorgpolicyrequest *GetOrgPolicyRequest 6779 urlParams_ gensupport.URLParams 6780 ctx_ context.Context 6781 header_ http.Header 6782} 6783 6784// GetOrgPolicy: Gets a `Policy` on a resource. If no `Policy` is set on 6785// the resource, a `Policy` is returned with default values including 6786// `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value 6787// can be used with `SetOrgPolicy()` to create or update a `Policy` 6788// during read-modify-write. 6789// 6790// - resource: Name of the resource the `Policy` is set on. 6791func (r *ProjectsService) GetOrgPolicy(resource string, getorgpolicyrequest *GetOrgPolicyRequest) *ProjectsGetOrgPolicyCall { 6792 c := &ProjectsGetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6793 c.resource = resource 6794 c.getorgpolicyrequest = getorgpolicyrequest 6795 return c 6796} 6797 6798// Fields allows partial responses to be retrieved. See 6799// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6800// for more information. 6801func (c *ProjectsGetOrgPolicyCall) Fields(s ...googleapi.Field) *ProjectsGetOrgPolicyCall { 6802 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6803 return c 6804} 6805 6806// Context sets the context to be used in this call's Do method. Any 6807// pending HTTP request will be aborted if the provided context is 6808// canceled. 6809func (c *ProjectsGetOrgPolicyCall) Context(ctx context.Context) *ProjectsGetOrgPolicyCall { 6810 c.ctx_ = ctx 6811 return c 6812} 6813 6814// Header returns an http.Header that can be modified by the caller to 6815// add HTTP headers to the request. 6816func (c *ProjectsGetOrgPolicyCall) Header() http.Header { 6817 if c.header_ == nil { 6818 c.header_ = make(http.Header) 6819 } 6820 return c.header_ 6821} 6822 6823func (c *ProjectsGetOrgPolicyCall) doRequest(alt string) (*http.Response, error) { 6824 reqHeaders := make(http.Header) 6825 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 6826 for k, v := range c.header_ { 6827 reqHeaders[k] = v 6828 } 6829 reqHeaders.Set("User-Agent", c.s.userAgent()) 6830 var body io.Reader = nil 6831 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getorgpolicyrequest) 6832 if err != nil { 6833 return nil, err 6834 } 6835 reqHeaders.Set("Content-Type", "application/json") 6836 c.urlParams_.Set("alt", alt) 6837 c.urlParams_.Set("prettyPrint", "false") 6838 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getOrgPolicy") 6839 urls += "?" + c.urlParams_.Encode() 6840 req, err := http.NewRequest("POST", urls, body) 6841 if err != nil { 6842 return nil, err 6843 } 6844 req.Header = reqHeaders 6845 googleapi.Expand(req.URL, map[string]string{ 6846 "resource": c.resource, 6847 }) 6848 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6849} 6850 6851// Do executes the "cloudresourcemanager.projects.getOrgPolicy" call. 6852// Exactly one of *OrgPolicy or error will be non-nil. Any non-2xx 6853// status code is an error. Response headers are in either 6854// *OrgPolicy.ServerResponse.Header or (if a response was returned at 6855// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6856// to check whether the returned error was because 6857// http.StatusNotModified was returned. 6858func (c *ProjectsGetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) { 6859 gensupport.SetOptions(c.urlParams_, opts...) 6860 res, err := c.doRequest("json") 6861 if res != nil && res.StatusCode == http.StatusNotModified { 6862 if res.Body != nil { 6863 res.Body.Close() 6864 } 6865 return nil, &googleapi.Error{ 6866 Code: res.StatusCode, 6867 Header: res.Header, 6868 } 6869 } 6870 if err != nil { 6871 return nil, err 6872 } 6873 defer googleapi.CloseBody(res) 6874 if err := googleapi.CheckResponse(res); err != nil { 6875 return nil, err 6876 } 6877 ret := &OrgPolicy{ 6878 ServerResponse: googleapi.ServerResponse{ 6879 Header: res.Header, 6880 HTTPStatusCode: res.StatusCode, 6881 }, 6882 } 6883 target := &ret 6884 if err := gensupport.DecodeResponse(target, res); err != nil { 6885 return nil, err 6886 } 6887 return ret, nil 6888 // { 6889 // "description": "Gets a `Policy` on a resource. If no `Policy` is set on the resource, a `Policy` is returned with default values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can be used with `SetOrgPolicy()` to create or update a `Policy` during read-modify-write.", 6890 // "flatPath": "v1/projects/{projectsId}:getOrgPolicy", 6891 // "httpMethod": "POST", 6892 // "id": "cloudresourcemanager.projects.getOrgPolicy", 6893 // "parameterOrder": [ 6894 // "resource" 6895 // ], 6896 // "parameters": { 6897 // "resource": { 6898 // "description": "Name of the resource the `Policy` is set on.", 6899 // "location": "path", 6900 // "pattern": "^projects/[^/]+$", 6901 // "required": true, 6902 // "type": "string" 6903 // } 6904 // }, 6905 // "path": "v1/{+resource}:getOrgPolicy", 6906 // "request": { 6907 // "$ref": "GetOrgPolicyRequest" 6908 // }, 6909 // "response": { 6910 // "$ref": "OrgPolicy" 6911 // }, 6912 // "scopes": [ 6913 // "https://www.googleapis.com/auth/cloud-platform", 6914 // "https://www.googleapis.com/auth/cloud-platform.read-only" 6915 // ] 6916 // } 6917 6918} 6919 6920// method id "cloudresourcemanager.projects.list": 6921 6922type ProjectsListCall struct { 6923 s *Service 6924 urlParams_ gensupport.URLParams 6925 ifNoneMatch_ string 6926 ctx_ context.Context 6927 header_ http.Header 6928} 6929 6930// List: Lists Projects that the caller has the 6931// `resourcemanager.projects.get` permission on and satisfy the 6932// specified filter. This method returns Projects in an unspecified 6933// order. This method is eventually consistent with project mutations; 6934// this means that a newly created project may not appear in the results 6935// or recent updates to an existing project may not be reflected in the 6936// results. To retrieve the latest state of a project, use the 6937// GetProject method. NOTE: If the request filter contains a 6938// `parent.type` and `parent.id` and the caller has the 6939// `resourcemanager.projects.list` permission on the parent, the results 6940// will be drawn from an alternate index which provides more consistent 6941// results. In future versions of this API, this List method will be 6942// split into List and Search to properly capture the behavioral 6943// difference. 6944func (r *ProjectsService) List() *ProjectsListCall { 6945 c := &ProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6946 return c 6947} 6948 6949// Filter sets the optional parameter "filter": An expression for 6950// filtering the results of the request. Filter rules are case 6951// insensitive. If multiple fields are included in a filter query, the 6952// query will return results that match any of the fields. Some eligible 6953// fields for filtering are: + `name` + `id` + `labels.` (where *key* is 6954// the name of a label) + `parent.type` + `parent.id` + `lifecycleState` 6955// Some examples of filter queries: | Query | Description | 6956// |------------------|-------------------------------------------------- 6957// ---| | name:how* | The project's name starts with "how". | | 6958// name:Howl | The project's name is `Howl` or `howl`. | | name:HOWL | 6959// Equivalent to above. | | NAME:howl | Equivalent to above. | | 6960// labels.color:* | The project has the label `color`. | | 6961// labels.color:red | The project's label `color` has the value `red`. | 6962// | labels.color:red labels.size:big | The project's label `color` has 6963// the value `red` and its label `size` has the value `big`.| | 6964// lifecycleState:DELETE_REQUESTED | Only show projects that are pending 6965// deletion.| If no filter is specified, the call will return projects 6966// for which the user has the `resourcemanager.projects.get` permission. 6967// NOTE: To perform a by-parent query (eg., what projects are directly 6968// in a Folder), the caller must have the 6969// `resourcemanager.projects.list` permission on the parent and the 6970// filter must contain both a `parent.type` and a `parent.id` 6971// restriction (example: "parent.type:folder parent.id:123"). In this 6972// case an alternate search index is used which provides more consistent 6973// results. 6974func (c *ProjectsListCall) Filter(filter string) *ProjectsListCall { 6975 c.urlParams_.Set("filter", filter) 6976 return c 6977} 6978 6979// PageSize sets the optional parameter "pageSize": The maximum number 6980// of Projects to return in the response. The server can return fewer 6981// Projects than requested. If unspecified, server picks an appropriate 6982// default. 6983func (c *ProjectsListCall) PageSize(pageSize int64) *ProjectsListCall { 6984 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6985 return c 6986} 6987 6988// PageToken sets the optional parameter "pageToken": A pagination token 6989// returned from a previous call to ListProjects that indicates from 6990// where listing should continue. 6991func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall { 6992 c.urlParams_.Set("pageToken", pageToken) 6993 return c 6994} 6995 6996// Fields allows partial responses to be retrieved. See 6997// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6998// for more information. 6999func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall { 7000 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7001 return c 7002} 7003 7004// IfNoneMatch sets the optional parameter which makes the operation 7005// fail if the object's ETag matches the given value. This is useful for 7006// getting updates only after the object has changed since the last 7007// request. Use googleapi.IsNotModified to check whether the response 7008// error from Do is the result of In-None-Match. 7009func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall { 7010 c.ifNoneMatch_ = entityTag 7011 return c 7012} 7013 7014// Context sets the context to be used in this call's Do method. Any 7015// pending HTTP request will be aborted if the provided context is 7016// canceled. 7017func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall { 7018 c.ctx_ = ctx 7019 return c 7020} 7021 7022// Header returns an http.Header that can be modified by the caller to 7023// add HTTP headers to the request. 7024func (c *ProjectsListCall) Header() http.Header { 7025 if c.header_ == nil { 7026 c.header_ = make(http.Header) 7027 } 7028 return c.header_ 7029} 7030 7031func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) { 7032 reqHeaders := make(http.Header) 7033 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 7034 for k, v := range c.header_ { 7035 reqHeaders[k] = v 7036 } 7037 reqHeaders.Set("User-Agent", c.s.userAgent()) 7038 if c.ifNoneMatch_ != "" { 7039 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7040 } 7041 var body io.Reader = nil 7042 c.urlParams_.Set("alt", alt) 7043 c.urlParams_.Set("prettyPrint", "false") 7044 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects") 7045 urls += "?" + c.urlParams_.Encode() 7046 req, err := http.NewRequest("GET", urls, body) 7047 if err != nil { 7048 return nil, err 7049 } 7050 req.Header = reqHeaders 7051 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7052} 7053 7054// Do executes the "cloudresourcemanager.projects.list" call. 7055// Exactly one of *ListProjectsResponse or error will be non-nil. Any 7056// non-2xx status code is an error. Response headers are in either 7057// *ListProjectsResponse.ServerResponse.Header or (if a response was 7058// returned at all) in error.(*googleapi.Error).Header. Use 7059// googleapi.IsNotModified to check whether the returned error was 7060// because http.StatusNotModified was returned. 7061func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ListProjectsResponse, error) { 7062 gensupport.SetOptions(c.urlParams_, opts...) 7063 res, err := c.doRequest("json") 7064 if res != nil && res.StatusCode == http.StatusNotModified { 7065 if res.Body != nil { 7066 res.Body.Close() 7067 } 7068 return nil, &googleapi.Error{ 7069 Code: res.StatusCode, 7070 Header: res.Header, 7071 } 7072 } 7073 if err != nil { 7074 return nil, err 7075 } 7076 defer googleapi.CloseBody(res) 7077 if err := googleapi.CheckResponse(res); err != nil { 7078 return nil, err 7079 } 7080 ret := &ListProjectsResponse{ 7081 ServerResponse: googleapi.ServerResponse{ 7082 Header: res.Header, 7083 HTTPStatusCode: res.StatusCode, 7084 }, 7085 } 7086 target := &ret 7087 if err := gensupport.DecodeResponse(target, res); err != nil { 7088 return nil, err 7089 } 7090 return ret, nil 7091 // { 7092 // "description": "Lists Projects that the caller has the `resourcemanager.projects.get` permission on and satisfy the specified filter. This method returns Projects in an unspecified order. This method is eventually consistent with project mutations; this means that a newly created project may not appear in the results or recent updates to an existing project may not be reflected in the results. To retrieve the latest state of a project, use the GetProject method. NOTE: If the request filter contains a `parent.type` and `parent.id` and the caller has the `resourcemanager.projects.list` permission on the parent, the results will be drawn from an alternate index which provides more consistent results. In future versions of this API, this List method will be split into List and Search to properly capture the behavioral difference.", 7093 // "flatPath": "v1/projects", 7094 // "httpMethod": "GET", 7095 // "id": "cloudresourcemanager.projects.list", 7096 // "parameterOrder": [], 7097 // "parameters": { 7098 // "filter": { 7099 // "description": "Optional. An expression for filtering the results of the request. Filter rules are case insensitive. If multiple fields are included in a filter query, the query will return results that match any of the fields. Some eligible fields for filtering are: + `name` + `id` + `labels.` (where *key* is the name of a label) + `parent.type` + `parent.id` + `lifecycleState` Some examples of filter queries: | Query | Description | |------------------|-----------------------------------------------------| | name:how* | The project's name starts with \"how\". | | name:Howl | The project's name is `Howl` or `howl`. | | name:HOWL | Equivalent to above. | | NAME:howl | Equivalent to above. | | labels.color:* | The project has the label `color`. | | labels.color:red | The project's label `color` has the value `red`. | | labels.color:red labels.size:big | The project's label `color` has the value `red` and its label `size` has the value `big`.| | lifecycleState:DELETE_REQUESTED | Only show projects that are pending deletion.| If no filter is specified, the call will return projects for which the user has the `resourcemanager.projects.get` permission. NOTE: To perform a by-parent query (eg., what projects are directly in a Folder), the caller must have the `resourcemanager.projects.list` permission on the parent and the filter must contain both a `parent.type` and a `parent.id` restriction (example: \"parent.type:folder parent.id:123\"). In this case an alternate search index is used which provides more consistent results.", 7100 // "location": "query", 7101 // "type": "string" 7102 // }, 7103 // "pageSize": { 7104 // "description": "Optional. The maximum number of Projects to return in the response. The server can return fewer Projects than requested. If unspecified, server picks an appropriate default.", 7105 // "format": "int32", 7106 // "location": "query", 7107 // "type": "integer" 7108 // }, 7109 // "pageToken": { 7110 // "description": "Optional. A pagination token returned from a previous call to ListProjects that indicates from where listing should continue.", 7111 // "location": "query", 7112 // "type": "string" 7113 // } 7114 // }, 7115 // "path": "v1/projects", 7116 // "response": { 7117 // "$ref": "ListProjectsResponse" 7118 // }, 7119 // "scopes": [ 7120 // "https://www.googleapis.com/auth/cloud-platform", 7121 // "https://www.googleapis.com/auth/cloud-platform.read-only" 7122 // ] 7123 // } 7124 7125} 7126 7127// Pages invokes f for each page of results. 7128// A non-nil error returned from f will halt the iteration. 7129// The provided context supersedes any context provided to the Context method. 7130func (c *ProjectsListCall) Pages(ctx context.Context, f func(*ListProjectsResponse) error) error { 7131 c.ctx_ = ctx 7132 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7133 for { 7134 x, err := c.Do() 7135 if err != nil { 7136 return err 7137 } 7138 if err := f(x); err != nil { 7139 return err 7140 } 7141 if x.NextPageToken == "" { 7142 return nil 7143 } 7144 c.PageToken(x.NextPageToken) 7145 } 7146} 7147 7148// method id "cloudresourcemanager.projects.listAvailableOrgPolicyConstraints": 7149 7150type ProjectsListAvailableOrgPolicyConstraintsCall struct { 7151 s *Service 7152 resource string 7153 listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest 7154 urlParams_ gensupport.URLParams 7155 ctx_ context.Context 7156 header_ http.Header 7157} 7158 7159// ListAvailableOrgPolicyConstraints: Lists `Constraints` that could be 7160// applied on the specified resource. 7161// 7162// - resource: Name of the resource to list `Constraints` for. 7163func (r *ProjectsService) ListAvailableOrgPolicyConstraints(resource string, listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest) *ProjectsListAvailableOrgPolicyConstraintsCall { 7164 c := &ProjectsListAvailableOrgPolicyConstraintsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7165 c.resource = resource 7166 c.listavailableorgpolicyconstraintsrequest = listavailableorgpolicyconstraintsrequest 7167 return c 7168} 7169 7170// Fields allows partial responses to be retrieved. See 7171// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7172// for more information. 7173func (c *ProjectsListAvailableOrgPolicyConstraintsCall) Fields(s ...googleapi.Field) *ProjectsListAvailableOrgPolicyConstraintsCall { 7174 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7175 return c 7176} 7177 7178// Context sets the context to be used in this call's Do method. Any 7179// pending HTTP request will be aborted if the provided context is 7180// canceled. 7181func (c *ProjectsListAvailableOrgPolicyConstraintsCall) Context(ctx context.Context) *ProjectsListAvailableOrgPolicyConstraintsCall { 7182 c.ctx_ = ctx 7183 return c 7184} 7185 7186// Header returns an http.Header that can be modified by the caller to 7187// add HTTP headers to the request. 7188func (c *ProjectsListAvailableOrgPolicyConstraintsCall) Header() http.Header { 7189 if c.header_ == nil { 7190 c.header_ = make(http.Header) 7191 } 7192 return c.header_ 7193} 7194 7195func (c *ProjectsListAvailableOrgPolicyConstraintsCall) doRequest(alt string) (*http.Response, error) { 7196 reqHeaders := make(http.Header) 7197 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 7198 for k, v := range c.header_ { 7199 reqHeaders[k] = v 7200 } 7201 reqHeaders.Set("User-Agent", c.s.userAgent()) 7202 var body io.Reader = nil 7203 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listavailableorgpolicyconstraintsrequest) 7204 if err != nil { 7205 return nil, err 7206 } 7207 reqHeaders.Set("Content-Type", "application/json") 7208 c.urlParams_.Set("alt", alt) 7209 c.urlParams_.Set("prettyPrint", "false") 7210 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listAvailableOrgPolicyConstraints") 7211 urls += "?" + c.urlParams_.Encode() 7212 req, err := http.NewRequest("POST", urls, body) 7213 if err != nil { 7214 return nil, err 7215 } 7216 req.Header = reqHeaders 7217 googleapi.Expand(req.URL, map[string]string{ 7218 "resource": c.resource, 7219 }) 7220 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7221} 7222 7223// Do executes the "cloudresourcemanager.projects.listAvailableOrgPolicyConstraints" call. 7224// Exactly one of *ListAvailableOrgPolicyConstraintsResponse or error 7225// will be non-nil. Any non-2xx status code is an error. Response 7226// headers are in either 7227// *ListAvailableOrgPolicyConstraintsResponse.ServerResponse.Header or 7228// (if a response was returned at all) in 7229// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7230// whether the returned error was because http.StatusNotModified was 7231// returned. 7232func (c *ProjectsListAvailableOrgPolicyConstraintsCall) Do(opts ...googleapi.CallOption) (*ListAvailableOrgPolicyConstraintsResponse, error) { 7233 gensupport.SetOptions(c.urlParams_, opts...) 7234 res, err := c.doRequest("json") 7235 if res != nil && res.StatusCode == http.StatusNotModified { 7236 if res.Body != nil { 7237 res.Body.Close() 7238 } 7239 return nil, &googleapi.Error{ 7240 Code: res.StatusCode, 7241 Header: res.Header, 7242 } 7243 } 7244 if err != nil { 7245 return nil, err 7246 } 7247 defer googleapi.CloseBody(res) 7248 if err := googleapi.CheckResponse(res); err != nil { 7249 return nil, err 7250 } 7251 ret := &ListAvailableOrgPolicyConstraintsResponse{ 7252 ServerResponse: googleapi.ServerResponse{ 7253 Header: res.Header, 7254 HTTPStatusCode: res.StatusCode, 7255 }, 7256 } 7257 target := &ret 7258 if err := gensupport.DecodeResponse(target, res); err != nil { 7259 return nil, err 7260 } 7261 return ret, nil 7262 // { 7263 // "description": "Lists `Constraints` that could be applied on the specified resource.", 7264 // "flatPath": "v1/projects/{projectsId}:listAvailableOrgPolicyConstraints", 7265 // "httpMethod": "POST", 7266 // "id": "cloudresourcemanager.projects.listAvailableOrgPolicyConstraints", 7267 // "parameterOrder": [ 7268 // "resource" 7269 // ], 7270 // "parameters": { 7271 // "resource": { 7272 // "description": "Name of the resource to list `Constraints` for.", 7273 // "location": "path", 7274 // "pattern": "^projects/[^/]+$", 7275 // "required": true, 7276 // "type": "string" 7277 // } 7278 // }, 7279 // "path": "v1/{+resource}:listAvailableOrgPolicyConstraints", 7280 // "request": { 7281 // "$ref": "ListAvailableOrgPolicyConstraintsRequest" 7282 // }, 7283 // "response": { 7284 // "$ref": "ListAvailableOrgPolicyConstraintsResponse" 7285 // }, 7286 // "scopes": [ 7287 // "https://www.googleapis.com/auth/cloud-platform", 7288 // "https://www.googleapis.com/auth/cloud-platform.read-only" 7289 // ] 7290 // } 7291 7292} 7293 7294// Pages invokes f for each page of results. 7295// A non-nil error returned from f will halt the iteration. 7296// The provided context supersedes any context provided to the Context method. 7297func (c *ProjectsListAvailableOrgPolicyConstraintsCall) Pages(ctx context.Context, f func(*ListAvailableOrgPolicyConstraintsResponse) error) error { 7298 c.ctx_ = ctx 7299 defer func(pt string) { c.listavailableorgpolicyconstraintsrequest.PageToken = pt }(c.listavailableorgpolicyconstraintsrequest.PageToken) // reset paging to original point 7300 for { 7301 x, err := c.Do() 7302 if err != nil { 7303 return err 7304 } 7305 if err := f(x); err != nil { 7306 return err 7307 } 7308 if x.NextPageToken == "" { 7309 return nil 7310 } 7311 c.listavailableorgpolicyconstraintsrequest.PageToken = x.NextPageToken 7312 } 7313} 7314 7315// method id "cloudresourcemanager.projects.listOrgPolicies": 7316 7317type ProjectsListOrgPoliciesCall struct { 7318 s *Service 7319 resource string 7320 listorgpoliciesrequest *ListOrgPoliciesRequest 7321 urlParams_ gensupport.URLParams 7322 ctx_ context.Context 7323 header_ http.Header 7324} 7325 7326// ListOrgPolicies: Lists all the `Policies` set for a particular 7327// resource. 7328// 7329// - resource: Name of the resource to list Policies for. 7330func (r *ProjectsService) ListOrgPolicies(resource string, listorgpoliciesrequest *ListOrgPoliciesRequest) *ProjectsListOrgPoliciesCall { 7331 c := &ProjectsListOrgPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7332 c.resource = resource 7333 c.listorgpoliciesrequest = listorgpoliciesrequest 7334 return c 7335} 7336 7337// Fields allows partial responses to be retrieved. See 7338// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7339// for more information. 7340func (c *ProjectsListOrgPoliciesCall) Fields(s ...googleapi.Field) *ProjectsListOrgPoliciesCall { 7341 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7342 return c 7343} 7344 7345// Context sets the context to be used in this call's Do method. Any 7346// pending HTTP request will be aborted if the provided context is 7347// canceled. 7348func (c *ProjectsListOrgPoliciesCall) Context(ctx context.Context) *ProjectsListOrgPoliciesCall { 7349 c.ctx_ = ctx 7350 return c 7351} 7352 7353// Header returns an http.Header that can be modified by the caller to 7354// add HTTP headers to the request. 7355func (c *ProjectsListOrgPoliciesCall) Header() http.Header { 7356 if c.header_ == nil { 7357 c.header_ = make(http.Header) 7358 } 7359 return c.header_ 7360} 7361 7362func (c *ProjectsListOrgPoliciesCall) doRequest(alt string) (*http.Response, error) { 7363 reqHeaders := make(http.Header) 7364 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 7365 for k, v := range c.header_ { 7366 reqHeaders[k] = v 7367 } 7368 reqHeaders.Set("User-Agent", c.s.userAgent()) 7369 var body io.Reader = nil 7370 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listorgpoliciesrequest) 7371 if err != nil { 7372 return nil, err 7373 } 7374 reqHeaders.Set("Content-Type", "application/json") 7375 c.urlParams_.Set("alt", alt) 7376 c.urlParams_.Set("prettyPrint", "false") 7377 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listOrgPolicies") 7378 urls += "?" + c.urlParams_.Encode() 7379 req, err := http.NewRequest("POST", urls, body) 7380 if err != nil { 7381 return nil, err 7382 } 7383 req.Header = reqHeaders 7384 googleapi.Expand(req.URL, map[string]string{ 7385 "resource": c.resource, 7386 }) 7387 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7388} 7389 7390// Do executes the "cloudresourcemanager.projects.listOrgPolicies" call. 7391// Exactly one of *ListOrgPoliciesResponse or error will be non-nil. Any 7392// non-2xx status code is an error. Response headers are in either 7393// *ListOrgPoliciesResponse.ServerResponse.Header or (if a response was 7394// returned at all) in error.(*googleapi.Error).Header. Use 7395// googleapi.IsNotModified to check whether the returned error was 7396// because http.StatusNotModified was returned. 7397func (c *ProjectsListOrgPoliciesCall) Do(opts ...googleapi.CallOption) (*ListOrgPoliciesResponse, error) { 7398 gensupport.SetOptions(c.urlParams_, opts...) 7399 res, err := c.doRequest("json") 7400 if res != nil && res.StatusCode == http.StatusNotModified { 7401 if res.Body != nil { 7402 res.Body.Close() 7403 } 7404 return nil, &googleapi.Error{ 7405 Code: res.StatusCode, 7406 Header: res.Header, 7407 } 7408 } 7409 if err != nil { 7410 return nil, err 7411 } 7412 defer googleapi.CloseBody(res) 7413 if err := googleapi.CheckResponse(res); err != nil { 7414 return nil, err 7415 } 7416 ret := &ListOrgPoliciesResponse{ 7417 ServerResponse: googleapi.ServerResponse{ 7418 Header: res.Header, 7419 HTTPStatusCode: res.StatusCode, 7420 }, 7421 } 7422 target := &ret 7423 if err := gensupport.DecodeResponse(target, res); err != nil { 7424 return nil, err 7425 } 7426 return ret, nil 7427 // { 7428 // "description": "Lists all the `Policies` set for a particular resource.", 7429 // "flatPath": "v1/projects/{projectsId}:listOrgPolicies", 7430 // "httpMethod": "POST", 7431 // "id": "cloudresourcemanager.projects.listOrgPolicies", 7432 // "parameterOrder": [ 7433 // "resource" 7434 // ], 7435 // "parameters": { 7436 // "resource": { 7437 // "description": "Name of the resource to list Policies for.", 7438 // "location": "path", 7439 // "pattern": "^projects/[^/]+$", 7440 // "required": true, 7441 // "type": "string" 7442 // } 7443 // }, 7444 // "path": "v1/{+resource}:listOrgPolicies", 7445 // "request": { 7446 // "$ref": "ListOrgPoliciesRequest" 7447 // }, 7448 // "response": { 7449 // "$ref": "ListOrgPoliciesResponse" 7450 // }, 7451 // "scopes": [ 7452 // "https://www.googleapis.com/auth/cloud-platform", 7453 // "https://www.googleapis.com/auth/cloud-platform.read-only" 7454 // ] 7455 // } 7456 7457} 7458 7459// Pages invokes f for each page of results. 7460// A non-nil error returned from f will halt the iteration. 7461// The provided context supersedes any context provided to the Context method. 7462func (c *ProjectsListOrgPoliciesCall) Pages(ctx context.Context, f func(*ListOrgPoliciesResponse) error) error { 7463 c.ctx_ = ctx 7464 defer func(pt string) { c.listorgpoliciesrequest.PageToken = pt }(c.listorgpoliciesrequest.PageToken) // reset paging to original point 7465 for { 7466 x, err := c.Do() 7467 if err != nil { 7468 return err 7469 } 7470 if err := f(x); err != nil { 7471 return err 7472 } 7473 if x.NextPageToken == "" { 7474 return nil 7475 } 7476 c.listorgpoliciesrequest.PageToken = x.NextPageToken 7477 } 7478} 7479 7480// method id "cloudresourcemanager.projects.setIamPolicy": 7481 7482type ProjectsSetIamPolicyCall struct { 7483 s *Service 7484 resource string 7485 setiampolicyrequest *SetIamPolicyRequest 7486 urlParams_ gensupport.URLParams 7487 ctx_ context.Context 7488 header_ http.Header 7489} 7490 7491// SetIamPolicy: Sets the IAM access control policy for the specified 7492// Project. CAUTION: This method will replace the existing policy, and 7493// cannot be used to append additional IAM settings. NOTE: Removing 7494// service accounts from policies or changing their roles can render 7495// services completely inoperable. It is important to understand how the 7496// service account is being used before removing or updating its roles. 7497// For additional information about `resource` (e.g. my-project-id) 7498// structure and identification, see Resource Names 7499// (https://cloud.google.com/apis/design/resource_names). The following 7500// constraints apply when using `setIamPolicy()`: + Project does not 7501// support `allUsers` and `allAuthenticatedUsers` as `members` in a 7502// `Binding` of a `Policy`. + The owner role can be granted to a `user`, 7503// `serviceAccount`, or a group that is part of an organization. For 7504// example, group@myownpersonaldomain.com could be added as an owner to 7505// a project in the myownpersonaldomain.com organization, but not the 7506// examplepetstore.com organization. + Service accounts can be made 7507// owners of a project directly without any restrictions. However, to be 7508// added as an owner, a user must be invited via Cloud Platform console 7509// and must accept the invitation. + A user cannot be granted the owner 7510// role using `setIamPolicy()`. The user must be granted the owner role 7511// using the Cloud Platform Console and must explicitly accept the 7512// invitation. + You can only grant ownership of a project to a member 7513// by using the GCP Console. Inviting a member will deliver an 7514// invitation email that they must accept. An invitation email is not 7515// generated if you are granting a role other than owner, or if both the 7516// member you are inviting and the project are part of your 7517// organization. + Membership changes that leave the project without any 7518// owners that have accepted the Terms of Service (ToS) will be 7519// rejected. + If the project is not part of an organization, there must 7520// be at least one owner who has accepted the Terms of Service (ToS) 7521// agreement in the policy. Calling `setIamPolicy()` to remove the last 7522// ToS-accepted owner from the policy will fail. This restriction also 7523// applies to legacy projects that no longer have owners who have 7524// accepted the ToS. Edits to IAM policies will be rejected until the 7525// lack of a ToS-accepting owner is rectified. Authorization requires 7526// the Google IAM permission `resourcemanager.projects.setIamPolicy` on 7527// the project 7528// 7529// - resource: REQUIRED: The resource for which the policy is being 7530// specified. See the operation documentation for the appropriate 7531// value for this field. 7532func (r *ProjectsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsSetIamPolicyCall { 7533 c := &ProjectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7534 c.resource = resource 7535 c.setiampolicyrequest = setiampolicyrequest 7536 return c 7537} 7538 7539// Fields allows partial responses to be retrieved. See 7540// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7541// for more information. 7542func (c *ProjectsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSetIamPolicyCall { 7543 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7544 return c 7545} 7546 7547// Context sets the context to be used in this call's Do method. Any 7548// pending HTTP request will be aborted if the provided context is 7549// canceled. 7550func (c *ProjectsSetIamPolicyCall) Context(ctx context.Context) *ProjectsSetIamPolicyCall { 7551 c.ctx_ = ctx 7552 return c 7553} 7554 7555// Header returns an http.Header that can be modified by the caller to 7556// add HTTP headers to the request. 7557func (c *ProjectsSetIamPolicyCall) Header() http.Header { 7558 if c.header_ == nil { 7559 c.header_ = make(http.Header) 7560 } 7561 return c.header_ 7562} 7563 7564func (c *ProjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 7565 reqHeaders := make(http.Header) 7566 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 7567 for k, v := range c.header_ { 7568 reqHeaders[k] = v 7569 } 7570 reqHeaders.Set("User-Agent", c.s.userAgent()) 7571 var body io.Reader = nil 7572 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 7573 if err != nil { 7574 return nil, err 7575 } 7576 reqHeaders.Set("Content-Type", "application/json") 7577 c.urlParams_.Set("alt", alt) 7578 c.urlParams_.Set("prettyPrint", "false") 7579 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{resource}:setIamPolicy") 7580 urls += "?" + c.urlParams_.Encode() 7581 req, err := http.NewRequest("POST", urls, body) 7582 if err != nil { 7583 return nil, err 7584 } 7585 req.Header = reqHeaders 7586 googleapi.Expand(req.URL, map[string]string{ 7587 "resource": c.resource, 7588 }) 7589 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7590} 7591 7592// Do executes the "cloudresourcemanager.projects.setIamPolicy" call. 7593// Exactly one of *Policy or error will be non-nil. Any non-2xx status 7594// code is an error. Response headers are in either 7595// *Policy.ServerResponse.Header or (if a response was returned at all) 7596// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7597// check whether the returned error was because http.StatusNotModified 7598// was returned. 7599func (c *ProjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 7600 gensupport.SetOptions(c.urlParams_, opts...) 7601 res, err := c.doRequest("json") 7602 if res != nil && res.StatusCode == http.StatusNotModified { 7603 if res.Body != nil { 7604 res.Body.Close() 7605 } 7606 return nil, &googleapi.Error{ 7607 Code: res.StatusCode, 7608 Header: res.Header, 7609 } 7610 } 7611 if err != nil { 7612 return nil, err 7613 } 7614 defer googleapi.CloseBody(res) 7615 if err := googleapi.CheckResponse(res); err != nil { 7616 return nil, err 7617 } 7618 ret := &Policy{ 7619 ServerResponse: googleapi.ServerResponse{ 7620 Header: res.Header, 7621 HTTPStatusCode: res.StatusCode, 7622 }, 7623 } 7624 target := &ret 7625 if err := gensupport.DecodeResponse(target, res); err != nil { 7626 return nil, err 7627 } 7628 return ret, nil 7629 // { 7630 // "description": "Sets the IAM access control policy for the specified Project. CAUTION: This method will replace the existing policy, and cannot be used to append additional IAM settings. NOTE: Removing service accounts from policies or changing their roles can render services completely inoperable. It is important to understand how the service account is being used before removing or updating its roles. For additional information about `resource` (e.g. my-project-id) structure and identification, see [Resource Names](https://cloud.google.com/apis/design/resource_names). The following constraints apply when using `setIamPolicy()`: + Project does not support `allUsers` and `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + The owner role can be granted to a `user`, `serviceAccount`, or a group that is part of an organization. For example, group@myownpersonaldomain.com could be added as an owner to a project in the myownpersonaldomain.com organization, but not the examplepetstore.com organization. + Service accounts can be made owners of a project directly without any restrictions. However, to be added as an owner, a user must be invited via Cloud Platform console and must accept the invitation. + A user cannot be granted the owner role using `setIamPolicy()`. The user must be granted the owner role using the Cloud Platform Console and must explicitly accept the invitation. + You can only grant ownership of a project to a member by using the GCP Console. Inviting a member will deliver an invitation email that they must accept. An invitation email is not generated if you are granting a role other than owner, or if both the member you are inviting and the project are part of your organization. + Membership changes that leave the project without any owners that have accepted the Terms of Service (ToS) will be rejected. + If the project is not part of an organization, there must be at least one owner who has accepted the Terms of Service (ToS) agreement in the policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner from the policy will fail. This restriction also applies to legacy projects that no longer have owners who have accepted the ToS. Edits to IAM policies will be rejected until the lack of a ToS-accepting owner is rectified. Authorization requires the Google IAM permission `resourcemanager.projects.setIamPolicy` on the project", 7631 // "flatPath": "v1/projects/{resource}:setIamPolicy", 7632 // "httpMethod": "POST", 7633 // "id": "cloudresourcemanager.projects.setIamPolicy", 7634 // "parameterOrder": [ 7635 // "resource" 7636 // ], 7637 // "parameters": { 7638 // "resource": { 7639 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 7640 // "location": "path", 7641 // "required": true, 7642 // "type": "string" 7643 // } 7644 // }, 7645 // "path": "v1/projects/{resource}:setIamPolicy", 7646 // "request": { 7647 // "$ref": "SetIamPolicyRequest" 7648 // }, 7649 // "response": { 7650 // "$ref": "Policy" 7651 // }, 7652 // "scopes": [ 7653 // "https://www.googleapis.com/auth/cloud-platform" 7654 // ] 7655 // } 7656 7657} 7658 7659// method id "cloudresourcemanager.projects.setOrgPolicy": 7660 7661type ProjectsSetOrgPolicyCall struct { 7662 s *Service 7663 resource string 7664 setorgpolicyrequest *SetOrgPolicyRequest 7665 urlParams_ gensupport.URLParams 7666 ctx_ context.Context 7667 header_ http.Header 7668} 7669 7670// SetOrgPolicy: Updates the specified `Policy` on the resource. Creates 7671// a new `Policy` for that `Constraint` on the resource if one does not 7672// exist. Not supplying an `etag` on the request `Policy` results in an 7673// unconditional write of the `Policy`. 7674// 7675// - resource: Resource name of the resource to attach the `Policy`. 7676func (r *ProjectsService) SetOrgPolicy(resource string, setorgpolicyrequest *SetOrgPolicyRequest) *ProjectsSetOrgPolicyCall { 7677 c := &ProjectsSetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7678 c.resource = resource 7679 c.setorgpolicyrequest = setorgpolicyrequest 7680 return c 7681} 7682 7683// Fields allows partial responses to be retrieved. See 7684// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7685// for more information. 7686func (c *ProjectsSetOrgPolicyCall) Fields(s ...googleapi.Field) *ProjectsSetOrgPolicyCall { 7687 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7688 return c 7689} 7690 7691// Context sets the context to be used in this call's Do method. Any 7692// pending HTTP request will be aborted if the provided context is 7693// canceled. 7694func (c *ProjectsSetOrgPolicyCall) Context(ctx context.Context) *ProjectsSetOrgPolicyCall { 7695 c.ctx_ = ctx 7696 return c 7697} 7698 7699// Header returns an http.Header that can be modified by the caller to 7700// add HTTP headers to the request. 7701func (c *ProjectsSetOrgPolicyCall) Header() http.Header { 7702 if c.header_ == nil { 7703 c.header_ = make(http.Header) 7704 } 7705 return c.header_ 7706} 7707 7708func (c *ProjectsSetOrgPolicyCall) doRequest(alt string) (*http.Response, error) { 7709 reqHeaders := make(http.Header) 7710 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 7711 for k, v := range c.header_ { 7712 reqHeaders[k] = v 7713 } 7714 reqHeaders.Set("User-Agent", c.s.userAgent()) 7715 var body io.Reader = nil 7716 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setorgpolicyrequest) 7717 if err != nil { 7718 return nil, err 7719 } 7720 reqHeaders.Set("Content-Type", "application/json") 7721 c.urlParams_.Set("alt", alt) 7722 c.urlParams_.Set("prettyPrint", "false") 7723 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setOrgPolicy") 7724 urls += "?" + c.urlParams_.Encode() 7725 req, err := http.NewRequest("POST", urls, body) 7726 if err != nil { 7727 return nil, err 7728 } 7729 req.Header = reqHeaders 7730 googleapi.Expand(req.URL, map[string]string{ 7731 "resource": c.resource, 7732 }) 7733 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7734} 7735 7736// Do executes the "cloudresourcemanager.projects.setOrgPolicy" call. 7737// Exactly one of *OrgPolicy or error will be non-nil. Any non-2xx 7738// status code is an error. Response headers are in either 7739// *OrgPolicy.ServerResponse.Header or (if a response was returned at 7740// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7741// to check whether the returned error was because 7742// http.StatusNotModified was returned. 7743func (c *ProjectsSetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) { 7744 gensupport.SetOptions(c.urlParams_, opts...) 7745 res, err := c.doRequest("json") 7746 if res != nil && res.StatusCode == http.StatusNotModified { 7747 if res.Body != nil { 7748 res.Body.Close() 7749 } 7750 return nil, &googleapi.Error{ 7751 Code: res.StatusCode, 7752 Header: res.Header, 7753 } 7754 } 7755 if err != nil { 7756 return nil, err 7757 } 7758 defer googleapi.CloseBody(res) 7759 if err := googleapi.CheckResponse(res); err != nil { 7760 return nil, err 7761 } 7762 ret := &OrgPolicy{ 7763 ServerResponse: googleapi.ServerResponse{ 7764 Header: res.Header, 7765 HTTPStatusCode: res.StatusCode, 7766 }, 7767 } 7768 target := &ret 7769 if err := gensupport.DecodeResponse(target, res); err != nil { 7770 return nil, err 7771 } 7772 return ret, nil 7773 // { 7774 // "description": "Updates the specified `Policy` on the resource. Creates a new `Policy` for that `Constraint` on the resource if one does not exist. Not supplying an `etag` on the request `Policy` results in an unconditional write of the `Policy`.", 7775 // "flatPath": "v1/projects/{projectsId}:setOrgPolicy", 7776 // "httpMethod": "POST", 7777 // "id": "cloudresourcemanager.projects.setOrgPolicy", 7778 // "parameterOrder": [ 7779 // "resource" 7780 // ], 7781 // "parameters": { 7782 // "resource": { 7783 // "description": "Resource name of the resource to attach the `Policy`.", 7784 // "location": "path", 7785 // "pattern": "^projects/[^/]+$", 7786 // "required": true, 7787 // "type": "string" 7788 // } 7789 // }, 7790 // "path": "v1/{+resource}:setOrgPolicy", 7791 // "request": { 7792 // "$ref": "SetOrgPolicyRequest" 7793 // }, 7794 // "response": { 7795 // "$ref": "OrgPolicy" 7796 // }, 7797 // "scopes": [ 7798 // "https://www.googleapis.com/auth/cloud-platform" 7799 // ] 7800 // } 7801 7802} 7803 7804// method id "cloudresourcemanager.projects.testIamPermissions": 7805 7806type ProjectsTestIamPermissionsCall struct { 7807 s *Service 7808 resource string 7809 testiampermissionsrequest *TestIamPermissionsRequest 7810 urlParams_ gensupport.URLParams 7811 ctx_ context.Context 7812 header_ http.Header 7813} 7814 7815// TestIamPermissions: Returns permissions that a caller has on the 7816// specified Project. For additional information about `resource` (e.g. 7817// my-project-id) structure and identification, see Resource Names 7818// (https://cloud.google.com/apis/design/resource_names). There are no 7819// permissions required for making this API call. 7820// 7821// - resource: REQUIRED: The resource for which the policy detail is 7822// being requested. See the operation documentation for the 7823// appropriate value for this field. 7824func (r *ProjectsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsTestIamPermissionsCall { 7825 c := &ProjectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7826 c.resource = resource 7827 c.testiampermissionsrequest = testiampermissionsrequest 7828 return c 7829} 7830 7831// Fields allows partial responses to be retrieved. See 7832// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7833// for more information. 7834func (c *ProjectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsTestIamPermissionsCall { 7835 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7836 return c 7837} 7838 7839// Context sets the context to be used in this call's Do method. Any 7840// pending HTTP request will be aborted if the provided context is 7841// canceled. 7842func (c *ProjectsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsTestIamPermissionsCall { 7843 c.ctx_ = ctx 7844 return c 7845} 7846 7847// Header returns an http.Header that can be modified by the caller to 7848// add HTTP headers to the request. 7849func (c *ProjectsTestIamPermissionsCall) Header() http.Header { 7850 if c.header_ == nil { 7851 c.header_ = make(http.Header) 7852 } 7853 return c.header_ 7854} 7855 7856func (c *ProjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 7857 reqHeaders := make(http.Header) 7858 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 7859 for k, v := range c.header_ { 7860 reqHeaders[k] = v 7861 } 7862 reqHeaders.Set("User-Agent", c.s.userAgent()) 7863 var body io.Reader = nil 7864 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 7865 if err != nil { 7866 return nil, err 7867 } 7868 reqHeaders.Set("Content-Type", "application/json") 7869 c.urlParams_.Set("alt", alt) 7870 c.urlParams_.Set("prettyPrint", "false") 7871 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{resource}:testIamPermissions") 7872 urls += "?" + c.urlParams_.Encode() 7873 req, err := http.NewRequest("POST", urls, body) 7874 if err != nil { 7875 return nil, err 7876 } 7877 req.Header = reqHeaders 7878 googleapi.Expand(req.URL, map[string]string{ 7879 "resource": c.resource, 7880 }) 7881 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7882} 7883 7884// Do executes the "cloudresourcemanager.projects.testIamPermissions" call. 7885// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 7886// Any non-2xx status code is an error. Response headers are in either 7887// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 7888// was returned at all) in error.(*googleapi.Error).Header. Use 7889// googleapi.IsNotModified to check whether the returned error was 7890// because http.StatusNotModified was returned. 7891func (c *ProjectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 7892 gensupport.SetOptions(c.urlParams_, opts...) 7893 res, err := c.doRequest("json") 7894 if res != nil && res.StatusCode == http.StatusNotModified { 7895 if res.Body != nil { 7896 res.Body.Close() 7897 } 7898 return nil, &googleapi.Error{ 7899 Code: res.StatusCode, 7900 Header: res.Header, 7901 } 7902 } 7903 if err != nil { 7904 return nil, err 7905 } 7906 defer googleapi.CloseBody(res) 7907 if err := googleapi.CheckResponse(res); err != nil { 7908 return nil, err 7909 } 7910 ret := &TestIamPermissionsResponse{ 7911 ServerResponse: googleapi.ServerResponse{ 7912 Header: res.Header, 7913 HTTPStatusCode: res.StatusCode, 7914 }, 7915 } 7916 target := &ret 7917 if err := gensupport.DecodeResponse(target, res); err != nil { 7918 return nil, err 7919 } 7920 return ret, nil 7921 // { 7922 // "description": "Returns permissions that a caller has on the specified Project. For additional information about `resource` (e.g. my-project-id) structure and identification, see [Resource Names](https://cloud.google.com/apis/design/resource_names). There are no permissions required for making this API call.", 7923 // "flatPath": "v1/projects/{resource}:testIamPermissions", 7924 // "httpMethod": "POST", 7925 // "id": "cloudresourcemanager.projects.testIamPermissions", 7926 // "parameterOrder": [ 7927 // "resource" 7928 // ], 7929 // "parameters": { 7930 // "resource": { 7931 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 7932 // "location": "path", 7933 // "required": true, 7934 // "type": "string" 7935 // } 7936 // }, 7937 // "path": "v1/projects/{resource}:testIamPermissions", 7938 // "request": { 7939 // "$ref": "TestIamPermissionsRequest" 7940 // }, 7941 // "response": { 7942 // "$ref": "TestIamPermissionsResponse" 7943 // }, 7944 // "scopes": [ 7945 // "https://www.googleapis.com/auth/cloud-platform", 7946 // "https://www.googleapis.com/auth/cloud-platform.read-only" 7947 // ] 7948 // } 7949 7950} 7951 7952// method id "cloudresourcemanager.projects.undelete": 7953 7954type ProjectsUndeleteCall struct { 7955 s *Service 7956 projectId string 7957 undeleteprojectrequest *UndeleteProjectRequest 7958 urlParams_ gensupport.URLParams 7959 ctx_ context.Context 7960 header_ http.Header 7961} 7962 7963// Undelete: Restores the Project identified by the specified 7964// `project_id` (for example, `my-project-123`). You can only use this 7965// method for a Project that has a lifecycle state of DELETE_REQUESTED. 7966// After deletion starts, the Project cannot be restored. The caller 7967// must have undelete permissions for this Project. 7968// 7969// - projectId: The project ID (for example, `foo-bar-123`). 7970func (r *ProjectsService) Undelete(projectId string, undeleteprojectrequest *UndeleteProjectRequest) *ProjectsUndeleteCall { 7971 c := &ProjectsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7972 c.projectId = projectId 7973 c.undeleteprojectrequest = undeleteprojectrequest 7974 return c 7975} 7976 7977// Fields allows partial responses to be retrieved. See 7978// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7979// for more information. 7980func (c *ProjectsUndeleteCall) Fields(s ...googleapi.Field) *ProjectsUndeleteCall { 7981 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7982 return c 7983} 7984 7985// Context sets the context to be used in this call's Do method. Any 7986// pending HTTP request will be aborted if the provided context is 7987// canceled. 7988func (c *ProjectsUndeleteCall) Context(ctx context.Context) *ProjectsUndeleteCall { 7989 c.ctx_ = ctx 7990 return c 7991} 7992 7993// Header returns an http.Header that can be modified by the caller to 7994// add HTTP headers to the request. 7995func (c *ProjectsUndeleteCall) Header() http.Header { 7996 if c.header_ == nil { 7997 c.header_ = make(http.Header) 7998 } 7999 return c.header_ 8000} 8001 8002func (c *ProjectsUndeleteCall) doRequest(alt string) (*http.Response, error) { 8003 reqHeaders := make(http.Header) 8004 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 8005 for k, v := range c.header_ { 8006 reqHeaders[k] = v 8007 } 8008 reqHeaders.Set("User-Agent", c.s.userAgent()) 8009 var body io.Reader = nil 8010 body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteprojectrequest) 8011 if err != nil { 8012 return nil, err 8013 } 8014 reqHeaders.Set("Content-Type", "application/json") 8015 c.urlParams_.Set("alt", alt) 8016 c.urlParams_.Set("prettyPrint", "false") 8017 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}:undelete") 8018 urls += "?" + c.urlParams_.Encode() 8019 req, err := http.NewRequest("POST", urls, body) 8020 if err != nil { 8021 return nil, err 8022 } 8023 req.Header = reqHeaders 8024 googleapi.Expand(req.URL, map[string]string{ 8025 "projectId": c.projectId, 8026 }) 8027 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8028} 8029 8030// Do executes the "cloudresourcemanager.projects.undelete" call. 8031// Exactly one of *Empty or error will be non-nil. Any non-2xx status 8032// code is an error. Response headers are in either 8033// *Empty.ServerResponse.Header or (if a response was returned at all) 8034// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8035// check whether the returned error was because http.StatusNotModified 8036// was returned. 8037func (c *ProjectsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 8038 gensupport.SetOptions(c.urlParams_, opts...) 8039 res, err := c.doRequest("json") 8040 if res != nil && res.StatusCode == http.StatusNotModified { 8041 if res.Body != nil { 8042 res.Body.Close() 8043 } 8044 return nil, &googleapi.Error{ 8045 Code: res.StatusCode, 8046 Header: res.Header, 8047 } 8048 } 8049 if err != nil { 8050 return nil, err 8051 } 8052 defer googleapi.CloseBody(res) 8053 if err := googleapi.CheckResponse(res); err != nil { 8054 return nil, err 8055 } 8056 ret := &Empty{ 8057 ServerResponse: googleapi.ServerResponse{ 8058 Header: res.Header, 8059 HTTPStatusCode: res.StatusCode, 8060 }, 8061 } 8062 target := &ret 8063 if err := gensupport.DecodeResponse(target, res); err != nil { 8064 return nil, err 8065 } 8066 return ret, nil 8067 // { 8068 // "description": "Restores the Project identified by the specified `project_id` (for example, `my-project-123`). You can only use this method for a Project that has a lifecycle state of DELETE_REQUESTED. After deletion starts, the Project cannot be restored. The caller must have undelete permissions for this Project.", 8069 // "flatPath": "v1/projects/{projectId}:undelete", 8070 // "httpMethod": "POST", 8071 // "id": "cloudresourcemanager.projects.undelete", 8072 // "parameterOrder": [ 8073 // "projectId" 8074 // ], 8075 // "parameters": { 8076 // "projectId": { 8077 // "description": "Required. The project ID (for example, `foo-bar-123`).", 8078 // "location": "path", 8079 // "required": true, 8080 // "type": "string" 8081 // } 8082 // }, 8083 // "path": "v1/projects/{projectId}:undelete", 8084 // "request": { 8085 // "$ref": "UndeleteProjectRequest" 8086 // }, 8087 // "response": { 8088 // "$ref": "Empty" 8089 // }, 8090 // "scopes": [ 8091 // "https://www.googleapis.com/auth/cloud-platform" 8092 // ] 8093 // } 8094 8095} 8096 8097// method id "cloudresourcemanager.projects.update": 8098 8099type ProjectsUpdateCall struct { 8100 s *Service 8101 projectId string 8102 project *Project 8103 urlParams_ gensupport.URLParams 8104 ctx_ context.Context 8105 header_ http.Header 8106} 8107 8108// Update: Updates the attributes of the Project identified by the 8109// specified `project_id` (for example, `my-project-123`). The caller 8110// must have modify permissions for this Project. 8111// 8112// - projectId: The project ID (for example, `my-project-123`). 8113func (r *ProjectsService) Update(projectId string, project *Project) *ProjectsUpdateCall { 8114 c := &ProjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8115 c.projectId = projectId 8116 c.project = project 8117 return c 8118} 8119 8120// Fields allows partial responses to be retrieved. See 8121// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8122// for more information. 8123func (c *ProjectsUpdateCall) Fields(s ...googleapi.Field) *ProjectsUpdateCall { 8124 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8125 return c 8126} 8127 8128// Context sets the context to be used in this call's Do method. Any 8129// pending HTTP request will be aborted if the provided context is 8130// canceled. 8131func (c *ProjectsUpdateCall) Context(ctx context.Context) *ProjectsUpdateCall { 8132 c.ctx_ = ctx 8133 return c 8134} 8135 8136// Header returns an http.Header that can be modified by the caller to 8137// add HTTP headers to the request. 8138func (c *ProjectsUpdateCall) Header() http.Header { 8139 if c.header_ == nil { 8140 c.header_ = make(http.Header) 8141 } 8142 return c.header_ 8143} 8144 8145func (c *ProjectsUpdateCall) doRequest(alt string) (*http.Response, error) { 8146 reqHeaders := make(http.Header) 8147 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 8148 for k, v := range c.header_ { 8149 reqHeaders[k] = v 8150 } 8151 reqHeaders.Set("User-Agent", c.s.userAgent()) 8152 var body io.Reader = nil 8153 body, err := googleapi.WithoutDataWrapper.JSONReader(c.project) 8154 if err != nil { 8155 return nil, err 8156 } 8157 reqHeaders.Set("Content-Type", "application/json") 8158 c.urlParams_.Set("alt", alt) 8159 c.urlParams_.Set("prettyPrint", "false") 8160 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}") 8161 urls += "?" + c.urlParams_.Encode() 8162 req, err := http.NewRequest("PUT", urls, body) 8163 if err != nil { 8164 return nil, err 8165 } 8166 req.Header = reqHeaders 8167 googleapi.Expand(req.URL, map[string]string{ 8168 "projectId": c.projectId, 8169 }) 8170 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8171} 8172 8173// Do executes the "cloudresourcemanager.projects.update" call. 8174// Exactly one of *Project or error will be non-nil. Any non-2xx status 8175// code is an error. Response headers are in either 8176// *Project.ServerResponse.Header or (if a response was returned at all) 8177// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8178// check whether the returned error was because http.StatusNotModified 8179// was returned. 8180func (c *ProjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Project, error) { 8181 gensupport.SetOptions(c.urlParams_, opts...) 8182 res, err := c.doRequest("json") 8183 if res != nil && res.StatusCode == http.StatusNotModified { 8184 if res.Body != nil { 8185 res.Body.Close() 8186 } 8187 return nil, &googleapi.Error{ 8188 Code: res.StatusCode, 8189 Header: res.Header, 8190 } 8191 } 8192 if err != nil { 8193 return nil, err 8194 } 8195 defer googleapi.CloseBody(res) 8196 if err := googleapi.CheckResponse(res); err != nil { 8197 return nil, err 8198 } 8199 ret := &Project{ 8200 ServerResponse: googleapi.ServerResponse{ 8201 Header: res.Header, 8202 HTTPStatusCode: res.StatusCode, 8203 }, 8204 } 8205 target := &ret 8206 if err := gensupport.DecodeResponse(target, res); err != nil { 8207 return nil, err 8208 } 8209 return ret, nil 8210 // { 8211 // "description": "Updates the attributes of the Project identified by the specified `project_id` (for example, `my-project-123`). The caller must have modify permissions for this Project.", 8212 // "flatPath": "v1/projects/{projectId}", 8213 // "httpMethod": "PUT", 8214 // "id": "cloudresourcemanager.projects.update", 8215 // "parameterOrder": [ 8216 // "projectId" 8217 // ], 8218 // "parameters": { 8219 // "projectId": { 8220 // "description": "The project ID (for example, `my-project-123`). Required.", 8221 // "location": "path", 8222 // "required": true, 8223 // "type": "string" 8224 // } 8225 // }, 8226 // "path": "v1/projects/{projectId}", 8227 // "request": { 8228 // "$ref": "Project" 8229 // }, 8230 // "response": { 8231 // "$ref": "Project" 8232 // }, 8233 // "scopes": [ 8234 // "https://www.googleapis.com/auth/cloud-platform" 8235 // ] 8236 // } 8237 8238} 8239