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/v2" 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/v2" 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:v2" 79const apiName = "cloudresourcemanager" 80const apiVersion = "v2" 81const basePath = "https://cloudresourcemanager.googleapis.com/" 82const mtlsBasePath = "https://cloudresourcemanager.mtls.googleapis.com/" 83 84// OAuth2 scopes used by this API. 85const ( 86 // See, edit, configure, and delete your Google Cloud data and see the 87 // email address for your Google Account. 88 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 89 90 // View your data across Google Cloud services and see the email address 91 // of your Google Account 92 CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" 93) 94 95// NewService creates a new Service. 96func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 97 scopesOption := option.WithScopes( 98 "https://www.googleapis.com/auth/cloud-platform", 99 "https://www.googleapis.com/auth/cloud-platform.read-only", 100 ) 101 // NOTE: prepend, so we don't override user-specified scopes. 102 opts = append([]option.ClientOption{scopesOption}, opts...) 103 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 104 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 105 client, endpoint, err := htransport.NewClient(ctx, opts...) 106 if err != nil { 107 return nil, err 108 } 109 s, err := New(client) 110 if err != nil { 111 return nil, err 112 } 113 if endpoint != "" { 114 s.BasePath = endpoint 115 } 116 return s, nil 117} 118 119// New creates a new Service. It uses the provided http.Client for requests. 120// 121// Deprecated: please use NewService instead. 122// To provide a custom HTTP client, use option.WithHTTPClient. 123// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 124func New(client *http.Client) (*Service, error) { 125 if client == nil { 126 return nil, errors.New("client is nil") 127 } 128 s := &Service{client: client, BasePath: basePath} 129 s.Folders = NewFoldersService(s) 130 s.Operations = NewOperationsService(s) 131 return s, nil 132} 133 134type Service struct { 135 client *http.Client 136 BasePath string // API endpoint base URL 137 UserAgent string // optional additional User-Agent fragment 138 139 Folders *FoldersService 140 141 Operations *OperationsService 142} 143 144func (s *Service) userAgent() string { 145 if s.UserAgent == "" { 146 return googleapi.UserAgent 147 } 148 return googleapi.UserAgent + " " + s.UserAgent 149} 150 151func NewFoldersService(s *Service) *FoldersService { 152 rs := &FoldersService{s: s} 153 return rs 154} 155 156type FoldersService struct { 157 s *Service 158} 159 160func NewOperationsService(s *Service) *OperationsService { 161 rs := &OperationsService{s: s} 162 return rs 163} 164 165type OperationsService struct { 166 s *Service 167} 168 169// AuditConfig: Specifies the audit configuration for a service. The 170// configuration determines which permission types are logged, and what 171// identities, if any, are exempted from logging. An AuditConfig must 172// have one or more AuditLogConfigs. If there are AuditConfigs for both 173// `allServices` and a specific service, the union of the two 174// AuditConfigs is used for that service: the log_types specified in 175// each AuditConfig are enabled, and the exempted_members in each 176// AuditLogConfig are exempted. Example Policy with multiple 177// AuditConfigs: { "audit_configs": [ { "service": "allServices", 178// "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": 179// [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { 180// "log_type": "ADMIN_READ" } ] }, { "service": 181// "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": 182// "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ 183// "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy 184// enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts 185// jose@example.com from DATA_READ logging, and aliya@example.com from 186// DATA_WRITE logging. 187type AuditConfig struct { 188 // AuditLogConfigs: The configuration for logging of each type of 189 // permission. 190 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"` 191 192 // Service: Specifies a service that will be enabled for audit logging. 193 // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. 194 // `allServices` is a special value that covers all services. 195 Service string `json:"service,omitempty"` 196 197 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to 198 // unconditionally include in API requests. By default, fields with 199 // empty or default values are omitted from API requests. However, any 200 // non-pointer, non-interface field appearing in ForceSendFields will be 201 // sent to the server regardless of whether the field is empty or not. 202 // This may be used to include empty fields in Patch requests. 203 ForceSendFields []string `json:"-"` 204 205 // NullFields is a list of field names (e.g. "AuditLogConfigs") to 206 // include in API requests with the JSON null value. By default, fields 207 // with empty values are omitted from API requests. However, any field 208 // with an empty value appearing in NullFields will be sent to the 209 // server as null. It is an error if a field in this list has a 210 // non-empty value. This may be used to include null fields in Patch 211 // requests. 212 NullFields []string `json:"-"` 213} 214 215func (s *AuditConfig) MarshalJSON() ([]byte, error) { 216 type NoMethod AuditConfig 217 raw := NoMethod(*s) 218 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 219} 220 221// AuditLogConfig: Provides the configuration for logging a type of 222// permissions. Example: { "audit_log_configs": [ { "log_type": 223// "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { 224// "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and 225// 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ 226// logging. 227type AuditLogConfig struct { 228 // ExemptedMembers: Specifies the identities that do not cause logging 229 // for this type of permission. Follows the same format of 230 // Binding.members. 231 ExemptedMembers []string `json:"exemptedMembers,omitempty"` 232 233 // LogType: The log type that this config enables. 234 // 235 // Possible values: 236 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this. 237 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy 238 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create 239 // "DATA_READ" - Data reads. Example: CloudSQL Users list 240 LogType string `json:"logType,omitempty"` 241 242 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to 243 // unconditionally include in API requests. By default, fields with 244 // empty or default values are omitted from API requests. However, any 245 // non-pointer, non-interface field appearing in ForceSendFields will be 246 // sent to the server regardless of whether the field is empty or not. 247 // This may be used to include empty fields in Patch requests. 248 ForceSendFields []string `json:"-"` 249 250 // NullFields is a list of field names (e.g. "ExemptedMembers") to 251 // include in API requests with the JSON null value. By default, fields 252 // with empty values are omitted from API requests. However, any field 253 // with an empty value appearing in NullFields will be sent to the 254 // server as null. It is an error if a field in this list has a 255 // non-empty value. This may be used to include null fields in Patch 256 // requests. 257 NullFields []string `json:"-"` 258} 259 260func (s *AuditLogConfig) MarshalJSON() ([]byte, error) { 261 type NoMethod AuditLogConfig 262 raw := NoMethod(*s) 263 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 264} 265 266// Binding: Associates `members`, or principals, with a `role`. 267type Binding struct { 268 // Condition: The condition that is associated with this binding. If the 269 // condition evaluates to `true`, then this binding applies to the 270 // current request. If the condition evaluates to `false`, then this 271 // binding does not apply to the current request. However, a different 272 // role binding might grant the same role to one or more of the 273 // principals in this binding. To learn which resources support 274 // conditions in their IAM policies, see the IAM documentation 275 // (https://cloud.google.com/iam/help/conditions/resource-policies). 276 Condition *Expr `json:"condition,omitempty"` 277 278 // Members: Specifies the principals requesting access for a Cloud 279 // Platform resource. `members` can have the following values: * 280 // `allUsers`: A special identifier that represents anyone who is on the 281 // internet; with or without a Google account. * 282 // `allAuthenticatedUsers`: A special identifier that represents anyone 283 // who is authenticated with a Google account or a service account. * 284 // `user:{emailid}`: An email address that represents a specific Google 285 // account. For example, `alice@example.com` . * 286 // `serviceAccount:{emailid}`: An email address that represents a 287 // service account. For example, 288 // `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An 289 // email address that represents a Google group. For example, 290 // `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An 291 // email address (plus unique identifier) representing a user that has 292 // been recently deleted. For example, 293 // `alice@example.com?uid=123456789012345678901`. If the user is 294 // recovered, this value reverts to `user:{emailid}` and the recovered 295 // user retains the role in the binding. * 296 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address 297 // (plus unique identifier) representing a service account that has been 298 // recently deleted. For example, 299 // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. 300 // If the service account is undeleted, this value reverts to 301 // `serviceAccount:{emailid}` and the undeleted service account retains 302 // the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: 303 // An email address (plus unique identifier) representing a Google group 304 // that has been recently deleted. For example, 305 // `admins@example.com?uid=123456789012345678901`. If the group is 306 // recovered, this value reverts to `group:{emailid}` and the recovered 307 // group retains the role in the binding. * `domain:{domain}`: The G 308 // Suite domain (primary) that represents all the users of that domain. 309 // For example, `google.com` or `example.com`. 310 Members []string `json:"members,omitempty"` 311 312 // Role: Role that is assigned to the list of `members`, or principals. 313 // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 314 Role string `json:"role,omitempty"` 315 316 // ForceSendFields is a list of field names (e.g. "Condition") to 317 // unconditionally include in API requests. By default, fields with 318 // empty or default values are omitted from API requests. However, any 319 // non-pointer, non-interface field appearing in ForceSendFields will be 320 // sent to the server regardless of whether the field is empty or not. 321 // This may be used to include empty fields in Patch requests. 322 ForceSendFields []string `json:"-"` 323 324 // NullFields is a list of field names (e.g. "Condition") to include in 325 // API requests with the JSON null value. By default, fields with empty 326 // values are omitted from API requests. However, any field with an 327 // empty value appearing in NullFields will be sent to the server as 328 // null. It is an error if a field in this list has a non-empty value. 329 // This may be used to include null fields in Patch requests. 330 NullFields []string `json:"-"` 331} 332 333func (s *Binding) MarshalJSON() ([]byte, error) { 334 type NoMethod Binding 335 raw := NoMethod(*s) 336 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 337} 338 339// CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation: 340// Metadata describing a long running folder operation 341type CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation struct { 342 // DestinationParent: The resource name of the folder or organization we 343 // are either creating the folder under or moving the folder to. 344 DestinationParent string `json:"destinationParent,omitempty"` 345 346 // DisplayName: The display name of the folder. 347 DisplayName string `json:"displayName,omitempty"` 348 349 // OperationType: The type of this operation. 350 // 351 // Possible values: 352 // "OPERATION_TYPE_UNSPECIFIED" - Operation type not specified. 353 // "CREATE" - A create folder operation. 354 // "MOVE" - A move folder operation. 355 OperationType string `json:"operationType,omitempty"` 356 357 // SourceParent: The resource name of the folder's parent. Only 358 // applicable when the operation_type is MOVE. 359 SourceParent string `json:"sourceParent,omitempty"` 360 361 // ForceSendFields is a list of field names (e.g. "DestinationParent") 362 // to unconditionally include in API requests. By default, fields with 363 // empty or default values are omitted from API requests. However, any 364 // non-pointer, non-interface field appearing in ForceSendFields will be 365 // sent to the server regardless of whether the field is empty or not. 366 // This may be used to include empty fields in Patch requests. 367 ForceSendFields []string `json:"-"` 368 369 // NullFields is a list of field names (e.g. "DestinationParent") to 370 // include in API requests with the JSON null value. By default, fields 371 // with empty values are omitted from API requests. However, any field 372 // with an empty value appearing in NullFields will be sent to the 373 // server as null. It is an error if a field in this list has a 374 // non-empty value. This may be used to include null fields in Patch 375 // requests. 376 NullFields []string `json:"-"` 377} 378 379func (s *CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation) MarshalJSON() ([]byte, error) { 380 type NoMethod CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation 381 raw := NoMethod(*s) 382 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 383} 384 385// CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation: 386// Metadata describing a long running folder operation 387type CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation struct { 388 // DestinationParent: The resource name of the folder or organization we 389 // are either creating the folder under or moving the folder to. 390 DestinationParent string `json:"destinationParent,omitempty"` 391 392 // DisplayName: The display name of the folder. 393 DisplayName string `json:"displayName,omitempty"` 394 395 // OperationType: The type of this operation. 396 // 397 // Possible values: 398 // "OPERATION_TYPE_UNSPECIFIED" - Operation type not specified. 399 // "CREATE" - A create folder operation. 400 // "MOVE" - A move folder operation. 401 OperationType string `json:"operationType,omitempty"` 402 403 // SourceParent: The resource name of the folder's parent. Only 404 // applicable when the operation_type is MOVE. 405 SourceParent string `json:"sourceParent,omitempty"` 406 407 // ForceSendFields is a list of field names (e.g. "DestinationParent") 408 // to unconditionally include in API requests. By default, fields with 409 // empty or default values are omitted from API requests. However, any 410 // non-pointer, non-interface field appearing in ForceSendFields will be 411 // sent to the server regardless of whether the field is empty or not. 412 // This may be used to include empty fields in Patch requests. 413 ForceSendFields []string `json:"-"` 414 415 // NullFields is a list of field names (e.g. "DestinationParent") to 416 // include in API requests with the JSON null value. By default, fields 417 // with empty values are omitted from API requests. However, any field 418 // with an empty value appearing in NullFields will be sent to the 419 // server as null. It is an error if a field in this list has a 420 // non-empty value. This may be used to include null fields in Patch 421 // requests. 422 NullFields []string `json:"-"` 423} 424 425func (s *CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation) MarshalJSON() ([]byte, error) { 426 type NoMethod CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation 427 raw := NoMethod(*s) 428 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 429} 430 431// CreateFolderMetadata: Metadata pertaining to the Folder creation 432// process. 433type CreateFolderMetadata struct { 434 // DisplayName: The display name of the folder. 435 DisplayName string `json:"displayName,omitempty"` 436 437 // Parent: The resource name of the folder or organization we are 438 // creating the folder under. 439 Parent string `json:"parent,omitempty"` 440 441 // ForceSendFields is a list of field names (e.g. "DisplayName") to 442 // unconditionally include in API requests. By default, fields with 443 // empty or default values are omitted from API requests. However, any 444 // non-pointer, non-interface field appearing in ForceSendFields will be 445 // sent to the server regardless of whether the field is empty or not. 446 // This may be used to include empty fields in Patch requests. 447 ForceSendFields []string `json:"-"` 448 449 // NullFields is a list of field names (e.g. "DisplayName") to include 450 // in API requests with the JSON null value. By default, fields with 451 // empty values are omitted from API requests. However, any field with 452 // an empty value appearing in NullFields will be sent to the server as 453 // null. It is an error if a field in this list has a non-empty value. 454 // This may be used to include null fields in Patch requests. 455 NullFields []string `json:"-"` 456} 457 458func (s *CreateFolderMetadata) MarshalJSON() ([]byte, error) { 459 type NoMethod CreateFolderMetadata 460 raw := NoMethod(*s) 461 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 462} 463 464// CreateProjectMetadata: A status object which is used as the 465// `metadata` field for the Operation returned by CreateProject. It 466// provides insight for when significant phases of Project creation have 467// completed. 468type CreateProjectMetadata struct { 469 // CreateTime: Creation time of the project creation workflow. 470 CreateTime string `json:"createTime,omitempty"` 471 472 // Gettable: True if the project can be retrieved using `GetProject`. No 473 // other operations on the project are guaranteed to work until the 474 // project creation is complete. 475 Gettable bool `json:"gettable,omitempty"` 476 477 // Ready: True if the project creation process is complete. 478 Ready bool `json:"ready,omitempty"` 479 480 // ForceSendFields is a list of field names (e.g. "CreateTime") to 481 // unconditionally include in API requests. By default, fields with 482 // empty or default values are omitted from API requests. However, any 483 // non-pointer, non-interface field appearing in ForceSendFields will be 484 // sent to the server regardless of whether the field is empty or not. 485 // This may be used to include empty fields in Patch requests. 486 ForceSendFields []string `json:"-"` 487 488 // NullFields is a list of field names (e.g. "CreateTime") to include in 489 // API requests with the JSON null value. By default, fields with empty 490 // values are omitted from API requests. However, any field with an 491 // empty value appearing in NullFields will be sent to the server as 492 // null. It is an error if a field in this list has a non-empty value. 493 // This may be used to include null fields in Patch requests. 494 NullFields []string `json:"-"` 495} 496 497func (s *CreateProjectMetadata) MarshalJSON() ([]byte, error) { 498 type NoMethod CreateProjectMetadata 499 raw := NoMethod(*s) 500 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 501} 502 503// CreateTagBindingMetadata: Runtime operation information for creating 504// a TagValue. 505type CreateTagBindingMetadata struct { 506} 507 508// CreateTagKeyMetadata: Runtime operation information for creating a 509// TagKey. 510type CreateTagKeyMetadata struct { 511} 512 513// CreateTagValueMetadata: Runtime operation information for creating a 514// TagValue. 515type CreateTagValueMetadata struct { 516} 517 518// DeleteFolderMetadata: A status object which is used as the `metadata` 519// field for the `Operation` returned by `DeleteFolder`. 520type DeleteFolderMetadata struct { 521} 522 523// DeleteOrganizationMetadata: A status object which is used as the 524// `metadata` field for the operation returned by DeleteOrganization. 525type DeleteOrganizationMetadata struct { 526} 527 528// DeleteProjectMetadata: A status object which is used as the 529// `metadata` field for the Operation returned by `DeleteProject`. 530type DeleteProjectMetadata struct { 531} 532 533// DeleteTagBindingMetadata: Runtime operation information for deleting 534// a TagBinding. 535type DeleteTagBindingMetadata struct { 536} 537 538// DeleteTagKeyMetadata: Runtime operation information for deleting a 539// TagKey. 540type DeleteTagKeyMetadata struct { 541} 542 543// DeleteTagValueMetadata: Runtime operation information for deleting a 544// TagValue. 545type DeleteTagValueMetadata struct { 546} 547 548// Expr: Represents a textual expression in the Common Expression 549// Language (CEL) syntax. CEL is a C-like expression language. The 550// syntax and semantics of CEL are documented at 551// https://github.com/google/cel-spec. Example (Comparison): title: 552// "Summary size limit" description: "Determines if a summary is less 553// than 100 chars" expression: "document.summary.size() < 100" Example 554// (Equality): title: "Requestor is owner" description: "Determines if 555// requestor is the document owner" expression: "document.owner == 556// request.auth.claims.email" Example (Logic): title: "Public documents" 557// description: "Determine whether the document should be publicly 558// visible" expression: "document.type != 'private' && document.type != 559// 'internal'" Example (Data Manipulation): title: "Notification string" 560// description: "Create a notification string with a timestamp." 561// expression: "'New message received at ' + 562// string(document.create_time)" The exact variables and functions that 563// may be referenced within an expression are determined by the service 564// that evaluates it. See the service documentation for additional 565// information. 566type Expr struct { 567 // Description: Optional. Description of the expression. This is a 568 // longer text which describes the expression, e.g. when hovered over it 569 // in a UI. 570 Description string `json:"description,omitempty"` 571 572 // Expression: Textual representation of an expression in Common 573 // Expression Language syntax. 574 Expression string `json:"expression,omitempty"` 575 576 // Location: Optional. String indicating the location of the expression 577 // for error reporting, e.g. a file name and a position in the file. 578 Location string `json:"location,omitempty"` 579 580 // Title: Optional. Title for the expression, i.e. a short string 581 // describing its purpose. This can be used e.g. in UIs which allow to 582 // enter the expression. 583 Title string `json:"title,omitempty"` 584 585 // ForceSendFields is a list of field names (e.g. "Description") to 586 // unconditionally include in API requests. By default, fields with 587 // empty or default values are omitted from API requests. However, any 588 // non-pointer, non-interface field appearing in ForceSendFields will be 589 // sent to the server regardless of whether the field is empty or not. 590 // This may be used to include empty fields in Patch requests. 591 ForceSendFields []string `json:"-"` 592 593 // NullFields is a list of field names (e.g. "Description") to include 594 // in API requests with the JSON null value. By default, fields with 595 // empty values are omitted from API requests. However, any field with 596 // an empty value appearing in NullFields will be sent to the server as 597 // null. It is an error if a field in this list has a non-empty value. 598 // This may be used to include null fields in Patch requests. 599 NullFields []string `json:"-"` 600} 601 602func (s *Expr) MarshalJSON() ([]byte, error) { 603 type NoMethod Expr 604 raw := NoMethod(*s) 605 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 606} 607 608// Folder: A Folder in an Organization's resource hierarchy, used to 609// organize that Organization's resources. 610type Folder struct { 611 // CreateTime: Output only. Timestamp when the Folder was created. 612 // Assigned by the server. 613 CreateTime string `json:"createTime,omitempty"` 614 615 // DisplayName: The folder's display name. A folder's display name must 616 // be unique amongst its siblings, e.g. no two folders with the same 617 // parent can share the same display name. The display name must start 618 // and end with a letter or digit, may contain letters, digits, spaces, 619 // hyphens and underscores and can be no longer than 30 characters. This 620 // is captured by the regular expression: `[\p{L}\p{N}]([\p{L}\p{N}_- 621 // ]{0,28}[\p{L}\p{N}])?`. 622 DisplayName string `json:"displayName,omitempty"` 623 624 // LifecycleState: Output only. The lifecycle state of the folder. 625 // Updates to the lifecycle_state must be performed via DeleteFolder and 626 // UndeleteFolder. 627 // 628 // Possible values: 629 // "LIFECYCLE_STATE_UNSPECIFIED" - Unspecified state. 630 // "ACTIVE" - The normal and active state. 631 // "DELETE_REQUESTED" - The folder has been marked for deletion by the 632 // user. 633 LifecycleState string `json:"lifecycleState,omitempty"` 634 635 // Name: Output only. The resource name of the Folder. Its format is 636 // `folders/{folder_id}`, for example: "folders/1234". 637 Name string `json:"name,omitempty"` 638 639 // Parent: Required. The Folder's parent's resource name. Updates to the 640 // folder's parent must be performed via MoveFolder. 641 Parent string `json:"parent,omitempty"` 642 643 // ServerResponse contains the HTTP response code and headers from the 644 // server. 645 googleapi.ServerResponse `json:"-"` 646 647 // ForceSendFields is a list of field names (e.g. "CreateTime") to 648 // unconditionally include in API requests. By default, fields with 649 // empty or default values are omitted from API requests. However, any 650 // non-pointer, non-interface field appearing in ForceSendFields will be 651 // sent to the server regardless of whether the field is empty or not. 652 // This may be used to include empty fields in Patch requests. 653 ForceSendFields []string `json:"-"` 654 655 // NullFields is a list of field names (e.g. "CreateTime") to include in 656 // API requests with the JSON null value. By default, fields with empty 657 // values are omitted from API requests. However, any field with an 658 // empty value appearing in NullFields will be sent to the server as 659 // null. It is an error if a field in this list has a non-empty value. 660 // This may be used to include null fields in Patch requests. 661 NullFields []string `json:"-"` 662} 663 664func (s *Folder) MarshalJSON() ([]byte, error) { 665 type NoMethod Folder 666 raw := NoMethod(*s) 667 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 668} 669 670// FolderOperation: Metadata describing a long running folder operation 671type FolderOperation struct { 672 // DestinationParent: The resource name of the folder or organization we 673 // are either creating the folder under or moving the folder to. 674 DestinationParent string `json:"destinationParent,omitempty"` 675 676 // DisplayName: The display name of the folder. 677 DisplayName string `json:"displayName,omitempty"` 678 679 // OperationType: The type of this operation. 680 // 681 // Possible values: 682 // "OPERATION_TYPE_UNSPECIFIED" - Operation type not specified. 683 // "CREATE" - A create folder operation. 684 // "MOVE" - A move folder operation. 685 OperationType string `json:"operationType,omitempty"` 686 687 // SourceParent: The resource name of the folder's parent. Only 688 // applicable when the operation_type is MOVE. 689 SourceParent string `json:"sourceParent,omitempty"` 690 691 // ForceSendFields is a list of field names (e.g. "DestinationParent") 692 // to unconditionally include in API requests. By default, fields with 693 // empty or default values are omitted from API requests. However, any 694 // non-pointer, non-interface field appearing in ForceSendFields will be 695 // sent to the server regardless of whether the field is empty or not. 696 // This may be used to include empty fields in Patch requests. 697 ForceSendFields []string `json:"-"` 698 699 // NullFields is a list of field names (e.g. "DestinationParent") to 700 // include in API requests with the JSON null value. By default, fields 701 // with empty values are omitted from API requests. However, any field 702 // with an empty value appearing in NullFields will be sent to the 703 // server as null. It is an error if a field in this list has a 704 // non-empty value. This may be used to include null fields in Patch 705 // requests. 706 NullFields []string `json:"-"` 707} 708 709func (s *FolderOperation) MarshalJSON() ([]byte, error) { 710 type NoMethod FolderOperation 711 raw := NoMethod(*s) 712 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 713} 714 715// FolderOperationError: A classification of the Folder Operation error. 716type FolderOperationError struct { 717 // ErrorMessageId: The type of operation error experienced. 718 // 719 // Possible values: 720 // "ERROR_TYPE_UNSPECIFIED" - The error type was unrecognized or 721 // unspecified. 722 // "ACTIVE_FOLDER_HEIGHT_VIOLATION" - The attempted action would 723 // violate the max folder depth constraint. 724 // "MAX_CHILD_FOLDERS_VIOLATION" - The attempted action would violate 725 // the max child folders constraint. 726 // "FOLDER_NAME_UNIQUENESS_VIOLATION" - The attempted action would 727 // violate the locally-unique folder display_name constraint. 728 // "RESOURCE_DELETED_VIOLATION" - The resource being moved has been 729 // deleted. 730 // "PARENT_DELETED_VIOLATION" - The resource a folder was being added 731 // to has been deleted. 732 // "CYCLE_INTRODUCED_VIOLATION" - The attempted action would introduce 733 // cycle in resource path. 734 // "FOLDER_BEING_MOVED_VIOLATION" - The attempted action would move a 735 // folder that is already being moved. 736 // "FOLDER_TO_DELETE_NON_EMPTY_VIOLATION" - The folder the caller is 737 // trying to delete contains active resources. 738 // "DELETED_FOLDER_HEIGHT_VIOLATION" - The attempted action would 739 // violate the max deleted folder depth constraint. 740 ErrorMessageId string `json:"errorMessageId,omitempty"` 741 742 // ForceSendFields is a list of field names (e.g. "ErrorMessageId") to 743 // unconditionally include in API requests. By default, fields with 744 // empty or default values are omitted from API requests. However, any 745 // non-pointer, non-interface field appearing in ForceSendFields will be 746 // sent to the server regardless of whether the field is empty or not. 747 // This may be used to include empty fields in Patch requests. 748 ForceSendFields []string `json:"-"` 749 750 // NullFields is a list of field names (e.g. "ErrorMessageId") to 751 // include in API requests with the JSON null value. By default, fields 752 // with empty values are omitted from API requests. However, any field 753 // with an empty value appearing in NullFields will be sent to the 754 // server as null. It is an error if a field in this list has a 755 // non-empty value. This may be used to include null fields in Patch 756 // requests. 757 NullFields []string `json:"-"` 758} 759 760func (s *FolderOperationError) MarshalJSON() ([]byte, error) { 761 type NoMethod FolderOperationError 762 raw := NoMethod(*s) 763 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 764} 765 766// GetIamPolicyRequest: Request message for `GetIamPolicy` method. 767type GetIamPolicyRequest struct { 768 // Options: OPTIONAL: A `GetPolicyOptions` object for specifying options 769 // to `GetIamPolicy`. 770 Options *GetPolicyOptions `json:"options,omitempty"` 771 772 // ForceSendFields is a list of field names (e.g. "Options") to 773 // unconditionally include in API requests. By default, fields with 774 // empty or default values are omitted from API requests. However, any 775 // non-pointer, non-interface field appearing in ForceSendFields will be 776 // sent to the server regardless of whether the field is empty or not. 777 // This may be used to include empty fields in Patch requests. 778 ForceSendFields []string `json:"-"` 779 780 // NullFields is a list of field names (e.g. "Options") to include in 781 // API requests with the JSON null value. By default, fields with empty 782 // values are omitted from API requests. However, any field with an 783 // empty value appearing in NullFields will be sent to the server as 784 // null. It is an error if a field in this list has a non-empty value. 785 // This may be used to include null fields in Patch requests. 786 NullFields []string `json:"-"` 787} 788 789func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) { 790 type NoMethod GetIamPolicyRequest 791 raw := NoMethod(*s) 792 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 793} 794 795// GetPolicyOptions: Encapsulates settings provided to GetIamPolicy. 796type GetPolicyOptions struct { 797 // RequestedPolicyVersion: Optional. The maximum policy version that 798 // will be used to format the policy. Valid values are 0, 1, and 3. 799 // Requests specifying an invalid value will be rejected. Requests for 800 // policies with any conditional role bindings must specify version 3. 801 // Policies with no conditional role bindings may specify any valid 802 // value or leave the field unset. The policy in the response might use 803 // the policy version that you specified, or it might use a lower policy 804 // version. For example, if you specify version 3, but the policy has no 805 // conditional role bindings, the response uses version 1. To learn 806 // which resources support conditions in their IAM policies, see the IAM 807 // documentation 808 // (https://cloud.google.com/iam/help/conditions/resource-policies). 809 RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"` 810 811 // ForceSendFields is a list of field names (e.g. 812 // "RequestedPolicyVersion") to unconditionally include in API requests. 813 // By default, fields with empty or default values are omitted from API 814 // requests. However, any non-pointer, non-interface field appearing in 815 // ForceSendFields will be sent to the server regardless of whether the 816 // field is empty or not. This may be used to include empty fields in 817 // Patch requests. 818 ForceSendFields []string `json:"-"` 819 820 // NullFields is a list of field names (e.g. "RequestedPolicyVersion") 821 // to include in API requests with the JSON null value. By default, 822 // fields with empty values are omitted from API requests. However, any 823 // field with an empty value appearing in NullFields will be sent to the 824 // server as null. It is an error if a field in this list has a 825 // non-empty value. This may be used to include null fields in Patch 826 // requests. 827 NullFields []string `json:"-"` 828} 829 830func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) { 831 type NoMethod GetPolicyOptions 832 raw := NoMethod(*s) 833 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 834} 835 836// ListFoldersResponse: The ListFolders response message. 837type ListFoldersResponse struct { 838 // Folders: A possibly paginated list of Folders that are direct 839 // descendants of the specified parent resource. 840 Folders []*Folder `json:"folders,omitempty"` 841 842 // NextPageToken: A pagination token returned from a previous call to 843 // `ListFolders` that indicates from where listing should continue. 844 NextPageToken string `json:"nextPageToken,omitempty"` 845 846 // ServerResponse contains the HTTP response code and headers from the 847 // server. 848 googleapi.ServerResponse `json:"-"` 849 850 // ForceSendFields is a list of field names (e.g. "Folders") to 851 // unconditionally include in API requests. By default, fields with 852 // empty or default values are omitted from API requests. However, any 853 // non-pointer, non-interface field appearing in ForceSendFields will be 854 // sent to the server regardless of whether the field is empty or not. 855 // This may be used to include empty fields in Patch requests. 856 ForceSendFields []string `json:"-"` 857 858 // NullFields is a list of field names (e.g. "Folders") to include in 859 // API requests with the JSON null value. By default, fields with empty 860 // values are omitted from API requests. However, any field with an 861 // empty value appearing in NullFields will be sent to the server as 862 // null. It is an error if a field in this list has a non-empty value. 863 // This may be used to include null fields in Patch requests. 864 NullFields []string `json:"-"` 865} 866 867func (s *ListFoldersResponse) MarshalJSON() ([]byte, error) { 868 type NoMethod ListFoldersResponse 869 raw := NoMethod(*s) 870 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 871} 872 873// MoveFolderMetadata: Metadata pertaining to the folder move process. 874type MoveFolderMetadata struct { 875 // DestinationParent: The resource name of the folder or organization to 876 // move the folder to. 877 DestinationParent string `json:"destinationParent,omitempty"` 878 879 // DisplayName: The display name of the folder. 880 DisplayName string `json:"displayName,omitempty"` 881 882 // SourceParent: The resource name of the folder's parent. 883 SourceParent string `json:"sourceParent,omitempty"` 884 885 // ForceSendFields is a list of field names (e.g. "DestinationParent") 886 // to unconditionally include in API requests. By default, fields with 887 // empty or default values are omitted from API requests. However, any 888 // non-pointer, non-interface field appearing in ForceSendFields will be 889 // sent to the server regardless of whether the field is empty or not. 890 // This may be used to include empty fields in Patch requests. 891 ForceSendFields []string `json:"-"` 892 893 // NullFields is a list of field names (e.g. "DestinationParent") to 894 // include in API requests with the JSON null value. By default, fields 895 // with empty values are omitted from API requests. However, any field 896 // with an empty value appearing in NullFields will be sent to the 897 // server as null. It is an error if a field in this list has a 898 // non-empty value. This may be used to include null fields in Patch 899 // requests. 900 NullFields []string `json:"-"` 901} 902 903func (s *MoveFolderMetadata) MarshalJSON() ([]byte, error) { 904 type NoMethod MoveFolderMetadata 905 raw := NoMethod(*s) 906 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 907} 908 909// MoveFolderRequest: The MoveFolder request message. 910type MoveFolderRequest struct { 911 // DestinationParent: Required. The resource name of the Folder or 912 // Organization to reparent the folder under. Must be of the form 913 // `folders/{folder_id}` or `organizations/{org_id}`. 914 DestinationParent string `json:"destinationParent,omitempty"` 915 916 // ForceSendFields is a list of field names (e.g. "DestinationParent") 917 // to unconditionally include in API requests. By default, fields with 918 // empty or default values are omitted from API requests. However, any 919 // non-pointer, non-interface field appearing in ForceSendFields will be 920 // sent to the server regardless of whether the field is empty or not. 921 // This may be used to include empty fields in Patch requests. 922 ForceSendFields []string `json:"-"` 923 924 // NullFields is a list of field names (e.g. "DestinationParent") to 925 // include in API requests with the JSON null value. By default, fields 926 // with empty values are omitted from API requests. However, any field 927 // with an empty value appearing in NullFields will be sent to the 928 // server as null. It is an error if a field in this list has a 929 // non-empty value. This may be used to include null fields in Patch 930 // requests. 931 NullFields []string `json:"-"` 932} 933 934func (s *MoveFolderRequest) MarshalJSON() ([]byte, error) { 935 type NoMethod MoveFolderRequest 936 raw := NoMethod(*s) 937 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 938} 939 940// MoveProjectMetadata: A status object which is used as the `metadata` 941// field for the Operation returned by MoveProject. 942type MoveProjectMetadata struct { 943} 944 945// Operation: This resource represents a long-running operation that is 946// the result of a network API call. 947type Operation struct { 948 // Done: If the value is `false`, it means the operation is still in 949 // progress. If `true`, the operation is completed, and either `error` 950 // or `response` is available. 951 Done bool `json:"done,omitempty"` 952 953 // Error: The error result of the operation in case of failure or 954 // cancellation. 955 Error *Status `json:"error,omitempty"` 956 957 // Metadata: Service-specific metadata associated with the operation. It 958 // typically contains progress information and common metadata such as 959 // create time. Some services might not provide such metadata. Any 960 // method that returns a long-running operation should document the 961 // metadata type, if any. 962 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 963 964 // Name: The server-assigned name, which is only unique within the same 965 // service that originally returns it. If you use the default HTTP 966 // mapping, the `name` should be a resource name ending with 967 // `operations/{unique_id}`. 968 Name string `json:"name,omitempty"` 969 970 // Response: The normal response of the operation in case of success. If 971 // the original method returns no data on success, such as `Delete`, the 972 // response is `google.protobuf.Empty`. If the original method is 973 // standard `Get`/`Create`/`Update`, the response should be the 974 // resource. For other methods, the response should have the type 975 // `XxxResponse`, where `Xxx` is the original method name. For example, 976 // if the original method name is `TakeSnapshot()`, the inferred 977 // response type is `TakeSnapshotResponse`. 978 Response googleapi.RawMessage `json:"response,omitempty"` 979 980 // ServerResponse contains the HTTP response code and headers from the 981 // server. 982 googleapi.ServerResponse `json:"-"` 983 984 // ForceSendFields is a list of field names (e.g. "Done") to 985 // unconditionally include in API requests. By default, fields with 986 // empty or default values are omitted from API requests. However, any 987 // non-pointer, non-interface field appearing in ForceSendFields will be 988 // sent to the server regardless of whether the field is empty or not. 989 // This may be used to include empty fields in Patch requests. 990 ForceSendFields []string `json:"-"` 991 992 // NullFields is a list of field names (e.g. "Done") to include in API 993 // requests with the JSON null value. By default, fields with empty 994 // values are omitted from API requests. However, any field with an 995 // empty value appearing in NullFields will be sent to the server as 996 // null. It is an error if a field in this list has a non-empty value. 997 // This may be used to include null fields in Patch requests. 998 NullFields []string `json:"-"` 999} 1000 1001func (s *Operation) MarshalJSON() ([]byte, error) { 1002 type NoMethod Operation 1003 raw := NoMethod(*s) 1004 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1005} 1006 1007// Policy: An Identity and Access Management (IAM) policy, which 1008// specifies access controls for Google Cloud resources. A `Policy` is a 1009// collection of `bindings`. A `binding` binds one or more `members`, or 1010// principals, to a single `role`. Principals can be user accounts, 1011// service accounts, Google groups, and domains (such as G Suite). A 1012// `role` is a named list of permissions; each `role` can be an IAM 1013// predefined role or a user-created custom role. For some types of 1014// Google Cloud resources, a `binding` can also specify a `condition`, 1015// which is a logical expression that allows access to a resource only 1016// if the expression evaluates to `true`. A condition can add 1017// constraints based on attributes of the request, the resource, or 1018// both. To learn which resources support conditions in their IAM 1019// policies, see the IAM documentation 1020// (https://cloud.google.com/iam/help/conditions/resource-policies). 1021// **JSON example:** { "bindings": [ { "role": 1022// "roles/resourcemanager.organizationAdmin", "members": [ 1023// "user:mike@example.com", "group:admins@example.com", 1024// "domain:google.com", 1025// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { 1026// "role": "roles/resourcemanager.organizationViewer", "members": [ 1027// "user:eve@example.com" ], "condition": { "title": "expirable access", 1028// "description": "Does not grant access after Sep 2020", "expression": 1029// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], 1030// "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: - 1031// members: - user:mike@example.com - group:admins@example.com - 1032// domain:google.com - 1033// serviceAccount:my-project-id@appspot.gserviceaccount.com role: 1034// roles/resourcemanager.organizationAdmin - members: - 1035// user:eve@example.com role: roles/resourcemanager.organizationViewer 1036// condition: title: expirable access description: Does not grant access 1037// after Sep 2020 expression: request.time < 1038// timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 1039// For a description of IAM and its features, see the IAM documentation 1040// (https://cloud.google.com/iam/docs/). 1041type Policy struct { 1042 // AuditConfigs: Specifies cloud audit logging configuration for this 1043 // policy. 1044 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"` 1045 1046 // Bindings: Associates a list of `members`, or principals, with a 1047 // `role`. Optionally, may specify a `condition` that determines how and 1048 // when the `bindings` are applied. Each of the `bindings` must contain 1049 // at least one principal. The `bindings` in a `Policy` can refer to up 1050 // to 1,500 principals; up to 250 of these principals can be Google 1051 // groups. Each occurrence of a principal counts towards these limits. 1052 // For example, if the `bindings` grant 50 different roles to 1053 // `user:alice@example.com`, and not to any other principal, then you 1054 // can add another 1,450 principals to the `bindings` in the `Policy`. 1055 Bindings []*Binding `json:"bindings,omitempty"` 1056 1057 // Etag: `etag` is used for optimistic concurrency control as a way to 1058 // help prevent simultaneous updates of a policy from overwriting each 1059 // other. It is strongly suggested that systems make use of the `etag` 1060 // in the read-modify-write cycle to perform policy updates in order to 1061 // avoid race conditions: An `etag` is returned in the response to 1062 // `getIamPolicy`, and systems are expected to put that etag in the 1063 // request to `setIamPolicy` to ensure that their change will be applied 1064 // to the same version of the policy. **Important:** If you use IAM 1065 // Conditions, you must include the `etag` field whenever you call 1066 // `setIamPolicy`. If you omit this field, then IAM allows you to 1067 // overwrite a version `3` policy with a version `1` policy, and all of 1068 // the conditions in the version `3` policy are lost. 1069 Etag string `json:"etag,omitempty"` 1070 1071 // Version: Specifies the format of the policy. Valid values are `0`, 1072 // `1`, and `3`. Requests that specify an invalid value are rejected. 1073 // Any operation that affects conditional role bindings must specify 1074 // version `3`. This requirement applies to the following operations: * 1075 // Getting a policy that includes a conditional role binding * Adding a 1076 // conditional role binding to a policy * Changing a conditional role 1077 // binding in a policy * Removing any role binding, with or without a 1078 // condition, from a policy that includes conditions **Important:** If 1079 // you use IAM Conditions, you must include the `etag` field whenever 1080 // you call `setIamPolicy`. If you omit this field, then IAM allows you 1081 // to overwrite a version `3` policy with a version `1` policy, and all 1082 // of the conditions in the version `3` policy are lost. If a policy 1083 // does not include any conditions, operations on that policy may 1084 // specify any valid version or leave the field unset. To learn which 1085 // resources support conditions in their IAM policies, see the IAM 1086 // documentation 1087 // (https://cloud.google.com/iam/help/conditions/resource-policies). 1088 Version int64 `json:"version,omitempty"` 1089 1090 // ServerResponse contains the HTTP response code and headers from the 1091 // server. 1092 googleapi.ServerResponse `json:"-"` 1093 1094 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to 1095 // unconditionally include in API requests. By default, fields with 1096 // empty or default values are omitted from API requests. However, any 1097 // non-pointer, non-interface field appearing in ForceSendFields will be 1098 // sent to the server regardless of whether the field is empty or not. 1099 // This may be used to include empty fields in Patch requests. 1100 ForceSendFields []string `json:"-"` 1101 1102 // NullFields is a list of field names (e.g. "AuditConfigs") to include 1103 // in API requests with the JSON null value. By default, fields with 1104 // empty values are omitted from API requests. However, any field with 1105 // an empty value appearing in NullFields will be sent to the server as 1106 // null. It is an error if a field in this list has a non-empty value. 1107 // This may be used to include null fields in Patch requests. 1108 NullFields []string `json:"-"` 1109} 1110 1111func (s *Policy) MarshalJSON() ([]byte, error) { 1112 type NoMethod Policy 1113 raw := NoMethod(*s) 1114 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1115} 1116 1117// ProjectCreationStatus: A status object which is used as the 1118// `metadata` field for the Operation returned by CreateProject. It 1119// provides insight for when significant phases of Project creation have 1120// completed. 1121type ProjectCreationStatus struct { 1122 // CreateTime: Creation time of the project creation workflow. 1123 CreateTime string `json:"createTime,omitempty"` 1124 1125 // Gettable: True if the project can be retrieved using GetProject. No 1126 // other operations on the project are guaranteed to work until the 1127 // project creation is complete. 1128 Gettable bool `json:"gettable,omitempty"` 1129 1130 // Ready: True if the project creation process is complete. 1131 Ready bool `json:"ready,omitempty"` 1132 1133 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1134 // unconditionally include in API requests. By default, fields with 1135 // empty or default values are omitted from API requests. However, any 1136 // non-pointer, non-interface field appearing in ForceSendFields will be 1137 // sent to the server regardless of whether the field is empty or not. 1138 // This may be used to include empty fields in Patch requests. 1139 ForceSendFields []string `json:"-"` 1140 1141 // NullFields is a list of field names (e.g. "CreateTime") to include in 1142 // API requests with the JSON null value. By default, fields with empty 1143 // values are omitted from API requests. However, any field with an 1144 // empty value appearing in NullFields will be sent to the server as 1145 // null. It is an error if a field in this list has a non-empty value. 1146 // This may be used to include null fields in Patch requests. 1147 NullFields []string `json:"-"` 1148} 1149 1150func (s *ProjectCreationStatus) MarshalJSON() ([]byte, error) { 1151 type NoMethod ProjectCreationStatus 1152 raw := NoMethod(*s) 1153 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1154} 1155 1156// SearchFoldersRequest: The request message for searching folders. 1157type SearchFoldersRequest struct { 1158 // PageSize: Optional. The maximum number of folders to return in the 1159 // response. The server can return fewer folders than requested. If 1160 // unspecified, server picks an appropriate default. 1161 PageSize int64 `json:"pageSize,omitempty"` 1162 1163 // PageToken: Optional. A pagination token returned from a previous call 1164 // to `SearchFolders` that indicates from where search should continue. 1165 PageToken string `json:"pageToken,omitempty"` 1166 1167 // Query: Search criteria used to select the Folders to return. If no 1168 // search criteria is specified then all accessible folders will be 1169 // returned. Query expressions can be used to restrict results based 1170 // upon displayName, lifecycleState and parent, where the operators `=`, 1171 // `NOT`, `AND` and `OR` can be used along with the suffix wildcard 1172 // symbol `*`. The displayName field in a query expression should use 1173 // escaped quotes for values that include whitespace to prevent 1174 // unexpected behavior. Some example queries are: * Query 1175 // `displayName=Test*` returns Folder resources whose display name 1176 // starts with "Test". * Query `lifecycleState=ACTIVE` returns Folder 1177 // resources with `lifecycleState` set to `ACTIVE`. * Query 1178 // `parent=folders/123` returns Folder resources that have `folders/123` 1179 // as a parent resource. * Query `parent=folders/123 AND 1180 // lifecycleState=ACTIVE` returns active Folder resources that have 1181 // `folders/123` as a parent resource. * Query `displayName=\\"Test 1182 // String\\" returns Folder resources with display names that include 1183 // both "Test" and "String". 1184 Query string `json:"query,omitempty"` 1185 1186 // ForceSendFields is a list of field names (e.g. "PageSize") to 1187 // unconditionally include in API requests. By default, fields with 1188 // empty or default values are omitted from API requests. However, any 1189 // non-pointer, non-interface field appearing in ForceSendFields will be 1190 // sent to the server regardless of whether the field is empty or not. 1191 // This may be used to include empty fields in Patch requests. 1192 ForceSendFields []string `json:"-"` 1193 1194 // NullFields is a list of field names (e.g. "PageSize") to include in 1195 // API requests with the JSON null value. By default, fields with empty 1196 // values are omitted from API requests. However, any field with an 1197 // empty value appearing in NullFields will be sent to the server as 1198 // null. It is an error if a field in this list has a non-empty value. 1199 // This may be used to include null fields in Patch requests. 1200 NullFields []string `json:"-"` 1201} 1202 1203func (s *SearchFoldersRequest) MarshalJSON() ([]byte, error) { 1204 type NoMethod SearchFoldersRequest 1205 raw := NoMethod(*s) 1206 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1207} 1208 1209// SearchFoldersResponse: The response message for searching folders. 1210type SearchFoldersResponse struct { 1211 // Folders: A possibly paginated folder search results. the specified 1212 // parent resource. 1213 Folders []*Folder `json:"folders,omitempty"` 1214 1215 // NextPageToken: A pagination token returned from a previous call to 1216 // `SearchFolders` that indicates from where searching should continue. 1217 NextPageToken string `json:"nextPageToken,omitempty"` 1218 1219 // ServerResponse contains the HTTP response code and headers from the 1220 // server. 1221 googleapi.ServerResponse `json:"-"` 1222 1223 // ForceSendFields is a list of field names (e.g. "Folders") to 1224 // unconditionally include in API requests. By default, fields with 1225 // empty or default values are omitted from API requests. However, any 1226 // non-pointer, non-interface field appearing in ForceSendFields will be 1227 // sent to the server regardless of whether the field is empty or not. 1228 // This may be used to include empty fields in Patch requests. 1229 ForceSendFields []string `json:"-"` 1230 1231 // NullFields is a list of field names (e.g. "Folders") to include in 1232 // API requests with the JSON null value. By default, fields with empty 1233 // values are omitted from API requests. However, any field with an 1234 // empty value appearing in NullFields will be sent to the server as 1235 // null. It is an error if a field in this list has a non-empty value. 1236 // This may be used to include null fields in Patch requests. 1237 NullFields []string `json:"-"` 1238} 1239 1240func (s *SearchFoldersResponse) MarshalJSON() ([]byte, error) { 1241 type NoMethod SearchFoldersResponse 1242 raw := NoMethod(*s) 1243 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1244} 1245 1246// SetIamPolicyRequest: Request message for `SetIamPolicy` method. 1247type SetIamPolicyRequest struct { 1248 // Policy: REQUIRED: The complete policy to be applied to the 1249 // `resource`. The size of the policy is limited to a few 10s of KB. An 1250 // empty policy is a valid policy but certain Cloud Platform services 1251 // (such as Projects) might reject them. 1252 Policy *Policy `json:"policy,omitempty"` 1253 1254 // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the 1255 // policy to modify. Only the fields in the mask will be modified. If no 1256 // mask is provided, the following default mask is used: `paths: 1257 // "bindings, etag" 1258 UpdateMask string `json:"updateMask,omitempty"` 1259 1260 // ForceSendFields is a list of field names (e.g. "Policy") to 1261 // unconditionally include in API requests. By default, fields with 1262 // empty or default values are omitted from API requests. However, any 1263 // non-pointer, non-interface field appearing in ForceSendFields will be 1264 // sent to the server regardless of whether the field is empty or not. 1265 // This may be used to include empty fields in Patch requests. 1266 ForceSendFields []string `json:"-"` 1267 1268 // NullFields is a list of field names (e.g. "Policy") to include in API 1269 // requests with the JSON null value. By default, fields with empty 1270 // values are omitted from API requests. However, any field with an 1271 // empty value appearing in NullFields will be sent to the server as 1272 // null. It is an error if a field in this list has a non-empty value. 1273 // This may be used to include null fields in Patch requests. 1274 NullFields []string `json:"-"` 1275} 1276 1277func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { 1278 type NoMethod SetIamPolicyRequest 1279 raw := NoMethod(*s) 1280 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1281} 1282 1283// Status: The `Status` type defines a logical error model that is 1284// suitable for different programming environments, including REST APIs 1285// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 1286// `Status` message contains three pieces of data: error code, error 1287// message, and error details. You can find out more about this error 1288// model and how to work with it in the API Design Guide 1289// (https://cloud.google.com/apis/design/errors). 1290type Status struct { 1291 // Code: The status code, which should be an enum value of 1292 // google.rpc.Code. 1293 Code int64 `json:"code,omitempty"` 1294 1295 // Details: A list of messages that carry the error details. There is a 1296 // common set of message types for APIs to use. 1297 Details []googleapi.RawMessage `json:"details,omitempty"` 1298 1299 // Message: A developer-facing error message, which should be in 1300 // English. Any user-facing error message should be localized and sent 1301 // in the google.rpc.Status.details field, or localized by the client. 1302 Message string `json:"message,omitempty"` 1303 1304 // ForceSendFields is a list of field names (e.g. "Code") to 1305 // unconditionally include in API requests. By default, fields with 1306 // empty or default values are omitted from API requests. However, any 1307 // non-pointer, non-interface field appearing in ForceSendFields will be 1308 // sent to the server regardless of whether the field is empty or not. 1309 // This may be used to include empty fields in Patch requests. 1310 ForceSendFields []string `json:"-"` 1311 1312 // NullFields is a list of field names (e.g. "Code") to include in API 1313 // requests with the JSON null value. By default, fields with empty 1314 // values are omitted from API requests. However, any field with an 1315 // empty value appearing in NullFields will be sent to the server as 1316 // null. It is an error if a field in this list has a non-empty value. 1317 // This may be used to include null fields in Patch requests. 1318 NullFields []string `json:"-"` 1319} 1320 1321func (s *Status) MarshalJSON() ([]byte, error) { 1322 type NoMethod Status 1323 raw := NoMethod(*s) 1324 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1325} 1326 1327// TestIamPermissionsRequest: Request message for `TestIamPermissions` 1328// method. 1329type TestIamPermissionsRequest struct { 1330 // Permissions: The set of permissions to check for the `resource`. 1331 // Permissions with wildcards (such as '*' or 'storage.*') are not 1332 // allowed. For more information see IAM Overview 1333 // (https://cloud.google.com/iam/docs/overview#permissions). 1334 Permissions []string `json:"permissions,omitempty"` 1335 1336 // ForceSendFields is a list of field names (e.g. "Permissions") to 1337 // unconditionally include in API requests. By default, fields with 1338 // empty or default values are omitted from API requests. However, any 1339 // non-pointer, non-interface field appearing in ForceSendFields will be 1340 // sent to the server regardless of whether the field is empty or not. 1341 // This may be used to include empty fields in Patch requests. 1342 ForceSendFields []string `json:"-"` 1343 1344 // NullFields is a list of field names (e.g. "Permissions") to include 1345 // in API requests with the JSON null value. By default, fields with 1346 // empty values are omitted from API requests. However, any field with 1347 // an empty value appearing in NullFields will be sent to the server as 1348 // null. It is an error if a field in this list has a non-empty value. 1349 // This may be used to include null fields in Patch requests. 1350 NullFields []string `json:"-"` 1351} 1352 1353func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { 1354 type NoMethod TestIamPermissionsRequest 1355 raw := NoMethod(*s) 1356 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1357} 1358 1359// TestIamPermissionsResponse: Response message for `TestIamPermissions` 1360// method. 1361type TestIamPermissionsResponse struct { 1362 // Permissions: A subset of `TestPermissionsRequest.permissions` that 1363 // the caller is allowed. 1364 Permissions []string `json:"permissions,omitempty"` 1365 1366 // ServerResponse contains the HTTP response code and headers from the 1367 // server. 1368 googleapi.ServerResponse `json:"-"` 1369 1370 // ForceSendFields is a list of field names (e.g. "Permissions") to 1371 // unconditionally include in API requests. By default, fields with 1372 // empty or default values are omitted from API requests. However, any 1373 // non-pointer, non-interface field appearing in ForceSendFields will be 1374 // sent to the server regardless of whether the field is empty or not. 1375 // This may be used to include empty fields in Patch requests. 1376 ForceSendFields []string `json:"-"` 1377 1378 // NullFields is a list of field names (e.g. "Permissions") to include 1379 // in API requests with the JSON null value. By default, fields with 1380 // empty values are omitted from API requests. However, any field with 1381 // an empty value appearing in NullFields will be sent to the server as 1382 // null. It is an error if a field in this list has a non-empty value. 1383 // This may be used to include null fields in Patch requests. 1384 NullFields []string `json:"-"` 1385} 1386 1387func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 1388 type NoMethod TestIamPermissionsResponse 1389 raw := NoMethod(*s) 1390 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1391} 1392 1393// UndeleteFolderMetadata: A status object which is used as the 1394// `metadata` field for the `Operation` returned by `UndeleteFolder`. 1395type UndeleteFolderMetadata struct { 1396} 1397 1398// UndeleteFolderRequest: The UndeleteFolder request message. 1399type UndeleteFolderRequest struct { 1400} 1401 1402// UndeleteOrganizationMetadata: A status object which is used as the 1403// `metadata` field for the Operation returned by UndeleteOrganization. 1404type UndeleteOrganizationMetadata struct { 1405} 1406 1407// UndeleteProjectMetadata: A status object which is used as the 1408// `metadata` field for the Operation returned by `UndeleteProject`. 1409type UndeleteProjectMetadata struct { 1410} 1411 1412// UpdateFolderMetadata: A status object which is used as the `metadata` 1413// field for the Operation returned by UpdateFolder. 1414type UpdateFolderMetadata struct { 1415} 1416 1417// UpdateProjectMetadata: A status object which is used as the 1418// `metadata` field for the Operation returned by UpdateProject. 1419type UpdateProjectMetadata struct { 1420} 1421 1422// UpdateTagKeyMetadata: Runtime operation information for updating a 1423// TagKey. 1424type UpdateTagKeyMetadata struct { 1425} 1426 1427// UpdateTagValueMetadata: Runtime operation information for updating a 1428// TagValue. 1429type UpdateTagValueMetadata struct { 1430} 1431 1432// method id "cloudresourcemanager.folders.create": 1433 1434type FoldersCreateCall struct { 1435 s *Service 1436 folder *Folder 1437 urlParams_ gensupport.URLParams 1438 ctx_ context.Context 1439 header_ http.Header 1440} 1441 1442// Create: Creates a Folder in the resource hierarchy. Returns an 1443// Operation which can be used to track the progress of the folder 1444// creation workflow. Upon success the Operation.response field will be 1445// populated with the created Folder. In order to succeed, the addition 1446// of this new Folder must not violate the Folder naming, height or 1447// fanout constraints. + The Folder's display_name must be distinct from 1448// all other Folders that share its parent. + The addition of the Folder 1449// must not cause the active Folder hierarchy to exceed a height of 10. 1450// Note, the full active + deleted Folder hierarchy is allowed to reach 1451// a height of 20; this provides additional headroom when moving folders 1452// that contain deleted folders. + The addition of the Folder must not 1453// cause the total number of Folders under its parent to exceed 300. If 1454// the operation fails due to a folder constraint violation, some errors 1455// may be returned by the CreateFolder request, with status code 1456// FAILED_PRECONDITION and an error description. Other folder constraint 1457// violations will be communicated in the Operation, with the specific 1458// PreconditionFailure returned via the details list in the 1459// Operation.error field. The caller must have 1460// `resourcemanager.folders.create` permission on the identified parent. 1461func (r *FoldersService) Create(folder *Folder) *FoldersCreateCall { 1462 c := &FoldersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1463 c.folder = folder 1464 return c 1465} 1466 1467// Parent sets the optional parameter "parent": Required. The resource 1468// name of the new Folder's parent. Must be of the form 1469// `folders/{folder_id}` or `organizations/{org_id}`. 1470func (c *FoldersCreateCall) Parent(parent string) *FoldersCreateCall { 1471 c.urlParams_.Set("parent", parent) 1472 return c 1473} 1474 1475// Fields allows partial responses to be retrieved. See 1476// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1477// for more information. 1478func (c *FoldersCreateCall) Fields(s ...googleapi.Field) *FoldersCreateCall { 1479 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1480 return c 1481} 1482 1483// Context sets the context to be used in this call's Do method. Any 1484// pending HTTP request will be aborted if the provided context is 1485// canceled. 1486func (c *FoldersCreateCall) Context(ctx context.Context) *FoldersCreateCall { 1487 c.ctx_ = ctx 1488 return c 1489} 1490 1491// Header returns an http.Header that can be modified by the caller to 1492// add HTTP headers to the request. 1493func (c *FoldersCreateCall) Header() http.Header { 1494 if c.header_ == nil { 1495 c.header_ = make(http.Header) 1496 } 1497 return c.header_ 1498} 1499 1500func (c *FoldersCreateCall) doRequest(alt string) (*http.Response, error) { 1501 reqHeaders := make(http.Header) 1502 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 1503 for k, v := range c.header_ { 1504 reqHeaders[k] = v 1505 } 1506 reqHeaders.Set("User-Agent", c.s.userAgent()) 1507 var body io.Reader = nil 1508 body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) 1509 if err != nil { 1510 return nil, err 1511 } 1512 reqHeaders.Set("Content-Type", "application/json") 1513 c.urlParams_.Set("alt", alt) 1514 c.urlParams_.Set("prettyPrint", "false") 1515 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/folders") 1516 urls += "?" + c.urlParams_.Encode() 1517 req, err := http.NewRequest("POST", urls, body) 1518 if err != nil { 1519 return nil, err 1520 } 1521 req.Header = reqHeaders 1522 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1523} 1524 1525// Do executes the "cloudresourcemanager.folders.create" call. 1526// Exactly one of *Operation or error will be non-nil. Any non-2xx 1527// status code is an error. Response headers are in either 1528// *Operation.ServerResponse.Header or (if a response was returned at 1529// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 1530// to check whether the returned error was because 1531// http.StatusNotModified was returned. 1532func (c *FoldersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 1533 gensupport.SetOptions(c.urlParams_, opts...) 1534 res, err := c.doRequest("json") 1535 if res != nil && res.StatusCode == http.StatusNotModified { 1536 if res.Body != nil { 1537 res.Body.Close() 1538 } 1539 return nil, &googleapi.Error{ 1540 Code: res.StatusCode, 1541 Header: res.Header, 1542 } 1543 } 1544 if err != nil { 1545 return nil, err 1546 } 1547 defer googleapi.CloseBody(res) 1548 if err := googleapi.CheckResponse(res); err != nil { 1549 return nil, err 1550 } 1551 ret := &Operation{ 1552 ServerResponse: googleapi.ServerResponse{ 1553 Header: res.Header, 1554 HTTPStatusCode: res.StatusCode, 1555 }, 1556 } 1557 target := &ret 1558 if err := gensupport.DecodeResponse(target, res); err != nil { 1559 return nil, err 1560 } 1561 return ret, nil 1562 // { 1563 // "description": "Creates a Folder in the resource hierarchy. Returns an Operation which can be used to track the progress of the folder creation workflow. Upon success the Operation.response field will be populated with the created Folder. In order to succeed, the addition of this new Folder must not violate the Folder naming, height or fanout constraints. + The Folder's display_name must be distinct from all other Folders that share its parent. + The addition of the Folder must not cause the active Folder hierarchy to exceed a height of 10. Note, the full active + deleted Folder hierarchy is allowed to reach a height of 20; this provides additional headroom when moving folders that contain deleted folders. + The addition of the Folder must not cause the total number of Folders under its parent to exceed 300. If the operation fails due to a folder constraint violation, some errors may be returned by the CreateFolder request, with status code FAILED_PRECONDITION and an error description. Other folder constraint violations will be communicated in the Operation, with the specific PreconditionFailure returned via the details list in the Operation.error field. The caller must have `resourcemanager.folders.create` permission on the identified parent.", 1564 // "flatPath": "v2/folders", 1565 // "httpMethod": "POST", 1566 // "id": "cloudresourcemanager.folders.create", 1567 // "parameterOrder": [], 1568 // "parameters": { 1569 // "parent": { 1570 // "description": "Required. The resource name of the new Folder's parent. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`.", 1571 // "location": "query", 1572 // "type": "string" 1573 // } 1574 // }, 1575 // "path": "v2/folders", 1576 // "request": { 1577 // "$ref": "Folder" 1578 // }, 1579 // "response": { 1580 // "$ref": "Operation" 1581 // }, 1582 // "scopes": [ 1583 // "https://www.googleapis.com/auth/cloud-platform" 1584 // ] 1585 // } 1586 1587} 1588 1589// method id "cloudresourcemanager.folders.delete": 1590 1591type FoldersDeleteCall struct { 1592 s *Service 1593 name string 1594 urlParams_ gensupport.URLParams 1595 ctx_ context.Context 1596 header_ http.Header 1597} 1598 1599// Delete: Requests deletion of a Folder. The Folder is moved into the 1600// DELETE_REQUESTED state immediately, and is deleted approximately 30 1601// days later. This method may only be called on an empty Folder in the 1602// ACTIVE state, where a Folder is empty if it doesn't contain any 1603// Folders or Projects in the ACTIVE state. The caller must have 1604// `resourcemanager.folders.delete` permission on the identified folder. 1605// 1606// - name: the resource name of the Folder to be deleted. Must be of the 1607// form `folders/{folder_id}`. 1608func (r *FoldersService) Delete(name string) *FoldersDeleteCall { 1609 c := &FoldersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1610 c.name = name 1611 return c 1612} 1613 1614// Fields allows partial responses to be retrieved. See 1615// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1616// for more information. 1617func (c *FoldersDeleteCall) Fields(s ...googleapi.Field) *FoldersDeleteCall { 1618 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1619 return c 1620} 1621 1622// Context sets the context to be used in this call's Do method. Any 1623// pending HTTP request will be aborted if the provided context is 1624// canceled. 1625func (c *FoldersDeleteCall) Context(ctx context.Context) *FoldersDeleteCall { 1626 c.ctx_ = ctx 1627 return c 1628} 1629 1630// Header returns an http.Header that can be modified by the caller to 1631// add HTTP headers to the request. 1632func (c *FoldersDeleteCall) Header() http.Header { 1633 if c.header_ == nil { 1634 c.header_ = make(http.Header) 1635 } 1636 return c.header_ 1637} 1638 1639func (c *FoldersDeleteCall) doRequest(alt string) (*http.Response, error) { 1640 reqHeaders := make(http.Header) 1641 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 1642 for k, v := range c.header_ { 1643 reqHeaders[k] = v 1644 } 1645 reqHeaders.Set("User-Agent", c.s.userAgent()) 1646 var body io.Reader = nil 1647 c.urlParams_.Set("alt", alt) 1648 c.urlParams_.Set("prettyPrint", "false") 1649 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 1650 urls += "?" + c.urlParams_.Encode() 1651 req, err := http.NewRequest("DELETE", urls, body) 1652 if err != nil { 1653 return nil, err 1654 } 1655 req.Header = reqHeaders 1656 googleapi.Expand(req.URL, map[string]string{ 1657 "name": c.name, 1658 }) 1659 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1660} 1661 1662// Do executes the "cloudresourcemanager.folders.delete" call. 1663// Exactly one of *Folder or error will be non-nil. Any non-2xx status 1664// code is an error. Response headers are in either 1665// *Folder.ServerResponse.Header or (if a response was returned at all) 1666// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1667// check whether the returned error was because http.StatusNotModified 1668// was returned. 1669func (c *FoldersDeleteCall) Do(opts ...googleapi.CallOption) (*Folder, error) { 1670 gensupport.SetOptions(c.urlParams_, opts...) 1671 res, err := c.doRequest("json") 1672 if res != nil && res.StatusCode == http.StatusNotModified { 1673 if res.Body != nil { 1674 res.Body.Close() 1675 } 1676 return nil, &googleapi.Error{ 1677 Code: res.StatusCode, 1678 Header: res.Header, 1679 } 1680 } 1681 if err != nil { 1682 return nil, err 1683 } 1684 defer googleapi.CloseBody(res) 1685 if err := googleapi.CheckResponse(res); err != nil { 1686 return nil, err 1687 } 1688 ret := &Folder{ 1689 ServerResponse: googleapi.ServerResponse{ 1690 Header: res.Header, 1691 HTTPStatusCode: res.StatusCode, 1692 }, 1693 } 1694 target := &ret 1695 if err := gensupport.DecodeResponse(target, res); err != nil { 1696 return nil, err 1697 } 1698 return ret, nil 1699 // { 1700 // "description": "Requests deletion of a Folder. The Folder is moved into the DELETE_REQUESTED state immediately, and is deleted approximately 30 days later. This method may only be called on an empty Folder in the ACTIVE state, where a Folder is empty if it doesn't contain any Folders or Projects in the ACTIVE state. The caller must have `resourcemanager.folders.delete` permission on the identified folder.", 1701 // "flatPath": "v2/folders/{foldersId}", 1702 // "httpMethod": "DELETE", 1703 // "id": "cloudresourcemanager.folders.delete", 1704 // "parameterOrder": [ 1705 // "name" 1706 // ], 1707 // "parameters": { 1708 // "name": { 1709 // "description": "Required. the resource name of the Folder to be deleted. Must be of the form `folders/{folder_id}`.", 1710 // "location": "path", 1711 // "pattern": "^folders/[^/]+$", 1712 // "required": true, 1713 // "type": "string" 1714 // } 1715 // }, 1716 // "path": "v2/{+name}", 1717 // "response": { 1718 // "$ref": "Folder" 1719 // }, 1720 // "scopes": [ 1721 // "https://www.googleapis.com/auth/cloud-platform" 1722 // ] 1723 // } 1724 1725} 1726 1727// method id "cloudresourcemanager.folders.get": 1728 1729type FoldersGetCall struct { 1730 s *Service 1731 name string 1732 urlParams_ gensupport.URLParams 1733 ifNoneMatch_ string 1734 ctx_ context.Context 1735 header_ http.Header 1736} 1737 1738// Get: Retrieves a Folder identified by the supplied resource name. 1739// Valid Folder resource names have the format `folders/{folder_id}` 1740// (for example, `folders/1234`). The caller must have 1741// `resourcemanager.folders.get` permission on the identified folder. 1742// 1743// - name: The resource name of the Folder to retrieve. Must be of the 1744// form `folders/{folder_id}`. 1745func (r *FoldersService) Get(name string) *FoldersGetCall { 1746 c := &FoldersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1747 c.name = name 1748 return c 1749} 1750 1751// Fields allows partial responses to be retrieved. See 1752// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1753// for more information. 1754func (c *FoldersGetCall) Fields(s ...googleapi.Field) *FoldersGetCall { 1755 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1756 return c 1757} 1758 1759// IfNoneMatch sets the optional parameter which makes the operation 1760// fail if the object's ETag matches the given value. This is useful for 1761// getting updates only after the object has changed since the last 1762// request. Use googleapi.IsNotModified to check whether the response 1763// error from Do is the result of In-None-Match. 1764func (c *FoldersGetCall) IfNoneMatch(entityTag string) *FoldersGetCall { 1765 c.ifNoneMatch_ = entityTag 1766 return c 1767} 1768 1769// Context sets the context to be used in this call's Do method. Any 1770// pending HTTP request will be aborted if the provided context is 1771// canceled. 1772func (c *FoldersGetCall) Context(ctx context.Context) *FoldersGetCall { 1773 c.ctx_ = ctx 1774 return c 1775} 1776 1777// Header returns an http.Header that can be modified by the caller to 1778// add HTTP headers to the request. 1779func (c *FoldersGetCall) Header() http.Header { 1780 if c.header_ == nil { 1781 c.header_ = make(http.Header) 1782 } 1783 return c.header_ 1784} 1785 1786func (c *FoldersGetCall) doRequest(alt string) (*http.Response, error) { 1787 reqHeaders := make(http.Header) 1788 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 1789 for k, v := range c.header_ { 1790 reqHeaders[k] = v 1791 } 1792 reqHeaders.Set("User-Agent", c.s.userAgent()) 1793 if c.ifNoneMatch_ != "" { 1794 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1795 } 1796 var body io.Reader = nil 1797 c.urlParams_.Set("alt", alt) 1798 c.urlParams_.Set("prettyPrint", "false") 1799 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 1800 urls += "?" + c.urlParams_.Encode() 1801 req, err := http.NewRequest("GET", urls, body) 1802 if err != nil { 1803 return nil, err 1804 } 1805 req.Header = reqHeaders 1806 googleapi.Expand(req.URL, map[string]string{ 1807 "name": c.name, 1808 }) 1809 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1810} 1811 1812// Do executes the "cloudresourcemanager.folders.get" call. 1813// Exactly one of *Folder or error will be non-nil. Any non-2xx status 1814// code is an error. Response headers are in either 1815// *Folder.ServerResponse.Header or (if a response was returned at all) 1816// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1817// check whether the returned error was because http.StatusNotModified 1818// was returned. 1819func (c *FoldersGetCall) Do(opts ...googleapi.CallOption) (*Folder, error) { 1820 gensupport.SetOptions(c.urlParams_, opts...) 1821 res, err := c.doRequest("json") 1822 if res != nil && res.StatusCode == http.StatusNotModified { 1823 if res.Body != nil { 1824 res.Body.Close() 1825 } 1826 return nil, &googleapi.Error{ 1827 Code: res.StatusCode, 1828 Header: res.Header, 1829 } 1830 } 1831 if err != nil { 1832 return nil, err 1833 } 1834 defer googleapi.CloseBody(res) 1835 if err := googleapi.CheckResponse(res); err != nil { 1836 return nil, err 1837 } 1838 ret := &Folder{ 1839 ServerResponse: googleapi.ServerResponse{ 1840 Header: res.Header, 1841 HTTPStatusCode: res.StatusCode, 1842 }, 1843 } 1844 target := &ret 1845 if err := gensupport.DecodeResponse(target, res); err != nil { 1846 return nil, err 1847 } 1848 return ret, nil 1849 // { 1850 // "description": "Retrieves a Folder identified by the supplied resource name. Valid Folder resource names have the format `folders/{folder_id}` (for example, `folders/1234`). The caller must have `resourcemanager.folders.get` permission on the identified folder.", 1851 // "flatPath": "v2/folders/{foldersId}", 1852 // "httpMethod": "GET", 1853 // "id": "cloudresourcemanager.folders.get", 1854 // "parameterOrder": [ 1855 // "name" 1856 // ], 1857 // "parameters": { 1858 // "name": { 1859 // "description": "Required. The resource name of the Folder to retrieve. Must be of the form `folders/{folder_id}`.", 1860 // "location": "path", 1861 // "pattern": "^folders/[^/]+$", 1862 // "required": true, 1863 // "type": "string" 1864 // } 1865 // }, 1866 // "path": "v2/{+name}", 1867 // "response": { 1868 // "$ref": "Folder" 1869 // }, 1870 // "scopes": [ 1871 // "https://www.googleapis.com/auth/cloud-platform", 1872 // "https://www.googleapis.com/auth/cloud-platform.read-only" 1873 // ] 1874 // } 1875 1876} 1877 1878// method id "cloudresourcemanager.folders.getIamPolicy": 1879 1880type FoldersGetIamPolicyCall struct { 1881 s *Service 1882 resource string 1883 getiampolicyrequest *GetIamPolicyRequest 1884 urlParams_ gensupport.URLParams 1885 ctx_ context.Context 1886 header_ http.Header 1887} 1888 1889// GetIamPolicy: Gets the access control policy for a Folder. The 1890// returned policy may be empty if no such policy or resource exists. 1891// The `resource` field should be the Folder's resource name, e.g. 1892// "folders/1234". The caller must have 1893// `resourcemanager.folders.getIamPolicy` permission on the identified 1894// folder. 1895// 1896// - resource: REQUIRED: The resource for which the policy is being 1897// requested. See the operation documentation for the appropriate 1898// value for this field. 1899func (r *FoldersService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *FoldersGetIamPolicyCall { 1900 c := &FoldersGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1901 c.resource = resource 1902 c.getiampolicyrequest = getiampolicyrequest 1903 return c 1904} 1905 1906// Fields allows partial responses to be retrieved. See 1907// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1908// for more information. 1909func (c *FoldersGetIamPolicyCall) Fields(s ...googleapi.Field) *FoldersGetIamPolicyCall { 1910 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1911 return c 1912} 1913 1914// Context sets the context to be used in this call's Do method. Any 1915// pending HTTP request will be aborted if the provided context is 1916// canceled. 1917func (c *FoldersGetIamPolicyCall) Context(ctx context.Context) *FoldersGetIamPolicyCall { 1918 c.ctx_ = ctx 1919 return c 1920} 1921 1922// Header returns an http.Header that can be modified by the caller to 1923// add HTTP headers to the request. 1924func (c *FoldersGetIamPolicyCall) Header() http.Header { 1925 if c.header_ == nil { 1926 c.header_ = make(http.Header) 1927 } 1928 return c.header_ 1929} 1930 1931func (c *FoldersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 1932 reqHeaders := make(http.Header) 1933 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 1934 for k, v := range c.header_ { 1935 reqHeaders[k] = v 1936 } 1937 reqHeaders.Set("User-Agent", c.s.userAgent()) 1938 var body io.Reader = nil 1939 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 1940 if err != nil { 1941 return nil, err 1942 } 1943 reqHeaders.Set("Content-Type", "application/json") 1944 c.urlParams_.Set("alt", alt) 1945 c.urlParams_.Set("prettyPrint", "false") 1946 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:getIamPolicy") 1947 urls += "?" + c.urlParams_.Encode() 1948 req, err := http.NewRequest("POST", urls, body) 1949 if err != nil { 1950 return nil, err 1951 } 1952 req.Header = reqHeaders 1953 googleapi.Expand(req.URL, map[string]string{ 1954 "resource": c.resource, 1955 }) 1956 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1957} 1958 1959// Do executes the "cloudresourcemanager.folders.getIamPolicy" call. 1960// Exactly one of *Policy or error will be non-nil. Any non-2xx status 1961// code is an error. Response headers are in either 1962// *Policy.ServerResponse.Header or (if a response was returned at all) 1963// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1964// check whether the returned error was because http.StatusNotModified 1965// was returned. 1966func (c *FoldersGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 1967 gensupport.SetOptions(c.urlParams_, opts...) 1968 res, err := c.doRequest("json") 1969 if res != nil && res.StatusCode == http.StatusNotModified { 1970 if res.Body != nil { 1971 res.Body.Close() 1972 } 1973 return nil, &googleapi.Error{ 1974 Code: res.StatusCode, 1975 Header: res.Header, 1976 } 1977 } 1978 if err != nil { 1979 return nil, err 1980 } 1981 defer googleapi.CloseBody(res) 1982 if err := googleapi.CheckResponse(res); err != nil { 1983 return nil, err 1984 } 1985 ret := &Policy{ 1986 ServerResponse: googleapi.ServerResponse{ 1987 Header: res.Header, 1988 HTTPStatusCode: res.StatusCode, 1989 }, 1990 } 1991 target := &ret 1992 if err := gensupport.DecodeResponse(target, res); err != nil { 1993 return nil, err 1994 } 1995 return ret, nil 1996 // { 1997 // "description": "Gets the access control policy for a Folder. The returned policy may be empty if no such policy or resource exists. The `resource` field should be the Folder's resource name, e.g. \"folders/1234\". The caller must have `resourcemanager.folders.getIamPolicy` permission on the identified folder.", 1998 // "flatPath": "v2/folders/{foldersId}:getIamPolicy", 1999 // "httpMethod": "POST", 2000 // "id": "cloudresourcemanager.folders.getIamPolicy", 2001 // "parameterOrder": [ 2002 // "resource" 2003 // ], 2004 // "parameters": { 2005 // "resource": { 2006 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 2007 // "location": "path", 2008 // "pattern": "^folders/[^/]+$", 2009 // "required": true, 2010 // "type": "string" 2011 // } 2012 // }, 2013 // "path": "v2/{+resource}:getIamPolicy", 2014 // "request": { 2015 // "$ref": "GetIamPolicyRequest" 2016 // }, 2017 // "response": { 2018 // "$ref": "Policy" 2019 // }, 2020 // "scopes": [ 2021 // "https://www.googleapis.com/auth/cloud-platform", 2022 // "https://www.googleapis.com/auth/cloud-platform.read-only" 2023 // ] 2024 // } 2025 2026} 2027 2028// method id "cloudresourcemanager.folders.list": 2029 2030type FoldersListCall struct { 2031 s *Service 2032 urlParams_ gensupport.URLParams 2033 ifNoneMatch_ string 2034 ctx_ context.Context 2035 header_ http.Header 2036} 2037 2038// List: Lists the Folders that are direct descendants of supplied 2039// parent resource. List provides a strongly consistent view of the 2040// Folders underneath the specified parent resource. List returns 2041// Folders sorted based upon the (ascending) lexical ordering of their 2042// display_name. The caller must have `resourcemanager.folders.list` 2043// permission on the identified parent. 2044func (r *FoldersService) List() *FoldersListCall { 2045 c := &FoldersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2046 return c 2047} 2048 2049// PageSize sets the optional parameter "pageSize": The maximum number 2050// of Folders to return in the response. The server can return fewer 2051// folders than requested. If unspecified, server picks an appropriate 2052// default. 2053func (c *FoldersListCall) PageSize(pageSize int64) *FoldersListCall { 2054 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2055 return c 2056} 2057 2058// PageToken sets the optional parameter "pageToken": A pagination token 2059// returned from a previous call to `ListFolders` that indicates where 2060// this listing should continue from. 2061func (c *FoldersListCall) PageToken(pageToken string) *FoldersListCall { 2062 c.urlParams_.Set("pageToken", pageToken) 2063 return c 2064} 2065 2066// Parent sets the optional parameter "parent": Required. The resource 2067// name of the Organization or Folder whose Folders are being listed. 2068// Must be of the form `folders/{folder_id}` or 2069// `organizations/{org_id}`. Access to this method is controlled by 2070// checking the `resourcemanager.folders.list` permission on the 2071// `parent`. 2072func (c *FoldersListCall) Parent(parent string) *FoldersListCall { 2073 c.urlParams_.Set("parent", parent) 2074 return c 2075} 2076 2077// ShowDeleted sets the optional parameter "showDeleted": Controls 2078// whether Folders in the DELETE_REQUESTED state should be returned. 2079// Defaults to false. 2080func (c *FoldersListCall) ShowDeleted(showDeleted bool) *FoldersListCall { 2081 c.urlParams_.Set("showDeleted", fmt.Sprint(showDeleted)) 2082 return c 2083} 2084 2085// Fields allows partial responses to be retrieved. See 2086// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2087// for more information. 2088func (c *FoldersListCall) Fields(s ...googleapi.Field) *FoldersListCall { 2089 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2090 return c 2091} 2092 2093// IfNoneMatch sets the optional parameter which makes the operation 2094// fail if the object's ETag matches the given value. This is useful for 2095// getting updates only after the object has changed since the last 2096// request. Use googleapi.IsNotModified to check whether the response 2097// error from Do is the result of In-None-Match. 2098func (c *FoldersListCall) IfNoneMatch(entityTag string) *FoldersListCall { 2099 c.ifNoneMatch_ = entityTag 2100 return c 2101} 2102 2103// Context sets the context to be used in this call's Do method. Any 2104// pending HTTP request will be aborted if the provided context is 2105// canceled. 2106func (c *FoldersListCall) Context(ctx context.Context) *FoldersListCall { 2107 c.ctx_ = ctx 2108 return c 2109} 2110 2111// Header returns an http.Header that can be modified by the caller to 2112// add HTTP headers to the request. 2113func (c *FoldersListCall) Header() http.Header { 2114 if c.header_ == nil { 2115 c.header_ = make(http.Header) 2116 } 2117 return c.header_ 2118} 2119 2120func (c *FoldersListCall) doRequest(alt string) (*http.Response, error) { 2121 reqHeaders := make(http.Header) 2122 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 2123 for k, v := range c.header_ { 2124 reqHeaders[k] = v 2125 } 2126 reqHeaders.Set("User-Agent", c.s.userAgent()) 2127 if c.ifNoneMatch_ != "" { 2128 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2129 } 2130 var body io.Reader = nil 2131 c.urlParams_.Set("alt", alt) 2132 c.urlParams_.Set("prettyPrint", "false") 2133 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/folders") 2134 urls += "?" + c.urlParams_.Encode() 2135 req, err := http.NewRequest("GET", urls, body) 2136 if err != nil { 2137 return nil, err 2138 } 2139 req.Header = reqHeaders 2140 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2141} 2142 2143// Do executes the "cloudresourcemanager.folders.list" call. 2144// Exactly one of *ListFoldersResponse or error will be non-nil. Any 2145// non-2xx status code is an error. Response headers are in either 2146// *ListFoldersResponse.ServerResponse.Header or (if a response was 2147// returned at all) in error.(*googleapi.Error).Header. Use 2148// googleapi.IsNotModified to check whether the returned error was 2149// because http.StatusNotModified was returned. 2150func (c *FoldersListCall) Do(opts ...googleapi.CallOption) (*ListFoldersResponse, error) { 2151 gensupport.SetOptions(c.urlParams_, opts...) 2152 res, err := c.doRequest("json") 2153 if res != nil && res.StatusCode == http.StatusNotModified { 2154 if res.Body != nil { 2155 res.Body.Close() 2156 } 2157 return nil, &googleapi.Error{ 2158 Code: res.StatusCode, 2159 Header: res.Header, 2160 } 2161 } 2162 if err != nil { 2163 return nil, err 2164 } 2165 defer googleapi.CloseBody(res) 2166 if err := googleapi.CheckResponse(res); err != nil { 2167 return nil, err 2168 } 2169 ret := &ListFoldersResponse{ 2170 ServerResponse: googleapi.ServerResponse{ 2171 Header: res.Header, 2172 HTTPStatusCode: res.StatusCode, 2173 }, 2174 } 2175 target := &ret 2176 if err := gensupport.DecodeResponse(target, res); err != nil { 2177 return nil, err 2178 } 2179 return ret, nil 2180 // { 2181 // "description": "Lists the Folders that are direct descendants of supplied parent resource. List provides a strongly consistent view of the Folders underneath the specified parent resource. List returns Folders sorted based upon the (ascending) lexical ordering of their display_name. The caller must have `resourcemanager.folders.list` permission on the identified parent.", 2182 // "flatPath": "v2/folders", 2183 // "httpMethod": "GET", 2184 // "id": "cloudresourcemanager.folders.list", 2185 // "parameterOrder": [], 2186 // "parameters": { 2187 // "pageSize": { 2188 // "description": "Optional. The maximum number of Folders to return in the response. The server can return fewer folders than requested. If unspecified, server picks an appropriate default.", 2189 // "format": "int32", 2190 // "location": "query", 2191 // "type": "integer" 2192 // }, 2193 // "pageToken": { 2194 // "description": "Optional. A pagination token returned from a previous call to `ListFolders` that indicates where this listing should continue from.", 2195 // "location": "query", 2196 // "type": "string" 2197 // }, 2198 // "parent": { 2199 // "description": "Required. The resource name of the Organization or Folder whose Folders are being listed. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. Access to this method is controlled by checking the `resourcemanager.folders.list` permission on the `parent`.", 2200 // "location": "query", 2201 // "type": "string" 2202 // }, 2203 // "showDeleted": { 2204 // "description": "Optional. Controls whether Folders in the DELETE_REQUESTED state should be returned. Defaults to false.", 2205 // "location": "query", 2206 // "type": "boolean" 2207 // } 2208 // }, 2209 // "path": "v2/folders", 2210 // "response": { 2211 // "$ref": "ListFoldersResponse" 2212 // }, 2213 // "scopes": [ 2214 // "https://www.googleapis.com/auth/cloud-platform", 2215 // "https://www.googleapis.com/auth/cloud-platform.read-only" 2216 // ] 2217 // } 2218 2219} 2220 2221// Pages invokes f for each page of results. 2222// A non-nil error returned from f will halt the iteration. 2223// The provided context supersedes any context provided to the Context method. 2224func (c *FoldersListCall) Pages(ctx context.Context, f func(*ListFoldersResponse) error) error { 2225 c.ctx_ = ctx 2226 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2227 for { 2228 x, err := c.Do() 2229 if err != nil { 2230 return err 2231 } 2232 if err := f(x); err != nil { 2233 return err 2234 } 2235 if x.NextPageToken == "" { 2236 return nil 2237 } 2238 c.PageToken(x.NextPageToken) 2239 } 2240} 2241 2242// method id "cloudresourcemanager.folders.move": 2243 2244type FoldersMoveCall struct { 2245 s *Service 2246 name string 2247 movefolderrequest *MoveFolderRequest 2248 urlParams_ gensupport.URLParams 2249 ctx_ context.Context 2250 header_ http.Header 2251} 2252 2253// Move: Moves a Folder under a new resource parent. Returns an 2254// Operation which can be used to track the progress of the folder move 2255// workflow. Upon success the Operation.response field will be populated 2256// with the moved Folder. Upon failure, a FolderOperationError 2257// categorizing the failure cause will be returned - if the failure 2258// occurs synchronously then the FolderOperationError will be returned 2259// via the Status.details field and if it occurs asynchronously then the 2260// FolderOperation will be returned via the Operation.error field. In 2261// addition, the Operation.metadata field will be populated with a 2262// FolderOperation message as an aid to stateless clients. Folder moves 2263// will be rejected if they violate either the naming, height or fanout 2264// constraints described in the CreateFolder documentation. The caller 2265// must have `resourcemanager.folders.move` permission on the folder's 2266// current and proposed new parent. 2267// 2268// - name: The resource name of the Folder to move. Must be of the form 2269// folders/{folder_id}. 2270func (r *FoldersService) Move(name string, movefolderrequest *MoveFolderRequest) *FoldersMoveCall { 2271 c := &FoldersMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2272 c.name = name 2273 c.movefolderrequest = movefolderrequest 2274 return c 2275} 2276 2277// Fields allows partial responses to be retrieved. See 2278// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2279// for more information. 2280func (c *FoldersMoveCall) Fields(s ...googleapi.Field) *FoldersMoveCall { 2281 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2282 return c 2283} 2284 2285// Context sets the context to be used in this call's Do method. Any 2286// pending HTTP request will be aborted if the provided context is 2287// canceled. 2288func (c *FoldersMoveCall) Context(ctx context.Context) *FoldersMoveCall { 2289 c.ctx_ = ctx 2290 return c 2291} 2292 2293// Header returns an http.Header that can be modified by the caller to 2294// add HTTP headers to the request. 2295func (c *FoldersMoveCall) Header() http.Header { 2296 if c.header_ == nil { 2297 c.header_ = make(http.Header) 2298 } 2299 return c.header_ 2300} 2301 2302func (c *FoldersMoveCall) doRequest(alt string) (*http.Response, error) { 2303 reqHeaders := make(http.Header) 2304 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 2305 for k, v := range c.header_ { 2306 reqHeaders[k] = v 2307 } 2308 reqHeaders.Set("User-Agent", c.s.userAgent()) 2309 var body io.Reader = nil 2310 body, err := googleapi.WithoutDataWrapper.JSONReader(c.movefolderrequest) 2311 if err != nil { 2312 return nil, err 2313 } 2314 reqHeaders.Set("Content-Type", "application/json") 2315 c.urlParams_.Set("alt", alt) 2316 c.urlParams_.Set("prettyPrint", "false") 2317 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:move") 2318 urls += "?" + c.urlParams_.Encode() 2319 req, err := http.NewRequest("POST", urls, body) 2320 if err != nil { 2321 return nil, err 2322 } 2323 req.Header = reqHeaders 2324 googleapi.Expand(req.URL, map[string]string{ 2325 "name": c.name, 2326 }) 2327 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2328} 2329 2330// Do executes the "cloudresourcemanager.folders.move" call. 2331// Exactly one of *Operation or error will be non-nil. Any non-2xx 2332// status code is an error. Response headers are in either 2333// *Operation.ServerResponse.Header or (if a response was returned at 2334// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2335// to check whether the returned error was because 2336// http.StatusNotModified was returned. 2337func (c *FoldersMoveCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2338 gensupport.SetOptions(c.urlParams_, opts...) 2339 res, err := c.doRequest("json") 2340 if res != nil && res.StatusCode == http.StatusNotModified { 2341 if res.Body != nil { 2342 res.Body.Close() 2343 } 2344 return nil, &googleapi.Error{ 2345 Code: res.StatusCode, 2346 Header: res.Header, 2347 } 2348 } 2349 if err != nil { 2350 return nil, err 2351 } 2352 defer googleapi.CloseBody(res) 2353 if err := googleapi.CheckResponse(res); err != nil { 2354 return nil, err 2355 } 2356 ret := &Operation{ 2357 ServerResponse: googleapi.ServerResponse{ 2358 Header: res.Header, 2359 HTTPStatusCode: res.StatusCode, 2360 }, 2361 } 2362 target := &ret 2363 if err := gensupport.DecodeResponse(target, res); err != nil { 2364 return nil, err 2365 } 2366 return ret, nil 2367 // { 2368 // "description": "Moves a Folder under a new resource parent. Returns an Operation which can be used to track the progress of the folder move workflow. Upon success the Operation.response field will be populated with the moved Folder. Upon failure, a FolderOperationError categorizing the failure cause will be returned - if the failure occurs synchronously then the FolderOperationError will be returned via the Status.details field and if it occurs asynchronously then the FolderOperation will be returned via the Operation.error field. In addition, the Operation.metadata field will be populated with a FolderOperation message as an aid to stateless clients. Folder moves will be rejected if they violate either the naming, height or fanout constraints described in the CreateFolder documentation. The caller must have `resourcemanager.folders.move` permission on the folder's current and proposed new parent.", 2369 // "flatPath": "v2/folders/{foldersId}:move", 2370 // "httpMethod": "POST", 2371 // "id": "cloudresourcemanager.folders.move", 2372 // "parameterOrder": [ 2373 // "name" 2374 // ], 2375 // "parameters": { 2376 // "name": { 2377 // "description": "Required. The resource name of the Folder to move. Must be of the form folders/{folder_id}", 2378 // "location": "path", 2379 // "pattern": "^folders/[^/]+$", 2380 // "required": true, 2381 // "type": "string" 2382 // } 2383 // }, 2384 // "path": "v2/{+name}:move", 2385 // "request": { 2386 // "$ref": "MoveFolderRequest" 2387 // }, 2388 // "response": { 2389 // "$ref": "Operation" 2390 // }, 2391 // "scopes": [ 2392 // "https://www.googleapis.com/auth/cloud-platform" 2393 // ] 2394 // } 2395 2396} 2397 2398// method id "cloudresourcemanager.folders.patch": 2399 2400type FoldersPatchCall struct { 2401 s *Service 2402 name string 2403 folder *Folder 2404 urlParams_ gensupport.URLParams 2405 ctx_ context.Context 2406 header_ http.Header 2407} 2408 2409// Patch: Updates a Folder, changing its display_name. Changes to the 2410// folder display_name will be rejected if they violate either the 2411// display_name formatting rules or naming constraints described in the 2412// CreateFolder documentation. The Folder's display name must start and 2413// end with a letter or digit, may contain letters, digits, spaces, 2414// hyphens and underscores and can be between 3 and 30 characters. This 2415// is captured by the regular expression: 2416// `\p{L}\p{N}{1,28}[\p{L}\p{N}]`. The caller must have 2417// `resourcemanager.folders.update` permission on the identified folder. 2418// If the update fails due to the unique name constraint then a 2419// PreconditionFailure explaining this violation will be returned in the 2420// Status.details field. 2421// 2422// - name: Output only. The resource name of the Folder. Its format is 2423// `folders/{folder_id}`, for example: "folders/1234". 2424func (r *FoldersService) Patch(name string, folder *Folder) *FoldersPatchCall { 2425 c := &FoldersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2426 c.name = name 2427 c.folder = folder 2428 return c 2429} 2430 2431// UpdateMask sets the optional parameter "updateMask": Required. Fields 2432// to be updated. Only the `display_name` can be updated. 2433func (c *FoldersPatchCall) UpdateMask(updateMask string) *FoldersPatchCall { 2434 c.urlParams_.Set("updateMask", updateMask) 2435 return c 2436} 2437 2438// Fields allows partial responses to be retrieved. See 2439// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2440// for more information. 2441func (c *FoldersPatchCall) Fields(s ...googleapi.Field) *FoldersPatchCall { 2442 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2443 return c 2444} 2445 2446// Context sets the context to be used in this call's Do method. Any 2447// pending HTTP request will be aborted if the provided context is 2448// canceled. 2449func (c *FoldersPatchCall) Context(ctx context.Context) *FoldersPatchCall { 2450 c.ctx_ = ctx 2451 return c 2452} 2453 2454// Header returns an http.Header that can be modified by the caller to 2455// add HTTP headers to the request. 2456func (c *FoldersPatchCall) Header() http.Header { 2457 if c.header_ == nil { 2458 c.header_ = make(http.Header) 2459 } 2460 return c.header_ 2461} 2462 2463func (c *FoldersPatchCall) doRequest(alt string) (*http.Response, error) { 2464 reqHeaders := make(http.Header) 2465 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 2466 for k, v := range c.header_ { 2467 reqHeaders[k] = v 2468 } 2469 reqHeaders.Set("User-Agent", c.s.userAgent()) 2470 var body io.Reader = nil 2471 body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) 2472 if err != nil { 2473 return nil, err 2474 } 2475 reqHeaders.Set("Content-Type", "application/json") 2476 c.urlParams_.Set("alt", alt) 2477 c.urlParams_.Set("prettyPrint", "false") 2478 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 2479 urls += "?" + c.urlParams_.Encode() 2480 req, err := http.NewRequest("PATCH", urls, body) 2481 if err != nil { 2482 return nil, err 2483 } 2484 req.Header = reqHeaders 2485 googleapi.Expand(req.URL, map[string]string{ 2486 "name": c.name, 2487 }) 2488 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2489} 2490 2491// Do executes the "cloudresourcemanager.folders.patch" call. 2492// Exactly one of *Folder or error will be non-nil. Any non-2xx status 2493// code is an error. Response headers are in either 2494// *Folder.ServerResponse.Header or (if a response was returned at all) 2495// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2496// check whether the returned error was because http.StatusNotModified 2497// was returned. 2498func (c *FoldersPatchCall) Do(opts ...googleapi.CallOption) (*Folder, error) { 2499 gensupport.SetOptions(c.urlParams_, opts...) 2500 res, err := c.doRequest("json") 2501 if res != nil && res.StatusCode == http.StatusNotModified { 2502 if res.Body != nil { 2503 res.Body.Close() 2504 } 2505 return nil, &googleapi.Error{ 2506 Code: res.StatusCode, 2507 Header: res.Header, 2508 } 2509 } 2510 if err != nil { 2511 return nil, err 2512 } 2513 defer googleapi.CloseBody(res) 2514 if err := googleapi.CheckResponse(res); err != nil { 2515 return nil, err 2516 } 2517 ret := &Folder{ 2518 ServerResponse: googleapi.ServerResponse{ 2519 Header: res.Header, 2520 HTTPStatusCode: res.StatusCode, 2521 }, 2522 } 2523 target := &ret 2524 if err := gensupport.DecodeResponse(target, res); err != nil { 2525 return nil, err 2526 } 2527 return ret, nil 2528 // { 2529 // "description": "Updates a Folder, changing its display_name. Changes to the folder display_name will be rejected if they violate either the display_name formatting rules or naming constraints described in the CreateFolder documentation. The Folder's display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be between 3 and 30 characters. This is captured by the regular expression: `\\p{L}\\p{N}{1,28}[\\p{L}\\p{N}]`. The caller must have `resourcemanager.folders.update` permission on the identified folder. If the update fails due to the unique name constraint then a PreconditionFailure explaining this violation will be returned in the Status.details field.", 2530 // "flatPath": "v2/folders/{foldersId}", 2531 // "httpMethod": "PATCH", 2532 // "id": "cloudresourcemanager.folders.patch", 2533 // "parameterOrder": [ 2534 // "name" 2535 // ], 2536 // "parameters": { 2537 // "name": { 2538 // "description": "Output only. The resource name of the Folder. Its format is `folders/{folder_id}`, for example: \"folders/1234\".", 2539 // "location": "path", 2540 // "pattern": "^folders/[^/]+$", 2541 // "required": true, 2542 // "type": "string" 2543 // }, 2544 // "updateMask": { 2545 // "description": "Required. Fields to be updated. Only the `display_name` can be updated.", 2546 // "format": "google-fieldmask", 2547 // "location": "query", 2548 // "type": "string" 2549 // } 2550 // }, 2551 // "path": "v2/{+name}", 2552 // "request": { 2553 // "$ref": "Folder" 2554 // }, 2555 // "response": { 2556 // "$ref": "Folder" 2557 // }, 2558 // "scopes": [ 2559 // "https://www.googleapis.com/auth/cloud-platform" 2560 // ] 2561 // } 2562 2563} 2564 2565// method id "cloudresourcemanager.folders.search": 2566 2567type FoldersSearchCall struct { 2568 s *Service 2569 searchfoldersrequest *SearchFoldersRequest 2570 urlParams_ gensupport.URLParams 2571 ctx_ context.Context 2572 header_ http.Header 2573} 2574 2575// Search: Search for folders that match specific filter criteria. 2576// Search provides an eventually consistent view of the folders a user 2577// has access to which meet the specified filter criteria. This will 2578// only return folders on which the caller has the permission 2579// `resourcemanager.folders.get`. 2580func (r *FoldersService) Search(searchfoldersrequest *SearchFoldersRequest) *FoldersSearchCall { 2581 c := &FoldersSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2582 c.searchfoldersrequest = searchfoldersrequest 2583 return c 2584} 2585 2586// Fields allows partial responses to be retrieved. See 2587// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2588// for more information. 2589func (c *FoldersSearchCall) Fields(s ...googleapi.Field) *FoldersSearchCall { 2590 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2591 return c 2592} 2593 2594// Context sets the context to be used in this call's Do method. Any 2595// pending HTTP request will be aborted if the provided context is 2596// canceled. 2597func (c *FoldersSearchCall) Context(ctx context.Context) *FoldersSearchCall { 2598 c.ctx_ = ctx 2599 return c 2600} 2601 2602// Header returns an http.Header that can be modified by the caller to 2603// add HTTP headers to the request. 2604func (c *FoldersSearchCall) Header() http.Header { 2605 if c.header_ == nil { 2606 c.header_ = make(http.Header) 2607 } 2608 return c.header_ 2609} 2610 2611func (c *FoldersSearchCall) doRequest(alt string) (*http.Response, error) { 2612 reqHeaders := make(http.Header) 2613 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 2614 for k, v := range c.header_ { 2615 reqHeaders[k] = v 2616 } 2617 reqHeaders.Set("User-Agent", c.s.userAgent()) 2618 var body io.Reader = nil 2619 body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchfoldersrequest) 2620 if err != nil { 2621 return nil, err 2622 } 2623 reqHeaders.Set("Content-Type", "application/json") 2624 c.urlParams_.Set("alt", alt) 2625 c.urlParams_.Set("prettyPrint", "false") 2626 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/folders:search") 2627 urls += "?" + c.urlParams_.Encode() 2628 req, err := http.NewRequest("POST", urls, body) 2629 if err != nil { 2630 return nil, err 2631 } 2632 req.Header = reqHeaders 2633 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2634} 2635 2636// Do executes the "cloudresourcemanager.folders.search" call. 2637// Exactly one of *SearchFoldersResponse or error will be non-nil. Any 2638// non-2xx status code is an error. Response headers are in either 2639// *SearchFoldersResponse.ServerResponse.Header or (if a response was 2640// returned at all) in error.(*googleapi.Error).Header. Use 2641// googleapi.IsNotModified to check whether the returned error was 2642// because http.StatusNotModified was returned. 2643func (c *FoldersSearchCall) Do(opts ...googleapi.CallOption) (*SearchFoldersResponse, error) { 2644 gensupport.SetOptions(c.urlParams_, opts...) 2645 res, err := c.doRequest("json") 2646 if res != nil && res.StatusCode == http.StatusNotModified { 2647 if res.Body != nil { 2648 res.Body.Close() 2649 } 2650 return nil, &googleapi.Error{ 2651 Code: res.StatusCode, 2652 Header: res.Header, 2653 } 2654 } 2655 if err != nil { 2656 return nil, err 2657 } 2658 defer googleapi.CloseBody(res) 2659 if err := googleapi.CheckResponse(res); err != nil { 2660 return nil, err 2661 } 2662 ret := &SearchFoldersResponse{ 2663 ServerResponse: googleapi.ServerResponse{ 2664 Header: res.Header, 2665 HTTPStatusCode: res.StatusCode, 2666 }, 2667 } 2668 target := &ret 2669 if err := gensupport.DecodeResponse(target, res); err != nil { 2670 return nil, err 2671 } 2672 return ret, nil 2673 // { 2674 // "description": "Search for folders that match specific filter criteria. Search provides an eventually consistent view of the folders a user has access to which meet the specified filter criteria. This will only return folders on which the caller has the permission `resourcemanager.folders.get`.", 2675 // "flatPath": "v2/folders:search", 2676 // "httpMethod": "POST", 2677 // "id": "cloudresourcemanager.folders.search", 2678 // "parameterOrder": [], 2679 // "parameters": {}, 2680 // "path": "v2/folders:search", 2681 // "request": { 2682 // "$ref": "SearchFoldersRequest" 2683 // }, 2684 // "response": { 2685 // "$ref": "SearchFoldersResponse" 2686 // }, 2687 // "scopes": [ 2688 // "https://www.googleapis.com/auth/cloud-platform", 2689 // "https://www.googleapis.com/auth/cloud-platform.read-only" 2690 // ] 2691 // } 2692 2693} 2694 2695// Pages invokes f for each page of results. 2696// A non-nil error returned from f will halt the iteration. 2697// The provided context supersedes any context provided to the Context method. 2698func (c *FoldersSearchCall) Pages(ctx context.Context, f func(*SearchFoldersResponse) error) error { 2699 c.ctx_ = ctx 2700 defer func(pt string) { c.searchfoldersrequest.PageToken = pt }(c.searchfoldersrequest.PageToken) // reset paging to original point 2701 for { 2702 x, err := c.Do() 2703 if err != nil { 2704 return err 2705 } 2706 if err := f(x); err != nil { 2707 return err 2708 } 2709 if x.NextPageToken == "" { 2710 return nil 2711 } 2712 c.searchfoldersrequest.PageToken = x.NextPageToken 2713 } 2714} 2715 2716// method id "cloudresourcemanager.folders.setIamPolicy": 2717 2718type FoldersSetIamPolicyCall struct { 2719 s *Service 2720 resource string 2721 setiampolicyrequest *SetIamPolicyRequest 2722 urlParams_ gensupport.URLParams 2723 ctx_ context.Context 2724 header_ http.Header 2725} 2726 2727// SetIamPolicy: Sets the access control policy on a Folder, replacing 2728// any existing policy. The `resource` field should be the Folder's 2729// resource name, e.g. "folders/1234". The caller must have 2730// `resourcemanager.folders.setIamPolicy` permission on the identified 2731// folder. 2732// 2733// - resource: REQUIRED: The resource for which the policy is being 2734// specified. See the operation documentation for the appropriate 2735// value for this field. 2736func (r *FoldersService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *FoldersSetIamPolicyCall { 2737 c := &FoldersSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2738 c.resource = resource 2739 c.setiampolicyrequest = setiampolicyrequest 2740 return c 2741} 2742 2743// Fields allows partial responses to be retrieved. See 2744// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2745// for more information. 2746func (c *FoldersSetIamPolicyCall) Fields(s ...googleapi.Field) *FoldersSetIamPolicyCall { 2747 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2748 return c 2749} 2750 2751// Context sets the context to be used in this call's Do method. Any 2752// pending HTTP request will be aborted if the provided context is 2753// canceled. 2754func (c *FoldersSetIamPolicyCall) Context(ctx context.Context) *FoldersSetIamPolicyCall { 2755 c.ctx_ = ctx 2756 return c 2757} 2758 2759// Header returns an http.Header that can be modified by the caller to 2760// add HTTP headers to the request. 2761func (c *FoldersSetIamPolicyCall) Header() http.Header { 2762 if c.header_ == nil { 2763 c.header_ = make(http.Header) 2764 } 2765 return c.header_ 2766} 2767 2768func (c *FoldersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 2769 reqHeaders := make(http.Header) 2770 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 2771 for k, v := range c.header_ { 2772 reqHeaders[k] = v 2773 } 2774 reqHeaders.Set("User-Agent", c.s.userAgent()) 2775 var body io.Reader = nil 2776 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 2777 if err != nil { 2778 return nil, err 2779 } 2780 reqHeaders.Set("Content-Type", "application/json") 2781 c.urlParams_.Set("alt", alt) 2782 c.urlParams_.Set("prettyPrint", "false") 2783 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:setIamPolicy") 2784 urls += "?" + c.urlParams_.Encode() 2785 req, err := http.NewRequest("POST", urls, body) 2786 if err != nil { 2787 return nil, err 2788 } 2789 req.Header = reqHeaders 2790 googleapi.Expand(req.URL, map[string]string{ 2791 "resource": c.resource, 2792 }) 2793 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2794} 2795 2796// Do executes the "cloudresourcemanager.folders.setIamPolicy" call. 2797// Exactly one of *Policy or error will be non-nil. Any non-2xx status 2798// code is an error. Response headers are in either 2799// *Policy.ServerResponse.Header or (if a response was returned at all) 2800// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2801// check whether the returned error was because http.StatusNotModified 2802// was returned. 2803func (c *FoldersSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 2804 gensupport.SetOptions(c.urlParams_, opts...) 2805 res, err := c.doRequest("json") 2806 if res != nil && res.StatusCode == http.StatusNotModified { 2807 if res.Body != nil { 2808 res.Body.Close() 2809 } 2810 return nil, &googleapi.Error{ 2811 Code: res.StatusCode, 2812 Header: res.Header, 2813 } 2814 } 2815 if err != nil { 2816 return nil, err 2817 } 2818 defer googleapi.CloseBody(res) 2819 if err := googleapi.CheckResponse(res); err != nil { 2820 return nil, err 2821 } 2822 ret := &Policy{ 2823 ServerResponse: googleapi.ServerResponse{ 2824 Header: res.Header, 2825 HTTPStatusCode: res.StatusCode, 2826 }, 2827 } 2828 target := &ret 2829 if err := gensupport.DecodeResponse(target, res); err != nil { 2830 return nil, err 2831 } 2832 return ret, nil 2833 // { 2834 // "description": "Sets the access control policy on a Folder, replacing any existing policy. The `resource` field should be the Folder's resource name, e.g. \"folders/1234\". The caller must have `resourcemanager.folders.setIamPolicy` permission on the identified folder.", 2835 // "flatPath": "v2/folders/{foldersId}:setIamPolicy", 2836 // "httpMethod": "POST", 2837 // "id": "cloudresourcemanager.folders.setIamPolicy", 2838 // "parameterOrder": [ 2839 // "resource" 2840 // ], 2841 // "parameters": { 2842 // "resource": { 2843 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 2844 // "location": "path", 2845 // "pattern": "^folders/[^/]+$", 2846 // "required": true, 2847 // "type": "string" 2848 // } 2849 // }, 2850 // "path": "v2/{+resource}:setIamPolicy", 2851 // "request": { 2852 // "$ref": "SetIamPolicyRequest" 2853 // }, 2854 // "response": { 2855 // "$ref": "Policy" 2856 // }, 2857 // "scopes": [ 2858 // "https://www.googleapis.com/auth/cloud-platform" 2859 // ] 2860 // } 2861 2862} 2863 2864// method id "cloudresourcemanager.folders.testIamPermissions": 2865 2866type FoldersTestIamPermissionsCall struct { 2867 s *Service 2868 resource string 2869 testiampermissionsrequest *TestIamPermissionsRequest 2870 urlParams_ gensupport.URLParams 2871 ctx_ context.Context 2872 header_ http.Header 2873} 2874 2875// TestIamPermissions: Returns permissions that a caller has on the 2876// specified Folder. The `resource` field should be the Folder's 2877// resource name, e.g. "folders/1234". There are no permissions required 2878// for making this API call. 2879// 2880// - resource: REQUIRED: The resource for which the policy detail is 2881// being requested. See the operation documentation for the 2882// appropriate value for this field. 2883func (r *FoldersService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *FoldersTestIamPermissionsCall { 2884 c := &FoldersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2885 c.resource = resource 2886 c.testiampermissionsrequest = testiampermissionsrequest 2887 return c 2888} 2889 2890// Fields allows partial responses to be retrieved. See 2891// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2892// for more information. 2893func (c *FoldersTestIamPermissionsCall) Fields(s ...googleapi.Field) *FoldersTestIamPermissionsCall { 2894 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2895 return c 2896} 2897 2898// Context sets the context to be used in this call's Do method. Any 2899// pending HTTP request will be aborted if the provided context is 2900// canceled. 2901func (c *FoldersTestIamPermissionsCall) Context(ctx context.Context) *FoldersTestIamPermissionsCall { 2902 c.ctx_ = ctx 2903 return c 2904} 2905 2906// Header returns an http.Header that can be modified by the caller to 2907// add HTTP headers to the request. 2908func (c *FoldersTestIamPermissionsCall) Header() http.Header { 2909 if c.header_ == nil { 2910 c.header_ = make(http.Header) 2911 } 2912 return c.header_ 2913} 2914 2915func (c *FoldersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 2916 reqHeaders := make(http.Header) 2917 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 2918 for k, v := range c.header_ { 2919 reqHeaders[k] = v 2920 } 2921 reqHeaders.Set("User-Agent", c.s.userAgent()) 2922 var body io.Reader = nil 2923 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 2924 if err != nil { 2925 return nil, err 2926 } 2927 reqHeaders.Set("Content-Type", "application/json") 2928 c.urlParams_.Set("alt", alt) 2929 c.urlParams_.Set("prettyPrint", "false") 2930 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:testIamPermissions") 2931 urls += "?" + c.urlParams_.Encode() 2932 req, err := http.NewRequest("POST", urls, body) 2933 if err != nil { 2934 return nil, err 2935 } 2936 req.Header = reqHeaders 2937 googleapi.Expand(req.URL, map[string]string{ 2938 "resource": c.resource, 2939 }) 2940 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2941} 2942 2943// Do executes the "cloudresourcemanager.folders.testIamPermissions" call. 2944// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 2945// Any non-2xx status code is an error. Response headers are in either 2946// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 2947// was returned at all) in error.(*googleapi.Error).Header. Use 2948// googleapi.IsNotModified to check whether the returned error was 2949// because http.StatusNotModified was returned. 2950func (c *FoldersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 2951 gensupport.SetOptions(c.urlParams_, opts...) 2952 res, err := c.doRequest("json") 2953 if res != nil && res.StatusCode == http.StatusNotModified { 2954 if res.Body != nil { 2955 res.Body.Close() 2956 } 2957 return nil, &googleapi.Error{ 2958 Code: res.StatusCode, 2959 Header: res.Header, 2960 } 2961 } 2962 if err != nil { 2963 return nil, err 2964 } 2965 defer googleapi.CloseBody(res) 2966 if err := googleapi.CheckResponse(res); err != nil { 2967 return nil, err 2968 } 2969 ret := &TestIamPermissionsResponse{ 2970 ServerResponse: googleapi.ServerResponse{ 2971 Header: res.Header, 2972 HTTPStatusCode: res.StatusCode, 2973 }, 2974 } 2975 target := &ret 2976 if err := gensupport.DecodeResponse(target, res); err != nil { 2977 return nil, err 2978 } 2979 return ret, nil 2980 // { 2981 // "description": "Returns permissions that a caller has on the specified Folder. The `resource` field should be the Folder's resource name, e.g. \"folders/1234\". There are no permissions required for making this API call.", 2982 // "flatPath": "v2/folders/{foldersId}:testIamPermissions", 2983 // "httpMethod": "POST", 2984 // "id": "cloudresourcemanager.folders.testIamPermissions", 2985 // "parameterOrder": [ 2986 // "resource" 2987 // ], 2988 // "parameters": { 2989 // "resource": { 2990 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 2991 // "location": "path", 2992 // "pattern": "^folders/[^/]+$", 2993 // "required": true, 2994 // "type": "string" 2995 // } 2996 // }, 2997 // "path": "v2/{+resource}:testIamPermissions", 2998 // "request": { 2999 // "$ref": "TestIamPermissionsRequest" 3000 // }, 3001 // "response": { 3002 // "$ref": "TestIamPermissionsResponse" 3003 // }, 3004 // "scopes": [ 3005 // "https://www.googleapis.com/auth/cloud-platform" 3006 // ] 3007 // } 3008 3009} 3010 3011// method id "cloudresourcemanager.folders.undelete": 3012 3013type FoldersUndeleteCall struct { 3014 s *Service 3015 name string 3016 undeletefolderrequest *UndeleteFolderRequest 3017 urlParams_ gensupport.URLParams 3018 ctx_ context.Context 3019 header_ http.Header 3020} 3021 3022// Undelete: Cancels the deletion request for a Folder. This method may 3023// only be called on a Folder in the DELETE_REQUESTED state. In order to 3024// succeed, the Folder's parent must be in the ACTIVE state. In 3025// addition, reintroducing the folder into the tree must not violate 3026// folder naming, height and fanout constraints described in the 3027// CreateFolder documentation. The caller must have 3028// `resourcemanager.folders.undelete` permission on the identified 3029// folder. 3030// 3031// - name: The resource name of the Folder to undelete. Must be of the 3032// form `folders/{folder_id}`. 3033func (r *FoldersService) Undelete(name string, undeletefolderrequest *UndeleteFolderRequest) *FoldersUndeleteCall { 3034 c := &FoldersUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3035 c.name = name 3036 c.undeletefolderrequest = undeletefolderrequest 3037 return c 3038} 3039 3040// Fields allows partial responses to be retrieved. See 3041// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3042// for more information. 3043func (c *FoldersUndeleteCall) Fields(s ...googleapi.Field) *FoldersUndeleteCall { 3044 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3045 return c 3046} 3047 3048// Context sets the context to be used in this call's Do method. Any 3049// pending HTTP request will be aborted if the provided context is 3050// canceled. 3051func (c *FoldersUndeleteCall) Context(ctx context.Context) *FoldersUndeleteCall { 3052 c.ctx_ = ctx 3053 return c 3054} 3055 3056// Header returns an http.Header that can be modified by the caller to 3057// add HTTP headers to the request. 3058func (c *FoldersUndeleteCall) Header() http.Header { 3059 if c.header_ == nil { 3060 c.header_ = make(http.Header) 3061 } 3062 return c.header_ 3063} 3064 3065func (c *FoldersUndeleteCall) doRequest(alt string) (*http.Response, error) { 3066 reqHeaders := make(http.Header) 3067 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 3068 for k, v := range c.header_ { 3069 reqHeaders[k] = v 3070 } 3071 reqHeaders.Set("User-Agent", c.s.userAgent()) 3072 var body io.Reader = nil 3073 body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletefolderrequest) 3074 if err != nil { 3075 return nil, err 3076 } 3077 reqHeaders.Set("Content-Type", "application/json") 3078 c.urlParams_.Set("alt", alt) 3079 c.urlParams_.Set("prettyPrint", "false") 3080 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") 3081 urls += "?" + c.urlParams_.Encode() 3082 req, err := http.NewRequest("POST", urls, body) 3083 if err != nil { 3084 return nil, err 3085 } 3086 req.Header = reqHeaders 3087 googleapi.Expand(req.URL, map[string]string{ 3088 "name": c.name, 3089 }) 3090 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3091} 3092 3093// Do executes the "cloudresourcemanager.folders.undelete" call. 3094// Exactly one of *Folder or error will be non-nil. Any non-2xx status 3095// code is an error. Response headers are in either 3096// *Folder.ServerResponse.Header or (if a response was returned at all) 3097// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3098// check whether the returned error was because http.StatusNotModified 3099// was returned. 3100func (c *FoldersUndeleteCall) Do(opts ...googleapi.CallOption) (*Folder, error) { 3101 gensupport.SetOptions(c.urlParams_, opts...) 3102 res, err := c.doRequest("json") 3103 if res != nil && res.StatusCode == http.StatusNotModified { 3104 if res.Body != nil { 3105 res.Body.Close() 3106 } 3107 return nil, &googleapi.Error{ 3108 Code: res.StatusCode, 3109 Header: res.Header, 3110 } 3111 } 3112 if err != nil { 3113 return nil, err 3114 } 3115 defer googleapi.CloseBody(res) 3116 if err := googleapi.CheckResponse(res); err != nil { 3117 return nil, err 3118 } 3119 ret := &Folder{ 3120 ServerResponse: googleapi.ServerResponse{ 3121 Header: res.Header, 3122 HTTPStatusCode: res.StatusCode, 3123 }, 3124 } 3125 target := &ret 3126 if err := gensupport.DecodeResponse(target, res); err != nil { 3127 return nil, err 3128 } 3129 return ret, nil 3130 // { 3131 // "description": "Cancels the deletion request for a Folder. This method may only be called on a Folder in the DELETE_REQUESTED state. In order to succeed, the Folder's parent must be in the ACTIVE state. In addition, reintroducing the folder into the tree must not violate folder naming, height and fanout constraints described in the CreateFolder documentation. The caller must have `resourcemanager.folders.undelete` permission on the identified folder.", 3132 // "flatPath": "v2/folders/{foldersId}:undelete", 3133 // "httpMethod": "POST", 3134 // "id": "cloudresourcemanager.folders.undelete", 3135 // "parameterOrder": [ 3136 // "name" 3137 // ], 3138 // "parameters": { 3139 // "name": { 3140 // "description": "Required. The resource name of the Folder to undelete. Must be of the form `folders/{folder_id}`.", 3141 // "location": "path", 3142 // "pattern": "^folders/[^/]+$", 3143 // "required": true, 3144 // "type": "string" 3145 // } 3146 // }, 3147 // "path": "v2/{+name}:undelete", 3148 // "request": { 3149 // "$ref": "UndeleteFolderRequest" 3150 // }, 3151 // "response": { 3152 // "$ref": "Folder" 3153 // }, 3154 // "scopes": [ 3155 // "https://www.googleapis.com/auth/cloud-platform" 3156 // ] 3157 // } 3158 3159} 3160 3161// method id "cloudresourcemanager.operations.get": 3162 3163type OperationsGetCall struct { 3164 s *Service 3165 name string 3166 urlParams_ gensupport.URLParams 3167 ifNoneMatch_ string 3168 ctx_ context.Context 3169 header_ http.Header 3170} 3171 3172// Get: Gets the latest state of a long-running operation. Clients can 3173// use this method to poll the operation result at intervals as 3174// recommended by the API service. 3175// 3176// - name: The name of the operation resource. 3177func (r *OperationsService) Get(name string) *OperationsGetCall { 3178 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3179 c.name = name 3180 return c 3181} 3182 3183// Fields allows partial responses to be retrieved. See 3184// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3185// for more information. 3186func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 3187 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3188 return c 3189} 3190 3191// IfNoneMatch sets the optional parameter which makes the operation 3192// fail if the object's ETag matches the given value. This is useful for 3193// getting updates only after the object has changed since the last 3194// request. Use googleapi.IsNotModified to check whether the response 3195// error from Do is the result of In-None-Match. 3196func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 3197 c.ifNoneMatch_ = entityTag 3198 return c 3199} 3200 3201// Context sets the context to be used in this call's Do method. Any 3202// pending HTTP request will be aborted if the provided context is 3203// canceled. 3204func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 3205 c.ctx_ = ctx 3206 return c 3207} 3208 3209// Header returns an http.Header that can be modified by the caller to 3210// add HTTP headers to the request. 3211func (c *OperationsGetCall) Header() http.Header { 3212 if c.header_ == nil { 3213 c.header_ = make(http.Header) 3214 } 3215 return c.header_ 3216} 3217 3218func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 3219 reqHeaders := make(http.Header) 3220 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211201") 3221 for k, v := range c.header_ { 3222 reqHeaders[k] = v 3223 } 3224 reqHeaders.Set("User-Agent", c.s.userAgent()) 3225 if c.ifNoneMatch_ != "" { 3226 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3227 } 3228 var body io.Reader = nil 3229 c.urlParams_.Set("alt", alt) 3230 c.urlParams_.Set("prettyPrint", "false") 3231 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 3232 urls += "?" + c.urlParams_.Encode() 3233 req, err := http.NewRequest("GET", urls, body) 3234 if err != nil { 3235 return nil, err 3236 } 3237 req.Header = reqHeaders 3238 googleapi.Expand(req.URL, map[string]string{ 3239 "name": c.name, 3240 }) 3241 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3242} 3243 3244// Do executes the "cloudresourcemanager.operations.get" call. 3245// Exactly one of *Operation or error will be non-nil. Any non-2xx 3246// status code is an error. Response headers are in either 3247// *Operation.ServerResponse.Header or (if a response was returned at 3248// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3249// to check whether the returned error was because 3250// http.StatusNotModified was returned. 3251func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3252 gensupport.SetOptions(c.urlParams_, opts...) 3253 res, err := c.doRequest("json") 3254 if res != nil && res.StatusCode == http.StatusNotModified { 3255 if res.Body != nil { 3256 res.Body.Close() 3257 } 3258 return nil, &googleapi.Error{ 3259 Code: res.StatusCode, 3260 Header: res.Header, 3261 } 3262 } 3263 if err != nil { 3264 return nil, err 3265 } 3266 defer googleapi.CloseBody(res) 3267 if err := googleapi.CheckResponse(res); err != nil { 3268 return nil, err 3269 } 3270 ret := &Operation{ 3271 ServerResponse: googleapi.ServerResponse{ 3272 Header: res.Header, 3273 HTTPStatusCode: res.StatusCode, 3274 }, 3275 } 3276 target := &ret 3277 if err := gensupport.DecodeResponse(target, res); err != nil { 3278 return nil, err 3279 } 3280 return ret, nil 3281 // { 3282 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", 3283 // "flatPath": "v1/operations/{operationsId}", 3284 // "httpMethod": "GET", 3285 // "id": "cloudresourcemanager.operations.get", 3286 // "parameterOrder": [ 3287 // "name" 3288 // ], 3289 // "parameters": { 3290 // "name": { 3291 // "description": "The name of the operation resource.", 3292 // "location": "path", 3293 // "pattern": "^operations/.*$", 3294 // "required": true, 3295 // "type": "string" 3296 // } 3297 // }, 3298 // "path": "v1/{+name}", 3299 // "response": { 3300 // "$ref": "Operation" 3301 // }, 3302 // "scopes": [ 3303 // "https://www.googleapis.com/auth/cloud-platform", 3304 // "https://www.googleapis.com/auth/cloud-platform.read-only" 3305 // ] 3306 // } 3307 3308} 3309