...

Source file src/google.golang.org/api/cloudresourcemanager/v1/cloudresourcemanager-gen.go

Documentation: google.golang.org/api/cloudresourcemanager/v1

     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/v1"
    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/v1"
    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:v1"
    95  const apiName = "cloudresourcemanager"
    96  const apiVersion = "v1"
    97  const basePath = "https://cloudresourcemanager.googleapis.com/"
    98  const basePathTemplate = "https://cloudresourcemanager.UNIVERSE_DOMAIN/"
    99  const mtlsBasePath = "https://cloudresourcemanager.mtls.googleapis.com/"
   100  
   101  // OAuth2 scopes used by this API.
   102  const (
   103  	// See, edit, configure, and delete your Google Cloud data and see the email
   104  	// address for your Google Account.
   105  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
   106  
   107  	// View your data across Google Cloud services and see the email address of
   108  	// your Google Account
   109  	CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
   110  )
   111  
   112  // NewService creates a new Service.
   113  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   114  	scopesOption := internaloption.WithDefaultScopes(
   115  		"https://www.googleapis.com/auth/cloud-platform",
   116  		"https://www.googleapis.com/auth/cloud-platform.read-only",
   117  	)
   118  	// NOTE: prepend, so we don't override user-specified scopes.
   119  	opts = append([]option.ClientOption{scopesOption}, opts...)
   120  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   121  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   122  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   123  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   124  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   125  	if err != nil {
   126  		return nil, err
   127  	}
   128  	s, err := New(client)
   129  	if err != nil {
   130  		return nil, err
   131  	}
   132  	if endpoint != "" {
   133  		s.BasePath = endpoint
   134  	}
   135  	return s, nil
   136  }
   137  
   138  // New creates a new Service. It uses the provided http.Client for requests.
   139  //
   140  // Deprecated: please use NewService instead.
   141  // To provide a custom HTTP client, use option.WithHTTPClient.
   142  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   143  func New(client *http.Client) (*Service, error) {
   144  	if client == nil {
   145  		return nil, errors.New("client is nil")
   146  	}
   147  	s := &Service{client: client, BasePath: basePath}
   148  	s.Folders = NewFoldersService(s)
   149  	s.Liens = NewLiensService(s)
   150  	s.Operations = NewOperationsService(s)
   151  	s.Organizations = NewOrganizationsService(s)
   152  	s.Projects = NewProjectsService(s)
   153  	return s, nil
   154  }
   155  
   156  type Service struct {
   157  	client    *http.Client
   158  	BasePath  string // API endpoint base URL
   159  	UserAgent string // optional additional User-Agent fragment
   160  
   161  	Folders *FoldersService
   162  
   163  	Liens *LiensService
   164  
   165  	Operations *OperationsService
   166  
   167  	Organizations *OrganizationsService
   168  
   169  	Projects *ProjectsService
   170  }
   171  
   172  func (s *Service) userAgent() string {
   173  	if s.UserAgent == "" {
   174  		return googleapi.UserAgent
   175  	}
   176  	return googleapi.UserAgent + " " + s.UserAgent
   177  }
   178  
   179  func NewFoldersService(s *Service) *FoldersService {
   180  	rs := &FoldersService{s: s}
   181  	return rs
   182  }
   183  
   184  type FoldersService struct {
   185  	s *Service
   186  }
   187  
   188  func NewLiensService(s *Service) *LiensService {
   189  	rs := &LiensService{s: s}
   190  	return rs
   191  }
   192  
   193  type LiensService struct {
   194  	s *Service
   195  }
   196  
   197  func NewOperationsService(s *Service) *OperationsService {
   198  	rs := &OperationsService{s: s}
   199  	return rs
   200  }
   201  
   202  type OperationsService struct {
   203  	s *Service
   204  }
   205  
   206  func NewOrganizationsService(s *Service) *OrganizationsService {
   207  	rs := &OrganizationsService{s: s}
   208  	return rs
   209  }
   210  
   211  type OrganizationsService struct {
   212  	s *Service
   213  }
   214  
   215  func NewProjectsService(s *Service) *ProjectsService {
   216  	rs := &ProjectsService{s: s}
   217  	return rs
   218  }
   219  
   220  type ProjectsService struct {
   221  	s *Service
   222  }
   223  
   224  // Ancestor: Identifying information for a single ancestor of a project.
   225  type Ancestor struct {
   226  	// ResourceId: Resource id of the ancestor.
   227  	ResourceId *ResourceId `json:"resourceId,omitempty"`
   228  	// ForceSendFields is a list of field names (e.g. "ResourceId") to
   229  	// unconditionally include in API requests. By default, fields with empty or
   230  	// default values are omitted from API requests. See
   231  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   232  	// details.
   233  	ForceSendFields []string `json:"-"`
   234  	// NullFields is a list of field names (e.g. "ResourceId") to include in API
   235  	// requests with the JSON null value. By default, fields with empty values are
   236  	// omitted from API requests. See
   237  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   238  	NullFields []string `json:"-"`
   239  }
   240  
   241  func (s *Ancestor) MarshalJSON() ([]byte, error) {
   242  	type NoMethod Ancestor
   243  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   244  }
   245  
   246  // AuditConfig: Specifies the audit configuration for a service. The
   247  // configuration determines which permission types are logged, and what
   248  // identities, if any, are exempted from logging. An AuditConfig must have one
   249  // or more AuditLogConfigs. If there are AuditConfigs for both `allServices`
   250  // and a specific service, the union of the two AuditConfigs is used for that
   251  // service: the log_types specified in each AuditConfig are enabled, and the
   252  // exempted_members in each AuditLogConfig are exempted. Example Policy with
   253  // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices",
   254  // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [
   255  // "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type":
   256  // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com",
   257  // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type":
   258  // "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For
   259  // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
   260  // logging. It also exempts `jose@example.com` from DATA_READ logging, and
   261  // `aliya@example.com` from DATA_WRITE logging.
   262  type AuditConfig struct {
   263  	// AuditLogConfigs: The configuration for logging of each type of permission.
   264  	AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
   265  	// Service: Specifies a service that will be enabled for audit logging. For
   266  	// example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices`
   267  	// is a special value that covers all services.
   268  	Service string `json:"service,omitempty"`
   269  	// ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
   270  	// unconditionally include in API requests. By default, fields with empty or
   271  	// default values are omitted from API requests. See
   272  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   273  	// details.
   274  	ForceSendFields []string `json:"-"`
   275  	// NullFields is a list of field names (e.g. "AuditLogConfigs") to include in
   276  	// API requests with the JSON null value. By default, fields with empty values
   277  	// are omitted from API requests. See
   278  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   279  	NullFields []string `json:"-"`
   280  }
   281  
   282  func (s *AuditConfig) MarshalJSON() ([]byte, error) {
   283  	type NoMethod AuditConfig
   284  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   285  }
   286  
   287  // AuditLogConfig: Provides the configuration for logging a type of
   288  // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ",
   289  // "exempted_members": [ "user:jose@example.com" ] }, { "log_type":
   290  // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while
   291  // exempting jose@example.com from DATA_READ logging.
   292  type AuditLogConfig struct {
   293  	// ExemptedMembers: Specifies the identities that do not cause logging for this
   294  	// type of permission. Follows the same format of Binding.members.
   295  	ExemptedMembers []string `json:"exemptedMembers,omitempty"`
   296  	// LogType: The log type that this config enables.
   297  	//
   298  	// Possible values:
   299  	//   "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
   300  	//   "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
   301  	//   "DATA_WRITE" - Data writes. Example: CloudSQL Users create
   302  	//   "DATA_READ" - Data reads. Example: CloudSQL Users list
   303  	LogType string `json:"logType,omitempty"`
   304  	// ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
   305  	// unconditionally include in API requests. By default, fields with empty or
   306  	// default values are omitted from API requests. See
   307  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   308  	// details.
   309  	ForceSendFields []string `json:"-"`
   310  	// NullFields is a list of field names (e.g. "ExemptedMembers") to include in
   311  	// API requests with the JSON null value. By default, fields with empty values
   312  	// are omitted from API requests. See
   313  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   314  	NullFields []string `json:"-"`
   315  }
   316  
   317  func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
   318  	type NoMethod AuditLogConfig
   319  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   320  }
   321  
   322  // Binding: Associates `members`, or principals, with a `role`.
   323  type Binding struct {
   324  	// Condition: The condition that is associated with this binding. If the
   325  	// condition evaluates to `true`, then this binding applies to the current
   326  	// request. If the condition evaluates to `false`, then this binding does not
   327  	// apply to the current request. However, a different role binding might grant
   328  	// the same role to one or more of the principals in this binding. To learn
   329  	// which resources support conditions in their IAM policies, see the IAM
   330  	// documentation
   331  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   332  	Condition *Expr `json:"condition,omitempty"`
   333  	// Members: Specifies the principals requesting access for a Google Cloud
   334  	// resource. `members` can have the following values: * `allUsers`: A special
   335  	// identifier that represents anyone who is on the internet; with or without a
   336  	// Google account. * `allAuthenticatedUsers`: A special identifier that
   337  	// represents anyone who is authenticated with a Google account or a service
   338  	// account. Does not include identities that come from external identity
   339  	// providers (IdPs) through identity federation. * `user:{emailid}`: An email
   340  	// address that represents a specific Google account. For example,
   341  	// `alice@example.com` . * `serviceAccount:{emailid}`: An email address that
   342  	// represents a Google service account. For example,
   343  	// `my-other-app@appspot.gserviceaccount.com`. *
   344  	// `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
   345  	// identifier for a Kubernetes service account
   346  	// (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
   347  	// For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
   348  	// `group:{emailid}`: An email address that represents a Google group. For
   349  	// example, `admins@example.com`. * `domain:{domain}`: The G Suite domain
   350  	// (primary) that represents all the users of that domain. For example,
   351  	// `google.com` or `example.com`. *
   352  	// `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub
   353  	// ject/{subject_attribute_value}`: A single identity in a workforce identity
   354  	// pool. *
   355  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   356  	// group/{group_id}`: All workforce identities in a group. *
   357  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   358  	// attribute.{attribute_name}/{attribute_value}`: All workforce identities with
   359  	// a specific attribute value. *
   360  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   361  	// *`: All identities in a workforce identity pool. *
   362  	// `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo
   363  	// rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single
   364  	// identity in a workload identity pool. *
   365  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   366  	// /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool
   367  	// group. *
   368  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   369  	// /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
   370  	// `: All identities in a workload identity pool with a certain attribute. *
   371  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   372  	// /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity
   373  	// pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
   374  	// unique identifier) representing a user that has been recently deleted. For
   375  	// example, `alice@example.com?uid=123456789012345678901`. If the user is
   376  	// recovered, this value reverts to `user:{emailid}` and the recovered user
   377  	// retains the role in the binding. *
   378  	// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
   379  	// unique identifier) representing a service account that has been recently
   380  	// deleted. For example,
   381  	// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the
   382  	// service account is undeleted, this value reverts to
   383  	// `serviceAccount:{emailid}` and the undeleted service account retains the
   384  	// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
   385  	// address (plus unique identifier) representing a Google group that has been
   386  	// recently deleted. For example,
   387  	// `admins@example.com?uid=123456789012345678901`. If the group is recovered,
   388  	// this value reverts to `group:{emailid}` and the recovered group retains the
   389  	// role in the binding. *
   390  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool
   391  	// _id}/subject/{subject_attribute_value}`: Deleted single identity in a
   392  	// workforce identity pool. For example,
   393  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po
   394  	// ol-id/subject/my-subject-attribute-value`.
   395  	Members []string `json:"members,omitempty"`
   396  	// Role: Role that is assigned to the list of `members`, or principals. For
   397  	// example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview
   398  	// of the IAM roles and permissions, see the IAM documentation
   399  	// (https://cloud.google.com/iam/docs/roles-overview). For a list of the
   400  	// available pre-defined roles, see here
   401  	// (https://cloud.google.com/iam/docs/understanding-roles).
   402  	Role string `json:"role,omitempty"`
   403  	// ForceSendFields is a list of field names (e.g. "Condition") 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. "Condition") to include in API
   410  	// requests with the JSON null value. By default, fields with empty values are
   411  	// 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 *Binding) MarshalJSON() ([]byte, error) {
   417  	type NoMethod Binding
   418  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   419  }
   420  
   421  // BooleanConstraint: A `Constraint` that is either enforced or not. For
   422  // example a constraint `constraints/compute.disableSerialPortAccess`. If it is
   423  // enforced on a VM instance, serial port connections will not be opened to
   424  // that instance.
   425  type BooleanConstraint struct {
   426  }
   427  
   428  // BooleanPolicy: Used in `policy_type` to specify how `boolean_policy` will
   429  // behave at this resource.
   430  type BooleanPolicy struct {
   431  	// Enforced: If `true`, then the `Policy` is enforced. If `false`, then any
   432  	// configuration is acceptable. Suppose you have a `Constraint`
   433  	// `constraints/compute.disableSerialPortAccess` with `constraint_default` set
   434  	// to `ALLOW`. A `Policy` for that `Constraint` exhibits the following
   435  	// behavior: - If the `Policy` at this resource has enforced set to `false`,
   436  	// serial port connection attempts will be allowed. - If the `Policy` at this
   437  	// resource has enforced set to `true`, serial port connection attempts will be
   438  	// refused. - If the `Policy` at this resource is `RestoreDefault`, serial port
   439  	// connection attempts will be allowed. - If no `Policy` is set at this
   440  	// resource or anywhere higher in the resource hierarchy, serial port
   441  	// connection attempts will be allowed. - If no `Policy` is set at this
   442  	// resource, but one exists higher in the resource hierarchy, the behavior is
   443  	// as if the`Policy` were set at this resource. The following examples
   444  	// demonstrate the different possible layerings: Example 1 (nearest
   445  	// `Constraint` wins): `organizations/foo` has a `Policy` with: {enforced:
   446  	// false} `projects/bar` has no `Policy` set. The constraint at `projects/bar`
   447  	// and `organizations/foo` will not be enforced. Example 2 (enforcement gets
   448  	// replaced): `organizations/foo` has a `Policy` with: {enforced: false}
   449  	// `projects/bar` has a `Policy` with: {enforced: true} The constraint at
   450  	// `organizations/foo` is not enforced. The constraint at `projects/bar` is
   451  	// enforced. Example 3 (RestoreDefault): `organizations/foo` has a `Policy`
   452  	// with: {enforced: true} `projects/bar` has a `Policy` with: {RestoreDefault:
   453  	// {}} The constraint at `organizations/foo` is enforced. The constraint at
   454  	// `projects/bar` is not enforced, because `constraint_default` for the
   455  	// `Constraint` is `ALLOW`.
   456  	Enforced bool `json:"enforced,omitempty"`
   457  	// ForceSendFields is a list of field names (e.g. "Enforced") to
   458  	// unconditionally include in API requests. By default, fields with empty or
   459  	// default values are omitted from API requests. See
   460  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   461  	// details.
   462  	ForceSendFields []string `json:"-"`
   463  	// NullFields is a list of field names (e.g. "Enforced") to include in API
   464  	// requests with the JSON null value. By default, fields with empty values are
   465  	// omitted from API requests. See
   466  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   467  	NullFields []string `json:"-"`
   468  }
   469  
   470  func (s *BooleanPolicy) MarshalJSON() ([]byte, error) {
   471  	type NoMethod BooleanPolicy
   472  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   473  }
   474  
   475  // ClearOrgPolicyRequest: The request sent to the ClearOrgPolicy method.
   476  type ClearOrgPolicyRequest struct {
   477  	// Constraint: Name of the `Constraint` of the `Policy` to clear.
   478  	Constraint string `json:"constraint,omitempty"`
   479  	// Etag: The current version, for concurrency control. Not sending an `etag`
   480  	// will cause the `Policy` to be cleared blindly.
   481  	Etag string `json:"etag,omitempty"`
   482  	// ForceSendFields is a list of field names (e.g. "Constraint") to
   483  	// unconditionally include in API requests. By default, fields with empty or
   484  	// default values are omitted from API requests. See
   485  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   486  	// details.
   487  	ForceSendFields []string `json:"-"`
   488  	// NullFields is a list of field names (e.g. "Constraint") to include in API
   489  	// requests with the JSON null value. By default, fields with empty values are
   490  	// omitted from API requests. See
   491  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   492  	NullFields []string `json:"-"`
   493  }
   494  
   495  func (s *ClearOrgPolicyRequest) MarshalJSON() ([]byte, error) {
   496  	type NoMethod ClearOrgPolicyRequest
   497  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   498  }
   499  
   500  // CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation:
   501  // Metadata describing a long running folder operation
   502  type CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation struct {
   503  	// DestinationParent: The resource name of the folder or organization we are
   504  	// either creating the folder under or moving the folder to.
   505  	DestinationParent string `json:"destinationParent,omitempty"`
   506  	// DisplayName: The display name of the folder.
   507  	DisplayName string `json:"displayName,omitempty"`
   508  	// OperationType: The type of this operation.
   509  	//
   510  	// Possible values:
   511  	//   "OPERATION_TYPE_UNSPECIFIED" - Operation type not specified.
   512  	//   "CREATE" - A create folder operation.
   513  	//   "MOVE" - A move folder operation.
   514  	OperationType string `json:"operationType,omitempty"`
   515  	// SourceParent: The resource name of the folder's parent. Only applicable when
   516  	// the operation_type is MOVE.
   517  	SourceParent string `json:"sourceParent,omitempty"`
   518  	// ForceSendFields is a list of field names (e.g. "DestinationParent") to
   519  	// unconditionally include in API requests. By default, fields with empty or
   520  	// default values are omitted from API requests. See
   521  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   522  	// details.
   523  	ForceSendFields []string `json:"-"`
   524  	// NullFields is a list of field names (e.g. "DestinationParent") to include in
   525  	// API requests with the JSON null value. By default, fields with empty values
   526  	// are omitted from API requests. See
   527  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   528  	NullFields []string `json:"-"`
   529  }
   530  
   531  func (s *CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation) MarshalJSON() ([]byte, error) {
   532  	type NoMethod CloudresourcemanagerGoogleCloudResourcemanagerV2alpha1FolderOperation
   533  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   534  }
   535  
   536  // CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation:
   537  // Metadata describing a long running folder operation
   538  type CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation struct {
   539  	// DestinationParent: The resource name of the folder or organization we are
   540  	// either creating the folder under or moving the folder to.
   541  	DestinationParent string `json:"destinationParent,omitempty"`
   542  	// DisplayName: The display name of the folder.
   543  	DisplayName string `json:"displayName,omitempty"`
   544  	// OperationType: The type of this operation.
   545  	//
   546  	// Possible values:
   547  	//   "OPERATION_TYPE_UNSPECIFIED" - Operation type not specified.
   548  	//   "CREATE" - A create folder operation.
   549  	//   "MOVE" - A move folder operation.
   550  	OperationType string `json:"operationType,omitempty"`
   551  	// SourceParent: The resource name of the folder's parent. Only applicable when
   552  	// the operation_type is MOVE.
   553  	SourceParent string `json:"sourceParent,omitempty"`
   554  	// ForceSendFields is a list of field names (e.g. "DestinationParent") to
   555  	// unconditionally include in API requests. By default, fields with empty or
   556  	// default values are omitted from API requests. See
   557  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   558  	// details.
   559  	ForceSendFields []string `json:"-"`
   560  	// NullFields is a list of field names (e.g. "DestinationParent") to include in
   561  	// API requests with the JSON null value. By default, fields with empty values
   562  	// are omitted from API requests. See
   563  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   564  	NullFields []string `json:"-"`
   565  }
   566  
   567  func (s *CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation) MarshalJSON() ([]byte, error) {
   568  	type NoMethod CloudresourcemanagerGoogleCloudResourcemanagerV2beta1FolderOperation
   569  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   570  }
   571  
   572  // Constraint: A `Constraint` describes a way in which a resource's
   573  // configuration can be restricted. For example, it controls which cloud
   574  // services can be activated across an organization, or whether a Compute
   575  // Engine instance can have serial port connections established. `Constraints`
   576  // can be configured by the organization's policy administrator to fit the
   577  // needs of the organzation by setting Policies for `Constraints` at different
   578  // locations in the organization's resource hierarchy. Policies are inherited
   579  // down the resource hierarchy from higher levels, but can also be overridden.
   580  // For details about the inheritance rules please read about Policies
   581  // (/resource-manager/reference/rest/v1/Policy). `Constraints` have a default
   582  // behavior determined by the `constraint_default` field, which is the
   583  // enforcement behavior that is used in the absence of a `Policy` being defined
   584  // or inherited for the resource in question.
   585  type Constraint struct {
   586  	// BooleanConstraint: Defines this constraint as being a BooleanConstraint.
   587  	BooleanConstraint *BooleanConstraint `json:"booleanConstraint,omitempty"`
   588  	// ConstraintDefault: The evaluation behavior of this constraint in the absence
   589  	// of 'Policy'.
   590  	//
   591  	// Possible values:
   592  	//   "CONSTRAINT_DEFAULT_UNSPECIFIED" - This is only used for distinguishing
   593  	// unset values and should never be used.
   594  	//   "ALLOW" - Indicate that all values are allowed for list constraints.
   595  	// Indicate that enforcement is off for boolean constraints.
   596  	//   "DENY" - Indicate that all values are denied for list constraints.
   597  	// Indicate that enforcement is on for boolean constraints.
   598  	ConstraintDefault string `json:"constraintDefault,omitempty"`
   599  	// Description: Detailed description of what this `Constraint` controls as well
   600  	// as how and where it is enforced. Mutable.
   601  	Description string `json:"description,omitempty"`
   602  	// DisplayName: The human readable name. Mutable.
   603  	DisplayName string `json:"displayName,omitempty"`
   604  	// ListConstraint: Defines this constraint as being a ListConstraint.
   605  	ListConstraint *ListConstraint `json:"listConstraint,omitempty"`
   606  	// Name: Immutable value, required to globally be unique. For example,
   607  	// `constraints/serviceuser.services`
   608  	Name string `json:"name,omitempty"`
   609  	// Version: Version of the `Constraint`. Default version is 0;
   610  	Version int64 `json:"version,omitempty"`
   611  	// ForceSendFields is a list of field names (e.g. "BooleanConstraint") to
   612  	// unconditionally include in API requests. By default, fields with empty or
   613  	// default values are omitted from API requests. See
   614  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   615  	// details.
   616  	ForceSendFields []string `json:"-"`
   617  	// NullFields is a list of field names (e.g. "BooleanConstraint") to include in
   618  	// API requests with the JSON null value. By default, fields with empty values
   619  	// are omitted from API requests. See
   620  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   621  	NullFields []string `json:"-"`
   622  }
   623  
   624  func (s *Constraint) MarshalJSON() ([]byte, error) {
   625  	type NoMethod Constraint
   626  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   627  }
   628  
   629  // CreateFolderMetadata: Metadata pertaining to the Folder creation process.
   630  type CreateFolderMetadata struct {
   631  	// DisplayName: The display name of the folder.
   632  	DisplayName string `json:"displayName,omitempty"`
   633  	// Parent: The resource name of the folder or organization we are creating the
   634  	// folder under.
   635  	Parent string `json:"parent,omitempty"`
   636  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   637  	// unconditionally include in API requests. By default, fields with empty or
   638  	// default values are omitted from API requests. See
   639  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   640  	// details.
   641  	ForceSendFields []string `json:"-"`
   642  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
   643  	// requests with the JSON null value. By default, fields with empty values are
   644  	// omitted from API requests. See
   645  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   646  	NullFields []string `json:"-"`
   647  }
   648  
   649  func (s *CreateFolderMetadata) MarshalJSON() ([]byte, error) {
   650  	type NoMethod CreateFolderMetadata
   651  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   652  }
   653  
   654  // CreateProjectMetadata: A status object which is used as the `metadata` field
   655  // for the Operation returned by CreateProject. It provides insight for when
   656  // significant phases of Project creation have completed.
   657  type CreateProjectMetadata struct {
   658  	// CreateTime: Creation time of the project creation workflow.
   659  	CreateTime string `json:"createTime,omitempty"`
   660  	// Gettable: True if the project can be retrieved using `GetProject`. No other
   661  	// operations on the project are guaranteed to work until the project creation
   662  	// is complete.
   663  	Gettable bool `json:"gettable,omitempty"`
   664  	// Ready: True if the project creation process is complete.
   665  	Ready bool `json:"ready,omitempty"`
   666  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   667  	// unconditionally include in API requests. By default, fields with empty or
   668  	// default values are omitted from API requests. See
   669  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   670  	// details.
   671  	ForceSendFields []string `json:"-"`
   672  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   673  	// requests with the JSON null value. By default, fields with empty values are
   674  	// omitted from API requests. See
   675  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   676  	NullFields []string `json:"-"`
   677  }
   678  
   679  func (s *CreateProjectMetadata) MarshalJSON() ([]byte, error) {
   680  	type NoMethod CreateProjectMetadata
   681  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   682  }
   683  
   684  // CreateTagBindingMetadata: Runtime operation information for creating a
   685  // TagValue.
   686  type CreateTagBindingMetadata struct {
   687  }
   688  
   689  // CreateTagKeyMetadata: Runtime operation information for creating a TagKey.
   690  type CreateTagKeyMetadata struct {
   691  }
   692  
   693  // CreateTagValueMetadata: Runtime operation information for creating a
   694  // TagValue.
   695  type CreateTagValueMetadata struct {
   696  }
   697  
   698  // DeleteFolderMetadata: A status object which is used as the `metadata` field
   699  // for the `Operation` returned by `DeleteFolder`.
   700  type DeleteFolderMetadata struct {
   701  }
   702  
   703  // DeleteOrganizationMetadata: A status object which is used as the `metadata`
   704  // field for the operation returned by DeleteOrganization.
   705  type DeleteOrganizationMetadata struct {
   706  }
   707  
   708  // DeleteProjectMetadata: A status object which is used as the `metadata` field
   709  // for the Operation returned by `DeleteProject`.
   710  type DeleteProjectMetadata struct {
   711  }
   712  
   713  // DeleteTagBindingMetadata: Runtime operation information for deleting a
   714  // TagBinding.
   715  type DeleteTagBindingMetadata struct {
   716  }
   717  
   718  // DeleteTagKeyMetadata: Runtime operation information for deleting a TagKey.
   719  type DeleteTagKeyMetadata struct {
   720  }
   721  
   722  // DeleteTagValueMetadata: Runtime operation information for deleting a
   723  // TagValue.
   724  type DeleteTagValueMetadata struct {
   725  }
   726  
   727  // Empty: A generic empty message that you can re-use to avoid defining
   728  // duplicated empty messages in your APIs. A typical example is to use it as
   729  // the request or the response type of an API method. For instance: service Foo
   730  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   731  type Empty struct {
   732  	// ServerResponse contains the HTTP response code and headers from the server.
   733  	googleapi.ServerResponse `json:"-"`
   734  }
   735  
   736  // Expr: Represents a textual expression in the Common Expression Language
   737  // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics
   738  // of CEL are documented at https://github.com/google/cel-spec. Example
   739  // (Comparison): title: "Summary size limit" description: "Determines if a
   740  // summary is less than 100 chars" expression: "document.summary.size() < 100"
   741  // Example (Equality): title: "Requestor is owner" description: "Determines if
   742  // requestor is the document owner" expression: "document.owner ==
   743  // request.auth.claims.email" Example (Logic): title: "Public documents"
   744  // description: "Determine whether the document should be publicly visible"
   745  // expression: "document.type != 'private' && document.type != 'internal'"
   746  // Example (Data Manipulation): title: "Notification string" description:
   747  // "Create a notification string with a timestamp." expression: "'New message
   748  // received at ' + string(document.create_time)" The exact variables and
   749  // functions that may be referenced within an expression are determined by the
   750  // service that evaluates it. See the service documentation for additional
   751  // information.
   752  type Expr struct {
   753  	// Description: Optional. Description of the expression. This is a longer text
   754  	// which describes the expression, e.g. when hovered over it in a UI.
   755  	Description string `json:"description,omitempty"`
   756  	// Expression: Textual representation of an expression in Common Expression
   757  	// Language syntax.
   758  	Expression string `json:"expression,omitempty"`
   759  	// Location: Optional. String indicating the location of the expression for
   760  	// error reporting, e.g. a file name and a position in the file.
   761  	Location string `json:"location,omitempty"`
   762  	// Title: Optional. Title for the expression, i.e. a short string describing
   763  	// its purpose. This can be used e.g. in UIs which allow to enter the
   764  	// expression.
   765  	Title string `json:"title,omitempty"`
   766  	// ForceSendFields is a list of field names (e.g. "Description") to
   767  	// unconditionally include in API requests. By default, fields with empty or
   768  	// default values are omitted from API requests. See
   769  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   770  	// details.
   771  	ForceSendFields []string `json:"-"`
   772  	// NullFields is a list of field names (e.g. "Description") to include in API
   773  	// requests with the JSON null value. By default, fields with empty values are
   774  	// omitted from API requests. See
   775  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   776  	NullFields []string `json:"-"`
   777  }
   778  
   779  func (s *Expr) MarshalJSON() ([]byte, error) {
   780  	type NoMethod Expr
   781  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   782  }
   783  
   784  // FolderOperation: Metadata describing a long running folder operation
   785  type FolderOperation struct {
   786  	// DestinationParent: The resource name of the folder or organization we are
   787  	// either creating the folder under or moving the folder to.
   788  	DestinationParent string `json:"destinationParent,omitempty"`
   789  	// DisplayName: The display name of the folder.
   790  	DisplayName string `json:"displayName,omitempty"`
   791  	// OperationType: The type of this operation.
   792  	//
   793  	// Possible values:
   794  	//   "OPERATION_TYPE_UNSPECIFIED" - Operation type not specified.
   795  	//   "CREATE" - A create folder operation.
   796  	//   "MOVE" - A move folder operation.
   797  	OperationType string `json:"operationType,omitempty"`
   798  	// SourceParent: The resource name of the folder's parent. Only applicable when
   799  	// the operation_type is MOVE.
   800  	SourceParent string `json:"sourceParent,omitempty"`
   801  	// ForceSendFields is a list of field names (e.g. "DestinationParent") to
   802  	// unconditionally include in API requests. By default, fields with empty or
   803  	// default values are omitted from API requests. See
   804  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   805  	// details.
   806  	ForceSendFields []string `json:"-"`
   807  	// NullFields is a list of field names (e.g. "DestinationParent") to include in
   808  	// API requests with the JSON null value. By default, fields with empty values
   809  	// are omitted from API requests. See
   810  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   811  	NullFields []string `json:"-"`
   812  }
   813  
   814  func (s *FolderOperation) MarshalJSON() ([]byte, error) {
   815  	type NoMethod FolderOperation
   816  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   817  }
   818  
   819  // FolderOperationError: A classification of the Folder Operation error.
   820  type FolderOperationError struct {
   821  	// ErrorMessageId: The type of operation error experienced.
   822  	//
   823  	// Possible values:
   824  	//   "ERROR_TYPE_UNSPECIFIED" - The error type was unrecognized or unspecified.
   825  	//   "ACTIVE_FOLDER_HEIGHT_VIOLATION" - The attempted action would violate the
   826  	// max folder depth constraint.
   827  	//   "MAX_CHILD_FOLDERS_VIOLATION" - The attempted action would violate the max
   828  	// child folders constraint.
   829  	//   "FOLDER_NAME_UNIQUENESS_VIOLATION" - The attempted action would violate
   830  	// the locally-unique folder display_name constraint.
   831  	//   "RESOURCE_DELETED_VIOLATION" - The resource being moved has been deleted.
   832  	//   "PARENT_DELETED_VIOLATION" - The resource a folder was being added to has
   833  	// been deleted.
   834  	//   "CYCLE_INTRODUCED_VIOLATION" - The attempted action would introduce cycle
   835  	// in resource path.
   836  	//   "FOLDER_BEING_MOVED_VIOLATION" - The attempted action would move a folder
   837  	// that is already being moved.
   838  	//   "FOLDER_TO_DELETE_NON_EMPTY_VIOLATION" - The folder the caller is trying
   839  	// to delete contains active resources.
   840  	//   "DELETED_FOLDER_HEIGHT_VIOLATION" - The attempted action would violate the
   841  	// max deleted folder depth constraint.
   842  	ErrorMessageId string `json:"errorMessageId,omitempty"`
   843  	// ForceSendFields is a list of field names (e.g. "ErrorMessageId") to
   844  	// unconditionally include in API requests. By default, fields with empty or
   845  	// default values are omitted from API requests. See
   846  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   847  	// details.
   848  	ForceSendFields []string `json:"-"`
   849  	// NullFields is a list of field names (e.g. "ErrorMessageId") to include in
   850  	// API requests with the JSON null value. By default, fields with empty values
   851  	// are omitted from API requests. See
   852  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   853  	NullFields []string `json:"-"`
   854  }
   855  
   856  func (s *FolderOperationError) MarshalJSON() ([]byte, error) {
   857  	type NoMethod FolderOperationError
   858  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   859  }
   860  
   861  // GetAncestryRequest: The request sent to the GetAncestry method.
   862  type GetAncestryRequest struct {
   863  }
   864  
   865  // GetAncestryResponse: Response from the projects.getAncestry method.
   866  type GetAncestryResponse struct {
   867  	// Ancestor: Ancestors are ordered from bottom to top of the resource
   868  	// hierarchy. The first ancestor is the project itself, followed by the
   869  	// project's parent, etc..
   870  	Ancestor []*Ancestor `json:"ancestor,omitempty"`
   871  
   872  	// ServerResponse contains the HTTP response code and headers from the server.
   873  	googleapi.ServerResponse `json:"-"`
   874  	// ForceSendFields is a list of field names (e.g. "Ancestor") to
   875  	// unconditionally include in API requests. By default, fields with empty or
   876  	// default values are omitted from API requests. See
   877  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   878  	// details.
   879  	ForceSendFields []string `json:"-"`
   880  	// NullFields is a list of field names (e.g. "Ancestor") to include in API
   881  	// requests with the JSON null value. By default, fields with empty values are
   882  	// omitted from API requests. See
   883  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   884  	NullFields []string `json:"-"`
   885  }
   886  
   887  func (s *GetAncestryResponse) MarshalJSON() ([]byte, error) {
   888  	type NoMethod GetAncestryResponse
   889  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   890  }
   891  
   892  // GetEffectiveOrgPolicyRequest: The request sent to the GetEffectiveOrgPolicy
   893  // method.
   894  type GetEffectiveOrgPolicyRequest struct {
   895  	// Constraint: The name of the `Constraint` to compute the effective `Policy`.
   896  	Constraint string `json:"constraint,omitempty"`
   897  	// ForceSendFields is a list of field names (e.g. "Constraint") to
   898  	// unconditionally include in API requests. By default, fields with empty or
   899  	// default values are omitted from API requests. See
   900  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   901  	// details.
   902  	ForceSendFields []string `json:"-"`
   903  	// NullFields is a list of field names (e.g. "Constraint") to include in API
   904  	// requests with the JSON null value. By default, fields with empty values are
   905  	// omitted from API requests. See
   906  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   907  	NullFields []string `json:"-"`
   908  }
   909  
   910  func (s *GetEffectiveOrgPolicyRequest) MarshalJSON() ([]byte, error) {
   911  	type NoMethod GetEffectiveOrgPolicyRequest
   912  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   913  }
   914  
   915  // GetIamPolicyRequest: Request message for `GetIamPolicy` method.
   916  type GetIamPolicyRequest struct {
   917  	// Options: OPTIONAL: A `GetPolicyOptions` object for specifying options to
   918  	// `GetIamPolicy`.
   919  	Options *GetPolicyOptions `json:"options,omitempty"`
   920  	// ForceSendFields is a list of field names (e.g. "Options") to unconditionally
   921  	// include in API requests. By default, fields with empty or default values are
   922  	// omitted from API requests. See
   923  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   924  	// details.
   925  	ForceSendFields []string `json:"-"`
   926  	// NullFields is a list of field names (e.g. "Options") to include in API
   927  	// requests with the JSON null value. By default, fields with empty values are
   928  	// omitted from API requests. See
   929  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   930  	NullFields []string `json:"-"`
   931  }
   932  
   933  func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) {
   934  	type NoMethod GetIamPolicyRequest
   935  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   936  }
   937  
   938  // GetOrgPolicyRequest: The request sent to the GetOrgPolicy method.
   939  type GetOrgPolicyRequest struct {
   940  	// Constraint: Name of the `Constraint` to get the `Policy`.
   941  	Constraint string `json:"constraint,omitempty"`
   942  	// ForceSendFields is a list of field names (e.g. "Constraint") to
   943  	// unconditionally include in API requests. By default, fields with empty or
   944  	// default values are omitted from API requests. See
   945  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   946  	// details.
   947  	ForceSendFields []string `json:"-"`
   948  	// NullFields is a list of field names (e.g. "Constraint") to include in API
   949  	// requests with the JSON null value. By default, fields with empty values are
   950  	// omitted from API requests. See
   951  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   952  	NullFields []string `json:"-"`
   953  }
   954  
   955  func (s *GetOrgPolicyRequest) MarshalJSON() ([]byte, error) {
   956  	type NoMethod GetOrgPolicyRequest
   957  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   958  }
   959  
   960  // GetPolicyOptions: Encapsulates settings provided to GetIamPolicy.
   961  type GetPolicyOptions struct {
   962  	// RequestedPolicyVersion: Optional. The maximum policy version that will be
   963  	// used to format the policy. Valid values are 0, 1, and 3. Requests specifying
   964  	// an invalid value will be rejected. Requests for policies with any
   965  	// conditional role bindings must specify version 3. Policies with no
   966  	// conditional role bindings may specify any valid value or leave the field
   967  	// unset. The policy in the response might use the policy version that you
   968  	// specified, or it might use a lower policy version. For example, if you
   969  	// specify version 3, but the policy has no conditional role bindings, the
   970  	// response uses version 1. To learn which resources support conditions in
   971  	// their IAM policies, see the IAM documentation
   972  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   973  	RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"`
   974  	// ForceSendFields is a list of field names (e.g. "RequestedPolicyVersion") to
   975  	// unconditionally include in API requests. By default, fields with empty or
   976  	// default values are omitted from API requests. See
   977  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   978  	// details.
   979  	ForceSendFields []string `json:"-"`
   980  	// NullFields is a list of field names (e.g. "RequestedPolicyVersion") to
   981  	// include in API requests with the JSON null value. By default, fields with
   982  	// empty values are omitted from API requests. See
   983  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   984  	NullFields []string `json:"-"`
   985  }
   986  
   987  func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) {
   988  	type NoMethod GetPolicyOptions
   989  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   990  }
   991  
   992  // Lien: A Lien represents an encumbrance on the actions that can be performed
   993  // on a resource.
   994  type Lien struct {
   995  	// CreateTime: The creation time of this Lien.
   996  	CreateTime string `json:"createTime,omitempty"`
   997  	// Name: A system-generated unique identifier for this Lien. Example:
   998  	// `liens/1234abcd`
   999  	Name string `json:"name,omitempty"`
  1000  	// Origin: A stable, user-visible/meaningful string identifying the origin of
  1001  	// the Lien, intended to be inspected programmatically. Maximum length of 200
  1002  	// characters. Example: 'compute.googleapis.com'
  1003  	Origin string `json:"origin,omitempty"`
  1004  	// Parent: A reference to the resource this Lien is attached to. The server
  1005  	// will validate the parent against those for which Liens are supported.
  1006  	// Example: `projects/1234`
  1007  	Parent string `json:"parent,omitempty"`
  1008  	// Reason: Concise user-visible strings indicating why an action cannot be
  1009  	// performed on a resource. Maximum length of 200 characters. Example: 'Holds
  1010  	// production API key'
  1011  	Reason string `json:"reason,omitempty"`
  1012  	// Restrictions: The types of operations which should be blocked as a result of
  1013  	// this Lien. Each value should correspond to an IAM permission. The server
  1014  	// will validate the permissions against those for which Liens are supported.
  1015  	// An empty list is meaningless and will be rejected. Example:
  1016  	// ['resourcemanager.projects.delete']
  1017  	Restrictions []string `json:"restrictions,omitempty"`
  1018  
  1019  	// ServerResponse contains the HTTP response code and headers from the server.
  1020  	googleapi.ServerResponse `json:"-"`
  1021  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
  1022  	// unconditionally include in API requests. By default, fields with empty or
  1023  	// default values are omitted from API requests. See
  1024  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1025  	// details.
  1026  	ForceSendFields []string `json:"-"`
  1027  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
  1028  	// requests with the JSON null value. By default, fields with empty values are
  1029  	// omitted from API requests. See
  1030  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1031  	NullFields []string `json:"-"`
  1032  }
  1033  
  1034  func (s *Lien) MarshalJSON() ([]byte, error) {
  1035  	type NoMethod Lien
  1036  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1037  }
  1038  
  1039  // ListAvailableOrgPolicyConstraintsRequest: The request sent to the
  1040  // `ListAvailableOrgPolicyConstraints` method on the project, folder, or
  1041  // organization.
  1042  type ListAvailableOrgPolicyConstraintsRequest struct {
  1043  	// PageSize: Size of the pages to be returned. This is currently unsupported
  1044  	// and will be ignored. The server may at any point start using this field to
  1045  	// limit page size.
  1046  	PageSize int64 `json:"pageSize,omitempty"`
  1047  	// PageToken: Page token used to retrieve the next page. This is currently
  1048  	// unsupported and will be ignored. The server may at any point start using
  1049  	// this field.
  1050  	PageToken string `json:"pageToken,omitempty"`
  1051  	// ForceSendFields is a list of field names (e.g. "PageSize") to
  1052  	// unconditionally include in API requests. By default, fields with empty or
  1053  	// default values are omitted from API requests. See
  1054  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1055  	// details.
  1056  	ForceSendFields []string `json:"-"`
  1057  	// NullFields is a list of field names (e.g. "PageSize") to include in API
  1058  	// requests with the JSON null value. By default, fields with empty values are
  1059  	// omitted from API requests. See
  1060  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1061  	NullFields []string `json:"-"`
  1062  }
  1063  
  1064  func (s *ListAvailableOrgPolicyConstraintsRequest) MarshalJSON() ([]byte, error) {
  1065  	type NoMethod ListAvailableOrgPolicyConstraintsRequest
  1066  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1067  }
  1068  
  1069  // ListAvailableOrgPolicyConstraintsResponse: The response returned from the
  1070  // `ListAvailableOrgPolicyConstraints` method. Returns all `Constraints` that
  1071  // could be set at this level of the hierarchy (contrast with the response from
  1072  // `ListPolicies`, which returns all policies which are set).
  1073  type ListAvailableOrgPolicyConstraintsResponse struct {
  1074  	// Constraints: The collection of constraints that are settable on the request
  1075  	// resource.
  1076  	Constraints []*Constraint `json:"constraints,omitempty"`
  1077  	// NextPageToken: Page token used to retrieve the next page. This is currently
  1078  	// not used.
  1079  	NextPageToken string `json:"nextPageToken,omitempty"`
  1080  
  1081  	// ServerResponse contains the HTTP response code and headers from the server.
  1082  	googleapi.ServerResponse `json:"-"`
  1083  	// ForceSendFields is a list of field names (e.g. "Constraints") to
  1084  	// unconditionally include in API requests. By default, fields with empty or
  1085  	// default values are omitted from API requests. See
  1086  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1087  	// details.
  1088  	ForceSendFields []string `json:"-"`
  1089  	// NullFields is a list of field names (e.g. "Constraints") to include in API
  1090  	// requests with the JSON null value. By default, fields with empty values are
  1091  	// omitted from API requests. See
  1092  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1093  	NullFields []string `json:"-"`
  1094  }
  1095  
  1096  func (s *ListAvailableOrgPolicyConstraintsResponse) MarshalJSON() ([]byte, error) {
  1097  	type NoMethod ListAvailableOrgPolicyConstraintsResponse
  1098  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1099  }
  1100  
  1101  // ListConstraint: A `Constraint` that allows or disallows a list of string
  1102  // values, which are configured by an Organization's policy administrator with
  1103  // a `Policy`.
  1104  type ListConstraint struct {
  1105  	// SuggestedValue: Optional. The Google Cloud Console will try to default to a
  1106  	// configuration that matches the value specified in this `Constraint`.
  1107  	SuggestedValue string `json:"suggestedValue,omitempty"`
  1108  	// SupportsUnder: Indicates whether subtrees of Cloud Resource Manager resource
  1109  	// hierarchy can be used in `Policy.allowed_values` and `Policy.denied_values`.
  1110  	// For example, "under:folders/123" would match any resource under the
  1111  	// 'folders/123' folder.
  1112  	SupportsUnder bool `json:"supportsUnder,omitempty"`
  1113  	// ForceSendFields is a list of field names (e.g. "SuggestedValue") to
  1114  	// unconditionally include in API requests. By default, fields with empty or
  1115  	// default values are omitted from API requests. See
  1116  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1117  	// details.
  1118  	ForceSendFields []string `json:"-"`
  1119  	// NullFields is a list of field names (e.g. "SuggestedValue") to include in
  1120  	// API requests with the JSON null value. By default, fields with empty values
  1121  	// are omitted from API requests. See
  1122  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1123  	NullFields []string `json:"-"`
  1124  }
  1125  
  1126  func (s *ListConstraint) MarshalJSON() ([]byte, error) {
  1127  	type NoMethod ListConstraint
  1128  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1129  }
  1130  
  1131  // ListLiensResponse: The response message for Liens.ListLiens.
  1132  type ListLiensResponse struct {
  1133  	// Liens: A list of Liens.
  1134  	Liens []*Lien `json:"liens,omitempty"`
  1135  	// NextPageToken: Token to retrieve the next page of results, or empty if there
  1136  	// are no more results in the list.
  1137  	NextPageToken string `json:"nextPageToken,omitempty"`
  1138  
  1139  	// ServerResponse contains the HTTP response code and headers from the server.
  1140  	googleapi.ServerResponse `json:"-"`
  1141  	// ForceSendFields is a list of field names (e.g. "Liens") to unconditionally
  1142  	// include in API requests. By default, fields with empty or default values are
  1143  	// omitted from API requests. See
  1144  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1145  	// details.
  1146  	ForceSendFields []string `json:"-"`
  1147  	// NullFields is a list of field names (e.g. "Liens") to include in API
  1148  	// requests with the JSON null value. By default, fields with empty values are
  1149  	// omitted from API requests. See
  1150  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1151  	NullFields []string `json:"-"`
  1152  }
  1153  
  1154  func (s *ListLiensResponse) MarshalJSON() ([]byte, error) {
  1155  	type NoMethod ListLiensResponse
  1156  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1157  }
  1158  
  1159  // ListOrgPoliciesRequest: The request sent to the ListOrgPolicies method.
  1160  type ListOrgPoliciesRequest struct {
  1161  	// PageSize: Size of the pages to be returned. This is currently unsupported
  1162  	// and will be ignored. The server may at any point start using this field to
  1163  	// limit page size.
  1164  	PageSize int64 `json:"pageSize,omitempty"`
  1165  	// PageToken: Page token used to retrieve the next page. This is currently
  1166  	// unsupported and will be ignored. The server may at any point start using
  1167  	// this field.
  1168  	PageToken string `json:"pageToken,omitempty"`
  1169  	// ForceSendFields is a list of field names (e.g. "PageSize") to
  1170  	// unconditionally include in API requests. By default, fields with empty or
  1171  	// default values are omitted from API requests. See
  1172  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1173  	// details.
  1174  	ForceSendFields []string `json:"-"`
  1175  	// NullFields is a list of field names (e.g. "PageSize") to include in API
  1176  	// requests with the JSON null value. By default, fields with empty values are
  1177  	// omitted from API requests. See
  1178  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1179  	NullFields []string `json:"-"`
  1180  }
  1181  
  1182  func (s *ListOrgPoliciesRequest) MarshalJSON() ([]byte, error) {
  1183  	type NoMethod ListOrgPoliciesRequest
  1184  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1185  }
  1186  
  1187  // ListOrgPoliciesResponse: The response returned from the `ListOrgPolicies`
  1188  // method. It will be empty if no `Policies` are set on the resource.
  1189  type ListOrgPoliciesResponse struct {
  1190  	// NextPageToken: Page token used to retrieve the next page. This is currently
  1191  	// not used, but the server may at any point start supplying a valid token.
  1192  	NextPageToken string `json:"nextPageToken,omitempty"`
  1193  	// Policies: The `Policies` that are set on the resource. It will be empty if
  1194  	// no `Policies` are set.
  1195  	Policies []*OrgPolicy `json:"policies,omitempty"`
  1196  
  1197  	// ServerResponse contains the HTTP response code and headers from the server.
  1198  	googleapi.ServerResponse `json:"-"`
  1199  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1200  	// unconditionally include in API requests. By default, fields with empty or
  1201  	// default values are omitted from API requests. See
  1202  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1203  	// details.
  1204  	ForceSendFields []string `json:"-"`
  1205  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1206  	// requests with the JSON null value. By default, fields with empty values are
  1207  	// omitted from API requests. See
  1208  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1209  	NullFields []string `json:"-"`
  1210  }
  1211  
  1212  func (s *ListOrgPoliciesResponse) MarshalJSON() ([]byte, error) {
  1213  	type NoMethod ListOrgPoliciesResponse
  1214  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1215  }
  1216  
  1217  // ListPolicy: Used in `policy_type` to specify how `list_policy` behaves at
  1218  // this resource. `ListPolicy` can define specific values and subtrees of Cloud
  1219  // Resource Manager resource hierarchy (`Organizations`, `Folders`, `Projects`)
  1220  // that are allowed or denied by setting the `allowed_values` and
  1221  // `denied_values` fields. This is achieved by using the `under:` and optional
  1222  // `is:` prefixes. The `under:` prefix is used to denote resource subtree
  1223  // values. The `is:` prefix is used to denote specific values, and is required
  1224  // only if the value contains a ":". Values prefixed with "is:" are treated the
  1225  // same as values with no prefix. Ancestry subtrees must be in one of the
  1226  // following formats: - "projects/", e.g. "projects/tokyo-rain-123" -
  1227  // "folders/", e.g. "folders/1234" - "organizations/", e.g.
  1228  // "organizations/1234" The `supports_under` field of the associated
  1229  // `Constraint` defines whether ancestry prefixes can be used. You can set
  1230  // `allowed_values` and `denied_values` in the same `Policy` if `all_values` is
  1231  // `ALL_VALUES_UNSPECIFIED`. `ALLOW` or `DENY` are used to allow or deny all
  1232  // values. If `all_values` is set to either `ALLOW` or `DENY`, `allowed_values`
  1233  // and `denied_values` must be unset.
  1234  type ListPolicy struct {
  1235  	// AllValues: The policy all_values state.
  1236  	//
  1237  	// Possible values:
  1238  	//   "ALL_VALUES_UNSPECIFIED" - Indicates that allowed_values or denied_values
  1239  	// must be set.
  1240  	//   "ALLOW" - A policy with this set allows all values.
  1241  	//   "DENY" - A policy with this set denies all values.
  1242  	AllValues string `json:"allValues,omitempty"`
  1243  	// AllowedValues: List of values allowed at this resource. Can only be set if
  1244  	// `all_values` is set to `ALL_VALUES_UNSPECIFIED`.
  1245  	AllowedValues []string `json:"allowedValues,omitempty"`
  1246  	// DeniedValues: List of values denied at this resource. Can only be set if
  1247  	// `all_values` is set to `ALL_VALUES_UNSPECIFIED`.
  1248  	DeniedValues []string `json:"deniedValues,omitempty"`
  1249  	// InheritFromParent: Determines the inheritance behavior for this `Policy`. By
  1250  	// default, a `ListPolicy` set at a resource supersedes any `Policy` set
  1251  	// anywhere up the resource hierarchy. However, if `inherit_from_parent` is set
  1252  	// to `true`, then the values from the effective `Policy` of the parent
  1253  	// resource are inherited, meaning the values set in this `Policy` are added to
  1254  	// the values inherited up the hierarchy. Setting `Policy` hierarchies that
  1255  	// inherit both allowed values and denied values isn't recommended in most
  1256  	// circumstances to keep the configuration simple and understandable. However,
  1257  	// it is possible to set a `Policy` with `allowed_values` set that inherits a
  1258  	// `Policy` with `denied_values` set. In this case, the values that are allowed
  1259  	// must be in `allowed_values` and not present in `denied_values`. For example,
  1260  	// suppose you have a `Constraint` `constraints/serviceuser.services`, which
  1261  	// has a `constraint_type` of `list_constraint`, and with `constraint_default`
  1262  	// set to `ALLOW`. Suppose that at the Organization level, a `Policy` is
  1263  	// applied that restricts the allowed API activations to {`E1`, `E2`}. Then, if
  1264  	// a `Policy` is applied to a project below the Organization that has
  1265  	// `inherit_from_parent` set to `false` and field all_values set to DENY, then
  1266  	// an attempt to activate any API will be denied. The following examples
  1267  	// demonstrate different possible layerings for `projects/bar` parented by
  1268  	// `organizations/foo`: Example 1 (no inherited values): `organizations/foo`
  1269  	// has a `Policy` with values: {allowed_values: "E1" allowed_values:"E2"}
  1270  	// `projects/bar` has `inherit_from_parent` `false` and values:
  1271  	// {allowed_values: "E3" allowed_values: "E4"} The accepted values at
  1272  	// `organizations/foo` are `E1`, `E2`. The accepted values at `projects/bar`
  1273  	// are `E3`, and `E4`. Example 2 (inherited values): `organizations/foo` has a
  1274  	// `Policy` with values: {allowed_values: "E1" allowed_values:"E2"}
  1275  	// `projects/bar` has a `Policy` with values: {value: "E3" value: "E4"
  1276  	// inherit_from_parent: true} The accepted values at `organizations/foo` are
  1277  	// `E1`, `E2`. The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and
  1278  	// `E4`. Example 3 (inheriting both allowed and denied values):
  1279  	// `organizations/foo` has a `Policy` with values: {allowed_values: "E1"
  1280  	// allowed_values: "E2"} `projects/bar` has a `Policy` with: {denied_values:
  1281  	// "E1"} The accepted values at `organizations/foo` are `E1`, `E2`. The value
  1282  	// accepted at `projects/bar` is `E2`. Example 4 (RestoreDefault):
  1283  	// `organizations/foo` has a `Policy` with values: {allowed_values: "E1"
  1284  	// allowed_values:"E2"} `projects/bar` has a `Policy` with values:
  1285  	// {RestoreDefault: {}} The accepted values at `organizations/foo` are `E1`,
  1286  	// `E2`. The accepted values at `projects/bar` are either all or none depending
  1287  	// on the value of `constraint_default` (if `ALLOW`, all; if `DENY`, none).
  1288  	// Example 5 (no policy inherits parent policy): `organizations/foo` has no
  1289  	// `Policy` set. `projects/bar` has no `Policy` set. The accepted values at
  1290  	// both levels are either all or none depending on the value of
  1291  	// `constraint_default` (if `ALLOW`, all; if `DENY`, none). Example 6
  1292  	// (ListConstraint allowing all): `organizations/foo` has a `Policy` with
  1293  	// values: {allowed_values: "E1" allowed_values: "E2"} `projects/bar` has a
  1294  	// `Policy` with: {all: ALLOW} The accepted values at `organizations/foo` are
  1295  	// `E1`, E2`. Any value is accepted at `projects/bar`. Example 7
  1296  	// (ListConstraint allowing none): `organizations/foo` has a `Policy` with
  1297  	// values: {allowed_values: "E1" allowed_values: "E2"} `projects/bar` has a
  1298  	// `Policy` with: {all: DENY} The accepted values at `organizations/foo` are
  1299  	// `E1`, E2`. No value is accepted at `projects/bar`. Example 10 (allowed and
  1300  	// denied subtrees of Resource Manager hierarchy): Given the following resource
  1301  	// hierarchy O1->{F1, F2}; F1->{P1}; F2->{P2, P3}, `organizations/foo` has a
  1302  	// `Policy` with values: {allowed_values: "under:organizations/O1"}
  1303  	// `projects/bar` has a `Policy` with: {allowed_values: "under:projects/P3"}
  1304  	// {denied_values: "under:folders/F2"} The accepted values at
  1305  	// `organizations/foo` are `organizations/O1`, `folders/F1`, `folders/F2`,
  1306  	// `projects/P1`, `projects/P2`, `projects/P3`. The accepted values at
  1307  	// `projects/bar` are `organizations/O1`, `folders/F1`, `projects/P1`.
  1308  	InheritFromParent bool `json:"inheritFromParent,omitempty"`
  1309  	// SuggestedValue: Optional. The Google Cloud Console will try to default to a
  1310  	// configuration that matches the value specified in this `Policy`. If
  1311  	// `suggested_value` is not set, it will inherit the value specified higher in
  1312  	// the hierarchy, unless `inherit_from_parent` is `false`.
  1313  	SuggestedValue string `json:"suggestedValue,omitempty"`
  1314  	// ForceSendFields is a list of field names (e.g. "AllValues") to
  1315  	// unconditionally include in API requests. By default, fields with empty or
  1316  	// default values are omitted from API requests. See
  1317  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1318  	// details.
  1319  	ForceSendFields []string `json:"-"`
  1320  	// NullFields is a list of field names (e.g. "AllValues") to include in API
  1321  	// requests with the JSON null value. By default, fields with empty values are
  1322  	// omitted from API requests. See
  1323  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1324  	NullFields []string `json:"-"`
  1325  }
  1326  
  1327  func (s *ListPolicy) MarshalJSON() ([]byte, error) {
  1328  	type NoMethod ListPolicy
  1329  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1330  }
  1331  
  1332  // ListProjectsResponse: A page of the response received from the ListProjects
  1333  // method. A paginated response where more pages are available has
  1334  // `next_page_token` set. This token can be used in a subsequent request to
  1335  // retrieve the next request page.
  1336  type ListProjectsResponse struct {
  1337  	// NextPageToken: Pagination token. If the result set is too large to fit in a
  1338  	// single response, this token is returned. It encodes the position of the
  1339  	// current result cursor. Feeding this value into a new list request with the
  1340  	// `page_token` parameter gives the next page of the results. When
  1341  	// `next_page_token` is not filled in, there is no next page and the list
  1342  	// returned is the last page in the result set. Pagination tokens have a
  1343  	// limited lifetime.
  1344  	NextPageToken string `json:"nextPageToken,omitempty"`
  1345  	// Projects: The list of Projects that matched the list filter. This list can
  1346  	// be paginated.
  1347  	Projects []*Project `json:"projects,omitempty"`
  1348  
  1349  	// ServerResponse contains the HTTP response code and headers from the server.
  1350  	googleapi.ServerResponse `json:"-"`
  1351  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1352  	// unconditionally include in API requests. By default, fields with empty or
  1353  	// default values are omitted from API requests. See
  1354  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1355  	// details.
  1356  	ForceSendFields []string `json:"-"`
  1357  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1358  	// requests with the JSON null value. By default, fields with empty values are
  1359  	// omitted from API requests. See
  1360  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1361  	NullFields []string `json:"-"`
  1362  }
  1363  
  1364  func (s *ListProjectsResponse) MarshalJSON() ([]byte, error) {
  1365  	type NoMethod ListProjectsResponse
  1366  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1367  }
  1368  
  1369  // MoveFolderMetadata: Metadata pertaining to the folder move process.
  1370  type MoveFolderMetadata struct {
  1371  	// DestinationParent: The resource name of the folder or organization to move
  1372  	// the folder to.
  1373  	DestinationParent string `json:"destinationParent,omitempty"`
  1374  	// DisplayName: The display name of the folder.
  1375  	DisplayName string `json:"displayName,omitempty"`
  1376  	// SourceParent: The resource name of the folder's parent.
  1377  	SourceParent string `json:"sourceParent,omitempty"`
  1378  	// ForceSendFields is a list of field names (e.g. "DestinationParent") to
  1379  	// unconditionally include in API requests. By default, fields with empty or
  1380  	// default values are omitted from API requests. See
  1381  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1382  	// details.
  1383  	ForceSendFields []string `json:"-"`
  1384  	// NullFields is a list of field names (e.g. "DestinationParent") to include in
  1385  	// API requests with the JSON null value. By default, fields with empty values
  1386  	// are omitted from API requests. See
  1387  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1388  	NullFields []string `json:"-"`
  1389  }
  1390  
  1391  func (s *MoveFolderMetadata) MarshalJSON() ([]byte, error) {
  1392  	type NoMethod MoveFolderMetadata
  1393  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1394  }
  1395  
  1396  // MoveProjectMetadata: A status object which is used as the `metadata` field
  1397  // for the Operation returned by MoveProject.
  1398  type MoveProjectMetadata struct {
  1399  }
  1400  
  1401  // Operation: This resource represents a long-running operation that is the
  1402  // result of a network API call.
  1403  type Operation struct {
  1404  	// Done: If the value is `false`, it means the operation is still in progress.
  1405  	// If `true`, the operation is completed, and either `error` or `response` is
  1406  	// available.
  1407  	Done bool `json:"done,omitempty"`
  1408  	// Error: The error result of the operation in case of failure or cancellation.
  1409  	Error *Status `json:"error,omitempty"`
  1410  	// Metadata: Service-specific metadata associated with the operation. It
  1411  	// typically contains progress information and common metadata such as create
  1412  	// time. Some services might not provide such metadata. Any method that returns
  1413  	// a long-running operation should document the metadata type, if any.
  1414  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  1415  	// Name: The server-assigned name, which is only unique within the same service
  1416  	// that originally returns it. If you use the default HTTP mapping, the `name`
  1417  	// should be a resource name ending with `operations/{unique_id}`.
  1418  	Name string `json:"name,omitempty"`
  1419  	// Response: The normal, successful response of the operation. If the original
  1420  	// method returns no data on success, such as `Delete`, the response is
  1421  	// `google.protobuf.Empty`. If the original method is standard
  1422  	// `Get`/`Create`/`Update`, the response should be the resource. For other
  1423  	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
  1424  	// original method name. For example, if the original method name is
  1425  	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
  1426  	Response googleapi.RawMessage `json:"response,omitempty"`
  1427  
  1428  	// ServerResponse contains the HTTP response code and headers from the server.
  1429  	googleapi.ServerResponse `json:"-"`
  1430  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
  1431  	// include in API requests. By default, fields with empty or default values are
  1432  	// omitted from API requests. See
  1433  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1434  	// details.
  1435  	ForceSendFields []string `json:"-"`
  1436  	// NullFields is a list of field names (e.g. "Done") to include in API requests
  1437  	// with the JSON null value. By default, fields with empty values are omitted
  1438  	// from API requests. See
  1439  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1440  	NullFields []string `json:"-"`
  1441  }
  1442  
  1443  func (s *Operation) MarshalJSON() ([]byte, error) {
  1444  	type NoMethod Operation
  1445  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1446  }
  1447  
  1448  // OrgPolicy: Defines a Cloud Organization `Policy` which is used to specify
  1449  // `Constraints` for configurations of Cloud Platform resources.
  1450  type OrgPolicy struct {
  1451  	// BooleanPolicy: For boolean `Constraints`, whether to enforce the
  1452  	// `Constraint` or not.
  1453  	BooleanPolicy *BooleanPolicy `json:"booleanPolicy,omitempty"`
  1454  	// Constraint: The name of the `Constraint` the `Policy` is configuring, for
  1455  	// example, `constraints/serviceuser.services`. A list of available constraints
  1456  	// (/resource-manager/docs/organization-policy/org-policy-constraints) is
  1457  	// available. Immutable after creation.
  1458  	Constraint string `json:"constraint,omitempty"`
  1459  	// Etag: An opaque tag indicating the current version of the `Policy`, used for
  1460  	// concurrency control. When the `Policy` is returned from either a `GetPolicy`
  1461  	// or a `ListOrgPolicy` request, this `etag` indicates the version of the
  1462  	// current `Policy` to use when executing a read-modify-write loop. When the
  1463  	// `Policy` is returned from a `GetEffectivePolicy` request, the `etag` will be
  1464  	// unset. When the `Policy` is used in a `SetOrgPolicy` method, use the `etag`
  1465  	// value that was returned from a `GetOrgPolicy` request as part of a
  1466  	// read-modify-write loop for concurrency control. Not setting the `etag`in a
  1467  	// `SetOrgPolicy` request will result in an unconditional write of the
  1468  	// `Policy`.
  1469  	Etag string `json:"etag,omitempty"`
  1470  	// ListPolicy: List of values either allowed or disallowed.
  1471  	ListPolicy *ListPolicy `json:"listPolicy,omitempty"`
  1472  	// RestoreDefault: Restores the default behavior of the constraint; independent
  1473  	// of `Constraint` type.
  1474  	RestoreDefault *RestoreDefault `json:"restoreDefault,omitempty"`
  1475  	// UpdateTime: The time stamp the `Policy` was previously updated. This is set
  1476  	// by the server, not specified by the caller, and represents the last time a
  1477  	// call to `SetOrgPolicy` was made for that `Policy`. Any value set by the
  1478  	// client will be ignored.
  1479  	UpdateTime string `json:"updateTime,omitempty"`
  1480  	// Version: Version of the `Policy`. Default version is 0;
  1481  	Version int64 `json:"version,omitempty"`
  1482  
  1483  	// ServerResponse contains the HTTP response code and headers from the server.
  1484  	googleapi.ServerResponse `json:"-"`
  1485  	// ForceSendFields is a list of field names (e.g. "BooleanPolicy") to
  1486  	// unconditionally include in API requests. By default, fields with empty or
  1487  	// default values are omitted from API requests. See
  1488  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1489  	// details.
  1490  	ForceSendFields []string `json:"-"`
  1491  	// NullFields is a list of field names (e.g. "BooleanPolicy") to include in API
  1492  	// requests with the JSON null value. By default, fields with empty values are
  1493  	// omitted from API requests. See
  1494  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1495  	NullFields []string `json:"-"`
  1496  }
  1497  
  1498  func (s *OrgPolicy) MarshalJSON() ([]byte, error) {
  1499  	type NoMethod OrgPolicy
  1500  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1501  }
  1502  
  1503  // Organization: The root node in the resource hierarchy to which a particular
  1504  // entity's (e.g., company) resources belong.
  1505  type Organization struct {
  1506  	// CreationTime: Timestamp when the Organization was created. Assigned by the
  1507  	// server.
  1508  	CreationTime string `json:"creationTime,omitempty"`
  1509  	// DisplayName: A human-readable string that refers to the Organization in the
  1510  	// Google Cloud console. This string is set by the server and cannot be
  1511  	// changed. The string will be set to the primary domain (for example,
  1512  	// "google.com") of the G Suite customer that owns the organization.
  1513  	DisplayName string `json:"displayName,omitempty"`
  1514  	// LifecycleState: The organization's current lifecycle state. Assigned by the
  1515  	// server.
  1516  	//
  1517  	// Possible values:
  1518  	//   "LIFECYCLE_STATE_UNSPECIFIED" - Unspecified state. This is only useful for
  1519  	// distinguishing unset values.
  1520  	//   "ACTIVE" - The normal and active state.
  1521  	//   "DELETE_REQUESTED" - The organization has been marked for deletion by the
  1522  	// user.
  1523  	LifecycleState string `json:"lifecycleState,omitempty"`
  1524  	// Name: Output only. The resource name of the organization. This is the
  1525  	// organization's relative path in the API. Its format is
  1526  	// "organizations/[organization_id]". For example, "organizations/1234".
  1527  	Name string `json:"name,omitempty"`
  1528  	// Owner: The owner of this Organization. The owner should be specified on
  1529  	// creation. Once set, it cannot be changed. This field is required.
  1530  	Owner *OrganizationOwner `json:"owner,omitempty"`
  1531  
  1532  	// ServerResponse contains the HTTP response code and headers from the server.
  1533  	googleapi.ServerResponse `json:"-"`
  1534  	// ForceSendFields is a list of field names (e.g. "CreationTime") to
  1535  	// unconditionally include in API requests. By default, fields with empty or
  1536  	// default values are omitted from API requests. See
  1537  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1538  	// details.
  1539  	ForceSendFields []string `json:"-"`
  1540  	// NullFields is a list of field names (e.g. "CreationTime") to include in API
  1541  	// requests with the JSON null value. By default, fields with empty values are
  1542  	// omitted from API requests. See
  1543  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1544  	NullFields []string `json:"-"`
  1545  }
  1546  
  1547  func (s *Organization) MarshalJSON() ([]byte, error) {
  1548  	type NoMethod Organization
  1549  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1550  }
  1551  
  1552  // OrganizationOwner: The entity that owns an Organization. The lifetime of the
  1553  // Organization and all of its descendants are bound to the
  1554  // `OrganizationOwner`. If the `OrganizationOwner` is deleted, the Organization
  1555  // and all its descendants will be deleted.
  1556  type OrganizationOwner struct {
  1557  	// DirectoryCustomerId: The G Suite customer id used in the Directory API.
  1558  	DirectoryCustomerId string `json:"directoryCustomerId,omitempty"`
  1559  	// ForceSendFields is a list of field names (e.g. "DirectoryCustomerId") to
  1560  	// unconditionally include in API requests. By default, fields with empty or
  1561  	// default values are omitted from API requests. See
  1562  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1563  	// details.
  1564  	ForceSendFields []string `json:"-"`
  1565  	// NullFields is a list of field names (e.g. "DirectoryCustomerId") to include
  1566  	// in API requests with the JSON null value. By default, fields with empty
  1567  	// values are omitted from API requests. See
  1568  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1569  	NullFields []string `json:"-"`
  1570  }
  1571  
  1572  func (s *OrganizationOwner) MarshalJSON() ([]byte, error) {
  1573  	type NoMethod OrganizationOwner
  1574  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1575  }
  1576  
  1577  // Policy: An Identity and Access Management (IAM) policy, which specifies
  1578  // access controls for Google Cloud resources. A `Policy` is a collection of
  1579  // `bindings`. A `binding` binds one or more `members`, or principals, to a
  1580  // single `role`. Principals can be user accounts, service accounts, Google
  1581  // groups, and domains (such as G Suite). A `role` is a named list of
  1582  // permissions; each `role` can be an IAM predefined role or a user-created
  1583  // custom role. For some types of Google Cloud resources, a `binding` can also
  1584  // specify a `condition`, which is a logical expression that allows access to a
  1585  // resource only if the expression evaluates to `true`. A condition can add
  1586  // constraints based on attributes of the request, the resource, or both. To
  1587  // learn which resources support conditions in their IAM policies, see the IAM
  1588  // documentation
  1589  // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
  1590  // example:** ``` { "bindings": [ { "role":
  1591  // "roles/resourcemanager.organizationAdmin", "members": [
  1592  // "user:mike@example.com", "group:admins@example.com", "domain:google.com",
  1593  // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role":
  1594  // "roles/resourcemanager.organizationViewer", "members": [
  1595  // "user:eve@example.com" ], "condition": { "title": "expirable access",
  1596  // "description": "Does not grant access after Sep 2020", "expression":
  1597  // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
  1598  // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
  1599  // members: - user:mike@example.com - group:admins@example.com -
  1600  // domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
  1601  // role: roles/resourcemanager.organizationAdmin - members: -
  1602  // user:eve@example.com role: roles/resourcemanager.organizationViewer
  1603  // condition: title: expirable access description: Does not grant access after
  1604  // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
  1605  // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
  1606  // see the IAM documentation (https://cloud.google.com/iam/docs/).
  1607  type Policy struct {
  1608  	// AuditConfigs: Specifies cloud audit logging configuration for this policy.
  1609  	AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  1610  	// Bindings: Associates a list of `members`, or principals, with a `role`.
  1611  	// Optionally, may specify a `condition` that determines how and when the
  1612  	// `bindings` are applied. Each of the `bindings` must contain at least one
  1613  	// principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
  1614  	// up to 250 of these principals can be Google groups. Each occurrence of a
  1615  	// principal counts towards these limits. For example, if the `bindings` grant
  1616  	// 50 different roles to `user:alice@example.com`, and not to any other
  1617  	// principal, then you can add another 1,450 principals to the `bindings` in
  1618  	// the `Policy`.
  1619  	Bindings []*Binding `json:"bindings,omitempty"`
  1620  	// Etag: `etag` is used for optimistic concurrency control as a way to help
  1621  	// prevent simultaneous updates of a policy from overwriting each other. It is
  1622  	// strongly suggested that systems make use of the `etag` in the
  1623  	// read-modify-write cycle to perform policy updates in order to avoid race
  1624  	// conditions: An `etag` is returned in the response to `getIamPolicy`, and
  1625  	// systems are expected to put that etag in the request to `setIamPolicy` to
  1626  	// ensure that their change will be applied to the same version of the policy.
  1627  	// **Important:** If you use IAM Conditions, you must include the `etag` field
  1628  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
  1629  	// you to overwrite a version `3` policy with a version `1` policy, and all of
  1630  	// the conditions in the version `3` policy are lost.
  1631  	Etag string `json:"etag,omitempty"`
  1632  	// Version: Specifies the format of the policy. Valid values are `0`, `1`, and
  1633  	// `3`. Requests that specify an invalid value are rejected. Any operation that
  1634  	// affects conditional role bindings must specify version `3`. This requirement
  1635  	// applies to the following operations: * Getting a policy that includes a
  1636  	// conditional role binding * Adding a conditional role binding to a policy *
  1637  	// Changing a conditional role binding in a policy * Removing any role binding,
  1638  	// with or without a condition, from a policy that includes conditions
  1639  	// **Important:** If you use IAM Conditions, you must include the `etag` field
  1640  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
  1641  	// you to overwrite a version `3` policy with a version `1` policy, and all of
  1642  	// the conditions in the version `3` policy are lost. If a policy does not
  1643  	// include any conditions, operations on that policy may specify any valid
  1644  	// version or leave the field unset. To learn which resources support
  1645  	// conditions in their IAM policies, see the IAM documentation
  1646  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
  1647  	Version int64 `json:"version,omitempty"`
  1648  
  1649  	// ServerResponse contains the HTTP response code and headers from the server.
  1650  	googleapi.ServerResponse `json:"-"`
  1651  	// ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  1652  	// unconditionally include in API requests. By default, fields with empty or
  1653  	// default values are omitted from API requests. See
  1654  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1655  	// details.
  1656  	ForceSendFields []string `json:"-"`
  1657  	// NullFields is a list of field names (e.g. "AuditConfigs") to include in API
  1658  	// requests with the JSON null value. By default, fields with empty values are
  1659  	// omitted from API requests. See
  1660  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1661  	NullFields []string `json:"-"`
  1662  }
  1663  
  1664  func (s *Policy) MarshalJSON() ([]byte, error) {
  1665  	type NoMethod Policy
  1666  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1667  }
  1668  
  1669  // Project: A Project is a high-level Google Cloud Platform entity. It is a
  1670  // container for ACLs, APIs, App Engine Apps, VMs, and other Google Cloud
  1671  // Platform resources.
  1672  type Project struct {
  1673  	// CreateTime: Creation time. Read-only.
  1674  	CreateTime string `json:"createTime,omitempty"`
  1675  	// Labels: The labels associated with this Project. Label keys must be between
  1676  	// 1 and 63 characters long and must conform to the following regular
  1677  	// expression: a-z{0,62}. Label values must be between 0 and 63 characters long
  1678  	// and must conform to the regular expression [a-z0-9_-]{0,63}. A label value
  1679  	// can be empty. No more than 256 labels can be associated with a given
  1680  	// resource. Clients should store labels in a representation such as JSON that
  1681  	// does not depend on specific characters being disallowed. Example:
  1682  	// "environment" : "dev" Read-write.
  1683  	Labels map[string]string `json:"labels,omitempty"`
  1684  	// LifecycleState: The Project lifecycle state. Read-only.
  1685  	//
  1686  	// Possible values:
  1687  	//   "LIFECYCLE_STATE_UNSPECIFIED" - Unspecified state. This is only
  1688  	// used/useful for distinguishing unset values.
  1689  	//   "ACTIVE" - The normal and active state.
  1690  	//   "DELETE_REQUESTED" - The project has been marked for deletion by the user
  1691  	// (by invoking DeleteProject) or by the system (Google Cloud Platform). This
  1692  	// can generally be reversed by invoking UndeleteProject.
  1693  	//   "DELETE_IN_PROGRESS" - This lifecycle state is no longer used and not
  1694  	// returned by the API.
  1695  	LifecycleState string `json:"lifecycleState,omitempty"`
  1696  	// Name: The optional user-assigned display name of the Project. When present
  1697  	// it must be between 4 to 30 characters. Allowed characters are: lowercase and
  1698  	// uppercase letters, numbers, hyphen, single-quote, double-quote, space, and
  1699  	// exclamation point. Example: `My Project` Read-write.
  1700  	Name string `json:"name,omitempty"`
  1701  	// Parent: An optional reference to a parent Resource. Supported parent types
  1702  	// include "organization" and "folder". Once set, the parent cannot be cleared.
  1703  	// The `parent` can be set on creation or using the `UpdateProject` method; the
  1704  	// end user must have the `resourcemanager.projects.create` permission on the
  1705  	// parent.
  1706  	Parent *ResourceId `json:"parent,omitempty"`
  1707  	// ProjectId: The unique, user-assigned ID of the Project. It must be 6 to 30
  1708  	// lowercase letters, digits, or hyphens. It must start with a letter. Trailing
  1709  	// hyphens are prohibited. Example: `tokyo-rain-123` Read-only after creation.
  1710  	ProjectId string `json:"projectId,omitempty"`
  1711  	// ProjectNumber: The number uniquely identifying the project. Example:
  1712  	// `415104041262` Read-only.
  1713  	ProjectNumber int64 `json:"projectNumber,omitempty,string"`
  1714  	// Tags: Optional. Input only. Immutable. Tag keys/values directly bound to
  1715  	// this project. Each item in the map must be expressed as " : ". For example:
  1716  	// "123/environment" : "production", "123/costCenter" : "marketing" Note:
  1717  	// Currently this field is in Preview.
  1718  	Tags map[string]string `json:"tags,omitempty"`
  1719  
  1720  	// ServerResponse contains the HTTP response code and headers from the server.
  1721  	googleapi.ServerResponse `json:"-"`
  1722  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
  1723  	// unconditionally include in API requests. By default, fields with empty or
  1724  	// default values are omitted from API requests. See
  1725  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1726  	// details.
  1727  	ForceSendFields []string `json:"-"`
  1728  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
  1729  	// requests with the JSON null value. By default, fields with empty values are
  1730  	// omitted from API requests. See
  1731  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1732  	NullFields []string `json:"-"`
  1733  }
  1734  
  1735  func (s *Project) MarshalJSON() ([]byte, error) {
  1736  	type NoMethod Project
  1737  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1738  }
  1739  
  1740  // ProjectCreationStatus: A status object which is used as the `metadata` field
  1741  // for the Operation returned by CreateProject. It provides insight for when
  1742  // significant phases of Project creation have completed.
  1743  type ProjectCreationStatus struct {
  1744  	// CreateTime: Creation time of the project creation workflow.
  1745  	CreateTime string `json:"createTime,omitempty"`
  1746  	// Gettable: True if the project can be retrieved using GetProject. No other
  1747  	// operations on the project are guaranteed to work until the project creation
  1748  	// is complete.
  1749  	Gettable bool `json:"gettable,omitempty"`
  1750  	// Ready: True if the project creation process is complete.
  1751  	Ready bool `json:"ready,omitempty"`
  1752  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
  1753  	// unconditionally include in API requests. By default, fields with empty or
  1754  	// default values are omitted from API requests. See
  1755  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1756  	// details.
  1757  	ForceSendFields []string `json:"-"`
  1758  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
  1759  	// requests with the JSON null value. By default, fields with empty values are
  1760  	// omitted from API requests. See
  1761  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1762  	NullFields []string `json:"-"`
  1763  }
  1764  
  1765  func (s *ProjectCreationStatus) MarshalJSON() ([]byte, error) {
  1766  	type NoMethod ProjectCreationStatus
  1767  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1768  }
  1769  
  1770  // ResourceId: A container to reference an id for any resource type. A
  1771  // `resource` in Google Cloud Platform is a generic term for something you (a
  1772  // developer) may want to interact with through one of our API's. Some examples
  1773  // are an App Engine app, a Compute Engine instance, a Cloud SQL database, and
  1774  // so on.
  1775  type ResourceId struct {
  1776  	// Id: The type-specific id. This should correspond to the id used in the
  1777  	// type-specific API's.
  1778  	Id string `json:"id,omitempty"`
  1779  	// Type: The resource type this id is for. At present, the valid types are:
  1780  	// "organization", "folder", and "project".
  1781  	Type string `json:"type,omitempty"`
  1782  	// ForceSendFields is a list of field names (e.g. "Id") to unconditionally
  1783  	// include in API requests. By default, fields with empty or default values are
  1784  	// omitted from API requests. See
  1785  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1786  	// details.
  1787  	ForceSendFields []string `json:"-"`
  1788  	// NullFields is a list of field names (e.g. "Id") to include in API requests
  1789  	// with the JSON null value. By default, fields with empty values are omitted
  1790  	// from API requests. See
  1791  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1792  	NullFields []string `json:"-"`
  1793  }
  1794  
  1795  func (s *ResourceId) MarshalJSON() ([]byte, error) {
  1796  	type NoMethod ResourceId
  1797  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1798  }
  1799  
  1800  // RestoreDefault: Ignores policies set above this resource and restores the
  1801  // `constraint_default` enforcement behavior of the specific `Constraint` at
  1802  // this resource. Suppose that `constraint_default` is set to `ALLOW` for the
  1803  // `Constraint` `constraints/serviceuser.services`. Suppose that organization
  1804  // foo.com sets a `Policy` at their Organization resource node that restricts
  1805  // the allowed service activations to deny all service activations. They could
  1806  // then set a `Policy` with the `policy_type` `restore_default` on several
  1807  // experimental projects, restoring the `constraint_default` enforcement of the
  1808  // `Constraint` for only those projects, allowing those projects to have all
  1809  // services activated.
  1810  type RestoreDefault struct {
  1811  }
  1812  
  1813  // SearchOrganizationsRequest: The request sent to the `SearchOrganizations`
  1814  // method.
  1815  type SearchOrganizationsRequest struct {
  1816  	// Filter: An optional query string used to filter the Organizations to return
  1817  	// in the response. Filter rules are case-insensitive. Organizations may be
  1818  	// filtered by `owner.directoryCustomerId` or by `domain`, where the domain is
  1819  	// a G Suite domain, for example: * Filter
  1820  	// `owner.directorycustomerid:123456789` returns Organization resources with
  1821  	// `owner.directory_customer_id` equal to `123456789`. * Filter
  1822  	// `domain:google.com` returns Organization resources corresponding to the
  1823  	// domain `google.com`. This field is optional.
  1824  	Filter string `json:"filter,omitempty"`
  1825  	// PageSize: The maximum number of Organizations to return in the response. The
  1826  	// server can return fewer organizations than requested. If unspecified, server
  1827  	// picks an appropriate default.
  1828  	PageSize int64 `json:"pageSize,omitempty"`
  1829  	// PageToken: A pagination token returned from a previous call to
  1830  	// `SearchOrganizations` that indicates from where listing should continue.
  1831  	// This field is optional.
  1832  	PageToken string `json:"pageToken,omitempty"`
  1833  	// ForceSendFields is a list of field names (e.g. "Filter") to unconditionally
  1834  	// include in API requests. By default, fields with empty or default values are
  1835  	// omitted from API requests. See
  1836  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1837  	// details.
  1838  	ForceSendFields []string `json:"-"`
  1839  	// NullFields is a list of field names (e.g. "Filter") to include in API
  1840  	// requests with the JSON null value. By default, fields with empty values are
  1841  	// omitted from API requests. See
  1842  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1843  	NullFields []string `json:"-"`
  1844  }
  1845  
  1846  func (s *SearchOrganizationsRequest) MarshalJSON() ([]byte, error) {
  1847  	type NoMethod SearchOrganizationsRequest
  1848  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1849  }
  1850  
  1851  // SearchOrganizationsResponse: The response returned from the
  1852  // `SearchOrganizations` method.
  1853  type SearchOrganizationsResponse struct {
  1854  	// NextPageToken: A pagination token to be used to retrieve the next page of
  1855  	// results. If the result is too large to fit within the page size specified in
  1856  	// the request, this field will be set with a token that can be used to fetch
  1857  	// the next page of results. If this field is empty, it indicates that this
  1858  	// response contains the last page of results.
  1859  	NextPageToken string `json:"nextPageToken,omitempty"`
  1860  	// Organizations: The list of Organizations that matched the search query,
  1861  	// possibly paginated.
  1862  	Organizations []*Organization `json:"organizations,omitempty"`
  1863  
  1864  	// ServerResponse contains the HTTP response code and headers from the server.
  1865  	googleapi.ServerResponse `json:"-"`
  1866  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1867  	// unconditionally include in API requests. By default, fields with empty or
  1868  	// default values are omitted from API requests. See
  1869  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1870  	// details.
  1871  	ForceSendFields []string `json:"-"`
  1872  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1873  	// requests with the JSON null value. By default, fields with empty values are
  1874  	// omitted from API requests. See
  1875  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1876  	NullFields []string `json:"-"`
  1877  }
  1878  
  1879  func (s *SearchOrganizationsResponse) MarshalJSON() ([]byte, error) {
  1880  	type NoMethod SearchOrganizationsResponse
  1881  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1882  }
  1883  
  1884  // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
  1885  type SetIamPolicyRequest struct {
  1886  	// Policy: REQUIRED: The complete policy to be applied to the `resource`. The
  1887  	// size of the policy is limited to a few 10s of KB. An empty policy is a valid
  1888  	// policy but certain Google Cloud services (such as Projects) might reject
  1889  	// them.
  1890  	Policy *Policy `json:"policy,omitempty"`
  1891  	// UpdateMask: OPTIONAL: A FieldMask specifying which fields of the policy to
  1892  	// modify. Only the fields in the mask will be modified. If no mask is
  1893  	// provided, the following default mask is used: `paths: "bindings, etag"
  1894  	UpdateMask string `json:"updateMask,omitempty"`
  1895  	// ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
  1896  	// include in API requests. By default, fields with empty or default values are
  1897  	// omitted from API requests. See
  1898  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1899  	// details.
  1900  	ForceSendFields []string `json:"-"`
  1901  	// NullFields is a list of field names (e.g. "Policy") to include in API
  1902  	// requests with the JSON null value. By default, fields with empty values are
  1903  	// omitted from API requests. See
  1904  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1905  	NullFields []string `json:"-"`
  1906  }
  1907  
  1908  func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  1909  	type NoMethod SetIamPolicyRequest
  1910  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1911  }
  1912  
  1913  // SetOrgPolicyRequest: The request sent to the SetOrgPolicyRequest method.
  1914  type SetOrgPolicyRequest struct {
  1915  	// Policy: `Policy` to set on the resource.
  1916  	Policy *OrgPolicy `json:"policy,omitempty"`
  1917  	// ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
  1918  	// include in API requests. By default, fields with empty or default values are
  1919  	// omitted from API requests. See
  1920  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1921  	// details.
  1922  	ForceSendFields []string `json:"-"`
  1923  	// NullFields is a list of field names (e.g. "Policy") to include in API
  1924  	// requests with the JSON null value. By default, fields with empty values are
  1925  	// omitted from API requests. See
  1926  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1927  	NullFields []string `json:"-"`
  1928  }
  1929  
  1930  func (s *SetOrgPolicyRequest) MarshalJSON() ([]byte, error) {
  1931  	type NoMethod SetOrgPolicyRequest
  1932  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1933  }
  1934  
  1935  // Status: The `Status` type defines a logical error model that is suitable for
  1936  // different programming environments, including REST APIs and RPC APIs. It is
  1937  // used by gRPC (https://github.com/grpc). Each `Status` message contains three
  1938  // pieces of data: error code, error message, and error details. You can find
  1939  // out more about this error model and how to work with it in the API Design
  1940  // Guide (https://cloud.google.com/apis/design/errors).
  1941  type Status struct {
  1942  	// Code: The status code, which should be an enum value of google.rpc.Code.
  1943  	Code int64 `json:"code,omitempty"`
  1944  	// Details: A list of messages that carry the error details. There is a common
  1945  	// set of message types for APIs to use.
  1946  	Details []googleapi.RawMessage `json:"details,omitempty"`
  1947  	// Message: A developer-facing error message, which should be in English. Any
  1948  	// user-facing error message should be localized and sent in the
  1949  	// google.rpc.Status.details field, or localized by the client.
  1950  	Message string `json:"message,omitempty"`
  1951  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
  1952  	// include in API requests. By default, fields with empty or default values are
  1953  	// omitted from API requests. See
  1954  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1955  	// details.
  1956  	ForceSendFields []string `json:"-"`
  1957  	// NullFields is a list of field names (e.g. "Code") to include in API requests
  1958  	// with the JSON null value. By default, fields with empty values are omitted
  1959  	// from API requests. See
  1960  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1961  	NullFields []string `json:"-"`
  1962  }
  1963  
  1964  func (s *Status) MarshalJSON() ([]byte, error) {
  1965  	type NoMethod Status
  1966  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1967  }
  1968  
  1969  // TestIamPermissionsRequest: Request message for `TestIamPermissions` method.
  1970  type TestIamPermissionsRequest struct {
  1971  	// Permissions: The set of permissions to check for the `resource`. Permissions
  1972  	// with wildcards (such as `*` or `storage.*`) are not allowed. For more
  1973  	// information see IAM Overview
  1974  	// (https://cloud.google.com/iam/docs/overview#permissions).
  1975  	Permissions []string `json:"permissions,omitempty"`
  1976  	// ForceSendFields is a list of field names (e.g. "Permissions") to
  1977  	// unconditionally include in API requests. By default, fields with empty or
  1978  	// default values are omitted from API requests. See
  1979  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1980  	// details.
  1981  	ForceSendFields []string `json:"-"`
  1982  	// NullFields is a list of field names (e.g. "Permissions") to include in API
  1983  	// requests with the JSON null value. By default, fields with empty values are
  1984  	// omitted from API requests. See
  1985  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1986  	NullFields []string `json:"-"`
  1987  }
  1988  
  1989  func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  1990  	type NoMethod TestIamPermissionsRequest
  1991  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1992  }
  1993  
  1994  // TestIamPermissionsResponse: Response message for `TestIamPermissions`
  1995  // method.
  1996  type TestIamPermissionsResponse struct {
  1997  	// Permissions: A subset of `TestPermissionsRequest.permissions` that the
  1998  	// caller is allowed.
  1999  	Permissions []string `json:"permissions,omitempty"`
  2000  
  2001  	// ServerResponse contains the HTTP response code and headers from the server.
  2002  	googleapi.ServerResponse `json:"-"`
  2003  	// ForceSendFields is a list of field names (e.g. "Permissions") to
  2004  	// unconditionally include in API requests. By default, fields with empty or
  2005  	// default values are omitted from API requests. See
  2006  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2007  	// details.
  2008  	ForceSendFields []string `json:"-"`
  2009  	// NullFields is a list of field names (e.g. "Permissions") to include in API
  2010  	// requests with the JSON null value. By default, fields with empty values are
  2011  	// omitted from API requests. See
  2012  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2013  	NullFields []string `json:"-"`
  2014  }
  2015  
  2016  func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  2017  	type NoMethod TestIamPermissionsResponse
  2018  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2019  }
  2020  
  2021  // UndeleteFolderMetadata: A status object which is used as the `metadata`
  2022  // field for the `Operation` returned by `UndeleteFolder`.
  2023  type UndeleteFolderMetadata struct {
  2024  }
  2025  
  2026  // UndeleteOrganizationMetadata: A status object which is used as the
  2027  // `metadata` field for the Operation returned by UndeleteOrganization.
  2028  type UndeleteOrganizationMetadata struct {
  2029  }
  2030  
  2031  // UndeleteProjectMetadata: A status object which is used as the `metadata`
  2032  // field for the Operation returned by `UndeleteProject`.
  2033  type UndeleteProjectMetadata struct {
  2034  }
  2035  
  2036  // UndeleteProjectRequest: The request sent to the UndeleteProject method.
  2037  type UndeleteProjectRequest struct {
  2038  }
  2039  
  2040  // UpdateFolderMetadata: A status object which is used as the `metadata` field
  2041  // for the Operation returned by UpdateFolder.
  2042  type UpdateFolderMetadata struct {
  2043  }
  2044  
  2045  // UpdateProjectMetadata: A status object which is used as the `metadata` field
  2046  // for the Operation returned by UpdateProject.
  2047  type UpdateProjectMetadata struct {
  2048  }
  2049  
  2050  // UpdateTagKeyMetadata: Runtime operation information for updating a TagKey.
  2051  type UpdateTagKeyMetadata struct {
  2052  }
  2053  
  2054  // UpdateTagValueMetadata: Runtime operation information for updating a
  2055  // TagValue.
  2056  type UpdateTagValueMetadata struct {
  2057  }
  2058  
  2059  type FoldersClearOrgPolicyCall struct {
  2060  	s                     *Service
  2061  	resource              string
  2062  	clearorgpolicyrequest *ClearOrgPolicyRequest
  2063  	urlParams_            gensupport.URLParams
  2064  	ctx_                  context.Context
  2065  	header_               http.Header
  2066  }
  2067  
  2068  // ClearOrgPolicy: Clears a `Policy` from a resource.
  2069  //
  2070  // - resource: Name of the resource for the `Policy` to clear.
  2071  func (r *FoldersService) ClearOrgPolicy(resource string, clearorgpolicyrequest *ClearOrgPolicyRequest) *FoldersClearOrgPolicyCall {
  2072  	c := &FoldersClearOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2073  	c.resource = resource
  2074  	c.clearorgpolicyrequest = clearorgpolicyrequest
  2075  	return c
  2076  }
  2077  
  2078  // Fields allows partial responses to be retrieved. See
  2079  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2080  // details.
  2081  func (c *FoldersClearOrgPolicyCall) Fields(s ...googleapi.Field) *FoldersClearOrgPolicyCall {
  2082  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2083  	return c
  2084  }
  2085  
  2086  // Context sets the context to be used in this call's Do method.
  2087  func (c *FoldersClearOrgPolicyCall) Context(ctx context.Context) *FoldersClearOrgPolicyCall {
  2088  	c.ctx_ = ctx
  2089  	return c
  2090  }
  2091  
  2092  // Header returns a http.Header that can be modified by the caller to add
  2093  // headers to the request.
  2094  func (c *FoldersClearOrgPolicyCall) Header() http.Header {
  2095  	if c.header_ == nil {
  2096  		c.header_ = make(http.Header)
  2097  	}
  2098  	return c.header_
  2099  }
  2100  
  2101  func (c *FoldersClearOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
  2102  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2103  	var body io.Reader = nil
  2104  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.clearorgpolicyrequest)
  2105  	if err != nil {
  2106  		return nil, err
  2107  	}
  2108  	c.urlParams_.Set("alt", alt)
  2109  	c.urlParams_.Set("prettyPrint", "false")
  2110  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:clearOrgPolicy")
  2111  	urls += "?" + c.urlParams_.Encode()
  2112  	req, err := http.NewRequest("POST", urls, body)
  2113  	if err != nil {
  2114  		return nil, err
  2115  	}
  2116  	req.Header = reqHeaders
  2117  	googleapi.Expand(req.URL, map[string]string{
  2118  		"resource": c.resource,
  2119  	})
  2120  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2121  }
  2122  
  2123  // Do executes the "cloudresourcemanager.folders.clearOrgPolicy" call.
  2124  // Any non-2xx status code is an error. Response headers are in either
  2125  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2126  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2127  // whether the returned error was because http.StatusNotModified was returned.
  2128  func (c *FoldersClearOrgPolicyCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2129  	gensupport.SetOptions(c.urlParams_, opts...)
  2130  	res, err := c.doRequest("json")
  2131  	if res != nil && res.StatusCode == http.StatusNotModified {
  2132  		if res.Body != nil {
  2133  			res.Body.Close()
  2134  		}
  2135  		return nil, gensupport.WrapError(&googleapi.Error{
  2136  			Code:   res.StatusCode,
  2137  			Header: res.Header,
  2138  		})
  2139  	}
  2140  	if err != nil {
  2141  		return nil, err
  2142  	}
  2143  	defer googleapi.CloseBody(res)
  2144  	if err := googleapi.CheckResponse(res); err != nil {
  2145  		return nil, gensupport.WrapError(err)
  2146  	}
  2147  	ret := &Empty{
  2148  		ServerResponse: googleapi.ServerResponse{
  2149  			Header:         res.Header,
  2150  			HTTPStatusCode: res.StatusCode,
  2151  		},
  2152  	}
  2153  	target := &ret
  2154  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2155  		return nil, err
  2156  	}
  2157  	return ret, nil
  2158  }
  2159  
  2160  type FoldersGetEffectiveOrgPolicyCall struct {
  2161  	s                            *Service
  2162  	resource                     string
  2163  	geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest
  2164  	urlParams_                   gensupport.URLParams
  2165  	ctx_                         context.Context
  2166  	header_                      http.Header
  2167  }
  2168  
  2169  // GetEffectiveOrgPolicy: Gets the effective `Policy` on a resource. This is
  2170  // the result of merging `Policies` in the resource hierarchy. The returned
  2171  // `Policy` will not have an `etag`set because it is a computed `Policy` across
  2172  // multiple resources. Subtrees of Resource Manager resource hierarchy with
  2173  // 'under:' prefix will not be expanded.
  2174  //
  2175  //   - resource: The name of the resource to start computing the effective
  2176  //     `Policy`.
  2177  func (r *FoldersService) GetEffectiveOrgPolicy(resource string, geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest) *FoldersGetEffectiveOrgPolicyCall {
  2178  	c := &FoldersGetEffectiveOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2179  	c.resource = resource
  2180  	c.geteffectiveorgpolicyrequest = geteffectiveorgpolicyrequest
  2181  	return c
  2182  }
  2183  
  2184  // Fields allows partial responses to be retrieved. See
  2185  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2186  // details.
  2187  func (c *FoldersGetEffectiveOrgPolicyCall) Fields(s ...googleapi.Field) *FoldersGetEffectiveOrgPolicyCall {
  2188  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2189  	return c
  2190  }
  2191  
  2192  // Context sets the context to be used in this call's Do method.
  2193  func (c *FoldersGetEffectiveOrgPolicyCall) Context(ctx context.Context) *FoldersGetEffectiveOrgPolicyCall {
  2194  	c.ctx_ = ctx
  2195  	return c
  2196  }
  2197  
  2198  // Header returns a http.Header that can be modified by the caller to add
  2199  // headers to the request.
  2200  func (c *FoldersGetEffectiveOrgPolicyCall) Header() http.Header {
  2201  	if c.header_ == nil {
  2202  		c.header_ = make(http.Header)
  2203  	}
  2204  	return c.header_
  2205  }
  2206  
  2207  func (c *FoldersGetEffectiveOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
  2208  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2209  	var body io.Reader = nil
  2210  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.geteffectiveorgpolicyrequest)
  2211  	if err != nil {
  2212  		return nil, err
  2213  	}
  2214  	c.urlParams_.Set("alt", alt)
  2215  	c.urlParams_.Set("prettyPrint", "false")
  2216  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getEffectiveOrgPolicy")
  2217  	urls += "?" + c.urlParams_.Encode()
  2218  	req, err := http.NewRequest("POST", urls, body)
  2219  	if err != nil {
  2220  		return nil, err
  2221  	}
  2222  	req.Header = reqHeaders
  2223  	googleapi.Expand(req.URL, map[string]string{
  2224  		"resource": c.resource,
  2225  	})
  2226  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2227  }
  2228  
  2229  // Do executes the "cloudresourcemanager.folders.getEffectiveOrgPolicy" call.
  2230  // Any non-2xx status code is an error. Response headers are in either
  2231  // *OrgPolicy.ServerResponse.Header or (if a response was returned at all) in
  2232  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2233  // whether the returned error was because http.StatusNotModified was returned.
  2234  func (c *FoldersGetEffectiveOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
  2235  	gensupport.SetOptions(c.urlParams_, opts...)
  2236  	res, err := c.doRequest("json")
  2237  	if res != nil && res.StatusCode == http.StatusNotModified {
  2238  		if res.Body != nil {
  2239  			res.Body.Close()
  2240  		}
  2241  		return nil, gensupport.WrapError(&googleapi.Error{
  2242  			Code:   res.StatusCode,
  2243  			Header: res.Header,
  2244  		})
  2245  	}
  2246  	if err != nil {
  2247  		return nil, err
  2248  	}
  2249  	defer googleapi.CloseBody(res)
  2250  	if err := googleapi.CheckResponse(res); err != nil {
  2251  		return nil, gensupport.WrapError(err)
  2252  	}
  2253  	ret := &OrgPolicy{
  2254  		ServerResponse: googleapi.ServerResponse{
  2255  			Header:         res.Header,
  2256  			HTTPStatusCode: res.StatusCode,
  2257  		},
  2258  	}
  2259  	target := &ret
  2260  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2261  		return nil, err
  2262  	}
  2263  	return ret, nil
  2264  }
  2265  
  2266  type FoldersGetOrgPolicyCall struct {
  2267  	s                   *Service
  2268  	resource            string
  2269  	getorgpolicyrequest *GetOrgPolicyRequest
  2270  	urlParams_          gensupport.URLParams
  2271  	ctx_                context.Context
  2272  	header_             http.Header
  2273  }
  2274  
  2275  // GetOrgPolicy: Gets a `Policy` on a resource. If no `Policy` is set on the
  2276  // resource, a `Policy` is returned with default values including
  2277  // `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can be
  2278  // used with `SetOrgPolicy()` to create or update a `Policy` during
  2279  // read-modify-write.
  2280  //
  2281  // - resource: Name of the resource the `Policy` is set on.
  2282  func (r *FoldersService) GetOrgPolicy(resource string, getorgpolicyrequest *GetOrgPolicyRequest) *FoldersGetOrgPolicyCall {
  2283  	c := &FoldersGetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2284  	c.resource = resource
  2285  	c.getorgpolicyrequest = getorgpolicyrequest
  2286  	return c
  2287  }
  2288  
  2289  // Fields allows partial responses to be retrieved. See
  2290  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2291  // details.
  2292  func (c *FoldersGetOrgPolicyCall) Fields(s ...googleapi.Field) *FoldersGetOrgPolicyCall {
  2293  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2294  	return c
  2295  }
  2296  
  2297  // Context sets the context to be used in this call's Do method.
  2298  func (c *FoldersGetOrgPolicyCall) Context(ctx context.Context) *FoldersGetOrgPolicyCall {
  2299  	c.ctx_ = ctx
  2300  	return c
  2301  }
  2302  
  2303  // Header returns a http.Header that can be modified by the caller to add
  2304  // headers to the request.
  2305  func (c *FoldersGetOrgPolicyCall) Header() http.Header {
  2306  	if c.header_ == nil {
  2307  		c.header_ = make(http.Header)
  2308  	}
  2309  	return c.header_
  2310  }
  2311  
  2312  func (c *FoldersGetOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
  2313  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2314  	var body io.Reader = nil
  2315  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.getorgpolicyrequest)
  2316  	if err != nil {
  2317  		return nil, err
  2318  	}
  2319  	c.urlParams_.Set("alt", alt)
  2320  	c.urlParams_.Set("prettyPrint", "false")
  2321  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getOrgPolicy")
  2322  	urls += "?" + c.urlParams_.Encode()
  2323  	req, err := http.NewRequest("POST", urls, body)
  2324  	if err != nil {
  2325  		return nil, err
  2326  	}
  2327  	req.Header = reqHeaders
  2328  	googleapi.Expand(req.URL, map[string]string{
  2329  		"resource": c.resource,
  2330  	})
  2331  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2332  }
  2333  
  2334  // Do executes the "cloudresourcemanager.folders.getOrgPolicy" call.
  2335  // Any non-2xx status code is an error. Response headers are in either
  2336  // *OrgPolicy.ServerResponse.Header or (if a response was returned at all) in
  2337  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2338  // whether the returned error was because http.StatusNotModified was returned.
  2339  func (c *FoldersGetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
  2340  	gensupport.SetOptions(c.urlParams_, opts...)
  2341  	res, err := c.doRequest("json")
  2342  	if res != nil && res.StatusCode == http.StatusNotModified {
  2343  		if res.Body != nil {
  2344  			res.Body.Close()
  2345  		}
  2346  		return nil, gensupport.WrapError(&googleapi.Error{
  2347  			Code:   res.StatusCode,
  2348  			Header: res.Header,
  2349  		})
  2350  	}
  2351  	if err != nil {
  2352  		return nil, err
  2353  	}
  2354  	defer googleapi.CloseBody(res)
  2355  	if err := googleapi.CheckResponse(res); err != nil {
  2356  		return nil, gensupport.WrapError(err)
  2357  	}
  2358  	ret := &OrgPolicy{
  2359  		ServerResponse: googleapi.ServerResponse{
  2360  			Header:         res.Header,
  2361  			HTTPStatusCode: res.StatusCode,
  2362  		},
  2363  	}
  2364  	target := &ret
  2365  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2366  		return nil, err
  2367  	}
  2368  	return ret, nil
  2369  }
  2370  
  2371  type FoldersListAvailableOrgPolicyConstraintsCall struct {
  2372  	s                                        *Service
  2373  	resource                                 string
  2374  	listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest
  2375  	urlParams_                               gensupport.URLParams
  2376  	ctx_                                     context.Context
  2377  	header_                                  http.Header
  2378  }
  2379  
  2380  // ListAvailableOrgPolicyConstraints: Lists `Constraints` that could be applied
  2381  // on the specified resource.
  2382  //
  2383  // - resource: Name of the resource to list `Constraints` for.
  2384  func (r *FoldersService) ListAvailableOrgPolicyConstraints(resource string, listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest) *FoldersListAvailableOrgPolicyConstraintsCall {
  2385  	c := &FoldersListAvailableOrgPolicyConstraintsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2386  	c.resource = resource
  2387  	c.listavailableorgpolicyconstraintsrequest = listavailableorgpolicyconstraintsrequest
  2388  	return c
  2389  }
  2390  
  2391  // Fields allows partial responses to be retrieved. See
  2392  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2393  // details.
  2394  func (c *FoldersListAvailableOrgPolicyConstraintsCall) Fields(s ...googleapi.Field) *FoldersListAvailableOrgPolicyConstraintsCall {
  2395  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2396  	return c
  2397  }
  2398  
  2399  // Context sets the context to be used in this call's Do method.
  2400  func (c *FoldersListAvailableOrgPolicyConstraintsCall) Context(ctx context.Context) *FoldersListAvailableOrgPolicyConstraintsCall {
  2401  	c.ctx_ = ctx
  2402  	return c
  2403  }
  2404  
  2405  // Header returns a http.Header that can be modified by the caller to add
  2406  // headers to the request.
  2407  func (c *FoldersListAvailableOrgPolicyConstraintsCall) Header() http.Header {
  2408  	if c.header_ == nil {
  2409  		c.header_ = make(http.Header)
  2410  	}
  2411  	return c.header_
  2412  }
  2413  
  2414  func (c *FoldersListAvailableOrgPolicyConstraintsCall) doRequest(alt string) (*http.Response, error) {
  2415  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2416  	var body io.Reader = nil
  2417  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.listavailableorgpolicyconstraintsrequest)
  2418  	if err != nil {
  2419  		return nil, err
  2420  	}
  2421  	c.urlParams_.Set("alt", alt)
  2422  	c.urlParams_.Set("prettyPrint", "false")
  2423  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listAvailableOrgPolicyConstraints")
  2424  	urls += "?" + c.urlParams_.Encode()
  2425  	req, err := http.NewRequest("POST", urls, body)
  2426  	if err != nil {
  2427  		return nil, err
  2428  	}
  2429  	req.Header = reqHeaders
  2430  	googleapi.Expand(req.URL, map[string]string{
  2431  		"resource": c.resource,
  2432  	})
  2433  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2434  }
  2435  
  2436  // Do executes the "cloudresourcemanager.folders.listAvailableOrgPolicyConstraints" call.
  2437  // Any non-2xx status code is an error. Response headers are in either
  2438  // *ListAvailableOrgPolicyConstraintsResponse.ServerResponse.Header or (if a
  2439  // response was returned at all) in error.(*googleapi.Error).Header. Use
  2440  // googleapi.IsNotModified to check whether the returned error was because
  2441  // http.StatusNotModified was returned.
  2442  func (c *FoldersListAvailableOrgPolicyConstraintsCall) Do(opts ...googleapi.CallOption) (*ListAvailableOrgPolicyConstraintsResponse, error) {
  2443  	gensupport.SetOptions(c.urlParams_, opts...)
  2444  	res, err := c.doRequest("json")
  2445  	if res != nil && res.StatusCode == http.StatusNotModified {
  2446  		if res.Body != nil {
  2447  			res.Body.Close()
  2448  		}
  2449  		return nil, gensupport.WrapError(&googleapi.Error{
  2450  			Code:   res.StatusCode,
  2451  			Header: res.Header,
  2452  		})
  2453  	}
  2454  	if err != nil {
  2455  		return nil, err
  2456  	}
  2457  	defer googleapi.CloseBody(res)
  2458  	if err := googleapi.CheckResponse(res); err != nil {
  2459  		return nil, gensupport.WrapError(err)
  2460  	}
  2461  	ret := &ListAvailableOrgPolicyConstraintsResponse{
  2462  		ServerResponse: googleapi.ServerResponse{
  2463  			Header:         res.Header,
  2464  			HTTPStatusCode: res.StatusCode,
  2465  		},
  2466  	}
  2467  	target := &ret
  2468  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2469  		return nil, err
  2470  	}
  2471  	return ret, nil
  2472  }
  2473  
  2474  // Pages invokes f for each page of results.
  2475  // A non-nil error returned from f will halt the iteration.
  2476  // The provided context supersedes any context provided to the Context method.
  2477  func (c *FoldersListAvailableOrgPolicyConstraintsCall) Pages(ctx context.Context, f func(*ListAvailableOrgPolicyConstraintsResponse) error) error {
  2478  	c.ctx_ = ctx
  2479  	defer func(pt string) { c.listavailableorgpolicyconstraintsrequest.PageToken = pt }(c.listavailableorgpolicyconstraintsrequest.PageToken)
  2480  	for {
  2481  		x, err := c.Do()
  2482  		if err != nil {
  2483  			return err
  2484  		}
  2485  		if err := f(x); err != nil {
  2486  			return err
  2487  		}
  2488  		if x.NextPageToken == "" {
  2489  			return nil
  2490  		}
  2491  		c.listavailableorgpolicyconstraintsrequest.PageToken = x.NextPageToken
  2492  	}
  2493  }
  2494  
  2495  type FoldersListOrgPoliciesCall struct {
  2496  	s                      *Service
  2497  	resource               string
  2498  	listorgpoliciesrequest *ListOrgPoliciesRequest
  2499  	urlParams_             gensupport.URLParams
  2500  	ctx_                   context.Context
  2501  	header_                http.Header
  2502  }
  2503  
  2504  // ListOrgPolicies: Lists all the `Policies` set for a particular resource.
  2505  //
  2506  // - resource: Name of the resource to list Policies for.
  2507  func (r *FoldersService) ListOrgPolicies(resource string, listorgpoliciesrequest *ListOrgPoliciesRequest) *FoldersListOrgPoliciesCall {
  2508  	c := &FoldersListOrgPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2509  	c.resource = resource
  2510  	c.listorgpoliciesrequest = listorgpoliciesrequest
  2511  	return c
  2512  }
  2513  
  2514  // Fields allows partial responses to be retrieved. See
  2515  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2516  // details.
  2517  func (c *FoldersListOrgPoliciesCall) Fields(s ...googleapi.Field) *FoldersListOrgPoliciesCall {
  2518  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2519  	return c
  2520  }
  2521  
  2522  // Context sets the context to be used in this call's Do method.
  2523  func (c *FoldersListOrgPoliciesCall) Context(ctx context.Context) *FoldersListOrgPoliciesCall {
  2524  	c.ctx_ = ctx
  2525  	return c
  2526  }
  2527  
  2528  // Header returns a http.Header that can be modified by the caller to add
  2529  // headers to the request.
  2530  func (c *FoldersListOrgPoliciesCall) Header() http.Header {
  2531  	if c.header_ == nil {
  2532  		c.header_ = make(http.Header)
  2533  	}
  2534  	return c.header_
  2535  }
  2536  
  2537  func (c *FoldersListOrgPoliciesCall) doRequest(alt string) (*http.Response, error) {
  2538  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2539  	var body io.Reader = nil
  2540  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.listorgpoliciesrequest)
  2541  	if err != nil {
  2542  		return nil, err
  2543  	}
  2544  	c.urlParams_.Set("alt", alt)
  2545  	c.urlParams_.Set("prettyPrint", "false")
  2546  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listOrgPolicies")
  2547  	urls += "?" + c.urlParams_.Encode()
  2548  	req, err := http.NewRequest("POST", urls, body)
  2549  	if err != nil {
  2550  		return nil, err
  2551  	}
  2552  	req.Header = reqHeaders
  2553  	googleapi.Expand(req.URL, map[string]string{
  2554  		"resource": c.resource,
  2555  	})
  2556  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2557  }
  2558  
  2559  // Do executes the "cloudresourcemanager.folders.listOrgPolicies" call.
  2560  // Any non-2xx status code is an error. Response headers are in either
  2561  // *ListOrgPoliciesResponse.ServerResponse.Header or (if a response was
  2562  // returned at all) in error.(*googleapi.Error).Header. Use
  2563  // googleapi.IsNotModified to check whether the returned error was because
  2564  // http.StatusNotModified was returned.
  2565  func (c *FoldersListOrgPoliciesCall) Do(opts ...googleapi.CallOption) (*ListOrgPoliciesResponse, error) {
  2566  	gensupport.SetOptions(c.urlParams_, opts...)
  2567  	res, err := c.doRequest("json")
  2568  	if res != nil && res.StatusCode == http.StatusNotModified {
  2569  		if res.Body != nil {
  2570  			res.Body.Close()
  2571  		}
  2572  		return nil, gensupport.WrapError(&googleapi.Error{
  2573  			Code:   res.StatusCode,
  2574  			Header: res.Header,
  2575  		})
  2576  	}
  2577  	if err != nil {
  2578  		return nil, err
  2579  	}
  2580  	defer googleapi.CloseBody(res)
  2581  	if err := googleapi.CheckResponse(res); err != nil {
  2582  		return nil, gensupport.WrapError(err)
  2583  	}
  2584  	ret := &ListOrgPoliciesResponse{
  2585  		ServerResponse: googleapi.ServerResponse{
  2586  			Header:         res.Header,
  2587  			HTTPStatusCode: res.StatusCode,
  2588  		},
  2589  	}
  2590  	target := &ret
  2591  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2592  		return nil, err
  2593  	}
  2594  	return ret, nil
  2595  }
  2596  
  2597  // Pages invokes f for each page of results.
  2598  // A non-nil error returned from f will halt the iteration.
  2599  // The provided context supersedes any context provided to the Context method.
  2600  func (c *FoldersListOrgPoliciesCall) Pages(ctx context.Context, f func(*ListOrgPoliciesResponse) error) error {
  2601  	c.ctx_ = ctx
  2602  	defer func(pt string) { c.listorgpoliciesrequest.PageToken = pt }(c.listorgpoliciesrequest.PageToken)
  2603  	for {
  2604  		x, err := c.Do()
  2605  		if err != nil {
  2606  			return err
  2607  		}
  2608  		if err := f(x); err != nil {
  2609  			return err
  2610  		}
  2611  		if x.NextPageToken == "" {
  2612  			return nil
  2613  		}
  2614  		c.listorgpoliciesrequest.PageToken = x.NextPageToken
  2615  	}
  2616  }
  2617  
  2618  type FoldersSetOrgPolicyCall struct {
  2619  	s                   *Service
  2620  	resource            string
  2621  	setorgpolicyrequest *SetOrgPolicyRequest
  2622  	urlParams_          gensupport.URLParams
  2623  	ctx_                context.Context
  2624  	header_             http.Header
  2625  }
  2626  
  2627  // SetOrgPolicy: Updates the specified `Policy` on the resource. Creates a new
  2628  // `Policy` for that `Constraint` on the resource if one does not exist. Not
  2629  // supplying an `etag` on the request `Policy` results in an unconditional
  2630  // write of the `Policy`.
  2631  //
  2632  // - resource: Resource name of the resource to attach the `Policy`.
  2633  func (r *FoldersService) SetOrgPolicy(resource string, setorgpolicyrequest *SetOrgPolicyRequest) *FoldersSetOrgPolicyCall {
  2634  	c := &FoldersSetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2635  	c.resource = resource
  2636  	c.setorgpolicyrequest = setorgpolicyrequest
  2637  	return c
  2638  }
  2639  
  2640  // Fields allows partial responses to be retrieved. See
  2641  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2642  // details.
  2643  func (c *FoldersSetOrgPolicyCall) Fields(s ...googleapi.Field) *FoldersSetOrgPolicyCall {
  2644  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2645  	return c
  2646  }
  2647  
  2648  // Context sets the context to be used in this call's Do method.
  2649  func (c *FoldersSetOrgPolicyCall) Context(ctx context.Context) *FoldersSetOrgPolicyCall {
  2650  	c.ctx_ = ctx
  2651  	return c
  2652  }
  2653  
  2654  // Header returns a http.Header that can be modified by the caller to add
  2655  // headers to the request.
  2656  func (c *FoldersSetOrgPolicyCall) Header() http.Header {
  2657  	if c.header_ == nil {
  2658  		c.header_ = make(http.Header)
  2659  	}
  2660  	return c.header_
  2661  }
  2662  
  2663  func (c *FoldersSetOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
  2664  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2665  	var body io.Reader = nil
  2666  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setorgpolicyrequest)
  2667  	if err != nil {
  2668  		return nil, err
  2669  	}
  2670  	c.urlParams_.Set("alt", alt)
  2671  	c.urlParams_.Set("prettyPrint", "false")
  2672  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setOrgPolicy")
  2673  	urls += "?" + c.urlParams_.Encode()
  2674  	req, err := http.NewRequest("POST", urls, body)
  2675  	if err != nil {
  2676  		return nil, err
  2677  	}
  2678  	req.Header = reqHeaders
  2679  	googleapi.Expand(req.URL, map[string]string{
  2680  		"resource": c.resource,
  2681  	})
  2682  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2683  }
  2684  
  2685  // Do executes the "cloudresourcemanager.folders.setOrgPolicy" call.
  2686  // Any non-2xx status code is an error. Response headers are in either
  2687  // *OrgPolicy.ServerResponse.Header or (if a response was returned at all) in
  2688  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2689  // whether the returned error was because http.StatusNotModified was returned.
  2690  func (c *FoldersSetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
  2691  	gensupport.SetOptions(c.urlParams_, opts...)
  2692  	res, err := c.doRequest("json")
  2693  	if res != nil && res.StatusCode == http.StatusNotModified {
  2694  		if res.Body != nil {
  2695  			res.Body.Close()
  2696  		}
  2697  		return nil, gensupport.WrapError(&googleapi.Error{
  2698  			Code:   res.StatusCode,
  2699  			Header: res.Header,
  2700  		})
  2701  	}
  2702  	if err != nil {
  2703  		return nil, err
  2704  	}
  2705  	defer googleapi.CloseBody(res)
  2706  	if err := googleapi.CheckResponse(res); err != nil {
  2707  		return nil, gensupport.WrapError(err)
  2708  	}
  2709  	ret := &OrgPolicy{
  2710  		ServerResponse: googleapi.ServerResponse{
  2711  			Header:         res.Header,
  2712  			HTTPStatusCode: res.StatusCode,
  2713  		},
  2714  	}
  2715  	target := &ret
  2716  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2717  		return nil, err
  2718  	}
  2719  	return ret, nil
  2720  }
  2721  
  2722  type LiensCreateCall struct {
  2723  	s          *Service
  2724  	lien       *Lien
  2725  	urlParams_ gensupport.URLParams
  2726  	ctx_       context.Context
  2727  	header_    http.Header
  2728  }
  2729  
  2730  // Create: Create a Lien which applies to the resource denoted by the `parent`
  2731  // field. Callers of this method will require permission on the `parent`
  2732  // resource. For example, applying to `projects/1234` requires permission
  2733  // `resourcemanager.projects.updateLiens`. NOTE: Some resources may limit the
  2734  // number of Liens which may be applied.
  2735  func (r *LiensService) Create(lien *Lien) *LiensCreateCall {
  2736  	c := &LiensCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2737  	c.lien = lien
  2738  	return c
  2739  }
  2740  
  2741  // Fields allows partial responses to be retrieved. See
  2742  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2743  // details.
  2744  func (c *LiensCreateCall) Fields(s ...googleapi.Field) *LiensCreateCall {
  2745  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2746  	return c
  2747  }
  2748  
  2749  // Context sets the context to be used in this call's Do method.
  2750  func (c *LiensCreateCall) Context(ctx context.Context) *LiensCreateCall {
  2751  	c.ctx_ = ctx
  2752  	return c
  2753  }
  2754  
  2755  // Header returns a http.Header that can be modified by the caller to add
  2756  // headers to the request.
  2757  func (c *LiensCreateCall) Header() http.Header {
  2758  	if c.header_ == nil {
  2759  		c.header_ = make(http.Header)
  2760  	}
  2761  	return c.header_
  2762  }
  2763  
  2764  func (c *LiensCreateCall) doRequest(alt string) (*http.Response, error) {
  2765  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2766  	var body io.Reader = nil
  2767  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.lien)
  2768  	if err != nil {
  2769  		return nil, err
  2770  	}
  2771  	c.urlParams_.Set("alt", alt)
  2772  	c.urlParams_.Set("prettyPrint", "false")
  2773  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/liens")
  2774  	urls += "?" + c.urlParams_.Encode()
  2775  	req, err := http.NewRequest("POST", urls, body)
  2776  	if err != nil {
  2777  		return nil, err
  2778  	}
  2779  	req.Header = reqHeaders
  2780  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2781  }
  2782  
  2783  // Do executes the "cloudresourcemanager.liens.create" call.
  2784  // Any non-2xx status code is an error. Response headers are in either
  2785  // *Lien.ServerResponse.Header or (if a response was returned at all) in
  2786  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2787  // whether the returned error was because http.StatusNotModified was returned.
  2788  func (c *LiensCreateCall) Do(opts ...googleapi.CallOption) (*Lien, error) {
  2789  	gensupport.SetOptions(c.urlParams_, opts...)
  2790  	res, err := c.doRequest("json")
  2791  	if res != nil && res.StatusCode == http.StatusNotModified {
  2792  		if res.Body != nil {
  2793  			res.Body.Close()
  2794  		}
  2795  		return nil, gensupport.WrapError(&googleapi.Error{
  2796  			Code:   res.StatusCode,
  2797  			Header: res.Header,
  2798  		})
  2799  	}
  2800  	if err != nil {
  2801  		return nil, err
  2802  	}
  2803  	defer googleapi.CloseBody(res)
  2804  	if err := googleapi.CheckResponse(res); err != nil {
  2805  		return nil, gensupport.WrapError(err)
  2806  	}
  2807  	ret := &Lien{
  2808  		ServerResponse: googleapi.ServerResponse{
  2809  			Header:         res.Header,
  2810  			HTTPStatusCode: res.StatusCode,
  2811  		},
  2812  	}
  2813  	target := &ret
  2814  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2815  		return nil, err
  2816  	}
  2817  	return ret, nil
  2818  }
  2819  
  2820  type LiensDeleteCall struct {
  2821  	s          *Service
  2822  	nameid     string
  2823  	urlParams_ gensupport.URLParams
  2824  	ctx_       context.Context
  2825  	header_    http.Header
  2826  }
  2827  
  2828  // Delete: Delete a Lien by `name`. Callers of this method will require
  2829  // permission on the `parent` resource. For example, a Lien with a `parent` of
  2830  // `projects/1234` requires permission `resourcemanager.projects.updateLiens`.
  2831  //
  2832  // - name: The name/identifier of the Lien to delete.
  2833  func (r *LiensService) Delete(nameid string) *LiensDeleteCall {
  2834  	c := &LiensDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2835  	c.nameid = nameid
  2836  	return c
  2837  }
  2838  
  2839  // Fields allows partial responses to be retrieved. See
  2840  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2841  // details.
  2842  func (c *LiensDeleteCall) Fields(s ...googleapi.Field) *LiensDeleteCall {
  2843  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2844  	return c
  2845  }
  2846  
  2847  // Context sets the context to be used in this call's Do method.
  2848  func (c *LiensDeleteCall) Context(ctx context.Context) *LiensDeleteCall {
  2849  	c.ctx_ = ctx
  2850  	return c
  2851  }
  2852  
  2853  // Header returns a http.Header that can be modified by the caller to add
  2854  // headers to the request.
  2855  func (c *LiensDeleteCall) Header() http.Header {
  2856  	if c.header_ == nil {
  2857  		c.header_ = make(http.Header)
  2858  	}
  2859  	return c.header_
  2860  }
  2861  
  2862  func (c *LiensDeleteCall) doRequest(alt string) (*http.Response, error) {
  2863  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2864  	var body io.Reader = nil
  2865  	c.urlParams_.Set("alt", alt)
  2866  	c.urlParams_.Set("prettyPrint", "false")
  2867  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2868  	urls += "?" + c.urlParams_.Encode()
  2869  	req, err := http.NewRequest("DELETE", urls, body)
  2870  	if err != nil {
  2871  		return nil, err
  2872  	}
  2873  	req.Header = reqHeaders
  2874  	googleapi.Expand(req.URL, map[string]string{
  2875  		"name": c.nameid,
  2876  	})
  2877  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2878  }
  2879  
  2880  // Do executes the "cloudresourcemanager.liens.delete" call.
  2881  // Any non-2xx status code is an error. Response headers are in either
  2882  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2883  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2884  // whether the returned error was because http.StatusNotModified was returned.
  2885  func (c *LiensDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2886  	gensupport.SetOptions(c.urlParams_, opts...)
  2887  	res, err := c.doRequest("json")
  2888  	if res != nil && res.StatusCode == http.StatusNotModified {
  2889  		if res.Body != nil {
  2890  			res.Body.Close()
  2891  		}
  2892  		return nil, gensupport.WrapError(&googleapi.Error{
  2893  			Code:   res.StatusCode,
  2894  			Header: res.Header,
  2895  		})
  2896  	}
  2897  	if err != nil {
  2898  		return nil, err
  2899  	}
  2900  	defer googleapi.CloseBody(res)
  2901  	if err := googleapi.CheckResponse(res); err != nil {
  2902  		return nil, gensupport.WrapError(err)
  2903  	}
  2904  	ret := &Empty{
  2905  		ServerResponse: googleapi.ServerResponse{
  2906  			Header:         res.Header,
  2907  			HTTPStatusCode: res.StatusCode,
  2908  		},
  2909  	}
  2910  	target := &ret
  2911  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2912  		return nil, err
  2913  	}
  2914  	return ret, nil
  2915  }
  2916  
  2917  type LiensGetCall struct {
  2918  	s            *Service
  2919  	nameid       string
  2920  	urlParams_   gensupport.URLParams
  2921  	ifNoneMatch_ string
  2922  	ctx_         context.Context
  2923  	header_      http.Header
  2924  }
  2925  
  2926  // Get: Retrieve a Lien by `name`. Callers of this method will require
  2927  // permission on the `parent` resource. For example, a Lien with a `parent` of
  2928  // `projects/1234` requires permission `resourcemanager.projects.get`
  2929  //
  2930  // - name: The name/identifier of the Lien.
  2931  func (r *LiensService) Get(nameid string) *LiensGetCall {
  2932  	c := &LiensGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2933  	c.nameid = nameid
  2934  	return c
  2935  }
  2936  
  2937  // Fields allows partial responses to be retrieved. See
  2938  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2939  // details.
  2940  func (c *LiensGetCall) Fields(s ...googleapi.Field) *LiensGetCall {
  2941  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2942  	return c
  2943  }
  2944  
  2945  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2946  // object's ETag matches the given value. This is useful for getting updates
  2947  // only after the object has changed since the last request.
  2948  func (c *LiensGetCall) IfNoneMatch(entityTag string) *LiensGetCall {
  2949  	c.ifNoneMatch_ = entityTag
  2950  	return c
  2951  }
  2952  
  2953  // Context sets the context to be used in this call's Do method.
  2954  func (c *LiensGetCall) Context(ctx context.Context) *LiensGetCall {
  2955  	c.ctx_ = ctx
  2956  	return c
  2957  }
  2958  
  2959  // Header returns a http.Header that can be modified by the caller to add
  2960  // headers to the request.
  2961  func (c *LiensGetCall) Header() http.Header {
  2962  	if c.header_ == nil {
  2963  		c.header_ = make(http.Header)
  2964  	}
  2965  	return c.header_
  2966  }
  2967  
  2968  func (c *LiensGetCall) doRequest(alt string) (*http.Response, error) {
  2969  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2970  	if c.ifNoneMatch_ != "" {
  2971  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2972  	}
  2973  	var body io.Reader = nil
  2974  	c.urlParams_.Set("alt", alt)
  2975  	c.urlParams_.Set("prettyPrint", "false")
  2976  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2977  	urls += "?" + c.urlParams_.Encode()
  2978  	req, err := http.NewRequest("GET", urls, body)
  2979  	if err != nil {
  2980  		return nil, err
  2981  	}
  2982  	req.Header = reqHeaders
  2983  	googleapi.Expand(req.URL, map[string]string{
  2984  		"name": c.nameid,
  2985  	})
  2986  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2987  }
  2988  
  2989  // Do executes the "cloudresourcemanager.liens.get" call.
  2990  // Any non-2xx status code is an error. Response headers are in either
  2991  // *Lien.ServerResponse.Header or (if a response was returned at all) in
  2992  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2993  // whether the returned error was because http.StatusNotModified was returned.
  2994  func (c *LiensGetCall) Do(opts ...googleapi.CallOption) (*Lien, error) {
  2995  	gensupport.SetOptions(c.urlParams_, opts...)
  2996  	res, err := c.doRequest("json")
  2997  	if res != nil && res.StatusCode == http.StatusNotModified {
  2998  		if res.Body != nil {
  2999  			res.Body.Close()
  3000  		}
  3001  		return nil, gensupport.WrapError(&googleapi.Error{
  3002  			Code:   res.StatusCode,
  3003  			Header: res.Header,
  3004  		})
  3005  	}
  3006  	if err != nil {
  3007  		return nil, err
  3008  	}
  3009  	defer googleapi.CloseBody(res)
  3010  	if err := googleapi.CheckResponse(res); err != nil {
  3011  		return nil, gensupport.WrapError(err)
  3012  	}
  3013  	ret := &Lien{
  3014  		ServerResponse: googleapi.ServerResponse{
  3015  			Header:         res.Header,
  3016  			HTTPStatusCode: res.StatusCode,
  3017  		},
  3018  	}
  3019  	target := &ret
  3020  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3021  		return nil, err
  3022  	}
  3023  	return ret, nil
  3024  }
  3025  
  3026  type LiensListCall struct {
  3027  	s            *Service
  3028  	urlParams_   gensupport.URLParams
  3029  	ifNoneMatch_ string
  3030  	ctx_         context.Context
  3031  	header_      http.Header
  3032  }
  3033  
  3034  // List: List all Liens applied to the `parent` resource. Callers of this
  3035  // method will require permission on the `parent` resource. For example, a Lien
  3036  // with a `parent` of `projects/1234` requires permission
  3037  // `resourcemanager.projects.get`.
  3038  func (r *LiensService) List() *LiensListCall {
  3039  	c := &LiensListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3040  	return c
  3041  }
  3042  
  3043  // PageSize sets the optional parameter "pageSize": The maximum number of items
  3044  // to return. This is a suggestion for the server. The server can return fewer
  3045  // liens than requested. If unspecified, server picks an appropriate default.
  3046  func (c *LiensListCall) PageSize(pageSize int64) *LiensListCall {
  3047  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3048  	return c
  3049  }
  3050  
  3051  // PageToken sets the optional parameter "pageToken": The `next_page_token`
  3052  // value returned from a previous List request, if any.
  3053  func (c *LiensListCall) PageToken(pageToken string) *LiensListCall {
  3054  	c.urlParams_.Set("pageToken", pageToken)
  3055  	return c
  3056  }
  3057  
  3058  // Parent sets the optional parameter "parent": Required. The name of the
  3059  // resource to list all attached Liens. For example, `projects/1234`.
  3060  // (google.api.field_policy).resource_type annotation is not set since the
  3061  // parent depends on the meta api implementation. This field could be a project
  3062  // or other sub project resources.
  3063  func (c *LiensListCall) Parent(parent string) *LiensListCall {
  3064  	c.urlParams_.Set("parent", parent)
  3065  	return c
  3066  }
  3067  
  3068  // Fields allows partial responses to be retrieved. See
  3069  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3070  // details.
  3071  func (c *LiensListCall) Fields(s ...googleapi.Field) *LiensListCall {
  3072  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3073  	return c
  3074  }
  3075  
  3076  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3077  // object's ETag matches the given value. This is useful for getting updates
  3078  // only after the object has changed since the last request.
  3079  func (c *LiensListCall) IfNoneMatch(entityTag string) *LiensListCall {
  3080  	c.ifNoneMatch_ = entityTag
  3081  	return c
  3082  }
  3083  
  3084  // Context sets the context to be used in this call's Do method.
  3085  func (c *LiensListCall) Context(ctx context.Context) *LiensListCall {
  3086  	c.ctx_ = ctx
  3087  	return c
  3088  }
  3089  
  3090  // Header returns a http.Header that can be modified by the caller to add
  3091  // headers to the request.
  3092  func (c *LiensListCall) Header() http.Header {
  3093  	if c.header_ == nil {
  3094  		c.header_ = make(http.Header)
  3095  	}
  3096  	return c.header_
  3097  }
  3098  
  3099  func (c *LiensListCall) doRequest(alt string) (*http.Response, error) {
  3100  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3101  	if c.ifNoneMatch_ != "" {
  3102  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3103  	}
  3104  	var body io.Reader = nil
  3105  	c.urlParams_.Set("alt", alt)
  3106  	c.urlParams_.Set("prettyPrint", "false")
  3107  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/liens")
  3108  	urls += "?" + c.urlParams_.Encode()
  3109  	req, err := http.NewRequest("GET", urls, body)
  3110  	if err != nil {
  3111  		return nil, err
  3112  	}
  3113  	req.Header = reqHeaders
  3114  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3115  }
  3116  
  3117  // Do executes the "cloudresourcemanager.liens.list" call.
  3118  // Any non-2xx status code is an error. Response headers are in either
  3119  // *ListLiensResponse.ServerResponse.Header or (if a response was returned at
  3120  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3121  // check whether the returned error was because http.StatusNotModified was
  3122  // returned.
  3123  func (c *LiensListCall) Do(opts ...googleapi.CallOption) (*ListLiensResponse, error) {
  3124  	gensupport.SetOptions(c.urlParams_, opts...)
  3125  	res, err := c.doRequest("json")
  3126  	if res != nil && res.StatusCode == http.StatusNotModified {
  3127  		if res.Body != nil {
  3128  			res.Body.Close()
  3129  		}
  3130  		return nil, gensupport.WrapError(&googleapi.Error{
  3131  			Code:   res.StatusCode,
  3132  			Header: res.Header,
  3133  		})
  3134  	}
  3135  	if err != nil {
  3136  		return nil, err
  3137  	}
  3138  	defer googleapi.CloseBody(res)
  3139  	if err := googleapi.CheckResponse(res); err != nil {
  3140  		return nil, gensupport.WrapError(err)
  3141  	}
  3142  	ret := &ListLiensResponse{
  3143  		ServerResponse: googleapi.ServerResponse{
  3144  			Header:         res.Header,
  3145  			HTTPStatusCode: res.StatusCode,
  3146  		},
  3147  	}
  3148  	target := &ret
  3149  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3150  		return nil, err
  3151  	}
  3152  	return ret, nil
  3153  }
  3154  
  3155  // Pages invokes f for each page of results.
  3156  // A non-nil error returned from f will halt the iteration.
  3157  // The provided context supersedes any context provided to the Context method.
  3158  func (c *LiensListCall) Pages(ctx context.Context, f func(*ListLiensResponse) error) error {
  3159  	c.ctx_ = ctx
  3160  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3161  	for {
  3162  		x, err := c.Do()
  3163  		if err != nil {
  3164  			return err
  3165  		}
  3166  		if err := f(x); err != nil {
  3167  			return err
  3168  		}
  3169  		if x.NextPageToken == "" {
  3170  			return nil
  3171  		}
  3172  		c.PageToken(x.NextPageToken)
  3173  	}
  3174  }
  3175  
  3176  type OperationsGetCall struct {
  3177  	s            *Service
  3178  	name         string
  3179  	urlParams_   gensupport.URLParams
  3180  	ifNoneMatch_ string
  3181  	ctx_         context.Context
  3182  	header_      http.Header
  3183  }
  3184  
  3185  // Get: Gets the latest state of a long-running operation. Clients can use this
  3186  // method to poll the operation result at intervals as recommended by the API
  3187  // service.
  3188  //
  3189  // - name: The name of the operation resource.
  3190  func (r *OperationsService) Get(name string) *OperationsGetCall {
  3191  	c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3192  	c.name = name
  3193  	return c
  3194  }
  3195  
  3196  // Fields allows partial responses to be retrieved. See
  3197  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3198  // details.
  3199  func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
  3200  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3201  	return c
  3202  }
  3203  
  3204  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3205  // object's ETag matches the given value. This is useful for getting updates
  3206  // only after the object has changed since the last request.
  3207  func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
  3208  	c.ifNoneMatch_ = entityTag
  3209  	return c
  3210  }
  3211  
  3212  // Context sets the context to be used in this call's Do method.
  3213  func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
  3214  	c.ctx_ = ctx
  3215  	return c
  3216  }
  3217  
  3218  // Header returns a http.Header that can be modified by the caller to add
  3219  // headers to the request.
  3220  func (c *OperationsGetCall) Header() http.Header {
  3221  	if c.header_ == nil {
  3222  		c.header_ = make(http.Header)
  3223  	}
  3224  	return c.header_
  3225  }
  3226  
  3227  func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
  3228  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3229  	if c.ifNoneMatch_ != "" {
  3230  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3231  	}
  3232  	var body io.Reader = nil
  3233  	c.urlParams_.Set("alt", alt)
  3234  	c.urlParams_.Set("prettyPrint", "false")
  3235  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3236  	urls += "?" + c.urlParams_.Encode()
  3237  	req, err := http.NewRequest("GET", urls, body)
  3238  	if err != nil {
  3239  		return nil, err
  3240  	}
  3241  	req.Header = reqHeaders
  3242  	googleapi.Expand(req.URL, map[string]string{
  3243  		"name": c.name,
  3244  	})
  3245  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3246  }
  3247  
  3248  // Do executes the "cloudresourcemanager.operations.get" call.
  3249  // Any non-2xx status code is an error. Response headers are in either
  3250  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3251  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3252  // whether the returned error was because http.StatusNotModified was returned.
  3253  func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3254  	gensupport.SetOptions(c.urlParams_, opts...)
  3255  	res, err := c.doRequest("json")
  3256  	if res != nil && res.StatusCode == http.StatusNotModified {
  3257  		if res.Body != nil {
  3258  			res.Body.Close()
  3259  		}
  3260  		return nil, gensupport.WrapError(&googleapi.Error{
  3261  			Code:   res.StatusCode,
  3262  			Header: res.Header,
  3263  		})
  3264  	}
  3265  	if err != nil {
  3266  		return nil, err
  3267  	}
  3268  	defer googleapi.CloseBody(res)
  3269  	if err := googleapi.CheckResponse(res); err != nil {
  3270  		return nil, gensupport.WrapError(err)
  3271  	}
  3272  	ret := &Operation{
  3273  		ServerResponse: googleapi.ServerResponse{
  3274  			Header:         res.Header,
  3275  			HTTPStatusCode: res.StatusCode,
  3276  		},
  3277  	}
  3278  	target := &ret
  3279  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3280  		return nil, err
  3281  	}
  3282  	return ret, nil
  3283  }
  3284  
  3285  type OrganizationsClearOrgPolicyCall struct {
  3286  	s                     *Service
  3287  	resource              string
  3288  	clearorgpolicyrequest *ClearOrgPolicyRequest
  3289  	urlParams_            gensupport.URLParams
  3290  	ctx_                  context.Context
  3291  	header_               http.Header
  3292  }
  3293  
  3294  // ClearOrgPolicy: Clears a `Policy` from a resource.
  3295  //
  3296  // - resource: Name of the resource for the `Policy` to clear.
  3297  func (r *OrganizationsService) ClearOrgPolicy(resource string, clearorgpolicyrequest *ClearOrgPolicyRequest) *OrganizationsClearOrgPolicyCall {
  3298  	c := &OrganizationsClearOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3299  	c.resource = resource
  3300  	c.clearorgpolicyrequest = clearorgpolicyrequest
  3301  	return c
  3302  }
  3303  
  3304  // Fields allows partial responses to be retrieved. See
  3305  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3306  // details.
  3307  func (c *OrganizationsClearOrgPolicyCall) Fields(s ...googleapi.Field) *OrganizationsClearOrgPolicyCall {
  3308  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3309  	return c
  3310  }
  3311  
  3312  // Context sets the context to be used in this call's Do method.
  3313  func (c *OrganizationsClearOrgPolicyCall) Context(ctx context.Context) *OrganizationsClearOrgPolicyCall {
  3314  	c.ctx_ = ctx
  3315  	return c
  3316  }
  3317  
  3318  // Header returns a http.Header that can be modified by the caller to add
  3319  // headers to the request.
  3320  func (c *OrganizationsClearOrgPolicyCall) Header() http.Header {
  3321  	if c.header_ == nil {
  3322  		c.header_ = make(http.Header)
  3323  	}
  3324  	return c.header_
  3325  }
  3326  
  3327  func (c *OrganizationsClearOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
  3328  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3329  	var body io.Reader = nil
  3330  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.clearorgpolicyrequest)
  3331  	if err != nil {
  3332  		return nil, err
  3333  	}
  3334  	c.urlParams_.Set("alt", alt)
  3335  	c.urlParams_.Set("prettyPrint", "false")
  3336  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:clearOrgPolicy")
  3337  	urls += "?" + c.urlParams_.Encode()
  3338  	req, err := http.NewRequest("POST", urls, body)
  3339  	if err != nil {
  3340  		return nil, err
  3341  	}
  3342  	req.Header = reqHeaders
  3343  	googleapi.Expand(req.URL, map[string]string{
  3344  		"resource": c.resource,
  3345  	})
  3346  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3347  }
  3348  
  3349  // Do executes the "cloudresourcemanager.organizations.clearOrgPolicy" call.
  3350  // Any non-2xx status code is an error. Response headers are in either
  3351  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  3352  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3353  // whether the returned error was because http.StatusNotModified was returned.
  3354  func (c *OrganizationsClearOrgPolicyCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3355  	gensupport.SetOptions(c.urlParams_, opts...)
  3356  	res, err := c.doRequest("json")
  3357  	if res != nil && res.StatusCode == http.StatusNotModified {
  3358  		if res.Body != nil {
  3359  			res.Body.Close()
  3360  		}
  3361  		return nil, gensupport.WrapError(&googleapi.Error{
  3362  			Code:   res.StatusCode,
  3363  			Header: res.Header,
  3364  		})
  3365  	}
  3366  	if err != nil {
  3367  		return nil, err
  3368  	}
  3369  	defer googleapi.CloseBody(res)
  3370  	if err := googleapi.CheckResponse(res); err != nil {
  3371  		return nil, gensupport.WrapError(err)
  3372  	}
  3373  	ret := &Empty{
  3374  		ServerResponse: googleapi.ServerResponse{
  3375  			Header:         res.Header,
  3376  			HTTPStatusCode: res.StatusCode,
  3377  		},
  3378  	}
  3379  	target := &ret
  3380  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3381  		return nil, err
  3382  	}
  3383  	return ret, nil
  3384  }
  3385  
  3386  type OrganizationsGetCall struct {
  3387  	s            *Service
  3388  	name         string
  3389  	urlParams_   gensupport.URLParams
  3390  	ifNoneMatch_ string
  3391  	ctx_         context.Context
  3392  	header_      http.Header
  3393  }
  3394  
  3395  // Get: Fetches an Organization resource identified by the specified resource
  3396  // name.
  3397  //
  3398  //   - name: The resource name of the Organization to fetch. This is the
  3399  //     organization's relative path in the API, formatted as
  3400  //     "organizations/[organizationId]". For example, "organizations/1234".
  3401  func (r *OrganizationsService) Get(name string) *OrganizationsGetCall {
  3402  	c := &OrganizationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3403  	c.name = name
  3404  	return c
  3405  }
  3406  
  3407  // Fields allows partial responses to be retrieved. See
  3408  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3409  // details.
  3410  func (c *OrganizationsGetCall) Fields(s ...googleapi.Field) *OrganizationsGetCall {
  3411  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3412  	return c
  3413  }
  3414  
  3415  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3416  // object's ETag matches the given value. This is useful for getting updates
  3417  // only after the object has changed since the last request.
  3418  func (c *OrganizationsGetCall) IfNoneMatch(entityTag string) *OrganizationsGetCall {
  3419  	c.ifNoneMatch_ = entityTag
  3420  	return c
  3421  }
  3422  
  3423  // Context sets the context to be used in this call's Do method.
  3424  func (c *OrganizationsGetCall) Context(ctx context.Context) *OrganizationsGetCall {
  3425  	c.ctx_ = ctx
  3426  	return c
  3427  }
  3428  
  3429  // Header returns a http.Header that can be modified by the caller to add
  3430  // headers to the request.
  3431  func (c *OrganizationsGetCall) Header() http.Header {
  3432  	if c.header_ == nil {
  3433  		c.header_ = make(http.Header)
  3434  	}
  3435  	return c.header_
  3436  }
  3437  
  3438  func (c *OrganizationsGetCall) doRequest(alt string) (*http.Response, error) {
  3439  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3440  	if c.ifNoneMatch_ != "" {
  3441  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3442  	}
  3443  	var body io.Reader = nil
  3444  	c.urlParams_.Set("alt", alt)
  3445  	c.urlParams_.Set("prettyPrint", "false")
  3446  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3447  	urls += "?" + c.urlParams_.Encode()
  3448  	req, err := http.NewRequest("GET", urls, body)
  3449  	if err != nil {
  3450  		return nil, err
  3451  	}
  3452  	req.Header = reqHeaders
  3453  	googleapi.Expand(req.URL, map[string]string{
  3454  		"name": c.name,
  3455  	})
  3456  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3457  }
  3458  
  3459  // Do executes the "cloudresourcemanager.organizations.get" call.
  3460  // Any non-2xx status code is an error. Response headers are in either
  3461  // *Organization.ServerResponse.Header or (if a response was returned at all)
  3462  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3463  // whether the returned error was because http.StatusNotModified was returned.
  3464  func (c *OrganizationsGetCall) Do(opts ...googleapi.CallOption) (*Organization, error) {
  3465  	gensupport.SetOptions(c.urlParams_, opts...)
  3466  	res, err := c.doRequest("json")
  3467  	if res != nil && res.StatusCode == http.StatusNotModified {
  3468  		if res.Body != nil {
  3469  			res.Body.Close()
  3470  		}
  3471  		return nil, gensupport.WrapError(&googleapi.Error{
  3472  			Code:   res.StatusCode,
  3473  			Header: res.Header,
  3474  		})
  3475  	}
  3476  	if err != nil {
  3477  		return nil, err
  3478  	}
  3479  	defer googleapi.CloseBody(res)
  3480  	if err := googleapi.CheckResponse(res); err != nil {
  3481  		return nil, gensupport.WrapError(err)
  3482  	}
  3483  	ret := &Organization{
  3484  		ServerResponse: googleapi.ServerResponse{
  3485  			Header:         res.Header,
  3486  			HTTPStatusCode: res.StatusCode,
  3487  		},
  3488  	}
  3489  	target := &ret
  3490  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3491  		return nil, err
  3492  	}
  3493  	return ret, nil
  3494  }
  3495  
  3496  type OrganizationsGetEffectiveOrgPolicyCall struct {
  3497  	s                            *Service
  3498  	resource                     string
  3499  	geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest
  3500  	urlParams_                   gensupport.URLParams
  3501  	ctx_                         context.Context
  3502  	header_                      http.Header
  3503  }
  3504  
  3505  // GetEffectiveOrgPolicy: Gets the effective `Policy` on a resource. This is
  3506  // the result of merging `Policies` in the resource hierarchy. The returned
  3507  // `Policy` will not have an `etag`set because it is a computed `Policy` across
  3508  // multiple resources. Subtrees of Resource Manager resource hierarchy with
  3509  // 'under:' prefix will not be expanded.
  3510  //
  3511  //   - resource: The name of the resource to start computing the effective
  3512  //     `Policy`.
  3513  func (r *OrganizationsService) GetEffectiveOrgPolicy(resource string, geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest) *OrganizationsGetEffectiveOrgPolicyCall {
  3514  	c := &OrganizationsGetEffectiveOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3515  	c.resource = resource
  3516  	c.geteffectiveorgpolicyrequest = geteffectiveorgpolicyrequest
  3517  	return c
  3518  }
  3519  
  3520  // Fields allows partial responses to be retrieved. See
  3521  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3522  // details.
  3523  func (c *OrganizationsGetEffectiveOrgPolicyCall) Fields(s ...googleapi.Field) *OrganizationsGetEffectiveOrgPolicyCall {
  3524  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3525  	return c
  3526  }
  3527  
  3528  // Context sets the context to be used in this call's Do method.
  3529  func (c *OrganizationsGetEffectiveOrgPolicyCall) Context(ctx context.Context) *OrganizationsGetEffectiveOrgPolicyCall {
  3530  	c.ctx_ = ctx
  3531  	return c
  3532  }
  3533  
  3534  // Header returns a http.Header that can be modified by the caller to add
  3535  // headers to the request.
  3536  func (c *OrganizationsGetEffectiveOrgPolicyCall) Header() http.Header {
  3537  	if c.header_ == nil {
  3538  		c.header_ = make(http.Header)
  3539  	}
  3540  	return c.header_
  3541  }
  3542  
  3543  func (c *OrganizationsGetEffectiveOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
  3544  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3545  	var body io.Reader = nil
  3546  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.geteffectiveorgpolicyrequest)
  3547  	if err != nil {
  3548  		return nil, err
  3549  	}
  3550  	c.urlParams_.Set("alt", alt)
  3551  	c.urlParams_.Set("prettyPrint", "false")
  3552  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getEffectiveOrgPolicy")
  3553  	urls += "?" + c.urlParams_.Encode()
  3554  	req, err := http.NewRequest("POST", urls, body)
  3555  	if err != nil {
  3556  		return nil, err
  3557  	}
  3558  	req.Header = reqHeaders
  3559  	googleapi.Expand(req.URL, map[string]string{
  3560  		"resource": c.resource,
  3561  	})
  3562  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3563  }
  3564  
  3565  // Do executes the "cloudresourcemanager.organizations.getEffectiveOrgPolicy" call.
  3566  // Any non-2xx status code is an error. Response headers are in either
  3567  // *OrgPolicy.ServerResponse.Header or (if a response was returned at all) in
  3568  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3569  // whether the returned error was because http.StatusNotModified was returned.
  3570  func (c *OrganizationsGetEffectiveOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
  3571  	gensupport.SetOptions(c.urlParams_, opts...)
  3572  	res, err := c.doRequest("json")
  3573  	if res != nil && res.StatusCode == http.StatusNotModified {
  3574  		if res.Body != nil {
  3575  			res.Body.Close()
  3576  		}
  3577  		return nil, gensupport.WrapError(&googleapi.Error{
  3578  			Code:   res.StatusCode,
  3579  			Header: res.Header,
  3580  		})
  3581  	}
  3582  	if err != nil {
  3583  		return nil, err
  3584  	}
  3585  	defer googleapi.CloseBody(res)
  3586  	if err := googleapi.CheckResponse(res); err != nil {
  3587  		return nil, gensupport.WrapError(err)
  3588  	}
  3589  	ret := &OrgPolicy{
  3590  		ServerResponse: googleapi.ServerResponse{
  3591  			Header:         res.Header,
  3592  			HTTPStatusCode: res.StatusCode,
  3593  		},
  3594  	}
  3595  	target := &ret
  3596  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3597  		return nil, err
  3598  	}
  3599  	return ret, nil
  3600  }
  3601  
  3602  type OrganizationsGetIamPolicyCall struct {
  3603  	s                   *Service
  3604  	resource            string
  3605  	getiampolicyrequest *GetIamPolicyRequest
  3606  	urlParams_          gensupport.URLParams
  3607  	ctx_                context.Context
  3608  	header_             http.Header
  3609  }
  3610  
  3611  // GetIamPolicy: Gets the access control policy for an Organization resource.
  3612  // May be empty if no such policy or resource exists. The `resource` field
  3613  // should be the organization's resource name, e.g. "organizations/123".
  3614  // Authorization requires the Google IAM permission
  3615  // `resourcemanager.organizations.getIamPolicy` on the specified organization
  3616  //
  3617  //   - resource: REQUIRED: The resource for which the policy is being requested.
  3618  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  3619  //     for the appropriate value for this field.
  3620  func (r *OrganizationsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *OrganizationsGetIamPolicyCall {
  3621  	c := &OrganizationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3622  	c.resource = resource
  3623  	c.getiampolicyrequest = getiampolicyrequest
  3624  	return c
  3625  }
  3626  
  3627  // Fields allows partial responses to be retrieved. See
  3628  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3629  // details.
  3630  func (c *OrganizationsGetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsGetIamPolicyCall {
  3631  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3632  	return c
  3633  }
  3634  
  3635  // Context sets the context to be used in this call's Do method.
  3636  func (c *OrganizationsGetIamPolicyCall) Context(ctx context.Context) *OrganizationsGetIamPolicyCall {
  3637  	c.ctx_ = ctx
  3638  	return c
  3639  }
  3640  
  3641  // Header returns a http.Header that can be modified by the caller to add
  3642  // headers to the request.
  3643  func (c *OrganizationsGetIamPolicyCall) Header() http.Header {
  3644  	if c.header_ == nil {
  3645  		c.header_ = make(http.Header)
  3646  	}
  3647  	return c.header_
  3648  }
  3649  
  3650  func (c *OrganizationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3651  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3652  	var body io.Reader = nil
  3653  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
  3654  	if err != nil {
  3655  		return nil, err
  3656  	}
  3657  	c.urlParams_.Set("alt", alt)
  3658  	c.urlParams_.Set("prettyPrint", "false")
  3659  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  3660  	urls += "?" + c.urlParams_.Encode()
  3661  	req, err := http.NewRequest("POST", urls, body)
  3662  	if err != nil {
  3663  		return nil, err
  3664  	}
  3665  	req.Header = reqHeaders
  3666  	googleapi.Expand(req.URL, map[string]string{
  3667  		"resource": c.resource,
  3668  	})
  3669  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3670  }
  3671  
  3672  // Do executes the "cloudresourcemanager.organizations.getIamPolicy" call.
  3673  // Any non-2xx status code is an error. Response headers are in either
  3674  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  3675  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3676  // whether the returned error was because http.StatusNotModified was returned.
  3677  func (c *OrganizationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3678  	gensupport.SetOptions(c.urlParams_, opts...)
  3679  	res, err := c.doRequest("json")
  3680  	if res != nil && res.StatusCode == http.StatusNotModified {
  3681  		if res.Body != nil {
  3682  			res.Body.Close()
  3683  		}
  3684  		return nil, gensupport.WrapError(&googleapi.Error{
  3685  			Code:   res.StatusCode,
  3686  			Header: res.Header,
  3687  		})
  3688  	}
  3689  	if err != nil {
  3690  		return nil, err
  3691  	}
  3692  	defer googleapi.CloseBody(res)
  3693  	if err := googleapi.CheckResponse(res); err != nil {
  3694  		return nil, gensupport.WrapError(err)
  3695  	}
  3696  	ret := &Policy{
  3697  		ServerResponse: googleapi.ServerResponse{
  3698  			Header:         res.Header,
  3699  			HTTPStatusCode: res.StatusCode,
  3700  		},
  3701  	}
  3702  	target := &ret
  3703  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3704  		return nil, err
  3705  	}
  3706  	return ret, nil
  3707  }
  3708  
  3709  type OrganizationsGetOrgPolicyCall struct {
  3710  	s                   *Service
  3711  	resource            string
  3712  	getorgpolicyrequest *GetOrgPolicyRequest
  3713  	urlParams_          gensupport.URLParams
  3714  	ctx_                context.Context
  3715  	header_             http.Header
  3716  }
  3717  
  3718  // GetOrgPolicy: Gets a `Policy` on a resource. If no `Policy` is set on the
  3719  // resource, a `Policy` is returned with default values including
  3720  // `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can be
  3721  // used with `SetOrgPolicy()` to create or update a `Policy` during
  3722  // read-modify-write.
  3723  //
  3724  // - resource: Name of the resource the `Policy` is set on.
  3725  func (r *OrganizationsService) GetOrgPolicy(resource string, getorgpolicyrequest *GetOrgPolicyRequest) *OrganizationsGetOrgPolicyCall {
  3726  	c := &OrganizationsGetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3727  	c.resource = resource
  3728  	c.getorgpolicyrequest = getorgpolicyrequest
  3729  	return c
  3730  }
  3731  
  3732  // Fields allows partial responses to be retrieved. See
  3733  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3734  // details.
  3735  func (c *OrganizationsGetOrgPolicyCall) Fields(s ...googleapi.Field) *OrganizationsGetOrgPolicyCall {
  3736  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3737  	return c
  3738  }
  3739  
  3740  // Context sets the context to be used in this call's Do method.
  3741  func (c *OrganizationsGetOrgPolicyCall) Context(ctx context.Context) *OrganizationsGetOrgPolicyCall {
  3742  	c.ctx_ = ctx
  3743  	return c
  3744  }
  3745  
  3746  // Header returns a http.Header that can be modified by the caller to add
  3747  // headers to the request.
  3748  func (c *OrganizationsGetOrgPolicyCall) Header() http.Header {
  3749  	if c.header_ == nil {
  3750  		c.header_ = make(http.Header)
  3751  	}
  3752  	return c.header_
  3753  }
  3754  
  3755  func (c *OrganizationsGetOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
  3756  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3757  	var body io.Reader = nil
  3758  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.getorgpolicyrequest)
  3759  	if err != nil {
  3760  		return nil, err
  3761  	}
  3762  	c.urlParams_.Set("alt", alt)
  3763  	c.urlParams_.Set("prettyPrint", "false")
  3764  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getOrgPolicy")
  3765  	urls += "?" + c.urlParams_.Encode()
  3766  	req, err := http.NewRequest("POST", urls, body)
  3767  	if err != nil {
  3768  		return nil, err
  3769  	}
  3770  	req.Header = reqHeaders
  3771  	googleapi.Expand(req.URL, map[string]string{
  3772  		"resource": c.resource,
  3773  	})
  3774  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3775  }
  3776  
  3777  // Do executes the "cloudresourcemanager.organizations.getOrgPolicy" call.
  3778  // Any non-2xx status code is an error. Response headers are in either
  3779  // *OrgPolicy.ServerResponse.Header or (if a response was returned at all) in
  3780  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3781  // whether the returned error was because http.StatusNotModified was returned.
  3782  func (c *OrganizationsGetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
  3783  	gensupport.SetOptions(c.urlParams_, opts...)
  3784  	res, err := c.doRequest("json")
  3785  	if res != nil && res.StatusCode == http.StatusNotModified {
  3786  		if res.Body != nil {
  3787  			res.Body.Close()
  3788  		}
  3789  		return nil, gensupport.WrapError(&googleapi.Error{
  3790  			Code:   res.StatusCode,
  3791  			Header: res.Header,
  3792  		})
  3793  	}
  3794  	if err != nil {
  3795  		return nil, err
  3796  	}
  3797  	defer googleapi.CloseBody(res)
  3798  	if err := googleapi.CheckResponse(res); err != nil {
  3799  		return nil, gensupport.WrapError(err)
  3800  	}
  3801  	ret := &OrgPolicy{
  3802  		ServerResponse: googleapi.ServerResponse{
  3803  			Header:         res.Header,
  3804  			HTTPStatusCode: res.StatusCode,
  3805  		},
  3806  	}
  3807  	target := &ret
  3808  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3809  		return nil, err
  3810  	}
  3811  	return ret, nil
  3812  }
  3813  
  3814  type OrganizationsListAvailableOrgPolicyConstraintsCall struct {
  3815  	s                                        *Service
  3816  	resource                                 string
  3817  	listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest
  3818  	urlParams_                               gensupport.URLParams
  3819  	ctx_                                     context.Context
  3820  	header_                                  http.Header
  3821  }
  3822  
  3823  // ListAvailableOrgPolicyConstraints: Lists `Constraints` that could be applied
  3824  // on the specified resource.
  3825  //
  3826  // - resource: Name of the resource to list `Constraints` for.
  3827  func (r *OrganizationsService) ListAvailableOrgPolicyConstraints(resource string, listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest) *OrganizationsListAvailableOrgPolicyConstraintsCall {
  3828  	c := &OrganizationsListAvailableOrgPolicyConstraintsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3829  	c.resource = resource
  3830  	c.listavailableorgpolicyconstraintsrequest = listavailableorgpolicyconstraintsrequest
  3831  	return c
  3832  }
  3833  
  3834  // Fields allows partial responses to be retrieved. See
  3835  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3836  // details.
  3837  func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) Fields(s ...googleapi.Field) *OrganizationsListAvailableOrgPolicyConstraintsCall {
  3838  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3839  	return c
  3840  }
  3841  
  3842  // Context sets the context to be used in this call's Do method.
  3843  func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) Context(ctx context.Context) *OrganizationsListAvailableOrgPolicyConstraintsCall {
  3844  	c.ctx_ = ctx
  3845  	return c
  3846  }
  3847  
  3848  // Header returns a http.Header that can be modified by the caller to add
  3849  // headers to the request.
  3850  func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) Header() http.Header {
  3851  	if c.header_ == nil {
  3852  		c.header_ = make(http.Header)
  3853  	}
  3854  	return c.header_
  3855  }
  3856  
  3857  func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) doRequest(alt string) (*http.Response, error) {
  3858  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3859  	var body io.Reader = nil
  3860  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.listavailableorgpolicyconstraintsrequest)
  3861  	if err != nil {
  3862  		return nil, err
  3863  	}
  3864  	c.urlParams_.Set("alt", alt)
  3865  	c.urlParams_.Set("prettyPrint", "false")
  3866  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listAvailableOrgPolicyConstraints")
  3867  	urls += "?" + c.urlParams_.Encode()
  3868  	req, err := http.NewRequest("POST", urls, body)
  3869  	if err != nil {
  3870  		return nil, err
  3871  	}
  3872  	req.Header = reqHeaders
  3873  	googleapi.Expand(req.URL, map[string]string{
  3874  		"resource": c.resource,
  3875  	})
  3876  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3877  }
  3878  
  3879  // Do executes the "cloudresourcemanager.organizations.listAvailableOrgPolicyConstraints" call.
  3880  // Any non-2xx status code is an error. Response headers are in either
  3881  // *ListAvailableOrgPolicyConstraintsResponse.ServerResponse.Header or (if a
  3882  // response was returned at all) in error.(*googleapi.Error).Header. Use
  3883  // googleapi.IsNotModified to check whether the returned error was because
  3884  // http.StatusNotModified was returned.
  3885  func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) Do(opts ...googleapi.CallOption) (*ListAvailableOrgPolicyConstraintsResponse, error) {
  3886  	gensupport.SetOptions(c.urlParams_, opts...)
  3887  	res, err := c.doRequest("json")
  3888  	if res != nil && res.StatusCode == http.StatusNotModified {
  3889  		if res.Body != nil {
  3890  			res.Body.Close()
  3891  		}
  3892  		return nil, gensupport.WrapError(&googleapi.Error{
  3893  			Code:   res.StatusCode,
  3894  			Header: res.Header,
  3895  		})
  3896  	}
  3897  	if err != nil {
  3898  		return nil, err
  3899  	}
  3900  	defer googleapi.CloseBody(res)
  3901  	if err := googleapi.CheckResponse(res); err != nil {
  3902  		return nil, gensupport.WrapError(err)
  3903  	}
  3904  	ret := &ListAvailableOrgPolicyConstraintsResponse{
  3905  		ServerResponse: googleapi.ServerResponse{
  3906  			Header:         res.Header,
  3907  			HTTPStatusCode: res.StatusCode,
  3908  		},
  3909  	}
  3910  	target := &ret
  3911  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3912  		return nil, err
  3913  	}
  3914  	return ret, nil
  3915  }
  3916  
  3917  // Pages invokes f for each page of results.
  3918  // A non-nil error returned from f will halt the iteration.
  3919  // The provided context supersedes any context provided to the Context method.
  3920  func (c *OrganizationsListAvailableOrgPolicyConstraintsCall) Pages(ctx context.Context, f func(*ListAvailableOrgPolicyConstraintsResponse) error) error {
  3921  	c.ctx_ = ctx
  3922  	defer func(pt string) { c.listavailableorgpolicyconstraintsrequest.PageToken = pt }(c.listavailableorgpolicyconstraintsrequest.PageToken)
  3923  	for {
  3924  		x, err := c.Do()
  3925  		if err != nil {
  3926  			return err
  3927  		}
  3928  		if err := f(x); err != nil {
  3929  			return err
  3930  		}
  3931  		if x.NextPageToken == "" {
  3932  			return nil
  3933  		}
  3934  		c.listavailableorgpolicyconstraintsrequest.PageToken = x.NextPageToken
  3935  	}
  3936  }
  3937  
  3938  type OrganizationsListOrgPoliciesCall struct {
  3939  	s                      *Service
  3940  	resource               string
  3941  	listorgpoliciesrequest *ListOrgPoliciesRequest
  3942  	urlParams_             gensupport.URLParams
  3943  	ctx_                   context.Context
  3944  	header_                http.Header
  3945  }
  3946  
  3947  // ListOrgPolicies: Lists all the `Policies` set for a particular resource.
  3948  //
  3949  // - resource: Name of the resource to list Policies for.
  3950  func (r *OrganizationsService) ListOrgPolicies(resource string, listorgpoliciesrequest *ListOrgPoliciesRequest) *OrganizationsListOrgPoliciesCall {
  3951  	c := &OrganizationsListOrgPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3952  	c.resource = resource
  3953  	c.listorgpoliciesrequest = listorgpoliciesrequest
  3954  	return c
  3955  }
  3956  
  3957  // Fields allows partial responses to be retrieved. See
  3958  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3959  // details.
  3960  func (c *OrganizationsListOrgPoliciesCall) Fields(s ...googleapi.Field) *OrganizationsListOrgPoliciesCall {
  3961  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3962  	return c
  3963  }
  3964  
  3965  // Context sets the context to be used in this call's Do method.
  3966  func (c *OrganizationsListOrgPoliciesCall) Context(ctx context.Context) *OrganizationsListOrgPoliciesCall {
  3967  	c.ctx_ = ctx
  3968  	return c
  3969  }
  3970  
  3971  // Header returns a http.Header that can be modified by the caller to add
  3972  // headers to the request.
  3973  func (c *OrganizationsListOrgPoliciesCall) Header() http.Header {
  3974  	if c.header_ == nil {
  3975  		c.header_ = make(http.Header)
  3976  	}
  3977  	return c.header_
  3978  }
  3979  
  3980  func (c *OrganizationsListOrgPoliciesCall) doRequest(alt string) (*http.Response, error) {
  3981  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3982  	var body io.Reader = nil
  3983  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.listorgpoliciesrequest)
  3984  	if err != nil {
  3985  		return nil, err
  3986  	}
  3987  	c.urlParams_.Set("alt", alt)
  3988  	c.urlParams_.Set("prettyPrint", "false")
  3989  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listOrgPolicies")
  3990  	urls += "?" + c.urlParams_.Encode()
  3991  	req, err := http.NewRequest("POST", urls, body)
  3992  	if err != nil {
  3993  		return nil, err
  3994  	}
  3995  	req.Header = reqHeaders
  3996  	googleapi.Expand(req.URL, map[string]string{
  3997  		"resource": c.resource,
  3998  	})
  3999  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4000  }
  4001  
  4002  // Do executes the "cloudresourcemanager.organizations.listOrgPolicies" call.
  4003  // Any non-2xx status code is an error. Response headers are in either
  4004  // *ListOrgPoliciesResponse.ServerResponse.Header or (if a response was
  4005  // returned at all) in error.(*googleapi.Error).Header. Use
  4006  // googleapi.IsNotModified to check whether the returned error was because
  4007  // http.StatusNotModified was returned.
  4008  func (c *OrganizationsListOrgPoliciesCall) Do(opts ...googleapi.CallOption) (*ListOrgPoliciesResponse, error) {
  4009  	gensupport.SetOptions(c.urlParams_, opts...)
  4010  	res, err := c.doRequest("json")
  4011  	if res != nil && res.StatusCode == http.StatusNotModified {
  4012  		if res.Body != nil {
  4013  			res.Body.Close()
  4014  		}
  4015  		return nil, gensupport.WrapError(&googleapi.Error{
  4016  			Code:   res.StatusCode,
  4017  			Header: res.Header,
  4018  		})
  4019  	}
  4020  	if err != nil {
  4021  		return nil, err
  4022  	}
  4023  	defer googleapi.CloseBody(res)
  4024  	if err := googleapi.CheckResponse(res); err != nil {
  4025  		return nil, gensupport.WrapError(err)
  4026  	}
  4027  	ret := &ListOrgPoliciesResponse{
  4028  		ServerResponse: googleapi.ServerResponse{
  4029  			Header:         res.Header,
  4030  			HTTPStatusCode: res.StatusCode,
  4031  		},
  4032  	}
  4033  	target := &ret
  4034  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4035  		return nil, err
  4036  	}
  4037  	return ret, nil
  4038  }
  4039  
  4040  // Pages invokes f for each page of results.
  4041  // A non-nil error returned from f will halt the iteration.
  4042  // The provided context supersedes any context provided to the Context method.
  4043  func (c *OrganizationsListOrgPoliciesCall) Pages(ctx context.Context, f func(*ListOrgPoliciesResponse) error) error {
  4044  	c.ctx_ = ctx
  4045  	defer func(pt string) { c.listorgpoliciesrequest.PageToken = pt }(c.listorgpoliciesrequest.PageToken)
  4046  	for {
  4047  		x, err := c.Do()
  4048  		if err != nil {
  4049  			return err
  4050  		}
  4051  		if err := f(x); err != nil {
  4052  			return err
  4053  		}
  4054  		if x.NextPageToken == "" {
  4055  			return nil
  4056  		}
  4057  		c.listorgpoliciesrequest.PageToken = x.NextPageToken
  4058  	}
  4059  }
  4060  
  4061  type OrganizationsSearchCall struct {
  4062  	s                          *Service
  4063  	searchorganizationsrequest *SearchOrganizationsRequest
  4064  	urlParams_                 gensupport.URLParams
  4065  	ctx_                       context.Context
  4066  	header_                    http.Header
  4067  }
  4068  
  4069  // Search: Searches Organization resources that are visible to the user and
  4070  // satisfy the specified filter. This method returns Organizations in an
  4071  // unspecified order. New Organizations do not necessarily appear at the end of
  4072  // the results. Search will only return organizations on which the user has the
  4073  // permission `resourcemanager.organizations.get` or has super admin
  4074  // privileges.
  4075  func (r *OrganizationsService) Search(searchorganizationsrequest *SearchOrganizationsRequest) *OrganizationsSearchCall {
  4076  	c := &OrganizationsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4077  	c.searchorganizationsrequest = searchorganizationsrequest
  4078  	return c
  4079  }
  4080  
  4081  // Fields allows partial responses to be retrieved. See
  4082  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4083  // details.
  4084  func (c *OrganizationsSearchCall) Fields(s ...googleapi.Field) *OrganizationsSearchCall {
  4085  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4086  	return c
  4087  }
  4088  
  4089  // Context sets the context to be used in this call's Do method.
  4090  func (c *OrganizationsSearchCall) Context(ctx context.Context) *OrganizationsSearchCall {
  4091  	c.ctx_ = ctx
  4092  	return c
  4093  }
  4094  
  4095  // Header returns a http.Header that can be modified by the caller to add
  4096  // headers to the request.
  4097  func (c *OrganizationsSearchCall) Header() http.Header {
  4098  	if c.header_ == nil {
  4099  		c.header_ = make(http.Header)
  4100  	}
  4101  	return c.header_
  4102  }
  4103  
  4104  func (c *OrganizationsSearchCall) doRequest(alt string) (*http.Response, error) {
  4105  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4106  	var body io.Reader = nil
  4107  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchorganizationsrequest)
  4108  	if err != nil {
  4109  		return nil, err
  4110  	}
  4111  	c.urlParams_.Set("alt", alt)
  4112  	c.urlParams_.Set("prettyPrint", "false")
  4113  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/organizations:search")
  4114  	urls += "?" + c.urlParams_.Encode()
  4115  	req, err := http.NewRequest("POST", urls, body)
  4116  	if err != nil {
  4117  		return nil, err
  4118  	}
  4119  	req.Header = reqHeaders
  4120  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4121  }
  4122  
  4123  // Do executes the "cloudresourcemanager.organizations.search" call.
  4124  // Any non-2xx status code is an error. Response headers are in either
  4125  // *SearchOrganizationsResponse.ServerResponse.Header or (if a response was
  4126  // returned at all) in error.(*googleapi.Error).Header. Use
  4127  // googleapi.IsNotModified to check whether the returned error was because
  4128  // http.StatusNotModified was returned.
  4129  func (c *OrganizationsSearchCall) Do(opts ...googleapi.CallOption) (*SearchOrganizationsResponse, error) {
  4130  	gensupport.SetOptions(c.urlParams_, opts...)
  4131  	res, err := c.doRequest("json")
  4132  	if res != nil && res.StatusCode == http.StatusNotModified {
  4133  		if res.Body != nil {
  4134  			res.Body.Close()
  4135  		}
  4136  		return nil, gensupport.WrapError(&googleapi.Error{
  4137  			Code:   res.StatusCode,
  4138  			Header: res.Header,
  4139  		})
  4140  	}
  4141  	if err != nil {
  4142  		return nil, err
  4143  	}
  4144  	defer googleapi.CloseBody(res)
  4145  	if err := googleapi.CheckResponse(res); err != nil {
  4146  		return nil, gensupport.WrapError(err)
  4147  	}
  4148  	ret := &SearchOrganizationsResponse{
  4149  		ServerResponse: googleapi.ServerResponse{
  4150  			Header:         res.Header,
  4151  			HTTPStatusCode: res.StatusCode,
  4152  		},
  4153  	}
  4154  	target := &ret
  4155  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4156  		return nil, err
  4157  	}
  4158  	return ret, nil
  4159  }
  4160  
  4161  // Pages invokes f for each page of results.
  4162  // A non-nil error returned from f will halt the iteration.
  4163  // The provided context supersedes any context provided to the Context method.
  4164  func (c *OrganizationsSearchCall) Pages(ctx context.Context, f func(*SearchOrganizationsResponse) error) error {
  4165  	c.ctx_ = ctx
  4166  	defer func(pt string) { c.searchorganizationsrequest.PageToken = pt }(c.searchorganizationsrequest.PageToken)
  4167  	for {
  4168  		x, err := c.Do()
  4169  		if err != nil {
  4170  			return err
  4171  		}
  4172  		if err := f(x); err != nil {
  4173  			return err
  4174  		}
  4175  		if x.NextPageToken == "" {
  4176  			return nil
  4177  		}
  4178  		c.searchorganizationsrequest.PageToken = x.NextPageToken
  4179  	}
  4180  }
  4181  
  4182  type OrganizationsSetIamPolicyCall struct {
  4183  	s                   *Service
  4184  	resource            string
  4185  	setiampolicyrequest *SetIamPolicyRequest
  4186  	urlParams_          gensupport.URLParams
  4187  	ctx_                context.Context
  4188  	header_             http.Header
  4189  }
  4190  
  4191  // SetIamPolicy: Sets the access control policy on an Organization resource.
  4192  // Replaces any existing policy. The `resource` field should be the
  4193  // organization's resource name, e.g. "organizations/123". Authorization
  4194  // requires the Google IAM permission
  4195  // `resourcemanager.organizations.setIamPolicy` on the specified organization
  4196  //
  4197  //   - resource: REQUIRED: The resource for which the policy is being specified.
  4198  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  4199  //     for the appropriate value for this field.
  4200  func (r *OrganizationsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *OrganizationsSetIamPolicyCall {
  4201  	c := &OrganizationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4202  	c.resource = resource
  4203  	c.setiampolicyrequest = setiampolicyrequest
  4204  	return c
  4205  }
  4206  
  4207  // Fields allows partial responses to be retrieved. See
  4208  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4209  // details.
  4210  func (c *OrganizationsSetIamPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSetIamPolicyCall {
  4211  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4212  	return c
  4213  }
  4214  
  4215  // Context sets the context to be used in this call's Do method.
  4216  func (c *OrganizationsSetIamPolicyCall) Context(ctx context.Context) *OrganizationsSetIamPolicyCall {
  4217  	c.ctx_ = ctx
  4218  	return c
  4219  }
  4220  
  4221  // Header returns a http.Header that can be modified by the caller to add
  4222  // headers to the request.
  4223  func (c *OrganizationsSetIamPolicyCall) Header() http.Header {
  4224  	if c.header_ == nil {
  4225  		c.header_ = make(http.Header)
  4226  	}
  4227  	return c.header_
  4228  }
  4229  
  4230  func (c *OrganizationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  4231  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4232  	var body io.Reader = nil
  4233  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  4234  	if err != nil {
  4235  		return nil, err
  4236  	}
  4237  	c.urlParams_.Set("alt", alt)
  4238  	c.urlParams_.Set("prettyPrint", "false")
  4239  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  4240  	urls += "?" + c.urlParams_.Encode()
  4241  	req, err := http.NewRequest("POST", urls, body)
  4242  	if err != nil {
  4243  		return nil, err
  4244  	}
  4245  	req.Header = reqHeaders
  4246  	googleapi.Expand(req.URL, map[string]string{
  4247  		"resource": c.resource,
  4248  	})
  4249  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4250  }
  4251  
  4252  // Do executes the "cloudresourcemanager.organizations.setIamPolicy" call.
  4253  // Any non-2xx status code is an error. Response headers are in either
  4254  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  4255  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4256  // whether the returned error was because http.StatusNotModified was returned.
  4257  func (c *OrganizationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  4258  	gensupport.SetOptions(c.urlParams_, opts...)
  4259  	res, err := c.doRequest("json")
  4260  	if res != nil && res.StatusCode == http.StatusNotModified {
  4261  		if res.Body != nil {
  4262  			res.Body.Close()
  4263  		}
  4264  		return nil, gensupport.WrapError(&googleapi.Error{
  4265  			Code:   res.StatusCode,
  4266  			Header: res.Header,
  4267  		})
  4268  	}
  4269  	if err != nil {
  4270  		return nil, err
  4271  	}
  4272  	defer googleapi.CloseBody(res)
  4273  	if err := googleapi.CheckResponse(res); err != nil {
  4274  		return nil, gensupport.WrapError(err)
  4275  	}
  4276  	ret := &Policy{
  4277  		ServerResponse: googleapi.ServerResponse{
  4278  			Header:         res.Header,
  4279  			HTTPStatusCode: res.StatusCode,
  4280  		},
  4281  	}
  4282  	target := &ret
  4283  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4284  		return nil, err
  4285  	}
  4286  	return ret, nil
  4287  }
  4288  
  4289  type OrganizationsSetOrgPolicyCall struct {
  4290  	s                   *Service
  4291  	resource            string
  4292  	setorgpolicyrequest *SetOrgPolicyRequest
  4293  	urlParams_          gensupport.URLParams
  4294  	ctx_                context.Context
  4295  	header_             http.Header
  4296  }
  4297  
  4298  // SetOrgPolicy: Updates the specified `Policy` on the resource. Creates a new
  4299  // `Policy` for that `Constraint` on the resource if one does not exist. Not
  4300  // supplying an `etag` on the request `Policy` results in an unconditional
  4301  // write of the `Policy`.
  4302  //
  4303  // - resource: Resource name of the resource to attach the `Policy`.
  4304  func (r *OrganizationsService) SetOrgPolicy(resource string, setorgpolicyrequest *SetOrgPolicyRequest) *OrganizationsSetOrgPolicyCall {
  4305  	c := &OrganizationsSetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4306  	c.resource = resource
  4307  	c.setorgpolicyrequest = setorgpolicyrequest
  4308  	return c
  4309  }
  4310  
  4311  // Fields allows partial responses to be retrieved. See
  4312  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4313  // details.
  4314  func (c *OrganizationsSetOrgPolicyCall) Fields(s ...googleapi.Field) *OrganizationsSetOrgPolicyCall {
  4315  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4316  	return c
  4317  }
  4318  
  4319  // Context sets the context to be used in this call's Do method.
  4320  func (c *OrganizationsSetOrgPolicyCall) Context(ctx context.Context) *OrganizationsSetOrgPolicyCall {
  4321  	c.ctx_ = ctx
  4322  	return c
  4323  }
  4324  
  4325  // Header returns a http.Header that can be modified by the caller to add
  4326  // headers to the request.
  4327  func (c *OrganizationsSetOrgPolicyCall) Header() http.Header {
  4328  	if c.header_ == nil {
  4329  		c.header_ = make(http.Header)
  4330  	}
  4331  	return c.header_
  4332  }
  4333  
  4334  func (c *OrganizationsSetOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
  4335  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4336  	var body io.Reader = nil
  4337  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setorgpolicyrequest)
  4338  	if err != nil {
  4339  		return nil, err
  4340  	}
  4341  	c.urlParams_.Set("alt", alt)
  4342  	c.urlParams_.Set("prettyPrint", "false")
  4343  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setOrgPolicy")
  4344  	urls += "?" + c.urlParams_.Encode()
  4345  	req, err := http.NewRequest("POST", urls, body)
  4346  	if err != nil {
  4347  		return nil, err
  4348  	}
  4349  	req.Header = reqHeaders
  4350  	googleapi.Expand(req.URL, map[string]string{
  4351  		"resource": c.resource,
  4352  	})
  4353  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4354  }
  4355  
  4356  // Do executes the "cloudresourcemanager.organizations.setOrgPolicy" call.
  4357  // Any non-2xx status code is an error. Response headers are in either
  4358  // *OrgPolicy.ServerResponse.Header or (if a response was returned at all) in
  4359  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4360  // whether the returned error was because http.StatusNotModified was returned.
  4361  func (c *OrganizationsSetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
  4362  	gensupport.SetOptions(c.urlParams_, opts...)
  4363  	res, err := c.doRequest("json")
  4364  	if res != nil && res.StatusCode == http.StatusNotModified {
  4365  		if res.Body != nil {
  4366  			res.Body.Close()
  4367  		}
  4368  		return nil, gensupport.WrapError(&googleapi.Error{
  4369  			Code:   res.StatusCode,
  4370  			Header: res.Header,
  4371  		})
  4372  	}
  4373  	if err != nil {
  4374  		return nil, err
  4375  	}
  4376  	defer googleapi.CloseBody(res)
  4377  	if err := googleapi.CheckResponse(res); err != nil {
  4378  		return nil, gensupport.WrapError(err)
  4379  	}
  4380  	ret := &OrgPolicy{
  4381  		ServerResponse: googleapi.ServerResponse{
  4382  			Header:         res.Header,
  4383  			HTTPStatusCode: res.StatusCode,
  4384  		},
  4385  	}
  4386  	target := &ret
  4387  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4388  		return nil, err
  4389  	}
  4390  	return ret, nil
  4391  }
  4392  
  4393  type OrganizationsTestIamPermissionsCall struct {
  4394  	s                         *Service
  4395  	resource                  string
  4396  	testiampermissionsrequest *TestIamPermissionsRequest
  4397  	urlParams_                gensupport.URLParams
  4398  	ctx_                      context.Context
  4399  	header_                   http.Header
  4400  }
  4401  
  4402  // TestIamPermissions: Returns permissions that a caller has on the specified
  4403  // Organization. The `resource` field should be the organization's resource
  4404  // name, e.g. "organizations/123". There are no permissions required for making
  4405  // this API call.
  4406  //
  4407  //   - resource: REQUIRED: The resource for which the policy detail is being
  4408  //     requested. See Resource names
  4409  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  4410  //     value for this field.
  4411  func (r *OrganizationsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *OrganizationsTestIamPermissionsCall {
  4412  	c := &OrganizationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4413  	c.resource = resource
  4414  	c.testiampermissionsrequest = testiampermissionsrequest
  4415  	return c
  4416  }
  4417  
  4418  // Fields allows partial responses to be retrieved. See
  4419  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4420  // details.
  4421  func (c *OrganizationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *OrganizationsTestIamPermissionsCall {
  4422  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4423  	return c
  4424  }
  4425  
  4426  // Context sets the context to be used in this call's Do method.
  4427  func (c *OrganizationsTestIamPermissionsCall) Context(ctx context.Context) *OrganizationsTestIamPermissionsCall {
  4428  	c.ctx_ = ctx
  4429  	return c
  4430  }
  4431  
  4432  // Header returns a http.Header that can be modified by the caller to add
  4433  // headers to the request.
  4434  func (c *OrganizationsTestIamPermissionsCall) Header() http.Header {
  4435  	if c.header_ == nil {
  4436  		c.header_ = make(http.Header)
  4437  	}
  4438  	return c.header_
  4439  }
  4440  
  4441  func (c *OrganizationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  4442  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4443  	var body io.Reader = nil
  4444  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  4445  	if err != nil {
  4446  		return nil, err
  4447  	}
  4448  	c.urlParams_.Set("alt", alt)
  4449  	c.urlParams_.Set("prettyPrint", "false")
  4450  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  4451  	urls += "?" + c.urlParams_.Encode()
  4452  	req, err := http.NewRequest("POST", urls, body)
  4453  	if err != nil {
  4454  		return nil, err
  4455  	}
  4456  	req.Header = reqHeaders
  4457  	googleapi.Expand(req.URL, map[string]string{
  4458  		"resource": c.resource,
  4459  	})
  4460  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4461  }
  4462  
  4463  // Do executes the "cloudresourcemanager.organizations.testIamPermissions" call.
  4464  // Any non-2xx status code is an error. Response headers are in either
  4465  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  4466  // returned at all) in error.(*googleapi.Error).Header. Use
  4467  // googleapi.IsNotModified to check whether the returned error was because
  4468  // http.StatusNotModified was returned.
  4469  func (c *OrganizationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  4470  	gensupport.SetOptions(c.urlParams_, opts...)
  4471  	res, err := c.doRequest("json")
  4472  	if res != nil && res.StatusCode == http.StatusNotModified {
  4473  		if res.Body != nil {
  4474  			res.Body.Close()
  4475  		}
  4476  		return nil, gensupport.WrapError(&googleapi.Error{
  4477  			Code:   res.StatusCode,
  4478  			Header: res.Header,
  4479  		})
  4480  	}
  4481  	if err != nil {
  4482  		return nil, err
  4483  	}
  4484  	defer googleapi.CloseBody(res)
  4485  	if err := googleapi.CheckResponse(res); err != nil {
  4486  		return nil, gensupport.WrapError(err)
  4487  	}
  4488  	ret := &TestIamPermissionsResponse{
  4489  		ServerResponse: googleapi.ServerResponse{
  4490  			Header:         res.Header,
  4491  			HTTPStatusCode: res.StatusCode,
  4492  		},
  4493  	}
  4494  	target := &ret
  4495  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4496  		return nil, err
  4497  	}
  4498  	return ret, nil
  4499  }
  4500  
  4501  type ProjectsClearOrgPolicyCall struct {
  4502  	s                     *Service
  4503  	resource              string
  4504  	clearorgpolicyrequest *ClearOrgPolicyRequest
  4505  	urlParams_            gensupport.URLParams
  4506  	ctx_                  context.Context
  4507  	header_               http.Header
  4508  }
  4509  
  4510  // ClearOrgPolicy: Clears a `Policy` from a resource.
  4511  //
  4512  // - resource: Name of the resource for the `Policy` to clear.
  4513  func (r *ProjectsService) ClearOrgPolicy(resource string, clearorgpolicyrequest *ClearOrgPolicyRequest) *ProjectsClearOrgPolicyCall {
  4514  	c := &ProjectsClearOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4515  	c.resource = resource
  4516  	c.clearorgpolicyrequest = clearorgpolicyrequest
  4517  	return c
  4518  }
  4519  
  4520  // Fields allows partial responses to be retrieved. See
  4521  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4522  // details.
  4523  func (c *ProjectsClearOrgPolicyCall) Fields(s ...googleapi.Field) *ProjectsClearOrgPolicyCall {
  4524  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4525  	return c
  4526  }
  4527  
  4528  // Context sets the context to be used in this call's Do method.
  4529  func (c *ProjectsClearOrgPolicyCall) Context(ctx context.Context) *ProjectsClearOrgPolicyCall {
  4530  	c.ctx_ = ctx
  4531  	return c
  4532  }
  4533  
  4534  // Header returns a http.Header that can be modified by the caller to add
  4535  // headers to the request.
  4536  func (c *ProjectsClearOrgPolicyCall) Header() http.Header {
  4537  	if c.header_ == nil {
  4538  		c.header_ = make(http.Header)
  4539  	}
  4540  	return c.header_
  4541  }
  4542  
  4543  func (c *ProjectsClearOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
  4544  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4545  	var body io.Reader = nil
  4546  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.clearorgpolicyrequest)
  4547  	if err != nil {
  4548  		return nil, err
  4549  	}
  4550  	c.urlParams_.Set("alt", alt)
  4551  	c.urlParams_.Set("prettyPrint", "false")
  4552  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:clearOrgPolicy")
  4553  	urls += "?" + c.urlParams_.Encode()
  4554  	req, err := http.NewRequest("POST", urls, body)
  4555  	if err != nil {
  4556  		return nil, err
  4557  	}
  4558  	req.Header = reqHeaders
  4559  	googleapi.Expand(req.URL, map[string]string{
  4560  		"resource": c.resource,
  4561  	})
  4562  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4563  }
  4564  
  4565  // Do executes the "cloudresourcemanager.projects.clearOrgPolicy" call.
  4566  // Any non-2xx status code is an error. Response headers are in either
  4567  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  4568  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4569  // whether the returned error was because http.StatusNotModified was returned.
  4570  func (c *ProjectsClearOrgPolicyCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4571  	gensupport.SetOptions(c.urlParams_, opts...)
  4572  	res, err := c.doRequest("json")
  4573  	if res != nil && res.StatusCode == http.StatusNotModified {
  4574  		if res.Body != nil {
  4575  			res.Body.Close()
  4576  		}
  4577  		return nil, gensupport.WrapError(&googleapi.Error{
  4578  			Code:   res.StatusCode,
  4579  			Header: res.Header,
  4580  		})
  4581  	}
  4582  	if err != nil {
  4583  		return nil, err
  4584  	}
  4585  	defer googleapi.CloseBody(res)
  4586  	if err := googleapi.CheckResponse(res); err != nil {
  4587  		return nil, gensupport.WrapError(err)
  4588  	}
  4589  	ret := &Empty{
  4590  		ServerResponse: googleapi.ServerResponse{
  4591  			Header:         res.Header,
  4592  			HTTPStatusCode: res.StatusCode,
  4593  		},
  4594  	}
  4595  	target := &ret
  4596  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4597  		return nil, err
  4598  	}
  4599  	return ret, nil
  4600  }
  4601  
  4602  type ProjectsCreateCall struct {
  4603  	s          *Service
  4604  	project    *Project
  4605  	urlParams_ gensupport.URLParams
  4606  	ctx_       context.Context
  4607  	header_    http.Header
  4608  }
  4609  
  4610  // Create: Request that a new Project be created. The result is an Operation
  4611  // which can be used to track the creation process. This process usually takes
  4612  // a few seconds, but can sometimes take much longer. The tracking Operation is
  4613  // automatically deleted after a few hours, so there is no need to call
  4614  // DeleteOperation. Authorization requires the Google IAM permission
  4615  // `resourcemanager.projects.create` on the specified parent for the new
  4616  // project. The parent is identified by a specified ResourceId, which must
  4617  // include both an ID and a type, such as organization. This method does not
  4618  // associate the new project with a billing account. You can set or update the
  4619  // billing account associated with a project using the
  4620  // [`projects.updateBillingInfo`]
  4621  // (/billing/reference/rest/v1/projects/updateBillingInfo) method.
  4622  func (r *ProjectsService) Create(project *Project) *ProjectsCreateCall {
  4623  	c := &ProjectsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4624  	c.project = project
  4625  	return c
  4626  }
  4627  
  4628  // Fields allows partial responses to be retrieved. See
  4629  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4630  // details.
  4631  func (c *ProjectsCreateCall) Fields(s ...googleapi.Field) *ProjectsCreateCall {
  4632  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4633  	return c
  4634  }
  4635  
  4636  // Context sets the context to be used in this call's Do method.
  4637  func (c *ProjectsCreateCall) Context(ctx context.Context) *ProjectsCreateCall {
  4638  	c.ctx_ = ctx
  4639  	return c
  4640  }
  4641  
  4642  // Header returns a http.Header that can be modified by the caller to add
  4643  // headers to the request.
  4644  func (c *ProjectsCreateCall) Header() http.Header {
  4645  	if c.header_ == nil {
  4646  		c.header_ = make(http.Header)
  4647  	}
  4648  	return c.header_
  4649  }
  4650  
  4651  func (c *ProjectsCreateCall) doRequest(alt string) (*http.Response, error) {
  4652  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4653  	var body io.Reader = nil
  4654  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.project)
  4655  	if err != nil {
  4656  		return nil, err
  4657  	}
  4658  	c.urlParams_.Set("alt", alt)
  4659  	c.urlParams_.Set("prettyPrint", "false")
  4660  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects")
  4661  	urls += "?" + c.urlParams_.Encode()
  4662  	req, err := http.NewRequest("POST", urls, body)
  4663  	if err != nil {
  4664  		return nil, err
  4665  	}
  4666  	req.Header = reqHeaders
  4667  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4668  }
  4669  
  4670  // Do executes the "cloudresourcemanager.projects.create" call.
  4671  // Any non-2xx status code is an error. Response headers are in either
  4672  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  4673  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4674  // whether the returned error was because http.StatusNotModified was returned.
  4675  func (c *ProjectsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4676  	gensupport.SetOptions(c.urlParams_, opts...)
  4677  	res, err := c.doRequest("json")
  4678  	if res != nil && res.StatusCode == http.StatusNotModified {
  4679  		if res.Body != nil {
  4680  			res.Body.Close()
  4681  		}
  4682  		return nil, gensupport.WrapError(&googleapi.Error{
  4683  			Code:   res.StatusCode,
  4684  			Header: res.Header,
  4685  		})
  4686  	}
  4687  	if err != nil {
  4688  		return nil, err
  4689  	}
  4690  	defer googleapi.CloseBody(res)
  4691  	if err := googleapi.CheckResponse(res); err != nil {
  4692  		return nil, gensupport.WrapError(err)
  4693  	}
  4694  	ret := &Operation{
  4695  		ServerResponse: googleapi.ServerResponse{
  4696  			Header:         res.Header,
  4697  			HTTPStatusCode: res.StatusCode,
  4698  		},
  4699  	}
  4700  	target := &ret
  4701  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4702  		return nil, err
  4703  	}
  4704  	return ret, nil
  4705  }
  4706  
  4707  type ProjectsDeleteCall struct {
  4708  	s          *Service
  4709  	projectId  string
  4710  	urlParams_ gensupport.URLParams
  4711  	ctx_       context.Context
  4712  	header_    http.Header
  4713  }
  4714  
  4715  // Delete: Marks the Project identified by the specified `project_id` (for
  4716  // example, `my-project-123`) for deletion. This method will only affect the
  4717  // Project if it has a lifecycle state of ACTIVE. This method changes the
  4718  // Project's lifecycle state from ACTIVE to DELETE_REQUESTED. The deletion
  4719  // starts at an unspecified time, at which point the Project is no longer
  4720  // accessible. Until the deletion completes, you can check the lifecycle state
  4721  // checked by retrieving the Project with GetProject, and the Project remains
  4722  // visible to ListProjects. However, you cannot update the project. After the
  4723  // deletion completes, the Project is not retrievable by the GetProject and
  4724  // ListProjects methods. The caller must have delete permissions for this
  4725  // Project.
  4726  //
  4727  // - projectId: The Project ID (for example, `foo-bar-123`).
  4728  func (r *ProjectsService) Delete(projectId string) *ProjectsDeleteCall {
  4729  	c := &ProjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4730  	c.projectId = projectId
  4731  	return c
  4732  }
  4733  
  4734  // Fields allows partial responses to be retrieved. See
  4735  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4736  // details.
  4737  func (c *ProjectsDeleteCall) Fields(s ...googleapi.Field) *ProjectsDeleteCall {
  4738  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4739  	return c
  4740  }
  4741  
  4742  // Context sets the context to be used in this call's Do method.
  4743  func (c *ProjectsDeleteCall) Context(ctx context.Context) *ProjectsDeleteCall {
  4744  	c.ctx_ = ctx
  4745  	return c
  4746  }
  4747  
  4748  // Header returns a http.Header that can be modified by the caller to add
  4749  // headers to the request.
  4750  func (c *ProjectsDeleteCall) Header() http.Header {
  4751  	if c.header_ == nil {
  4752  		c.header_ = make(http.Header)
  4753  	}
  4754  	return c.header_
  4755  }
  4756  
  4757  func (c *ProjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4758  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4759  	var body io.Reader = nil
  4760  	c.urlParams_.Set("alt", alt)
  4761  	c.urlParams_.Set("prettyPrint", "false")
  4762  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}")
  4763  	urls += "?" + c.urlParams_.Encode()
  4764  	req, err := http.NewRequest("DELETE", urls, body)
  4765  	if err != nil {
  4766  		return nil, err
  4767  	}
  4768  	req.Header = reqHeaders
  4769  	googleapi.Expand(req.URL, map[string]string{
  4770  		"projectId": c.projectId,
  4771  	})
  4772  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4773  }
  4774  
  4775  // Do executes the "cloudresourcemanager.projects.delete" call.
  4776  // Any non-2xx status code is an error. Response headers are in either
  4777  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  4778  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4779  // whether the returned error was because http.StatusNotModified was returned.
  4780  func (c *ProjectsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4781  	gensupport.SetOptions(c.urlParams_, opts...)
  4782  	res, err := c.doRequest("json")
  4783  	if res != nil && res.StatusCode == http.StatusNotModified {
  4784  		if res.Body != nil {
  4785  			res.Body.Close()
  4786  		}
  4787  		return nil, gensupport.WrapError(&googleapi.Error{
  4788  			Code:   res.StatusCode,
  4789  			Header: res.Header,
  4790  		})
  4791  	}
  4792  	if err != nil {
  4793  		return nil, err
  4794  	}
  4795  	defer googleapi.CloseBody(res)
  4796  	if err := googleapi.CheckResponse(res); err != nil {
  4797  		return nil, gensupport.WrapError(err)
  4798  	}
  4799  	ret := &Empty{
  4800  		ServerResponse: googleapi.ServerResponse{
  4801  			Header:         res.Header,
  4802  			HTTPStatusCode: res.StatusCode,
  4803  		},
  4804  	}
  4805  	target := &ret
  4806  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4807  		return nil, err
  4808  	}
  4809  	return ret, nil
  4810  }
  4811  
  4812  type ProjectsGetCall struct {
  4813  	s            *Service
  4814  	projectId    string
  4815  	urlParams_   gensupport.URLParams
  4816  	ifNoneMatch_ string
  4817  	ctx_         context.Context
  4818  	header_      http.Header
  4819  }
  4820  
  4821  // Get: Retrieves the Project identified by the specified `project_id` (for
  4822  // example, `my-project-123`). The caller must have read permissions for this
  4823  // Project.
  4824  //
  4825  // - projectId: The Project ID (for example, `my-project-123`).
  4826  func (r *ProjectsService) Get(projectId string) *ProjectsGetCall {
  4827  	c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4828  	c.projectId = projectId
  4829  	return c
  4830  }
  4831  
  4832  // Fields allows partial responses to be retrieved. See
  4833  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4834  // details.
  4835  func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  4836  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4837  	return c
  4838  }
  4839  
  4840  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4841  // object's ETag matches the given value. This is useful for getting updates
  4842  // only after the object has changed since the last request.
  4843  func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  4844  	c.ifNoneMatch_ = entityTag
  4845  	return c
  4846  }
  4847  
  4848  // Context sets the context to be used in this call's Do method.
  4849  func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  4850  	c.ctx_ = ctx
  4851  	return c
  4852  }
  4853  
  4854  // Header returns a http.Header that can be modified by the caller to add
  4855  // headers to the request.
  4856  func (c *ProjectsGetCall) Header() http.Header {
  4857  	if c.header_ == nil {
  4858  		c.header_ = make(http.Header)
  4859  	}
  4860  	return c.header_
  4861  }
  4862  
  4863  func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  4864  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4865  	if c.ifNoneMatch_ != "" {
  4866  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4867  	}
  4868  	var body io.Reader = nil
  4869  	c.urlParams_.Set("alt", alt)
  4870  	c.urlParams_.Set("prettyPrint", "false")
  4871  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}")
  4872  	urls += "?" + c.urlParams_.Encode()
  4873  	req, err := http.NewRequest("GET", urls, body)
  4874  	if err != nil {
  4875  		return nil, err
  4876  	}
  4877  	req.Header = reqHeaders
  4878  	googleapi.Expand(req.URL, map[string]string{
  4879  		"projectId": c.projectId,
  4880  	})
  4881  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4882  }
  4883  
  4884  // Do executes the "cloudresourcemanager.projects.get" call.
  4885  // Any non-2xx status code is an error. Response headers are in either
  4886  // *Project.ServerResponse.Header or (if a response was returned at all) in
  4887  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4888  // whether the returned error was because http.StatusNotModified was returned.
  4889  func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  4890  	gensupport.SetOptions(c.urlParams_, opts...)
  4891  	res, err := c.doRequest("json")
  4892  	if res != nil && res.StatusCode == http.StatusNotModified {
  4893  		if res.Body != nil {
  4894  			res.Body.Close()
  4895  		}
  4896  		return nil, gensupport.WrapError(&googleapi.Error{
  4897  			Code:   res.StatusCode,
  4898  			Header: res.Header,
  4899  		})
  4900  	}
  4901  	if err != nil {
  4902  		return nil, err
  4903  	}
  4904  	defer googleapi.CloseBody(res)
  4905  	if err := googleapi.CheckResponse(res); err != nil {
  4906  		return nil, gensupport.WrapError(err)
  4907  	}
  4908  	ret := &Project{
  4909  		ServerResponse: googleapi.ServerResponse{
  4910  			Header:         res.Header,
  4911  			HTTPStatusCode: res.StatusCode,
  4912  		},
  4913  	}
  4914  	target := &ret
  4915  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4916  		return nil, err
  4917  	}
  4918  	return ret, nil
  4919  }
  4920  
  4921  type ProjectsGetAncestryCall struct {
  4922  	s                  *Service
  4923  	projectId          string
  4924  	getancestryrequest *GetAncestryRequest
  4925  	urlParams_         gensupport.URLParams
  4926  	ctx_               context.Context
  4927  	header_            http.Header
  4928  }
  4929  
  4930  // GetAncestry: Gets a list of ancestors in the resource hierarchy for the
  4931  // Project identified by the specified `project_id` (for example,
  4932  // `my-project-123`). The caller must have read permissions for this Project.
  4933  //
  4934  // - projectId: The Project ID (for example, `my-project-123`).
  4935  func (r *ProjectsService) GetAncestry(projectId string, getancestryrequest *GetAncestryRequest) *ProjectsGetAncestryCall {
  4936  	c := &ProjectsGetAncestryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4937  	c.projectId = projectId
  4938  	c.getancestryrequest = getancestryrequest
  4939  	return c
  4940  }
  4941  
  4942  // Fields allows partial responses to be retrieved. See
  4943  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4944  // details.
  4945  func (c *ProjectsGetAncestryCall) Fields(s ...googleapi.Field) *ProjectsGetAncestryCall {
  4946  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4947  	return c
  4948  }
  4949  
  4950  // Context sets the context to be used in this call's Do method.
  4951  func (c *ProjectsGetAncestryCall) Context(ctx context.Context) *ProjectsGetAncestryCall {
  4952  	c.ctx_ = ctx
  4953  	return c
  4954  }
  4955  
  4956  // Header returns a http.Header that can be modified by the caller to add
  4957  // headers to the request.
  4958  func (c *ProjectsGetAncestryCall) Header() http.Header {
  4959  	if c.header_ == nil {
  4960  		c.header_ = make(http.Header)
  4961  	}
  4962  	return c.header_
  4963  }
  4964  
  4965  func (c *ProjectsGetAncestryCall) doRequest(alt string) (*http.Response, error) {
  4966  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4967  	var body io.Reader = nil
  4968  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.getancestryrequest)
  4969  	if err != nil {
  4970  		return nil, err
  4971  	}
  4972  	c.urlParams_.Set("alt", alt)
  4973  	c.urlParams_.Set("prettyPrint", "false")
  4974  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}:getAncestry")
  4975  	urls += "?" + c.urlParams_.Encode()
  4976  	req, err := http.NewRequest("POST", urls, body)
  4977  	if err != nil {
  4978  		return nil, err
  4979  	}
  4980  	req.Header = reqHeaders
  4981  	googleapi.Expand(req.URL, map[string]string{
  4982  		"projectId": c.projectId,
  4983  	})
  4984  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4985  }
  4986  
  4987  // Do executes the "cloudresourcemanager.projects.getAncestry" call.
  4988  // Any non-2xx status code is an error. Response headers are in either
  4989  // *GetAncestryResponse.ServerResponse.Header or (if a response was returned at
  4990  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4991  // check whether the returned error was because http.StatusNotModified was
  4992  // returned.
  4993  func (c *ProjectsGetAncestryCall) Do(opts ...googleapi.CallOption) (*GetAncestryResponse, error) {
  4994  	gensupport.SetOptions(c.urlParams_, opts...)
  4995  	res, err := c.doRequest("json")
  4996  	if res != nil && res.StatusCode == http.StatusNotModified {
  4997  		if res.Body != nil {
  4998  			res.Body.Close()
  4999  		}
  5000  		return nil, gensupport.WrapError(&googleapi.Error{
  5001  			Code:   res.StatusCode,
  5002  			Header: res.Header,
  5003  		})
  5004  	}
  5005  	if err != nil {
  5006  		return nil, err
  5007  	}
  5008  	defer googleapi.CloseBody(res)
  5009  	if err := googleapi.CheckResponse(res); err != nil {
  5010  		return nil, gensupport.WrapError(err)
  5011  	}
  5012  	ret := &GetAncestryResponse{
  5013  		ServerResponse: googleapi.ServerResponse{
  5014  			Header:         res.Header,
  5015  			HTTPStatusCode: res.StatusCode,
  5016  		},
  5017  	}
  5018  	target := &ret
  5019  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5020  		return nil, err
  5021  	}
  5022  	return ret, nil
  5023  }
  5024  
  5025  type ProjectsGetEffectiveOrgPolicyCall struct {
  5026  	s                            *Service
  5027  	resource                     string
  5028  	geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest
  5029  	urlParams_                   gensupport.URLParams
  5030  	ctx_                         context.Context
  5031  	header_                      http.Header
  5032  }
  5033  
  5034  // GetEffectiveOrgPolicy: Gets the effective `Policy` on a resource. This is
  5035  // the result of merging `Policies` in the resource hierarchy. The returned
  5036  // `Policy` will not have an `etag`set because it is a computed `Policy` across
  5037  // multiple resources. Subtrees of Resource Manager resource hierarchy with
  5038  // 'under:' prefix will not be expanded.
  5039  //
  5040  //   - resource: The name of the resource to start computing the effective
  5041  //     `Policy`.
  5042  func (r *ProjectsService) GetEffectiveOrgPolicy(resource string, geteffectiveorgpolicyrequest *GetEffectiveOrgPolicyRequest) *ProjectsGetEffectiveOrgPolicyCall {
  5043  	c := &ProjectsGetEffectiveOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5044  	c.resource = resource
  5045  	c.geteffectiveorgpolicyrequest = geteffectiveorgpolicyrequest
  5046  	return c
  5047  }
  5048  
  5049  // Fields allows partial responses to be retrieved. See
  5050  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5051  // details.
  5052  func (c *ProjectsGetEffectiveOrgPolicyCall) Fields(s ...googleapi.Field) *ProjectsGetEffectiveOrgPolicyCall {
  5053  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5054  	return c
  5055  }
  5056  
  5057  // Context sets the context to be used in this call's Do method.
  5058  func (c *ProjectsGetEffectiveOrgPolicyCall) Context(ctx context.Context) *ProjectsGetEffectiveOrgPolicyCall {
  5059  	c.ctx_ = ctx
  5060  	return c
  5061  }
  5062  
  5063  // Header returns a http.Header that can be modified by the caller to add
  5064  // headers to the request.
  5065  func (c *ProjectsGetEffectiveOrgPolicyCall) Header() http.Header {
  5066  	if c.header_ == nil {
  5067  		c.header_ = make(http.Header)
  5068  	}
  5069  	return c.header_
  5070  }
  5071  
  5072  func (c *ProjectsGetEffectiveOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
  5073  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5074  	var body io.Reader = nil
  5075  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.geteffectiveorgpolicyrequest)
  5076  	if err != nil {
  5077  		return nil, err
  5078  	}
  5079  	c.urlParams_.Set("alt", alt)
  5080  	c.urlParams_.Set("prettyPrint", "false")
  5081  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getEffectiveOrgPolicy")
  5082  	urls += "?" + c.urlParams_.Encode()
  5083  	req, err := http.NewRequest("POST", urls, body)
  5084  	if err != nil {
  5085  		return nil, err
  5086  	}
  5087  	req.Header = reqHeaders
  5088  	googleapi.Expand(req.URL, map[string]string{
  5089  		"resource": c.resource,
  5090  	})
  5091  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5092  }
  5093  
  5094  // Do executes the "cloudresourcemanager.projects.getEffectiveOrgPolicy" call.
  5095  // Any non-2xx status code is an error. Response headers are in either
  5096  // *OrgPolicy.ServerResponse.Header or (if a response was returned at all) in
  5097  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5098  // whether the returned error was because http.StatusNotModified was returned.
  5099  func (c *ProjectsGetEffectiveOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
  5100  	gensupport.SetOptions(c.urlParams_, opts...)
  5101  	res, err := c.doRequest("json")
  5102  	if res != nil && res.StatusCode == http.StatusNotModified {
  5103  		if res.Body != nil {
  5104  			res.Body.Close()
  5105  		}
  5106  		return nil, gensupport.WrapError(&googleapi.Error{
  5107  			Code:   res.StatusCode,
  5108  			Header: res.Header,
  5109  		})
  5110  	}
  5111  	if err != nil {
  5112  		return nil, err
  5113  	}
  5114  	defer googleapi.CloseBody(res)
  5115  	if err := googleapi.CheckResponse(res); err != nil {
  5116  		return nil, gensupport.WrapError(err)
  5117  	}
  5118  	ret := &OrgPolicy{
  5119  		ServerResponse: googleapi.ServerResponse{
  5120  			Header:         res.Header,
  5121  			HTTPStatusCode: res.StatusCode,
  5122  		},
  5123  	}
  5124  	target := &ret
  5125  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5126  		return nil, err
  5127  	}
  5128  	return ret, nil
  5129  }
  5130  
  5131  type ProjectsGetIamPolicyCall struct {
  5132  	s                   *Service
  5133  	resource            string
  5134  	getiampolicyrequest *GetIamPolicyRequest
  5135  	urlParams_          gensupport.URLParams
  5136  	ctx_                context.Context
  5137  	header_             http.Header
  5138  }
  5139  
  5140  // GetIamPolicy: Returns the IAM access control policy for the specified
  5141  // Project. Permission is denied if the policy or the resource does not exist.
  5142  // Authorization requires the Google IAM permission
  5143  // `resourcemanager.projects.getIamPolicy` on the project. For additional
  5144  // information about `resource` (e.g. my-project-id) structure and
  5145  // identification, see Resource Names
  5146  // (https://cloud.google.com/apis/design/resource_names).
  5147  //
  5148  //   - resource: REQUIRED: The resource for which the policy is being requested.
  5149  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  5150  //     for the appropriate value for this field.
  5151  func (r *ProjectsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsGetIamPolicyCall {
  5152  	c := &ProjectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5153  	c.resource = resource
  5154  	c.getiampolicyrequest = getiampolicyrequest
  5155  	return c
  5156  }
  5157  
  5158  // Fields allows partial responses to be retrieved. See
  5159  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5160  // details.
  5161  func (c *ProjectsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsGetIamPolicyCall {
  5162  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5163  	return c
  5164  }
  5165  
  5166  // Context sets the context to be used in this call's Do method.
  5167  func (c *ProjectsGetIamPolicyCall) Context(ctx context.Context) *ProjectsGetIamPolicyCall {
  5168  	c.ctx_ = ctx
  5169  	return c
  5170  }
  5171  
  5172  // Header returns a http.Header that can be modified by the caller to add
  5173  // headers to the request.
  5174  func (c *ProjectsGetIamPolicyCall) Header() http.Header {
  5175  	if c.header_ == nil {
  5176  		c.header_ = make(http.Header)
  5177  	}
  5178  	return c.header_
  5179  }
  5180  
  5181  func (c *ProjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  5182  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5183  	var body io.Reader = nil
  5184  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
  5185  	if err != nil {
  5186  		return nil, err
  5187  	}
  5188  	c.urlParams_.Set("alt", alt)
  5189  	c.urlParams_.Set("prettyPrint", "false")
  5190  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{resource}:getIamPolicy")
  5191  	urls += "?" + c.urlParams_.Encode()
  5192  	req, err := http.NewRequest("POST", urls, body)
  5193  	if err != nil {
  5194  		return nil, err
  5195  	}
  5196  	req.Header = reqHeaders
  5197  	googleapi.Expand(req.URL, map[string]string{
  5198  		"resource": c.resource,
  5199  	})
  5200  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5201  }
  5202  
  5203  // Do executes the "cloudresourcemanager.projects.getIamPolicy" call.
  5204  // Any non-2xx status code is an error. Response headers are in either
  5205  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  5206  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5207  // whether the returned error was because http.StatusNotModified was returned.
  5208  func (c *ProjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  5209  	gensupport.SetOptions(c.urlParams_, opts...)
  5210  	res, err := c.doRequest("json")
  5211  	if res != nil && res.StatusCode == http.StatusNotModified {
  5212  		if res.Body != nil {
  5213  			res.Body.Close()
  5214  		}
  5215  		return nil, gensupport.WrapError(&googleapi.Error{
  5216  			Code:   res.StatusCode,
  5217  			Header: res.Header,
  5218  		})
  5219  	}
  5220  	if err != nil {
  5221  		return nil, err
  5222  	}
  5223  	defer googleapi.CloseBody(res)
  5224  	if err := googleapi.CheckResponse(res); err != nil {
  5225  		return nil, gensupport.WrapError(err)
  5226  	}
  5227  	ret := &Policy{
  5228  		ServerResponse: googleapi.ServerResponse{
  5229  			Header:         res.Header,
  5230  			HTTPStatusCode: res.StatusCode,
  5231  		},
  5232  	}
  5233  	target := &ret
  5234  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5235  		return nil, err
  5236  	}
  5237  	return ret, nil
  5238  }
  5239  
  5240  type ProjectsGetOrgPolicyCall struct {
  5241  	s                   *Service
  5242  	resource            string
  5243  	getorgpolicyrequest *GetOrgPolicyRequest
  5244  	urlParams_          gensupport.URLParams
  5245  	ctx_                context.Context
  5246  	header_             http.Header
  5247  }
  5248  
  5249  // GetOrgPolicy: Gets a `Policy` on a resource. If no `Policy` is set on the
  5250  // resource, a `Policy` is returned with default values including
  5251  // `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can be
  5252  // used with `SetOrgPolicy()` to create or update a `Policy` during
  5253  // read-modify-write.
  5254  //
  5255  // - resource: Name of the resource the `Policy` is set on.
  5256  func (r *ProjectsService) GetOrgPolicy(resource string, getorgpolicyrequest *GetOrgPolicyRequest) *ProjectsGetOrgPolicyCall {
  5257  	c := &ProjectsGetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5258  	c.resource = resource
  5259  	c.getorgpolicyrequest = getorgpolicyrequest
  5260  	return c
  5261  }
  5262  
  5263  // Fields allows partial responses to be retrieved. See
  5264  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5265  // details.
  5266  func (c *ProjectsGetOrgPolicyCall) Fields(s ...googleapi.Field) *ProjectsGetOrgPolicyCall {
  5267  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5268  	return c
  5269  }
  5270  
  5271  // Context sets the context to be used in this call's Do method.
  5272  func (c *ProjectsGetOrgPolicyCall) Context(ctx context.Context) *ProjectsGetOrgPolicyCall {
  5273  	c.ctx_ = ctx
  5274  	return c
  5275  }
  5276  
  5277  // Header returns a http.Header that can be modified by the caller to add
  5278  // headers to the request.
  5279  func (c *ProjectsGetOrgPolicyCall) Header() http.Header {
  5280  	if c.header_ == nil {
  5281  		c.header_ = make(http.Header)
  5282  	}
  5283  	return c.header_
  5284  }
  5285  
  5286  func (c *ProjectsGetOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
  5287  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5288  	var body io.Reader = nil
  5289  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.getorgpolicyrequest)
  5290  	if err != nil {
  5291  		return nil, err
  5292  	}
  5293  	c.urlParams_.Set("alt", alt)
  5294  	c.urlParams_.Set("prettyPrint", "false")
  5295  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getOrgPolicy")
  5296  	urls += "?" + c.urlParams_.Encode()
  5297  	req, err := http.NewRequest("POST", urls, body)
  5298  	if err != nil {
  5299  		return nil, err
  5300  	}
  5301  	req.Header = reqHeaders
  5302  	googleapi.Expand(req.URL, map[string]string{
  5303  		"resource": c.resource,
  5304  	})
  5305  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5306  }
  5307  
  5308  // Do executes the "cloudresourcemanager.projects.getOrgPolicy" call.
  5309  // Any non-2xx status code is an error. Response headers are in either
  5310  // *OrgPolicy.ServerResponse.Header or (if a response was returned at all) in
  5311  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5312  // whether the returned error was because http.StatusNotModified was returned.
  5313  func (c *ProjectsGetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
  5314  	gensupport.SetOptions(c.urlParams_, opts...)
  5315  	res, err := c.doRequest("json")
  5316  	if res != nil && res.StatusCode == http.StatusNotModified {
  5317  		if res.Body != nil {
  5318  			res.Body.Close()
  5319  		}
  5320  		return nil, gensupport.WrapError(&googleapi.Error{
  5321  			Code:   res.StatusCode,
  5322  			Header: res.Header,
  5323  		})
  5324  	}
  5325  	if err != nil {
  5326  		return nil, err
  5327  	}
  5328  	defer googleapi.CloseBody(res)
  5329  	if err := googleapi.CheckResponse(res); err != nil {
  5330  		return nil, gensupport.WrapError(err)
  5331  	}
  5332  	ret := &OrgPolicy{
  5333  		ServerResponse: googleapi.ServerResponse{
  5334  			Header:         res.Header,
  5335  			HTTPStatusCode: res.StatusCode,
  5336  		},
  5337  	}
  5338  	target := &ret
  5339  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5340  		return nil, err
  5341  	}
  5342  	return ret, nil
  5343  }
  5344  
  5345  type ProjectsListCall struct {
  5346  	s            *Service
  5347  	urlParams_   gensupport.URLParams
  5348  	ifNoneMatch_ string
  5349  	ctx_         context.Context
  5350  	header_      http.Header
  5351  }
  5352  
  5353  // List: Lists Projects that the caller has the `resourcemanager.projects.get`
  5354  // permission on and satisfy the specified filter. This method returns Projects
  5355  // in an unspecified order. This method is eventually consistent with project
  5356  // mutations; this means that a newly created project may not appear in the
  5357  // results or recent updates to an existing project may not be reflected in the
  5358  // results. To retrieve the latest state of a project, use the GetProject
  5359  // method. NOTE: If the request filter contains a `parent.type` and `parent.id`
  5360  // and the caller has the `resourcemanager.projects.list` permission on the
  5361  // parent, the results will be drawn from an alternate index which provides
  5362  // more consistent results. In future versions of this API, this List method
  5363  // will be split into List and Search to properly capture the behavioral
  5364  // difference.
  5365  func (r *ProjectsService) List() *ProjectsListCall {
  5366  	c := &ProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5367  	return c
  5368  }
  5369  
  5370  // Filter sets the optional parameter "filter": An expression for filtering the
  5371  // results of the request. Filter rules are case insensitive. If multiple
  5372  // fields are included in a filter query, the query will return results that
  5373  // match any of the fields. Some eligible fields for filtering are: + `name` +
  5374  // `id` + `labels.` (where *key* is the name of a label) + `parent.type` +
  5375  // `parent.id` + `lifecycleState` Some examples of filter queries: | Query |
  5376  // Description |
  5377  // |------------------|-----------------------------------------------------| |
  5378  // name:how* | The project's name starts with "how". | | name:Howl | The
  5379  // project's name is `Howl` or `howl`. | | name:HOWL | Equivalent to above. | |
  5380  // NAME:howl | Equivalent to above. | | labels.color:* | The project has the
  5381  // label `color`. | | labels.color:red | The project's label `color` has the
  5382  // value `red`. | | labels.color:red labels.size:big | The project's label
  5383  // `color` has the value `red` or its label `size` has the value `big`. | |
  5384  // lifecycleState:DELETE_REQUESTED | Only show projects that are pending
  5385  // deletion.| If no filter is specified, the call will return projects for
  5386  // which the user has the `resourcemanager.projects.get` permission. NOTE: To
  5387  // perform a by-parent query (eg., what projects are directly in a Folder), the
  5388  // caller must have the `resourcemanager.projects.list` permission on the
  5389  // parent and the filter must contain both a `parent.type` and a `parent.id`
  5390  // restriction (example: "parent.type:folder parent.id:123"). In this case an
  5391  // alternate search index is used which provides more consistent results.
  5392  func (c *ProjectsListCall) Filter(filter string) *ProjectsListCall {
  5393  	c.urlParams_.Set("filter", filter)
  5394  	return c
  5395  }
  5396  
  5397  // PageSize sets the optional parameter "pageSize": The maximum number of
  5398  // Projects to return in the response. The server can return fewer Projects
  5399  // than requested. If unspecified, server picks an appropriate default.
  5400  func (c *ProjectsListCall) PageSize(pageSize int64) *ProjectsListCall {
  5401  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5402  	return c
  5403  }
  5404  
  5405  // PageToken sets the optional parameter "pageToken": A pagination token
  5406  // returned from a previous call to ListProjects that indicates from where
  5407  // listing should continue.
  5408  func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall {
  5409  	c.urlParams_.Set("pageToken", pageToken)
  5410  	return c
  5411  }
  5412  
  5413  // Fields allows partial responses to be retrieved. See
  5414  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5415  // details.
  5416  func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall {
  5417  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5418  	return c
  5419  }
  5420  
  5421  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5422  // object's ETag matches the given value. This is useful for getting updates
  5423  // only after the object has changed since the last request.
  5424  func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall {
  5425  	c.ifNoneMatch_ = entityTag
  5426  	return c
  5427  }
  5428  
  5429  // Context sets the context to be used in this call's Do method.
  5430  func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall {
  5431  	c.ctx_ = ctx
  5432  	return c
  5433  }
  5434  
  5435  // Header returns a http.Header that can be modified by the caller to add
  5436  // headers to the request.
  5437  func (c *ProjectsListCall) Header() http.Header {
  5438  	if c.header_ == nil {
  5439  		c.header_ = make(http.Header)
  5440  	}
  5441  	return c.header_
  5442  }
  5443  
  5444  func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) {
  5445  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5446  	if c.ifNoneMatch_ != "" {
  5447  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5448  	}
  5449  	var body io.Reader = nil
  5450  	c.urlParams_.Set("alt", alt)
  5451  	c.urlParams_.Set("prettyPrint", "false")
  5452  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects")
  5453  	urls += "?" + c.urlParams_.Encode()
  5454  	req, err := http.NewRequest("GET", urls, body)
  5455  	if err != nil {
  5456  		return nil, err
  5457  	}
  5458  	req.Header = reqHeaders
  5459  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5460  }
  5461  
  5462  // Do executes the "cloudresourcemanager.projects.list" call.
  5463  // Any non-2xx status code is an error. Response headers are in either
  5464  // *ListProjectsResponse.ServerResponse.Header or (if a response was returned
  5465  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5466  // check whether the returned error was because http.StatusNotModified was
  5467  // returned.
  5468  func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ListProjectsResponse, error) {
  5469  	gensupport.SetOptions(c.urlParams_, opts...)
  5470  	res, err := c.doRequest("json")
  5471  	if res != nil && res.StatusCode == http.StatusNotModified {
  5472  		if res.Body != nil {
  5473  			res.Body.Close()
  5474  		}
  5475  		return nil, gensupport.WrapError(&googleapi.Error{
  5476  			Code:   res.StatusCode,
  5477  			Header: res.Header,
  5478  		})
  5479  	}
  5480  	if err != nil {
  5481  		return nil, err
  5482  	}
  5483  	defer googleapi.CloseBody(res)
  5484  	if err := googleapi.CheckResponse(res); err != nil {
  5485  		return nil, gensupport.WrapError(err)
  5486  	}
  5487  	ret := &ListProjectsResponse{
  5488  		ServerResponse: googleapi.ServerResponse{
  5489  			Header:         res.Header,
  5490  			HTTPStatusCode: res.StatusCode,
  5491  		},
  5492  	}
  5493  	target := &ret
  5494  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5495  		return nil, err
  5496  	}
  5497  	return ret, nil
  5498  }
  5499  
  5500  // Pages invokes f for each page of results.
  5501  // A non-nil error returned from f will halt the iteration.
  5502  // The provided context supersedes any context provided to the Context method.
  5503  func (c *ProjectsListCall) Pages(ctx context.Context, f func(*ListProjectsResponse) error) error {
  5504  	c.ctx_ = ctx
  5505  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  5506  	for {
  5507  		x, err := c.Do()
  5508  		if err != nil {
  5509  			return err
  5510  		}
  5511  		if err := f(x); err != nil {
  5512  			return err
  5513  		}
  5514  		if x.NextPageToken == "" {
  5515  			return nil
  5516  		}
  5517  		c.PageToken(x.NextPageToken)
  5518  	}
  5519  }
  5520  
  5521  type ProjectsListAvailableOrgPolicyConstraintsCall struct {
  5522  	s                                        *Service
  5523  	resource                                 string
  5524  	listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest
  5525  	urlParams_                               gensupport.URLParams
  5526  	ctx_                                     context.Context
  5527  	header_                                  http.Header
  5528  }
  5529  
  5530  // ListAvailableOrgPolicyConstraints: Lists `Constraints` that could be applied
  5531  // on the specified resource.
  5532  //
  5533  // - resource: Name of the resource to list `Constraints` for.
  5534  func (r *ProjectsService) ListAvailableOrgPolicyConstraints(resource string, listavailableorgpolicyconstraintsrequest *ListAvailableOrgPolicyConstraintsRequest) *ProjectsListAvailableOrgPolicyConstraintsCall {
  5535  	c := &ProjectsListAvailableOrgPolicyConstraintsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5536  	c.resource = resource
  5537  	c.listavailableorgpolicyconstraintsrequest = listavailableorgpolicyconstraintsrequest
  5538  	return c
  5539  }
  5540  
  5541  // Fields allows partial responses to be retrieved. See
  5542  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5543  // details.
  5544  func (c *ProjectsListAvailableOrgPolicyConstraintsCall) Fields(s ...googleapi.Field) *ProjectsListAvailableOrgPolicyConstraintsCall {
  5545  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5546  	return c
  5547  }
  5548  
  5549  // Context sets the context to be used in this call's Do method.
  5550  func (c *ProjectsListAvailableOrgPolicyConstraintsCall) Context(ctx context.Context) *ProjectsListAvailableOrgPolicyConstraintsCall {
  5551  	c.ctx_ = ctx
  5552  	return c
  5553  }
  5554  
  5555  // Header returns a http.Header that can be modified by the caller to add
  5556  // headers to the request.
  5557  func (c *ProjectsListAvailableOrgPolicyConstraintsCall) Header() http.Header {
  5558  	if c.header_ == nil {
  5559  		c.header_ = make(http.Header)
  5560  	}
  5561  	return c.header_
  5562  }
  5563  
  5564  func (c *ProjectsListAvailableOrgPolicyConstraintsCall) doRequest(alt string) (*http.Response, error) {
  5565  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5566  	var body io.Reader = nil
  5567  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.listavailableorgpolicyconstraintsrequest)
  5568  	if err != nil {
  5569  		return nil, err
  5570  	}
  5571  	c.urlParams_.Set("alt", alt)
  5572  	c.urlParams_.Set("prettyPrint", "false")
  5573  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listAvailableOrgPolicyConstraints")
  5574  	urls += "?" + c.urlParams_.Encode()
  5575  	req, err := http.NewRequest("POST", urls, body)
  5576  	if err != nil {
  5577  		return nil, err
  5578  	}
  5579  	req.Header = reqHeaders
  5580  	googleapi.Expand(req.URL, map[string]string{
  5581  		"resource": c.resource,
  5582  	})
  5583  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5584  }
  5585  
  5586  // Do executes the "cloudresourcemanager.projects.listAvailableOrgPolicyConstraints" call.
  5587  // Any non-2xx status code is an error. Response headers are in either
  5588  // *ListAvailableOrgPolicyConstraintsResponse.ServerResponse.Header or (if a
  5589  // response was returned at all) in error.(*googleapi.Error).Header. Use
  5590  // googleapi.IsNotModified to check whether the returned error was because
  5591  // http.StatusNotModified was returned.
  5592  func (c *ProjectsListAvailableOrgPolicyConstraintsCall) Do(opts ...googleapi.CallOption) (*ListAvailableOrgPolicyConstraintsResponse, error) {
  5593  	gensupport.SetOptions(c.urlParams_, opts...)
  5594  	res, err := c.doRequest("json")
  5595  	if res != nil && res.StatusCode == http.StatusNotModified {
  5596  		if res.Body != nil {
  5597  			res.Body.Close()
  5598  		}
  5599  		return nil, gensupport.WrapError(&googleapi.Error{
  5600  			Code:   res.StatusCode,
  5601  			Header: res.Header,
  5602  		})
  5603  	}
  5604  	if err != nil {
  5605  		return nil, err
  5606  	}
  5607  	defer googleapi.CloseBody(res)
  5608  	if err := googleapi.CheckResponse(res); err != nil {
  5609  		return nil, gensupport.WrapError(err)
  5610  	}
  5611  	ret := &ListAvailableOrgPolicyConstraintsResponse{
  5612  		ServerResponse: googleapi.ServerResponse{
  5613  			Header:         res.Header,
  5614  			HTTPStatusCode: res.StatusCode,
  5615  		},
  5616  	}
  5617  	target := &ret
  5618  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5619  		return nil, err
  5620  	}
  5621  	return ret, nil
  5622  }
  5623  
  5624  // Pages invokes f for each page of results.
  5625  // A non-nil error returned from f will halt the iteration.
  5626  // The provided context supersedes any context provided to the Context method.
  5627  func (c *ProjectsListAvailableOrgPolicyConstraintsCall) Pages(ctx context.Context, f func(*ListAvailableOrgPolicyConstraintsResponse) error) error {
  5628  	c.ctx_ = ctx
  5629  	defer func(pt string) { c.listavailableorgpolicyconstraintsrequest.PageToken = pt }(c.listavailableorgpolicyconstraintsrequest.PageToken)
  5630  	for {
  5631  		x, err := c.Do()
  5632  		if err != nil {
  5633  			return err
  5634  		}
  5635  		if err := f(x); err != nil {
  5636  			return err
  5637  		}
  5638  		if x.NextPageToken == "" {
  5639  			return nil
  5640  		}
  5641  		c.listavailableorgpolicyconstraintsrequest.PageToken = x.NextPageToken
  5642  	}
  5643  }
  5644  
  5645  type ProjectsListOrgPoliciesCall struct {
  5646  	s                      *Service
  5647  	resource               string
  5648  	listorgpoliciesrequest *ListOrgPoliciesRequest
  5649  	urlParams_             gensupport.URLParams
  5650  	ctx_                   context.Context
  5651  	header_                http.Header
  5652  }
  5653  
  5654  // ListOrgPolicies: Lists all the `Policies` set for a particular resource.
  5655  //
  5656  // - resource: Name of the resource to list Policies for.
  5657  func (r *ProjectsService) ListOrgPolicies(resource string, listorgpoliciesrequest *ListOrgPoliciesRequest) *ProjectsListOrgPoliciesCall {
  5658  	c := &ProjectsListOrgPoliciesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5659  	c.resource = resource
  5660  	c.listorgpoliciesrequest = listorgpoliciesrequest
  5661  	return c
  5662  }
  5663  
  5664  // Fields allows partial responses to be retrieved. See
  5665  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5666  // details.
  5667  func (c *ProjectsListOrgPoliciesCall) Fields(s ...googleapi.Field) *ProjectsListOrgPoliciesCall {
  5668  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5669  	return c
  5670  }
  5671  
  5672  // Context sets the context to be used in this call's Do method.
  5673  func (c *ProjectsListOrgPoliciesCall) Context(ctx context.Context) *ProjectsListOrgPoliciesCall {
  5674  	c.ctx_ = ctx
  5675  	return c
  5676  }
  5677  
  5678  // Header returns a http.Header that can be modified by the caller to add
  5679  // headers to the request.
  5680  func (c *ProjectsListOrgPoliciesCall) Header() http.Header {
  5681  	if c.header_ == nil {
  5682  		c.header_ = make(http.Header)
  5683  	}
  5684  	return c.header_
  5685  }
  5686  
  5687  func (c *ProjectsListOrgPoliciesCall) doRequest(alt string) (*http.Response, error) {
  5688  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5689  	var body io.Reader = nil
  5690  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.listorgpoliciesrequest)
  5691  	if err != nil {
  5692  		return nil, err
  5693  	}
  5694  	c.urlParams_.Set("alt", alt)
  5695  	c.urlParams_.Set("prettyPrint", "false")
  5696  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:listOrgPolicies")
  5697  	urls += "?" + c.urlParams_.Encode()
  5698  	req, err := http.NewRequest("POST", urls, body)
  5699  	if err != nil {
  5700  		return nil, err
  5701  	}
  5702  	req.Header = reqHeaders
  5703  	googleapi.Expand(req.URL, map[string]string{
  5704  		"resource": c.resource,
  5705  	})
  5706  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5707  }
  5708  
  5709  // Do executes the "cloudresourcemanager.projects.listOrgPolicies" call.
  5710  // Any non-2xx status code is an error. Response headers are in either
  5711  // *ListOrgPoliciesResponse.ServerResponse.Header or (if a response was
  5712  // returned at all) in error.(*googleapi.Error).Header. Use
  5713  // googleapi.IsNotModified to check whether the returned error was because
  5714  // http.StatusNotModified was returned.
  5715  func (c *ProjectsListOrgPoliciesCall) Do(opts ...googleapi.CallOption) (*ListOrgPoliciesResponse, error) {
  5716  	gensupport.SetOptions(c.urlParams_, opts...)
  5717  	res, err := c.doRequest("json")
  5718  	if res != nil && res.StatusCode == http.StatusNotModified {
  5719  		if res.Body != nil {
  5720  			res.Body.Close()
  5721  		}
  5722  		return nil, gensupport.WrapError(&googleapi.Error{
  5723  			Code:   res.StatusCode,
  5724  			Header: res.Header,
  5725  		})
  5726  	}
  5727  	if err != nil {
  5728  		return nil, err
  5729  	}
  5730  	defer googleapi.CloseBody(res)
  5731  	if err := googleapi.CheckResponse(res); err != nil {
  5732  		return nil, gensupport.WrapError(err)
  5733  	}
  5734  	ret := &ListOrgPoliciesResponse{
  5735  		ServerResponse: googleapi.ServerResponse{
  5736  			Header:         res.Header,
  5737  			HTTPStatusCode: res.StatusCode,
  5738  		},
  5739  	}
  5740  	target := &ret
  5741  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5742  		return nil, err
  5743  	}
  5744  	return ret, nil
  5745  }
  5746  
  5747  // Pages invokes f for each page of results.
  5748  // A non-nil error returned from f will halt the iteration.
  5749  // The provided context supersedes any context provided to the Context method.
  5750  func (c *ProjectsListOrgPoliciesCall) Pages(ctx context.Context, f func(*ListOrgPoliciesResponse) error) error {
  5751  	c.ctx_ = ctx
  5752  	defer func(pt string) { c.listorgpoliciesrequest.PageToken = pt }(c.listorgpoliciesrequest.PageToken)
  5753  	for {
  5754  		x, err := c.Do()
  5755  		if err != nil {
  5756  			return err
  5757  		}
  5758  		if err := f(x); err != nil {
  5759  			return err
  5760  		}
  5761  		if x.NextPageToken == "" {
  5762  			return nil
  5763  		}
  5764  		c.listorgpoliciesrequest.PageToken = x.NextPageToken
  5765  	}
  5766  }
  5767  
  5768  type ProjectsSetIamPolicyCall struct {
  5769  	s                   *Service
  5770  	resource            string
  5771  	setiampolicyrequest *SetIamPolicyRequest
  5772  	urlParams_          gensupport.URLParams
  5773  	ctx_                context.Context
  5774  	header_             http.Header
  5775  }
  5776  
  5777  // SetIamPolicy: Sets the IAM access control policy for the specified Project.
  5778  // CAUTION: This method will replace the existing policy, and cannot be used to
  5779  // append additional IAM settings. NOTE: Removing service accounts from
  5780  // policies or changing their roles can render services completely inoperable.
  5781  // It is important to understand how the service account is being used before
  5782  // removing or updating its roles. For additional information about `resource`
  5783  // (e.g. my-project-id) structure and identification, see Resource Names
  5784  // (https://cloud.google.com/apis/design/resource_names). The following
  5785  // constraints apply when using `setIamPolicy()`: + Project does not support
  5786  // `allUsers` and `allAuthenticatedUsers` as `members` in a `Binding` of a
  5787  // `Policy`. + The owner role can be granted to a `user`, `serviceAccount`, or
  5788  // a group that is part of an organization. For example,
  5789  // group@myownpersonaldomain.com could be added as an owner to a project in the
  5790  // myownpersonaldomain.com organization, but not the examplepetstore.com
  5791  // organization. + Service accounts can be made owners of a project directly
  5792  // without any restrictions. However, to be added as an owner, a user must be
  5793  // invited via Cloud Platform console and must accept the invitation. + A user
  5794  // cannot be granted the owner role using `setIamPolicy()`. The user must be
  5795  // granted the owner role using the Cloud Platform Console and must explicitly
  5796  // accept the invitation. + You can only grant ownership of a project to a
  5797  // member by using the Google Cloud console. Inviting a member will deliver an
  5798  // invitation email that they must accept. An invitation email is not generated
  5799  // if you are granting a role other than owner, or if both the member you are
  5800  // inviting and the project are part of your organization. + If the project is
  5801  // not part of an organization, there must be at least one owner who has
  5802  // accepted the Terms of Service (ToS) agreement in the policy. Calling
  5803  // `setIamPolicy()` to remove the last ToS-accepted owner from the policy will
  5804  // fail. This restriction also applies to legacy projects that no longer have
  5805  // owners who have accepted the ToS. Edits to IAM policies will be rejected
  5806  // until the lack of a ToS-accepting owner is rectified. If the project is part
  5807  // of an organization, you can remove all owners, potentially making the
  5808  // organization inaccessible. Authorization requires the Google IAM permission
  5809  // `resourcemanager.projects.setIamPolicy` on the project
  5810  //
  5811  //   - resource: REQUIRED: The resource for which the policy is being specified.
  5812  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  5813  //     for the appropriate value for this field.
  5814  func (r *ProjectsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsSetIamPolicyCall {
  5815  	c := &ProjectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5816  	c.resource = resource
  5817  	c.setiampolicyrequest = setiampolicyrequest
  5818  	return c
  5819  }
  5820  
  5821  // Fields allows partial responses to be retrieved. See
  5822  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5823  // details.
  5824  func (c *ProjectsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsSetIamPolicyCall {
  5825  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5826  	return c
  5827  }
  5828  
  5829  // Context sets the context to be used in this call's Do method.
  5830  func (c *ProjectsSetIamPolicyCall) Context(ctx context.Context) *ProjectsSetIamPolicyCall {
  5831  	c.ctx_ = ctx
  5832  	return c
  5833  }
  5834  
  5835  // Header returns a http.Header that can be modified by the caller to add
  5836  // headers to the request.
  5837  func (c *ProjectsSetIamPolicyCall) Header() http.Header {
  5838  	if c.header_ == nil {
  5839  		c.header_ = make(http.Header)
  5840  	}
  5841  	return c.header_
  5842  }
  5843  
  5844  func (c *ProjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  5845  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5846  	var body io.Reader = nil
  5847  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  5848  	if err != nil {
  5849  		return nil, err
  5850  	}
  5851  	c.urlParams_.Set("alt", alt)
  5852  	c.urlParams_.Set("prettyPrint", "false")
  5853  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{resource}:setIamPolicy")
  5854  	urls += "?" + c.urlParams_.Encode()
  5855  	req, err := http.NewRequest("POST", urls, body)
  5856  	if err != nil {
  5857  		return nil, err
  5858  	}
  5859  	req.Header = reqHeaders
  5860  	googleapi.Expand(req.URL, map[string]string{
  5861  		"resource": c.resource,
  5862  	})
  5863  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5864  }
  5865  
  5866  // Do executes the "cloudresourcemanager.projects.setIamPolicy" call.
  5867  // Any non-2xx status code is an error. Response headers are in either
  5868  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  5869  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5870  // whether the returned error was because http.StatusNotModified was returned.
  5871  func (c *ProjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  5872  	gensupport.SetOptions(c.urlParams_, opts...)
  5873  	res, err := c.doRequest("json")
  5874  	if res != nil && res.StatusCode == http.StatusNotModified {
  5875  		if res.Body != nil {
  5876  			res.Body.Close()
  5877  		}
  5878  		return nil, gensupport.WrapError(&googleapi.Error{
  5879  			Code:   res.StatusCode,
  5880  			Header: res.Header,
  5881  		})
  5882  	}
  5883  	if err != nil {
  5884  		return nil, err
  5885  	}
  5886  	defer googleapi.CloseBody(res)
  5887  	if err := googleapi.CheckResponse(res); err != nil {
  5888  		return nil, gensupport.WrapError(err)
  5889  	}
  5890  	ret := &Policy{
  5891  		ServerResponse: googleapi.ServerResponse{
  5892  			Header:         res.Header,
  5893  			HTTPStatusCode: res.StatusCode,
  5894  		},
  5895  	}
  5896  	target := &ret
  5897  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5898  		return nil, err
  5899  	}
  5900  	return ret, nil
  5901  }
  5902  
  5903  type ProjectsSetOrgPolicyCall struct {
  5904  	s                   *Service
  5905  	resource            string
  5906  	setorgpolicyrequest *SetOrgPolicyRequest
  5907  	urlParams_          gensupport.URLParams
  5908  	ctx_                context.Context
  5909  	header_             http.Header
  5910  }
  5911  
  5912  // SetOrgPolicy: Updates the specified `Policy` on the resource. Creates a new
  5913  // `Policy` for that `Constraint` on the resource if one does not exist. Not
  5914  // supplying an `etag` on the request `Policy` results in an unconditional
  5915  // write of the `Policy`.
  5916  //
  5917  // - resource: Resource name of the resource to attach the `Policy`.
  5918  func (r *ProjectsService) SetOrgPolicy(resource string, setorgpolicyrequest *SetOrgPolicyRequest) *ProjectsSetOrgPolicyCall {
  5919  	c := &ProjectsSetOrgPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5920  	c.resource = resource
  5921  	c.setorgpolicyrequest = setorgpolicyrequest
  5922  	return c
  5923  }
  5924  
  5925  // Fields allows partial responses to be retrieved. See
  5926  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5927  // details.
  5928  func (c *ProjectsSetOrgPolicyCall) Fields(s ...googleapi.Field) *ProjectsSetOrgPolicyCall {
  5929  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5930  	return c
  5931  }
  5932  
  5933  // Context sets the context to be used in this call's Do method.
  5934  func (c *ProjectsSetOrgPolicyCall) Context(ctx context.Context) *ProjectsSetOrgPolicyCall {
  5935  	c.ctx_ = ctx
  5936  	return c
  5937  }
  5938  
  5939  // Header returns a http.Header that can be modified by the caller to add
  5940  // headers to the request.
  5941  func (c *ProjectsSetOrgPolicyCall) Header() http.Header {
  5942  	if c.header_ == nil {
  5943  		c.header_ = make(http.Header)
  5944  	}
  5945  	return c.header_
  5946  }
  5947  
  5948  func (c *ProjectsSetOrgPolicyCall) doRequest(alt string) (*http.Response, error) {
  5949  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5950  	var body io.Reader = nil
  5951  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setorgpolicyrequest)
  5952  	if err != nil {
  5953  		return nil, err
  5954  	}
  5955  	c.urlParams_.Set("alt", alt)
  5956  	c.urlParams_.Set("prettyPrint", "false")
  5957  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setOrgPolicy")
  5958  	urls += "?" + c.urlParams_.Encode()
  5959  	req, err := http.NewRequest("POST", urls, body)
  5960  	if err != nil {
  5961  		return nil, err
  5962  	}
  5963  	req.Header = reqHeaders
  5964  	googleapi.Expand(req.URL, map[string]string{
  5965  		"resource": c.resource,
  5966  	})
  5967  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5968  }
  5969  
  5970  // Do executes the "cloudresourcemanager.projects.setOrgPolicy" call.
  5971  // Any non-2xx status code is an error. Response headers are in either
  5972  // *OrgPolicy.ServerResponse.Header or (if a response was returned at all) in
  5973  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5974  // whether the returned error was because http.StatusNotModified was returned.
  5975  func (c *ProjectsSetOrgPolicyCall) Do(opts ...googleapi.CallOption) (*OrgPolicy, error) {
  5976  	gensupport.SetOptions(c.urlParams_, opts...)
  5977  	res, err := c.doRequest("json")
  5978  	if res != nil && res.StatusCode == http.StatusNotModified {
  5979  		if res.Body != nil {
  5980  			res.Body.Close()
  5981  		}
  5982  		return nil, gensupport.WrapError(&googleapi.Error{
  5983  			Code:   res.StatusCode,
  5984  			Header: res.Header,
  5985  		})
  5986  	}
  5987  	if err != nil {
  5988  		return nil, err
  5989  	}
  5990  	defer googleapi.CloseBody(res)
  5991  	if err := googleapi.CheckResponse(res); err != nil {
  5992  		return nil, gensupport.WrapError(err)
  5993  	}
  5994  	ret := &OrgPolicy{
  5995  		ServerResponse: googleapi.ServerResponse{
  5996  			Header:         res.Header,
  5997  			HTTPStatusCode: res.StatusCode,
  5998  		},
  5999  	}
  6000  	target := &ret
  6001  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6002  		return nil, err
  6003  	}
  6004  	return ret, nil
  6005  }
  6006  
  6007  type ProjectsTestIamPermissionsCall struct {
  6008  	s                         *Service
  6009  	resource                  string
  6010  	testiampermissionsrequest *TestIamPermissionsRequest
  6011  	urlParams_                gensupport.URLParams
  6012  	ctx_                      context.Context
  6013  	header_                   http.Header
  6014  }
  6015  
  6016  // TestIamPermissions: Returns permissions that a caller has on the specified
  6017  // Project. For additional information about `resource` (e.g. my-project-id)
  6018  // structure and identification, see Resource Names
  6019  // (https://cloud.google.com/apis/design/resource_names). There are no
  6020  // permissions required for making this API call.
  6021  //
  6022  //   - resource: REQUIRED: The resource for which the policy detail is being
  6023  //     requested. See Resource names
  6024  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  6025  //     value for this field.
  6026  func (r *ProjectsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsTestIamPermissionsCall {
  6027  	c := &ProjectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6028  	c.resource = resource
  6029  	c.testiampermissionsrequest = testiampermissionsrequest
  6030  	return c
  6031  }
  6032  
  6033  // Fields allows partial responses to be retrieved. See
  6034  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6035  // details.
  6036  func (c *ProjectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsTestIamPermissionsCall {
  6037  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6038  	return c
  6039  }
  6040  
  6041  // Context sets the context to be used in this call's Do method.
  6042  func (c *ProjectsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsTestIamPermissionsCall {
  6043  	c.ctx_ = ctx
  6044  	return c
  6045  }
  6046  
  6047  // Header returns a http.Header that can be modified by the caller to add
  6048  // headers to the request.
  6049  func (c *ProjectsTestIamPermissionsCall) Header() http.Header {
  6050  	if c.header_ == nil {
  6051  		c.header_ = make(http.Header)
  6052  	}
  6053  	return c.header_
  6054  }
  6055  
  6056  func (c *ProjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  6057  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6058  	var body io.Reader = nil
  6059  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  6060  	if err != nil {
  6061  		return nil, err
  6062  	}
  6063  	c.urlParams_.Set("alt", alt)
  6064  	c.urlParams_.Set("prettyPrint", "false")
  6065  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{resource}:testIamPermissions")
  6066  	urls += "?" + c.urlParams_.Encode()
  6067  	req, err := http.NewRequest("POST", urls, body)
  6068  	if err != nil {
  6069  		return nil, err
  6070  	}
  6071  	req.Header = reqHeaders
  6072  	googleapi.Expand(req.URL, map[string]string{
  6073  		"resource": c.resource,
  6074  	})
  6075  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6076  }
  6077  
  6078  // Do executes the "cloudresourcemanager.projects.testIamPermissions" call.
  6079  // Any non-2xx status code is an error. Response headers are in either
  6080  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  6081  // returned at all) in error.(*googleapi.Error).Header. Use
  6082  // googleapi.IsNotModified to check whether the returned error was because
  6083  // http.StatusNotModified was returned.
  6084  func (c *ProjectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  6085  	gensupport.SetOptions(c.urlParams_, opts...)
  6086  	res, err := c.doRequest("json")
  6087  	if res != nil && res.StatusCode == http.StatusNotModified {
  6088  		if res.Body != nil {
  6089  			res.Body.Close()
  6090  		}
  6091  		return nil, gensupport.WrapError(&googleapi.Error{
  6092  			Code:   res.StatusCode,
  6093  			Header: res.Header,
  6094  		})
  6095  	}
  6096  	if err != nil {
  6097  		return nil, err
  6098  	}
  6099  	defer googleapi.CloseBody(res)
  6100  	if err := googleapi.CheckResponse(res); err != nil {
  6101  		return nil, gensupport.WrapError(err)
  6102  	}
  6103  	ret := &TestIamPermissionsResponse{
  6104  		ServerResponse: googleapi.ServerResponse{
  6105  			Header:         res.Header,
  6106  			HTTPStatusCode: res.StatusCode,
  6107  		},
  6108  	}
  6109  	target := &ret
  6110  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6111  		return nil, err
  6112  	}
  6113  	return ret, nil
  6114  }
  6115  
  6116  type ProjectsUndeleteCall struct {
  6117  	s                      *Service
  6118  	projectId              string
  6119  	undeleteprojectrequest *UndeleteProjectRequest
  6120  	urlParams_             gensupport.URLParams
  6121  	ctx_                   context.Context
  6122  	header_                http.Header
  6123  }
  6124  
  6125  // Undelete: Restores the Project identified by the specified `project_id` (for
  6126  // example, `my-project-123`). You can only use this method for a Project that
  6127  // has a lifecycle state of DELETE_REQUESTED. After deletion starts, the
  6128  // Project cannot be restored. The caller must have undelete permissions for
  6129  // this Project.
  6130  //
  6131  // - projectId: The project ID (for example, `foo-bar-123`).
  6132  func (r *ProjectsService) Undelete(projectId string, undeleteprojectrequest *UndeleteProjectRequest) *ProjectsUndeleteCall {
  6133  	c := &ProjectsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6134  	c.projectId = projectId
  6135  	c.undeleteprojectrequest = undeleteprojectrequest
  6136  	return c
  6137  }
  6138  
  6139  // Fields allows partial responses to be retrieved. See
  6140  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6141  // details.
  6142  func (c *ProjectsUndeleteCall) Fields(s ...googleapi.Field) *ProjectsUndeleteCall {
  6143  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6144  	return c
  6145  }
  6146  
  6147  // Context sets the context to be used in this call's Do method.
  6148  func (c *ProjectsUndeleteCall) Context(ctx context.Context) *ProjectsUndeleteCall {
  6149  	c.ctx_ = ctx
  6150  	return c
  6151  }
  6152  
  6153  // Header returns a http.Header that can be modified by the caller to add
  6154  // headers to the request.
  6155  func (c *ProjectsUndeleteCall) Header() http.Header {
  6156  	if c.header_ == nil {
  6157  		c.header_ = make(http.Header)
  6158  	}
  6159  	return c.header_
  6160  }
  6161  
  6162  func (c *ProjectsUndeleteCall) doRequest(alt string) (*http.Response, error) {
  6163  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6164  	var body io.Reader = nil
  6165  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeleteprojectrequest)
  6166  	if err != nil {
  6167  		return nil, err
  6168  	}
  6169  	c.urlParams_.Set("alt", alt)
  6170  	c.urlParams_.Set("prettyPrint", "false")
  6171  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}:undelete")
  6172  	urls += "?" + c.urlParams_.Encode()
  6173  	req, err := http.NewRequest("POST", urls, body)
  6174  	if err != nil {
  6175  		return nil, err
  6176  	}
  6177  	req.Header = reqHeaders
  6178  	googleapi.Expand(req.URL, map[string]string{
  6179  		"projectId": c.projectId,
  6180  	})
  6181  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6182  }
  6183  
  6184  // Do executes the "cloudresourcemanager.projects.undelete" call.
  6185  // Any non-2xx status code is an error. Response headers are in either
  6186  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  6187  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6188  // whether the returned error was because http.StatusNotModified was returned.
  6189  func (c *ProjectsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  6190  	gensupport.SetOptions(c.urlParams_, opts...)
  6191  	res, err := c.doRequest("json")
  6192  	if res != nil && res.StatusCode == http.StatusNotModified {
  6193  		if res.Body != nil {
  6194  			res.Body.Close()
  6195  		}
  6196  		return nil, gensupport.WrapError(&googleapi.Error{
  6197  			Code:   res.StatusCode,
  6198  			Header: res.Header,
  6199  		})
  6200  	}
  6201  	if err != nil {
  6202  		return nil, err
  6203  	}
  6204  	defer googleapi.CloseBody(res)
  6205  	if err := googleapi.CheckResponse(res); err != nil {
  6206  		return nil, gensupport.WrapError(err)
  6207  	}
  6208  	ret := &Empty{
  6209  		ServerResponse: googleapi.ServerResponse{
  6210  			Header:         res.Header,
  6211  			HTTPStatusCode: res.StatusCode,
  6212  		},
  6213  	}
  6214  	target := &ret
  6215  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6216  		return nil, err
  6217  	}
  6218  	return ret, nil
  6219  }
  6220  
  6221  type ProjectsUpdateCall struct {
  6222  	s          *Service
  6223  	projectId  string
  6224  	project    *Project
  6225  	urlParams_ gensupport.URLParams
  6226  	ctx_       context.Context
  6227  	header_    http.Header
  6228  }
  6229  
  6230  // Update: Updates the attributes of the Project identified by the specified
  6231  // `project_id` (for example, `my-project-123`). The caller must have modify
  6232  // permissions for this Project.
  6233  //
  6234  // - projectId: The project ID (for example, `my-project-123`).
  6235  func (r *ProjectsService) Update(projectId string, project *Project) *ProjectsUpdateCall {
  6236  	c := &ProjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6237  	c.projectId = projectId
  6238  	c.project = project
  6239  	return c
  6240  }
  6241  
  6242  // Fields allows partial responses to be retrieved. See
  6243  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6244  // details.
  6245  func (c *ProjectsUpdateCall) Fields(s ...googleapi.Field) *ProjectsUpdateCall {
  6246  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6247  	return c
  6248  }
  6249  
  6250  // Context sets the context to be used in this call's Do method.
  6251  func (c *ProjectsUpdateCall) Context(ctx context.Context) *ProjectsUpdateCall {
  6252  	c.ctx_ = ctx
  6253  	return c
  6254  }
  6255  
  6256  // Header returns a http.Header that can be modified by the caller to add
  6257  // headers to the request.
  6258  func (c *ProjectsUpdateCall) Header() http.Header {
  6259  	if c.header_ == nil {
  6260  		c.header_ = make(http.Header)
  6261  	}
  6262  	return c.header_
  6263  }
  6264  
  6265  func (c *ProjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
  6266  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6267  	var body io.Reader = nil
  6268  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.project)
  6269  	if err != nil {
  6270  		return nil, err
  6271  	}
  6272  	c.urlParams_.Set("alt", alt)
  6273  	c.urlParams_.Set("prettyPrint", "false")
  6274  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}")
  6275  	urls += "?" + c.urlParams_.Encode()
  6276  	req, err := http.NewRequest("PUT", urls, body)
  6277  	if err != nil {
  6278  		return nil, err
  6279  	}
  6280  	req.Header = reqHeaders
  6281  	googleapi.Expand(req.URL, map[string]string{
  6282  		"projectId": c.projectId,
  6283  	})
  6284  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6285  }
  6286  
  6287  // Do executes the "cloudresourcemanager.projects.update" call.
  6288  // Any non-2xx status code is an error. Response headers are in either
  6289  // *Project.ServerResponse.Header or (if a response was returned at all) in
  6290  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6291  // whether the returned error was because http.StatusNotModified was returned.
  6292  func (c *ProjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  6293  	gensupport.SetOptions(c.urlParams_, opts...)
  6294  	res, err := c.doRequest("json")
  6295  	if res != nil && res.StatusCode == http.StatusNotModified {
  6296  		if res.Body != nil {
  6297  			res.Body.Close()
  6298  		}
  6299  		return nil, gensupport.WrapError(&googleapi.Error{
  6300  			Code:   res.StatusCode,
  6301  			Header: res.Header,
  6302  		})
  6303  	}
  6304  	if err != nil {
  6305  		return nil, err
  6306  	}
  6307  	defer googleapi.CloseBody(res)
  6308  	if err := googleapi.CheckResponse(res); err != nil {
  6309  		return nil, gensupport.WrapError(err)
  6310  	}
  6311  	ret := &Project{
  6312  		ServerResponse: googleapi.ServerResponse{
  6313  			Header:         res.Header,
  6314  			HTTPStatusCode: res.StatusCode,
  6315  		},
  6316  	}
  6317  	target := &ret
  6318  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6319  		return nil, err
  6320  	}
  6321  	return ret, nil
  6322  }
  6323  

View as plain text