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