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