...

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

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

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

View as plain text