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