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