1 // Copyright 2024 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 // # Library status 12 // 13 // These client libraries are officially supported by Google. However, this 14 // library is considered complete and is in maintenance mode. This means 15 // that we will address critical bugs and security issues but will not add 16 // any new features. 17 // 18 // When possible, we recommend using our newer 19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) 20 // that are still actively being worked and iterated on. 21 // 22 // # Creating a client 23 // 24 // Usage example: 25 // 26 // import "google.golang.org/api/cloudresourcemanager/v2" 27 // ... 28 // ctx := context.Background() 29 // cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx) 30 // 31 // In this example, Google Application Default Credentials are used for 32 // authentication. For information on how to create and obtain Application 33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 34 // 35 // # Other authentication options 36 // 37 // By default, all available scopes (see "Constants") are used to authenticate. 38 // To restrict scopes, use [google.golang.org/api/option.WithScopes]: 39 // 40 // cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx, option.WithScopes(cloudresourcemanager.CloudPlatformReadOnlyScope)) 41 // 42 // To use an API key for authentication (note: some APIs do not support API 43 // keys), use [google.golang.org/api/option.WithAPIKey]: 44 // 45 // cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx, option.WithAPIKey("AIza...")) 46 // 47 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 48 // flow, use [google.golang.org/api/option.WithTokenSource]: 49 // 50 // config := &oauth2.Config{...} 51 // // ... 52 // token, err := config.Exchange(ctx, ...) 53 // cloudresourcemanagerService, err := cloudresourcemanager.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 54 // 55 // See [google.golang.org/api/option.ClientOption] for details on options. 56 package cloudresourcemanager // import "google.golang.org/api/cloudresourcemanager/v2" 57 58 import ( 59 "bytes" 60 "context" 61 "encoding/json" 62 "errors" 63 "fmt" 64 "io" 65 "net/http" 66 "net/url" 67 "strconv" 68 "strings" 69 70 googleapi "google.golang.org/api/googleapi" 71 internal "google.golang.org/api/internal" 72 gensupport "google.golang.org/api/internal/gensupport" 73 option "google.golang.org/api/option" 74 internaloption "google.golang.org/api/option/internaloption" 75 htransport "google.golang.org/api/transport/http" 76 ) 77 78 // Always reference these packages, just in case the auto-generated code 79 // below doesn't. 80 var _ = bytes.NewBuffer 81 var _ = strconv.Itoa 82 var _ = fmt.Sprintf 83 var _ = json.NewDecoder 84 var _ = io.Copy 85 var _ = url.Parse 86 var _ = gensupport.MarshalJSON 87 var _ = googleapi.Version 88 var _ = errors.New 89 var _ = strings.Replace 90 var _ = context.Canceled 91 var _ = internaloption.WithDefaultEndpoint 92 var _ = internal.Version 93 94 const apiId = "cloudresourcemanager:v2" 95 const apiName = "cloudresourcemanager" 96 const apiVersion = "v2" 97 const basePath = "https://cloudresourcemanager.googleapis.com/" 98 const basePathTemplate = "https://cloudresourcemanager.UNIVERSE_DOMAIN/" 99 const mtlsBasePath = "https://cloudresourcemanager.mtls.googleapis.com/" 100 101 // OAuth2 scopes used by this API. 102 const ( 103 // See, edit, configure, and delete your Google Cloud data and see the email 104 // address for your Google Account. 105 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 106 107 // View your data across Google Cloud services and see the email address of 108 // your Google Account 109 CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" 110 ) 111 112 // NewService creates a new Service. 113 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 114 scopesOption := internaloption.WithDefaultScopes( 115 "https://www.googleapis.com/auth/cloud-platform", 116 "https://www.googleapis.com/auth/cloud-platform.read-only", 117 ) 118 // NOTE: prepend, so we don't override user-specified scopes. 119 opts = append([]option.ClientOption{scopesOption}, opts...) 120 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 121 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 122 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 123 opts = append(opts, internaloption.EnableNewAuthLibrary()) 124 client, endpoint, err := htransport.NewClient(ctx, opts...) 125 if err != nil { 126 return nil, err 127 } 128 s, err := New(client) 129 if err != nil { 130 return nil, err 131 } 132 if endpoint != "" { 133 s.BasePath = endpoint 134 } 135 return s, nil 136 } 137 138 // New creates a new Service. It uses the provided http.Client for requests. 139 // 140 // Deprecated: please use NewService instead. 141 // To provide a custom HTTP client, use option.WithHTTPClient. 142 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 143 func New(client *http.Client) (*Service, error) { 144 if client == nil { 145 return nil, errors.New("client is nil") 146 } 147 s := &Service{client: client, BasePath: basePath} 148 s.Folders = NewFoldersService(s) 149 s.Operations = NewOperationsService(s) 150 return s, nil 151 } 152 153 type Service struct { 154 client *http.Client 155 BasePath string // API endpoint base URL 156 UserAgent string // optional additional User-Agent fragment 157 158 Folders *FoldersService 159 160 Operations *OperationsService 161 } 162 163 func (s *Service) userAgent() string { 164 if s.UserAgent == "" { 165 return googleapi.UserAgent 166 } 167 return googleapi.UserAgent + " " + s.UserAgent 168 } 169 170 func NewFoldersService(s *Service) *FoldersService { 171 rs := &FoldersService{s: s} 172 return rs 173 } 174 175 type FoldersService struct { 176 s *Service 177 } 178 179 func NewOperationsService(s *Service) *OperationsService { 180 rs := &OperationsService{s: s} 181 return rs 182 } 183 184 type OperationsService struct { 185 s *Service 186 } 187 188 // AuditConfig: Specifies the audit configuration for a service. The 189 // configuration determines which permission types are logged, and what 190 // identities, if any, are exempted from logging. An AuditConfig must have one 191 // or more AuditLogConfigs. If there are AuditConfigs for both `allServices` 192 // and a specific service, the union of the two AuditConfigs is used for that 193 // service: the log_types specified in each AuditConfig are enabled, and the 194 // exempted_members in each AuditLogConfig are exempted. Example Policy with 195 // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices", 196 // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ 197 // "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": 198 // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", 199 // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": 200 // "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For 201 // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ 202 // logging. It also exempts `jose@example.com` from DATA_READ logging, and 203 // `aliya@example.com` from DATA_WRITE logging. 204 type AuditConfig struct { 205 // AuditLogConfigs: The configuration for logging of each type of permission. 206 AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"` 207 // Service: Specifies a service that will be enabled for audit logging. For 208 // example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` 209 // is a special value that covers all services. 210 Service string `json:"service,omitempty"` 211 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to 212 // unconditionally include in API requests. By default, fields with empty or 213 // default values are omitted from API requests. See 214 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 215 // details. 216 ForceSendFields []string `json:"-"` 217 // NullFields is a list of field names (e.g. "AuditLogConfigs") to include in 218 // API requests with the JSON null value. By default, fields with empty values 219 // are omitted from API requests. See 220 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 221 NullFields []string `json:"-"` 222 } 223 224 func (s *AuditConfig) MarshalJSON() ([]byte, error) { 225 type NoMethod AuditConfig 226 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 227 } 228 229 // AuditLogConfig: Provides the configuration for logging a type of 230 // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ", 231 // "exempted_members": [ "user:jose@example.com" ] }, { "log_type": 232 // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while 233 // exempting jose@example.com from DATA_READ logging. 234 type AuditLogConfig struct { 235 // ExemptedMembers: Specifies the identities that do not cause logging for this 236 // type of permission. Follows the same format of Binding.members. 237 ExemptedMembers []string `json:"exemptedMembers,omitempty"` 238 // LogType: The log type that this config enables. 239 // 240 // Possible values: 241 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this. 242 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy 243 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create 244 // "DATA_READ" - Data reads. Example: CloudSQL Users list 245 LogType string `json:"logType,omitempty"` 246 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to 247 // unconditionally include in API requests. By default, fields with empty or 248 // default values are omitted from API requests. See 249 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 250 // details. 251 ForceSendFields []string `json:"-"` 252 // NullFields is a list of field names (e.g. "ExemptedMembers") to include in 253 // API requests with the JSON null value. By default, fields with empty values 254 // are omitted from API requests. See 255 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 256 NullFields []string `json:"-"` 257 } 258 259 func (s *AuditLogConfig) MarshalJSON() ([]byte, error) { 260 type NoMethod AuditLogConfig 261 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 262 } 263 264 // Binding: Associates `members`, or principals, with a `role`. 265 type Binding struct { 266 // Condition: The condition that is associated with this binding. If the 267 // condition evaluates to `true`, then this binding applies to the current 268 // request. If the condition evaluates to `false`, then this binding does not 269 // apply to the current request. However, a different role binding might grant 270 // the same role to one or more of the principals in this binding. To learn 271 // which resources support conditions in their IAM policies, see the IAM 272 // documentation 273 // (https://cloud.google.com/iam/help/conditions/resource-policies). 274 Condition *Expr `json:"condition,omitempty"` 275 // Members: Specifies the principals requesting access for a Google Cloud 276 // resource. `members` can have the following values: * `allUsers`: A special 277 // identifier that represents anyone who is on the internet; with or without a 278 // Google account. * `allAuthenticatedUsers`: A special identifier that 279 // represents anyone who is authenticated with a Google account or a service 280 // account. Does not include identities that come from external identity 281 // providers (IdPs) through identity federation. * `user:{emailid}`: An email 282 // address that represents a specific Google account. For example, 283 // `alice@example.com` . * `serviceAccount:{emailid}`: An email address that 284 // represents a Google service account. For example, 285 // `my-other-app@appspot.gserviceaccount.com`. * 286 // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An 287 // identifier for a Kubernetes service account 288 // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). 289 // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * 290 // `group:{emailid}`: An email address that represents a Google group. For 291 // example, `admins@example.com`. * `domain:{domain}`: The G Suite domain 292 // (primary) that represents all the users of that domain. For example, 293 // `google.com` or `example.com`. * 294 // `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub 295 // ject/{subject_attribute_value}`: A single identity in a workforce identity 296 // pool. * 297 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/ 298 // group/{group_id}`: All workforce identities in a group. * 299 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/ 300 // attribute.{attribute_name}/{attribute_value}`: All workforce identities with 301 // a specific attribute value. * 302 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/ 303 // *`: All identities in a workforce identity pool. * 304 // `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo 305 // rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single 306 // identity in a workload identity pool. * 307 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global 308 // /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool 309 // group. * 310 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global 311 // /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value} 312 // `: All identities in a workload identity pool with a certain attribute. * 313 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global 314 // /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity 315 // pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus 316 // unique identifier) representing a user that has been recently deleted. For 317 // example, `alice@example.com?uid=123456789012345678901`. If the user is 318 // recovered, this value reverts to `user:{emailid}` and the recovered user 319 // retains the role in the binding. * 320 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus 321 // unique identifier) representing a service account that has been recently 322 // deleted. For example, 323 // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the 324 // service account is undeleted, this value reverts to 325 // `serviceAccount:{emailid}` and the undeleted service account retains the 326 // role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email 327 // address (plus unique identifier) representing a Google group that has been 328 // recently deleted. For example, 329 // `admins@example.com?uid=123456789012345678901`. If the group is recovered, 330 // this value reverts to `group:{emailid}` and the recovered group retains the 331 // role in the binding. * 332 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool 333 // _id}/subject/{subject_attribute_value}`: Deleted single identity in a 334 // workforce identity pool. For example, 335 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po 336 // ol-id/subject/my-subject-attribute-value`. 337 Members []string `json:"members,omitempty"` 338 // Role: Role that is assigned to the list of `members`, or principals. For 339 // example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview 340 // of the IAM roles and permissions, see the IAM documentation 341 // (https://cloud.google.com/iam/docs/roles-overview). For a list of the 342 // available pre-defined roles, see here 343 // (https://cloud.google.com/iam/docs/understanding-roles). 344 Role string `json:"role,omitempty"` 345 // ForceSendFields is a list of field names (e.g. "Condition") to 346 // unconditionally include in API requests. By default, fields with empty or 347 // default values are omitted from API requests. See 348 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 349 // details. 350 ForceSendFields []string `json:"-"` 351 // NullFields is a list of field names (e.g. "Condition") to include in API 352 // requests with the JSON null value. By default, fields with empty values are 353 // omitted from API requests. See 354 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 355 NullFields []string `json:"-"` 356 } 357 358 func (s *Binding) MarshalJSON() ([]byte, error) { 359 type NoMethod Binding 360 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 361 } 362 363 // CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation: 364 // Metadata describing a long running folder operation 365 type CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation struct { 366 // DestinationParent: The resource name of the folder or organization we are 367 // either creating the folder under or moving the folder to. 368 DestinationParent string `json:"destinationParent,omitempty"` 369 // DisplayName: The display name of the folder. 370 DisplayName string `json:"displayName,omitempty"` 371 // OperationType: The type of this operation. 372 // 373 // Possible values: 374 // "OPERATION_TYPE_UNSPECIFIED" - Operation type not specified. 375 // "CREATE" - A create folder operation. 376 // "MOVE" - A move folder operation. 377 OperationType string `json:"operationType,omitempty"` 378 // SourceParent: The resource name of the folder's parent. Only applicable when 379 // the operation_type is MOVE. 380 SourceParent string `json:"sourceParent,omitempty"` 381 // ForceSendFields is a list of field names (e.g. "DestinationParent") to 382 // unconditionally include in API requests. By default, fields with empty or 383 // default values are omitted from API requests. See 384 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 385 // details. 386 ForceSendFields []string `json:"-"` 387 // NullFields is a list of field names (e.g. "DestinationParent") to include in 388 // API requests with the JSON null value. By default, fields with empty values 389 // are omitted from API requests. See 390 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 391 NullFields []string `json:"-"` 392 } 393 394 func (s *CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation) MarshalJSON() ([]byte, error) { 395 type NoMethod CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation 396 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 397 } 398 399 // CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation: 400 // Metadata describing a long running folder operation 401 type CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation struct { 402 // DestinationParent: The resource name of the folder or organization we are 403 // either creating the folder under or moving the folder to. 404 DestinationParent string `json:"destinationParent,omitempty"` 405 // DisplayName: The display name of the folder. 406 DisplayName string `json:"displayName,omitempty"` 407 // OperationType: The type of this operation. 408 // 409 // Possible values: 410 // "OPERATION_TYPE_UNSPECIFIED" - Operation type not specified. 411 // "CREATE" - A create folder operation. 412 // "MOVE" - A move folder operation. 413 OperationType string `json:"operationType,omitempty"` 414 // SourceParent: The resource name of the folder's parent. Only applicable when 415 // the operation_type is MOVE. 416 SourceParent string `json:"sourceParent,omitempty"` 417 // ForceSendFields is a list of field names (e.g. "DestinationParent") to 418 // unconditionally include in API requests. By default, fields with empty or 419 // default values are omitted from API requests. See 420 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 421 // details. 422 ForceSendFields []string `json:"-"` 423 // NullFields is a list of field names (e.g. "DestinationParent") to include in 424 // API requests with the JSON null value. By default, fields with empty values 425 // are omitted from API requests. See 426 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 427 NullFields []string `json:"-"` 428 } 429 430 func (s *CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation) MarshalJSON() ([]byte, error) { 431 type NoMethod CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation 432 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 433 } 434 435 // CreateFolderMetadata: Metadata pertaining to the Folder creation process. 436 type CreateFolderMetadata struct { 437 // DisplayName: The display name of the folder. 438 DisplayName string `json:"displayName,omitempty"` 439 // Parent: The resource name of the folder or organization we are creating the 440 // folder under. 441 Parent string `json:"parent,omitempty"` 442 // ForceSendFields is a list of field names (e.g. "DisplayName") to 443 // unconditionally include in API requests. By default, fields with empty or 444 // default values are omitted from API requests. See 445 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 446 // details. 447 ForceSendFields []string `json:"-"` 448 // NullFields is a list of field names (e.g. "DisplayName") to include in API 449 // requests with the JSON null value. By default, fields with empty values are 450 // omitted from API requests. See 451 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 452 NullFields []string `json:"-"` 453 } 454 455 func (s *CreateFolderMetadata) MarshalJSON() ([]byte, error) { 456 type NoMethod CreateFolderMetadata 457 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 458 } 459 460 // CreateProjectMetadata: A status object which is used as the `metadata` field 461 // for the Operation returned by CreateProject. It provides insight for when 462 // significant phases of Project creation have completed. 463 type CreateProjectMetadata struct { 464 // CreateTime: Creation time of the project creation workflow. 465 CreateTime string `json:"createTime,omitempty"` 466 // Gettable: True if the project can be retrieved using `GetProject`. No other 467 // operations on the project are guaranteed to work until the project creation 468 // is complete. 469 Gettable bool `json:"gettable,omitempty"` 470 // Ready: True if the project creation process is complete. 471 Ready bool `json:"ready,omitempty"` 472 // ForceSendFields is a list of field names (e.g. "CreateTime") to 473 // unconditionally include in API requests. By default, fields with empty or 474 // default values are omitted from API requests. See 475 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 476 // details. 477 ForceSendFields []string `json:"-"` 478 // NullFields is a list of field names (e.g. "CreateTime") to include in API 479 // requests with the JSON null value. By default, fields with empty values are 480 // omitted from API requests. See 481 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 482 NullFields []string `json:"-"` 483 } 484 485 func (s *CreateProjectMetadata) MarshalJSON() ([]byte, error) { 486 type NoMethod CreateProjectMetadata 487 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 488 } 489 490 // CreateTagBindingMetadata: Runtime operation information for creating a 491 // TagValue. 492 type CreateTagBindingMetadata struct { 493 } 494 495 // CreateTagKeyMetadata: Runtime operation information for creating a TagKey. 496 type CreateTagKeyMetadata struct { 497 } 498 499 // CreateTagValueMetadata: Runtime operation information for creating a 500 // TagValue. 501 type CreateTagValueMetadata struct { 502 } 503 504 // DeleteFolderMetadata: A status object which is used as the `metadata` field 505 // for the `Operation` returned by `DeleteFolder`. 506 type DeleteFolderMetadata struct { 507 } 508 509 // DeleteOrganizationMetadata: A status object which is used as the `metadata` 510 // field for the operation returned by DeleteOrganization. 511 type DeleteOrganizationMetadata struct { 512 } 513 514 // DeleteProjectMetadata: A status object which is used as the `metadata` field 515 // for the Operation returned by `DeleteProject`. 516 type DeleteProjectMetadata struct { 517 } 518 519 // DeleteTagBindingMetadata: Runtime operation information for deleting a 520 // TagBinding. 521 type DeleteTagBindingMetadata struct { 522 } 523 524 // DeleteTagKeyMetadata: Runtime operation information for deleting a TagKey. 525 type DeleteTagKeyMetadata struct { 526 } 527 528 // DeleteTagValueMetadata: Runtime operation information for deleting a 529 // TagValue. 530 type DeleteTagValueMetadata struct { 531 } 532 533 // Expr: Represents a textual expression in the Common Expression Language 534 // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics 535 // of CEL are documented at https://github.com/google/cel-spec. Example 536 // (Comparison): title: "Summary size limit" description: "Determines if a 537 // summary is less than 100 chars" expression: "document.summary.size() < 100" 538 // Example (Equality): title: "Requestor is owner" description: "Determines if 539 // requestor is the document owner" expression: "document.owner == 540 // request.auth.claims.email" Example (Logic): title: "Public documents" 541 // description: "Determine whether the document should be publicly visible" 542 // expression: "document.type != 'private' && document.type != 'internal'" 543 // Example (Data Manipulation): title: "Notification string" description: 544 // "Create a notification string with a timestamp." expression: "'New message 545 // received at ' + string(document.create_time)" The exact variables and 546 // functions that may be referenced within an expression are determined by the 547 // service that evaluates it. See the service documentation for additional 548 // information. 549 type Expr struct { 550 // Description: Optional. Description of the expression. This is a longer text 551 // which describes the expression, e.g. when hovered over it in a UI. 552 Description string `json:"description,omitempty"` 553 // Expression: Textual representation of an expression in Common Expression 554 // Language syntax. 555 Expression string `json:"expression,omitempty"` 556 // Location: Optional. String indicating the location of the expression for 557 // error reporting, e.g. a file name and a position in the file. 558 Location string `json:"location,omitempty"` 559 // Title: Optional. Title for the expression, i.e. a short string describing 560 // its purpose. This can be used e.g. in UIs which allow to enter the 561 // expression. 562 Title string `json:"title,omitempty"` 563 // ForceSendFields is a list of field names (e.g. "Description") to 564 // unconditionally include in API requests. By default, fields with empty or 565 // default values are omitted from API requests. See 566 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 567 // details. 568 ForceSendFields []string `json:"-"` 569 // NullFields is a list of field names (e.g. "Description") to include in API 570 // requests with the JSON null value. By default, fields with empty values are 571 // omitted from API requests. See 572 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 573 NullFields []string `json:"-"` 574 } 575 576 func (s *Expr) MarshalJSON() ([]byte, error) { 577 type NoMethod Expr 578 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 579 } 580 581 // Folder: A Folder in an Organization's resource hierarchy, used to organize 582 // that Organization's resources. 583 type Folder struct { 584 // CreateTime: Output only. Timestamp when the Folder was created. Assigned by 585 // the server. 586 CreateTime string `json:"createTime,omitempty"` 587 // DisplayName: The folder's display name. A folder's display name must be 588 // unique amongst its siblings, e.g. no two folders with the same parent can 589 // share the same display name. The display name must start and end with a 590 // letter or digit, may contain letters, digits, spaces, hyphens and 591 // underscores and can be no longer than 30 characters. This is captured by the 592 // regular expression: `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`. 593 DisplayName string `json:"displayName,omitempty"` 594 // LifecycleState: Output only. The lifecycle state of the folder. Updates to 595 // the lifecycle_state must be performed via DeleteFolder and UndeleteFolder. 596 // 597 // Possible values: 598 // "LIFECYCLE_STATE_UNSPECIFIED" - Unspecified state. 599 // "ACTIVE" - The normal and active state. 600 // "DELETE_REQUESTED" - The folder has been marked for deletion by the user. 601 LifecycleState string `json:"lifecycleState,omitempty"` 602 // Name: Output only. The resource name of the Folder. Its format is 603 // `folders/{folder_id}`, for example: "folders/1234". 604 Name string `json:"name,omitempty"` 605 // Parent: Required. The Folder's parent's resource name. Updates to the 606 // folder's parent must be performed via MoveFolder. 607 Parent string `json:"parent,omitempty"` 608 // Tags: Optional. Input only. Immutable. Tag keys/values directly bound to 609 // this folder. Each item in the map must be expressed as " : ". For example: 610 // "123/environment" : "production", "123/costCenter" : "marketing" Note: 611 // Currently this field is in Preview. 612 Tags map[string]string `json:"tags,omitempty"` 613 614 // ServerResponse contains the HTTP response code and headers from the server. 615 googleapi.ServerResponse `json:"-"` 616 // ForceSendFields is a list of field names (e.g. "CreateTime") to 617 // unconditionally include in API requests. By default, fields with empty or 618 // default values are omitted from API requests. See 619 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 620 // details. 621 ForceSendFields []string `json:"-"` 622 // NullFields is a list of field names (e.g. "CreateTime") to include in API 623 // requests with the JSON null value. By default, fields with empty values are 624 // omitted from API requests. See 625 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 626 NullFields []string `json:"-"` 627 } 628 629 func (s *Folder) MarshalJSON() ([]byte, error) { 630 type NoMethod Folder 631 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 632 } 633 634 // FolderOperation: Metadata describing a long running folder operation 635 type FolderOperation struct { 636 // DestinationParent: The resource name of the folder or organization we are 637 // either creating the folder under or moving the folder to. 638 DestinationParent string `json:"destinationParent,omitempty"` 639 // DisplayName: The display name of the folder. 640 DisplayName string `json:"displayName,omitempty"` 641 // OperationType: The type of this operation. 642 // 643 // Possible values: 644 // "OPERATION_TYPE_UNSPECIFIED" - Operation type not specified. 645 // "CREATE" - A create folder operation. 646 // "MOVE" - A move folder operation. 647 OperationType string `json:"operationType,omitempty"` 648 // SourceParent: The resource name of the folder's parent. Only applicable when 649 // the operation_type is MOVE. 650 SourceParent string `json:"sourceParent,omitempty"` 651 // ForceSendFields is a list of field names (e.g. "DestinationParent") to 652 // unconditionally include in API requests. By default, fields with empty or 653 // default values are omitted from API requests. See 654 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 655 // details. 656 ForceSendFields []string `json:"-"` 657 // NullFields is a list of field names (e.g. "DestinationParent") to include in 658 // API requests with the JSON null value. By default, fields with empty values 659 // are omitted from API requests. See 660 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 661 NullFields []string `json:"-"` 662 } 663 664 func (s *FolderOperation) MarshalJSON() ([]byte, error) { 665 type NoMethod FolderOperation 666 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 667 } 668 669 // FolderOperationError: A classification of the Folder Operation error. 670 type FolderOperationError struct { 671 // ErrorMessageId: The type of operation error experienced. 672 // 673 // Possible values: 674 // "ERROR_TYPE_UNSPECIFIED" - The error type was unrecognized or unspecified. 675 // "ACTIVE_FOLDER_HEIGHT_VIOLATION" - The attempted action would violate the 676 // max folder depth constraint. 677 // "MAX_CHILD_FOLDERS_VIOLATION" - The attempted action would violate the max 678 // child folders constraint. 679 // "FOLDER_NAME_UNIQUENESS_VIOLATION" - The attempted action would violate 680 // the locally-unique folder display_name constraint. 681 // "RESOURCE_DELETED_VIOLATION" - The resource being moved has been deleted. 682 // "PARENT_DELETED_VIOLATION" - The resource a folder was being added to has 683 // been deleted. 684 // "CYCLE_INTRODUCED_VIOLATION" - The attempted action would introduce cycle 685 // in resource path. 686 // "FOLDER_BEING_MOVED_VIOLATION" - The attempted action would move a folder 687 // that is already being moved. 688 // "FOLDER_TO_DELETE_NON_EMPTY_VIOLATION" - The folder the caller is trying 689 // to delete contains active resources. 690 // "DELETED_FOLDER_HEIGHT_VIOLATION" - The attempted action would violate the 691 // max deleted folder depth constraint. 692 ErrorMessageId string `json:"errorMessageId,omitempty"` 693 // ForceSendFields is a list of field names (e.g. "ErrorMessageId") to 694 // unconditionally include in API requests. By default, fields with empty or 695 // default values are omitted from API requests. See 696 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 697 // details. 698 ForceSendFields []string `json:"-"` 699 // NullFields is a list of field names (e.g. "ErrorMessageId") to include in 700 // API requests with the JSON null value. By default, fields with empty values 701 // are omitted from API requests. See 702 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 703 NullFields []string `json:"-"` 704 } 705 706 func (s *FolderOperationError) MarshalJSON() ([]byte, error) { 707 type NoMethod FolderOperationError 708 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 709 } 710 711 // GetIamPolicyRequest: Request message for `GetIamPolicy` method. 712 type GetIamPolicyRequest struct { 713 // Options: OPTIONAL: A `GetPolicyOptions` object for specifying options to 714 // `GetIamPolicy`. 715 Options *GetPolicyOptions `json:"options,omitempty"` 716 // ForceSendFields is a list of field names (e.g. "Options") to unconditionally 717 // include in API requests. By default, fields with empty or default values are 718 // omitted from API requests. See 719 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 720 // details. 721 ForceSendFields []string `json:"-"` 722 // NullFields is a list of field names (e.g. "Options") to include in API 723 // requests with the JSON null value. By default, fields with empty values are 724 // omitted from API requests. See 725 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 726 NullFields []string `json:"-"` 727 } 728 729 func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) { 730 type NoMethod GetIamPolicyRequest 731 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 732 } 733 734 // GetPolicyOptions: Encapsulates settings provided to GetIamPolicy. 735 type GetPolicyOptions struct { 736 // RequestedPolicyVersion: Optional. The maximum policy version that will be 737 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying 738 // an invalid value will be rejected. Requests for policies with any 739 // conditional role bindings must specify version 3. Policies with no 740 // conditional role bindings may specify any valid value or leave the field 741 // unset. The policy in the response might use the policy version that you 742 // specified, or it might use a lower policy version. For example, if you 743 // specify version 3, but the policy has no conditional role bindings, the 744 // response uses version 1. To learn which resources support conditions in 745 // their IAM policies, see the IAM documentation 746 // (https://cloud.google.com/iam/help/conditions/resource-policies). 747 RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"` 748 // ForceSendFields is a list of field names (e.g. "RequestedPolicyVersion") to 749 // unconditionally include in API requests. By default, fields with empty or 750 // default values are omitted from API requests. See 751 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 752 // details. 753 ForceSendFields []string `json:"-"` 754 // NullFields is a list of field names (e.g. "RequestedPolicyVersion") to 755 // include in API requests with the JSON null value. By default, fields with 756 // empty values are omitted from API requests. See 757 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 758 NullFields []string `json:"-"` 759 } 760 761 func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) { 762 type NoMethod GetPolicyOptions 763 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 764 } 765 766 // ListFoldersResponse: The ListFolders response message. 767 type ListFoldersResponse struct { 768 // Folders: A possibly paginated list of Folders that are direct descendants of 769 // the specified parent resource. 770 Folders []*Folder `json:"folders,omitempty"` 771 // NextPageToken: A pagination token returned from a previous call to 772 // `ListFolders` that indicates from where listing should continue. 773 NextPageToken string `json:"nextPageToken,omitempty"` 774 775 // ServerResponse contains the HTTP response code and headers from the server. 776 googleapi.ServerResponse `json:"-"` 777 // ForceSendFields is a list of field names (e.g. "Folders") to unconditionally 778 // include in API requests. By default, fields with empty or default values are 779 // omitted from API requests. See 780 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 781 // details. 782 ForceSendFields []string `json:"-"` 783 // NullFields is a list of field names (e.g. "Folders") to include in API 784 // requests with the JSON null value. By default, fields with empty values are 785 // omitted from API requests. See 786 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 787 NullFields []string `json:"-"` 788 } 789 790 func (s *ListFoldersResponse) MarshalJSON() ([]byte, error) { 791 type NoMethod ListFoldersResponse 792 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 793 } 794 795 // MoveFolderMetadata: Metadata pertaining to the folder move process. 796 type MoveFolderMetadata struct { 797 // DestinationParent: The resource name of the folder or organization to move 798 // the folder to. 799 DestinationParent string `json:"destinationParent,omitempty"` 800 // DisplayName: The display name of the folder. 801 DisplayName string `json:"displayName,omitempty"` 802 // SourceParent: The resource name of the folder's parent. 803 SourceParent string `json:"sourceParent,omitempty"` 804 // ForceSendFields is a list of field names (e.g. "DestinationParent") to 805 // unconditionally include in API requests. By default, fields with empty or 806 // default values are omitted from API requests. See 807 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 808 // details. 809 ForceSendFields []string `json:"-"` 810 // NullFields is a list of field names (e.g. "DestinationParent") to include in 811 // API requests with the JSON null value. By default, fields with empty values 812 // are omitted from API requests. See 813 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 814 NullFields []string `json:"-"` 815 } 816 817 func (s *MoveFolderMetadata) MarshalJSON() ([]byte, error) { 818 type NoMethod MoveFolderMetadata 819 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 820 } 821 822 // MoveFolderRequest: The MoveFolder request message. 823 type MoveFolderRequest struct { 824 // DestinationParent: Required. The resource name of the Folder or Organization 825 // to reparent the folder under. Must be of the form `folders/{folder_id}` or 826 // `organizations/{org_id}`. 827 DestinationParent string `json:"destinationParent,omitempty"` 828 // ForceSendFields is a list of field names (e.g. "DestinationParent") to 829 // unconditionally include in API requests. By default, fields with empty or 830 // default values are omitted from API requests. See 831 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 832 // details. 833 ForceSendFields []string `json:"-"` 834 // NullFields is a list of field names (e.g. "DestinationParent") to include in 835 // API requests with the JSON null value. By default, fields with empty values 836 // are omitted from API requests. See 837 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 838 NullFields []string `json:"-"` 839 } 840 841 func (s *MoveFolderRequest) MarshalJSON() ([]byte, error) { 842 type NoMethod MoveFolderRequest 843 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 844 } 845 846 // MoveProjectMetadata: A status object which is used as the `metadata` field 847 // for the Operation returned by MoveProject. 848 type MoveProjectMetadata struct { 849 } 850 851 // Operation: This resource represents a long-running operation that is the 852 // result of a network API call. 853 type Operation struct { 854 // Done: If the value is `false`, it means the operation is still in progress. 855 // If `true`, the operation is completed, and either `error` or `response` is 856 // available. 857 Done bool `json:"done,omitempty"` 858 // Error: The error result of the operation in case of failure or cancellation. 859 Error *Status `json:"error,omitempty"` 860 // Metadata: Service-specific metadata associated with the operation. It 861 // typically contains progress information and common metadata such as create 862 // time. Some services might not provide such metadata. Any method that returns 863 // a long-running operation should document the metadata type, if any. 864 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 865 // Name: The server-assigned name, which is only unique within the same service 866 // that originally returns it. If you use the default HTTP mapping, the `name` 867 // should be a resource name ending with `operations/{unique_id}`. 868 Name string `json:"name,omitempty"` 869 // Response: The normal, successful response of the operation. If the original 870 // method returns no data on success, such as `Delete`, the response is 871 // `google.protobuf.Empty`. If the original method is standard 872 // `Get`/`Create`/`Update`, the response should be the resource. For other 873 // methods, the response should have the type `XxxResponse`, where `Xxx` is the 874 // original method name. For example, if the original method name is 875 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. 876 Response googleapi.RawMessage `json:"response,omitempty"` 877 878 // ServerResponse contains the HTTP response code and headers from the server. 879 googleapi.ServerResponse `json:"-"` 880 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally 881 // include in API requests. By default, fields with empty or default values are 882 // omitted from API requests. See 883 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 884 // details. 885 ForceSendFields []string `json:"-"` 886 // NullFields is a list of field names (e.g. "Done") to include in API requests 887 // with the JSON null value. By default, fields with empty values are omitted 888 // from API requests. See 889 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 890 NullFields []string `json:"-"` 891 } 892 893 func (s *Operation) MarshalJSON() ([]byte, error) { 894 type NoMethod Operation 895 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 896 } 897 898 // Policy: An Identity and Access Management (IAM) policy, which specifies 899 // access controls for Google Cloud resources. A `Policy` is a collection of 900 // `bindings`. A `binding` binds one or more `members`, or principals, to a 901 // single `role`. Principals can be user accounts, service accounts, Google 902 // groups, and domains (such as G Suite). A `role` is a named list of 903 // permissions; each `role` can be an IAM predefined role or a user-created 904 // custom role. For some types of Google Cloud resources, a `binding` can also 905 // specify a `condition`, which is a logical expression that allows access to a 906 // resource only if the expression evaluates to `true`. A condition can add 907 // constraints based on attributes of the request, the resource, or both. To 908 // learn which resources support conditions in their IAM policies, see the IAM 909 // documentation 910 // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON 911 // example:** ``` { "bindings": [ { "role": 912 // "roles/resourcemanager.organizationAdmin", "members": [ 913 // "user:mike@example.com", "group:admins@example.com", "domain:google.com", 914 // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": 915 // "roles/resourcemanager.organizationViewer", "members": [ 916 // "user:eve@example.com" ], "condition": { "title": "expirable access", 917 // "description": "Does not grant access after Sep 2020", "expression": 918 // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": 919 // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: - 920 // members: - user:mike@example.com - group:admins@example.com - 921 // domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com 922 // role: roles/resourcemanager.organizationAdmin - members: - 923 // user:eve@example.com role: roles/resourcemanager.organizationViewer 924 // condition: title: expirable access description: Does not grant access after 925 // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') 926 // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features, 927 // see the IAM documentation (https://cloud.google.com/iam/docs/). 928 type Policy struct { 929 // AuditConfigs: Specifies cloud audit logging configuration for this policy. 930 AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"` 931 // Bindings: Associates a list of `members`, or principals, with a `role`. 932 // Optionally, may specify a `condition` that determines how and when the 933 // `bindings` are applied. Each of the `bindings` must contain at least one 934 // principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; 935 // up to 250 of these principals can be Google groups. Each occurrence of a 936 // principal counts towards these limits. For example, if the `bindings` grant 937 // 50 different roles to `user:alice@example.com`, and not to any other 938 // principal, then you can add another 1,450 principals to the `bindings` in 939 // the `Policy`. 940 Bindings []*Binding `json:"bindings,omitempty"` 941 // Etag: `etag` is used for optimistic concurrency control as a way to help 942 // prevent simultaneous updates of a policy from overwriting each other. It is 943 // strongly suggested that systems make use of the `etag` in the 944 // read-modify-write cycle to perform policy updates in order to avoid race 945 // conditions: An `etag` is returned in the response to `getIamPolicy`, and 946 // systems are expected to put that etag in the request to `setIamPolicy` to 947 // ensure that their change will be applied to the same version of the policy. 948 // **Important:** If you use IAM Conditions, you must include the `etag` field 949 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows 950 // you to overwrite a version `3` policy with a version `1` policy, and all of 951 // the conditions in the version `3` policy are lost. 952 Etag string `json:"etag,omitempty"` 953 // Version: Specifies the format of the policy. Valid values are `0`, `1`, and 954 // `3`. Requests that specify an invalid value are rejected. Any operation that 955 // affects conditional role bindings must specify version `3`. This requirement 956 // applies to the following operations: * Getting a policy that includes a 957 // conditional role binding * Adding a conditional role binding to a policy * 958 // Changing a conditional role binding in a policy * Removing any role binding, 959 // with or without a condition, from a policy that includes conditions 960 // **Important:** If you use IAM Conditions, you must include the `etag` field 961 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows 962 // you to overwrite a version `3` policy with a version `1` policy, and all of 963 // the conditions in the version `3` policy are lost. If a policy does not 964 // include any conditions, operations on that policy may specify any valid 965 // version or leave the field unset. To learn which resources support 966 // conditions in their IAM policies, see the IAM documentation 967 // (https://cloud.google.com/iam/help/conditions/resource-policies). 968 Version int64 `json:"version,omitempty"` 969 970 // ServerResponse contains the HTTP response code and headers from the server. 971 googleapi.ServerResponse `json:"-"` 972 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to 973 // unconditionally include in API requests. By default, fields with empty or 974 // default values are omitted from API requests. See 975 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 976 // details. 977 ForceSendFields []string `json:"-"` 978 // NullFields is a list of field names (e.g. "AuditConfigs") to include in API 979 // requests with the JSON null value. By default, fields with empty values are 980 // omitted from API requests. See 981 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 982 NullFields []string `json:"-"` 983 } 984 985 func (s *Policy) MarshalJSON() ([]byte, error) { 986 type NoMethod Policy 987 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 988 } 989 990 // ProjectCreationStatus: A status object which is used as the `metadata` field 991 // for the Operation returned by CreateProject. It provides insight for when 992 // significant phases of Project creation have completed. 993 type ProjectCreationStatus struct { 994 // CreateTime: Creation time of the project creation workflow. 995 CreateTime string `json:"createTime,omitempty"` 996 // Gettable: True if the project can be retrieved using GetProject. No other 997 // operations on the project are guaranteed to work until the project creation 998 // is complete. 999 Gettable bool `json:"gettable,omitempty"` 1000 // Ready: True if the project creation process is complete. 1001 Ready bool `json:"ready,omitempty"` 1002 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1003 // unconditionally include in API requests. By default, fields with empty or 1004 // default values are omitted from API requests. See 1005 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1006 // details. 1007 ForceSendFields []string `json:"-"` 1008 // NullFields is a list of field names (e.g. "CreateTime") to include in API 1009 // requests with the JSON null value. By default, fields with empty values are 1010 // omitted from API requests. See 1011 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1012 NullFields []string `json:"-"` 1013 } 1014 1015 func (s *ProjectCreationStatus) MarshalJSON() ([]byte, error) { 1016 type NoMethod ProjectCreationStatus 1017 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1018 } 1019 1020 // SearchFoldersRequest: The request message for searching folders. 1021 type SearchFoldersRequest struct { 1022 // PageSize: Optional. The maximum number of folders to return in the response. 1023 // The server can return fewer folders than requested. If unspecified, server 1024 // picks an appropriate default. 1025 PageSize int64 `json:"pageSize,omitempty"` 1026 // PageToken: Optional. A pagination token returned from a previous call to 1027 // `SearchFolders` that indicates from where search should continue. 1028 PageToken string `json:"pageToken,omitempty"` 1029 // Query: Search criteria used to select the Folders to return. If no search 1030 // criteria is specified then all accessible folders will be returned. Query 1031 // expressions can be used to restrict results based upon displayName, 1032 // lifecycleState and parent, where the operators `=`, `NOT`, `AND` and `OR` 1033 // can be used along with the suffix wildcard symbol `*`. The displayName field 1034 // in a query expression should use escaped quotes for values that include 1035 // whitespace to prevent unexpected behavior. Some example queries are: * Query 1036 // `displayName=Test*` returns Folder resources whose display name starts with 1037 // "Test". * Query `lifecycleState=ACTIVE` returns Folder resources with 1038 // `lifecycleState` set to `ACTIVE`. * Query `parent=folders/123` returns 1039 // Folder resources that have `folders/123` as a parent resource. * Query 1040 // `parent=folders/123 AND lifecycleState=ACTIVE` returns active Folder 1041 // resources that have `folders/123` as a parent resource. * Query 1042 // `displayName=\\"Test String\\" returns Folder resources with display names 1043 // that include both "Test" and "String". 1044 Query string `json:"query,omitempty"` 1045 // ForceSendFields is a list of field names (e.g. "PageSize") to 1046 // unconditionally include in API requests. By default, fields with empty or 1047 // default values are omitted from API requests. See 1048 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1049 // details. 1050 ForceSendFields []string `json:"-"` 1051 // NullFields is a list of field names (e.g. "PageSize") to include in API 1052 // requests with the JSON null value. By default, fields with empty values are 1053 // omitted from API requests. See 1054 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1055 NullFields []string `json:"-"` 1056 } 1057 1058 func (s *SearchFoldersRequest) MarshalJSON() ([]byte, error) { 1059 type NoMethod SearchFoldersRequest 1060 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1061 } 1062 1063 // SearchFoldersResponse: The response message for searching folders. 1064 type SearchFoldersResponse struct { 1065 // Folders: A possibly paginated folder search results. the specified parent 1066 // resource. 1067 Folders []*Folder `json:"folders,omitempty"` 1068 // NextPageToken: A pagination token returned from a previous call to 1069 // `SearchFolders` that indicates from where searching should continue. 1070 NextPageToken string `json:"nextPageToken,omitempty"` 1071 1072 // ServerResponse contains the HTTP response code and headers from the server. 1073 googleapi.ServerResponse `json:"-"` 1074 // ForceSendFields is a list of field names (e.g. "Folders") to unconditionally 1075 // include in API requests. By default, fields with empty or default values are 1076 // omitted from API requests. See 1077 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1078 // details. 1079 ForceSendFields []string `json:"-"` 1080 // NullFields is a list of field names (e.g. "Folders") to include in API 1081 // requests with the JSON null value. By default, fields with empty values are 1082 // omitted from API requests. See 1083 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1084 NullFields []string `json:"-"` 1085 } 1086 1087 func (s *SearchFoldersResponse) MarshalJSON() ([]byte, error) { 1088 type NoMethod SearchFoldersResponse 1089 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1090 } 1091 1092 // SetIamPolicyRequest: Request message for `SetIamPolicy` method. 1093 type SetIamPolicyRequest struct { 1094 // Policy: REQUIRED: The complete policy to be applied to the `resource`. The 1095 // size of the policy is limited to a few 10s of KB. An empty policy is a valid 1096 // policy but certain Google Cloud services (such as Projects) might reject 1097 // them. 1098 Policy *Policy `json:"policy,omitempty"` 1099 // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the policy to 1100 // modify. Only the fields in the mask will be modified. If no mask is 1101 // provided, the following default mask is used: `paths: "bindings, etag" 1102 UpdateMask string `json:"updateMask,omitempty"` 1103 // ForceSendFields is a list of field names (e.g. "Policy") to unconditionally 1104 // include in API requests. By default, fields with empty or default values are 1105 // omitted from API requests. See 1106 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1107 // details. 1108 ForceSendFields []string `json:"-"` 1109 // NullFields is a list of field names (e.g. "Policy") to include in API 1110 // requests with the JSON null value. By default, fields with empty values are 1111 // omitted from API requests. See 1112 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1113 NullFields []string `json:"-"` 1114 } 1115 1116 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { 1117 type NoMethod SetIamPolicyRequest 1118 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1119 } 1120 1121 // Status: The `Status` type defines a logical error model that is suitable for 1122 // different programming environments, including REST APIs and RPC APIs. It is 1123 // used by gRPC (https://github.com/grpc). Each `Status` message contains three 1124 // pieces of data: error code, error message, and error details. You can find 1125 // out more about this error model and how to work with it in the API Design 1126 // Guide (https://cloud.google.com/apis/design/errors). 1127 type Status struct { 1128 // Code: The status code, which should be an enum value of google.rpc.Code. 1129 Code int64 `json:"code,omitempty"` 1130 // Details: A list of messages that carry the error details. There is a common 1131 // set of message types for APIs to use. 1132 Details []googleapi.RawMessage `json:"details,omitempty"` 1133 // Message: A developer-facing error message, which should be in English. Any 1134 // user-facing error message should be localized and sent in the 1135 // google.rpc.Status.details field, or localized by the client. 1136 Message string `json:"message,omitempty"` 1137 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 1138 // include in API requests. By default, fields with empty or default values are 1139 // omitted from API requests. See 1140 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1141 // details. 1142 ForceSendFields []string `json:"-"` 1143 // NullFields is a list of field names (e.g. "Code") to include in API requests 1144 // with the JSON null value. By default, fields with empty values are omitted 1145 // from API requests. See 1146 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1147 NullFields []string `json:"-"` 1148 } 1149 1150 func (s *Status) MarshalJSON() ([]byte, error) { 1151 type NoMethod Status 1152 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1153 } 1154 1155 // TestIamPermissionsRequest: Request message for `TestIamPermissions` method. 1156 type TestIamPermissionsRequest struct { 1157 // Permissions: The set of permissions to check for the `resource`. Permissions 1158 // with wildcards (such as `*` or `storage.*`) are not allowed. For more 1159 // information see IAM Overview 1160 // (https://cloud.google.com/iam/docs/overview#permissions). 1161 Permissions []string `json:"permissions,omitempty"` 1162 // ForceSendFields is a list of field names (e.g. "Permissions") to 1163 // unconditionally include in API requests. By default, fields with empty or 1164 // default values are omitted from API requests. See 1165 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1166 // details. 1167 ForceSendFields []string `json:"-"` 1168 // NullFields is a list of field names (e.g. "Permissions") to include in API 1169 // requests with the JSON null value. By default, fields with empty values are 1170 // omitted from API requests. See 1171 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1172 NullFields []string `json:"-"` 1173 } 1174 1175 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { 1176 type NoMethod TestIamPermissionsRequest 1177 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1178 } 1179 1180 // TestIamPermissionsResponse: Response message for `TestIamPermissions` 1181 // method. 1182 type TestIamPermissionsResponse struct { 1183 // Permissions: A subset of `TestPermissionsRequest.permissions` that the 1184 // caller is allowed. 1185 Permissions []string `json:"permissions,omitempty"` 1186 1187 // ServerResponse contains the HTTP response code and headers from the server. 1188 googleapi.ServerResponse `json:"-"` 1189 // ForceSendFields is a list of field names (e.g. "Permissions") to 1190 // unconditionally include in API requests. By default, fields with empty or 1191 // default values are omitted from API requests. See 1192 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1193 // details. 1194 ForceSendFields []string `json:"-"` 1195 // NullFields is a list of field names (e.g. "Permissions") to include in API 1196 // requests with the JSON null value. By default, fields with empty values are 1197 // omitted from API requests. See 1198 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1199 NullFields []string `json:"-"` 1200 } 1201 1202 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 1203 type NoMethod TestIamPermissionsResponse 1204 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1205 } 1206 1207 // UndeleteFolderMetadata: A status object which is used as the `metadata` 1208 // field for the `Operation` returned by `UndeleteFolder`. 1209 type UndeleteFolderMetadata struct { 1210 } 1211 1212 // UndeleteFolderRequest: The UndeleteFolder request message. 1213 type UndeleteFolderRequest struct { 1214 } 1215 1216 // UndeleteOrganizationMetadata: A status object which is used as the 1217 // `metadata` field for the Operation returned by UndeleteOrganization. 1218 type UndeleteOrganizationMetadata struct { 1219 } 1220 1221 // UndeleteProjectMetadata: A status object which is used as the `metadata` 1222 // field for the Operation returned by `UndeleteProject`. 1223 type UndeleteProjectMetadata struct { 1224 } 1225 1226 // UpdateFolderMetadata: A status object which is used as the `metadata` field 1227 // for the Operation returned by UpdateFolder. 1228 type UpdateFolderMetadata struct { 1229 } 1230 1231 // UpdateProjectMetadata: A status object which is used as the `metadata` field 1232 // for the Operation returned by UpdateProject. 1233 type UpdateProjectMetadata struct { 1234 } 1235 1236 // UpdateTagKeyMetadata: Runtime operation information for updating a TagKey. 1237 type UpdateTagKeyMetadata struct { 1238 } 1239 1240 // UpdateTagValueMetadata: Runtime operation information for updating a 1241 // TagValue. 1242 type UpdateTagValueMetadata struct { 1243 } 1244 1245 type FoldersCreateCall struct { 1246 s *Service 1247 folder *Folder 1248 urlParams_ gensupport.URLParams 1249 ctx_ context.Context 1250 header_ http.Header 1251 } 1252 1253 // Create: Creates a Folder in the resource hierarchy. Returns an Operation 1254 // which can be used to track the progress of the folder creation workflow. 1255 // Upon success the Operation.response field will be populated with the created 1256 // Folder. In order to succeed, the addition of this new Folder must not 1257 // violate the Folder naming, height or fanout constraints. + The Folder's 1258 // display_name must be distinct from all other Folders that share its parent. 1259 // + The addition of the Folder must not cause the active Folder hierarchy to 1260 // exceed a height of 10. Note, the full active + deleted Folder hierarchy is 1261 // allowed to reach a height of 20; this provides additional headroom when 1262 // moving folders that contain deleted folders. + The addition of the Folder 1263 // must not cause the total number of Folders under its parent to exceed 300. 1264 // If the operation fails due to a folder constraint violation, some errors may 1265 // be returned by the CreateFolder request, with status code 1266 // FAILED_PRECONDITION and an error description. Other folder constraint 1267 // violations will be communicated in the Operation, with the specific 1268 // PreconditionFailure returned via the details list in the Operation.error 1269 // field. The caller must have `resourcemanager.folders.create` permission on 1270 // the identified parent. 1271 func (r *FoldersService) Create(folder *Folder) *FoldersCreateCall { 1272 c := &FoldersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1273 c.folder = folder 1274 return c 1275 } 1276 1277 // Parent sets the optional parameter "parent": Required. The resource name of 1278 // the new Folder's parent. Must be of the form `folders/{folder_id}` or 1279 // `organizations/{org_id}`. 1280 func (c *FoldersCreateCall) Parent(parent string) *FoldersCreateCall { 1281 c.urlParams_.Set("parent", parent) 1282 return c 1283 } 1284 1285 // Fields allows partial responses to be retrieved. See 1286 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1287 // details. 1288 func (c *FoldersCreateCall) Fields(s ...googleapi.Field) *FoldersCreateCall { 1289 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1290 return c 1291 } 1292 1293 // Context sets the context to be used in this call's Do method. 1294 func (c *FoldersCreateCall) Context(ctx context.Context) *FoldersCreateCall { 1295 c.ctx_ = ctx 1296 return c 1297 } 1298 1299 // Header returns a http.Header that can be modified by the caller to add 1300 // headers to the request. 1301 func (c *FoldersCreateCall) Header() http.Header { 1302 if c.header_ == nil { 1303 c.header_ = make(http.Header) 1304 } 1305 return c.header_ 1306 } 1307 1308 func (c *FoldersCreateCall) doRequest(alt string) (*http.Response, error) { 1309 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 1310 var body io.Reader = nil 1311 body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) 1312 if err != nil { 1313 return nil, err 1314 } 1315 c.urlParams_.Set("alt", alt) 1316 c.urlParams_.Set("prettyPrint", "false") 1317 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/folders") 1318 urls += "?" + c.urlParams_.Encode() 1319 req, err := http.NewRequest("POST", urls, body) 1320 if err != nil { 1321 return nil, err 1322 } 1323 req.Header = reqHeaders 1324 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1325 } 1326 1327 // Do executes the "cloudresourcemanager.folders.create" call. 1328 // Any non-2xx status code is an error. Response headers are in either 1329 // *Operation.ServerResponse.Header or (if a response was returned at all) in 1330 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1331 // whether the returned error was because http.StatusNotModified was returned. 1332 func (c *FoldersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 1333 gensupport.SetOptions(c.urlParams_, opts...) 1334 res, err := c.doRequest("json") 1335 if res != nil && res.StatusCode == http.StatusNotModified { 1336 if res.Body != nil { 1337 res.Body.Close() 1338 } 1339 return nil, gensupport.WrapError(&googleapi.Error{ 1340 Code: res.StatusCode, 1341 Header: res.Header, 1342 }) 1343 } 1344 if err != nil { 1345 return nil, err 1346 } 1347 defer googleapi.CloseBody(res) 1348 if err := googleapi.CheckResponse(res); err != nil { 1349 return nil, gensupport.WrapError(err) 1350 } 1351 ret := &Operation{ 1352 ServerResponse: googleapi.ServerResponse{ 1353 Header: res.Header, 1354 HTTPStatusCode: res.StatusCode, 1355 }, 1356 } 1357 target := &ret 1358 if err := gensupport.DecodeResponse(target, res); err != nil { 1359 return nil, err 1360 } 1361 return ret, nil 1362 } 1363 1364 type FoldersDeleteCall struct { 1365 s *Service 1366 name string 1367 urlParams_ gensupport.URLParams 1368 ctx_ context.Context 1369 header_ http.Header 1370 } 1371 1372 // Delete: Requests deletion of a Folder. The Folder is moved into the 1373 // DELETE_REQUESTED state immediately, and is deleted approximately 30 days 1374 // later. This method may only be called on an empty Folder in the ACTIVE 1375 // state, where a Folder is empty if it doesn't contain any Folders or Projects 1376 // in the ACTIVE state. The caller must have `resourcemanager.folders.delete` 1377 // permission on the identified folder. 1378 // 1379 // - name: the resource name of the Folder to be deleted. Must be of the form 1380 // `folders/{folder_id}`. 1381 func (r *FoldersService) Delete(name string) *FoldersDeleteCall { 1382 c := &FoldersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1383 c.name = name 1384 return c 1385 } 1386 1387 // Fields allows partial responses to be retrieved. See 1388 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1389 // details. 1390 func (c *FoldersDeleteCall) Fields(s ...googleapi.Field) *FoldersDeleteCall { 1391 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1392 return c 1393 } 1394 1395 // Context sets the context to be used in this call's Do method. 1396 func (c *FoldersDeleteCall) Context(ctx context.Context) *FoldersDeleteCall { 1397 c.ctx_ = ctx 1398 return c 1399 } 1400 1401 // Header returns a http.Header that can be modified by the caller to add 1402 // headers to the request. 1403 func (c *FoldersDeleteCall) Header() http.Header { 1404 if c.header_ == nil { 1405 c.header_ = make(http.Header) 1406 } 1407 return c.header_ 1408 } 1409 1410 func (c *FoldersDeleteCall) doRequest(alt string) (*http.Response, error) { 1411 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 1412 var body io.Reader = nil 1413 c.urlParams_.Set("alt", alt) 1414 c.urlParams_.Set("prettyPrint", "false") 1415 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 1416 urls += "?" + c.urlParams_.Encode() 1417 req, err := http.NewRequest("DELETE", urls, body) 1418 if err != nil { 1419 return nil, err 1420 } 1421 req.Header = reqHeaders 1422 googleapi.Expand(req.URL, map[string]string{ 1423 "name": c.name, 1424 }) 1425 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1426 } 1427 1428 // Do executes the "cloudresourcemanager.folders.delete" call. 1429 // Any non-2xx status code is an error. Response headers are in either 1430 // *Folder.ServerResponse.Header or (if a response was returned at all) in 1431 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1432 // whether the returned error was because http.StatusNotModified was returned. 1433 func (c *FoldersDeleteCall) Do(opts ...googleapi.CallOption) (*Folder, error) { 1434 gensupport.SetOptions(c.urlParams_, opts...) 1435 res, err := c.doRequest("json") 1436 if res != nil && res.StatusCode == http.StatusNotModified { 1437 if res.Body != nil { 1438 res.Body.Close() 1439 } 1440 return nil, gensupport.WrapError(&googleapi.Error{ 1441 Code: res.StatusCode, 1442 Header: res.Header, 1443 }) 1444 } 1445 if err != nil { 1446 return nil, err 1447 } 1448 defer googleapi.CloseBody(res) 1449 if err := googleapi.CheckResponse(res); err != nil { 1450 return nil, gensupport.WrapError(err) 1451 } 1452 ret := &Folder{ 1453 ServerResponse: googleapi.ServerResponse{ 1454 Header: res.Header, 1455 HTTPStatusCode: res.StatusCode, 1456 }, 1457 } 1458 target := &ret 1459 if err := gensupport.DecodeResponse(target, res); err != nil { 1460 return nil, err 1461 } 1462 return ret, nil 1463 } 1464 1465 type FoldersGetCall struct { 1466 s *Service 1467 name string 1468 urlParams_ gensupport.URLParams 1469 ifNoneMatch_ string 1470 ctx_ context.Context 1471 header_ http.Header 1472 } 1473 1474 // Get: Retrieves a Folder identified by the supplied resource name. Valid 1475 // Folder resource names have the format `folders/{folder_id}` (for example, 1476 // `folders/1234`). The caller must have `resourcemanager.folders.get` 1477 // permission on the identified folder. 1478 // 1479 // - name: The resource name of the Folder to retrieve. Must be of the form 1480 // `folders/{folder_id}`. 1481 func (r *FoldersService) Get(name string) *FoldersGetCall { 1482 c := &FoldersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1483 c.name = name 1484 return c 1485 } 1486 1487 // Fields allows partial responses to be retrieved. See 1488 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1489 // details. 1490 func (c *FoldersGetCall) Fields(s ...googleapi.Field) *FoldersGetCall { 1491 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1492 return c 1493 } 1494 1495 // IfNoneMatch sets an optional parameter which makes the operation fail if the 1496 // object's ETag matches the given value. This is useful for getting updates 1497 // only after the object has changed since the last request. 1498 func (c *FoldersGetCall) IfNoneMatch(entityTag string) *FoldersGetCall { 1499 c.ifNoneMatch_ = entityTag 1500 return c 1501 } 1502 1503 // Context sets the context to be used in this call's Do method. 1504 func (c *FoldersGetCall) Context(ctx context.Context) *FoldersGetCall { 1505 c.ctx_ = ctx 1506 return c 1507 } 1508 1509 // Header returns a http.Header that can be modified by the caller to add 1510 // headers to the request. 1511 func (c *FoldersGetCall) Header() http.Header { 1512 if c.header_ == nil { 1513 c.header_ = make(http.Header) 1514 } 1515 return c.header_ 1516 } 1517 1518 func (c *FoldersGetCall) doRequest(alt string) (*http.Response, error) { 1519 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 1520 if c.ifNoneMatch_ != "" { 1521 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1522 } 1523 var body io.Reader = nil 1524 c.urlParams_.Set("alt", alt) 1525 c.urlParams_.Set("prettyPrint", "false") 1526 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 1527 urls += "?" + c.urlParams_.Encode() 1528 req, err := http.NewRequest("GET", urls, body) 1529 if err != nil { 1530 return nil, err 1531 } 1532 req.Header = reqHeaders 1533 googleapi.Expand(req.URL, map[string]string{ 1534 "name": c.name, 1535 }) 1536 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1537 } 1538 1539 // Do executes the "cloudresourcemanager.folders.get" call. 1540 // Any non-2xx status code is an error. Response headers are in either 1541 // *Folder.ServerResponse.Header or (if a response was returned at all) in 1542 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1543 // whether the returned error was because http.StatusNotModified was returned. 1544 func (c *FoldersGetCall) Do(opts ...googleapi.CallOption) (*Folder, error) { 1545 gensupport.SetOptions(c.urlParams_, opts...) 1546 res, err := c.doRequest("json") 1547 if res != nil && res.StatusCode == http.StatusNotModified { 1548 if res.Body != nil { 1549 res.Body.Close() 1550 } 1551 return nil, gensupport.WrapError(&googleapi.Error{ 1552 Code: res.StatusCode, 1553 Header: res.Header, 1554 }) 1555 } 1556 if err != nil { 1557 return nil, err 1558 } 1559 defer googleapi.CloseBody(res) 1560 if err := googleapi.CheckResponse(res); err != nil { 1561 return nil, gensupport.WrapError(err) 1562 } 1563 ret := &Folder{ 1564 ServerResponse: googleapi.ServerResponse{ 1565 Header: res.Header, 1566 HTTPStatusCode: res.StatusCode, 1567 }, 1568 } 1569 target := &ret 1570 if err := gensupport.DecodeResponse(target, res); err != nil { 1571 return nil, err 1572 } 1573 return ret, nil 1574 } 1575 1576 type FoldersGetIamPolicyCall struct { 1577 s *Service 1578 resource string 1579 getiampolicyrequest *GetIamPolicyRequest 1580 urlParams_ gensupport.URLParams 1581 ctx_ context.Context 1582 header_ http.Header 1583 } 1584 1585 // GetIamPolicy: Gets the access control policy for a Folder. The returned 1586 // policy may be empty if no such policy or resource exists. The `resource` 1587 // field should be the Folder's resource name, e.g. "folders/1234". The caller 1588 // must have `resourcemanager.folders.getIamPolicy` permission on the 1589 // identified folder. 1590 // 1591 // - resource: REQUIRED: The resource for which the policy is being requested. 1592 // See Resource names (https://cloud.google.com/apis/design/resource_names) 1593 // for the appropriate value for this field. 1594 func (r *FoldersService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *FoldersGetIamPolicyCall { 1595 c := &FoldersGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1596 c.resource = resource 1597 c.getiampolicyrequest = getiampolicyrequest 1598 return c 1599 } 1600 1601 // Fields allows partial responses to be retrieved. See 1602 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1603 // details. 1604 func (c *FoldersGetIamPolicyCall) Fields(s ...googleapi.Field) *FoldersGetIamPolicyCall { 1605 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1606 return c 1607 } 1608 1609 // Context sets the context to be used in this call's Do method. 1610 func (c *FoldersGetIamPolicyCall) Context(ctx context.Context) *FoldersGetIamPolicyCall { 1611 c.ctx_ = ctx 1612 return c 1613 } 1614 1615 // Header returns a http.Header that can be modified by the caller to add 1616 // headers to the request. 1617 func (c *FoldersGetIamPolicyCall) Header() http.Header { 1618 if c.header_ == nil { 1619 c.header_ = make(http.Header) 1620 } 1621 return c.header_ 1622 } 1623 1624 func (c *FoldersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 1625 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 1626 var body io.Reader = nil 1627 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 1628 if err != nil { 1629 return nil, err 1630 } 1631 c.urlParams_.Set("alt", alt) 1632 c.urlParams_.Set("prettyPrint", "false") 1633 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:getIamPolicy") 1634 urls += "?" + c.urlParams_.Encode() 1635 req, err := http.NewRequest("POST", urls, body) 1636 if err != nil { 1637 return nil, err 1638 } 1639 req.Header = reqHeaders 1640 googleapi.Expand(req.URL, map[string]string{ 1641 "resource": c.resource, 1642 }) 1643 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1644 } 1645 1646 // Do executes the "cloudresourcemanager.folders.getIamPolicy" call. 1647 // Any non-2xx status code is an error. Response headers are in either 1648 // *Policy.ServerResponse.Header or (if a response was returned at all) in 1649 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1650 // whether the returned error was because http.StatusNotModified was returned. 1651 func (c *FoldersGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 1652 gensupport.SetOptions(c.urlParams_, opts...) 1653 res, err := c.doRequest("json") 1654 if res != nil && res.StatusCode == http.StatusNotModified { 1655 if res.Body != nil { 1656 res.Body.Close() 1657 } 1658 return nil, gensupport.WrapError(&googleapi.Error{ 1659 Code: res.StatusCode, 1660 Header: res.Header, 1661 }) 1662 } 1663 if err != nil { 1664 return nil, err 1665 } 1666 defer googleapi.CloseBody(res) 1667 if err := googleapi.CheckResponse(res); err != nil { 1668 return nil, gensupport.WrapError(err) 1669 } 1670 ret := &Policy{ 1671 ServerResponse: googleapi.ServerResponse{ 1672 Header: res.Header, 1673 HTTPStatusCode: res.StatusCode, 1674 }, 1675 } 1676 target := &ret 1677 if err := gensupport.DecodeResponse(target, res); err != nil { 1678 return nil, err 1679 } 1680 return ret, nil 1681 } 1682 1683 type FoldersListCall struct { 1684 s *Service 1685 urlParams_ gensupport.URLParams 1686 ifNoneMatch_ string 1687 ctx_ context.Context 1688 header_ http.Header 1689 } 1690 1691 // List: Lists the Folders that are direct descendants of supplied parent 1692 // resource. List provides a strongly consistent view of the Folders underneath 1693 // the specified parent resource. List returns Folders sorted based upon the 1694 // (ascending) lexical ordering of their display_name. The caller must have 1695 // `resourcemanager.folders.list` permission on the identified parent. 1696 func (r *FoldersService) List() *FoldersListCall { 1697 c := &FoldersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1698 return c 1699 } 1700 1701 // PageSize sets the optional parameter "pageSize": The maximum number of 1702 // Folders to return in the response. The server can return fewer folders than 1703 // requested. If unspecified, server picks an appropriate default. 1704 func (c *FoldersListCall) PageSize(pageSize int64) *FoldersListCall { 1705 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 1706 return c 1707 } 1708 1709 // PageToken sets the optional parameter "pageToken": A pagination token 1710 // returned from a previous call to `ListFolders` that indicates where this 1711 // listing should continue from. 1712 func (c *FoldersListCall) PageToken(pageToken string) *FoldersListCall { 1713 c.urlParams_.Set("pageToken", pageToken) 1714 return c 1715 } 1716 1717 // Parent sets the optional parameter "parent": Required. The resource name of 1718 // the Organization or Folder whose Folders are being listed. Must be of the 1719 // form `folders/{folder_id}` or `organizations/{org_id}`. Access to this 1720 // method is controlled by checking the `resourcemanager.folders.list` 1721 // permission on the `parent`. 1722 func (c *FoldersListCall) Parent(parent string) *FoldersListCall { 1723 c.urlParams_.Set("parent", parent) 1724 return c 1725 } 1726 1727 // ShowDeleted sets the optional parameter "showDeleted": Controls whether 1728 // Folders in the DELETE_REQUESTED state should be returned. Defaults to false. 1729 func (c *FoldersListCall) ShowDeleted(showDeleted bool) *FoldersListCall { 1730 c.urlParams_.Set("showDeleted", fmt.Sprint(showDeleted)) 1731 return c 1732 } 1733 1734 // Fields allows partial responses to be retrieved. See 1735 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1736 // details. 1737 func (c *FoldersListCall) Fields(s ...googleapi.Field) *FoldersListCall { 1738 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1739 return c 1740 } 1741 1742 // IfNoneMatch sets an optional parameter which makes the operation fail if the 1743 // object's ETag matches the given value. This is useful for getting updates 1744 // only after the object has changed since the last request. 1745 func (c *FoldersListCall) IfNoneMatch(entityTag string) *FoldersListCall { 1746 c.ifNoneMatch_ = entityTag 1747 return c 1748 } 1749 1750 // Context sets the context to be used in this call's Do method. 1751 func (c *FoldersListCall) Context(ctx context.Context) *FoldersListCall { 1752 c.ctx_ = ctx 1753 return c 1754 } 1755 1756 // Header returns a http.Header that can be modified by the caller to add 1757 // headers to the request. 1758 func (c *FoldersListCall) Header() http.Header { 1759 if c.header_ == nil { 1760 c.header_ = make(http.Header) 1761 } 1762 return c.header_ 1763 } 1764 1765 func (c *FoldersListCall) doRequest(alt string) (*http.Response, error) { 1766 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 1767 if c.ifNoneMatch_ != "" { 1768 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1769 } 1770 var body io.Reader = nil 1771 c.urlParams_.Set("alt", alt) 1772 c.urlParams_.Set("prettyPrint", "false") 1773 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/folders") 1774 urls += "?" + c.urlParams_.Encode() 1775 req, err := http.NewRequest("GET", urls, body) 1776 if err != nil { 1777 return nil, err 1778 } 1779 req.Header = reqHeaders 1780 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1781 } 1782 1783 // Do executes the "cloudresourcemanager.folders.list" call. 1784 // Any non-2xx status code is an error. Response headers are in either 1785 // *ListFoldersResponse.ServerResponse.Header or (if a response was returned at 1786 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1787 // check whether the returned error was because http.StatusNotModified was 1788 // returned. 1789 func (c *FoldersListCall) Do(opts ...googleapi.CallOption) (*ListFoldersResponse, error) { 1790 gensupport.SetOptions(c.urlParams_, opts...) 1791 res, err := c.doRequest("json") 1792 if res != nil && res.StatusCode == http.StatusNotModified { 1793 if res.Body != nil { 1794 res.Body.Close() 1795 } 1796 return nil, gensupport.WrapError(&googleapi.Error{ 1797 Code: res.StatusCode, 1798 Header: res.Header, 1799 }) 1800 } 1801 if err != nil { 1802 return nil, err 1803 } 1804 defer googleapi.CloseBody(res) 1805 if err := googleapi.CheckResponse(res); err != nil { 1806 return nil, gensupport.WrapError(err) 1807 } 1808 ret := &ListFoldersResponse{ 1809 ServerResponse: googleapi.ServerResponse{ 1810 Header: res.Header, 1811 HTTPStatusCode: res.StatusCode, 1812 }, 1813 } 1814 target := &ret 1815 if err := gensupport.DecodeResponse(target, res); err != nil { 1816 return nil, err 1817 } 1818 return ret, nil 1819 } 1820 1821 // Pages invokes f for each page of results. 1822 // A non-nil error returned from f will halt the iteration. 1823 // The provided context supersedes any context provided to the Context method. 1824 func (c *FoldersListCall) Pages(ctx context.Context, f func(*ListFoldersResponse) error) error { 1825 c.ctx_ = ctx 1826 defer c.PageToken(c.urlParams_.Get("pageToken")) 1827 for { 1828 x, err := c.Do() 1829 if err != nil { 1830 return err 1831 } 1832 if err := f(x); err != nil { 1833 return err 1834 } 1835 if x.NextPageToken == "" { 1836 return nil 1837 } 1838 c.PageToken(x.NextPageToken) 1839 } 1840 } 1841 1842 type FoldersMoveCall struct { 1843 s *Service 1844 name string 1845 movefolderrequest *MoveFolderRequest 1846 urlParams_ gensupport.URLParams 1847 ctx_ context.Context 1848 header_ http.Header 1849 } 1850 1851 // Move: Moves a Folder under a new resource parent. Returns an Operation which 1852 // can be used to track the progress of the folder move workflow. Upon success 1853 // the Operation.response field will be populated with the moved Folder. Upon 1854 // failure, a FolderOperationError categorizing the failure cause will be 1855 // returned - if the failure occurs synchronously then the FolderOperationError 1856 // will be returned via the Status.details field and if it occurs 1857 // asynchronously then the FolderOperation will be returned via the 1858 // Operation.error field. In addition, the Operation.metadata field will be 1859 // populated with a FolderOperation message as an aid to stateless clients. 1860 // Folder moves will be rejected if they violate either the naming, height or 1861 // fanout constraints described in the CreateFolder documentation. The caller 1862 // must have `resourcemanager.folders.move` permission on the folder's current 1863 // and proposed new parent. 1864 // 1865 // - name: The resource name of the Folder to move. Must be of the form 1866 // folders/{folder_id}. 1867 func (r *FoldersService) Move(name string, movefolderrequest *MoveFolderRequest) *FoldersMoveCall { 1868 c := &FoldersMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1869 c.name = name 1870 c.movefolderrequest = movefolderrequest 1871 return c 1872 } 1873 1874 // Fields allows partial responses to be retrieved. See 1875 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1876 // details. 1877 func (c *FoldersMoveCall) Fields(s ...googleapi.Field) *FoldersMoveCall { 1878 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1879 return c 1880 } 1881 1882 // Context sets the context to be used in this call's Do method. 1883 func (c *FoldersMoveCall) Context(ctx context.Context) *FoldersMoveCall { 1884 c.ctx_ = ctx 1885 return c 1886 } 1887 1888 // Header returns a http.Header that can be modified by the caller to add 1889 // headers to the request. 1890 func (c *FoldersMoveCall) Header() http.Header { 1891 if c.header_ == nil { 1892 c.header_ = make(http.Header) 1893 } 1894 return c.header_ 1895 } 1896 1897 func (c *FoldersMoveCall) doRequest(alt string) (*http.Response, error) { 1898 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 1899 var body io.Reader = nil 1900 body, err := googleapi.WithoutDataWrapper.JSONReader(c.movefolderrequest) 1901 if err != nil { 1902 return nil, err 1903 } 1904 c.urlParams_.Set("alt", alt) 1905 c.urlParams_.Set("prettyPrint", "false") 1906 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:move") 1907 urls += "?" + c.urlParams_.Encode() 1908 req, err := http.NewRequest("POST", urls, body) 1909 if err != nil { 1910 return nil, err 1911 } 1912 req.Header = reqHeaders 1913 googleapi.Expand(req.URL, map[string]string{ 1914 "name": c.name, 1915 }) 1916 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1917 } 1918 1919 // Do executes the "cloudresourcemanager.folders.move" call. 1920 // Any non-2xx status code is an error. Response headers are in either 1921 // *Operation.ServerResponse.Header or (if a response was returned at all) in 1922 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 1923 // whether the returned error was because http.StatusNotModified was returned. 1924 func (c *FoldersMoveCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 1925 gensupport.SetOptions(c.urlParams_, opts...) 1926 res, err := c.doRequest("json") 1927 if res != nil && res.StatusCode == http.StatusNotModified { 1928 if res.Body != nil { 1929 res.Body.Close() 1930 } 1931 return nil, gensupport.WrapError(&googleapi.Error{ 1932 Code: res.StatusCode, 1933 Header: res.Header, 1934 }) 1935 } 1936 if err != nil { 1937 return nil, err 1938 } 1939 defer googleapi.CloseBody(res) 1940 if err := googleapi.CheckResponse(res); err != nil { 1941 return nil, gensupport.WrapError(err) 1942 } 1943 ret := &Operation{ 1944 ServerResponse: googleapi.ServerResponse{ 1945 Header: res.Header, 1946 HTTPStatusCode: res.StatusCode, 1947 }, 1948 } 1949 target := &ret 1950 if err := gensupport.DecodeResponse(target, res); err != nil { 1951 return nil, err 1952 } 1953 return ret, nil 1954 } 1955 1956 type FoldersPatchCall struct { 1957 s *Service 1958 name string 1959 folder *Folder 1960 urlParams_ gensupport.URLParams 1961 ctx_ context.Context 1962 header_ http.Header 1963 } 1964 1965 // Patch: Updates a Folder, changing its display_name. Changes to the folder 1966 // display_name will be rejected if they violate either the display_name 1967 // formatting rules or naming constraints described in the CreateFolder 1968 // documentation. The Folder's display name must start and end with a letter or 1969 // digit, may contain letters, digits, spaces, hyphens and underscores and can 1970 // be between 3 and 30 characters. This is captured by the regular expression: 1971 // `\p{L}\p{N}{1,28}[\p{L}\p{N}]`. The caller must have 1972 // `resourcemanager.folders.update` permission on the identified folder. If the 1973 // update fails due to the unique name constraint then a PreconditionFailure 1974 // explaining this violation will be returned in the Status.details field. 1975 // 1976 // - name: Output only. The resource name of the Folder. Its format is 1977 // `folders/{folder_id}`, for example: "folders/1234". 1978 func (r *FoldersService) Patch(name string, folder *Folder) *FoldersPatchCall { 1979 c := &FoldersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1980 c.name = name 1981 c.folder = folder 1982 return c 1983 } 1984 1985 // UpdateMask sets the optional parameter "updateMask": Required. Fields to be 1986 // updated. Only the `display_name` can be updated. 1987 func (c *FoldersPatchCall) UpdateMask(updateMask string) *FoldersPatchCall { 1988 c.urlParams_.Set("updateMask", updateMask) 1989 return c 1990 } 1991 1992 // Fields allows partial responses to be retrieved. See 1993 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1994 // details. 1995 func (c *FoldersPatchCall) Fields(s ...googleapi.Field) *FoldersPatchCall { 1996 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1997 return c 1998 } 1999 2000 // Context sets the context to be used in this call's Do method. 2001 func (c *FoldersPatchCall) Context(ctx context.Context) *FoldersPatchCall { 2002 c.ctx_ = ctx 2003 return c 2004 } 2005 2006 // Header returns a http.Header that can be modified by the caller to add 2007 // headers to the request. 2008 func (c *FoldersPatchCall) Header() http.Header { 2009 if c.header_ == nil { 2010 c.header_ = make(http.Header) 2011 } 2012 return c.header_ 2013 } 2014 2015 func (c *FoldersPatchCall) doRequest(alt string) (*http.Response, error) { 2016 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2017 var body io.Reader = nil 2018 body, err := googleapi.WithoutDataWrapper.JSONReader(c.folder) 2019 if err != nil { 2020 return nil, err 2021 } 2022 c.urlParams_.Set("alt", alt) 2023 c.urlParams_.Set("prettyPrint", "false") 2024 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}") 2025 urls += "?" + c.urlParams_.Encode() 2026 req, err := http.NewRequest("PATCH", urls, body) 2027 if err != nil { 2028 return nil, err 2029 } 2030 req.Header = reqHeaders 2031 googleapi.Expand(req.URL, map[string]string{ 2032 "name": c.name, 2033 }) 2034 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2035 } 2036 2037 // Do executes the "cloudresourcemanager.folders.patch" call. 2038 // Any non-2xx status code is an error. Response headers are in either 2039 // *Folder.ServerResponse.Header or (if a response was returned at all) in 2040 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2041 // whether the returned error was because http.StatusNotModified was returned. 2042 func (c *FoldersPatchCall) Do(opts ...googleapi.CallOption) (*Folder, error) { 2043 gensupport.SetOptions(c.urlParams_, opts...) 2044 res, err := c.doRequest("json") 2045 if res != nil && res.StatusCode == http.StatusNotModified { 2046 if res.Body != nil { 2047 res.Body.Close() 2048 } 2049 return nil, gensupport.WrapError(&googleapi.Error{ 2050 Code: res.StatusCode, 2051 Header: res.Header, 2052 }) 2053 } 2054 if err != nil { 2055 return nil, err 2056 } 2057 defer googleapi.CloseBody(res) 2058 if err := googleapi.CheckResponse(res); err != nil { 2059 return nil, gensupport.WrapError(err) 2060 } 2061 ret := &Folder{ 2062 ServerResponse: googleapi.ServerResponse{ 2063 Header: res.Header, 2064 HTTPStatusCode: res.StatusCode, 2065 }, 2066 } 2067 target := &ret 2068 if err := gensupport.DecodeResponse(target, res); err != nil { 2069 return nil, err 2070 } 2071 return ret, nil 2072 } 2073 2074 type FoldersSearchCall struct { 2075 s *Service 2076 searchfoldersrequest *SearchFoldersRequest 2077 urlParams_ gensupport.URLParams 2078 ctx_ context.Context 2079 header_ http.Header 2080 } 2081 2082 // Search: Search for folders that match specific filter criteria. Search 2083 // provides an eventually consistent view of the folders a user has access to 2084 // which meet the specified filter criteria. This will only return folders on 2085 // which the caller has the permission `resourcemanager.folders.get`. 2086 func (r *FoldersService) Search(searchfoldersrequest *SearchFoldersRequest) *FoldersSearchCall { 2087 c := &FoldersSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2088 c.searchfoldersrequest = searchfoldersrequest 2089 return c 2090 } 2091 2092 // Fields allows partial responses to be retrieved. See 2093 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2094 // details. 2095 func (c *FoldersSearchCall) Fields(s ...googleapi.Field) *FoldersSearchCall { 2096 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2097 return c 2098 } 2099 2100 // Context sets the context to be used in this call's Do method. 2101 func (c *FoldersSearchCall) Context(ctx context.Context) *FoldersSearchCall { 2102 c.ctx_ = ctx 2103 return c 2104 } 2105 2106 // Header returns a http.Header that can be modified by the caller to add 2107 // headers to the request. 2108 func (c *FoldersSearchCall) Header() http.Header { 2109 if c.header_ == nil { 2110 c.header_ = make(http.Header) 2111 } 2112 return c.header_ 2113 } 2114 2115 func (c *FoldersSearchCall) doRequest(alt string) (*http.Response, error) { 2116 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2117 var body io.Reader = nil 2118 body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchfoldersrequest) 2119 if err != nil { 2120 return nil, err 2121 } 2122 c.urlParams_.Set("alt", alt) 2123 c.urlParams_.Set("prettyPrint", "false") 2124 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/folders:search") 2125 urls += "?" + c.urlParams_.Encode() 2126 req, err := http.NewRequest("POST", urls, body) 2127 if err != nil { 2128 return nil, err 2129 } 2130 req.Header = reqHeaders 2131 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2132 } 2133 2134 // Do executes the "cloudresourcemanager.folders.search" call. 2135 // Any non-2xx status code is an error. Response headers are in either 2136 // *SearchFoldersResponse.ServerResponse.Header or (if a response was returned 2137 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2138 // check whether the returned error was because http.StatusNotModified was 2139 // returned. 2140 func (c *FoldersSearchCall) Do(opts ...googleapi.CallOption) (*SearchFoldersResponse, error) { 2141 gensupport.SetOptions(c.urlParams_, opts...) 2142 res, err := c.doRequest("json") 2143 if res != nil && res.StatusCode == http.StatusNotModified { 2144 if res.Body != nil { 2145 res.Body.Close() 2146 } 2147 return nil, gensupport.WrapError(&googleapi.Error{ 2148 Code: res.StatusCode, 2149 Header: res.Header, 2150 }) 2151 } 2152 if err != nil { 2153 return nil, err 2154 } 2155 defer googleapi.CloseBody(res) 2156 if err := googleapi.CheckResponse(res); err != nil { 2157 return nil, gensupport.WrapError(err) 2158 } 2159 ret := &SearchFoldersResponse{ 2160 ServerResponse: googleapi.ServerResponse{ 2161 Header: res.Header, 2162 HTTPStatusCode: res.StatusCode, 2163 }, 2164 } 2165 target := &ret 2166 if err := gensupport.DecodeResponse(target, res); err != nil { 2167 return nil, err 2168 } 2169 return ret, nil 2170 } 2171 2172 // Pages invokes f for each page of results. 2173 // A non-nil error returned from f will halt the iteration. 2174 // The provided context supersedes any context provided to the Context method. 2175 func (c *FoldersSearchCall) Pages(ctx context.Context, f func(*SearchFoldersResponse) error) error { 2176 c.ctx_ = ctx 2177 defer func(pt string) { c.searchfoldersrequest.PageToken = pt }(c.searchfoldersrequest.PageToken) 2178 for { 2179 x, err := c.Do() 2180 if err != nil { 2181 return err 2182 } 2183 if err := f(x); err != nil { 2184 return err 2185 } 2186 if x.NextPageToken == "" { 2187 return nil 2188 } 2189 c.searchfoldersrequest.PageToken = x.NextPageToken 2190 } 2191 } 2192 2193 type FoldersSetIamPolicyCall struct { 2194 s *Service 2195 resource string 2196 setiampolicyrequest *SetIamPolicyRequest 2197 urlParams_ gensupport.URLParams 2198 ctx_ context.Context 2199 header_ http.Header 2200 } 2201 2202 // SetIamPolicy: Sets the access control policy on a Folder, replacing any 2203 // existing policy. The `resource` field should be the Folder's resource name, 2204 // e.g. "folders/1234". The caller must have 2205 // `resourcemanager.folders.setIamPolicy` permission on the identified folder. 2206 // 2207 // - resource: REQUIRED: The resource for which the policy is being specified. 2208 // See Resource names (https://cloud.google.com/apis/design/resource_names) 2209 // for the appropriate value for this field. 2210 func (r *FoldersService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *FoldersSetIamPolicyCall { 2211 c := &FoldersSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2212 c.resource = resource 2213 c.setiampolicyrequest = setiampolicyrequest 2214 return c 2215 } 2216 2217 // Fields allows partial responses to be retrieved. See 2218 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2219 // details. 2220 func (c *FoldersSetIamPolicyCall) Fields(s ...googleapi.Field) *FoldersSetIamPolicyCall { 2221 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2222 return c 2223 } 2224 2225 // Context sets the context to be used in this call's Do method. 2226 func (c *FoldersSetIamPolicyCall) Context(ctx context.Context) *FoldersSetIamPolicyCall { 2227 c.ctx_ = ctx 2228 return c 2229 } 2230 2231 // Header returns a http.Header that can be modified by the caller to add 2232 // headers to the request. 2233 func (c *FoldersSetIamPolicyCall) Header() http.Header { 2234 if c.header_ == nil { 2235 c.header_ = make(http.Header) 2236 } 2237 return c.header_ 2238 } 2239 2240 func (c *FoldersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 2241 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2242 var body io.Reader = nil 2243 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 2244 if err != nil { 2245 return nil, err 2246 } 2247 c.urlParams_.Set("alt", alt) 2248 c.urlParams_.Set("prettyPrint", "false") 2249 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:setIamPolicy") 2250 urls += "?" + c.urlParams_.Encode() 2251 req, err := http.NewRequest("POST", urls, body) 2252 if err != nil { 2253 return nil, err 2254 } 2255 req.Header = reqHeaders 2256 googleapi.Expand(req.URL, map[string]string{ 2257 "resource": c.resource, 2258 }) 2259 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2260 } 2261 2262 // Do executes the "cloudresourcemanager.folders.setIamPolicy" call. 2263 // Any non-2xx status code is an error. Response headers are in either 2264 // *Policy.ServerResponse.Header or (if a response was returned at all) in 2265 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2266 // whether the returned error was because http.StatusNotModified was returned. 2267 func (c *FoldersSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 2268 gensupport.SetOptions(c.urlParams_, opts...) 2269 res, err := c.doRequest("json") 2270 if res != nil && res.StatusCode == http.StatusNotModified { 2271 if res.Body != nil { 2272 res.Body.Close() 2273 } 2274 return nil, gensupport.WrapError(&googleapi.Error{ 2275 Code: res.StatusCode, 2276 Header: res.Header, 2277 }) 2278 } 2279 if err != nil { 2280 return nil, err 2281 } 2282 defer googleapi.CloseBody(res) 2283 if err := googleapi.CheckResponse(res); err != nil { 2284 return nil, gensupport.WrapError(err) 2285 } 2286 ret := &Policy{ 2287 ServerResponse: googleapi.ServerResponse{ 2288 Header: res.Header, 2289 HTTPStatusCode: res.StatusCode, 2290 }, 2291 } 2292 target := &ret 2293 if err := gensupport.DecodeResponse(target, res); err != nil { 2294 return nil, err 2295 } 2296 return ret, nil 2297 } 2298 2299 type FoldersTestIamPermissionsCall struct { 2300 s *Service 2301 resource string 2302 testiampermissionsrequest *TestIamPermissionsRequest 2303 urlParams_ gensupport.URLParams 2304 ctx_ context.Context 2305 header_ http.Header 2306 } 2307 2308 // TestIamPermissions: Returns permissions that a caller has on the specified 2309 // Folder. The `resource` field should be the Folder's resource name, e.g. 2310 // "folders/1234". There are no permissions required for making this API call. 2311 // 2312 // - resource: REQUIRED: The resource for which the policy detail is being 2313 // requested. See Resource names 2314 // (https://cloud.google.com/apis/design/resource_names) for the appropriate 2315 // value for this field. 2316 func (r *FoldersService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *FoldersTestIamPermissionsCall { 2317 c := &FoldersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2318 c.resource = resource 2319 c.testiampermissionsrequest = testiampermissionsrequest 2320 return c 2321 } 2322 2323 // Fields allows partial responses to be retrieved. See 2324 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2325 // details. 2326 func (c *FoldersTestIamPermissionsCall) Fields(s ...googleapi.Field) *FoldersTestIamPermissionsCall { 2327 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2328 return c 2329 } 2330 2331 // Context sets the context to be used in this call's Do method. 2332 func (c *FoldersTestIamPermissionsCall) Context(ctx context.Context) *FoldersTestIamPermissionsCall { 2333 c.ctx_ = ctx 2334 return c 2335 } 2336 2337 // Header returns a http.Header that can be modified by the caller to add 2338 // headers to the request. 2339 func (c *FoldersTestIamPermissionsCall) Header() http.Header { 2340 if c.header_ == nil { 2341 c.header_ = make(http.Header) 2342 } 2343 return c.header_ 2344 } 2345 2346 func (c *FoldersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 2347 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2348 var body io.Reader = nil 2349 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 2350 if err != nil { 2351 return nil, err 2352 } 2353 c.urlParams_.Set("alt", alt) 2354 c.urlParams_.Set("prettyPrint", "false") 2355 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:testIamPermissions") 2356 urls += "?" + c.urlParams_.Encode() 2357 req, err := http.NewRequest("POST", urls, body) 2358 if err != nil { 2359 return nil, err 2360 } 2361 req.Header = reqHeaders 2362 googleapi.Expand(req.URL, map[string]string{ 2363 "resource": c.resource, 2364 }) 2365 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2366 } 2367 2368 // Do executes the "cloudresourcemanager.folders.testIamPermissions" call. 2369 // Any non-2xx status code is an error. Response headers are in either 2370 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was 2371 // returned at all) in error.(*googleapi.Error).Header. Use 2372 // googleapi.IsNotModified to check whether the returned error was because 2373 // http.StatusNotModified was returned. 2374 func (c *FoldersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 2375 gensupport.SetOptions(c.urlParams_, opts...) 2376 res, err := c.doRequest("json") 2377 if res != nil && res.StatusCode == http.StatusNotModified { 2378 if res.Body != nil { 2379 res.Body.Close() 2380 } 2381 return nil, gensupport.WrapError(&googleapi.Error{ 2382 Code: res.StatusCode, 2383 Header: res.Header, 2384 }) 2385 } 2386 if err != nil { 2387 return nil, err 2388 } 2389 defer googleapi.CloseBody(res) 2390 if err := googleapi.CheckResponse(res); err != nil { 2391 return nil, gensupport.WrapError(err) 2392 } 2393 ret := &TestIamPermissionsResponse{ 2394 ServerResponse: googleapi.ServerResponse{ 2395 Header: res.Header, 2396 HTTPStatusCode: res.StatusCode, 2397 }, 2398 } 2399 target := &ret 2400 if err := gensupport.DecodeResponse(target, res); err != nil { 2401 return nil, err 2402 } 2403 return ret, nil 2404 } 2405 2406 type FoldersUndeleteCall struct { 2407 s *Service 2408 name string 2409 undeletefolderrequest *UndeleteFolderRequest 2410 urlParams_ gensupport.URLParams 2411 ctx_ context.Context 2412 header_ http.Header 2413 } 2414 2415 // Undelete: Cancels the deletion request for a Folder. This method may only be 2416 // called on a Folder in the DELETE_REQUESTED state. In order to succeed, the 2417 // Folder's parent must be in the ACTIVE state. In addition, reintroducing the 2418 // folder into the tree must not violate folder naming, height and fanout 2419 // constraints described in the CreateFolder documentation. The caller must 2420 // have `resourcemanager.folders.undelete` permission on the identified folder. 2421 // 2422 // - name: The resource name of the Folder to undelete. Must be of the form 2423 // `folders/{folder_id}`. 2424 func (r *FoldersService) Undelete(name string, undeletefolderrequest *UndeleteFolderRequest) *FoldersUndeleteCall { 2425 c := &FoldersUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2426 c.name = name 2427 c.undeletefolderrequest = undeletefolderrequest 2428 return c 2429 } 2430 2431 // Fields allows partial responses to be retrieved. See 2432 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2433 // details. 2434 func (c *FoldersUndeleteCall) Fields(s ...googleapi.Field) *FoldersUndeleteCall { 2435 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2436 return c 2437 } 2438 2439 // Context sets the context to be used in this call's Do method. 2440 func (c *FoldersUndeleteCall) Context(ctx context.Context) *FoldersUndeleteCall { 2441 c.ctx_ = ctx 2442 return c 2443 } 2444 2445 // Header returns a http.Header that can be modified by the caller to add 2446 // headers to the request. 2447 func (c *FoldersUndeleteCall) Header() http.Header { 2448 if c.header_ == nil { 2449 c.header_ = make(http.Header) 2450 } 2451 return c.header_ 2452 } 2453 2454 func (c *FoldersUndeleteCall) doRequest(alt string) (*http.Response, error) { 2455 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2456 var body io.Reader = nil 2457 body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletefolderrequest) 2458 if err != nil { 2459 return nil, err 2460 } 2461 c.urlParams_.Set("alt", alt) 2462 c.urlParams_.Set("prettyPrint", "false") 2463 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete") 2464 urls += "?" + c.urlParams_.Encode() 2465 req, err := http.NewRequest("POST", urls, body) 2466 if err != nil { 2467 return nil, err 2468 } 2469 req.Header = reqHeaders 2470 googleapi.Expand(req.URL, map[string]string{ 2471 "name": c.name, 2472 }) 2473 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2474 } 2475 2476 // Do executes the "cloudresourcemanager.folders.undelete" call. 2477 // Any non-2xx status code is an error. Response headers are in either 2478 // *Folder.ServerResponse.Header or (if a response was returned at all) in 2479 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2480 // whether the returned error was because http.StatusNotModified was returned. 2481 func (c *FoldersUndeleteCall) Do(opts ...googleapi.CallOption) (*Folder, error) { 2482 gensupport.SetOptions(c.urlParams_, opts...) 2483 res, err := c.doRequest("json") 2484 if res != nil && res.StatusCode == http.StatusNotModified { 2485 if res.Body != nil { 2486 res.Body.Close() 2487 } 2488 return nil, gensupport.WrapError(&googleapi.Error{ 2489 Code: res.StatusCode, 2490 Header: res.Header, 2491 }) 2492 } 2493 if err != nil { 2494 return nil, err 2495 } 2496 defer googleapi.CloseBody(res) 2497 if err := googleapi.CheckResponse(res); err != nil { 2498 return nil, gensupport.WrapError(err) 2499 } 2500 ret := &Folder{ 2501 ServerResponse: googleapi.ServerResponse{ 2502 Header: res.Header, 2503 HTTPStatusCode: res.StatusCode, 2504 }, 2505 } 2506 target := &ret 2507 if err := gensupport.DecodeResponse(target, res); err != nil { 2508 return nil, err 2509 } 2510 return ret, nil 2511 } 2512 2513 type OperationsGetCall struct { 2514 s *Service 2515 name string 2516 urlParams_ gensupport.URLParams 2517 ifNoneMatch_ string 2518 ctx_ context.Context 2519 header_ http.Header 2520 } 2521 2522 // Get: Gets the latest state of a long-running operation. Clients can use this 2523 // method to poll the operation result at intervals as recommended by the API 2524 // service. 2525 // 2526 // - name: The name of the operation resource. 2527 func (r *OperationsService) Get(name string) *OperationsGetCall { 2528 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2529 c.name = name 2530 return c 2531 } 2532 2533 // Fields allows partial responses to be retrieved. See 2534 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2535 // details. 2536 func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 2537 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2538 return c 2539 } 2540 2541 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2542 // object's ETag matches the given value. This is useful for getting updates 2543 // only after the object has changed since the last request. 2544 func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 2545 c.ifNoneMatch_ = entityTag 2546 return c 2547 } 2548 2549 // Context sets the context to be used in this call's Do method. 2550 func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 2551 c.ctx_ = ctx 2552 return c 2553 } 2554 2555 // Header returns a http.Header that can be modified by the caller to add 2556 // headers to the request. 2557 func (c *OperationsGetCall) Header() http.Header { 2558 if c.header_ == nil { 2559 c.header_ = make(http.Header) 2560 } 2561 return c.header_ 2562 } 2563 2564 func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 2565 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2566 if c.ifNoneMatch_ != "" { 2567 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2568 } 2569 var body io.Reader = nil 2570 c.urlParams_.Set("alt", alt) 2571 c.urlParams_.Set("prettyPrint", "false") 2572 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2573 urls += "?" + c.urlParams_.Encode() 2574 req, err := http.NewRequest("GET", urls, body) 2575 if err != nil { 2576 return nil, err 2577 } 2578 req.Header = reqHeaders 2579 googleapi.Expand(req.URL, map[string]string{ 2580 "name": c.name, 2581 }) 2582 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2583 } 2584 2585 // Do executes the "cloudresourcemanager.operations.get" call. 2586 // Any non-2xx status code is an error. Response headers are in either 2587 // *Operation.ServerResponse.Header or (if a response was returned at all) in 2588 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2589 // whether the returned error was because http.StatusNotModified was returned. 2590 func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2591 gensupport.SetOptions(c.urlParams_, opts...) 2592 res, err := c.doRequest("json") 2593 if res != nil && res.StatusCode == http.StatusNotModified { 2594 if res.Body != nil { 2595 res.Body.Close() 2596 } 2597 return nil, gensupport.WrapError(&googleapi.Error{ 2598 Code: res.StatusCode, 2599 Header: res.Header, 2600 }) 2601 } 2602 if err != nil { 2603 return nil, err 2604 } 2605 defer googleapi.CloseBody(res) 2606 if err := googleapi.CheckResponse(res); err != nil { 2607 return nil, gensupport.WrapError(err) 2608 } 2609 ret := &Operation{ 2610 ServerResponse: googleapi.ServerResponse{ 2611 Header: res.Header, 2612 HTTPStatusCode: res.StatusCode, 2613 }, 2614 } 2615 target := &ret 2616 if err := gensupport.DecodeResponse(target, res); err != nil { 2617 return nil, err 2618 } 2619 return ret, nil 2620 } 2621