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/v1beta1" 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/v1beta1" 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:v1beta1" 79const apiName = "cloudresourcemanager" 80const apiVersion = "v1beta1" 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.Organizations = NewOrganizationsService(s) 130 s.Projects = NewProjectsService(s) 131 return s, nil 132} 133 134type Service struct { 135 client *http.Client 136 BasePath string // API endpoint base URL 137 UserAgent string // optional additional User-Agent fragment 138 139 Organizations *OrganizationsService 140 141 Projects *ProjectsService 142} 143 144func (s *Service) userAgent() string { 145 if s.UserAgent == "" { 146 return googleapi.UserAgent 147 } 148 return googleapi.UserAgent + " " + s.UserAgent 149} 150 151func NewOrganizationsService(s *Service) *OrganizationsService { 152 rs := &OrganizationsService{s: s} 153 return rs 154} 155 156type OrganizationsService struct { 157 s *Service 158} 159 160func NewProjectsService(s *Service) *ProjectsService { 161 rs := &ProjectsService{s: s} 162 return rs 163} 164 165type ProjectsService struct { 166 s *Service 167} 168 169// Ancestor: Identifying information for a single ancestor of a project. 170type Ancestor struct { 171 // ResourceId: Resource id of the ancestor. 172 ResourceId *ResourceId `json:"resourceId,omitempty"` 173 174 // ForceSendFields is a list of field names (e.g. "ResourceId") to 175 // unconditionally include in API requests. By default, fields with 176 // empty or default values are omitted from API requests. However, any 177 // non-pointer, non-interface field appearing in ForceSendFields will be 178 // sent to the server regardless of whether the field is empty or not. 179 // This may be used to include empty fields in Patch requests. 180 ForceSendFields []string `json:"-"` 181 182 // NullFields is a list of field names (e.g. "ResourceId") to include in 183 // API requests with the JSON null value. By default, fields with empty 184 // values are omitted from API requests. However, any field with an 185 // empty value appearing in NullFields will be sent to the server as 186 // null. It is an error if a field in this list has a non-empty value. 187 // This may be used to include null fields in Patch requests. 188 NullFields []string `json:"-"` 189} 190 191func (s *Ancestor) MarshalJSON() ([]byte, error) { 192 type NoMethod Ancestor 193 raw := NoMethod(*s) 194 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 195} 196 197// AuditConfig: Specifies the audit configuration for a service. The 198// configuration determines which permission types are logged, and what 199// identities, if any, are exempted from logging. An AuditConfig must 200// have one or more AuditLogConfigs. If there are AuditConfigs for both 201// `allServices` and a specific service, the union of the two 202// AuditConfigs is used for that service: the log_types specified in 203// each AuditConfig are enabled, and the exempted_members in each 204// AuditLogConfig are exempted. Example Policy with multiple 205// AuditConfigs: { "audit_configs": [ { "service": "allServices", 206// "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": 207// [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { 208// "log_type": "ADMIN_READ" } ] }, { "service": 209// "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": 210// "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ 211// "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy 212// enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts 213// jose@example.com from DATA_READ logging, and aliya@example.com from 214// DATA_WRITE logging. 215type AuditConfig struct { 216 // AuditLogConfigs: The configuration for logging of each type of 217 // permission. 218 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"` 219 220 // Service: Specifies a service that will be enabled for audit logging. 221 // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. 222 // `allServices` is a special value that covers all services. 223 Service string `json:"service,omitempty"` 224 225 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to 226 // unconditionally include in API requests. By default, fields with 227 // empty or default values are omitted from API requests. However, any 228 // non-pointer, non-interface field appearing in ForceSendFields will be 229 // sent to the server regardless of whether the field is empty or not. 230 // This may be used to include empty fields in Patch requests. 231 ForceSendFields []string `json:"-"` 232 233 // NullFields is a list of field names (e.g. "AuditLogConfigs") to 234 // include in API requests with the JSON null value. By default, fields 235 // with empty values are omitted from API requests. However, any field 236 // with an empty value appearing in NullFields will be sent to the 237 // server as null. It is an error if a field in this list has a 238 // non-empty value. This may be used to include null fields in Patch 239 // requests. 240 NullFields []string `json:"-"` 241} 242 243func (s *AuditConfig) MarshalJSON() ([]byte, error) { 244 type NoMethod AuditConfig 245 raw := NoMethod(*s) 246 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 247} 248 249// AuditLogConfig: Provides the configuration for logging a type of 250// permissions. Example: { "audit_log_configs": [ { "log_type": 251// "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { 252// "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and 253// 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ 254// logging. 255type AuditLogConfig struct { 256 // ExemptedMembers: Specifies the identities that do not cause logging 257 // for this type of permission. Follows the same format of 258 // Binding.members. 259 ExemptedMembers []string `json:"exemptedMembers,omitempty"` 260 261 // LogType: The log type that this config enables. 262 // 263 // Possible values: 264 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this. 265 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy 266 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create 267 // "DATA_READ" - Data reads. Example: CloudSQL Users list 268 LogType string `json:"logType,omitempty"` 269 270 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to 271 // unconditionally include in API requests. By default, fields with 272 // empty or default values are omitted from API requests. However, any 273 // non-pointer, non-interface field appearing in ForceSendFields will be 274 // sent to the server regardless of whether the field is empty or not. 275 // This may be used to include empty fields in Patch requests. 276 ForceSendFields []string `json:"-"` 277 278 // NullFields is a list of field names (e.g. "ExemptedMembers") to 279 // include in API requests with the JSON null value. By default, fields 280 // with empty values are omitted from API requests. However, any field 281 // with an empty value appearing in NullFields will be sent to the 282 // server as null. It is an error if a field in this list has a 283 // non-empty value. This may be used to include null fields in Patch 284 // requests. 285 NullFields []string `json:"-"` 286} 287 288func (s *AuditLogConfig) MarshalJSON() ([]byte, error) { 289 type NoMethod AuditLogConfig 290 raw := NoMethod(*s) 291 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 292} 293 294// Binding: Associates `members` with a `role`. 295type Binding struct { 296 // Condition: The condition that is associated with this binding. If the 297 // condition evaluates to `true`, then this binding applies to the 298 // current request. If the condition evaluates to `false`, then this 299 // binding does not apply to the current request. However, a different 300 // role binding might grant the same role to one or more of the members 301 // in this binding. To learn which resources support conditions in their 302 // IAM policies, see the IAM documentation 303 // (https://cloud.google.com/iam/help/conditions/resource-policies). 304 Condition *Expr `json:"condition,omitempty"` 305 306 // Members: Specifies the identities requesting access for a Cloud 307 // Platform resource. `members` can have the following values: * 308 // `allUsers`: A special identifier that represents anyone who is on the 309 // internet; with or without a Google account. * 310 // `allAuthenticatedUsers`: A special identifier that represents anyone 311 // who is authenticated with a Google account or a service account. * 312 // `user:{emailid}`: An email address that represents a specific Google 313 // account. For example, `alice@example.com` . * 314 // `serviceAccount:{emailid}`: An email address that represents a 315 // service account. For example, 316 // `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An 317 // email address that represents a Google group. For example, 318 // `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An 319 // email address (plus unique identifier) representing a user that has 320 // been recently deleted. For example, 321 // `alice@example.com?uid=123456789012345678901`. If the user is 322 // recovered, this value reverts to `user:{emailid}` and the recovered 323 // user retains the role in the binding. * 324 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address 325 // (plus unique identifier) representing a service account that has been 326 // recently deleted. For example, 327 // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 328 // If the service account is undeleted, this value reverts to 329 // `serviceAccount:{emailid}` and the undeleted service account retains 330 // the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: 331 // An email address (plus unique identifier) representing a Google group 332 // that has been recently deleted. For example, 333 // `admins@example.com?uid=123456789012345678901`. If the group is 334 // recovered, this value reverts to `group:{emailid}` and the recovered 335 // group retains the role in the binding. * `domain:{domain}`: The G 336 // Suite domain (primary) that represents all the users of that domain. 337 // For example, `google.com` or `example.com`. 338 Members []string `json:"members,omitempty"` 339 340 // Role: Role that is assigned to `members`. For example, 341 // `roles/viewer`, `roles/editor`, or `roles/owner`. 342 Role string `json:"role,omitempty"` 343 344 // ForceSendFields is a list of field names (e.g. "Condition") to 345 // unconditionally include in API requests. By default, fields with 346 // empty or default values are omitted from API requests. However, any 347 // non-pointer, non-interface field appearing in ForceSendFields will be 348 // sent to the server regardless of whether the field is empty or not. 349 // This may be used to include empty fields in Patch requests. 350 ForceSendFields []string `json:"-"` 351 352 // NullFields is a list of field names (e.g. "Condition") to include in 353 // API requests with the JSON null value. By default, fields with empty 354 // values are omitted from API requests. However, any field with an 355 // empty value appearing in NullFields will be sent to the server as 356 // null. It is an error if a field in this list has a non-empty value. 357 // This may be used to include null fields in Patch requests. 358 NullFields []string `json:"-"` 359} 360 361func (s *Binding) MarshalJSON() ([]byte, error) { 362 type NoMethod Binding 363 raw := NoMethod(*s) 364 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 365} 366 367// CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation: 368// Metadata describing a long running folder operation 369type CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation struct { 370 // DestinationParent: The resource name of the folder or organization we 371 // are either creating the folder under or moving the folder to. 372 DestinationParent string `json:"destinationParent,omitempty"` 373 374 // DisplayName: The display name of the folder. 375 DisplayName string `json:"displayName,omitempty"` 376 377 // OperationType: The type of this operation. 378 // 379 // Possible values: 380 // "OPERATION_TYPE_UNSPECIFIED" - Operation type not specified. 381 // "CREATE" - A create folder operation. 382 // "MOVE" - A move folder operation. 383 OperationType string `json:"operationType,omitempty"` 384 385 // SourceParent: The resource name of the folder's parent. Only 386 // applicable when the operation_type is MOVE. 387 SourceParent string `json:"sourceParent,omitempty"` 388 389 // ForceSendFields is a list of field names (e.g. "DestinationParent") 390 // to unconditionally include in API requests. By default, fields with 391 // empty or default values are omitted from API requests. However, any 392 // non-pointer, non-interface field appearing in ForceSendFields will be 393 // sent to the server regardless of whether the field is empty or not. 394 // This may be used to include empty fields in Patch requests. 395 ForceSendFields []string `json:"-"` 396 397 // NullFields is a list of field names (e.g. "DestinationParent") to 398 // include in API requests with the JSON null value. By default, fields 399 // with empty values are omitted from API requests. However, any field 400 // with an empty value appearing in NullFields will be sent to the 401 // server as null. It is an error if a field in this list has a 402 // non-empty value. This may be used to include null fields in Patch 403 // requests. 404 NullFields []string `json:"-"` 405} 406 407func (s *CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation) MarshalJSON() ([]byte, error) { 408 type NoMethod CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation 409 raw := NoMethod(*s) 410 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 411} 412 413// CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation: 414// Metadata describing a long running folder operation 415type CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation struct { 416 // DestinationParent: The resource name of the folder or organization we 417 // are either creating the folder under or moving the folder to. 418 DestinationParent string `json:"destinationParent,omitempty"` 419 420 // DisplayName: The display name of the folder. 421 DisplayName string `json:"displayName,omitempty"` 422 423 // OperationType: The type of this operation. 424 // 425 // Possible values: 426 // "OPERATION_TYPE_UNSPECIFIED" - Operation type not specified. 427 // "CREATE" - A create folder operation. 428 // "MOVE" - A move folder operation. 429 OperationType string `json:"operationType,omitempty"` 430 431 // SourceParent: The resource name of the folder's parent. Only 432 // applicable when the operation_type is MOVE. 433 SourceParent string `json:"sourceParent,omitempty"` 434 435 // ForceSendFields is a list of field names (e.g. "DestinationParent") 436 // to unconditionally include in API requests. By default, fields with 437 // empty or default values are omitted from API requests. However, any 438 // non-pointer, non-interface field appearing in ForceSendFields will be 439 // sent to the server regardless of whether the field is empty or not. 440 // This may be used to include empty fields in Patch requests. 441 ForceSendFields []string `json:"-"` 442 443 // NullFields is a list of field names (e.g. "DestinationParent") to 444 // include in API requests with the JSON null value. By default, fields 445 // with empty values are omitted from API requests. However, any field 446 // with an empty value appearing in NullFields will be sent to the 447 // server as null. It is an error if a field in this list has a 448 // non-empty value. This may be used to include null fields in Patch 449 // requests. 450 NullFields []string `json:"-"` 451} 452 453func (s *CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation) MarshalJSON() ([]byte, error) { 454 type NoMethod CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation 455 raw := NoMethod(*s) 456 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 457} 458 459// CreateFolderMetadata: Metadata pertaining to the Folder creation 460// process. 461type CreateFolderMetadata struct { 462 // DisplayName: The display name of the folder. 463 DisplayName string `json:"displayName,omitempty"` 464 465 // Parent: The resource name of the folder or organization we are 466 // creating the folder under. 467 Parent string `json:"parent,omitempty"` 468 469 // ForceSendFields is a list of field names (e.g. "DisplayName") to 470 // unconditionally include in API requests. By default, fields with 471 // empty or default values are omitted from API requests. However, any 472 // non-pointer, non-interface field appearing in ForceSendFields will be 473 // sent to the server regardless of whether the field is empty or not. 474 // This may be used to include empty fields in Patch requests. 475 ForceSendFields []string `json:"-"` 476 477 // NullFields is a list of field names (e.g. "DisplayName") to include 478 // in API requests with the JSON null value. By default, fields with 479 // empty values are omitted from API requests. However, any field with 480 // an empty value appearing in NullFields will be sent to the server as 481 // null. It is an error if a field in this list has a non-empty value. 482 // This may be used to include null fields in Patch requests. 483 NullFields []string `json:"-"` 484} 485 486func (s *CreateFolderMetadata) MarshalJSON() ([]byte, error) { 487 type NoMethod CreateFolderMetadata 488 raw := NoMethod(*s) 489 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 490} 491 492// CreateProjectMetadata: A status object which is used as the 493// `metadata` field for the Operation returned by CreateProject. It 494// provides insight for when significant phases of Project creation have 495// completed. 496type CreateProjectMetadata struct { 497 // CreateTime: Creation time of the project creation workflow. 498 CreateTime string `json:"createTime,omitempty"` 499 500 // Gettable: True if the project can be retrieved using `GetProject`. No 501 // other operations on the project are guaranteed to work until the 502 // project creation is complete. 503 Gettable bool `json:"gettable,omitempty"` 504 505 // Ready: True if the project creation process is complete. 506 Ready bool `json:"ready,omitempty"` 507 508 // ForceSendFields is a list of field names (e.g. "CreateTime") to 509 // unconditionally include in API requests. By default, fields with 510 // empty or default values are omitted from API requests. However, any 511 // non-pointer, non-interface field appearing in ForceSendFields will be 512 // sent to the server regardless of whether the field is empty or not. 513 // This may be used to include empty fields in Patch requests. 514 ForceSendFields []string `json:"-"` 515 516 // NullFields is a list of field names (e.g. "CreateTime") to include in 517 // API requests with the JSON null value. By default, fields with empty 518 // values are omitted from API requests. However, any field with an 519 // empty value appearing in NullFields will be sent to the server as 520 // null. It is an error if a field in this list has a non-empty value. 521 // This may be used to include null fields in Patch requests. 522 NullFields []string `json:"-"` 523} 524 525func (s *CreateProjectMetadata) MarshalJSON() ([]byte, error) { 526 type NoMethod CreateProjectMetadata 527 raw := NoMethod(*s) 528 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 529} 530 531// CreateTagBindingMetadata: Runtime operation information for creating 532// a TagValue. 533type CreateTagBindingMetadata struct { 534} 535 536// CreateTagKeyMetadata: Runtime operation information for creating a 537// TagKey. 538type CreateTagKeyMetadata struct { 539} 540 541// CreateTagValueMetadata: Runtime operation information for creating a 542// TagValue. 543type CreateTagValueMetadata struct { 544} 545 546// DeleteFolderMetadata: A status object which is used as the `metadata` 547// field for the `Operation` returned by `DeleteFolder`. 548type DeleteFolderMetadata struct { 549} 550 551// DeleteOrganizationMetadata: A status object which is used as the 552// `metadata` field for the operation returned by DeleteOrganization. 553type DeleteOrganizationMetadata struct { 554} 555 556// DeleteProjectMetadata: A status object which is used as the 557// `metadata` field for the Operation returned by `DeleteProject`. 558type DeleteProjectMetadata struct { 559} 560 561// DeleteTagBindingMetadata: Runtime operation information for deleting 562// a TagBinding. 563type DeleteTagBindingMetadata struct { 564} 565 566// DeleteTagKeyMetadata: Runtime operation information for deleting a 567// TagKey. 568type DeleteTagKeyMetadata struct { 569} 570 571// DeleteTagValueMetadata: Runtime operation information for deleting a 572// TagValue. 573type DeleteTagValueMetadata struct { 574} 575 576// Empty: A generic empty message that you can re-use to avoid defining 577// duplicated empty messages in your APIs. A typical example is to use 578// it as the request or the response type of an API method. For 579// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 580// (google.protobuf.Empty); } The JSON representation for `Empty` is 581// empty JSON object `{}`. 582type Empty struct { 583 // ServerResponse contains the HTTP response code and headers from the 584 // server. 585 googleapi.ServerResponse `json:"-"` 586} 587 588// Expr: Represents a textual expression in the Common Expression 589// Language (CEL) syntax. CEL is a C-like expression language. The 590// syntax and semantics of CEL are documented at 591// https://github.com/google/cel-spec. Example (Comparison): title: 592// "Summary size limit" description: "Determines if a summary is less 593// than 100 chars" expression: "document.summary.size() < 100" Example 594// (Equality): title: "Requestor is owner" description: "Determines if 595// requestor is the document owner" expression: "document.owner == 596// request.auth.claims.email" Example (Logic): title: "Public documents" 597// description: "Determine whether the document should be publicly 598// visible" expression: "document.type != 'private' && document.type != 599// 'internal'" Example (Data Manipulation): title: "Notification string" 600// description: "Create a notification string with a timestamp." 601// expression: "'New message received at ' + 602// string(document.create_time)" The exact variables and functions that 603// may be referenced within an expression are determined by the service 604// that evaluates it. See the service documentation for additional 605// information. 606type Expr struct { 607 // Description: Optional. Description of the expression. This is a 608 // longer text which describes the expression, e.g. when hovered over it 609 // in a UI. 610 Description string `json:"description,omitempty"` 611 612 // Expression: Textual representation of an expression in Common 613 // Expression Language syntax. 614 Expression string `json:"expression,omitempty"` 615 616 // Location: Optional. String indicating the location of the expression 617 // for error reporting, e.g. a file name and a position in the file. 618 Location string `json:"location,omitempty"` 619 620 // Title: Optional. Title for the expression, i.e. a short string 621 // describing its purpose. This can be used e.g. in UIs which allow to 622 // enter the expression. 623 Title string `json:"title,omitempty"` 624 625 // ForceSendFields is a list of field names (e.g. "Description") to 626 // unconditionally include in API requests. By default, fields with 627 // empty or default values are omitted from API requests. However, any 628 // non-pointer, non-interface field appearing in ForceSendFields will be 629 // sent to the server regardless of whether the field is empty or not. 630 // This may be used to include empty fields in Patch requests. 631 ForceSendFields []string `json:"-"` 632 633 // NullFields is a list of field names (e.g. "Description") to include 634 // in API requests with the JSON null value. By default, fields with 635 // empty values are omitted from API requests. However, any field with 636 // an empty value appearing in NullFields will be sent to the server as 637 // null. It is an error if a field in this list has a non-empty value. 638 // This may be used to include null fields in Patch requests. 639 NullFields []string `json:"-"` 640} 641 642func (s *Expr) MarshalJSON() ([]byte, error) { 643 type NoMethod Expr 644 raw := NoMethod(*s) 645 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 646} 647 648// FolderOperation: Metadata describing a long running folder operation 649type FolderOperation struct { 650 // DestinationParent: The resource name of the folder or organization we 651 // are either creating the folder under or moving the folder to. 652 DestinationParent string `json:"destinationParent,omitempty"` 653 654 // DisplayName: The display name of the folder. 655 DisplayName string `json:"displayName,omitempty"` 656 657 // OperationType: The type of this operation. 658 // 659 // Possible values: 660 // "OPERATION_TYPE_UNSPECIFIED" - Operation type not specified. 661 // "CREATE" - A create folder operation. 662 // "MOVE" - A move folder operation. 663 OperationType string `json:"operationType,omitempty"` 664 665 // SourceParent: The resource name of the folder's parent. Only 666 // applicable when the operation_type is MOVE. 667 SourceParent string `json:"sourceParent,omitempty"` 668 669 // ForceSendFields is a list of field names (e.g. "DestinationParent") 670 // to unconditionally include in API requests. By default, fields with 671 // empty or default values are omitted from API requests. However, any 672 // non-pointer, non-interface field appearing in ForceSendFields will be 673 // sent to the server regardless of whether the field is empty or not. 674 // This may be used to include empty fields in Patch requests. 675 ForceSendFields []string `json:"-"` 676 677 // NullFields is a list of field names (e.g. "DestinationParent") to 678 // include in API requests with the JSON null value. By default, fields 679 // with empty values are omitted from API requests. However, any field 680 // with an empty value appearing in NullFields will be sent to the 681 // server as null. It is an error if a field in this list has a 682 // non-empty value. This may be used to include null fields in Patch 683 // requests. 684 NullFields []string `json:"-"` 685} 686 687func (s *FolderOperation) MarshalJSON() ([]byte, error) { 688 type NoMethod FolderOperation 689 raw := NoMethod(*s) 690 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 691} 692 693// FolderOperationError: A classification of the Folder Operation error. 694type FolderOperationError struct { 695 // ErrorMessageId: The type of operation error experienced. 696 // 697 // Possible values: 698 // "ERROR_TYPE_UNSPECIFIED" - The error type was unrecognized or 699 // unspecified. 700 // "ACTIVE_FOLDER_HEIGHT_VIOLATION" - The attempted action would 701 // violate the max folder depth constraint. 702 // "MAX_CHILD_FOLDERS_VIOLATION" - The attempted action would violate 703 // the max child folders constraint. 704 // "FOLDER_NAME_UNIQUENESS_VIOLATION" - The attempted action would 705 // violate the locally-unique folder display_name constraint. 706 // "RESOURCE_DELETED_VIOLATION" - The resource being moved has been 707 // deleted. 708 // "PARENT_DELETED_VIOLATION" - The resource a folder was being added 709 // to has been deleted. 710 // "CYCLE_INTRODUCED_VIOLATION" - The attempted action would introduce 711 // cycle in resource path. 712 // "FOLDER_BEING_MOVED_VIOLATION" - The attempted action would move a 713 // folder that is already being moved. 714 // "FOLDER_TO_DELETE_NON_EMPTY_VIOLATION" - The folder the caller is 715 // trying to delete contains active resources. 716 // "DELETED_FOLDER_HEIGHT_VIOLATION" - The attempted action would 717 // violate the max deleted folder depth constraint. 718 ErrorMessageId string `json:"errorMessageId,omitempty"` 719 720 // ForceSendFields is a list of field names (e.g. "ErrorMessageId") to 721 // unconditionally include in API requests. By default, fields with 722 // empty or default values are omitted from API requests. However, any 723 // non-pointer, non-interface field appearing in ForceSendFields will be 724 // sent to the server regardless of whether the field is empty or not. 725 // This may be used to include empty fields in Patch requests. 726 ForceSendFields []string `json:"-"` 727 728 // NullFields is a list of field names (e.g. "ErrorMessageId") to 729 // include in API requests with the JSON null value. By default, fields 730 // with empty values are omitted from API requests. However, any field 731 // with an empty value appearing in NullFields will be sent to the 732 // server as null. It is an error if a field in this list has a 733 // non-empty value. This may be used to include null fields in Patch 734 // requests. 735 NullFields []string `json:"-"` 736} 737 738func (s *FolderOperationError) MarshalJSON() ([]byte, error) { 739 type NoMethod FolderOperationError 740 raw := NoMethod(*s) 741 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 742} 743 744// GetAncestryRequest: The request sent to the 745// [google.cloudresourcemanager.projects.v1beta1.DeveloperProjects.GetAnc 746// estry] method. 747type GetAncestryRequest struct { 748} 749 750// GetAncestryResponse: Response from the projects.getAncestry method. 751type GetAncestryResponse struct { 752 // Ancestor: Ancestors are ordered from bottom to top of the resource 753 // hierarchy. The first ancestor is the project itself, followed by the 754 // project's parent, etc. 755 Ancestor []*Ancestor `json:"ancestor,omitempty"` 756 757 // ServerResponse contains the HTTP response code and headers from the 758 // server. 759 googleapi.ServerResponse `json:"-"` 760 761 // ForceSendFields is a list of field names (e.g. "Ancestor") to 762 // unconditionally include in API requests. By default, fields with 763 // empty or default values are omitted from API requests. However, any 764 // non-pointer, non-interface field appearing in ForceSendFields will be 765 // sent to the server regardless of whether the field is empty or not. 766 // This may be used to include empty fields in Patch requests. 767 ForceSendFields []string `json:"-"` 768 769 // NullFields is a list of field names (e.g. "Ancestor") to include in 770 // API requests with the JSON null value. By default, fields with empty 771 // values are omitted from API requests. However, any field with an 772 // empty value appearing in NullFields will be sent to the server as 773 // null. It is an error if a field in this list has a non-empty value. 774 // This may be used to include null fields in Patch requests. 775 NullFields []string `json:"-"` 776} 777 778func (s *GetAncestryResponse) MarshalJSON() ([]byte, error) { 779 type NoMethod GetAncestryResponse 780 raw := NoMethod(*s) 781 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 782} 783 784// GetIamPolicyRequest: Request message for `GetIamPolicy` method. 785type GetIamPolicyRequest struct { 786 // Options: OPTIONAL: A `GetPolicyOptions` object for specifying options 787 // to `GetIamPolicy`. 788 Options *GetPolicyOptions `json:"options,omitempty"` 789 790 // ForceSendFields is a list of field names (e.g. "Options") to 791 // unconditionally include in API requests. By default, fields with 792 // empty or default values are omitted from API requests. However, any 793 // non-pointer, non-interface field appearing in ForceSendFields will be 794 // sent to the server regardless of whether the field is empty or not. 795 // This may be used to include empty fields in Patch requests. 796 ForceSendFields []string `json:"-"` 797 798 // NullFields is a list of field names (e.g. "Options") to include in 799 // API requests with the JSON null value. By default, fields with empty 800 // values are omitted from API requests. However, any field with an 801 // empty value appearing in NullFields will be sent to the server as 802 // null. It is an error if a field in this list has a non-empty value. 803 // This may be used to include null fields in Patch requests. 804 NullFields []string `json:"-"` 805} 806 807func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) { 808 type NoMethod GetIamPolicyRequest 809 raw := NoMethod(*s) 810 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 811} 812 813// GetPolicyOptions: Encapsulates settings provided to GetIamPolicy. 814type GetPolicyOptions struct { 815 // RequestedPolicyVersion: Optional. The policy format version to be 816 // returned. Valid values are 0, 1, and 3. Requests specifying an 817 // invalid value will be rejected. Requests for policies with any 818 // conditional bindings must specify version 3. Policies without any 819 // conditional bindings may specify any valid value or leave the field 820 // unset. To learn which resources support conditions in their IAM 821 // policies, see the IAM documentation 822 // (https://cloud.google.com/iam/help/conditions/resource-policies). 823 RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"` 824 825 // ForceSendFields is a list of field names (e.g. 826 // "RequestedPolicyVersion") to unconditionally include in API requests. 827 // By default, fields with empty or default values are omitted from API 828 // requests. However, any non-pointer, non-interface field appearing in 829 // ForceSendFields will be sent to the server regardless of whether the 830 // field is empty or not. This may be used to include empty fields in 831 // Patch requests. 832 ForceSendFields []string `json:"-"` 833 834 // NullFields is a list of field names (e.g. "RequestedPolicyVersion") 835 // to include in API requests with the JSON null value. By default, 836 // fields with empty values are omitted from API requests. However, any 837 // field with an empty value appearing in NullFields will be sent to the 838 // server as null. It is an error if a field in this list has a 839 // non-empty value. This may be used to include null fields in Patch 840 // requests. 841 NullFields []string `json:"-"` 842} 843 844func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) { 845 type NoMethod GetPolicyOptions 846 raw := NoMethod(*s) 847 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 848} 849 850// ListOrganizationsResponse: The response returned from the 851// `ListOrganizations` method. 852type ListOrganizationsResponse struct { 853 // NextPageToken: A pagination token to be used to retrieve the next 854 // page of results. If the result is too large to fit within the page 855 // size specified in the request, this field will be set with a token 856 // that can be used to fetch the next page of results. If this field is 857 // empty, it indicates that this response contains the last page of 858 // results. 859 NextPageToken string `json:"nextPageToken,omitempty"` 860 861 // Organizations: The list of Organizations that matched the list query, 862 // possibly paginated. 863 Organizations []*Organization `json:"organizations,omitempty"` 864 865 // ServerResponse contains the HTTP response code and headers from the 866 // server. 867 googleapi.ServerResponse `json:"-"` 868 869 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 870 // unconditionally include in API requests. By default, fields with 871 // empty or default values are omitted from API requests. However, any 872 // non-pointer, non-interface field appearing in ForceSendFields will be 873 // sent to the server regardless of whether the field is empty or not. 874 // This may be used to include empty fields in Patch requests. 875 ForceSendFields []string `json:"-"` 876 877 // NullFields is a list of field names (e.g. "NextPageToken") to include 878 // in API requests with the JSON null value. By default, fields with 879 // empty values are omitted from API requests. However, any field with 880 // an empty value appearing in NullFields will be sent to the server as 881 // null. It is an error if a field in this list has a non-empty value. 882 // This may be used to include null fields in Patch requests. 883 NullFields []string `json:"-"` 884} 885 886func (s *ListOrganizationsResponse) MarshalJSON() ([]byte, error) { 887 type NoMethod ListOrganizationsResponse 888 raw := NoMethod(*s) 889 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 890} 891 892// ListProjectsResponse: A page of the response received from the 893// ListProjects method. A paginated response where more pages are 894// available has `next_page_token` set. This token can be used in a 895// subsequent request to retrieve the next request page. 896type ListProjectsResponse struct { 897 // NextPageToken: Pagination token. If the result set is too large to 898 // fit in a single response, this token is returned. It encodes the 899 // position of the current result cursor. Feeding this value into a new 900 // list request with the `page_token` parameter gives the next page of 901 // the results. When `next_page_token` is not filled in, there is no 902 // next page and the list returned is the last page in the result set. 903 // Pagination tokens have a limited lifetime. 904 NextPageToken string `json:"nextPageToken,omitempty"` 905 906 // Projects: The list of Projects that matched the list filter. This 907 // list can be paginated. 908 Projects []*Project `json:"projects,omitempty"` 909 910 // ServerResponse contains the HTTP response code and headers from the 911 // server. 912 googleapi.ServerResponse `json:"-"` 913 914 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 915 // unconditionally include in API requests. By default, fields with 916 // empty or default values are omitted from API requests. However, any 917 // non-pointer, non-interface field appearing in ForceSendFields will be 918 // sent to the server regardless of whether the field is empty or not. 919 // This may be used to include empty fields in Patch requests. 920 ForceSendFields []string `json:"-"` 921 922 // NullFields is a list of field names (e.g. "NextPageToken") to include 923 // in API requests with the JSON null value. By default, fields with 924 // empty values are omitted from API requests. However, any field with 925 // an empty value appearing in NullFields will be sent to the server as 926 // null. It is an error if a field in this list has a non-empty value. 927 // This may be used to include null fields in Patch requests. 928 NullFields []string `json:"-"` 929} 930 931func (s *ListProjectsResponse) MarshalJSON() ([]byte, error) { 932 type NoMethod ListProjectsResponse 933 raw := NoMethod(*s) 934 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 935} 936 937// MoveFolderMetadata: Metadata pertaining to the folder move process. 938type MoveFolderMetadata struct { 939 // DestinationParent: The resource name of the folder or organization to 940 // move the folder to. 941 DestinationParent string `json:"destinationParent,omitempty"` 942 943 // DisplayName: The display name of the folder. 944 DisplayName string `json:"displayName,omitempty"` 945 946 // SourceParent: The resource name of the folder's parent. 947 SourceParent string `json:"sourceParent,omitempty"` 948 949 // ForceSendFields is a list of field names (e.g. "DestinationParent") 950 // to unconditionally include in API requests. By default, fields with 951 // empty or default values are omitted from API requests. However, any 952 // non-pointer, non-interface field appearing in ForceSendFields will be 953 // sent to the server regardless of whether the field is empty or not. 954 // This may be used to include empty fields in Patch requests. 955 ForceSendFields []string `json:"-"` 956 957 // NullFields is a list of field names (e.g. "DestinationParent") to 958 // include in API requests with the JSON null value. By default, fields 959 // with empty values are omitted from API requests. However, any field 960 // with an empty value appearing in NullFields will be sent to the 961 // server as null. It is an error if a field in this list has a 962 // non-empty value. This may be used to include null fields in Patch 963 // requests. 964 NullFields []string `json:"-"` 965} 966 967func (s *MoveFolderMetadata) MarshalJSON() ([]byte, error) { 968 type NoMethod MoveFolderMetadata 969 raw := NoMethod(*s) 970 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 971} 972 973// MoveProjectMetadata: A status object which is used as the `metadata` 974// field for the Operation returned by MoveProject. 975type MoveProjectMetadata struct { 976} 977 978// Organization: The root node in the resource hierarchy to which a 979// particular entity's (e.g., company) resources belong. 980type Organization struct { 981 // CreationTime: Timestamp when the Organization was created. Assigned 982 // by the server. 983 CreationTime string `json:"creationTime,omitempty"` 984 985 // DisplayName: A human-readable string that refers to the Organization 986 // in the GCP Console UI. This string is set by the server and cannot be 987 // changed. The string will be set to the primary domain (for example, 988 // "google.com") of the G Suite customer that owns the organization. 989 DisplayName string `json:"displayName,omitempty"` 990 991 // LifecycleState: The organization's current lifecycle state. Assigned 992 // by the server. 993 // 994 // Possible values: 995 // "LIFECYCLE_STATE_UNSPECIFIED" - Unspecified state. This is only 996 // useful for distinguishing unset values. 997 // "ACTIVE" - The normal and active state. 998 // "DELETE_REQUESTED" - The organization has been marked for deletion 999 // by the user. 1000 LifecycleState string `json:"lifecycleState,omitempty"` 1001 1002 // Name: Output only. The resource name of the organization. This is the 1003 // organization's relative path in the API. Its format is 1004 // "organizations/[organization_id]". For example, "organizations/1234". 1005 Name string `json:"name,omitempty"` 1006 1007 // OrganizationId: An immutable id for the Organization that is assigned 1008 // on creation. This should be omitted when creating a new Organization. 1009 // This field is read-only. 1010 OrganizationId string `json:"organizationId,omitempty"` 1011 1012 // Owner: The owner of this Organization. The owner should be specified 1013 // on creation. Once set, it cannot be changed. This field is required. 1014 Owner *OrganizationOwner `json:"owner,omitempty"` 1015 1016 // ServerResponse contains the HTTP response code and headers from the 1017 // server. 1018 googleapi.ServerResponse `json:"-"` 1019 1020 // ForceSendFields is a list of field names (e.g. "CreationTime") to 1021 // unconditionally include in API requests. By default, fields with 1022 // empty or default values are omitted from API requests. However, any 1023 // non-pointer, non-interface field appearing in ForceSendFields will be 1024 // sent to the server regardless of whether the field is empty or not. 1025 // This may be used to include empty fields in Patch requests. 1026 ForceSendFields []string `json:"-"` 1027 1028 // NullFields is a list of field names (e.g. "CreationTime") to include 1029 // in API requests with the JSON null value. By default, fields with 1030 // empty values are omitted from API requests. However, any field with 1031 // an empty value appearing in NullFields will be sent to the server as 1032 // null. It is an error if a field in this list has a non-empty value. 1033 // This may be used to include null fields in Patch requests. 1034 NullFields []string `json:"-"` 1035} 1036 1037func (s *Organization) MarshalJSON() ([]byte, error) { 1038 type NoMethod Organization 1039 raw := NoMethod(*s) 1040 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1041} 1042 1043// OrganizationOwner: The entity that owns an Organization. The lifetime 1044// of the Organization and all of its descendants are bound to the 1045// `OrganizationOwner`. If the `OrganizationOwner` is deleted, the 1046// Organization and all its descendants will be deleted. 1047type OrganizationOwner struct { 1048 // DirectoryCustomerId: The G Suite customer id used in the Directory 1049 // API. 1050 DirectoryCustomerId string `json:"directoryCustomerId,omitempty"` 1051 1052 // ForceSendFields is a list of field names (e.g. "DirectoryCustomerId") 1053 // to unconditionally include in API requests. By default, fields with 1054 // empty or default values are omitted from API requests. However, any 1055 // non-pointer, non-interface field appearing in ForceSendFields will be 1056 // sent to the server regardless of whether the field is empty or not. 1057 // This may be used to include empty fields in Patch requests. 1058 ForceSendFields []string `json:"-"` 1059 1060 // NullFields is a list of field names (e.g. "DirectoryCustomerId") to 1061 // include in API requests with the JSON null value. By default, fields 1062 // with empty values are omitted from API requests. However, any field 1063 // with an empty value appearing in NullFields will be sent to the 1064 // server as null. It is an error if a field in this list has a 1065 // non-empty value. This may be used to include null fields in Patch 1066 // requests. 1067 NullFields []string `json:"-"` 1068} 1069 1070func (s *OrganizationOwner) MarshalJSON() ([]byte, error) { 1071 type NoMethod OrganizationOwner 1072 raw := NoMethod(*s) 1073 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1074} 1075 1076// Policy: An Identity and Access Management (IAM) policy, which 1077// specifies access controls for Google Cloud resources. A `Policy` is a 1078// collection of `bindings`. A `binding` binds one or more `members` to 1079// a single `role`. Members can be user accounts, service accounts, 1080// Google groups, and domains (such as G Suite). A `role` is a named 1081// list of permissions; each `role` can be an IAM predefined role or a 1082// user-created custom role. For some types of Google Cloud resources, a 1083// `binding` can also specify a `condition`, which is a logical 1084// expression that allows access to a resource only if the expression 1085// evaluates to `true`. A condition can add constraints based on 1086// attributes of the request, the resource, or both. To learn which 1087// resources support conditions in their IAM policies, see the IAM 1088// documentation 1089// (https://cloud.google.com/iam/help/conditions/resource-policies). 1090// **JSON example:** { "bindings": [ { "role": 1091// "roles/resourcemanager.organizationAdmin", "members": [ 1092// "user:mike@example.com", "group:admins@example.com", 1093// "domain:google.com", 1094// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { 1095// "role": "roles/resourcemanager.organizationViewer", "members": [ 1096// "user:eve@example.com" ], "condition": { "title": "expirable access", 1097// "description": "Does not grant access after Sep 2020", "expression": 1098// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], 1099// "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - 1100// members: - user:mike@example.com - group:admins@example.com - 1101// domain:google.com - 1102// serviceAccount:my-project-id@appspot.gserviceaccount.com role: 1103// roles/resourcemanager.organizationAdmin - members: - 1104// user:eve@example.com role: roles/resourcemanager.organizationViewer 1105// condition: title: expirable access description: Does not grant access 1106// after Sep 2020 expression: request.time < 1107// timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 1108// For a description of IAM and its features, see the IAM documentation 1109// (https://cloud.google.com/iam/docs/). 1110type Policy struct { 1111 // AuditConfigs: Specifies cloud audit logging configuration for this 1112 // policy. 1113 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"` 1114 1115 // Bindings: Associates a list of `members` to a `role`. Optionally, may 1116 // specify a `condition` that determines how and when the `bindings` are 1117 // applied. Each of the `bindings` must contain at least one member. 1118 Bindings []*Binding `json:"bindings,omitempty"` 1119 1120 // Etag: `etag` is used for optimistic concurrency control as a way to 1121 // help prevent simultaneous updates of a policy from overwriting each 1122 // other. It is strongly suggested that systems make use of the `etag` 1123 // in the read-modify-write cycle to perform policy updates in order to 1124 // avoid race conditions: An `etag` is returned in the response to 1125 // `getIamPolicy`, and systems are expected to put that etag in the 1126 // request to `setIamPolicy` to ensure that their change will be applied 1127 // to the same version of the policy. **Important:** If you use IAM 1128 // Conditions, you must include the `etag` field whenever you call 1129 // `setIamPolicy`. If you omit this field, then IAM allows you to 1130 // overwrite a version `3` policy with a version `1` policy, and all of 1131 // the conditions in the version `3` policy are lost. 1132 Etag string `json:"etag,omitempty"` 1133 1134 // Version: Specifies the format of the policy. Valid values are `0`, 1135 // `1`, and `3`. Requests that specify an invalid value are rejected. 1136 // Any operation that affects conditional role bindings must specify 1137 // version `3`. This requirement applies to the following operations: * 1138 // Getting a policy that includes a conditional role binding * Adding a 1139 // conditional role binding to a policy * Changing a conditional role 1140 // binding in a policy * Removing any role binding, with or without a 1141 // condition, from a policy that includes conditions **Important:** If 1142 // you use IAM Conditions, you must include the `etag` field whenever 1143 // you call `setIamPolicy`. If you omit this field, then IAM allows you 1144 // to overwrite a version `3` policy with a version `1` policy, and all 1145 // of the conditions in the version `3` policy are lost. If a policy 1146 // does not include any conditions, operations on that policy may 1147 // specify any valid version or leave the field unset. To learn which 1148 // resources support conditions in their IAM policies, see the IAM 1149 // documentation 1150 // (https://cloud.google.com/iam/help/conditions/resource-policies). 1151 Version int64 `json:"version,omitempty"` 1152 1153 // ServerResponse contains the HTTP response code and headers from the 1154 // server. 1155 googleapi.ServerResponse `json:"-"` 1156 1157 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to 1158 // unconditionally include in API requests. By default, fields with 1159 // empty or default values are omitted from API requests. However, any 1160 // non-pointer, non-interface field appearing in ForceSendFields will be 1161 // sent to the server regardless of whether the field is empty or not. 1162 // This may be used to include empty fields in Patch requests. 1163 ForceSendFields []string `json:"-"` 1164 1165 // NullFields is a list of field names (e.g. "AuditConfigs") to include 1166 // in API requests with the JSON null value. By default, fields with 1167 // empty values are omitted from API requests. However, any field with 1168 // an empty value appearing in NullFields will be sent to the server as 1169 // null. It is an error if a field in this list has a non-empty value. 1170 // This may be used to include null fields in Patch requests. 1171 NullFields []string `json:"-"` 1172} 1173 1174func (s *Policy) MarshalJSON() ([]byte, error) { 1175 type NoMethod Policy 1176 raw := NoMethod(*s) 1177 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1178} 1179 1180// Project: A Project is a high-level Google Cloud Platform entity. It 1181// is a container for ACLs, APIs, App Engine Apps, VMs, and other Google 1182// Cloud Platform resources. 1183type Project struct { 1184 // CreateTime: Creation time. Read-only. 1185 CreateTime string `json:"createTime,omitempty"` 1186 1187 // Labels: The labels associated with this Project. Label keys must be 1188 // between 1 and 63 characters long and must conform to the following 1189 // regular expression: a-z{0,62}. Label values must be between 0 and 63 1190 // characters long and must conform to the regular expression 1191 // [a-z0-9_-]{0,63}. A label value can be empty. No more than 256 labels 1192 // can be associated with a given resource. Clients should store labels 1193 // in a representation such as JSON that does not depend on specific 1194 // characters being disallowed. Example: "environment" : "dev" 1195 // Read-write. 1196 Labels map[string]string `json:"labels,omitempty"` 1197 1198 // LifecycleState: The Project lifecycle state. Read-only. 1199 // 1200 // Possible values: 1201 // "LIFECYCLE_STATE_UNSPECIFIED" - Unspecified state. This is only 1202 // used/useful for distinguishing unset values. 1203 // "ACTIVE" - The normal and active state. 1204 // "DELETE_REQUESTED" - The project has been marked for deletion by 1205 // the user (by invoking DeleteProject) or by the system (Google Cloud 1206 // Platform). This can generally be reversed by invoking 1207 // UndeleteProject. 1208 // "DELETE_IN_PROGRESS" - This lifecycle state is no longer used and 1209 // is not returned by the API. 1210 LifecycleState string `json:"lifecycleState,omitempty"` 1211 1212 // Name: The optional user-assigned display name of the Project. When 1213 // present it must be between 4 to 30 characters. Allowed characters 1214 // are: lowercase and uppercase letters, numbers, hyphen, single-quote, 1215 // double-quote, space, and exclamation point. Example: `My Project` 1216 // Read-write. 1217 Name string `json:"name,omitempty"` 1218 1219 // Parent: An optional reference to a parent Resource. Supported parent 1220 // types include "organization" and "folder". Once set, the parent 1221 // cannot be cleared. The `parent` can be set on creation or using the 1222 // `UpdateProject` method; the end user must have the 1223 // `resourcemanager.projects.create` permission on the parent. 1224 // Read-write. 1225 Parent *ResourceId `json:"parent,omitempty"` 1226 1227 // ProjectId: The unique, user-assigned ID of the Project. It must be 6 1228 // to 30 lowercase letters, digits, or hyphens. It must start with a 1229 // letter. Trailing hyphens are prohibited. Example: `tokyo-rain-123` 1230 // Read-only after creation. 1231 ProjectId string `json:"projectId,omitempty"` 1232 1233 // ProjectNumber: The number uniquely identifying the project. Example: 1234 // `415104041262` Read-only. 1235 ProjectNumber int64 `json:"projectNumber,omitempty,string"` 1236 1237 // ServerResponse contains the HTTP response code and headers from the 1238 // server. 1239 googleapi.ServerResponse `json:"-"` 1240 1241 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1242 // unconditionally include in API requests. By default, fields with 1243 // empty or default values are omitted from API requests. However, any 1244 // non-pointer, non-interface field appearing in ForceSendFields will be 1245 // sent to the server regardless of whether the field is empty or not. 1246 // This may be used to include empty fields in Patch requests. 1247 ForceSendFields []string `json:"-"` 1248 1249 // NullFields is a list of field names (e.g. "CreateTime") to include in 1250 // API requests with the JSON null value. By default, fields with empty 1251 // values are omitted from API requests. However, any field with an 1252 // empty value appearing in NullFields will be sent to the server as 1253 // null. It is an error if a field in this list has a non-empty value. 1254 // This may be used to include null fields in Patch requests. 1255 NullFields []string `json:"-"` 1256} 1257 1258func (s *Project) MarshalJSON() ([]byte, error) { 1259 type NoMethod Project 1260 raw := NoMethod(*s) 1261 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1262} 1263 1264// ProjectCreationStatus: A status object which is used as the 1265// `metadata` field for the Operation returned by CreateProject. It 1266// provides insight for when significant phases of Project creation have 1267// completed. 1268type ProjectCreationStatus struct { 1269 // CreateTime: Creation time of the project creation workflow. 1270 CreateTime string `json:"createTime,omitempty"` 1271 1272 // Gettable: True if the project can be retrieved using GetProject. No 1273 // other operations on the project are guaranteed to work until the 1274 // project creation is complete. 1275 Gettable bool `json:"gettable,omitempty"` 1276 1277 // Ready: True if the project creation process is complete. 1278 Ready bool `json:"ready,omitempty"` 1279 1280 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1281 // unconditionally include in API requests. By default, fields with 1282 // empty or default values are omitted from API requests. However, any 1283 // non-pointer, non-interface field appearing in ForceSendFields will be 1284 // sent to the server regardless of whether the field is empty or not. 1285 // This may be used to include empty fields in Patch requests. 1286 ForceSendFields []string `json:"-"` 1287 1288 // NullFields is a list of field names (e.g. "CreateTime") to include in 1289 // API requests with the JSON null value. By default, fields with empty 1290 // values are omitted from API requests. However, any field with an 1291 // empty value appearing in NullFields will be sent to the server as 1292 // null. It is an error if a field in this list has a non-empty value. 1293 // This may be used to include null fields in Patch requests. 1294 NullFields []string `json:"-"` 1295} 1296 1297func (s *ProjectCreationStatus) MarshalJSON() ([]byte, error) { 1298 type NoMethod ProjectCreationStatus 1299 raw := NoMethod(*s) 1300 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1301} 1302 1303// ResourceId: A container to reference an id for any resource type. A 1304// `resource` in Google Cloud Platform is a generic term for something 1305// you (a developer) may want to interact with through one of our API's. 1306// Some examples are an App Engine app, a Compute Engine instance, a 1307// Cloud SQL database, and so on. 1308type ResourceId struct { 1309 // Id: Required field for the type-specific id. This should correspond 1310 // to the id used in the type-specific API's. 1311 Id string `json:"id,omitempty"` 1312 1313 // Type: Required field representing the resource type this id is for. 1314 // At present, the valid types are "project", "folder", and 1315 // "organization". 1316 Type string `json:"type,omitempty"` 1317 1318 // ForceSendFields is a list of field names (e.g. "Id") to 1319 // unconditionally include in API requests. By default, fields with 1320 // empty or default values are omitted from API requests. However, any 1321 // non-pointer, non-interface field appearing in ForceSendFields will be 1322 // sent to the server regardless of whether the field is empty or not. 1323 // This may be used to include empty fields in Patch requests. 1324 ForceSendFields []string `json:"-"` 1325 1326 // NullFields is a list of field names (e.g. "Id") to include in API 1327 // requests with the JSON null value. By default, fields with empty 1328 // values are omitted from API requests. However, any field with an 1329 // empty value appearing in NullFields will be sent to the server as 1330 // null. It is an error if a field in this list has a non-empty value. 1331 // This may be used to include null fields in Patch requests. 1332 NullFields []string `json:"-"` 1333} 1334 1335func (s *ResourceId) MarshalJSON() ([]byte, error) { 1336 type NoMethod ResourceId 1337 raw := NoMethod(*s) 1338 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1339} 1340 1341// SetIamPolicyRequest: Request message for `SetIamPolicy` method. 1342type SetIamPolicyRequest struct { 1343 // Policy: REQUIRED: The complete policy to be applied to the 1344 // `resource`. The size of the policy is limited to a few 10s of KB. An 1345 // empty policy is a valid policy but certain Cloud Platform services 1346 // (such as Projects) might reject them. 1347 Policy *Policy `json:"policy,omitempty"` 1348 1349 // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the 1350 // policy to modify. Only the fields in the mask will be modified. If no 1351 // mask is provided, the following default mask is used: `paths: 1352 // "bindings, etag" 1353 UpdateMask string `json:"updateMask,omitempty"` 1354 1355 // ForceSendFields is a list of field names (e.g. "Policy") to 1356 // unconditionally include in API requests. By default, fields with 1357 // empty or default values are omitted from API requests. However, any 1358 // non-pointer, non-interface field appearing in ForceSendFields will be 1359 // sent to the server regardless of whether the field is empty or not. 1360 // This may be used to include empty fields in Patch requests. 1361 ForceSendFields []string `json:"-"` 1362 1363 // NullFields is a list of field names (e.g. "Policy") to include in API 1364 // requests with the JSON null value. By default, fields with empty 1365 // values are omitted from API requests. However, any field with an 1366 // empty value appearing in NullFields will be sent to the server as 1367 // null. It is an error if a field in this list has a non-empty value. 1368 // This may be used to include null fields in Patch requests. 1369 NullFields []string `json:"-"` 1370} 1371 1372func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { 1373 type NoMethod SetIamPolicyRequest 1374 raw := NoMethod(*s) 1375 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1376} 1377 1378// TestIamPermissionsRequest: Request message for `TestIamPermissions` 1379// method. 1380type TestIamPermissionsRequest struct { 1381 // Permissions: The set of permissions to check for the `resource`. 1382 // Permissions with wildcards (such as '*' or 'storage.*') are not 1383 // allowed. For more information see IAM Overview 1384 // (https://cloud.google.com/iam/docs/overview#permissions). 1385 Permissions []string `json:"permissions,omitempty"` 1386 1387 // ForceSendFields is a list of field names (e.g. "Permissions") to 1388 // unconditionally include in API requests. By default, fields with 1389 // empty or default values are omitted from API requests. However, any 1390 // non-pointer, non-interface field appearing in ForceSendFields will be 1391 // sent to the server regardless of whether the field is empty or not. 1392 // This may be used to include empty fields in Patch requests. 1393 ForceSendFields []string `json:"-"` 1394 1395 // NullFields is a list of field names (e.g. "Permissions") to include 1396 // in API requests with the JSON null value. By default, fields with 1397 // empty values are omitted from API requests. However, any field with 1398 // an empty value appearing in NullFields will be sent to the server as 1399 // null. It is an error if a field in this list has a non-empty value. 1400 // This may be used to include null fields in Patch requests. 1401 NullFields []string `json:"-"` 1402} 1403 1404func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { 1405 type NoMethod TestIamPermissionsRequest 1406 raw := NoMethod(*s) 1407 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1408} 1409 1410// TestIamPermissionsResponse: Response message for `TestIamPermissions` 1411// method. 1412type TestIamPermissionsResponse struct { 1413 // Permissions: A subset of `TestPermissionsRequest.permissions` that 1414 // the caller is allowed. 1415 Permissions []string `json:"permissions,omitempty"` 1416 1417 // ServerResponse contains the HTTP response code and headers from the 1418 // server. 1419 googleapi.ServerResponse `json:"-"` 1420 1421 // ForceSendFields is a list of field names (e.g. "Permissions") to 1422 // unconditionally include in API requests. By default, fields with 1423 // empty or default values are omitted from API requests. However, any 1424 // non-pointer, non-interface field appearing in ForceSendFields will be 1425 // sent to the server regardless of whether the field is empty or not. 1426 // This may be used to include empty fields in Patch requests. 1427 ForceSendFields []string `json:"-"` 1428 1429 // NullFields is a list of field names (e.g. "Permissions") to include 1430 // in API requests with the JSON null value. By default, fields with 1431 // empty values are omitted from API requests. However, any field with 1432 // an empty value appearing in NullFields will be sent to the server as 1433 // null. It is an error if a field in this list has a non-empty value. 1434 // This may be used to include null fields in Patch requests. 1435 NullFields []string `json:"-"` 1436} 1437 1438func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 1439 type NoMethod TestIamPermissionsResponse 1440 raw := NoMethod(*s) 1441 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1442} 1443 1444// UndeleteFolderMetadata: A status object which is used as the 1445// `metadata` field for the `Operation` returned by `UndeleteFolder`. 1446type UndeleteFolderMetadata struct { 1447} 1448 1449// UndeleteOrganizationMetadata: A status object which is used as the 1450// `metadata` field for the Operation returned by UndeleteOrganization. 1451type UndeleteOrganizationMetadata struct { 1452} 1453 1454// UndeleteProjectMetadata: A status object which is used as the 1455// `metadata` field for the Operation returned by `UndeleteProject`. 1456type UndeleteProjectMetadata struct { 1457} 1458 1459// UndeleteProjectRequest: The request sent to the UndeleteProject 1460// method. 1461type UndeleteProjectRequest struct { 1462} 1463 1464// UpdateFolderMetadata: A status object which is used as the `metadata` 1465// field for the Operation returned by UpdateFolder. 1466type UpdateFolderMetadata struct { 1467} 1468 1469// UpdateProjectMetadata: A status object which is used as the 1470// `metadata` field for the Operation returned by UpdateProject. 1471type UpdateProjectMetadata struct { 1472} 1473 1474// UpdateTagKeyMetadata: Runtime operation information for updating a 1475// TagKey. 1476type UpdateTagKeyMetadata struct { 1477} 1478 1479// UpdateTagValueMetadata: Runtime operation information for updating a 1480// TagValue. 1481type UpdateTagValueMetadata struct { 1482} 1483 1484// method id "cloudresourcemanager.organizations.get": 1485 1486type OrganizationsGetCall struct { 1487 s *Service 1488 name string 1489 urlParams_ gensupport.URLParams 1490 ifNoneMatch_ string 1491 ctx_ context.Context 1492 header_ http.Header 1493} 1494 1495// Get: Fetches an Organization resource identified by the specified 1496// resource name. 1497// 1498// - name: The resource name of the Organization to fetch. This is the 1499// organization's relative path in the API, formatted as 1500// "organizations/[organizationId]". For example, 1501// "organizations/1234". 1502func (r *OrganizationsService) Get(name string) *OrganizationsGetCall { 1503 c := &OrganizationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1504 c.name = name 1505 return c 1506} 1507 1508// OrganizationId sets the optional parameter "organizationId": The id 1509// of the Organization resource to fetch. This field is deprecated and 1510// will be removed in v1. Use name instead. 1511func (c *OrganizationsGetCall) OrganizationId(organizationId string) *OrganizationsGetCall { 1512 c.urlParams_.Set("organizationId", organizationId) 1513 return c 1514} 1515 1516// Fields allows partial responses to be retrieved. See 1517// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1518// for more information. 1519func (c *OrganizationsGetCall) Fields(s ...googleapi.Field) *OrganizationsGetCall { 1520 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1521 return c 1522} 1523 1524// IfNoneMatch sets the optional parameter which makes the operation 1525// fail if the object's ETag matches the given value. This is useful for 1526// getting updates only after the object has changed since the last 1527// request. Use googleapi.IsNotModified to check whether the response 1528// error from Do is the result of In-None-Match. 1529func (c *OrganizationsGetCall) IfNoneMatch(entityTag string) *OrganizationsGetCall { 1530 c.ifNoneMatch_ = entityTag 1531 return c 1532} 1533 1534// Context sets the context to be used in this call's Do method. Any 1535// pending HTTP request will be aborted if the provided context is 1536// canceled. 1537func (c *OrganizationsGetCall) Context(ctx context.Context) *OrganizationsGetCall { 1538 c.ctx_ = ctx 1539 return c 1540} 1541 1542// Header returns an http.Header that can be modified by the caller to 1543// add HTTP headers to the request. 1544func (c *OrganizationsGetCall) Header() http.Header { 1545 if c.header_ == nil { 1546 c.header_ = make(http.Header) 1547 } 1548 return c.header_ 1549} 1550 1551func (c *OrganizationsGetCall) doRequest(alt string) (*http.Response, error) { 1552 reqHeaders := make(http.Header) 1553 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 1554 for k, v := range c.header_ { 1555 reqHeaders[k] = v 1556 } 1557 reqHeaders.Set("User-Agent", c.s.userAgent()) 1558 if c.ifNoneMatch_ != "" { 1559 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1560 } 1561 var body io.Reader = nil 1562 c.urlParams_.Set("alt", alt) 1563 c.urlParams_.Set("prettyPrint", "false") 1564 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 1565 urls += "?" + c.urlParams_.Encode() 1566 req, err := http.NewRequest("GET", urls, body) 1567 if err != nil { 1568 return nil, err 1569 } 1570 req.Header = reqHeaders 1571 googleapi.Expand(req.URL, map[string]string{ 1572 "name": c.name, 1573 }) 1574 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1575} 1576 1577// Do executes the "cloudresourcemanager.organizations.get" call. 1578// Exactly one of *Organization or error will be non-nil. Any non-2xx 1579// status code is an error. Response headers are in either 1580// *Organization.ServerResponse.Header or (if a response was returned at 1581// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1582// to check whether the returned error was because 1583// http.StatusNotModified was returned. 1584func (c *OrganizationsGetCall) Do(opts ...googleapi.CallOption) (*Organization, error) { 1585 gensupport.SetOptions(c.urlParams_, opts...) 1586 res, err := c.doRequest("json") 1587 if res != nil && res.StatusCode == http.StatusNotModified { 1588 if res.Body != nil { 1589 res.Body.Close() 1590 } 1591 return nil, &googleapi.Error{ 1592 Code: res.StatusCode, 1593 Header: res.Header, 1594 } 1595 } 1596 if err != nil { 1597 return nil, err 1598 } 1599 defer googleapi.CloseBody(res) 1600 if err := googleapi.CheckResponse(res); err != nil { 1601 return nil, err 1602 } 1603 ret := &Organization{ 1604 ServerResponse: googleapi.ServerResponse{ 1605 Header: res.Header, 1606 HTTPStatusCode: res.StatusCode, 1607 }, 1608 } 1609 target := &ret 1610 if err := gensupport.DecodeResponse(target, res); err != nil { 1611 return nil, err 1612 } 1613 return ret, nil 1614 // { 1615 // "description": "Fetches an Organization resource identified by the specified resource name.", 1616 // "flatPath": "v1beta1/organizations/{organizationsId}", 1617 // "httpMethod": "GET", 1618 // "id": "cloudresourcemanager.organizations.get", 1619 // "parameterOrder": [ 1620 // "name" 1621 // ], 1622 // "parameters": { 1623 // "name": { 1624 // "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\".", 1625 // "location": "path", 1626 // "pattern": "^organizations/[^/]+$", 1627 // "required": true, 1628 // "type": "string" 1629 // }, 1630 // "organizationId": { 1631 // "description": "The id of the Organization resource to fetch. This field is deprecated and will be removed in v1. Use name instead.", 1632 // "location": "query", 1633 // "type": "string" 1634 // } 1635 // }, 1636 // "path": "v1beta1/{+name}", 1637 // "response": { 1638 // "$ref": "Organization" 1639 // }, 1640 // "scopes": [ 1641 // "https://www.googleapis.com/auth/cloud-platform", 1642 // "https://www.googleapis.com/auth/cloud-platform.read-only" 1643 // ] 1644 // } 1645 1646} 1647 1648// method id "cloudresourcemanager.organizations.getIamPolicy": 1649 1650type OrganizationsGetIamPolicyCall struct { 1651 s *Service 1652 resource string 1653 getiampolicyrequest *GetIamPolicyRequest 1654 urlParams_ gensupport.URLParams 1655 ctx_ context.Context 1656 header_ http.Header 1657} 1658 1659// GetIamPolicy: Gets the access control policy for an Organization 1660// resource. May be empty if no such policy or resource exists. The 1661// `resource` field should be the organization's resource name, e.g. 1662// "organizations/123". 1663// 1664// - resource: REQUIRED: The resource for which the policy is being 1665// requested. See the operation documentation for the appropriate 1666// value for this field. 1667func (r *OrganizationsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *OrganizationsGetIamPolicyCall { 1668 c := &OrganizationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1669 c.resource = resource 1670 c.getiampolicyrequest = getiampolicyrequest 1671 return c 1672} 1673 1674// Fields allows partial responses to be retrieved. See 1675// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1676// for more information. 1677func (c *OrganizationsGetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsGetIamPolicyCall { 1678 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1679 return c 1680} 1681 1682// Context sets the context to be used in this call's Do method. Any 1683// pending HTTP request will be aborted if the provided context is 1684// canceled. 1685func (c *OrganizationsGetIamPolicyCall) Context(ctx context.Context) *OrganizationsGetIamPolicyCall { 1686 c.ctx_ = ctx 1687 return c 1688} 1689 1690// Header returns an http.Header that can be modified by the caller to 1691// add HTTP headers to the request. 1692func (c *OrganizationsGetIamPolicyCall) Header() http.Header { 1693 if c.header_ == nil { 1694 c.header_ = make(http.Header) 1695 } 1696 return c.header_ 1697} 1698 1699func (c *OrganizationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 1700 reqHeaders := make(http.Header) 1701 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 1702 for k, v := range c.header_ { 1703 reqHeaders[k] = v 1704 } 1705 reqHeaders.Set("User-Agent", c.s.userAgent()) 1706 var body io.Reader = nil 1707 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 1708 if err != nil { 1709 return nil, err 1710 } 1711 reqHeaders.Set("Content-Type", "application/json") 1712 c.urlParams_.Set("alt", alt) 1713 c.urlParams_.Set("prettyPrint", "false") 1714 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy") 1715 urls += "?" + c.urlParams_.Encode() 1716 req, err := http.NewRequest("POST", urls, body) 1717 if err != nil { 1718 return nil, err 1719 } 1720 req.Header = reqHeaders 1721 googleapi.Expand(req.URL, map[string]string{ 1722 "resource": c.resource, 1723 }) 1724 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1725} 1726 1727// Do executes the "cloudresourcemanager.organizations.getIamPolicy" call. 1728// Exactly one of *Policy or error will be non-nil. Any non-2xx status 1729// code is an error. Response headers are in either 1730// *Policy.ServerResponse.Header or (if a response was returned at all) 1731// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1732// check whether the returned error was because http.StatusNotModified 1733// was returned. 1734func (c *OrganizationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 1735 gensupport.SetOptions(c.urlParams_, opts...) 1736 res, err := c.doRequest("json") 1737 if res != nil && res.StatusCode == http.StatusNotModified { 1738 if res.Body != nil { 1739 res.Body.Close() 1740 } 1741 return nil, &googleapi.Error{ 1742 Code: res.StatusCode, 1743 Header: res.Header, 1744 } 1745 } 1746 if err != nil { 1747 return nil, err 1748 } 1749 defer googleapi.CloseBody(res) 1750 if err := googleapi.CheckResponse(res); err != nil { 1751 return nil, err 1752 } 1753 ret := &Policy{ 1754 ServerResponse: googleapi.ServerResponse{ 1755 Header: res.Header, 1756 HTTPStatusCode: res.StatusCode, 1757 }, 1758 } 1759 target := &ret 1760 if err := gensupport.DecodeResponse(target, res); err != nil { 1761 return nil, err 1762 } 1763 return ret, nil 1764 // { 1765 // "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\".", 1766 // "flatPath": "v1beta1/organizations/{organizationsId}:getIamPolicy", 1767 // "httpMethod": "POST", 1768 // "id": "cloudresourcemanager.organizations.getIamPolicy", 1769 // "parameterOrder": [ 1770 // "resource" 1771 // ], 1772 // "parameters": { 1773 // "resource": { 1774 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 1775 // "location": "path", 1776 // "pattern": "^organizations/[^/]+$", 1777 // "required": true, 1778 // "type": "string" 1779 // } 1780 // }, 1781 // "path": "v1beta1/{+resource}:getIamPolicy", 1782 // "request": { 1783 // "$ref": "GetIamPolicyRequest" 1784 // }, 1785 // "response": { 1786 // "$ref": "Policy" 1787 // }, 1788 // "scopes": [ 1789 // "https://www.googleapis.com/auth/cloud-platform", 1790 // "https://www.googleapis.com/auth/cloud-platform.read-only" 1791 // ] 1792 // } 1793 1794} 1795 1796// method id "cloudresourcemanager.organizations.list": 1797 1798type OrganizationsListCall struct { 1799 s *Service 1800 urlParams_ gensupport.URLParams 1801 ifNoneMatch_ string 1802 ctx_ context.Context 1803 header_ http.Header 1804} 1805 1806// List: Lists Organization resources that are visible to the user and 1807// satisfy the specified filter. This method returns Organizations in an 1808// unspecified order. New Organizations do not necessarily appear at the 1809// end of the list. 1810func (r *OrganizationsService) List() *OrganizationsListCall { 1811 c := &OrganizationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1812 return c 1813} 1814 1815// Filter sets the optional parameter "filter": An optional query string 1816// used to filter the Organizations to return in the response. Filter 1817// rules are case-insensitive. Organizations may be filtered by 1818// `owner.directoryCustomerId` or by `domain`, where the domain is a G 1819// Suite domain, for example: * Filter 1820// `owner.directorycustomerid:123456789` returns Organization resources 1821// with `owner.directory_customer_id` equal to `123456789`. * Filter 1822// `domain:google.com` returns Organization resources corresponding to 1823// the domain `google.com`. This field is optional. 1824func (c *OrganizationsListCall) Filter(filter string) *OrganizationsListCall { 1825 c.urlParams_.Set("filter", filter) 1826 return c 1827} 1828 1829// PageSize sets the optional parameter "pageSize": The maximum number 1830// of Organizations to return in the response. This field is optional. 1831func (c *OrganizationsListCall) PageSize(pageSize int64) *OrganizationsListCall { 1832 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 1833 return c 1834} 1835 1836// PageToken sets the optional parameter "pageToken": A pagination token 1837// returned from a previous call to `ListOrganizations` that indicates 1838// from where listing should continue. This field is optional. 1839func (c *OrganizationsListCall) PageToken(pageToken string) *OrganizationsListCall { 1840 c.urlParams_.Set("pageToken", pageToken) 1841 return c 1842} 1843 1844// Fields allows partial responses to be retrieved. See 1845// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1846// for more information. 1847func (c *OrganizationsListCall) Fields(s ...googleapi.Field) *OrganizationsListCall { 1848 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1849 return c 1850} 1851 1852// IfNoneMatch sets the optional parameter which makes the operation 1853// fail if the object's ETag matches the given value. This is useful for 1854// getting updates only after the object has changed since the last 1855// request. Use googleapi.IsNotModified to check whether the response 1856// error from Do is the result of In-None-Match. 1857func (c *OrganizationsListCall) IfNoneMatch(entityTag string) *OrganizationsListCall { 1858 c.ifNoneMatch_ = entityTag 1859 return c 1860} 1861 1862// Context sets the context to be used in this call's Do method. Any 1863// pending HTTP request will be aborted if the provided context is 1864// canceled. 1865func (c *OrganizationsListCall) Context(ctx context.Context) *OrganizationsListCall { 1866 c.ctx_ = ctx 1867 return c 1868} 1869 1870// Header returns an http.Header that can be modified by the caller to 1871// add HTTP headers to the request. 1872func (c *OrganizationsListCall) Header() http.Header { 1873 if c.header_ == nil { 1874 c.header_ = make(http.Header) 1875 } 1876 return c.header_ 1877} 1878 1879func (c *OrganizationsListCall) doRequest(alt string) (*http.Response, error) { 1880 reqHeaders := make(http.Header) 1881 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 1882 for k, v := range c.header_ { 1883 reqHeaders[k] = v 1884 } 1885 reqHeaders.Set("User-Agent", c.s.userAgent()) 1886 if c.ifNoneMatch_ != "" { 1887 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1888 } 1889 var body io.Reader = nil 1890 c.urlParams_.Set("alt", alt) 1891 c.urlParams_.Set("prettyPrint", "false") 1892 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/organizations") 1893 urls += "?" + c.urlParams_.Encode() 1894 req, err := http.NewRequest("GET", urls, body) 1895 if err != nil { 1896 return nil, err 1897 } 1898 req.Header = reqHeaders 1899 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1900} 1901 1902// Do executes the "cloudresourcemanager.organizations.list" call. 1903// Exactly one of *ListOrganizationsResponse or error will be non-nil. 1904// Any non-2xx status code is an error. Response headers are in either 1905// *ListOrganizationsResponse.ServerResponse.Header or (if a response 1906// was returned at all) in error.(*googleapi.Error).Header. Use 1907// googleapi.IsNotModified to check whether the returned error was 1908// because http.StatusNotModified was returned. 1909func (c *OrganizationsListCall) Do(opts ...googleapi.CallOption) (*ListOrganizationsResponse, error) { 1910 gensupport.SetOptions(c.urlParams_, opts...) 1911 res, err := c.doRequest("json") 1912 if res != nil && res.StatusCode == http.StatusNotModified { 1913 if res.Body != nil { 1914 res.Body.Close() 1915 } 1916 return nil, &googleapi.Error{ 1917 Code: res.StatusCode, 1918 Header: res.Header, 1919 } 1920 } 1921 if err != nil { 1922 return nil, err 1923 } 1924 defer googleapi.CloseBody(res) 1925 if err := googleapi.CheckResponse(res); err != nil { 1926 return nil, err 1927 } 1928 ret := &ListOrganizationsResponse{ 1929 ServerResponse: googleapi.ServerResponse{ 1930 Header: res.Header, 1931 HTTPStatusCode: res.StatusCode, 1932 }, 1933 } 1934 target := &ret 1935 if err := gensupport.DecodeResponse(target, res); err != nil { 1936 return nil, err 1937 } 1938 return ret, nil 1939 // { 1940 // "description": "Lists 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 list.", 1941 // "flatPath": "v1beta1/organizations", 1942 // "httpMethod": "GET", 1943 // "id": "cloudresourcemanager.organizations.list", 1944 // "parameterOrder": [], 1945 // "parameters": { 1946 // "filter": { 1947 // "description": "An optional query string used to filter the Organizations to return in the response. Filter rules are case-insensitive. Organizations may be filtered by `owner.directoryCustomerId` or by `domain`, where the domain is a G Suite domain, for example: * Filter `owner.directorycustomerid:123456789` returns Organization resources with `owner.directory_customer_id` equal to `123456789`. * Filter `domain:google.com` returns Organization resources corresponding to the domain `google.com`. This field is optional.", 1948 // "location": "query", 1949 // "type": "string" 1950 // }, 1951 // "pageSize": { 1952 // "description": "The maximum number of Organizations to return in the response. This field is optional.", 1953 // "format": "int32", 1954 // "location": "query", 1955 // "type": "integer" 1956 // }, 1957 // "pageToken": { 1958 // "description": "A pagination token returned from a previous call to `ListOrganizations` that indicates from where listing should continue. This field is optional.", 1959 // "location": "query", 1960 // "type": "string" 1961 // } 1962 // }, 1963 // "path": "v1beta1/organizations", 1964 // "response": { 1965 // "$ref": "ListOrganizationsResponse" 1966 // }, 1967 // "scopes": [ 1968 // "https://www.googleapis.com/auth/cloud-platform", 1969 // "https://www.googleapis.com/auth/cloud-platform.read-only" 1970 // ] 1971 // } 1972 1973} 1974 1975// Pages invokes f for each page of results. 1976// A non-nil error returned from f will halt the iteration. 1977// The provided context supersedes any context provided to the Context method. 1978func (c *OrganizationsListCall) Pages(ctx context.Context, f func(*ListOrganizationsResponse) error) error { 1979 c.ctx_ = ctx 1980 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 1981 for { 1982 x, err := c.Do() 1983 if err != nil { 1984 return err 1985 } 1986 if err := f(x); err != nil { 1987 return err 1988 } 1989 if x.NextPageToken == "" { 1990 return nil 1991 } 1992 c.PageToken(x.NextPageToken) 1993 } 1994} 1995 1996// method id "cloudresourcemanager.organizations.setIamPolicy": 1997 1998type OrganizationsSetIamPolicyCall struct { 1999 s *Service 2000 resource string 2001 setiampolicyrequest *SetIamPolicyRequest 2002 urlParams_ gensupport.URLParams 2003 ctx_ context.Context 2004 header_ http.Header 2005} 2006 2007// SetIamPolicy: Sets the access control policy on an Organization 2008// resource. Replaces any existing policy. The `resource` field should 2009// be the organization's resource name, e.g. "organizations/123". 2010// 2011// - resource: REQUIRED: The resource for which the policy is being 2012// specified. See the operation documentation for the appropriate 2013// value for this field. 2014func (r *OrganizationsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *OrganizationsSetIamPolicyCall { 2015 c := &OrganizationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2016 c.resource = resource 2017 c.setiampolicyrequest = setiampolicyrequest 2018 return c 2019} 2020 2021// Fields allows partial responses to be retrieved. See 2022// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2023// for more information. 2024func (c *OrganizationsSetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSetIamPolicyCall { 2025 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2026 return c 2027} 2028 2029// Context sets the context to be used in this call's Do method. Any 2030// pending HTTP request will be aborted if the provided context is 2031// canceled. 2032func (c *OrganizationsSetIamPolicyCall) Context(ctx context.Context) *OrganizationsSetIamPolicyCall { 2033 c.ctx_ = ctx 2034 return c 2035} 2036 2037// Header returns an http.Header that can be modified by the caller to 2038// add HTTP headers to the request. 2039func (c *OrganizationsSetIamPolicyCall) Header() http.Header { 2040 if c.header_ == nil { 2041 c.header_ = make(http.Header) 2042 } 2043 return c.header_ 2044} 2045 2046func (c *OrganizationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 2047 reqHeaders := make(http.Header) 2048 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 2049 for k, v := range c.header_ { 2050 reqHeaders[k] = v 2051 } 2052 reqHeaders.Set("User-Agent", c.s.userAgent()) 2053 var body io.Reader = nil 2054 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 2055 if err != nil { 2056 return nil, err 2057 } 2058 reqHeaders.Set("Content-Type", "application/json") 2059 c.urlParams_.Set("alt", alt) 2060 c.urlParams_.Set("prettyPrint", "false") 2061 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy") 2062 urls += "?" + c.urlParams_.Encode() 2063 req, err := http.NewRequest("POST", urls, body) 2064 if err != nil { 2065 return nil, err 2066 } 2067 req.Header = reqHeaders 2068 googleapi.Expand(req.URL, map[string]string{ 2069 "resource": c.resource, 2070 }) 2071 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2072} 2073 2074// Do executes the "cloudresourcemanager.organizations.setIamPolicy" call. 2075// Exactly one of *Policy or error will be non-nil. Any non-2xx status 2076// code is an error. Response headers are in either 2077// *Policy.ServerResponse.Header or (if a response was returned at all) 2078// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2079// check whether the returned error was because http.StatusNotModified 2080// was returned. 2081func (c *OrganizationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 2082 gensupport.SetOptions(c.urlParams_, opts...) 2083 res, err := c.doRequest("json") 2084 if res != nil && res.StatusCode == http.StatusNotModified { 2085 if res.Body != nil { 2086 res.Body.Close() 2087 } 2088 return nil, &googleapi.Error{ 2089 Code: res.StatusCode, 2090 Header: res.Header, 2091 } 2092 } 2093 if err != nil { 2094 return nil, err 2095 } 2096 defer googleapi.CloseBody(res) 2097 if err := googleapi.CheckResponse(res); err != nil { 2098 return nil, err 2099 } 2100 ret := &Policy{ 2101 ServerResponse: googleapi.ServerResponse{ 2102 Header: res.Header, 2103 HTTPStatusCode: res.StatusCode, 2104 }, 2105 } 2106 target := &ret 2107 if err := gensupport.DecodeResponse(target, res); err != nil { 2108 return nil, err 2109 } 2110 return ret, nil 2111 // { 2112 // "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\".", 2113 // "flatPath": "v1beta1/organizations/{organizationsId}:setIamPolicy", 2114 // "httpMethod": "POST", 2115 // "id": "cloudresourcemanager.organizations.setIamPolicy", 2116 // "parameterOrder": [ 2117 // "resource" 2118 // ], 2119 // "parameters": { 2120 // "resource": { 2121 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 2122 // "location": "path", 2123 // "pattern": "^organizations/[^/]+$", 2124 // "required": true, 2125 // "type": "string" 2126 // } 2127 // }, 2128 // "path": "v1beta1/{+resource}:setIamPolicy", 2129 // "request": { 2130 // "$ref": "SetIamPolicyRequest" 2131 // }, 2132 // "response": { 2133 // "$ref": "Policy" 2134 // }, 2135 // "scopes": [ 2136 // "https://www.googleapis.com/auth/cloud-platform" 2137 // ] 2138 // } 2139 2140} 2141 2142// method id "cloudresourcemanager.organizations.testIamPermissions": 2143 2144type OrganizationsTestIamPermissionsCall struct { 2145 s *Service 2146 resource string 2147 testiampermissionsrequest *TestIamPermissionsRequest 2148 urlParams_ gensupport.URLParams 2149 ctx_ context.Context 2150 header_ http.Header 2151} 2152 2153// TestIamPermissions: Returns permissions that a caller has on the 2154// specified Organization. The `resource` field should be the 2155// organization's resource name, e.g. "organizations/123". 2156// 2157// - resource: REQUIRED: The resource for which the policy detail is 2158// being requested. See the operation documentation for the 2159// appropriate value for this field. 2160func (r *OrganizationsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *OrganizationsTestIamPermissionsCall { 2161 c := &OrganizationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2162 c.resource = resource 2163 c.testiampermissionsrequest = testiampermissionsrequest 2164 return c 2165} 2166 2167// Fields allows partial responses to be retrieved. See 2168// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2169// for more information. 2170func (c *OrganizationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *OrganizationsTestIamPermissionsCall { 2171 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2172 return c 2173} 2174 2175// Context sets the context to be used in this call's Do method. Any 2176// pending HTTP request will be aborted if the provided context is 2177// canceled. 2178func (c *OrganizationsTestIamPermissionsCall) Context(ctx context.Context) *OrganizationsTestIamPermissionsCall { 2179 c.ctx_ = ctx 2180 return c 2181} 2182 2183// Header returns an http.Header that can be modified by the caller to 2184// add HTTP headers to the request. 2185func (c *OrganizationsTestIamPermissionsCall) Header() http.Header { 2186 if c.header_ == nil { 2187 c.header_ = make(http.Header) 2188 } 2189 return c.header_ 2190} 2191 2192func (c *OrganizationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 2193 reqHeaders := make(http.Header) 2194 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 2195 for k, v := range c.header_ { 2196 reqHeaders[k] = v 2197 } 2198 reqHeaders.Set("User-Agent", c.s.userAgent()) 2199 var body io.Reader = nil 2200 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 2201 if err != nil { 2202 return nil, err 2203 } 2204 reqHeaders.Set("Content-Type", "application/json") 2205 c.urlParams_.Set("alt", alt) 2206 c.urlParams_.Set("prettyPrint", "false") 2207 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions") 2208 urls += "?" + c.urlParams_.Encode() 2209 req, err := http.NewRequest("POST", urls, body) 2210 if err != nil { 2211 return nil, err 2212 } 2213 req.Header = reqHeaders 2214 googleapi.Expand(req.URL, map[string]string{ 2215 "resource": c.resource, 2216 }) 2217 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2218} 2219 2220// Do executes the "cloudresourcemanager.organizations.testIamPermissions" call. 2221// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 2222// Any non-2xx status code is an error. Response headers are in either 2223// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 2224// was returned at all) in error.(*googleapi.Error).Header. Use 2225// googleapi.IsNotModified to check whether the returned error was 2226// because http.StatusNotModified was returned. 2227func (c *OrganizationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 2228 gensupport.SetOptions(c.urlParams_, opts...) 2229 res, err := c.doRequest("json") 2230 if res != nil && res.StatusCode == http.StatusNotModified { 2231 if res.Body != nil { 2232 res.Body.Close() 2233 } 2234 return nil, &googleapi.Error{ 2235 Code: res.StatusCode, 2236 Header: res.Header, 2237 } 2238 } 2239 if err != nil { 2240 return nil, err 2241 } 2242 defer googleapi.CloseBody(res) 2243 if err := googleapi.CheckResponse(res); err != nil { 2244 return nil, err 2245 } 2246 ret := &TestIamPermissionsResponse{ 2247 ServerResponse: googleapi.ServerResponse{ 2248 Header: res.Header, 2249 HTTPStatusCode: res.StatusCode, 2250 }, 2251 } 2252 target := &ret 2253 if err := gensupport.DecodeResponse(target, res); err != nil { 2254 return nil, err 2255 } 2256 return ret, nil 2257 // { 2258 // "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\".", 2259 // "flatPath": "v1beta1/organizations/{organizationsId}:testIamPermissions", 2260 // "httpMethod": "POST", 2261 // "id": "cloudresourcemanager.organizations.testIamPermissions", 2262 // "parameterOrder": [ 2263 // "resource" 2264 // ], 2265 // "parameters": { 2266 // "resource": { 2267 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 2268 // "location": "path", 2269 // "pattern": "^organizations/[^/]+$", 2270 // "required": true, 2271 // "type": "string" 2272 // } 2273 // }, 2274 // "path": "v1beta1/{+resource}:testIamPermissions", 2275 // "request": { 2276 // "$ref": "TestIamPermissionsRequest" 2277 // }, 2278 // "response": { 2279 // "$ref": "TestIamPermissionsResponse" 2280 // }, 2281 // "scopes": [ 2282 // "https://www.googleapis.com/auth/cloud-platform", 2283 // "https://www.googleapis.com/auth/cloud-platform.read-only" 2284 // ] 2285 // } 2286 2287} 2288 2289// method id "cloudresourcemanager.organizations.update": 2290 2291type OrganizationsUpdateCall struct { 2292 s *Service 2293 name string 2294 organization *Organization 2295 urlParams_ gensupport.URLParams 2296 ctx_ context.Context 2297 header_ http.Header 2298} 2299 2300// Update: Updates an Organization resource identified by the specified 2301// resource name. 2302// 2303// - name: Output only. The resource name of the organization. This is 2304// the organization's relative path in the API. Its format is 2305// "organizations/[organization_id]". For example, 2306// "organizations/1234". 2307func (r *OrganizationsService) Update(name string, organization *Organization) *OrganizationsUpdateCall { 2308 c := &OrganizationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2309 c.name = name 2310 c.organization = organization 2311 return c 2312} 2313 2314// Fields allows partial responses to be retrieved. See 2315// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2316// for more information. 2317func (c *OrganizationsUpdateCall) Fields(s ...googleapi.Field) *OrganizationsUpdateCall { 2318 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2319 return c 2320} 2321 2322// Context sets the context to be used in this call's Do method. Any 2323// pending HTTP request will be aborted if the provided context is 2324// canceled. 2325func (c *OrganizationsUpdateCall) Context(ctx context.Context) *OrganizationsUpdateCall { 2326 c.ctx_ = ctx 2327 return c 2328} 2329 2330// Header returns an http.Header that can be modified by the caller to 2331// add HTTP headers to the request. 2332func (c *OrganizationsUpdateCall) Header() http.Header { 2333 if c.header_ == nil { 2334 c.header_ = make(http.Header) 2335 } 2336 return c.header_ 2337} 2338 2339func (c *OrganizationsUpdateCall) doRequest(alt string) (*http.Response, error) { 2340 reqHeaders := make(http.Header) 2341 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 2342 for k, v := range c.header_ { 2343 reqHeaders[k] = v 2344 } 2345 reqHeaders.Set("User-Agent", c.s.userAgent()) 2346 var body io.Reader = nil 2347 body, err := googleapi.WithoutDataWrapper.JSONReader(c.organization) 2348 if err != nil { 2349 return nil, err 2350 } 2351 reqHeaders.Set("Content-Type", "application/json") 2352 c.urlParams_.Set("alt", alt) 2353 c.urlParams_.Set("prettyPrint", "false") 2354 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 2355 urls += "?" + c.urlParams_.Encode() 2356 req, err := http.NewRequest("PUT", urls, body) 2357 if err != nil { 2358 return nil, err 2359 } 2360 req.Header = reqHeaders 2361 googleapi.Expand(req.URL, map[string]string{ 2362 "name": c.name, 2363 }) 2364 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2365} 2366 2367// Do executes the "cloudresourcemanager.organizations.update" call. 2368// Exactly one of *Organization or error will be non-nil. Any non-2xx 2369// status code is an error. Response headers are in either 2370// *Organization.ServerResponse.Header or (if a response was returned at 2371// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2372// to check whether the returned error was because 2373// http.StatusNotModified was returned. 2374func (c *OrganizationsUpdateCall) Do(opts ...googleapi.CallOption) (*Organization, error) { 2375 gensupport.SetOptions(c.urlParams_, opts...) 2376 res, err := c.doRequest("json") 2377 if res != nil && res.StatusCode == http.StatusNotModified { 2378 if res.Body != nil { 2379 res.Body.Close() 2380 } 2381 return nil, &googleapi.Error{ 2382 Code: res.StatusCode, 2383 Header: res.Header, 2384 } 2385 } 2386 if err != nil { 2387 return nil, err 2388 } 2389 defer googleapi.CloseBody(res) 2390 if err := googleapi.CheckResponse(res); err != nil { 2391 return nil, err 2392 } 2393 ret := &Organization{ 2394 ServerResponse: googleapi.ServerResponse{ 2395 Header: res.Header, 2396 HTTPStatusCode: res.StatusCode, 2397 }, 2398 } 2399 target := &ret 2400 if err := gensupport.DecodeResponse(target, res); err != nil { 2401 return nil, err 2402 } 2403 return ret, nil 2404 // { 2405 // "description": "Updates an Organization resource identified by the specified resource name.", 2406 // "flatPath": "v1beta1/organizations/{organizationsId}", 2407 // "httpMethod": "PUT", 2408 // "id": "cloudresourcemanager.organizations.update", 2409 // "parameterOrder": [ 2410 // "name" 2411 // ], 2412 // "parameters": { 2413 // "name": { 2414 // "description": "Output only. The resource name of the organization. This is the organization's relative path in the API. Its format is \"organizations/[organization_id]\". For example, \"organizations/1234\".", 2415 // "location": "path", 2416 // "pattern": "^organizations/[^/]+$", 2417 // "required": true, 2418 // "type": "string" 2419 // } 2420 // }, 2421 // "path": "v1beta1/{+name}", 2422 // "request": { 2423 // "$ref": "Organization" 2424 // }, 2425 // "response": { 2426 // "$ref": "Organization" 2427 // }, 2428 // "scopes": [ 2429 // "https://www.googleapis.com/auth/cloud-platform" 2430 // ] 2431 // } 2432 2433} 2434 2435// method id "cloudresourcemanager.projects.create": 2436 2437type ProjectsCreateCall struct { 2438 s *Service 2439 project *Project 2440 urlParams_ gensupport.URLParams 2441 ctx_ context.Context 2442 header_ http.Header 2443} 2444 2445// Create: Creates a Project resource. Initially, the Project resource 2446// is owned by its creator exclusively. The creator can later grant 2447// permission to others to read or update the Project. Several APIs are 2448// activated automatically for the Project, including Google Cloud 2449// Storage. The parent is identified by a specified ResourceId, which 2450// must include both an ID and a type, such as project, folder, or 2451// organization. This method does not associate the new project with a 2452// billing account. You can set or update the billing account associated 2453// with a project using the [`projects.updateBillingInfo`] 2454// (/billing/reference/rest/v1/projects/updateBillingInfo) method. 2455func (r *ProjectsService) Create(project *Project) *ProjectsCreateCall { 2456 c := &ProjectsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2457 c.project = project 2458 return c 2459} 2460 2461// UseLegacyStack sets the optional parameter "useLegacyStack": A now 2462// unused experiment opt-out option. 2463func (c *ProjectsCreateCall) UseLegacyStack(useLegacyStack bool) *ProjectsCreateCall { 2464 c.urlParams_.Set("useLegacyStack", fmt.Sprint(useLegacyStack)) 2465 return c 2466} 2467 2468// Fields allows partial responses to be retrieved. See 2469// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2470// for more information. 2471func (c *ProjectsCreateCall) Fields(s ...googleapi.Field) *ProjectsCreateCall { 2472 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2473 return c 2474} 2475 2476// Context sets the context to be used in this call's Do method. Any 2477// pending HTTP request will be aborted if the provided context is 2478// canceled. 2479func (c *ProjectsCreateCall) Context(ctx context.Context) *ProjectsCreateCall { 2480 c.ctx_ = ctx 2481 return c 2482} 2483 2484// Header returns an http.Header that can be modified by the caller to 2485// add HTTP headers to the request. 2486func (c *ProjectsCreateCall) Header() http.Header { 2487 if c.header_ == nil { 2488 c.header_ = make(http.Header) 2489 } 2490 return c.header_ 2491} 2492 2493func (c *ProjectsCreateCall) doRequest(alt string) (*http.Response, error) { 2494 reqHeaders := make(http.Header) 2495 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 2496 for k, v := range c.header_ { 2497 reqHeaders[k] = v 2498 } 2499 reqHeaders.Set("User-Agent", c.s.userAgent()) 2500 var body io.Reader = nil 2501 body, err := googleapi.WithoutDataWrapper.JSONReader(c.project) 2502 if err != nil { 2503 return nil, err 2504 } 2505 reqHeaders.Set("Content-Type", "application/json") 2506 c.urlParams_.Set("alt", alt) 2507 c.urlParams_.Set("prettyPrint", "false") 2508 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects") 2509 urls += "?" + c.urlParams_.Encode() 2510 req, err := http.NewRequest("POST", urls, body) 2511 if err != nil { 2512 return nil, err 2513 } 2514 req.Header = reqHeaders 2515 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2516} 2517 2518// Do executes the "cloudresourcemanager.projects.create" call. 2519// Exactly one of *Project or error will be non-nil. Any non-2xx status 2520// code is an error. Response headers are in either 2521// *Project.ServerResponse.Header or (if a response was returned at all) 2522// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2523// check whether the returned error was because http.StatusNotModified 2524// was returned. 2525func (c *ProjectsCreateCall) Do(opts ...googleapi.CallOption) (*Project, error) { 2526 gensupport.SetOptions(c.urlParams_, opts...) 2527 res, err := c.doRequest("json") 2528 if res != nil && res.StatusCode == http.StatusNotModified { 2529 if res.Body != nil { 2530 res.Body.Close() 2531 } 2532 return nil, &googleapi.Error{ 2533 Code: res.StatusCode, 2534 Header: res.Header, 2535 } 2536 } 2537 if err != nil { 2538 return nil, err 2539 } 2540 defer googleapi.CloseBody(res) 2541 if err := googleapi.CheckResponse(res); err != nil { 2542 return nil, err 2543 } 2544 ret := &Project{ 2545 ServerResponse: googleapi.ServerResponse{ 2546 Header: res.Header, 2547 HTTPStatusCode: res.StatusCode, 2548 }, 2549 } 2550 target := &ret 2551 if err := gensupport.DecodeResponse(target, res); err != nil { 2552 return nil, err 2553 } 2554 return ret, nil 2555 // { 2556 // "description": "Creates a Project resource. Initially, the Project resource is owned by its creator exclusively. The creator can later grant permission to others to read or update the Project. Several APIs are activated automatically for the Project, including Google Cloud Storage. The parent is identified by a specified ResourceId, which must include both an ID and a type, such as project, folder, or 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.", 2557 // "flatPath": "v1beta1/projects", 2558 // "httpMethod": "POST", 2559 // "id": "cloudresourcemanager.projects.create", 2560 // "parameterOrder": [], 2561 // "parameters": { 2562 // "useLegacyStack": { 2563 // "description": "A now unused experiment opt-out option.", 2564 // "location": "query", 2565 // "type": "boolean" 2566 // } 2567 // }, 2568 // "path": "v1beta1/projects", 2569 // "request": { 2570 // "$ref": "Project" 2571 // }, 2572 // "response": { 2573 // "$ref": "Project" 2574 // }, 2575 // "scopes": [ 2576 // "https://www.googleapis.com/auth/cloud-platform" 2577 // ] 2578 // } 2579 2580} 2581 2582// method id "cloudresourcemanager.projects.delete": 2583 2584type ProjectsDeleteCall struct { 2585 s *Service 2586 projectId string 2587 urlParams_ gensupport.URLParams 2588 ctx_ context.Context 2589 header_ http.Header 2590} 2591 2592// Delete: Marks the Project identified by the specified `project_id` 2593// (for example, `my-project-123`) for deletion. This method will only 2594// affect the Project if it has a lifecycle state of ACTIVE. This method 2595// changes the Project's lifecycle state from ACTIVE to 2596// DELETE_REQUESTED. The deletion starts at an unspecified time, at 2597// which point the project is no longer accessible. Until the deletion 2598// completes, you can check the lifecycle state checked by retrieving 2599// the Project with GetProject, and the Project remains visible to 2600// ListProjects. However, you cannot update the project. After the 2601// deletion completes, the Project is not retrievable by the GetProject 2602// and ListProjects methods. The caller must have delete permissions for 2603// this Project. 2604// 2605// - projectId: The Project ID (for example, `foo-bar-123`). 2606func (r *ProjectsService) Delete(projectId string) *ProjectsDeleteCall { 2607 c := &ProjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2608 c.projectId = projectId 2609 return c 2610} 2611 2612// Fields allows partial responses to be retrieved. See 2613// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2614// for more information. 2615func (c *ProjectsDeleteCall) Fields(s ...googleapi.Field) *ProjectsDeleteCall { 2616 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2617 return c 2618} 2619 2620// Context sets the context to be used in this call's Do method. Any 2621// pending HTTP request will be aborted if the provided context is 2622// canceled. 2623func (c *ProjectsDeleteCall) Context(ctx context.Context) *ProjectsDeleteCall { 2624 c.ctx_ = ctx 2625 return c 2626} 2627 2628// Header returns an http.Header that can be modified by the caller to 2629// add HTTP headers to the request. 2630func (c *ProjectsDeleteCall) Header() http.Header { 2631 if c.header_ == nil { 2632 c.header_ = make(http.Header) 2633 } 2634 return c.header_ 2635} 2636 2637func (c *ProjectsDeleteCall) doRequest(alt string) (*http.Response, error) { 2638 reqHeaders := make(http.Header) 2639 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 2640 for k, v := range c.header_ { 2641 reqHeaders[k] = v 2642 } 2643 reqHeaders.Set("User-Agent", c.s.userAgent()) 2644 var body io.Reader = nil 2645 c.urlParams_.Set("alt", alt) 2646 c.urlParams_.Set("prettyPrint", "false") 2647 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}") 2648 urls += "?" + c.urlParams_.Encode() 2649 req, err := http.NewRequest("DELETE", urls, body) 2650 if err != nil { 2651 return nil, err 2652 } 2653 req.Header = reqHeaders 2654 googleapi.Expand(req.URL, map[string]string{ 2655 "projectId": c.projectId, 2656 }) 2657 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2658} 2659 2660// Do executes the "cloudresourcemanager.projects.delete" call. 2661// Exactly one of *Empty or error will be non-nil. Any non-2xx status 2662// code is an error. Response headers are in either 2663// *Empty.ServerResponse.Header or (if a response was returned at all) 2664// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2665// check whether the returned error was because http.StatusNotModified 2666// was returned. 2667func (c *ProjectsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 2668 gensupport.SetOptions(c.urlParams_, opts...) 2669 res, err := c.doRequest("json") 2670 if res != nil && res.StatusCode == http.StatusNotModified { 2671 if res.Body != nil { 2672 res.Body.Close() 2673 } 2674 return nil, &googleapi.Error{ 2675 Code: res.StatusCode, 2676 Header: res.Header, 2677 } 2678 } 2679 if err != nil { 2680 return nil, err 2681 } 2682 defer googleapi.CloseBody(res) 2683 if err := googleapi.CheckResponse(res); err != nil { 2684 return nil, err 2685 } 2686 ret := &Empty{ 2687 ServerResponse: googleapi.ServerResponse{ 2688 Header: res.Header, 2689 HTTPStatusCode: res.StatusCode, 2690 }, 2691 } 2692 target := &ret 2693 if err := gensupport.DecodeResponse(target, res); err != nil { 2694 return nil, err 2695 } 2696 return ret, nil 2697 // { 2698 // "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.", 2699 // "flatPath": "v1beta1/projects/{projectId}", 2700 // "httpMethod": "DELETE", 2701 // "id": "cloudresourcemanager.projects.delete", 2702 // "parameterOrder": [ 2703 // "projectId" 2704 // ], 2705 // "parameters": { 2706 // "projectId": { 2707 // "description": "The Project ID (for example, `foo-bar-123`).", 2708 // "location": "path", 2709 // "required": true, 2710 // "type": "string" 2711 // } 2712 // }, 2713 // "path": "v1beta1/projects/{projectId}", 2714 // "response": { 2715 // "$ref": "Empty" 2716 // }, 2717 // "scopes": [ 2718 // "https://www.googleapis.com/auth/cloud-platform" 2719 // ] 2720 // } 2721 2722} 2723 2724// method id "cloudresourcemanager.projects.get": 2725 2726type ProjectsGetCall struct { 2727 s *Service 2728 projectId string 2729 urlParams_ gensupport.URLParams 2730 ifNoneMatch_ string 2731 ctx_ context.Context 2732 header_ http.Header 2733} 2734 2735// Get: Retrieves the Project identified by the specified `project_id` 2736// (for example, `my-project-123`). The caller must have read 2737// permissions for this Project. 2738// 2739// - projectId: The Project ID (for example, `my-project-123`). 2740func (r *ProjectsService) Get(projectId string) *ProjectsGetCall { 2741 c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2742 c.projectId = projectId 2743 return c 2744} 2745 2746// Fields allows partial responses to be retrieved. See 2747// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2748// for more information. 2749func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall { 2750 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2751 return c 2752} 2753 2754// IfNoneMatch sets the optional parameter which makes the operation 2755// fail if the object's ETag matches the given value. This is useful for 2756// getting updates only after the object has changed since the last 2757// request. Use googleapi.IsNotModified to check whether the response 2758// error from Do is the result of In-None-Match. 2759func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall { 2760 c.ifNoneMatch_ = entityTag 2761 return c 2762} 2763 2764// Context sets the context to be used in this call's Do method. Any 2765// pending HTTP request will be aborted if the provided context is 2766// canceled. 2767func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall { 2768 c.ctx_ = ctx 2769 return c 2770} 2771 2772// Header returns an http.Header that can be modified by the caller to 2773// add HTTP headers to the request. 2774func (c *ProjectsGetCall) Header() http.Header { 2775 if c.header_ == nil { 2776 c.header_ = make(http.Header) 2777 } 2778 return c.header_ 2779} 2780 2781func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) { 2782 reqHeaders := make(http.Header) 2783 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 2784 for k, v := range c.header_ { 2785 reqHeaders[k] = v 2786 } 2787 reqHeaders.Set("User-Agent", c.s.userAgent()) 2788 if c.ifNoneMatch_ != "" { 2789 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2790 } 2791 var body io.Reader = nil 2792 c.urlParams_.Set("alt", alt) 2793 c.urlParams_.Set("prettyPrint", "false") 2794 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}") 2795 urls += "?" + c.urlParams_.Encode() 2796 req, err := http.NewRequest("GET", urls, body) 2797 if err != nil { 2798 return nil, err 2799 } 2800 req.Header = reqHeaders 2801 googleapi.Expand(req.URL, map[string]string{ 2802 "projectId": c.projectId, 2803 }) 2804 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2805} 2806 2807// Do executes the "cloudresourcemanager.projects.get" call. 2808// Exactly one of *Project or error will be non-nil. Any non-2xx status 2809// code is an error. Response headers are in either 2810// *Project.ServerResponse.Header or (if a response was returned at all) 2811// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2812// check whether the returned error was because http.StatusNotModified 2813// was returned. 2814func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) { 2815 gensupport.SetOptions(c.urlParams_, opts...) 2816 res, err := c.doRequest("json") 2817 if res != nil && res.StatusCode == http.StatusNotModified { 2818 if res.Body != nil { 2819 res.Body.Close() 2820 } 2821 return nil, &googleapi.Error{ 2822 Code: res.StatusCode, 2823 Header: res.Header, 2824 } 2825 } 2826 if err != nil { 2827 return nil, err 2828 } 2829 defer googleapi.CloseBody(res) 2830 if err := googleapi.CheckResponse(res); err != nil { 2831 return nil, err 2832 } 2833 ret := &Project{ 2834 ServerResponse: googleapi.ServerResponse{ 2835 Header: res.Header, 2836 HTTPStatusCode: res.StatusCode, 2837 }, 2838 } 2839 target := &ret 2840 if err := gensupport.DecodeResponse(target, res); err != nil { 2841 return nil, err 2842 } 2843 return ret, nil 2844 // { 2845 // "description": "Retrieves the Project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this Project.", 2846 // "flatPath": "v1beta1/projects/{projectId}", 2847 // "httpMethod": "GET", 2848 // "id": "cloudresourcemanager.projects.get", 2849 // "parameterOrder": [ 2850 // "projectId" 2851 // ], 2852 // "parameters": { 2853 // "projectId": { 2854 // "description": "Required. The Project ID (for example, `my-project-123`).", 2855 // "location": "path", 2856 // "required": true, 2857 // "type": "string" 2858 // } 2859 // }, 2860 // "path": "v1beta1/projects/{projectId}", 2861 // "response": { 2862 // "$ref": "Project" 2863 // }, 2864 // "scopes": [ 2865 // "https://www.googleapis.com/auth/cloud-platform", 2866 // "https://www.googleapis.com/auth/cloud-platform.read-only" 2867 // ] 2868 // } 2869 2870} 2871 2872// method id "cloudresourcemanager.projects.getAncestry": 2873 2874type ProjectsGetAncestryCall struct { 2875 s *Service 2876 projectId string 2877 getancestryrequest *GetAncestryRequest 2878 urlParams_ gensupport.URLParams 2879 ctx_ context.Context 2880 header_ http.Header 2881} 2882 2883// GetAncestry: Gets a list of ancestors in the resource hierarchy for 2884// the Project identified by the specified `project_id` (for example, 2885// `my-project-123`). The caller must have read permissions for this 2886// Project. 2887// 2888// - projectId: The Project ID (for example, `my-project-123`). 2889func (r *ProjectsService) GetAncestry(projectId string, getancestryrequest *GetAncestryRequest) *ProjectsGetAncestryCall { 2890 c := &ProjectsGetAncestryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2891 c.projectId = projectId 2892 c.getancestryrequest = getancestryrequest 2893 return c 2894} 2895 2896// Fields allows partial responses to be retrieved. See 2897// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2898// for more information. 2899func (c *ProjectsGetAncestryCall) Fields(s ...googleapi.Field) *ProjectsGetAncestryCall { 2900 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2901 return c 2902} 2903 2904// Context sets the context to be used in this call's Do method. Any 2905// pending HTTP request will be aborted if the provided context is 2906// canceled. 2907func (c *ProjectsGetAncestryCall) Context(ctx context.Context) *ProjectsGetAncestryCall { 2908 c.ctx_ = ctx 2909 return c 2910} 2911 2912// Header returns an http.Header that can be modified by the caller to 2913// add HTTP headers to the request. 2914func (c *ProjectsGetAncestryCall) Header() http.Header { 2915 if c.header_ == nil { 2916 c.header_ = make(http.Header) 2917 } 2918 return c.header_ 2919} 2920 2921func (c *ProjectsGetAncestryCall) doRequest(alt string) (*http.Response, error) { 2922 reqHeaders := make(http.Header) 2923 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 2924 for k, v := range c.header_ { 2925 reqHeaders[k] = v 2926 } 2927 reqHeaders.Set("User-Agent", c.s.userAgent()) 2928 var body io.Reader = nil 2929 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getancestryrequest) 2930 if err != nil { 2931 return nil, err 2932 } 2933 reqHeaders.Set("Content-Type", "application/json") 2934 c.urlParams_.Set("alt", alt) 2935 c.urlParams_.Set("prettyPrint", "false") 2936 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}:getAncestry") 2937 urls += "?" + c.urlParams_.Encode() 2938 req, err := http.NewRequest("POST", urls, body) 2939 if err != nil { 2940 return nil, err 2941 } 2942 req.Header = reqHeaders 2943 googleapi.Expand(req.URL, map[string]string{ 2944 "projectId": c.projectId, 2945 }) 2946 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2947} 2948 2949// Do executes the "cloudresourcemanager.projects.getAncestry" call. 2950// Exactly one of *GetAncestryResponse or error will be non-nil. Any 2951// non-2xx status code is an error. Response headers are in either 2952// *GetAncestryResponse.ServerResponse.Header or (if a response was 2953// returned at all) in error.(*googleapi.Error).Header. Use 2954// googleapi.IsNotModified to check whether the returned error was 2955// because http.StatusNotModified was returned. 2956func (c *ProjectsGetAncestryCall) Do(opts ...googleapi.CallOption) (*GetAncestryResponse, error) { 2957 gensupport.SetOptions(c.urlParams_, opts...) 2958 res, err := c.doRequest("json") 2959 if res != nil && res.StatusCode == http.StatusNotModified { 2960 if res.Body != nil { 2961 res.Body.Close() 2962 } 2963 return nil, &googleapi.Error{ 2964 Code: res.StatusCode, 2965 Header: res.Header, 2966 } 2967 } 2968 if err != nil { 2969 return nil, err 2970 } 2971 defer googleapi.CloseBody(res) 2972 if err := googleapi.CheckResponse(res); err != nil { 2973 return nil, err 2974 } 2975 ret := &GetAncestryResponse{ 2976 ServerResponse: googleapi.ServerResponse{ 2977 Header: res.Header, 2978 HTTPStatusCode: res.StatusCode, 2979 }, 2980 } 2981 target := &ret 2982 if err := gensupport.DecodeResponse(target, res); err != nil { 2983 return nil, err 2984 } 2985 return ret, nil 2986 // { 2987 // "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.", 2988 // "flatPath": "v1beta1/projects/{projectId}:getAncestry", 2989 // "httpMethod": "POST", 2990 // "id": "cloudresourcemanager.projects.getAncestry", 2991 // "parameterOrder": [ 2992 // "projectId" 2993 // ], 2994 // "parameters": { 2995 // "projectId": { 2996 // "description": "Required. The Project ID (for example, `my-project-123`).", 2997 // "location": "path", 2998 // "required": true, 2999 // "type": "string" 3000 // } 3001 // }, 3002 // "path": "v1beta1/projects/{projectId}:getAncestry", 3003 // "request": { 3004 // "$ref": "GetAncestryRequest" 3005 // }, 3006 // "response": { 3007 // "$ref": "GetAncestryResponse" 3008 // }, 3009 // "scopes": [ 3010 // "https://www.googleapis.com/auth/cloud-platform", 3011 // "https://www.googleapis.com/auth/cloud-platform.read-only" 3012 // ] 3013 // } 3014 3015} 3016 3017// method id "cloudresourcemanager.projects.getIamPolicy": 3018 3019type ProjectsGetIamPolicyCall struct { 3020 s *Service 3021 resource string 3022 getiampolicyrequest *GetIamPolicyRequest 3023 urlParams_ gensupport.URLParams 3024 ctx_ context.Context 3025 header_ http.Header 3026} 3027 3028// GetIamPolicy: Returns the IAM access control policy for the specified 3029// Project. Permission is denied if the policy or the resource does not 3030// exist. For additional information about resource structure and 3031// identification, see Resource Names (/apis/design/resource_names). 3032// 3033// - resource: REQUIRED: The resource for which the policy is being 3034// requested. See the operation documentation for the appropriate 3035// value for this field. 3036func (r *ProjectsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsGetIamPolicyCall { 3037 c := &ProjectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3038 c.resource = resource 3039 c.getiampolicyrequest = getiampolicyrequest 3040 return c 3041} 3042 3043// Fields allows partial responses to be retrieved. See 3044// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3045// for more information. 3046func (c *ProjectsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsGetIamPolicyCall { 3047 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3048 return c 3049} 3050 3051// Context sets the context to be used in this call's Do method. Any 3052// pending HTTP request will be aborted if the provided context is 3053// canceled. 3054func (c *ProjectsGetIamPolicyCall) Context(ctx context.Context) *ProjectsGetIamPolicyCall { 3055 c.ctx_ = ctx 3056 return c 3057} 3058 3059// Header returns an http.Header that can be modified by the caller to 3060// add HTTP headers to the request. 3061func (c *ProjectsGetIamPolicyCall) Header() http.Header { 3062 if c.header_ == nil { 3063 c.header_ = make(http.Header) 3064 } 3065 return c.header_ 3066} 3067 3068func (c *ProjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 3069 reqHeaders := make(http.Header) 3070 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3071 for k, v := range c.header_ { 3072 reqHeaders[k] = v 3073 } 3074 reqHeaders.Set("User-Agent", c.s.userAgent()) 3075 var body io.Reader = nil 3076 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 3077 if err != nil { 3078 return nil, err 3079 } 3080 reqHeaders.Set("Content-Type", "application/json") 3081 c.urlParams_.Set("alt", alt) 3082 c.urlParams_.Set("prettyPrint", "false") 3083 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{resource}:getIamPolicy") 3084 urls += "?" + c.urlParams_.Encode() 3085 req, err := http.NewRequest("POST", urls, body) 3086 if err != nil { 3087 return nil, err 3088 } 3089 req.Header = reqHeaders 3090 googleapi.Expand(req.URL, map[string]string{ 3091 "resource": c.resource, 3092 }) 3093 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3094} 3095 3096// Do executes the "cloudresourcemanager.projects.getIamPolicy" call. 3097// Exactly one of *Policy or error will be non-nil. Any non-2xx status 3098// code is an error. Response headers are in either 3099// *Policy.ServerResponse.Header or (if a response was returned at all) 3100// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3101// check whether the returned error was because http.StatusNotModified 3102// was returned. 3103func (c *ProjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 3104 gensupport.SetOptions(c.urlParams_, opts...) 3105 res, err := c.doRequest("json") 3106 if res != nil && res.StatusCode == http.StatusNotModified { 3107 if res.Body != nil { 3108 res.Body.Close() 3109 } 3110 return nil, &googleapi.Error{ 3111 Code: res.StatusCode, 3112 Header: res.Header, 3113 } 3114 } 3115 if err != nil { 3116 return nil, err 3117 } 3118 defer googleapi.CloseBody(res) 3119 if err := googleapi.CheckResponse(res); err != nil { 3120 return nil, err 3121 } 3122 ret := &Policy{ 3123 ServerResponse: googleapi.ServerResponse{ 3124 Header: res.Header, 3125 HTTPStatusCode: res.StatusCode, 3126 }, 3127 } 3128 target := &ret 3129 if err := gensupport.DecodeResponse(target, res); err != nil { 3130 return nil, err 3131 } 3132 return ret, nil 3133 // { 3134 // "description": "Returns the IAM access control policy for the specified Project. Permission is denied if the policy or the resource does not exist. For additional information about resource structure and identification, see [Resource Names](/apis/design/resource_names).", 3135 // "flatPath": "v1beta1/projects/{resource}:getIamPolicy", 3136 // "httpMethod": "POST", 3137 // "id": "cloudresourcemanager.projects.getIamPolicy", 3138 // "parameterOrder": [ 3139 // "resource" 3140 // ], 3141 // "parameters": { 3142 // "resource": { 3143 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 3144 // "location": "path", 3145 // "required": true, 3146 // "type": "string" 3147 // } 3148 // }, 3149 // "path": "v1beta1/projects/{resource}:getIamPolicy", 3150 // "request": { 3151 // "$ref": "GetIamPolicyRequest" 3152 // }, 3153 // "response": { 3154 // "$ref": "Policy" 3155 // }, 3156 // "scopes": [ 3157 // "https://www.googleapis.com/auth/cloud-platform", 3158 // "https://www.googleapis.com/auth/cloud-platform.read-only" 3159 // ] 3160 // } 3161 3162} 3163 3164// method id "cloudresourcemanager.projects.list": 3165 3166type ProjectsListCall struct { 3167 s *Service 3168 urlParams_ gensupport.URLParams 3169 ifNoneMatch_ string 3170 ctx_ context.Context 3171 header_ http.Header 3172} 3173 3174// List: Lists Projects that the caller has the 3175// `resourcemanager.projects.get` permission on and satisfy the 3176// specified filter. This method returns Projects in an unspecified 3177// order. This method is eventually consistent with project mutations; 3178// this means that a newly created project may not appear in the results 3179// or recent updates to an existing project may not be reflected in the 3180// results. To retrieve the latest state of a project, use the 3181// GetProject method. NOTE: If the request filter contains a 3182// `parent.type` and `parent.id` and the caller has the 3183// `resourcemanager.projects.list` permission on the parent, the results 3184// will be drawn from an alternate index which provides more consistent 3185// results. In future versions of this API, this List method will be 3186// split into List and Search to properly capture the behavioral 3187// difference. 3188func (r *ProjectsService) List() *ProjectsListCall { 3189 c := &ProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3190 return c 3191} 3192 3193// Filter sets the optional parameter "filter": An expression for 3194// filtering the results of the request. Filter rules are case 3195// insensitive. If multiple fields are included in a filter query, the 3196// query will return results that match any of the fields. Some eligible 3197// fields for filtering are: + `name` + `id` + `labels.` (where *key* is 3198// the name of a label) + `parent.type` + `parent.id` Some examples of 3199// using labels as filters: | Filter | Description | 3200// |------------------|-------------------------------------------------- 3201// ---| | name:how* | The project's name starts with "how". | | 3202// name:Howl | The project's name is `Howl` or `howl`. | | name:HOWL | 3203// Equivalent to above. | | NAME:howl | Equivalent to above. | | 3204// labels.color:* | The project has the label `color`. | | 3205// labels.color:red | The project's label `color` has the value `red`. | 3206// | labels.color:red labels.size:big |The project's label `color` has 3207// the value `red` and its label `size` has the value `big`. | If no 3208// filter is specified, the call will return projects for which the user 3209// has the `resourcemanager.projects.get` permission. NOTE: To perform a 3210// by-parent query (eg., what projects are directly in a Folder), the 3211// caller must have the `resourcemanager.projects.list` permission on 3212// the parent and the filter must contain both a `parent.type` and a 3213// `parent.id` restriction (example: "parent.type:folder 3214// parent.id:123"). In this case an alternate search index is used which 3215// provides more consistent results. 3216func (c *ProjectsListCall) Filter(filter string) *ProjectsListCall { 3217 c.urlParams_.Set("filter", filter) 3218 return c 3219} 3220 3221// PageSize sets the optional parameter "pageSize": The maximum number 3222// of Projects to return in the response. The server can return fewer 3223// Projects than requested. If unspecified, server picks an appropriate 3224// default. 3225func (c *ProjectsListCall) PageSize(pageSize int64) *ProjectsListCall { 3226 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3227 return c 3228} 3229 3230// PageToken sets the optional parameter "pageToken": A pagination token 3231// returned from a previous call to ListProjects that indicates from 3232// where listing should continue. 3233func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall { 3234 c.urlParams_.Set("pageToken", pageToken) 3235 return c 3236} 3237 3238// Fields allows partial responses to be retrieved. See 3239// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3240// for more information. 3241func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall { 3242 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3243 return c 3244} 3245 3246// IfNoneMatch sets the optional parameter which makes the operation 3247// fail if the object's ETag matches the given value. This is useful for 3248// getting updates only after the object has changed since the last 3249// request. Use googleapi.IsNotModified to check whether the response 3250// error from Do is the result of In-None-Match. 3251func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall { 3252 c.ifNoneMatch_ = entityTag 3253 return c 3254} 3255 3256// Context sets the context to be used in this call's Do method. Any 3257// pending HTTP request will be aborted if the provided context is 3258// canceled. 3259func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall { 3260 c.ctx_ = ctx 3261 return c 3262} 3263 3264// Header returns an http.Header that can be modified by the caller to 3265// add HTTP headers to the request. 3266func (c *ProjectsListCall) Header() http.Header { 3267 if c.header_ == nil { 3268 c.header_ = make(http.Header) 3269 } 3270 return c.header_ 3271} 3272 3273func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) { 3274 reqHeaders := make(http.Header) 3275 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3276 for k, v := range c.header_ { 3277 reqHeaders[k] = v 3278 } 3279 reqHeaders.Set("User-Agent", c.s.userAgent()) 3280 if c.ifNoneMatch_ != "" { 3281 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3282 } 3283 var body io.Reader = nil 3284 c.urlParams_.Set("alt", alt) 3285 c.urlParams_.Set("prettyPrint", "false") 3286 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects") 3287 urls += "?" + c.urlParams_.Encode() 3288 req, err := http.NewRequest("GET", urls, body) 3289 if err != nil { 3290 return nil, err 3291 } 3292 req.Header = reqHeaders 3293 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3294} 3295 3296// Do executes the "cloudresourcemanager.projects.list" call. 3297// Exactly one of *ListProjectsResponse or error will be non-nil. Any 3298// non-2xx status code is an error. Response headers are in either 3299// *ListProjectsResponse.ServerResponse.Header or (if a response was 3300// returned at all) in error.(*googleapi.Error).Header. Use 3301// googleapi.IsNotModified to check whether the returned error was 3302// because http.StatusNotModified was returned. 3303func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ListProjectsResponse, error) { 3304 gensupport.SetOptions(c.urlParams_, opts...) 3305 res, err := c.doRequest("json") 3306 if res != nil && res.StatusCode == http.StatusNotModified { 3307 if res.Body != nil { 3308 res.Body.Close() 3309 } 3310 return nil, &googleapi.Error{ 3311 Code: res.StatusCode, 3312 Header: res.Header, 3313 } 3314 } 3315 if err != nil { 3316 return nil, err 3317 } 3318 defer googleapi.CloseBody(res) 3319 if err := googleapi.CheckResponse(res); err != nil { 3320 return nil, err 3321 } 3322 ret := &ListProjectsResponse{ 3323 ServerResponse: googleapi.ServerResponse{ 3324 Header: res.Header, 3325 HTTPStatusCode: res.StatusCode, 3326 }, 3327 } 3328 target := &ret 3329 if err := gensupport.DecodeResponse(target, res); err != nil { 3330 return nil, err 3331 } 3332 return ret, nil 3333 // { 3334 // "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.", 3335 // "flatPath": "v1beta1/projects", 3336 // "httpMethod": "GET", 3337 // "id": "cloudresourcemanager.projects.list", 3338 // "parameterOrder": [], 3339 // "parameters": { 3340 // "filter": { 3341 // "description": "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` Some examples of using labels as filters: | Filter | 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`. | 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. Optional.", 3342 // "location": "query", 3343 // "type": "string" 3344 // }, 3345 // "pageSize": { 3346 // "description": "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. Optional.", 3347 // "format": "int32", 3348 // "location": "query", 3349 // "type": "integer" 3350 // }, 3351 // "pageToken": { 3352 // "description": "A pagination token returned from a previous call to ListProjects that indicates from where listing should continue. Optional.", 3353 // "location": "query", 3354 // "type": "string" 3355 // } 3356 // }, 3357 // "path": "v1beta1/projects", 3358 // "response": { 3359 // "$ref": "ListProjectsResponse" 3360 // }, 3361 // "scopes": [ 3362 // "https://www.googleapis.com/auth/cloud-platform", 3363 // "https://www.googleapis.com/auth/cloud-platform.read-only" 3364 // ] 3365 // } 3366 3367} 3368 3369// Pages invokes f for each page of results. 3370// A non-nil error returned from f will halt the iteration. 3371// The provided context supersedes any context provided to the Context method. 3372func (c *ProjectsListCall) Pages(ctx context.Context, f func(*ListProjectsResponse) error) error { 3373 c.ctx_ = ctx 3374 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3375 for { 3376 x, err := c.Do() 3377 if err != nil { 3378 return err 3379 } 3380 if err := f(x); err != nil { 3381 return err 3382 } 3383 if x.NextPageToken == "" { 3384 return nil 3385 } 3386 c.PageToken(x.NextPageToken) 3387 } 3388} 3389 3390// method id "cloudresourcemanager.projects.setIamPolicy": 3391 3392type ProjectsSetIamPolicyCall struct { 3393 s *Service 3394 resource string 3395 setiampolicyrequest *SetIamPolicyRequest 3396 urlParams_ gensupport.URLParams 3397 ctx_ context.Context 3398 header_ http.Header 3399} 3400 3401// SetIamPolicy: Sets the IAM access control policy for the specified 3402// Project. CAUTION: This method will replace the existing policy, and 3403// cannot be used to append additional IAM settings. NOTE: Removing 3404// service accounts from policies or changing their roles can render 3405// services completely inoperable. It is important to understand how the 3406// service account is being used before removing or updating its roles. 3407// The following constraints apply when using `setIamPolicy()`: + 3408// Project does not support `allUsers` and `allAuthenticatedUsers` as 3409// `members` in a `Binding` of a `Policy`. + The owner role can be 3410// granted to a `user`, `serviceAccount`, or a group that is part of an 3411// organization. For example, group@myownpersonaldomain.com could be 3412// added as an owner to a project in the myownpersonaldomain.com 3413// organization, but not the examplepetstore.com organization. + Service 3414// accounts can be made owners of a project directly without any 3415// restrictions. However, to be added as an owner, a user must be 3416// invited via Cloud Platform console and must accept the invitation. + 3417// A user cannot be granted the owner role using `setIamPolicy()`. The 3418// user must be granted the owner role using the Cloud Platform Console 3419// and must explicitly accept the invitation. + Invitations to grant the 3420// owner role cannot be sent using `setIamPolicy()`; they must be sent 3421// only using the Cloud Platform Console. + Membership changes that 3422// leave the project without any owners that have accepted the Terms of 3423// Service (ToS) will be rejected. + If the project is not part of an 3424// organization, there must be at least one owner who has accepted the 3425// Terms of Service (ToS) agreement in the policy. Calling 3426// `setIamPolicy()` to remove the last ToS-accepted owner from the 3427// policy will fail. This restriction also applies to legacy projects 3428// that no longer have owners who have accepted the ToS. Edits to IAM 3429// policies will be rejected until the lack of a ToS-accepting owner is 3430// rectified. Authorization requires the Google IAM permission 3431// `resourcemanager.projects.setIamPolicy` on the project 3432// 3433// - resource: REQUIRED: The resource for which the policy is being 3434// specified. See the operation documentation for the appropriate 3435// value for this field. 3436func (r *ProjectsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsSetIamPolicyCall { 3437 c := &ProjectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3438 c.resource = resource 3439 c.setiampolicyrequest = setiampolicyrequest 3440 return c 3441} 3442 3443// Fields allows partial responses to be retrieved. See 3444// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3445// for more information. 3446func (c *ProjectsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSetIamPolicyCall { 3447 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3448 return c 3449} 3450 3451// Context sets the context to be used in this call's Do method. Any 3452// pending HTTP request will be aborted if the provided context is 3453// canceled. 3454func (c *ProjectsSetIamPolicyCall) Context(ctx context.Context) *ProjectsSetIamPolicyCall { 3455 c.ctx_ = ctx 3456 return c 3457} 3458 3459// Header returns an http.Header that can be modified by the caller to 3460// add HTTP headers to the request. 3461func (c *ProjectsSetIamPolicyCall) Header() http.Header { 3462 if c.header_ == nil { 3463 c.header_ = make(http.Header) 3464 } 3465 return c.header_ 3466} 3467 3468func (c *ProjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 3469 reqHeaders := make(http.Header) 3470 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3471 for k, v := range c.header_ { 3472 reqHeaders[k] = v 3473 } 3474 reqHeaders.Set("User-Agent", c.s.userAgent()) 3475 var body io.Reader = nil 3476 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 3477 if err != nil { 3478 return nil, err 3479 } 3480 reqHeaders.Set("Content-Type", "application/json") 3481 c.urlParams_.Set("alt", alt) 3482 c.urlParams_.Set("prettyPrint", "false") 3483 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{resource}:setIamPolicy") 3484 urls += "?" + c.urlParams_.Encode() 3485 req, err := http.NewRequest("POST", urls, body) 3486 if err != nil { 3487 return nil, err 3488 } 3489 req.Header = reqHeaders 3490 googleapi.Expand(req.URL, map[string]string{ 3491 "resource": c.resource, 3492 }) 3493 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3494} 3495 3496// Do executes the "cloudresourcemanager.projects.setIamPolicy" call. 3497// Exactly one of *Policy or error will be non-nil. Any non-2xx status 3498// code is an error. Response headers are in either 3499// *Policy.ServerResponse.Header or (if a response was returned at all) 3500// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3501// check whether the returned error was because http.StatusNotModified 3502// was returned. 3503func (c *ProjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 3504 gensupport.SetOptions(c.urlParams_, opts...) 3505 res, err := c.doRequest("json") 3506 if res != nil && res.StatusCode == http.StatusNotModified { 3507 if res.Body != nil { 3508 res.Body.Close() 3509 } 3510 return nil, &googleapi.Error{ 3511 Code: res.StatusCode, 3512 Header: res.Header, 3513 } 3514 } 3515 if err != nil { 3516 return nil, err 3517 } 3518 defer googleapi.CloseBody(res) 3519 if err := googleapi.CheckResponse(res); err != nil { 3520 return nil, err 3521 } 3522 ret := &Policy{ 3523 ServerResponse: googleapi.ServerResponse{ 3524 Header: res.Header, 3525 HTTPStatusCode: res.StatusCode, 3526 }, 3527 } 3528 target := &ret 3529 if err := gensupport.DecodeResponse(target, res); err != nil { 3530 return nil, err 3531 } 3532 return ret, nil 3533 // { 3534 // "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. 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. + Invitations to grant the owner role cannot be sent using `setIamPolicy()`; they must be sent only using the Cloud Platform Console. + 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", 3535 // "flatPath": "v1beta1/projects/{resource}:setIamPolicy", 3536 // "httpMethod": "POST", 3537 // "id": "cloudresourcemanager.projects.setIamPolicy", 3538 // "parameterOrder": [ 3539 // "resource" 3540 // ], 3541 // "parameters": { 3542 // "resource": { 3543 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 3544 // "location": "path", 3545 // "required": true, 3546 // "type": "string" 3547 // } 3548 // }, 3549 // "path": "v1beta1/projects/{resource}:setIamPolicy", 3550 // "request": { 3551 // "$ref": "SetIamPolicyRequest" 3552 // }, 3553 // "response": { 3554 // "$ref": "Policy" 3555 // }, 3556 // "scopes": [ 3557 // "https://www.googleapis.com/auth/cloud-platform" 3558 // ] 3559 // } 3560 3561} 3562 3563// method id "cloudresourcemanager.projects.testIamPermissions": 3564 3565type ProjectsTestIamPermissionsCall struct { 3566 s *Service 3567 resource string 3568 testiampermissionsrequest *TestIamPermissionsRequest 3569 urlParams_ gensupport.URLParams 3570 ctx_ context.Context 3571 header_ http.Header 3572} 3573 3574// TestIamPermissions: Returns permissions that a caller has on the 3575// specified Project. 3576// 3577// - resource: REQUIRED: The resource for which the policy detail is 3578// being requested. See the operation documentation for the 3579// appropriate value for this field. 3580func (r *ProjectsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsTestIamPermissionsCall { 3581 c := &ProjectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3582 c.resource = resource 3583 c.testiampermissionsrequest = testiampermissionsrequest 3584 return c 3585} 3586 3587// Fields allows partial responses to be retrieved. See 3588// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3589// for more information. 3590func (c *ProjectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsTestIamPermissionsCall { 3591 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3592 return c 3593} 3594 3595// Context sets the context to be used in this call's Do method. Any 3596// pending HTTP request will be aborted if the provided context is 3597// canceled. 3598func (c *ProjectsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsTestIamPermissionsCall { 3599 c.ctx_ = ctx 3600 return c 3601} 3602 3603// Header returns an http.Header that can be modified by the caller to 3604// add HTTP headers to the request. 3605func (c *ProjectsTestIamPermissionsCall) Header() http.Header { 3606 if c.header_ == nil { 3607 c.header_ = make(http.Header) 3608 } 3609 return c.header_ 3610} 3611 3612func (c *ProjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 3613 reqHeaders := make(http.Header) 3614 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3615 for k, v := range c.header_ { 3616 reqHeaders[k] = v 3617 } 3618 reqHeaders.Set("User-Agent", c.s.userAgent()) 3619 var body io.Reader = nil 3620 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 3621 if err != nil { 3622 return nil, err 3623 } 3624 reqHeaders.Set("Content-Type", "application/json") 3625 c.urlParams_.Set("alt", alt) 3626 c.urlParams_.Set("prettyPrint", "false") 3627 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{resource}:testIamPermissions") 3628 urls += "?" + c.urlParams_.Encode() 3629 req, err := http.NewRequest("POST", urls, body) 3630 if err != nil { 3631 return nil, err 3632 } 3633 req.Header = reqHeaders 3634 googleapi.Expand(req.URL, map[string]string{ 3635 "resource": c.resource, 3636 }) 3637 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3638} 3639 3640// Do executes the "cloudresourcemanager.projects.testIamPermissions" call. 3641// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 3642// Any non-2xx status code is an error. Response headers are in either 3643// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 3644// was returned at all) in error.(*googleapi.Error).Header. Use 3645// googleapi.IsNotModified to check whether the returned error was 3646// because http.StatusNotModified was returned. 3647func (c *ProjectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 3648 gensupport.SetOptions(c.urlParams_, opts...) 3649 res, err := c.doRequest("json") 3650 if res != nil && res.StatusCode == http.StatusNotModified { 3651 if res.Body != nil { 3652 res.Body.Close() 3653 } 3654 return nil, &googleapi.Error{ 3655 Code: res.StatusCode, 3656 Header: res.Header, 3657 } 3658 } 3659 if err != nil { 3660 return nil, err 3661 } 3662 defer googleapi.CloseBody(res) 3663 if err := googleapi.CheckResponse(res); err != nil { 3664 return nil, err 3665 } 3666 ret := &TestIamPermissionsResponse{ 3667 ServerResponse: googleapi.ServerResponse{ 3668 Header: res.Header, 3669 HTTPStatusCode: res.StatusCode, 3670 }, 3671 } 3672 target := &ret 3673 if err := gensupport.DecodeResponse(target, res); err != nil { 3674 return nil, err 3675 } 3676 return ret, nil 3677 // { 3678 // "description": "Returns permissions that a caller has on the specified Project.", 3679 // "flatPath": "v1beta1/projects/{resource}:testIamPermissions", 3680 // "httpMethod": "POST", 3681 // "id": "cloudresourcemanager.projects.testIamPermissions", 3682 // "parameterOrder": [ 3683 // "resource" 3684 // ], 3685 // "parameters": { 3686 // "resource": { 3687 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 3688 // "location": "path", 3689 // "required": true, 3690 // "type": "string" 3691 // } 3692 // }, 3693 // "path": "v1beta1/projects/{resource}:testIamPermissions", 3694 // "request": { 3695 // "$ref": "TestIamPermissionsRequest" 3696 // }, 3697 // "response": { 3698 // "$ref": "TestIamPermissionsResponse" 3699 // }, 3700 // "scopes": [ 3701 // "https://www.googleapis.com/auth/cloud-platform", 3702 // "https://www.googleapis.com/auth/cloud-platform.read-only" 3703 // ] 3704 // } 3705 3706} 3707 3708// method id "cloudresourcemanager.projects.undelete": 3709 3710type ProjectsUndeleteCall struct { 3711 s *Service 3712 projectId string 3713 undeleteprojectrequest *UndeleteProjectRequest 3714 urlParams_ gensupport.URLParams 3715 ctx_ context.Context 3716 header_ http.Header 3717} 3718 3719// Undelete: Restores the Project identified by the specified 3720// `project_id` (for example, `my-project-123`). You can only use this 3721// method for a Project that has a lifecycle state of DELETE_REQUESTED. 3722// After deletion starts, the Project cannot be restored. The caller 3723// must have undelete permissions for this Project. 3724// 3725// - projectId: The project ID (for example, `foo-bar-123`). 3726func (r *ProjectsService) Undelete(projectId string, undeleteprojectrequest *UndeleteProjectRequest) *ProjectsUndeleteCall { 3727 c := &ProjectsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3728 c.projectId = projectId 3729 c.undeleteprojectrequest = undeleteprojectrequest 3730 return c 3731} 3732 3733// Fields allows partial responses to be retrieved. See 3734// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3735// for more information. 3736func (c *ProjectsUndeleteCall) Fields(s ...googleapi.Field) *ProjectsUndeleteCall { 3737 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3738 return c 3739} 3740 3741// Context sets the context to be used in this call's Do method. Any 3742// pending HTTP request will be aborted if the provided context is 3743// canceled. 3744func (c *ProjectsUndeleteCall) Context(ctx context.Context) *ProjectsUndeleteCall { 3745 c.ctx_ = ctx 3746 return c 3747} 3748 3749// Header returns an http.Header that can be modified by the caller to 3750// add HTTP headers to the request. 3751func (c *ProjectsUndeleteCall) Header() http.Header { 3752 if c.header_ == nil { 3753 c.header_ = make(http.Header) 3754 } 3755 return c.header_ 3756} 3757 3758func (c *ProjectsUndeleteCall) doRequest(alt string) (*http.Response, error) { 3759 reqHeaders := make(http.Header) 3760 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3761 for k, v := range c.header_ { 3762 reqHeaders[k] = v 3763 } 3764 reqHeaders.Set("User-Agent", c.s.userAgent()) 3765 var body io.Reader = nil 3766 body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteprojectrequest) 3767 if err != nil { 3768 return nil, err 3769 } 3770 reqHeaders.Set("Content-Type", "application/json") 3771 c.urlParams_.Set("alt", alt) 3772 c.urlParams_.Set("prettyPrint", "false") 3773 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}:undelete") 3774 urls += "?" + c.urlParams_.Encode() 3775 req, err := http.NewRequest("POST", urls, body) 3776 if err != nil { 3777 return nil, err 3778 } 3779 req.Header = reqHeaders 3780 googleapi.Expand(req.URL, map[string]string{ 3781 "projectId": c.projectId, 3782 }) 3783 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3784} 3785 3786// Do executes the "cloudresourcemanager.projects.undelete" call. 3787// Exactly one of *Empty or error will be non-nil. Any non-2xx status 3788// code is an error. Response headers are in either 3789// *Empty.ServerResponse.Header or (if a response was returned at all) 3790// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3791// check whether the returned error was because http.StatusNotModified 3792// was returned. 3793func (c *ProjectsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 3794 gensupport.SetOptions(c.urlParams_, opts...) 3795 res, err := c.doRequest("json") 3796 if res != nil && res.StatusCode == http.StatusNotModified { 3797 if res.Body != nil { 3798 res.Body.Close() 3799 } 3800 return nil, &googleapi.Error{ 3801 Code: res.StatusCode, 3802 Header: res.Header, 3803 } 3804 } 3805 if err != nil { 3806 return nil, err 3807 } 3808 defer googleapi.CloseBody(res) 3809 if err := googleapi.CheckResponse(res); err != nil { 3810 return nil, err 3811 } 3812 ret := &Empty{ 3813 ServerResponse: googleapi.ServerResponse{ 3814 Header: res.Header, 3815 HTTPStatusCode: res.StatusCode, 3816 }, 3817 } 3818 target := &ret 3819 if err := gensupport.DecodeResponse(target, res); err != nil { 3820 return nil, err 3821 } 3822 return ret, nil 3823 // { 3824 // "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.", 3825 // "flatPath": "v1beta1/projects/{projectId}:undelete", 3826 // "httpMethod": "POST", 3827 // "id": "cloudresourcemanager.projects.undelete", 3828 // "parameterOrder": [ 3829 // "projectId" 3830 // ], 3831 // "parameters": { 3832 // "projectId": { 3833 // "description": "Required. The project ID (for example, `foo-bar-123`).", 3834 // "location": "path", 3835 // "required": true, 3836 // "type": "string" 3837 // } 3838 // }, 3839 // "path": "v1beta1/projects/{projectId}:undelete", 3840 // "request": { 3841 // "$ref": "UndeleteProjectRequest" 3842 // }, 3843 // "response": { 3844 // "$ref": "Empty" 3845 // }, 3846 // "scopes": [ 3847 // "https://www.googleapis.com/auth/cloud-platform" 3848 // ] 3849 // } 3850 3851} 3852 3853// method id "cloudresourcemanager.projects.update": 3854 3855type ProjectsUpdateCall struct { 3856 s *Service 3857 projectId string 3858 project *Project 3859 urlParams_ gensupport.URLParams 3860 ctx_ context.Context 3861 header_ http.Header 3862} 3863 3864// Update: Updates the attributes of the Project identified by the 3865// specified `project_id` (for example, `my-project-123`). The caller 3866// must have modify permissions for this Project. 3867// 3868// - projectId: The project ID (for example, `my-project-123`). 3869func (r *ProjectsService) Update(projectId string, project *Project) *ProjectsUpdateCall { 3870 c := &ProjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3871 c.projectId = projectId 3872 c.project = project 3873 return c 3874} 3875 3876// Fields allows partial responses to be retrieved. See 3877// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3878// for more information. 3879func (c *ProjectsUpdateCall) Fields(s ...googleapi.Field) *ProjectsUpdateCall { 3880 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3881 return c 3882} 3883 3884// Context sets the context to be used in this call's Do method. Any 3885// pending HTTP request will be aborted if the provided context is 3886// canceled. 3887func (c *ProjectsUpdateCall) Context(ctx context.Context) *ProjectsUpdateCall { 3888 c.ctx_ = ctx 3889 return c 3890} 3891 3892// Header returns an http.Header that can be modified by the caller to 3893// add HTTP headers to the request. 3894func (c *ProjectsUpdateCall) Header() http.Header { 3895 if c.header_ == nil { 3896 c.header_ = make(http.Header) 3897 } 3898 return c.header_ 3899} 3900 3901func (c *ProjectsUpdateCall) doRequest(alt string) (*http.Response, error) { 3902 reqHeaders := make(http.Header) 3903 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3904 for k, v := range c.header_ { 3905 reqHeaders[k] = v 3906 } 3907 reqHeaders.Set("User-Agent", c.s.userAgent()) 3908 var body io.Reader = nil 3909 body, err := googleapi.WithoutDataWrapper.JSONReader(c.project) 3910 if err != nil { 3911 return nil, err 3912 } 3913 reqHeaders.Set("Content-Type", "application/json") 3914 c.urlParams_.Set("alt", alt) 3915 c.urlParams_.Set("prettyPrint", "false") 3916 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}") 3917 urls += "?" + c.urlParams_.Encode() 3918 req, err := http.NewRequest("PUT", urls, body) 3919 if err != nil { 3920 return nil, err 3921 } 3922 req.Header = reqHeaders 3923 googleapi.Expand(req.URL, map[string]string{ 3924 "projectId": c.projectId, 3925 }) 3926 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3927} 3928 3929// Do executes the "cloudresourcemanager.projects.update" call. 3930// Exactly one of *Project or error will be non-nil. Any non-2xx status 3931// code is an error. Response headers are in either 3932// *Project.ServerResponse.Header or (if a response was returned at all) 3933// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3934// check whether the returned error was because http.StatusNotModified 3935// was returned. 3936func (c *ProjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Project, error) { 3937 gensupport.SetOptions(c.urlParams_, opts...) 3938 res, err := c.doRequest("json") 3939 if res != nil && res.StatusCode == http.StatusNotModified { 3940 if res.Body != nil { 3941 res.Body.Close() 3942 } 3943 return nil, &googleapi.Error{ 3944 Code: res.StatusCode, 3945 Header: res.Header, 3946 } 3947 } 3948 if err != nil { 3949 return nil, err 3950 } 3951 defer googleapi.CloseBody(res) 3952 if err := googleapi.CheckResponse(res); err != nil { 3953 return nil, err 3954 } 3955 ret := &Project{ 3956 ServerResponse: googleapi.ServerResponse{ 3957 Header: res.Header, 3958 HTTPStatusCode: res.StatusCode, 3959 }, 3960 } 3961 target := &ret 3962 if err := gensupport.DecodeResponse(target, res); err != nil { 3963 return nil, err 3964 } 3965 return ret, nil 3966 // { 3967 // "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.", 3968 // "flatPath": "v1beta1/projects/{projectId}", 3969 // "httpMethod": "PUT", 3970 // "id": "cloudresourcemanager.projects.update", 3971 // "parameterOrder": [ 3972 // "projectId" 3973 // ], 3974 // "parameters": { 3975 // "projectId": { 3976 // "description": "The project ID (for example, `my-project-123`).", 3977 // "location": "path", 3978 // "required": true, 3979 // "type": "string" 3980 // } 3981 // }, 3982 // "path": "v1beta1/projects/{projectId}", 3983 // "request": { 3984 // "$ref": "Project" 3985 // }, 3986 // "response": { 3987 // "$ref": "Project" 3988 // }, 3989 // "scopes": [ 3990 // "https://www.googleapis.com/auth/cloud-platform" 3991 // ] 3992 // } 3993 3994} 3995