...

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

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

     1  // Copyright 2023 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 gameservices provides access to the Game Services API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/solutions/gaming/
    10  //
    11  // # Creating a client
    12  //
    13  // Usage example:
    14  //
    15  //	import "google.golang.org/api/gameservices/v1"
    16  //	...
    17  //	ctx := context.Background()
    18  //	gameservicesService, err := gameservices.NewService(ctx)
    19  //
    20  // In this example, Google Application Default Credentials are used for authentication.
    21  //
    22  // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    23  //
    24  // # Other authentication options
    25  //
    26  // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
    27  //
    28  //	gameservicesService, err := gameservices.NewService(ctx, option.WithAPIKey("AIza..."))
    29  //
    30  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
    31  //
    32  //	config := &oauth2.Config{...}
    33  //	// ...
    34  //	token, err := config.Exchange(ctx, ...)
    35  //	gameservicesService, err := gameservices.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    36  //
    37  // See https://godoc.org/google.golang.org/api/option/ for details on options.
    38  package gameservices // import "google.golang.org/api/gameservices/v1"
    39  
    40  import (
    41  	"bytes"
    42  	"context"
    43  	"encoding/json"
    44  	"errors"
    45  	"fmt"
    46  	"io"
    47  	"net/http"
    48  	"net/url"
    49  	"strconv"
    50  	"strings"
    51  
    52  	googleapi "google.golang.org/api/googleapi"
    53  	internal "google.golang.org/api/internal"
    54  	gensupport "google.golang.org/api/internal/gensupport"
    55  	option "google.golang.org/api/option"
    56  	internaloption "google.golang.org/api/option/internaloption"
    57  	htransport "google.golang.org/api/transport/http"
    58  )
    59  
    60  // Always reference these packages, just in case the auto-generated code
    61  // below doesn't.
    62  var _ = bytes.NewBuffer
    63  var _ = strconv.Itoa
    64  var _ = fmt.Sprintf
    65  var _ = json.NewDecoder
    66  var _ = io.Copy
    67  var _ = url.Parse
    68  var _ = gensupport.MarshalJSON
    69  var _ = googleapi.Version
    70  var _ = errors.New
    71  var _ = strings.Replace
    72  var _ = context.Canceled
    73  var _ = internaloption.WithDefaultEndpoint
    74  var _ = internal.Version
    75  
    76  const apiId = "gameservices:v1"
    77  const apiName = "gameservices"
    78  const apiVersion = "v1"
    79  const basePath = "https://gameservices.googleapis.com/"
    80  const mtlsBasePath = "https://gameservices.mtls.googleapis.com/"
    81  
    82  // OAuth2 scopes used by this API.
    83  const (
    84  	// See, edit, configure, and delete your Google Cloud data and see the
    85  	// email address for your Google Account.
    86  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
    87  )
    88  
    89  // NewService creates a new Service.
    90  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
    91  	scopesOption := internaloption.WithDefaultScopes(
    92  		"https://www.googleapis.com/auth/cloud-platform",
    93  	)
    94  	// NOTE: prepend, so we don't override user-specified scopes.
    95  	opts = append([]option.ClientOption{scopesOption}, opts...)
    96  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
    97  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
    98  	client, endpoint, err := htransport.NewClient(ctx, opts...)
    99  	if err != nil {
   100  		return nil, err
   101  	}
   102  	s, err := New(client)
   103  	if err != nil {
   104  		return nil, err
   105  	}
   106  	if endpoint != "" {
   107  		s.BasePath = endpoint
   108  	}
   109  	return s, nil
   110  }
   111  
   112  // New creates a new Service. It uses the provided http.Client for requests.
   113  //
   114  // Deprecated: please use NewService instead.
   115  // To provide a custom HTTP client, use option.WithHTTPClient.
   116  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   117  func New(client *http.Client) (*Service, error) {
   118  	if client == nil {
   119  		return nil, errors.New("client is nil")
   120  	}
   121  	s := &Service{client: client, BasePath: basePath}
   122  	s.Projects = NewProjectsService(s)
   123  	return s, nil
   124  }
   125  
   126  type Service struct {
   127  	client    *http.Client
   128  	BasePath  string // API endpoint base URL
   129  	UserAgent string // optional additional User-Agent fragment
   130  
   131  	Projects *ProjectsService
   132  }
   133  
   134  func (s *Service) userAgent() string {
   135  	if s.UserAgent == "" {
   136  		return googleapi.UserAgent
   137  	}
   138  	return googleapi.UserAgent + " " + s.UserAgent
   139  }
   140  
   141  func NewProjectsService(s *Service) *ProjectsService {
   142  	rs := &ProjectsService{s: s}
   143  	rs.Locations = NewProjectsLocationsService(s)
   144  	return rs
   145  }
   146  
   147  type ProjectsService struct {
   148  	s *Service
   149  
   150  	Locations *ProjectsLocationsService
   151  }
   152  
   153  func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
   154  	rs := &ProjectsLocationsService{s: s}
   155  	rs.GameServerDeployments = NewProjectsLocationsGameServerDeploymentsService(s)
   156  	rs.Operations = NewProjectsLocationsOperationsService(s)
   157  	return rs
   158  }
   159  
   160  type ProjectsLocationsService struct {
   161  	s *Service
   162  
   163  	GameServerDeployments *ProjectsLocationsGameServerDeploymentsService
   164  
   165  	Operations *ProjectsLocationsOperationsService
   166  }
   167  
   168  func NewProjectsLocationsGameServerDeploymentsService(s *Service) *ProjectsLocationsGameServerDeploymentsService {
   169  	rs := &ProjectsLocationsGameServerDeploymentsService{s: s}
   170  	return rs
   171  }
   172  
   173  type ProjectsLocationsGameServerDeploymentsService struct {
   174  	s *Service
   175  }
   176  
   177  func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
   178  	rs := &ProjectsLocationsOperationsService{s: s}
   179  	return rs
   180  }
   181  
   182  type ProjectsLocationsOperationsService struct {
   183  	s *Service
   184  }
   185  
   186  // AuditConfig: Specifies the audit configuration for a service. The
   187  // configuration determines which permission types are logged, and what
   188  // identities, if any, are exempted from logging. An AuditConfig must
   189  // have one or more AuditLogConfigs. If there are AuditConfigs for both
   190  // `allServices` and a specific service, the union of the two
   191  // AuditConfigs is used for that service: the log_types specified in
   192  // each AuditConfig are enabled, and the exempted_members in each
   193  // AuditLogConfig are exempted. Example Policy with multiple
   194  // AuditConfigs: { "audit_configs": [ { "service": "allServices",
   195  // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members":
   196  // [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, {
   197  // "log_type": "ADMIN_READ" } ] }, { "service":
   198  // "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type":
   199  // "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [
   200  // "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy
   201  // enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts
   202  // `jose@example.com` from DATA_READ logging, and `aliya@example.com`
   203  // from DATA_WRITE logging.
   204  type AuditConfig struct {
   205  	// AuditLogConfigs: The configuration for logging of each type of
   206  	// permission.
   207  	AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
   208  
   209  	// Service: Specifies a service that will be enabled for audit logging.
   210  	// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
   211  	// `allServices` is a special value that covers all services.
   212  	Service string `json:"service,omitempty"`
   213  
   214  	// ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
   215  	// unconditionally include in API requests. By default, fields with
   216  	// empty or default values are omitted from API requests. However, any
   217  	// non-pointer, non-interface field appearing in ForceSendFields will be
   218  	// sent to the server regardless of whether the field is empty or not.
   219  	// This may be used to include empty fields in Patch requests.
   220  	ForceSendFields []string `json:"-"`
   221  
   222  	// NullFields is a list of field names (e.g. "AuditLogConfigs") to
   223  	// include in API requests with the JSON null value. By default, fields
   224  	// with empty values are omitted from API requests. However, any field
   225  	// with an empty value appearing in NullFields will be sent to the
   226  	// server as null. It is an error if a field in this list has a
   227  	// non-empty value. This may be used to include null fields in Patch
   228  	// requests.
   229  	NullFields []string `json:"-"`
   230  }
   231  
   232  func (s *AuditConfig) MarshalJSON() ([]byte, error) {
   233  	type NoMethod AuditConfig
   234  	raw := NoMethod(*s)
   235  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   236  }
   237  
   238  // AuditLogConfig: Provides the configuration for logging a type of
   239  // permissions. Example: { "audit_log_configs": [ { "log_type":
   240  // "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, {
   241  // "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and
   242  // 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ
   243  // logging.
   244  type AuditLogConfig struct {
   245  	// ExemptedMembers: Specifies the identities that do not cause logging
   246  	// for this type of permission. Follows the same format of
   247  	// Binding.members.
   248  	ExemptedMembers []string `json:"exemptedMembers,omitempty"`
   249  
   250  	IgnoreChildExemptions bool `json:"ignoreChildExemptions,omitempty"`
   251  
   252  	// LogType: The log type that this config enables.
   253  	//
   254  	// Possible values:
   255  	//   "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
   256  	//   "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
   257  	//   "DATA_WRITE" - Data writes. Example: CloudSQL Users create
   258  	//   "DATA_READ" - Data reads. Example: CloudSQL Users list
   259  	LogType string `json:"logType,omitempty"`
   260  
   261  	// ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
   262  	// unconditionally include in API requests. By default, fields with
   263  	// empty or default values are omitted from API requests. However, any
   264  	// non-pointer, non-interface field appearing in ForceSendFields will be
   265  	// sent to the server regardless of whether the field is empty or not.
   266  	// This may be used to include empty fields in Patch requests.
   267  	ForceSendFields []string `json:"-"`
   268  
   269  	// NullFields is a list of field names (e.g. "ExemptedMembers") to
   270  	// include in API requests with the JSON null value. By default, fields
   271  	// with empty values are omitted from API requests. However, any field
   272  	// with an empty value appearing in NullFields will be sent to the
   273  	// server as null. It is an error if a field in this list has a
   274  	// non-empty value. This may be used to include null fields in Patch
   275  	// requests.
   276  	NullFields []string `json:"-"`
   277  }
   278  
   279  func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
   280  	type NoMethod AuditLogConfig
   281  	raw := NoMethod(*s)
   282  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   283  }
   284  
   285  // AuthorizationLoggingOptions: Authorization-related information used
   286  // by Cloud Audit Logging.
   287  type AuthorizationLoggingOptions struct {
   288  	// PermissionType: The type of the permission that was checked.
   289  	//
   290  	// Possible values:
   291  	//   "PERMISSION_TYPE_UNSPECIFIED" - Default. Should not be used.
   292  	//   "ADMIN_READ" - A read of admin (meta) data.
   293  	//   "ADMIN_WRITE" - A write of admin (meta) data.
   294  	//   "DATA_READ" - A read of standard data.
   295  	//   "DATA_WRITE" - A write of standard data.
   296  	PermissionType string `json:"permissionType,omitempty"`
   297  
   298  	// ForceSendFields is a list of field names (e.g. "PermissionType") to
   299  	// unconditionally include in API requests. By default, fields with
   300  	// empty or default values are omitted from API requests. However, any
   301  	// non-pointer, non-interface field appearing in ForceSendFields will be
   302  	// sent to the server regardless of whether the field is empty or not.
   303  	// This may be used to include empty fields in Patch requests.
   304  	ForceSendFields []string `json:"-"`
   305  
   306  	// NullFields is a list of field names (e.g. "PermissionType") to
   307  	// include in API requests with the JSON null value. By default, fields
   308  	// with empty values are omitted from API requests. However, any field
   309  	// with an empty value appearing in NullFields will be sent to the
   310  	// server as null. It is an error if a field in this list has a
   311  	// non-empty value. This may be used to include null fields in Patch
   312  	// requests.
   313  	NullFields []string `json:"-"`
   314  }
   315  
   316  func (s *AuthorizationLoggingOptions) MarshalJSON() ([]byte, error) {
   317  	type NoMethod AuthorizationLoggingOptions
   318  	raw := NoMethod(*s)
   319  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   320  }
   321  
   322  // Binding: Associates `members`, or principals, with a `role`.
   323  type Binding struct {
   324  	BindingId string `json:"bindingId,omitempty"`
   325  
   326  	// Condition: The condition that is associated with this binding. If the
   327  	// condition evaluates to `true`, then this binding applies to the
   328  	// current request. If the condition evaluates to `false`, then this
   329  	// binding does not apply to the current request. However, a different
   330  	// role binding might grant the same role to one or more of the
   331  	// principals in this binding. To learn which resources support
   332  	// conditions in their IAM policies, see the IAM documentation
   333  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   334  	Condition *Expr `json:"condition,omitempty"`
   335  
   336  	// Members: Specifies the principals requesting access for a Google
   337  	// Cloud resource. `members` can have the following values: *
   338  	// `allUsers`: A special identifier that represents anyone who is on the
   339  	// internet; with or without a Google account. *
   340  	// `allAuthenticatedUsers`: A special identifier that represents anyone
   341  	// who is authenticated with a Google account or a service account. Does
   342  	// not include identities that come from external identity providers
   343  	// (IdPs) through identity federation. * `user:{emailid}`: An email
   344  	// address that represents a specific Google account. For example,
   345  	// `alice@example.com` . * `serviceAccount:{emailid}`: An email address
   346  	// that represents a Google service account. For example,
   347  	// `my-other-app@appspot.gserviceaccount.com`. *
   348  	// `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`:
   349  	//  An identifier for a Kubernetes service account
   350  	// (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
   351  	// For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`.
   352  	// * `group:{emailid}`: An email address that represents a Google group.
   353  	// For example, `admins@example.com`. * `domain:{domain}`: The G Suite
   354  	// domain (primary) that represents all the users of that domain. For
   355  	// example, `google.com` or `example.com`. *
   356  	// `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
   357  	// unique identifier) representing a user that has been recently
   358  	// deleted. For example, `alice@example.com?uid=123456789012345678901`.
   359  	// If the user is recovered, this value reverts to `user:{emailid}` and
   360  	// the recovered user retains the role in the binding. *
   361  	// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address
   362  	// (plus unique identifier) representing a service account that has been
   363  	// recently deleted. For example,
   364  	// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
   365  	// If the service account is undeleted, this value reverts to
   366  	// `serviceAccount:{emailid}` and the undeleted service account retains
   367  	// the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`:
   368  	// An email address (plus unique identifier) representing a Google group
   369  	// that has been recently deleted. For example,
   370  	// `admins@example.com?uid=123456789012345678901`. If the group is
   371  	// recovered, this value reverts to `group:{emailid}` and the recovered
   372  	// group retains the role in the binding.
   373  	Members []string `json:"members,omitempty"`
   374  
   375  	// Role: Role that is assigned to the list of `members`, or principals.
   376  	// For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
   377  	Role string `json:"role,omitempty"`
   378  
   379  	// ForceSendFields is a list of field names (e.g. "BindingId") to
   380  	// unconditionally include in API requests. By default, fields with
   381  	// empty or default values are omitted from API requests. However, any
   382  	// non-pointer, non-interface field appearing in ForceSendFields will be
   383  	// sent to the server regardless of whether the field is empty or not.
   384  	// This may be used to include empty fields in Patch requests.
   385  	ForceSendFields []string `json:"-"`
   386  
   387  	// NullFields is a list of field names (e.g. "BindingId") to include in
   388  	// API requests with the JSON null value. By default, fields with empty
   389  	// values are omitted from API requests. However, any field with an
   390  	// empty value appearing in NullFields will be sent to the server as
   391  	// null. It is an error if a field in this list has a non-empty value.
   392  	// This may be used to include null fields in Patch requests.
   393  	NullFields []string `json:"-"`
   394  }
   395  
   396  func (s *Binding) MarshalJSON() ([]byte, error) {
   397  	type NoMethod Binding
   398  	raw := NoMethod(*s)
   399  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   400  }
   401  
   402  // CancelOperationRequest: The request message for
   403  // Operations.CancelOperation.
   404  type CancelOperationRequest struct {
   405  }
   406  
   407  // CloudAuditOptions: Write a Cloud Audit log
   408  type CloudAuditOptions struct {
   409  	// AuthorizationLoggingOptions: Information used by the Cloud Audit
   410  	// Logging pipeline.
   411  	AuthorizationLoggingOptions *AuthorizationLoggingOptions `json:"authorizationLoggingOptions,omitempty"`
   412  
   413  	// LogName: The log_name to populate in the Cloud Audit Record.
   414  	//
   415  	// Possible values:
   416  	//   "UNSPECIFIED_LOG_NAME" - Default. Should not be used.
   417  	//   "ADMIN_ACTIVITY" - Corresponds to
   418  	// "cloudaudit.googleapis.com/activity"
   419  	//   "DATA_ACCESS" - Corresponds to
   420  	// "cloudaudit.googleapis.com/data_access"
   421  	LogName string `json:"logName,omitempty"`
   422  
   423  	// ForceSendFields is a list of field names (e.g.
   424  	// "AuthorizationLoggingOptions") to unconditionally include in API
   425  	// requests. By default, fields with empty or default values are omitted
   426  	// from API requests. However, any non-pointer, non-interface field
   427  	// appearing in ForceSendFields will be sent to the server regardless of
   428  	// whether the field is empty or not. This may be used to include empty
   429  	// fields in Patch requests.
   430  	ForceSendFields []string `json:"-"`
   431  
   432  	// NullFields is a list of field names (e.g.
   433  	// "AuthorizationLoggingOptions") to include in API requests with the
   434  	// JSON null value. By default, fields with empty values are omitted
   435  	// from API requests. However, any field with an empty value appearing
   436  	// in NullFields will be sent to the server as null. It is an error if a
   437  	// field in this list has a non-empty value. This may be used to include
   438  	// null fields in Patch requests.
   439  	NullFields []string `json:"-"`
   440  }
   441  
   442  func (s *CloudAuditOptions) MarshalJSON() ([]byte, error) {
   443  	type NoMethod CloudAuditOptions
   444  	raw := NoMethod(*s)
   445  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   446  }
   447  
   448  // Condition: A condition to be met.
   449  type Condition struct {
   450  	// Iam: Trusted attributes supplied by the IAM system.
   451  	//
   452  	// Possible values:
   453  	//   "NO_ATTR" - Default non-attribute.
   454  	//   "AUTHORITY" - Either principal or (if present) authority selector.
   455  	//   "ATTRIBUTION" - The principal (even if an authority selector is
   456  	// present), which must only be used for attribution, not authorization.
   457  	//   "SECURITY_REALM" - Any of the security realms in the IAMContext
   458  	// (go/security-realms). When used with IN, the condition indicates "any
   459  	// of the request's realms match one of the given values; with NOT_IN,
   460  	// "none of the realms match any of the given values". Note that a value
   461  	// can be: - 'self:campus' (i.e., clients that are in the same campus) -
   462  	// 'self:metro' (i.e., clients that are in the same metro) -
   463  	// 'self:cloud-region' (i.e., allow connections from clients that are in
   464  	// the same cloud region) - 'self:prod-region' (i.e., allow connections
   465  	// from clients that are in the same prod region) - 'guardians' (i.e.,
   466  	// allow connections from its guardian realms. See
   467  	// go/security-realms-glossary#guardian for more information.) - 'self'
   468  	// [DEPRECATED] (i.e., allow connections from clients that are in the
   469  	// same security realm, which is currently but not guaranteed to be
   470  	// campus-sized) - a realm (e.g., 'campus-abc') - a realm group (e.g.,
   471  	// 'realms-for-borg-cell-xx', see: go/realm-groups) A match is
   472  	// determined by a realm group membership check performed by a
   473  	// RealmAclRep object (go/realm-acl-howto). It is not permitted to grant
   474  	// access based on the *absence* of a realm, so realm conditions can
   475  	// only be used in a "positive" context (e.g., ALLOW/IN or DENY/NOT_IN).
   476  	//   "APPROVER" - An approver (distinct from the requester) that has
   477  	// authorized this request. When used with IN, the condition indicates
   478  	// that one of the approvers associated with the request matches the
   479  	// specified principal, or is a member of the specified group. Approvers
   480  	// can only grant additional access, and are thus only used in a
   481  	// strictly positive context (e.g. ALLOW/IN or DENY/NOT_IN).
   482  	//   "JUSTIFICATION_TYPE" - What types of justifications have been
   483  	// supplied with this request. String values should match enum names
   484  	// from security.credentials.JustificationType, e.g. "MANUAL_STRING". It
   485  	// is not permitted to grant access based on the *absence* of a
   486  	// justification, so justification conditions can only be used in a
   487  	// "positive" context (e.g., ALLOW/IN or DENY/NOT_IN). Multiple
   488  	// justifications, e.g., a Buganizer ID and a manually-entered reason,
   489  	// are normal and supported.
   490  	//   "CREDENTIALS_TYPE" - What type of credentials have been supplied
   491  	// with this request. String values should match enum names from
   492  	// security_loas_l2.CredentialsType - currently, only
   493  	// CREDS_TYPE_EMERGENCY is supported. It is not permitted to grant
   494  	// access based on the *absence* of a credentials type, so the
   495  	// conditions can only be used in a "positive" context (e.g., ALLOW/IN
   496  	// or DENY/NOT_IN).
   497  	//   "CREDS_ASSERTION" - EXPERIMENTAL -- DO NOT USE. The conditions can
   498  	// only be used in a "positive" context (e.g., ALLOW/IN or DENY/NOT_IN).
   499  	Iam string `json:"iam,omitempty"`
   500  
   501  	// Op: An operator to apply the subject with.
   502  	//
   503  	// Possible values:
   504  	//   "NO_OP" - Default no-op.
   505  	//   "EQUALS" - DEPRECATED. Use IN instead.
   506  	//   "NOT_EQUALS" - DEPRECATED. Use NOT_IN instead.
   507  	//   "IN" - The condition is true if the subject (or any element of it
   508  	// if it is a set) matches any of the supplied values.
   509  	//   "NOT_IN" - The condition is true if the subject (or every element
   510  	// of it if it is a set) matches none of the supplied values.
   511  	//   "DISCHARGED" - Subject is discharged
   512  	Op string `json:"op,omitempty"`
   513  
   514  	// Svc: Trusted attributes discharged by the service.
   515  	Svc string `json:"svc,omitempty"`
   516  
   517  	// Sys: Trusted attributes supplied by any service that owns resources
   518  	// and uses the IAM system for access control.
   519  	//
   520  	// Possible values:
   521  	//   "NO_ATTR" - Default non-attribute type
   522  	//   "REGION" - Region of the resource
   523  	//   "SERVICE" - Service name
   524  	//   "NAME" - Resource name
   525  	//   "IP" - IP address of the caller
   526  	Sys string `json:"sys,omitempty"`
   527  
   528  	// Values: The objects of the condition.
   529  	Values []string `json:"values,omitempty"`
   530  
   531  	// ForceSendFields is a list of field names (e.g. "Iam") to
   532  	// unconditionally include in API requests. By default, fields with
   533  	// empty or default values are omitted from API requests. However, any
   534  	// non-pointer, non-interface field appearing in ForceSendFields will be
   535  	// sent to the server regardless of whether the field is empty or not.
   536  	// This may be used to include empty fields in Patch requests.
   537  	ForceSendFields []string `json:"-"`
   538  
   539  	// NullFields is a list of field names (e.g. "Iam") to include in API
   540  	// requests with the JSON null value. By default, fields with empty
   541  	// values are omitted from API requests. However, any field with an
   542  	// empty value appearing in NullFields will be sent to the server as
   543  	// null. It is an error if a field in this list has a non-empty value.
   544  	// This may be used to include null fields in Patch requests.
   545  	NullFields []string `json:"-"`
   546  }
   547  
   548  func (s *Condition) MarshalJSON() ([]byte, error) {
   549  	type NoMethod Condition
   550  	raw := NoMethod(*s)
   551  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   552  }
   553  
   554  // CounterOptions: Increment a streamz counter with the specified metric
   555  // and field names. Metric names should start with a '/', generally be
   556  // lowercase-only, and end in "_count". Field names should not contain
   557  // an initial slash. The actual exported metric names will have
   558  // "/iam/policy" prepended. Field names correspond to IAM request
   559  // parameters and field values are their respective values. Supported
   560  // field names: - "authority", which is "[token]" if IAMContext.token is
   561  // present, otherwise the value of IAMContext.authority_selector if
   562  // present, and otherwise a representation of IAMContext.principal; or -
   563  // "iam_principal", a representation of IAMContext.principal even if a
   564  // token or authority selector is present; or - "" (empty string),
   565  // resulting in a counter with no fields. Examples: counter { metric:
   566  // "/debug_access_count" field: "iam_principal" } ==> increment counter
   567  // /iam/policy/debug_access_count {iam_principal=[value of
   568  // IAMContext.principal]}
   569  type CounterOptions struct {
   570  	// CustomFields: Custom fields.
   571  	CustomFields []*CustomField `json:"customFields,omitempty"`
   572  
   573  	// Field: The field value to attribute.
   574  	Field string `json:"field,omitempty"`
   575  
   576  	// Metric: The metric to update.
   577  	Metric string `json:"metric,omitempty"`
   578  
   579  	// ForceSendFields is a list of field names (e.g. "CustomFields") to
   580  	// unconditionally include in API requests. By default, fields with
   581  	// empty or default values are omitted from API requests. However, any
   582  	// non-pointer, non-interface field appearing in ForceSendFields will be
   583  	// sent to the server regardless of whether the field is empty or not.
   584  	// This may be used to include empty fields in Patch requests.
   585  	ForceSendFields []string `json:"-"`
   586  
   587  	// NullFields is a list of field names (e.g. "CustomFields") to include
   588  	// in API requests with the JSON null value. By default, fields with
   589  	// empty values are omitted from API requests. However, any field with
   590  	// an empty value appearing in NullFields will be sent to the server as
   591  	// null. It is an error if a field in this list has a non-empty value.
   592  	// This may be used to include null fields in Patch requests.
   593  	NullFields []string `json:"-"`
   594  }
   595  
   596  func (s *CounterOptions) MarshalJSON() ([]byte, error) {
   597  	type NoMethod CounterOptions
   598  	raw := NoMethod(*s)
   599  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   600  }
   601  
   602  // CustomField: Custom fields. These can be used to create a counter
   603  // with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
   604  type CustomField struct {
   605  	// Name: Name is the field name.
   606  	Name string `json:"name,omitempty"`
   607  
   608  	// Value: Value is the field value. It is important that in contrast to
   609  	// the CounterOptions.field, the value here is a constant that is not
   610  	// derived from the IAMContext.
   611  	Value string `json:"value,omitempty"`
   612  
   613  	// ForceSendFields is a list of field names (e.g. "Name") to
   614  	// unconditionally include in API requests. By default, fields with
   615  	// empty or default values are omitted from API requests. However, any
   616  	// non-pointer, non-interface field appearing in ForceSendFields will be
   617  	// sent to the server regardless of whether the field is empty or not.
   618  	// This may be used to include empty fields in Patch requests.
   619  	ForceSendFields []string `json:"-"`
   620  
   621  	// NullFields is a list of field names (e.g. "Name") to include in API
   622  	// requests with the JSON null value. By default, fields with empty
   623  	// values are omitted from API requests. However, any field with an
   624  	// empty value appearing in NullFields will be sent to the server as
   625  	// null. It is an error if a field in this list has a non-empty value.
   626  	// This may be used to include null fields in Patch requests.
   627  	NullFields []string `json:"-"`
   628  }
   629  
   630  func (s *CustomField) MarshalJSON() ([]byte, error) {
   631  	type NoMethod CustomField
   632  	raw := NoMethod(*s)
   633  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   634  }
   635  
   636  // DataAccessOptions: Write a Data Access (Gin) log
   637  type DataAccessOptions struct {
   638  	// Possible values:
   639  	//   "LOG_MODE_UNSPECIFIED" - Client is not required to write a partial
   640  	// Gin log immediately after the authorization check. If client chooses
   641  	// to write one and it fails, client may either fail open (allow the
   642  	// operation to continue) or fail closed (handle as a DENY outcome).
   643  	//   "LOG_FAIL_CLOSED" - The application's operation in the context of
   644  	// which this authorization check is being made may only be performed if
   645  	// it is successfully logged to Gin. For instance, the authorization
   646  	// library may satisfy this obligation by emitting a partial log entry
   647  	// at authorization check time and only returning ALLOW to the
   648  	// application if it succeeds. If a matching Rule has this directive,
   649  	// but the client has not indicated that it will honor such
   650  	// requirements, then the IAM check will result in authorization failure
   651  	// by setting CheckPolicyResponse.success=false.
   652  	LogMode string `json:"logMode,omitempty"`
   653  
   654  	// ForceSendFields is a list of field names (e.g. "LogMode") to
   655  	// unconditionally include in API requests. By default, fields with
   656  	// empty or default values are omitted from API requests. However, any
   657  	// non-pointer, non-interface field appearing in ForceSendFields will be
   658  	// sent to the server regardless of whether the field is empty or not.
   659  	// This may be used to include empty fields in Patch requests.
   660  	ForceSendFields []string `json:"-"`
   661  
   662  	// NullFields is a list of field names (e.g. "LogMode") to include in
   663  	// API requests with the JSON null value. By default, fields with empty
   664  	// values are omitted from API requests. However, any field with an
   665  	// empty value appearing in NullFields will be sent to the server as
   666  	// null. It is an error if a field in this list has a non-empty value.
   667  	// This may be used to include null fields in Patch requests.
   668  	NullFields []string `json:"-"`
   669  }
   670  
   671  func (s *DataAccessOptions) MarshalJSON() ([]byte, error) {
   672  	type NoMethod DataAccessOptions
   673  	raw := NoMethod(*s)
   674  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   675  }
   676  
   677  // Empty: A generic empty message that you can re-use to avoid defining
   678  // duplicated empty messages in your APIs. A typical example is to use
   679  // it as the request or the response type of an API method. For
   680  // instance: service Foo { rpc Bar(google.protobuf.Empty) returns
   681  // (google.protobuf.Empty); }
   682  type Empty struct {
   683  	// ServerResponse contains the HTTP response code and headers from the
   684  	// server.
   685  	googleapi.ServerResponse `json:"-"`
   686  }
   687  
   688  // Expr: Represents a textual expression in the Common Expression
   689  // Language (CEL) syntax. CEL is a C-like expression language. The
   690  // syntax and semantics of CEL are documented at
   691  // https://github.com/google/cel-spec. Example (Comparison): title:
   692  // "Summary size limit" description: "Determines if a summary is less
   693  // than 100 chars" expression: "document.summary.size() < 100" Example
   694  // (Equality): title: "Requestor is owner" description: "Determines if
   695  // requestor is the document owner" expression: "document.owner ==
   696  // request.auth.claims.email" Example (Logic): title: "Public documents"
   697  // description: "Determine whether the document should be publicly
   698  // visible" expression: "document.type != 'private' && document.type !=
   699  // 'internal'" Example (Data Manipulation): title: "Notification string"
   700  // description: "Create a notification string with a timestamp."
   701  // expression: "'New message received at ' +
   702  // string(document.create_time)" The exact variables and functions that
   703  // may be referenced within an expression are determined by the service
   704  // that evaluates it. See the service documentation for additional
   705  // information.
   706  type Expr struct {
   707  	// Description: Optional. Description of the expression. This is a
   708  	// longer text which describes the expression, e.g. when hovered over it
   709  	// in a UI.
   710  	Description string `json:"description,omitempty"`
   711  
   712  	// Expression: Textual representation of an expression in Common
   713  	// Expression Language syntax.
   714  	Expression string `json:"expression,omitempty"`
   715  
   716  	// Location: Optional. String indicating the location of the expression
   717  	// for error reporting, e.g. a file name and a position in the file.
   718  	Location string `json:"location,omitempty"`
   719  
   720  	// Title: Optional. Title for the expression, i.e. a short string
   721  	// describing its purpose. This can be used e.g. in UIs which allow to
   722  	// enter the expression.
   723  	Title string `json:"title,omitempty"`
   724  
   725  	// ForceSendFields is a list of field names (e.g. "Description") to
   726  	// unconditionally include in API requests. By default, fields with
   727  	// empty or default values are omitted from API requests. However, any
   728  	// non-pointer, non-interface field appearing in ForceSendFields will be
   729  	// sent to the server regardless of whether the field is empty or not.
   730  	// This may be used to include empty fields in Patch requests.
   731  	ForceSendFields []string `json:"-"`
   732  
   733  	// NullFields is a list of field names (e.g. "Description") to include
   734  	// in API requests with the JSON null value. By default, fields with
   735  	// empty values are omitted from API requests. However, any field with
   736  	// an empty value appearing in NullFields will be sent to the server as
   737  	// null. It is an error if a field in this list has a non-empty value.
   738  	// This may be used to include null fields in Patch requests.
   739  	NullFields []string `json:"-"`
   740  }
   741  
   742  func (s *Expr) MarshalJSON() ([]byte, error) {
   743  	type NoMethod Expr
   744  	raw := NoMethod(*s)
   745  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   746  }
   747  
   748  // ListLocationsResponse: The response message for
   749  // Locations.ListLocations.
   750  type ListLocationsResponse struct {
   751  	// Locations: A list of locations that matches the specified filter in
   752  	// the request.
   753  	Locations []*Location `json:"locations,omitempty"`
   754  
   755  	// NextPageToken: The standard List next-page token.
   756  	NextPageToken string `json:"nextPageToken,omitempty"`
   757  
   758  	// ServerResponse contains the HTTP response code and headers from the
   759  	// server.
   760  	googleapi.ServerResponse `json:"-"`
   761  
   762  	// ForceSendFields is a list of field names (e.g. "Locations") to
   763  	// unconditionally include in API requests. By default, fields with
   764  	// empty or default values are omitted from API requests. However, any
   765  	// non-pointer, non-interface field appearing in ForceSendFields will be
   766  	// sent to the server regardless of whether the field is empty or not.
   767  	// This may be used to include empty fields in Patch requests.
   768  	ForceSendFields []string `json:"-"`
   769  
   770  	// NullFields is a list of field names (e.g. "Locations") to include in
   771  	// API requests with the JSON null value. By default, fields with empty
   772  	// values are omitted from API requests. However, any field with an
   773  	// empty value appearing in NullFields will be sent to the server as
   774  	// null. It is an error if a field in this list has a non-empty value.
   775  	// This may be used to include null fields in Patch requests.
   776  	NullFields []string `json:"-"`
   777  }
   778  
   779  func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
   780  	type NoMethod ListLocationsResponse
   781  	raw := NoMethod(*s)
   782  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   783  }
   784  
   785  // ListOperationsResponse: The response message for
   786  // Operations.ListOperations.
   787  type ListOperationsResponse struct {
   788  	// NextPageToken: The standard List next-page token.
   789  	NextPageToken string `json:"nextPageToken,omitempty"`
   790  
   791  	// Operations: A list of operations that matches the specified filter in
   792  	// the request.
   793  	Operations []*Operation `json:"operations,omitempty"`
   794  
   795  	// ServerResponse contains the HTTP response code and headers from the
   796  	// server.
   797  	googleapi.ServerResponse `json:"-"`
   798  
   799  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   800  	// unconditionally include in API requests. By default, fields with
   801  	// empty or default values are omitted from API requests. However, any
   802  	// non-pointer, non-interface field appearing in ForceSendFields will be
   803  	// sent to the server regardless of whether the field is empty or not.
   804  	// This may be used to include empty fields in Patch requests.
   805  	ForceSendFields []string `json:"-"`
   806  
   807  	// NullFields is a list of field names (e.g. "NextPageToken") to include
   808  	// in API requests with the JSON null value. By default, fields with
   809  	// empty values are omitted from API requests. However, any field with
   810  	// an empty value appearing in NullFields will be sent to the server as
   811  	// null. It is an error if a field in this list has a non-empty value.
   812  	// This may be used to include null fields in Patch requests.
   813  	NullFields []string `json:"-"`
   814  }
   815  
   816  func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
   817  	type NoMethod ListOperationsResponse
   818  	raw := NoMethod(*s)
   819  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   820  }
   821  
   822  // Location: A resource that represents a Google Cloud location.
   823  type Location struct {
   824  	// DisplayName: The friendly name for this location, typically a nearby
   825  	// city name. For example, "Tokyo".
   826  	DisplayName string `json:"displayName,omitempty"`
   827  
   828  	// Labels: Cross-service attributes for the location. For example
   829  	// {"cloud.googleapis.com/region": "us-east1"}
   830  	Labels map[string]string `json:"labels,omitempty"`
   831  
   832  	// LocationId: The canonical id for this location. For example:
   833  	// "us-east1".
   834  	LocationId string `json:"locationId,omitempty"`
   835  
   836  	// Metadata: Service-specific metadata. For example the available
   837  	// capacity at the given location.
   838  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   839  
   840  	// Name: Resource name for the location, which may vary between
   841  	// implementations. For example:
   842  	// "projects/example-project/locations/us-east1"
   843  	Name string `json:"name,omitempty"`
   844  
   845  	// ServerResponse contains the HTTP response code and headers from the
   846  	// server.
   847  	googleapi.ServerResponse `json:"-"`
   848  
   849  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   850  	// unconditionally include in API requests. By default, fields with
   851  	// empty or default values are omitted from API requests. However, any
   852  	// non-pointer, non-interface field appearing in ForceSendFields will be
   853  	// sent to the server regardless of whether the field is empty or not.
   854  	// This may be used to include empty fields in Patch requests.
   855  	ForceSendFields []string `json:"-"`
   856  
   857  	// NullFields is a list of field names (e.g. "DisplayName") to include
   858  	// in API requests with the JSON null value. By default, fields with
   859  	// empty values are omitted from API requests. However, any field with
   860  	// an empty value appearing in NullFields will be sent to the server as
   861  	// null. It is an error if a field in this list has a non-empty value.
   862  	// This may be used to include null fields in Patch requests.
   863  	NullFields []string `json:"-"`
   864  }
   865  
   866  func (s *Location) MarshalJSON() ([]byte, error) {
   867  	type NoMethod Location
   868  	raw := NoMethod(*s)
   869  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   870  }
   871  
   872  // LogConfig: Specifies what kind of log the caller must write
   873  type LogConfig struct {
   874  	// CloudAudit: Cloud audit options.
   875  	CloudAudit *CloudAuditOptions `json:"cloudAudit,omitempty"`
   876  
   877  	// Counter: Counter options.
   878  	Counter *CounterOptions `json:"counter,omitempty"`
   879  
   880  	// DataAccess: Data access options.
   881  	DataAccess *DataAccessOptions `json:"dataAccess,omitempty"`
   882  
   883  	// ForceSendFields is a list of field names (e.g. "CloudAudit") to
   884  	// unconditionally include in API requests. By default, fields with
   885  	// empty or default values are omitted from API requests. However, any
   886  	// non-pointer, non-interface field appearing in ForceSendFields will be
   887  	// sent to the server regardless of whether the field is empty or not.
   888  	// This may be used to include empty fields in Patch requests.
   889  	ForceSendFields []string `json:"-"`
   890  
   891  	// NullFields is a list of field names (e.g. "CloudAudit") to include in
   892  	// API requests with the JSON null value. By default, fields with empty
   893  	// values are omitted from API requests. However, any field with an
   894  	// empty value appearing in NullFields will be sent to the server as
   895  	// null. It is an error if a field in this list has a non-empty value.
   896  	// This may be used to include null fields in Patch requests.
   897  	NullFields []string `json:"-"`
   898  }
   899  
   900  func (s *LogConfig) MarshalJSON() ([]byte, error) {
   901  	type NoMethod LogConfig
   902  	raw := NoMethod(*s)
   903  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   904  }
   905  
   906  // Operation: This resource represents a long-running operation that is
   907  // the result of a network API call.
   908  type Operation struct {
   909  	// Done: If the value is `false`, it means the operation is still in
   910  	// progress. If `true`, the operation is completed, and either `error`
   911  	// or `response` is available.
   912  	Done bool `json:"done,omitempty"`
   913  
   914  	// Error: The error result of the operation in case of failure or
   915  	// cancellation.
   916  	Error *Status `json:"error,omitempty"`
   917  
   918  	// Metadata: Service-specific metadata associated with the operation. It
   919  	// typically contains progress information and common metadata such as
   920  	// create time. Some services might not provide such metadata. Any
   921  	// method that returns a long-running operation should document the
   922  	// metadata type, if any.
   923  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   924  
   925  	// Name: The server-assigned name, which is only unique within the same
   926  	// service that originally returns it. If you use the default HTTP
   927  	// mapping, the `name` should be a resource name ending with
   928  	// `operations/{unique_id}`.
   929  	Name string `json:"name,omitempty"`
   930  
   931  	// Response: The normal response of the operation in case of success. If
   932  	// the original method returns no data on success, such as `Delete`, the
   933  	// response is `google.protobuf.Empty`. If the original method is
   934  	// standard `Get`/`Create`/`Update`, the response should be the
   935  	// resource. For other methods, the response should have the type
   936  	// `XxxResponse`, where `Xxx` is the original method name. For example,
   937  	// if the original method name is `TakeSnapshot()`, the inferred
   938  	// response type is `TakeSnapshotResponse`.
   939  	Response googleapi.RawMessage `json:"response,omitempty"`
   940  
   941  	// ServerResponse contains the HTTP response code and headers from the
   942  	// server.
   943  	googleapi.ServerResponse `json:"-"`
   944  
   945  	// ForceSendFields is a list of field names (e.g. "Done") to
   946  	// unconditionally include in API requests. By default, fields with
   947  	// empty or default values are omitted from API requests. However, any
   948  	// non-pointer, non-interface field appearing in ForceSendFields will be
   949  	// sent to the server regardless of whether the field is empty or not.
   950  	// This may be used to include empty fields in Patch requests.
   951  	ForceSendFields []string `json:"-"`
   952  
   953  	// NullFields is a list of field names (e.g. "Done") to include in API
   954  	// requests with the JSON null value. By default, fields with empty
   955  	// values are omitted from API requests. However, any field with an
   956  	// empty value appearing in NullFields will be sent to the server as
   957  	// null. It is an error if a field in this list has a non-empty value.
   958  	// This may be used to include null fields in Patch requests.
   959  	NullFields []string `json:"-"`
   960  }
   961  
   962  func (s *Operation) MarshalJSON() ([]byte, error) {
   963  	type NoMethod Operation
   964  	raw := NoMethod(*s)
   965  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   966  }
   967  
   968  // Policy: An Identity and Access Management (IAM) policy, which
   969  // specifies access controls for Google Cloud resources. A `Policy` is a
   970  // collection of `bindings`. A `binding` binds one or more `members`, or
   971  // principals, to a single `role`. Principals can be user accounts,
   972  // service accounts, Google groups, and domains (such as G Suite). A
   973  // `role` is a named list of permissions; each `role` can be an IAM
   974  // predefined role or a user-created custom role. For some types of
   975  // Google Cloud resources, a `binding` can also specify a `condition`,
   976  // which is a logical expression that allows access to a resource only
   977  // if the expression evaluates to `true`. A condition can add
   978  // constraints based on attributes of the request, the resource, or
   979  // both. To learn which resources support conditions in their IAM
   980  // policies, see the IAM documentation
   981  // (https://cloud.google.com/iam/help/conditions/resource-policies).
   982  // **JSON example:** { "bindings": [ { "role":
   983  // "roles/resourcemanager.organizationAdmin", "members": [
   984  // "user:mike@example.com", "group:admins@example.com",
   985  // "domain:google.com",
   986  // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, {
   987  // "role": "roles/resourcemanager.organizationViewer", "members": [
   988  // "user:eve@example.com" ], "condition": { "title": "expirable access",
   989  // "description": "Does not grant access after Sep 2020", "expression":
   990  // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ],
   991  // "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: -
   992  // members: - user:mike@example.com - group:admins@example.com -
   993  // domain:google.com -
   994  // serviceAccount:my-project-id@appspot.gserviceaccount.com role:
   995  // roles/resourcemanager.organizationAdmin - members: -
   996  // user:eve@example.com role: roles/resourcemanager.organizationViewer
   997  // condition: title: expirable access description: Does not grant access
   998  // after Sep 2020 expression: request.time <
   999  // timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3
  1000  // For a description of IAM and its features, see the IAM documentation
  1001  // (https://cloud.google.com/iam/docs/).
  1002  type Policy struct {
  1003  	// AuditConfigs: Specifies cloud audit logging configuration for this
  1004  	// policy.
  1005  	AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  1006  
  1007  	// Bindings: Associates a list of `members`, or principals, with a
  1008  	// `role`. Optionally, may specify a `condition` that determines how and
  1009  	// when the `bindings` are applied. Each of the `bindings` must contain
  1010  	// at least one principal. The `bindings` in a `Policy` can refer to up
  1011  	// to 1,500 principals; up to 250 of these principals can be Google
  1012  	// groups. Each occurrence of a principal counts towards these limits.
  1013  	// For example, if the `bindings` grant 50 different roles to
  1014  	// `user:alice@example.com`, and not to any other principal, then you
  1015  	// can add another 1,450 principals to the `bindings` in the `Policy`.
  1016  	Bindings []*Binding `json:"bindings,omitempty"`
  1017  
  1018  	// Etag: `etag` is used for optimistic concurrency control as a way to
  1019  	// help prevent simultaneous updates of a policy from overwriting each
  1020  	// other. It is strongly suggested that systems make use of the `etag`
  1021  	// in the read-modify-write cycle to perform policy updates in order to
  1022  	// avoid race conditions: An `etag` is returned in the response to
  1023  	// `getIamPolicy`, and systems are expected to put that etag in the
  1024  	// request to `setIamPolicy` to ensure that their change will be applied
  1025  	// to the same version of the policy. **Important:** If you use IAM
  1026  	// Conditions, you must include the `etag` field whenever you call
  1027  	// `setIamPolicy`. If you omit this field, then IAM allows you to
  1028  	// overwrite a version `3` policy with a version `1` policy, and all of
  1029  	// the conditions in the version `3` policy are lost.
  1030  	Etag string `json:"etag,omitempty"`
  1031  
  1032  	// Rules: If more than one rule is specified, the rules are applied in
  1033  	// the following manner: - All matching LOG rules are always applied. -
  1034  	// If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging
  1035  	// will be applied if one or more matching rule requires logging. -
  1036  	// Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
  1037  	// granted. Logging will be applied if one or more matching rule
  1038  	// requires logging. - Otherwise, if no rule applies, permission is
  1039  	// denied.
  1040  	Rules []*Rule `json:"rules,omitempty"`
  1041  
  1042  	// Version: Specifies the format of the policy. Valid values are `0`,
  1043  	// `1`, and `3`. Requests that specify an invalid value are rejected.
  1044  	// Any operation that affects conditional role bindings must specify
  1045  	// version `3`. This requirement applies to the following operations: *
  1046  	// Getting a policy that includes a conditional role binding * Adding a
  1047  	// conditional role binding to a policy * Changing a conditional role
  1048  	// binding in a policy * Removing any role binding, with or without a
  1049  	// condition, from a policy that includes conditions **Important:** If
  1050  	// you use IAM Conditions, you must include the `etag` field whenever
  1051  	// you call `setIamPolicy`. If you omit this field, then IAM allows you
  1052  	// to overwrite a version `3` policy with a version `1` policy, and all
  1053  	// of the conditions in the version `3` policy are lost. If a policy
  1054  	// does not include any conditions, operations on that policy may
  1055  	// specify any valid version or leave the field unset. To learn which
  1056  	// resources support conditions in their IAM policies, see the IAM
  1057  	// documentation
  1058  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
  1059  	Version int64 `json:"version,omitempty"`
  1060  
  1061  	// ServerResponse contains the HTTP response code and headers from the
  1062  	// server.
  1063  	googleapi.ServerResponse `json:"-"`
  1064  
  1065  	// ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  1066  	// unconditionally include in API requests. By default, fields with
  1067  	// empty or default values are omitted from API requests. However, any
  1068  	// non-pointer, non-interface field appearing in ForceSendFields will be
  1069  	// sent to the server regardless of whether the field is empty or not.
  1070  	// This may be used to include empty fields in Patch requests.
  1071  	ForceSendFields []string `json:"-"`
  1072  
  1073  	// NullFields is a list of field names (e.g. "AuditConfigs") to include
  1074  	// in API requests with the JSON null value. By default, fields with
  1075  	// empty values are omitted from API requests. However, any field with
  1076  	// an empty value appearing in NullFields will be sent to the server as
  1077  	// null. It is an error if a field in this list has a non-empty value.
  1078  	// This may be used to include null fields in Patch requests.
  1079  	NullFields []string `json:"-"`
  1080  }
  1081  
  1082  func (s *Policy) MarshalJSON() ([]byte, error) {
  1083  	type NoMethod Policy
  1084  	raw := NoMethod(*s)
  1085  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1086  }
  1087  
  1088  // Rule: A rule to be applied in a Policy.
  1089  type Rule struct {
  1090  	// Action: Required
  1091  	//
  1092  	// Possible values:
  1093  	//   "NO_ACTION" - Default no action.
  1094  	//   "ALLOW" - Matching 'Entries' grant access.
  1095  	//   "ALLOW_WITH_LOG" - Matching 'Entries' grant access and the caller
  1096  	// promises to log the request per the returned log_configs.
  1097  	//   "DENY" - Matching 'Entries' deny access.
  1098  	//   "DENY_WITH_LOG" - Matching 'Entries' deny access and the caller
  1099  	// promises to log the request per the returned log_configs.
  1100  	//   "LOG" - Matching 'Entries' tell IAM.Check callers to generate logs.
  1101  	Action string `json:"action,omitempty"`
  1102  
  1103  	// Conditions: Additional restrictions that must be met. All conditions
  1104  	// must pass for the rule to match.
  1105  	Conditions []*Condition `json:"conditions,omitempty"`
  1106  
  1107  	// Description: Human-readable description of the rule.
  1108  	Description string `json:"description,omitempty"`
  1109  
  1110  	// In: If one or more 'in' clauses are specified, the rule matches if
  1111  	// the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
  1112  	In []string `json:"in,omitempty"`
  1113  
  1114  	// LogConfig: The config returned to callers of CheckPolicy for any
  1115  	// entries that match the LOG action.
  1116  	LogConfig []*LogConfig `json:"logConfig,omitempty"`
  1117  
  1118  	// NotIn: If one or more 'not_in' clauses are specified, the rule
  1119  	// matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the
  1120  	// entries. The format for in and not_in entries can be found at in the
  1121  	// Local IAM documentation (see go/local-iam#features).
  1122  	NotIn []string `json:"notIn,omitempty"`
  1123  
  1124  	// Permissions: A permission is a string of form '..' (e.g.,
  1125  	// 'storage.buckets.list'). A value of '*' matches all permissions, and
  1126  	// a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
  1127  	Permissions []string `json:"permissions,omitempty"`
  1128  
  1129  	// ForceSendFields is a list of field names (e.g. "Action") to
  1130  	// unconditionally include in API requests. By default, fields with
  1131  	// empty or default values are omitted from API requests. However, any
  1132  	// non-pointer, non-interface field appearing in ForceSendFields will be
  1133  	// sent to the server regardless of whether the field is empty or not.
  1134  	// This may be used to include empty fields in Patch requests.
  1135  	ForceSendFields []string `json:"-"`
  1136  
  1137  	// NullFields is a list of field names (e.g. "Action") to include in API
  1138  	// requests with the JSON null value. By default, fields with empty
  1139  	// values are omitted from API requests. However, any field with an
  1140  	// empty value appearing in NullFields will be sent to the server as
  1141  	// null. It is an error if a field in this list has a non-empty value.
  1142  	// This may be used to include null fields in Patch requests.
  1143  	NullFields []string `json:"-"`
  1144  }
  1145  
  1146  func (s *Rule) MarshalJSON() ([]byte, error) {
  1147  	type NoMethod Rule
  1148  	raw := NoMethod(*s)
  1149  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1150  }
  1151  
  1152  // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
  1153  type SetIamPolicyRequest struct {
  1154  	// Policy: REQUIRED: The complete policy to be applied to the
  1155  	// `resource`. The size of the policy is limited to a few 10s of KB. An
  1156  	// empty policy is a valid policy but certain Google Cloud services
  1157  	// (such as Projects) might reject them.
  1158  	Policy *Policy `json:"policy,omitempty"`
  1159  
  1160  	// UpdateMask: OPTIONAL: A FieldMask specifying which fields of the
  1161  	// policy to modify. Only the fields in the mask will be modified. If no
  1162  	// mask is provided, the following default mask is used: `paths:
  1163  	// "bindings, etag"
  1164  	UpdateMask string `json:"updateMask,omitempty"`
  1165  
  1166  	// ForceSendFields is a list of field names (e.g. "Policy") to
  1167  	// unconditionally include in API requests. By default, fields with
  1168  	// empty or default values are omitted from API requests. However, any
  1169  	// non-pointer, non-interface field appearing in ForceSendFields will be
  1170  	// sent to the server regardless of whether the field is empty or not.
  1171  	// This may be used to include empty fields in Patch requests.
  1172  	ForceSendFields []string `json:"-"`
  1173  
  1174  	// NullFields is a list of field names (e.g. "Policy") to include in API
  1175  	// requests with the JSON null value. By default, fields with empty
  1176  	// values are omitted from API requests. However, any field with an
  1177  	// empty value appearing in NullFields will be sent to the server as
  1178  	// null. It is an error if a field in this list has a non-empty value.
  1179  	// This may be used to include null fields in Patch requests.
  1180  	NullFields []string `json:"-"`
  1181  }
  1182  
  1183  func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  1184  	type NoMethod SetIamPolicyRequest
  1185  	raw := NoMethod(*s)
  1186  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1187  }
  1188  
  1189  // Status: The `Status` type defines a logical error model that is
  1190  // suitable for different programming environments, including REST APIs
  1191  // and RPC APIs. It is used by gRPC (https://github.com/grpc). Each
  1192  // `Status` message contains three pieces of data: error code, error
  1193  // message, and error details. You can find out more about this error
  1194  // model and how to work with it in the API Design Guide
  1195  // (https://cloud.google.com/apis/design/errors).
  1196  type Status struct {
  1197  	// Code: The status code, which should be an enum value of
  1198  	// google.rpc.Code.
  1199  	Code int64 `json:"code,omitempty"`
  1200  
  1201  	// Details: A list of messages that carry the error details. There is a
  1202  	// common set of message types for APIs to use.
  1203  	Details []googleapi.RawMessage `json:"details,omitempty"`
  1204  
  1205  	// Message: A developer-facing error message, which should be in
  1206  	// English. Any user-facing error message should be localized and sent
  1207  	// in the google.rpc.Status.details field, or localized by the client.
  1208  	Message string `json:"message,omitempty"`
  1209  
  1210  	// ForceSendFields is a list of field names (e.g. "Code") to
  1211  	// unconditionally include in API requests. By default, fields with
  1212  	// empty or default values are omitted from API requests. However, any
  1213  	// non-pointer, non-interface field appearing in ForceSendFields will be
  1214  	// sent to the server regardless of whether the field is empty or not.
  1215  	// This may be used to include empty fields in Patch requests.
  1216  	ForceSendFields []string `json:"-"`
  1217  
  1218  	// NullFields is a list of field names (e.g. "Code") to include in API
  1219  	// requests with the JSON null value. By default, fields with empty
  1220  	// values are omitted from API requests. However, any field with an
  1221  	// empty value appearing in NullFields will be sent to the server as
  1222  	// null. It is an error if a field in this list has a non-empty value.
  1223  	// This may be used to include null fields in Patch requests.
  1224  	NullFields []string `json:"-"`
  1225  }
  1226  
  1227  func (s *Status) MarshalJSON() ([]byte, error) {
  1228  	type NoMethod Status
  1229  	raw := NoMethod(*s)
  1230  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1231  }
  1232  
  1233  // TestIamPermissionsRequest: Request message for `TestIamPermissions`
  1234  // method.
  1235  type TestIamPermissionsRequest struct {
  1236  	// Permissions: The set of permissions to check for the `resource`.
  1237  	// Permissions with wildcards (such as `*` or `storage.*`) are not
  1238  	// allowed. For more information see IAM Overview
  1239  	// (https://cloud.google.com/iam/docs/overview#permissions).
  1240  	Permissions []string `json:"permissions,omitempty"`
  1241  
  1242  	// ForceSendFields is a list of field names (e.g. "Permissions") to
  1243  	// unconditionally include in API requests. By default, fields with
  1244  	// empty or default values are omitted from API requests. However, any
  1245  	// non-pointer, non-interface field appearing in ForceSendFields will be
  1246  	// sent to the server regardless of whether the field is empty or not.
  1247  	// This may be used to include empty fields in Patch requests.
  1248  	ForceSendFields []string `json:"-"`
  1249  
  1250  	// NullFields is a list of field names (e.g. "Permissions") to include
  1251  	// in API requests with the JSON null value. By default, fields with
  1252  	// empty values are omitted from API requests. However, any field with
  1253  	// an empty value appearing in NullFields will be sent to the server as
  1254  	// null. It is an error if a field in this list has a non-empty value.
  1255  	// This may be used to include null fields in Patch requests.
  1256  	NullFields []string `json:"-"`
  1257  }
  1258  
  1259  func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  1260  	type NoMethod TestIamPermissionsRequest
  1261  	raw := NoMethod(*s)
  1262  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1263  }
  1264  
  1265  // TestIamPermissionsResponse: Response message for `TestIamPermissions`
  1266  // method.
  1267  type TestIamPermissionsResponse struct {
  1268  	// Permissions: A subset of `TestPermissionsRequest.permissions` that
  1269  	// the caller is allowed.
  1270  	Permissions []string `json:"permissions,omitempty"`
  1271  
  1272  	// ServerResponse contains the HTTP response code and headers from the
  1273  	// server.
  1274  	googleapi.ServerResponse `json:"-"`
  1275  
  1276  	// ForceSendFields is a list of field names (e.g. "Permissions") to
  1277  	// unconditionally include in API requests. By default, fields with
  1278  	// empty or default values are omitted from API requests. However, any
  1279  	// non-pointer, non-interface field appearing in ForceSendFields will be
  1280  	// sent to the server regardless of whether the field is empty or not.
  1281  	// This may be used to include empty fields in Patch requests.
  1282  	ForceSendFields []string `json:"-"`
  1283  
  1284  	// NullFields is a list of field names (e.g. "Permissions") to include
  1285  	// in API requests with the JSON null value. By default, fields with
  1286  	// empty values are omitted from API requests. However, any field with
  1287  	// an empty value appearing in NullFields will be sent to the server as
  1288  	// null. It is an error if a field in this list has a non-empty value.
  1289  	// This may be used to include null fields in Patch requests.
  1290  	NullFields []string `json:"-"`
  1291  }
  1292  
  1293  func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  1294  	type NoMethod TestIamPermissionsResponse
  1295  	raw := NoMethod(*s)
  1296  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1297  }
  1298  
  1299  // method id "gameservices.projects.locations.get":
  1300  
  1301  type ProjectsLocationsGetCall struct {
  1302  	s            *Service
  1303  	name         string
  1304  	urlParams_   gensupport.URLParams
  1305  	ifNoneMatch_ string
  1306  	ctx_         context.Context
  1307  	header_      http.Header
  1308  }
  1309  
  1310  // Get: Gets information about a location.
  1311  //
  1312  // - name: Resource name for the location.
  1313  func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
  1314  	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1315  	c.name = name
  1316  	return c
  1317  }
  1318  
  1319  // Fields allows partial responses to be retrieved. See
  1320  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1321  // for more information.
  1322  func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
  1323  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1324  	return c
  1325  }
  1326  
  1327  // IfNoneMatch sets the optional parameter which makes the operation
  1328  // fail if the object's ETag matches the given value. This is useful for
  1329  // getting updates only after the object has changed since the last
  1330  // request. Use googleapi.IsNotModified to check whether the response
  1331  // error from Do is the result of In-None-Match.
  1332  func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
  1333  	c.ifNoneMatch_ = entityTag
  1334  	return c
  1335  }
  1336  
  1337  // Context sets the context to be used in this call's Do method. Any
  1338  // pending HTTP request will be aborted if the provided context is
  1339  // canceled.
  1340  func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
  1341  	c.ctx_ = ctx
  1342  	return c
  1343  }
  1344  
  1345  // Header returns an http.Header that can be modified by the caller to
  1346  // add HTTP headers to the request.
  1347  func (c *ProjectsLocationsGetCall) Header() http.Header {
  1348  	if c.header_ == nil {
  1349  		c.header_ = make(http.Header)
  1350  	}
  1351  	return c.header_
  1352  }
  1353  
  1354  func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  1355  	reqHeaders := make(http.Header)
  1356  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
  1357  	for k, v := range c.header_ {
  1358  		reqHeaders[k] = v
  1359  	}
  1360  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1361  	if c.ifNoneMatch_ != "" {
  1362  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1363  	}
  1364  	var body io.Reader = nil
  1365  	c.urlParams_.Set("alt", alt)
  1366  	c.urlParams_.Set("prettyPrint", "false")
  1367  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1368  	urls += "?" + c.urlParams_.Encode()
  1369  	req, err := http.NewRequest("GET", urls, body)
  1370  	if err != nil {
  1371  		return nil, err
  1372  	}
  1373  	req.Header = reqHeaders
  1374  	googleapi.Expand(req.URL, map[string]string{
  1375  		"name": c.name,
  1376  	})
  1377  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1378  }
  1379  
  1380  // Do executes the "gameservices.projects.locations.get" call.
  1381  // Exactly one of *Location or error will be non-nil. Any non-2xx status
  1382  // code is an error. Response headers are in either
  1383  // *Location.ServerResponse.Header or (if a response was returned at
  1384  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1385  // to check whether the returned error was because
  1386  // http.StatusNotModified was returned.
  1387  func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
  1388  	gensupport.SetOptions(c.urlParams_, opts...)
  1389  	res, err := c.doRequest("json")
  1390  	if res != nil && res.StatusCode == http.StatusNotModified {
  1391  		if res.Body != nil {
  1392  			res.Body.Close()
  1393  		}
  1394  		return nil, gensupport.WrapError(&googleapi.Error{
  1395  			Code:   res.StatusCode,
  1396  			Header: res.Header,
  1397  		})
  1398  	}
  1399  	if err != nil {
  1400  		return nil, err
  1401  	}
  1402  	defer googleapi.CloseBody(res)
  1403  	if err := googleapi.CheckResponse(res); err != nil {
  1404  		return nil, gensupport.WrapError(err)
  1405  	}
  1406  	ret := &Location{
  1407  		ServerResponse: googleapi.ServerResponse{
  1408  			Header:         res.Header,
  1409  			HTTPStatusCode: res.StatusCode,
  1410  		},
  1411  	}
  1412  	target := &ret
  1413  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1414  		return nil, err
  1415  	}
  1416  	return ret, nil
  1417  	// {
  1418  	//   "description": "Gets information about a location.",
  1419  	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}",
  1420  	//   "httpMethod": "GET",
  1421  	//   "id": "gameservices.projects.locations.get",
  1422  	//   "parameterOrder": [
  1423  	//     "name"
  1424  	//   ],
  1425  	//   "parameters": {
  1426  	//     "name": {
  1427  	//       "description": "Resource name for the location.",
  1428  	//       "location": "path",
  1429  	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
  1430  	//       "required": true,
  1431  	//       "type": "string"
  1432  	//     }
  1433  	//   },
  1434  	//   "path": "v1/{+name}",
  1435  	//   "response": {
  1436  	//     "$ref": "Location"
  1437  	//   },
  1438  	//   "scopes": [
  1439  	//     "https://www.googleapis.com/auth/cloud-platform"
  1440  	//   ]
  1441  	// }
  1442  
  1443  }
  1444  
  1445  // method id "gameservices.projects.locations.list":
  1446  
  1447  type ProjectsLocationsListCall struct {
  1448  	s            *Service
  1449  	name         string
  1450  	urlParams_   gensupport.URLParams
  1451  	ifNoneMatch_ string
  1452  	ctx_         context.Context
  1453  	header_      http.Header
  1454  }
  1455  
  1456  // List: Lists information about the supported locations for this
  1457  // service.
  1458  //
  1459  //   - name: The resource that owns the locations collection, if
  1460  //     applicable.
  1461  func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
  1462  	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1463  	c.name = name
  1464  	return c
  1465  }
  1466  
  1467  // Filter sets the optional parameter "filter": A filter to narrow down
  1468  // results to a preferred subset. The filtering language accepts strings
  1469  // like "displayName=tokyo", and is documented in more detail in
  1470  // AIP-160 (https://google.aip.dev/160).
  1471  func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
  1472  	c.urlParams_.Set("filter", filter)
  1473  	return c
  1474  }
  1475  
  1476  // IncludeUnrevealedLocations sets the optional parameter
  1477  // "includeUnrevealedLocations": If true, the returned list will include
  1478  // locations which are not yet revealed.
  1479  func (c *ProjectsLocationsListCall) IncludeUnrevealedLocations(includeUnrevealedLocations bool) *ProjectsLocationsListCall {
  1480  	c.urlParams_.Set("includeUnrevealedLocations", fmt.Sprint(includeUnrevealedLocations))
  1481  	return c
  1482  }
  1483  
  1484  // PageSize sets the optional parameter "pageSize": The maximum number
  1485  // of results to return. If not set, the service selects a default.
  1486  func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
  1487  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1488  	return c
  1489  }
  1490  
  1491  // PageToken sets the optional parameter "pageToken": A page token
  1492  // received from the `next_page_token` field in the response. Send that
  1493  // page token to receive the subsequent page.
  1494  func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
  1495  	c.urlParams_.Set("pageToken", pageToken)
  1496  	return c
  1497  }
  1498  
  1499  // Fields allows partial responses to be retrieved. See
  1500  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1501  // for more information.
  1502  func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
  1503  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1504  	return c
  1505  }
  1506  
  1507  // IfNoneMatch sets the optional parameter which makes the operation
  1508  // fail if the object's ETag matches the given value. This is useful for
  1509  // getting updates only after the object has changed since the last
  1510  // request. Use googleapi.IsNotModified to check whether the response
  1511  // error from Do is the result of In-None-Match.
  1512  func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
  1513  	c.ifNoneMatch_ = entityTag
  1514  	return c
  1515  }
  1516  
  1517  // Context sets the context to be used in this call's Do method. Any
  1518  // pending HTTP request will be aborted if the provided context is
  1519  // canceled.
  1520  func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
  1521  	c.ctx_ = ctx
  1522  	return c
  1523  }
  1524  
  1525  // Header returns an http.Header that can be modified by the caller to
  1526  // add HTTP headers to the request.
  1527  func (c *ProjectsLocationsListCall) Header() http.Header {
  1528  	if c.header_ == nil {
  1529  		c.header_ = make(http.Header)
  1530  	}
  1531  	return c.header_
  1532  }
  1533  
  1534  func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  1535  	reqHeaders := make(http.Header)
  1536  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
  1537  	for k, v := range c.header_ {
  1538  		reqHeaders[k] = v
  1539  	}
  1540  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1541  	if c.ifNoneMatch_ != "" {
  1542  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1543  	}
  1544  	var body io.Reader = nil
  1545  	c.urlParams_.Set("alt", alt)
  1546  	c.urlParams_.Set("prettyPrint", "false")
  1547  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
  1548  	urls += "?" + c.urlParams_.Encode()
  1549  	req, err := http.NewRequest("GET", urls, body)
  1550  	if err != nil {
  1551  		return nil, err
  1552  	}
  1553  	req.Header = reqHeaders
  1554  	googleapi.Expand(req.URL, map[string]string{
  1555  		"name": c.name,
  1556  	})
  1557  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1558  }
  1559  
  1560  // Do executes the "gameservices.projects.locations.list" call.
  1561  // Exactly one of *ListLocationsResponse or error will be non-nil. Any
  1562  // non-2xx status code is an error. Response headers are in either
  1563  // *ListLocationsResponse.ServerResponse.Header or (if a response was
  1564  // returned at all) in error.(*googleapi.Error).Header. Use
  1565  // googleapi.IsNotModified to check whether the returned error was
  1566  // because http.StatusNotModified was returned.
  1567  func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
  1568  	gensupport.SetOptions(c.urlParams_, opts...)
  1569  	res, err := c.doRequest("json")
  1570  	if res != nil && res.StatusCode == http.StatusNotModified {
  1571  		if res.Body != nil {
  1572  			res.Body.Close()
  1573  		}
  1574  		return nil, gensupport.WrapError(&googleapi.Error{
  1575  			Code:   res.StatusCode,
  1576  			Header: res.Header,
  1577  		})
  1578  	}
  1579  	if err != nil {
  1580  		return nil, err
  1581  	}
  1582  	defer googleapi.CloseBody(res)
  1583  	if err := googleapi.CheckResponse(res); err != nil {
  1584  		return nil, gensupport.WrapError(err)
  1585  	}
  1586  	ret := &ListLocationsResponse{
  1587  		ServerResponse: googleapi.ServerResponse{
  1588  			Header:         res.Header,
  1589  			HTTPStatusCode: res.StatusCode,
  1590  		},
  1591  	}
  1592  	target := &ret
  1593  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1594  		return nil, err
  1595  	}
  1596  	return ret, nil
  1597  	// {
  1598  	//   "description": "Lists information about the supported locations for this service.",
  1599  	//   "flatPath": "v1/projects/{projectsId}/locations",
  1600  	//   "httpMethod": "GET",
  1601  	//   "id": "gameservices.projects.locations.list",
  1602  	//   "parameterOrder": [
  1603  	//     "name"
  1604  	//   ],
  1605  	//   "parameters": {
  1606  	//     "filter": {
  1607  	//       "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like `\"displayName=tokyo\"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).",
  1608  	//       "location": "query",
  1609  	//       "type": "string"
  1610  	//     },
  1611  	//     "includeUnrevealedLocations": {
  1612  	//       "description": "If true, the returned list will include locations which are not yet revealed.",
  1613  	//       "location": "query",
  1614  	//       "type": "boolean"
  1615  	//     },
  1616  	//     "name": {
  1617  	//       "description": "The resource that owns the locations collection, if applicable.",
  1618  	//       "location": "path",
  1619  	//       "pattern": "^projects/[^/]+$",
  1620  	//       "required": true,
  1621  	//       "type": "string"
  1622  	//     },
  1623  	//     "pageSize": {
  1624  	//       "description": "The maximum number of results to return. If not set, the service selects a default.",
  1625  	//       "format": "int32",
  1626  	//       "location": "query",
  1627  	//       "type": "integer"
  1628  	//     },
  1629  	//     "pageToken": {
  1630  	//       "description": "A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.",
  1631  	//       "location": "query",
  1632  	//       "type": "string"
  1633  	//     }
  1634  	//   },
  1635  	//   "path": "v1/{+name}/locations",
  1636  	//   "response": {
  1637  	//     "$ref": "ListLocationsResponse"
  1638  	//   },
  1639  	//   "scopes": [
  1640  	//     "https://www.googleapis.com/auth/cloud-platform"
  1641  	//   ]
  1642  	// }
  1643  
  1644  }
  1645  
  1646  // Pages invokes f for each page of results.
  1647  // A non-nil error returned from f will halt the iteration.
  1648  // The provided context supersedes any context provided to the Context method.
  1649  func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
  1650  	c.ctx_ = ctx
  1651  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1652  	for {
  1653  		x, err := c.Do()
  1654  		if err != nil {
  1655  			return err
  1656  		}
  1657  		if err := f(x); err != nil {
  1658  			return err
  1659  		}
  1660  		if x.NextPageToken == "" {
  1661  			return nil
  1662  		}
  1663  		c.PageToken(x.NextPageToken)
  1664  	}
  1665  }
  1666  
  1667  // method id "gameservices.projects.locations.gameServerDeployments.getIamPolicy":
  1668  
  1669  type ProjectsLocationsGameServerDeploymentsGetIamPolicyCall struct {
  1670  	s            *Service
  1671  	resource     string
  1672  	urlParams_   gensupport.URLParams
  1673  	ifNoneMatch_ string
  1674  	ctx_         context.Context
  1675  	header_      http.Header
  1676  }
  1677  
  1678  // GetIamPolicy: Gets the access control policy for a resource. Returns
  1679  // an empty policy if the resource exists and does not have a policy
  1680  // set.
  1681  //
  1682  //   - resource: REQUIRED: The resource for which the policy is being
  1683  //     requested. See Resource names
  1684  //     (https://cloud.google.com/apis/design/resource_names) for the
  1685  //     appropriate value for this field.
  1686  func (r *ProjectsLocationsGameServerDeploymentsService) GetIamPolicy(resource string) *ProjectsLocationsGameServerDeploymentsGetIamPolicyCall {
  1687  	c := &ProjectsLocationsGameServerDeploymentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1688  	c.resource = resource
  1689  	return c
  1690  }
  1691  
  1692  // OptionsRequestedPolicyVersion sets the optional parameter
  1693  // "options.requestedPolicyVersion": The maximum policy version that
  1694  // will be used to format the policy. Valid values are 0, 1, and 3.
  1695  // Requests specifying an invalid value will be rejected. Requests for
  1696  // policies with any conditional role bindings must specify version 3.
  1697  // Policies with no conditional role bindings may specify any valid
  1698  // value or leave the field unset. The policy in the response might use
  1699  // the policy version that you specified, or it might use a lower policy
  1700  // version. For example, if you specify version 3, but the policy has no
  1701  // conditional role bindings, the response uses version 1. To learn
  1702  // which resources support conditions in their IAM policies, see the IAM
  1703  // documentation
  1704  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  1705  func (c *ProjectsLocationsGameServerDeploymentsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsGameServerDeploymentsGetIamPolicyCall {
  1706  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  1707  	return c
  1708  }
  1709  
  1710  // Fields allows partial responses to be retrieved. See
  1711  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1712  // for more information.
  1713  func (c *ProjectsLocationsGameServerDeploymentsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsGameServerDeploymentsGetIamPolicyCall {
  1714  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1715  	return c
  1716  }
  1717  
  1718  // IfNoneMatch sets the optional parameter which makes the operation
  1719  // fail if the object's ETag matches the given value. This is useful for
  1720  // getting updates only after the object has changed since the last
  1721  // request. Use googleapi.IsNotModified to check whether the response
  1722  // error from Do is the result of In-None-Match.
  1723  func (c *ProjectsLocationsGameServerDeploymentsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsGameServerDeploymentsGetIamPolicyCall {
  1724  	c.ifNoneMatch_ = entityTag
  1725  	return c
  1726  }
  1727  
  1728  // Context sets the context to be used in this call's Do method. Any
  1729  // pending HTTP request will be aborted if the provided context is
  1730  // canceled.
  1731  func (c *ProjectsLocationsGameServerDeploymentsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsGameServerDeploymentsGetIamPolicyCall {
  1732  	c.ctx_ = ctx
  1733  	return c
  1734  }
  1735  
  1736  // Header returns an http.Header that can be modified by the caller to
  1737  // add HTTP headers to the request.
  1738  func (c *ProjectsLocationsGameServerDeploymentsGetIamPolicyCall) Header() http.Header {
  1739  	if c.header_ == nil {
  1740  		c.header_ = make(http.Header)
  1741  	}
  1742  	return c.header_
  1743  }
  1744  
  1745  func (c *ProjectsLocationsGameServerDeploymentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  1746  	reqHeaders := make(http.Header)
  1747  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
  1748  	for k, v := range c.header_ {
  1749  		reqHeaders[k] = v
  1750  	}
  1751  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1752  	if c.ifNoneMatch_ != "" {
  1753  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1754  	}
  1755  	var body io.Reader = nil
  1756  	c.urlParams_.Set("alt", alt)
  1757  	c.urlParams_.Set("prettyPrint", "false")
  1758  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  1759  	urls += "?" + c.urlParams_.Encode()
  1760  	req, err := http.NewRequest("GET", urls, body)
  1761  	if err != nil {
  1762  		return nil, err
  1763  	}
  1764  	req.Header = reqHeaders
  1765  	googleapi.Expand(req.URL, map[string]string{
  1766  		"resource": c.resource,
  1767  	})
  1768  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1769  }
  1770  
  1771  // Do executes the "gameservices.projects.locations.gameServerDeployments.getIamPolicy" call.
  1772  // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  1773  // code is an error. Response headers are in either
  1774  // *Policy.ServerResponse.Header or (if a response was returned at all)
  1775  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1776  // check whether the returned error was because http.StatusNotModified
  1777  // was returned.
  1778  func (c *ProjectsLocationsGameServerDeploymentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  1779  	gensupport.SetOptions(c.urlParams_, opts...)
  1780  	res, err := c.doRequest("json")
  1781  	if res != nil && res.StatusCode == http.StatusNotModified {
  1782  		if res.Body != nil {
  1783  			res.Body.Close()
  1784  		}
  1785  		return nil, gensupport.WrapError(&googleapi.Error{
  1786  			Code:   res.StatusCode,
  1787  			Header: res.Header,
  1788  		})
  1789  	}
  1790  	if err != nil {
  1791  		return nil, err
  1792  	}
  1793  	defer googleapi.CloseBody(res)
  1794  	if err := googleapi.CheckResponse(res); err != nil {
  1795  		return nil, gensupport.WrapError(err)
  1796  	}
  1797  	ret := &Policy{
  1798  		ServerResponse: googleapi.ServerResponse{
  1799  			Header:         res.Header,
  1800  			HTTPStatusCode: res.StatusCode,
  1801  		},
  1802  	}
  1803  	target := &ret
  1804  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1805  		return nil, err
  1806  	}
  1807  	return ret, nil
  1808  	// {
  1809  	//   "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  1810  	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/gameServerDeployments/{gameServerDeploymentsId}:getIamPolicy",
  1811  	//   "httpMethod": "GET",
  1812  	//   "id": "gameservices.projects.locations.gameServerDeployments.getIamPolicy",
  1813  	//   "parameterOrder": [
  1814  	//     "resource"
  1815  	//   ],
  1816  	//   "parameters": {
  1817  	//     "options.requestedPolicyVersion": {
  1818  	//       "description": "Optional. The maximum policy version that will be used to format the policy. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional role bindings must specify version 3. Policies with no conditional role bindings may specify any valid value or leave the field unset. The policy in the response might use the policy version that you specified, or it might use a lower policy version. For example, if you specify version 3, but the policy has no conditional role bindings, the response uses version 1. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).",
  1819  	//       "format": "int32",
  1820  	//       "location": "query",
  1821  	//       "type": "integer"
  1822  	//     },
  1823  	//     "resource": {
  1824  	//       "description": "REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.",
  1825  	//       "location": "path",
  1826  	//       "pattern": "^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+$",
  1827  	//       "required": true,
  1828  	//       "type": "string"
  1829  	//     }
  1830  	//   },
  1831  	//   "path": "v1/{+resource}:getIamPolicy",
  1832  	//   "response": {
  1833  	//     "$ref": "Policy"
  1834  	//   },
  1835  	//   "scopes": [
  1836  	//     "https://www.googleapis.com/auth/cloud-platform"
  1837  	//   ]
  1838  	// }
  1839  
  1840  }
  1841  
  1842  // method id "gameservices.projects.locations.gameServerDeployments.setIamPolicy":
  1843  
  1844  type ProjectsLocationsGameServerDeploymentsSetIamPolicyCall struct {
  1845  	s                   *Service
  1846  	resource            string
  1847  	setiampolicyrequest *SetIamPolicyRequest
  1848  	urlParams_          gensupport.URLParams
  1849  	ctx_                context.Context
  1850  	header_             http.Header
  1851  }
  1852  
  1853  // SetIamPolicy: Sets the access control policy on the specified
  1854  // resource. Replaces any existing policy. Can return `NOT_FOUND`,
  1855  // `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
  1856  //
  1857  //   - resource: REQUIRED: The resource for which the policy is being
  1858  //     specified. See Resource names
  1859  //     (https://cloud.google.com/apis/design/resource_names) for the
  1860  //     appropriate value for this field.
  1861  func (r *ProjectsLocationsGameServerDeploymentsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsGameServerDeploymentsSetIamPolicyCall {
  1862  	c := &ProjectsLocationsGameServerDeploymentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1863  	c.resource = resource
  1864  	c.setiampolicyrequest = setiampolicyrequest
  1865  	return c
  1866  }
  1867  
  1868  // Fields allows partial responses to be retrieved. See
  1869  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1870  // for more information.
  1871  func (c *ProjectsLocationsGameServerDeploymentsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsGameServerDeploymentsSetIamPolicyCall {
  1872  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1873  	return c
  1874  }
  1875  
  1876  // Context sets the context to be used in this call's Do method. Any
  1877  // pending HTTP request will be aborted if the provided context is
  1878  // canceled.
  1879  func (c *ProjectsLocationsGameServerDeploymentsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsGameServerDeploymentsSetIamPolicyCall {
  1880  	c.ctx_ = ctx
  1881  	return c
  1882  }
  1883  
  1884  // Header returns an http.Header that can be modified by the caller to
  1885  // add HTTP headers to the request.
  1886  func (c *ProjectsLocationsGameServerDeploymentsSetIamPolicyCall) Header() http.Header {
  1887  	if c.header_ == nil {
  1888  		c.header_ = make(http.Header)
  1889  	}
  1890  	return c.header_
  1891  }
  1892  
  1893  func (c *ProjectsLocationsGameServerDeploymentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  1894  	reqHeaders := make(http.Header)
  1895  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
  1896  	for k, v := range c.header_ {
  1897  		reqHeaders[k] = v
  1898  	}
  1899  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1900  	var body io.Reader = nil
  1901  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  1902  	if err != nil {
  1903  		return nil, err
  1904  	}
  1905  	reqHeaders.Set("Content-Type", "application/json")
  1906  	c.urlParams_.Set("alt", alt)
  1907  	c.urlParams_.Set("prettyPrint", "false")
  1908  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  1909  	urls += "?" + c.urlParams_.Encode()
  1910  	req, err := http.NewRequest("POST", urls, body)
  1911  	if err != nil {
  1912  		return nil, err
  1913  	}
  1914  	req.Header = reqHeaders
  1915  	googleapi.Expand(req.URL, map[string]string{
  1916  		"resource": c.resource,
  1917  	})
  1918  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1919  }
  1920  
  1921  // Do executes the "gameservices.projects.locations.gameServerDeployments.setIamPolicy" call.
  1922  // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  1923  // code is an error. Response headers are in either
  1924  // *Policy.ServerResponse.Header or (if a response was returned at all)
  1925  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1926  // check whether the returned error was because http.StatusNotModified
  1927  // was returned.
  1928  func (c *ProjectsLocationsGameServerDeploymentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  1929  	gensupport.SetOptions(c.urlParams_, opts...)
  1930  	res, err := c.doRequest("json")
  1931  	if res != nil && res.StatusCode == http.StatusNotModified {
  1932  		if res.Body != nil {
  1933  			res.Body.Close()
  1934  		}
  1935  		return nil, gensupport.WrapError(&googleapi.Error{
  1936  			Code:   res.StatusCode,
  1937  			Header: res.Header,
  1938  		})
  1939  	}
  1940  	if err != nil {
  1941  		return nil, err
  1942  	}
  1943  	defer googleapi.CloseBody(res)
  1944  	if err := googleapi.CheckResponse(res); err != nil {
  1945  		return nil, gensupport.WrapError(err)
  1946  	}
  1947  	ret := &Policy{
  1948  		ServerResponse: googleapi.ServerResponse{
  1949  			Header:         res.Header,
  1950  			HTTPStatusCode: res.StatusCode,
  1951  		},
  1952  	}
  1953  	target := &ret
  1954  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1955  		return nil, err
  1956  	}
  1957  	return ret, nil
  1958  	// {
  1959  	//   "description": "Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.",
  1960  	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/gameServerDeployments/{gameServerDeploymentsId}:setIamPolicy",
  1961  	//   "httpMethod": "POST",
  1962  	//   "id": "gameservices.projects.locations.gameServerDeployments.setIamPolicy",
  1963  	//   "parameterOrder": [
  1964  	//     "resource"
  1965  	//   ],
  1966  	//   "parameters": {
  1967  	//     "resource": {
  1968  	//       "description": "REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.",
  1969  	//       "location": "path",
  1970  	//       "pattern": "^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+$",
  1971  	//       "required": true,
  1972  	//       "type": "string"
  1973  	//     }
  1974  	//   },
  1975  	//   "path": "v1/{+resource}:setIamPolicy",
  1976  	//   "request": {
  1977  	//     "$ref": "SetIamPolicyRequest"
  1978  	//   },
  1979  	//   "response": {
  1980  	//     "$ref": "Policy"
  1981  	//   },
  1982  	//   "scopes": [
  1983  	//     "https://www.googleapis.com/auth/cloud-platform"
  1984  	//   ]
  1985  	// }
  1986  
  1987  }
  1988  
  1989  // method id "gameservices.projects.locations.gameServerDeployments.testIamPermissions":
  1990  
  1991  type ProjectsLocationsGameServerDeploymentsTestIamPermissionsCall struct {
  1992  	s                         *Service
  1993  	resource                  string
  1994  	testiampermissionsrequest *TestIamPermissionsRequest
  1995  	urlParams_                gensupport.URLParams
  1996  	ctx_                      context.Context
  1997  	header_                   http.Header
  1998  }
  1999  
  2000  // TestIamPermissions: Returns permissions that a caller has on the
  2001  // specified resource. If the resource does not exist, this will return
  2002  // an empty set of permissions, not a `NOT_FOUND` error. Note: This
  2003  // operation is designed to be used for building permission-aware UIs
  2004  // and command-line tools, not for authorization checking. This
  2005  // operation may "fail open" without warning.
  2006  //
  2007  //   - resource: REQUIRED: The resource for which the policy detail is
  2008  //     being requested. See Resource names
  2009  //     (https://cloud.google.com/apis/design/resource_names) for the
  2010  //     appropriate value for this field.
  2011  func (r *ProjectsLocationsGameServerDeploymentsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsGameServerDeploymentsTestIamPermissionsCall {
  2012  	c := &ProjectsLocationsGameServerDeploymentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2013  	c.resource = resource
  2014  	c.testiampermissionsrequest = testiampermissionsrequest
  2015  	return c
  2016  }
  2017  
  2018  // Fields allows partial responses to be retrieved. See
  2019  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2020  // for more information.
  2021  func (c *ProjectsLocationsGameServerDeploymentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsGameServerDeploymentsTestIamPermissionsCall {
  2022  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2023  	return c
  2024  }
  2025  
  2026  // Context sets the context to be used in this call's Do method. Any
  2027  // pending HTTP request will be aborted if the provided context is
  2028  // canceled.
  2029  func (c *ProjectsLocationsGameServerDeploymentsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsGameServerDeploymentsTestIamPermissionsCall {
  2030  	c.ctx_ = ctx
  2031  	return c
  2032  }
  2033  
  2034  // Header returns an http.Header that can be modified by the caller to
  2035  // add HTTP headers to the request.
  2036  func (c *ProjectsLocationsGameServerDeploymentsTestIamPermissionsCall) Header() http.Header {
  2037  	if c.header_ == nil {
  2038  		c.header_ = make(http.Header)
  2039  	}
  2040  	return c.header_
  2041  }
  2042  
  2043  func (c *ProjectsLocationsGameServerDeploymentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  2044  	reqHeaders := make(http.Header)
  2045  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
  2046  	for k, v := range c.header_ {
  2047  		reqHeaders[k] = v
  2048  	}
  2049  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2050  	var body io.Reader = nil
  2051  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  2052  	if err != nil {
  2053  		return nil, err
  2054  	}
  2055  	reqHeaders.Set("Content-Type", "application/json")
  2056  	c.urlParams_.Set("alt", alt)
  2057  	c.urlParams_.Set("prettyPrint", "false")
  2058  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  2059  	urls += "?" + c.urlParams_.Encode()
  2060  	req, err := http.NewRequest("POST", urls, body)
  2061  	if err != nil {
  2062  		return nil, err
  2063  	}
  2064  	req.Header = reqHeaders
  2065  	googleapi.Expand(req.URL, map[string]string{
  2066  		"resource": c.resource,
  2067  	})
  2068  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2069  }
  2070  
  2071  // Do executes the "gameservices.projects.locations.gameServerDeployments.testIamPermissions" call.
  2072  // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  2073  // Any non-2xx status code is an error. Response headers are in either
  2074  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  2075  // was returned at all) in error.(*googleapi.Error).Header. Use
  2076  // googleapi.IsNotModified to check whether the returned error was
  2077  // because http.StatusNotModified was returned.
  2078  func (c *ProjectsLocationsGameServerDeploymentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  2079  	gensupport.SetOptions(c.urlParams_, opts...)
  2080  	res, err := c.doRequest("json")
  2081  	if res != nil && res.StatusCode == http.StatusNotModified {
  2082  		if res.Body != nil {
  2083  			res.Body.Close()
  2084  		}
  2085  		return nil, gensupport.WrapError(&googleapi.Error{
  2086  			Code:   res.StatusCode,
  2087  			Header: res.Header,
  2088  		})
  2089  	}
  2090  	if err != nil {
  2091  		return nil, err
  2092  	}
  2093  	defer googleapi.CloseBody(res)
  2094  	if err := googleapi.CheckResponse(res); err != nil {
  2095  		return nil, gensupport.WrapError(err)
  2096  	}
  2097  	ret := &TestIamPermissionsResponse{
  2098  		ServerResponse: googleapi.ServerResponse{
  2099  			Header:         res.Header,
  2100  			HTTPStatusCode: res.StatusCode,
  2101  		},
  2102  	}
  2103  	target := &ret
  2104  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2105  		return nil, err
  2106  	}
  2107  	return ret, nil
  2108  	// {
  2109  	//   "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.",
  2110  	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/gameServerDeployments/{gameServerDeploymentsId}:testIamPermissions",
  2111  	//   "httpMethod": "POST",
  2112  	//   "id": "gameservices.projects.locations.gameServerDeployments.testIamPermissions",
  2113  	//   "parameterOrder": [
  2114  	//     "resource"
  2115  	//   ],
  2116  	//   "parameters": {
  2117  	//     "resource": {
  2118  	//       "description": "REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.",
  2119  	//       "location": "path",
  2120  	//       "pattern": "^projects/[^/]+/locations/[^/]+/gameServerDeployments/[^/]+$",
  2121  	//       "required": true,
  2122  	//       "type": "string"
  2123  	//     }
  2124  	//   },
  2125  	//   "path": "v1/{+resource}:testIamPermissions",
  2126  	//   "request": {
  2127  	//     "$ref": "TestIamPermissionsRequest"
  2128  	//   },
  2129  	//   "response": {
  2130  	//     "$ref": "TestIamPermissionsResponse"
  2131  	//   },
  2132  	//   "scopes": [
  2133  	//     "https://www.googleapis.com/auth/cloud-platform"
  2134  	//   ]
  2135  	// }
  2136  
  2137  }
  2138  
  2139  // method id "gameservices.projects.locations.operations.cancel":
  2140  
  2141  type ProjectsLocationsOperationsCancelCall struct {
  2142  	s                      *Service
  2143  	name                   string
  2144  	canceloperationrequest *CancelOperationRequest
  2145  	urlParams_             gensupport.URLParams
  2146  	ctx_                   context.Context
  2147  	header_                http.Header
  2148  }
  2149  
  2150  // Cancel: Starts asynchronous cancellation on a long-running operation.
  2151  // The server makes a best effort to cancel the operation, but success
  2152  // is not guaranteed. If the server doesn't support this method, it
  2153  // returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use
  2154  // Operations.GetOperation or other methods to check whether the
  2155  // cancellation succeeded or whether the operation completed despite
  2156  // cancellation. On successful cancellation, the operation is not
  2157  // deleted; instead, it becomes an operation with an Operation.error
  2158  // value with a google.rpc.Status.code of 1, corresponding to
  2159  // `Code.CANCELLED`.
  2160  //
  2161  // - name: The name of the operation resource to be cancelled.
  2162  func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
  2163  	c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2164  	c.name = name
  2165  	c.canceloperationrequest = canceloperationrequest
  2166  	return c
  2167  }
  2168  
  2169  // Fields allows partial responses to be retrieved. See
  2170  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2171  // for more information.
  2172  func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
  2173  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2174  	return c
  2175  }
  2176  
  2177  // Context sets the context to be used in this call's Do method. Any
  2178  // pending HTTP request will be aborted if the provided context is
  2179  // canceled.
  2180  func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
  2181  	c.ctx_ = ctx
  2182  	return c
  2183  }
  2184  
  2185  // Header returns an http.Header that can be modified by the caller to
  2186  // add HTTP headers to the request.
  2187  func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
  2188  	if c.header_ == nil {
  2189  		c.header_ = make(http.Header)
  2190  	}
  2191  	return c.header_
  2192  }
  2193  
  2194  func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  2195  	reqHeaders := make(http.Header)
  2196  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
  2197  	for k, v := range c.header_ {
  2198  		reqHeaders[k] = v
  2199  	}
  2200  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2201  	var body io.Reader = nil
  2202  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  2203  	if err != nil {
  2204  		return nil, err
  2205  	}
  2206  	reqHeaders.Set("Content-Type", "application/json")
  2207  	c.urlParams_.Set("alt", alt)
  2208  	c.urlParams_.Set("prettyPrint", "false")
  2209  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
  2210  	urls += "?" + c.urlParams_.Encode()
  2211  	req, err := http.NewRequest("POST", urls, body)
  2212  	if err != nil {
  2213  		return nil, err
  2214  	}
  2215  	req.Header = reqHeaders
  2216  	googleapi.Expand(req.URL, map[string]string{
  2217  		"name": c.name,
  2218  	})
  2219  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2220  }
  2221  
  2222  // Do executes the "gameservices.projects.locations.operations.cancel" call.
  2223  // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2224  // code is an error. Response headers are in either
  2225  // *Empty.ServerResponse.Header or (if a response was returned at all)
  2226  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2227  // check whether the returned error was because http.StatusNotModified
  2228  // was returned.
  2229  func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2230  	gensupport.SetOptions(c.urlParams_, opts...)
  2231  	res, err := c.doRequest("json")
  2232  	if res != nil && res.StatusCode == http.StatusNotModified {
  2233  		if res.Body != nil {
  2234  			res.Body.Close()
  2235  		}
  2236  		return nil, gensupport.WrapError(&googleapi.Error{
  2237  			Code:   res.StatusCode,
  2238  			Header: res.Header,
  2239  		})
  2240  	}
  2241  	if err != nil {
  2242  		return nil, err
  2243  	}
  2244  	defer googleapi.CloseBody(res)
  2245  	if err := googleapi.CheckResponse(res); err != nil {
  2246  		return nil, gensupport.WrapError(err)
  2247  	}
  2248  	ret := &Empty{
  2249  		ServerResponse: googleapi.ServerResponse{
  2250  			Header:         res.Header,
  2251  			HTTPStatusCode: res.StatusCode,
  2252  		},
  2253  	}
  2254  	target := &ret
  2255  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2256  		return nil, err
  2257  	}
  2258  	return ret, nil
  2259  	// {
  2260  	//   "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.",
  2261  	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel",
  2262  	//   "httpMethod": "POST",
  2263  	//   "id": "gameservices.projects.locations.operations.cancel",
  2264  	//   "parameterOrder": [
  2265  	//     "name"
  2266  	//   ],
  2267  	//   "parameters": {
  2268  	//     "name": {
  2269  	//       "description": "The name of the operation resource to be cancelled.",
  2270  	//       "location": "path",
  2271  	//       "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  2272  	//       "required": true,
  2273  	//       "type": "string"
  2274  	//     }
  2275  	//   },
  2276  	//   "path": "v1/{+name}:cancel",
  2277  	//   "request": {
  2278  	//     "$ref": "CancelOperationRequest"
  2279  	//   },
  2280  	//   "response": {
  2281  	//     "$ref": "Empty"
  2282  	//   },
  2283  	//   "scopes": [
  2284  	//     "https://www.googleapis.com/auth/cloud-platform"
  2285  	//   ]
  2286  	// }
  2287  
  2288  }
  2289  
  2290  // method id "gameservices.projects.locations.operations.delete":
  2291  
  2292  type ProjectsLocationsOperationsDeleteCall struct {
  2293  	s          *Service
  2294  	name       string
  2295  	urlParams_ gensupport.URLParams
  2296  	ctx_       context.Context
  2297  	header_    http.Header
  2298  }
  2299  
  2300  // Delete: Deletes a long-running operation. This method indicates that
  2301  // the client is no longer interested in the operation result. It does
  2302  // not cancel the operation. If the server doesn't support this method,
  2303  // it returns `google.rpc.Code.UNIMPLEMENTED`.
  2304  //
  2305  // - name: The name of the operation resource to be deleted.
  2306  func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
  2307  	c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2308  	c.name = name
  2309  	return c
  2310  }
  2311  
  2312  // Fields allows partial responses to be retrieved. See
  2313  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2314  // for more information.
  2315  func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
  2316  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2317  	return c
  2318  }
  2319  
  2320  // Context sets the context to be used in this call's Do method. Any
  2321  // pending HTTP request will be aborted if the provided context is
  2322  // canceled.
  2323  func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
  2324  	c.ctx_ = ctx
  2325  	return c
  2326  }
  2327  
  2328  // Header returns an http.Header that can be modified by the caller to
  2329  // add HTTP headers to the request.
  2330  func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
  2331  	if c.header_ == nil {
  2332  		c.header_ = make(http.Header)
  2333  	}
  2334  	return c.header_
  2335  }
  2336  
  2337  func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2338  	reqHeaders := make(http.Header)
  2339  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
  2340  	for k, v := range c.header_ {
  2341  		reqHeaders[k] = v
  2342  	}
  2343  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2344  	var body io.Reader = nil
  2345  	c.urlParams_.Set("alt", alt)
  2346  	c.urlParams_.Set("prettyPrint", "false")
  2347  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2348  	urls += "?" + c.urlParams_.Encode()
  2349  	req, err := http.NewRequest("DELETE", urls, body)
  2350  	if err != nil {
  2351  		return nil, err
  2352  	}
  2353  	req.Header = reqHeaders
  2354  	googleapi.Expand(req.URL, map[string]string{
  2355  		"name": c.name,
  2356  	})
  2357  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2358  }
  2359  
  2360  // Do executes the "gameservices.projects.locations.operations.delete" call.
  2361  // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2362  // code is an error. Response headers are in either
  2363  // *Empty.ServerResponse.Header or (if a response was returned at all)
  2364  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2365  // check whether the returned error was because http.StatusNotModified
  2366  // was returned.
  2367  func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2368  	gensupport.SetOptions(c.urlParams_, opts...)
  2369  	res, err := c.doRequest("json")
  2370  	if res != nil && res.StatusCode == http.StatusNotModified {
  2371  		if res.Body != nil {
  2372  			res.Body.Close()
  2373  		}
  2374  		return nil, gensupport.WrapError(&googleapi.Error{
  2375  			Code:   res.StatusCode,
  2376  			Header: res.Header,
  2377  		})
  2378  	}
  2379  	if err != nil {
  2380  		return nil, err
  2381  	}
  2382  	defer googleapi.CloseBody(res)
  2383  	if err := googleapi.CheckResponse(res); err != nil {
  2384  		return nil, gensupport.WrapError(err)
  2385  	}
  2386  	ret := &Empty{
  2387  		ServerResponse: googleapi.ServerResponse{
  2388  			Header:         res.Header,
  2389  			HTTPStatusCode: res.StatusCode,
  2390  		},
  2391  	}
  2392  	target := &ret
  2393  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2394  		return nil, err
  2395  	}
  2396  	return ret, nil
  2397  	// {
  2398  	//   "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.",
  2399  	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}",
  2400  	//   "httpMethod": "DELETE",
  2401  	//   "id": "gameservices.projects.locations.operations.delete",
  2402  	//   "parameterOrder": [
  2403  	//     "name"
  2404  	//   ],
  2405  	//   "parameters": {
  2406  	//     "name": {
  2407  	//       "description": "The name of the operation resource to be deleted.",
  2408  	//       "location": "path",
  2409  	//       "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  2410  	//       "required": true,
  2411  	//       "type": "string"
  2412  	//     }
  2413  	//   },
  2414  	//   "path": "v1/{+name}",
  2415  	//   "response": {
  2416  	//     "$ref": "Empty"
  2417  	//   },
  2418  	//   "scopes": [
  2419  	//     "https://www.googleapis.com/auth/cloud-platform"
  2420  	//   ]
  2421  	// }
  2422  
  2423  }
  2424  
  2425  // method id "gameservices.projects.locations.operations.get":
  2426  
  2427  type ProjectsLocationsOperationsGetCall struct {
  2428  	s            *Service
  2429  	name         string
  2430  	urlParams_   gensupport.URLParams
  2431  	ifNoneMatch_ string
  2432  	ctx_         context.Context
  2433  	header_      http.Header
  2434  }
  2435  
  2436  // Get: Gets the latest state of a long-running operation. Clients can
  2437  // use this method to poll the operation result at intervals as
  2438  // recommended by the API service.
  2439  //
  2440  // - name: The name of the operation resource.
  2441  func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  2442  	c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2443  	c.name = name
  2444  	return c
  2445  }
  2446  
  2447  // Fields allows partial responses to be retrieved. See
  2448  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2449  // for more information.
  2450  func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  2451  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2452  	return c
  2453  }
  2454  
  2455  // IfNoneMatch sets the optional parameter which makes the operation
  2456  // fail if the object's ETag matches the given value. This is useful for
  2457  // getting updates only after the object has changed since the last
  2458  // request. Use googleapi.IsNotModified to check whether the response
  2459  // error from Do is the result of In-None-Match.
  2460  func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  2461  	c.ifNoneMatch_ = entityTag
  2462  	return c
  2463  }
  2464  
  2465  // Context sets the context to be used in this call's Do method. Any
  2466  // pending HTTP request will be aborted if the provided context is
  2467  // canceled.
  2468  func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  2469  	c.ctx_ = ctx
  2470  	return c
  2471  }
  2472  
  2473  // Header returns an http.Header that can be modified by the caller to
  2474  // add HTTP headers to the request.
  2475  func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  2476  	if c.header_ == nil {
  2477  		c.header_ = make(http.Header)
  2478  	}
  2479  	return c.header_
  2480  }
  2481  
  2482  func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  2483  	reqHeaders := make(http.Header)
  2484  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
  2485  	for k, v := range c.header_ {
  2486  		reqHeaders[k] = v
  2487  	}
  2488  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2489  	if c.ifNoneMatch_ != "" {
  2490  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2491  	}
  2492  	var body io.Reader = nil
  2493  	c.urlParams_.Set("alt", alt)
  2494  	c.urlParams_.Set("prettyPrint", "false")
  2495  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2496  	urls += "?" + c.urlParams_.Encode()
  2497  	req, err := http.NewRequest("GET", urls, body)
  2498  	if err != nil {
  2499  		return nil, err
  2500  	}
  2501  	req.Header = reqHeaders
  2502  	googleapi.Expand(req.URL, map[string]string{
  2503  		"name": c.name,
  2504  	})
  2505  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2506  }
  2507  
  2508  // Do executes the "gameservices.projects.locations.operations.get" call.
  2509  // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2510  // status code is an error. Response headers are in either
  2511  // *Operation.ServerResponse.Header or (if a response was returned at
  2512  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2513  // to check whether the returned error was because
  2514  // http.StatusNotModified was returned.
  2515  func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2516  	gensupport.SetOptions(c.urlParams_, opts...)
  2517  	res, err := c.doRequest("json")
  2518  	if res != nil && res.StatusCode == http.StatusNotModified {
  2519  		if res.Body != nil {
  2520  			res.Body.Close()
  2521  		}
  2522  		return nil, gensupport.WrapError(&googleapi.Error{
  2523  			Code:   res.StatusCode,
  2524  			Header: res.Header,
  2525  		})
  2526  	}
  2527  	if err != nil {
  2528  		return nil, err
  2529  	}
  2530  	defer googleapi.CloseBody(res)
  2531  	if err := googleapi.CheckResponse(res); err != nil {
  2532  		return nil, gensupport.WrapError(err)
  2533  	}
  2534  	ret := &Operation{
  2535  		ServerResponse: googleapi.ServerResponse{
  2536  			Header:         res.Header,
  2537  			HTTPStatusCode: res.StatusCode,
  2538  		},
  2539  	}
  2540  	target := &ret
  2541  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2542  		return nil, err
  2543  	}
  2544  	return ret, nil
  2545  	// {
  2546  	//   "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
  2547  	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}",
  2548  	//   "httpMethod": "GET",
  2549  	//   "id": "gameservices.projects.locations.operations.get",
  2550  	//   "parameterOrder": [
  2551  	//     "name"
  2552  	//   ],
  2553  	//   "parameters": {
  2554  	//     "name": {
  2555  	//       "description": "The name of the operation resource.",
  2556  	//       "location": "path",
  2557  	//       "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  2558  	//       "required": true,
  2559  	//       "type": "string"
  2560  	//     }
  2561  	//   },
  2562  	//   "path": "v1/{+name}",
  2563  	//   "response": {
  2564  	//     "$ref": "Operation"
  2565  	//   },
  2566  	//   "scopes": [
  2567  	//     "https://www.googleapis.com/auth/cloud-platform"
  2568  	//   ]
  2569  	// }
  2570  
  2571  }
  2572  
  2573  // method id "gameservices.projects.locations.operations.list":
  2574  
  2575  type ProjectsLocationsOperationsListCall struct {
  2576  	s            *Service
  2577  	name         string
  2578  	urlParams_   gensupport.URLParams
  2579  	ifNoneMatch_ string
  2580  	ctx_         context.Context
  2581  	header_      http.Header
  2582  }
  2583  
  2584  // List: Lists operations that match the specified filter in the
  2585  // request. If the server doesn't support this method, it returns
  2586  // `UNIMPLEMENTED`.
  2587  //
  2588  // - name: The name of the operation's parent resource.
  2589  func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
  2590  	c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2591  	c.name = name
  2592  	return c
  2593  }
  2594  
  2595  // Filter sets the optional parameter "filter": The standard list
  2596  // filter.
  2597  func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
  2598  	c.urlParams_.Set("filter", filter)
  2599  	return c
  2600  }
  2601  
  2602  // PageSize sets the optional parameter "pageSize": The standard list
  2603  // page size.
  2604  func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
  2605  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2606  	return c
  2607  }
  2608  
  2609  // PageToken sets the optional parameter "pageToken": The standard list
  2610  // page token.
  2611  func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
  2612  	c.urlParams_.Set("pageToken", pageToken)
  2613  	return c
  2614  }
  2615  
  2616  // Fields allows partial responses to be retrieved. See
  2617  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2618  // for more information.
  2619  func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  2620  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2621  	return c
  2622  }
  2623  
  2624  // IfNoneMatch sets the optional parameter which makes the operation
  2625  // fail if the object's ETag matches the given value. This is useful for
  2626  // getting updates only after the object has changed since the last
  2627  // request. Use googleapi.IsNotModified to check whether the response
  2628  // error from Do is the result of In-None-Match.
  2629  func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  2630  	c.ifNoneMatch_ = entityTag
  2631  	return c
  2632  }
  2633  
  2634  // Context sets the context to be used in this call's Do method. Any
  2635  // pending HTTP request will be aborted if the provided context is
  2636  // canceled.
  2637  func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  2638  	c.ctx_ = ctx
  2639  	return c
  2640  }
  2641  
  2642  // Header returns an http.Header that can be modified by the caller to
  2643  // add HTTP headers to the request.
  2644  func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  2645  	if c.header_ == nil {
  2646  		c.header_ = make(http.Header)
  2647  	}
  2648  	return c.header_
  2649  }
  2650  
  2651  func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  2652  	reqHeaders := make(http.Header)
  2653  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
  2654  	for k, v := range c.header_ {
  2655  		reqHeaders[k] = v
  2656  	}
  2657  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2658  	if c.ifNoneMatch_ != "" {
  2659  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2660  	}
  2661  	var body io.Reader = nil
  2662  	c.urlParams_.Set("alt", alt)
  2663  	c.urlParams_.Set("prettyPrint", "false")
  2664  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
  2665  	urls += "?" + c.urlParams_.Encode()
  2666  	req, err := http.NewRequest("GET", urls, body)
  2667  	if err != nil {
  2668  		return nil, err
  2669  	}
  2670  	req.Header = reqHeaders
  2671  	googleapi.Expand(req.URL, map[string]string{
  2672  		"name": c.name,
  2673  	})
  2674  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2675  }
  2676  
  2677  // Do executes the "gameservices.projects.locations.operations.list" call.
  2678  // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  2679  // non-2xx status code is an error. Response headers are in either
  2680  // *ListOperationsResponse.ServerResponse.Header or (if a response was
  2681  // returned at all) in error.(*googleapi.Error).Header. Use
  2682  // googleapi.IsNotModified to check whether the returned error was
  2683  // because http.StatusNotModified was returned.
  2684  func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  2685  	gensupport.SetOptions(c.urlParams_, opts...)
  2686  	res, err := c.doRequest("json")
  2687  	if res != nil && res.StatusCode == http.StatusNotModified {
  2688  		if res.Body != nil {
  2689  			res.Body.Close()
  2690  		}
  2691  		return nil, gensupport.WrapError(&googleapi.Error{
  2692  			Code:   res.StatusCode,
  2693  			Header: res.Header,
  2694  		})
  2695  	}
  2696  	if err != nil {
  2697  		return nil, err
  2698  	}
  2699  	defer googleapi.CloseBody(res)
  2700  	if err := googleapi.CheckResponse(res); err != nil {
  2701  		return nil, gensupport.WrapError(err)
  2702  	}
  2703  	ret := &ListOperationsResponse{
  2704  		ServerResponse: googleapi.ServerResponse{
  2705  			Header:         res.Header,
  2706  			HTTPStatusCode: res.StatusCode,
  2707  		},
  2708  	}
  2709  	target := &ret
  2710  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2711  		return nil, err
  2712  	}
  2713  	return ret, nil
  2714  	// {
  2715  	//   "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.",
  2716  	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations",
  2717  	//   "httpMethod": "GET",
  2718  	//   "id": "gameservices.projects.locations.operations.list",
  2719  	//   "parameterOrder": [
  2720  	//     "name"
  2721  	//   ],
  2722  	//   "parameters": {
  2723  	//     "filter": {
  2724  	//       "description": "The standard list filter.",
  2725  	//       "location": "query",
  2726  	//       "type": "string"
  2727  	//     },
  2728  	//     "name": {
  2729  	//       "description": "The name of the operation's parent resource.",
  2730  	//       "location": "path",
  2731  	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
  2732  	//       "required": true,
  2733  	//       "type": "string"
  2734  	//     },
  2735  	//     "pageSize": {
  2736  	//       "description": "The standard list page size.",
  2737  	//       "format": "int32",
  2738  	//       "location": "query",
  2739  	//       "type": "integer"
  2740  	//     },
  2741  	//     "pageToken": {
  2742  	//       "description": "The standard list page token.",
  2743  	//       "location": "query",
  2744  	//       "type": "string"
  2745  	//     }
  2746  	//   },
  2747  	//   "path": "v1/{+name}/operations",
  2748  	//   "response": {
  2749  	//     "$ref": "ListOperationsResponse"
  2750  	//   },
  2751  	//   "scopes": [
  2752  	//     "https://www.googleapis.com/auth/cloud-platform"
  2753  	//   ]
  2754  	// }
  2755  
  2756  }
  2757  
  2758  // Pages invokes f for each page of results.
  2759  // A non-nil error returned from f will halt the iteration.
  2760  // The provided context supersedes any context provided to the Context method.
  2761  func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  2762  	c.ctx_ = ctx
  2763  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2764  	for {
  2765  		x, err := c.Do()
  2766  		if err != nil {
  2767  			return err
  2768  		}
  2769  		if err := f(x); err != nil {
  2770  			return err
  2771  		}
  2772  		if x.NextPageToken == "" {
  2773  			return nil
  2774  		}
  2775  		c.PageToken(x.NextPageToken)
  2776  	}
  2777  }
  2778  

View as plain text