...

Source file src/google.golang.org/api/bigqueryreservation/v1alpha2/bigqueryreservation-gen.go

Documentation: google.golang.org/api/bigqueryreservation/v1alpha2

     1  // Copyright 2020 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package bigqueryreservation provides access to the BigQuery Reservation API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/bigquery/
    10  //
    11  // # Creating a client
    12  //
    13  // Usage example:
    14  //
    15  //	import "google.golang.org/api/bigqueryreservation/v1alpha2"
    16  //	...
    17  //	ctx := context.Background()
    18  //	bigqueryreservationService, err := bigqueryreservation.NewService(ctx)
    19  //
    20  // In this example, Google Application Default Credentials are used for authentication.
    21  //
    22  // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    23  //
    24  // # Other authentication options
    25  //
    26  // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
    27  //
    28  //	bigqueryreservationService, err := bigqueryreservation.NewService(ctx, option.WithScopes(bigqueryreservation.CloudPlatformScope))
    29  //
    30  // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
    31  //
    32  //	bigqueryreservationService, err := bigqueryreservation.NewService(ctx, option.WithAPIKey("AIza..."))
    33  //
    34  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
    35  //
    36  //	config := &oauth2.Config{...}
    37  //	// ...
    38  //	token, err := config.Exchange(ctx, ...)
    39  //	bigqueryreservationService, err := bigqueryreservation.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    40  //
    41  // See https://godoc.org/google.golang.org/api/option/ for details on options.
    42  package bigqueryreservation // import "google.golang.org/api/bigqueryreservation/v1alpha2"
    43  
    44  import (
    45  	"bytes"
    46  	"context"
    47  	"encoding/json"
    48  	"errors"
    49  	"fmt"
    50  	"io"
    51  	"net/http"
    52  	"net/url"
    53  	"strconv"
    54  	"strings"
    55  
    56  	googleapi "google.golang.org/api/googleapi"
    57  	gensupport "google.golang.org/api/internal/gensupport"
    58  	option "google.golang.org/api/option"
    59  	internaloption "google.golang.org/api/option/internaloption"
    60  	htransport "google.golang.org/api/transport/http"
    61  )
    62  
    63  // Always reference these packages, just in case the auto-generated code
    64  // below doesn't.
    65  var _ = bytes.NewBuffer
    66  var _ = strconv.Itoa
    67  var _ = fmt.Sprintf
    68  var _ = json.NewDecoder
    69  var _ = io.Copy
    70  var _ = url.Parse
    71  var _ = gensupport.MarshalJSON
    72  var _ = googleapi.Version
    73  var _ = errors.New
    74  var _ = strings.Replace
    75  var _ = context.Canceled
    76  var _ = internaloption.WithDefaultEndpoint
    77  
    78  const apiId = "bigqueryreservation:v1alpha2"
    79  const apiName = "bigqueryreservation"
    80  const apiVersion = "v1alpha2"
    81  const basePath = "https://bigqueryreservation.googleapis.com/"
    82  const mtlsBasePath = "https://bigqueryreservation.mtls.googleapis.com/"
    83  
    84  // OAuth2 scopes used by this API.
    85  const (
    86  	// View and manage your data in Google BigQuery
    87  	BigqueryScope = "https://www.googleapis.com/auth/bigquery"
    88  
    89  	// View and manage your data across Google Cloud Platform services
    90  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
    91  )
    92  
    93  // NewService creates a new Service.
    94  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
    95  	scopesOption := option.WithScopes(
    96  		"https://www.googleapis.com/auth/bigquery",
    97  		"https://www.googleapis.com/auth/cloud-platform",
    98  	)
    99  	// NOTE: prepend, so we don't override user-specified scopes.
   100  	opts = append([]option.ClientOption{scopesOption}, opts...)
   101  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   102  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   103  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   104  	if err != nil {
   105  		return nil, err
   106  	}
   107  	s, err := New(client)
   108  	if err != nil {
   109  		return nil, err
   110  	}
   111  	if endpoint != "" {
   112  		s.BasePath = endpoint
   113  	}
   114  	return s, nil
   115  }
   116  
   117  // New creates a new Service. It uses the provided http.Client for requests.
   118  //
   119  // Deprecated: please use NewService instead.
   120  // To provide a custom HTTP client, use option.WithHTTPClient.
   121  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   122  func New(client *http.Client) (*Service, error) {
   123  	if client == nil {
   124  		return nil, errors.New("client is nil")
   125  	}
   126  	s := &Service{client: client, BasePath: basePath}
   127  	s.Projects = NewProjectsService(s)
   128  	return s, nil
   129  }
   130  
   131  type Service struct {
   132  	client    *http.Client
   133  	BasePath  string // API endpoint base URL
   134  	UserAgent string // optional additional User-Agent fragment
   135  
   136  	Projects *ProjectsService
   137  }
   138  
   139  func (s *Service) userAgent() string {
   140  	if s.UserAgent == "" {
   141  		return googleapi.UserAgent
   142  	}
   143  	return googleapi.UserAgent + " " + s.UserAgent
   144  }
   145  
   146  func NewProjectsService(s *Service) *ProjectsService {
   147  	rs := &ProjectsService{s: s}
   148  	rs.Locations = NewProjectsLocationsService(s)
   149  	return rs
   150  }
   151  
   152  type ProjectsService struct {
   153  	s *Service
   154  
   155  	Locations *ProjectsLocationsService
   156  }
   157  
   158  func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
   159  	rs := &ProjectsLocationsService{s: s}
   160  	rs.Operations = NewProjectsLocationsOperationsService(s)
   161  	rs.ReservationGrants = NewProjectsLocationsReservationGrantsService(s)
   162  	rs.Reservations = NewProjectsLocationsReservationsService(s)
   163  	return rs
   164  }
   165  
   166  type ProjectsLocationsService struct {
   167  	s *Service
   168  
   169  	Operations *ProjectsLocationsOperationsService
   170  
   171  	ReservationGrants *ProjectsLocationsReservationGrantsService
   172  
   173  	Reservations *ProjectsLocationsReservationsService
   174  }
   175  
   176  func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
   177  	rs := &ProjectsLocationsOperationsService{s: s}
   178  	return rs
   179  }
   180  
   181  type ProjectsLocationsOperationsService struct {
   182  	s *Service
   183  }
   184  
   185  func NewProjectsLocationsReservationGrantsService(s *Service) *ProjectsLocationsReservationGrantsService {
   186  	rs := &ProjectsLocationsReservationGrantsService{s: s}
   187  	return rs
   188  }
   189  
   190  type ProjectsLocationsReservationGrantsService struct {
   191  	s *Service
   192  }
   193  
   194  func NewProjectsLocationsReservationsService(s *Service) *ProjectsLocationsReservationsService {
   195  	rs := &ProjectsLocationsReservationsService{s: s}
   196  	rs.SlotPools = NewProjectsLocationsReservationsSlotPoolsService(s)
   197  	return rs
   198  }
   199  
   200  type ProjectsLocationsReservationsService struct {
   201  	s *Service
   202  
   203  	SlotPools *ProjectsLocationsReservationsSlotPoolsService
   204  }
   205  
   206  func NewProjectsLocationsReservationsSlotPoolsService(s *Service) *ProjectsLocationsReservationsSlotPoolsService {
   207  	rs := &ProjectsLocationsReservationsSlotPoolsService{s: s}
   208  	return rs
   209  }
   210  
   211  type ProjectsLocationsReservationsSlotPoolsService struct {
   212  	s *Service
   213  }
   214  
   215  // CreateSlotPoolMetadata: The metadata for operation returned from
   216  // ReservationService.CreateSlotPool.
   217  type CreateSlotPoolMetadata struct {
   218  	// SlotPool: Resource name of the slot pool that is being created. E.g.,
   219  	// projects/myproject/locations/us-central1/reservations/foo/slotPools/12
   220  	// 3
   221  	SlotPool string `json:"slotPool,omitempty"`
   222  
   223  	// ForceSendFields is a list of field names (e.g. "SlotPool") to
   224  	// unconditionally include in API requests. By default, fields with
   225  	// empty values are omitted from API requests. However, any non-pointer,
   226  	// non-interface field appearing in ForceSendFields will be sent to the
   227  	// server regardless of whether the field is empty or not. This may be
   228  	// used to include empty fields in Patch requests.
   229  	ForceSendFields []string `json:"-"`
   230  
   231  	// NullFields is a list of field names (e.g. "SlotPool") to include in
   232  	// API requests with the JSON null value. By default, fields with empty
   233  	// values are omitted from API requests. However, any field with an
   234  	// empty value appearing in NullFields will be sent to the server as
   235  	// null. It is an error if a field in this list has a non-empty value.
   236  	// This may be used to include null fields in Patch requests.
   237  	NullFields []string `json:"-"`
   238  }
   239  
   240  func (s *CreateSlotPoolMetadata) MarshalJSON() ([]byte, error) {
   241  	type NoMethod CreateSlotPoolMetadata
   242  	raw := NoMethod(*s)
   243  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   244  }
   245  
   246  // Empty: A generic empty message that you can re-use to avoid defining
   247  // duplicated empty messages in your APIs. A typical example is to use
   248  // it as the request or the response type of an API method. For
   249  // instance: service Foo { rpc Bar(google.protobuf.Empty) returns
   250  // (google.protobuf.Empty); } The JSON representation for `Empty` is
   251  // empty JSON object `{}`.
   252  type Empty struct {
   253  	// ServerResponse contains the HTTP response code and headers from the
   254  	// server.
   255  	googleapi.ServerResponse `json:"-"`
   256  }
   257  
   258  // ListReservationGrantsResponse: The response for
   259  // ReservationService.ListReservationGrants.
   260  type ListReservationGrantsResponse struct {
   261  	// NextPageToken: Token to retrieve the next page of results, or empty
   262  	// if there are no more results in the list.
   263  	NextPageToken string `json:"nextPageToken,omitempty"`
   264  
   265  	// ReservationGrants: List of reservation grants visible to the user.
   266  	ReservationGrants []*ReservationGrant `json:"reservationGrants,omitempty"`
   267  
   268  	// ServerResponse contains the HTTP response code and headers from the
   269  	// server.
   270  	googleapi.ServerResponse `json:"-"`
   271  
   272  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   273  	// unconditionally include in API requests. By default, fields with
   274  	// empty values are omitted from API requests. However, any non-pointer,
   275  	// non-interface field appearing in ForceSendFields will be sent to the
   276  	// server regardless of whether the field is empty or not. This may be
   277  	// used to include empty fields in Patch requests.
   278  	ForceSendFields []string `json:"-"`
   279  
   280  	// NullFields is a list of field names (e.g. "NextPageToken") to include
   281  	// in API requests with the JSON null value. By default, fields with
   282  	// empty values are omitted from API requests. However, any field with
   283  	// an empty value appearing in NullFields will be sent to the server as
   284  	// null. It is an error if a field in this list has a non-empty value.
   285  	// This may be used to include null fields in Patch requests.
   286  	NullFields []string `json:"-"`
   287  }
   288  
   289  func (s *ListReservationGrantsResponse) MarshalJSON() ([]byte, error) {
   290  	type NoMethod ListReservationGrantsResponse
   291  	raw := NoMethod(*s)
   292  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   293  }
   294  
   295  // ListReservationsResponse: The response for
   296  // ReservationService.ListReservations.
   297  type ListReservationsResponse struct {
   298  	// NextPageToken: Token to retrieve the next page of results, or empty
   299  	// if there are no more results in the list.
   300  	NextPageToken string `json:"nextPageToken,omitempty"`
   301  
   302  	// Reservations: List of reservations visible to the user.
   303  	Reservations []*Reservation `json:"reservations,omitempty"`
   304  
   305  	// ServerResponse contains the HTTP response code and headers from the
   306  	// server.
   307  	googleapi.ServerResponse `json:"-"`
   308  
   309  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   310  	// unconditionally include in API requests. By default, fields with
   311  	// empty values are omitted from API requests. However, any non-pointer,
   312  	// non-interface field appearing in ForceSendFields will be sent to the
   313  	// server regardless of whether the field is empty or not. This may be
   314  	// used to include empty fields in Patch requests.
   315  	ForceSendFields []string `json:"-"`
   316  
   317  	// NullFields is a list of field names (e.g. "NextPageToken") to include
   318  	// in API requests with the JSON null value. By default, fields with
   319  	// empty values are omitted from API requests. However, any field with
   320  	// an empty value appearing in NullFields will be sent to the server as
   321  	// null. It is an error if a field in this list has a non-empty value.
   322  	// This may be used to include null fields in Patch requests.
   323  	NullFields []string `json:"-"`
   324  }
   325  
   326  func (s *ListReservationsResponse) MarshalJSON() ([]byte, error) {
   327  	type NoMethod ListReservationsResponse
   328  	raw := NoMethod(*s)
   329  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   330  }
   331  
   332  // ListSlotPoolsResponse: The response for
   333  // ReservationService.ListSlotPools.
   334  type ListSlotPoolsResponse struct {
   335  	// NextPageToken: Token to retrieve the next page of results, or empty
   336  	// if there are no more results in the list.
   337  	NextPageToken string `json:"nextPageToken,omitempty"`
   338  
   339  	// SlotPools: List of slot pools visible to the user.
   340  	SlotPools []*SlotPool `json:"slotPools,omitempty"`
   341  
   342  	// ServerResponse contains the HTTP response code and headers from the
   343  	// server.
   344  	googleapi.ServerResponse `json:"-"`
   345  
   346  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   347  	// unconditionally include in API requests. By default, fields with
   348  	// empty values are omitted from API requests. However, any non-pointer,
   349  	// non-interface field appearing in ForceSendFields will be sent to the
   350  	// server regardless of whether the field is empty or not. This may be
   351  	// used to include empty fields in Patch requests.
   352  	ForceSendFields []string `json:"-"`
   353  
   354  	// NullFields is a list of field names (e.g. "NextPageToken") to include
   355  	// in API requests with the JSON null value. By default, fields with
   356  	// empty values are omitted from API requests. However, any field with
   357  	// an empty value appearing in NullFields will be sent to the server as
   358  	// null. It is an error if a field in this list has a non-empty value.
   359  	// This may be used to include null fields in Patch requests.
   360  	NullFields []string `json:"-"`
   361  }
   362  
   363  func (s *ListSlotPoolsResponse) MarshalJSON() ([]byte, error) {
   364  	type NoMethod ListSlotPoolsResponse
   365  	raw := NoMethod(*s)
   366  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   367  }
   368  
   369  // Operation: This resource represents a long-running operation that is
   370  // the result of a network API call.
   371  type Operation struct {
   372  	// Done: If the value is `false`, it means the operation is still in
   373  	// progress. If `true`, the operation is completed, and either `error`
   374  	// or `response` is available.
   375  	Done bool `json:"done,omitempty"`
   376  
   377  	// Error: The error result of the operation in case of failure or
   378  	// cancellation.
   379  	Error *Status `json:"error,omitempty"`
   380  
   381  	// Metadata: Service-specific metadata associated with the operation. It
   382  	// typically contains progress information and common metadata such as
   383  	// create time. Some services might not provide such metadata. Any
   384  	// method that returns a long-running operation should document the
   385  	// metadata type, if any.
   386  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   387  
   388  	// Name: The server-assigned name, which is only unique within the same
   389  	// service that originally returns it. If you use the default HTTP
   390  	// mapping, the `name` should be a resource name ending with
   391  	// `operations/{unique_id}`.
   392  	Name string `json:"name,omitempty"`
   393  
   394  	// Response: The normal response of the operation in case of success. If
   395  	// the original method returns no data on success, such as `Delete`, the
   396  	// response is `google.protobuf.Empty`. If the original method is
   397  	// standard `Get`/`Create`/`Update`, the response should be the
   398  	// resource. For other methods, the response should have the type
   399  	// `XxxResponse`, where `Xxx` is the original method name. For example,
   400  	// if the original method name is `TakeSnapshot()`, the inferred
   401  	// response type is `TakeSnapshotResponse`.
   402  	Response googleapi.RawMessage `json:"response,omitempty"`
   403  
   404  	// ServerResponse contains the HTTP response code and headers from the
   405  	// server.
   406  	googleapi.ServerResponse `json:"-"`
   407  
   408  	// ForceSendFields is a list of field names (e.g. "Done") to
   409  	// unconditionally include in API requests. By default, fields with
   410  	// empty values are omitted from API requests. However, any non-pointer,
   411  	// non-interface field appearing in ForceSendFields will be sent to the
   412  	// server regardless of whether the field is empty or not. This may be
   413  	// used to include empty fields in Patch requests.
   414  	ForceSendFields []string `json:"-"`
   415  
   416  	// NullFields is a list of field names (e.g. "Done") to include in API
   417  	// requests with the JSON null value. By default, fields with empty
   418  	// values are omitted from API requests. However, any field with an
   419  	// empty value appearing in NullFields will be sent to the server as
   420  	// null. It is an error if a field in this list has a non-empty value.
   421  	// This may be used to include null fields in Patch requests.
   422  	NullFields []string `json:"-"`
   423  }
   424  
   425  func (s *Operation) MarshalJSON() ([]byte, error) {
   426  	type NoMethod Operation
   427  	raw := NoMethod(*s)
   428  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   429  }
   430  
   431  // Reservation: A reservation is a mechanism used to guarantee slots to
   432  // users.
   433  type Reservation struct {
   434  	// Name: The resource name of the reservation, e.g.,
   435  	// "projects/*/locations/*/reservations/dev/team/product". Reservation
   436  	// names (e.g., "dev/team/product") exceeding a depth of six will fail
   437  	// with `google.rpc.Code.INVALID_ARGUMENT`.
   438  	Name string `json:"name,omitempty"`
   439  
   440  	// SlotCapacity: Maximum slots available to this reservation and its
   441  	// children. A slot is a unit of computational power in BigQuery, and
   442  	// serves as the unit of parallelism. In a scan of a multi-partitioned
   443  	// table, a single slot operates on a single partition of the table. If
   444  	// the new reservation's slot capacity exceed the parent's slot capacity
   445  	// or if total slot capacity of the new reservation and its siblings
   446  	// exceeds the parent's slot capacity, the request will fail with
   447  	// `google.rpc.Code.RESOURCE_EXHAUSTED`.
   448  	SlotCapacity int64 `json:"slotCapacity,omitempty,string"`
   449  
   450  	// UseParentReservation: If true, any query using this reservation will
   451  	// also be submitted to the parent reservation. This allows the query to
   452  	// share the additional slot capacity of the parent with other queries
   453  	// in the parent reservation. If the parent also has this field set to
   454  	// true, then this process will continue until it encounters a
   455  	// reservation for which this is false. If false, a query using this
   456  	// reservation will execute with the maximum slot capacity as specified
   457  	// above. If not specified, default value is true. Ignored for top-level
   458  	// reservation.
   459  	UseParentReservation bool `json:"useParentReservation,omitempty"`
   460  
   461  	// ServerResponse contains the HTTP response code and headers from the
   462  	// server.
   463  	googleapi.ServerResponse `json:"-"`
   464  
   465  	// ForceSendFields is a list of field names (e.g. "Name") to
   466  	// unconditionally include in API requests. By default, fields with
   467  	// empty values are omitted from API requests. However, any non-pointer,
   468  	// non-interface field appearing in ForceSendFields will be sent to the
   469  	// server regardless of whether the field is empty or not. This may be
   470  	// used to include empty fields in Patch requests.
   471  	ForceSendFields []string `json:"-"`
   472  
   473  	// NullFields is a list of field names (e.g. "Name") to include in API
   474  	// requests with the JSON null value. By default, fields with empty
   475  	// values are omitted from API requests. However, any field with an
   476  	// empty value appearing in NullFields will be sent to the server as
   477  	// null. It is an error if a field in this list has a non-empty value.
   478  	// This may be used to include null fields in Patch requests.
   479  	NullFields []string `json:"-"`
   480  }
   481  
   482  func (s *Reservation) MarshalJSON() ([]byte, error) {
   483  	type NoMethod Reservation
   484  	raw := NoMethod(*s)
   485  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   486  }
   487  
   488  // ReservationGrant: A ReservationGrant allows a project to submit jobs
   489  // of a certain type using slots from the specified reservation.
   490  type ReservationGrant struct {
   491  	// Grantee: The resource which will use the reservation. E.g.
   492  	// projects/myproject, folders/123, organizations/456.
   493  	Grantee string `json:"grantee,omitempty"`
   494  
   495  	// JobType: Which type of jobs will use the reservation.
   496  	//
   497  	// Possible values:
   498  	//   "JOB_TYPE_UNSPECIFIED" - Invalid type. Requests with this value
   499  	// will be rejected with error code `google.rpc.Code.INVALID_ARGUMENT`.
   500  	//   "PIPELINE" - Pipeline (load/export) jobs from the project will use
   501  	// the reservation.
   502  	//   "QUERY" - Query jobs from the project will use the reservation.
   503  	JobType string `json:"jobType,omitempty"`
   504  
   505  	// Name: Output only. Name of the resource. E.g.:
   506  	// projects/myproject/locations/eu/reservationGrants/123.
   507  	Name string `json:"name,omitempty"`
   508  
   509  	// Reservation: Resource name of the reservation. E.g.,
   510  	// projects/myproject/locations/eu/reservations/my_reservation. This
   511  	// reservation must be in the same location as the grant. This
   512  	// reservation should belong to the same parent project.
   513  	Reservation string `json:"reservation,omitempty"`
   514  
   515  	// State: Output only. State of the ReservationGrant.
   516  	//
   517  	// Possible values:
   518  	//   "STATE_UNSPECIFIED" - Invalid state value.
   519  	//   "PENDING" - Queries from grantee will be executed as on-demand, if
   520  	// related ReservationGrant is pending.
   521  	//   "ACTIVE" - ReservationGrant is ready.
   522  	State string `json:"state,omitempty"`
   523  
   524  	// ServerResponse contains the HTTP response code and headers from the
   525  	// server.
   526  	googleapi.ServerResponse `json:"-"`
   527  
   528  	// ForceSendFields is a list of field names (e.g. "Grantee") to
   529  	// unconditionally include in API requests. By default, fields with
   530  	// empty values are omitted from API requests. However, any non-pointer,
   531  	// non-interface field appearing in ForceSendFields will be sent to the
   532  	// server regardless of whether the field is empty or not. This may be
   533  	// used to include empty fields in Patch requests.
   534  	ForceSendFields []string `json:"-"`
   535  
   536  	// NullFields is a list of field names (e.g. "Grantee") to include in
   537  	// API requests with the JSON null value. By default, fields with empty
   538  	// values are omitted from API requests. However, any field with an
   539  	// empty value appearing in NullFields will be sent to the server as
   540  	// null. It is an error if a field in this list has a non-empty value.
   541  	// This may be used to include null fields in Patch requests.
   542  	NullFields []string `json:"-"`
   543  }
   544  
   545  func (s *ReservationGrant) MarshalJSON() ([]byte, error) {
   546  	type NoMethod ReservationGrant
   547  	raw := NoMethod(*s)
   548  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   549  }
   550  
   551  // SearchReservationGrantsResponse: The response for
   552  // ReservationService.SearchReservationGrants.
   553  type SearchReservationGrantsResponse struct {
   554  	// NextPageToken: Token to retrieve the next page of results, or empty
   555  	// if there are no more results in the list.
   556  	NextPageToken string `json:"nextPageToken,omitempty"`
   557  
   558  	// ReservationGrants: List of reservation grants visible to the user.
   559  	ReservationGrants []*ReservationGrant `json:"reservationGrants,omitempty"`
   560  
   561  	// ServerResponse contains the HTTP response code and headers from the
   562  	// server.
   563  	googleapi.ServerResponse `json:"-"`
   564  
   565  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   566  	// unconditionally include in API requests. By default, fields with
   567  	// empty values are omitted from API requests. However, any non-pointer,
   568  	// non-interface field appearing in ForceSendFields will be sent to the
   569  	// server regardless of whether the field is empty or not. This may be
   570  	// used to include empty fields in Patch requests.
   571  	ForceSendFields []string `json:"-"`
   572  
   573  	// NullFields is a list of field names (e.g. "NextPageToken") to include
   574  	// in API requests with the JSON null value. By default, fields with
   575  	// empty values are omitted from API requests. However, any field with
   576  	// an empty value appearing in NullFields will be sent to the server as
   577  	// null. It is an error if a field in this list has a non-empty value.
   578  	// This may be used to include null fields in Patch requests.
   579  	NullFields []string `json:"-"`
   580  }
   581  
   582  func (s *SearchReservationGrantsResponse) MarshalJSON() ([]byte, error) {
   583  	type NoMethod SearchReservationGrantsResponse
   584  	raw := NoMethod(*s)
   585  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   586  }
   587  
   588  // SlotPool: Slot pool is a way to purchase slots with some minimum
   589  // committed period of usage. Slot pool is immutable and cannot be
   590  // deleted until the end of the commitment period. After the end of the
   591  // commitment period, slots are still available but can be freely
   592  // removed any time. Annual commitments will automatically be downgraded
   593  // to monthly after the commitment ends. A slot pool resource exists as
   594  // a child resource of a top-level reservation. Sum of all the ACTIVE
   595  // pools slot_count is always equal to the reservation slot_capacity.
   596  type SlotPool struct {
   597  	// CommitmentEndTime: Output only. The end of the commitment period.
   598  	// Slot pool cannot be removed before commitment_end_time. It is
   599  	// applicable only for ACTIVE slot pools and is computed as a
   600  	// combination of the plan and the time when the slot pool became
   601  	// ACTIVE.
   602  	CommitmentEndTime string `json:"commitmentEndTime,omitempty"`
   603  
   604  	// FailureStatus: Output only. For FAILED slot pool, provides the reason
   605  	// of failure.
   606  	FailureStatus *Status `json:"failureStatus,omitempty"`
   607  
   608  	// Name: Output only. The resource name of the slot pool, e.g.,
   609  	// projects/myproject/locations/us-central1/reservations/myreservation/sl
   610  	// otPools/123
   611  	Name string `json:"name,omitempty"`
   612  
   613  	// Plan: Slot pool commitment plan.
   614  	//
   615  	// Possible values:
   616  	//   "COMMITMENT_PLAN_UNSPECIFIED" - Invalid plan value. Requests with
   617  	// this value will be rejected with error code
   618  	// `google.rpc.Code.INVALID_ARGUMENT`.
   619  	//   "FLEX" - Slot pool can be removed at any point, even after becoming
   620  	// ACTIVE.
   621  	//   "TRIAL" - Trial commitments have a committed period of 182 days
   622  	// after becoming ACTIVE. After that, they are converted to a new
   623  	// commitment based on the renewal_plan. Default renewal_plan for Trial
   624  	// commitment is Flex so that it can be deleted right after committed
   625  	// period ends.
   626  	//   "MONTHLY" - Slot pool cannot be removed for 30 days after becoming
   627  	// ACTIVE.
   628  	//   "ANNUAL" - Slot pool cannot be removed for 365 days after becoming
   629  	// ACTIVE. Note: annual commitments are automatically downgraded to
   630  	// monthly after 365 days.
   631  	Plan string `json:"plan,omitempty"`
   632  
   633  	// SlotCount: Number of slots in this pool.
   634  	SlotCount int64 `json:"slotCount,omitempty,string"`
   635  
   636  	// State: Output only.
   637  	//
   638  	// Possible values:
   639  	//   "STATE_UNSPECIFIED" - Invalid state value.
   640  	//   "PENDING" - Slot pool is pending provisioning. Pending slot pool
   641  	// does not contribute to the parent's slot_capacity.
   642  	//   "ACTIVE" - Once slots are provisioned, slot pool becomes active.
   643  	// slot_count is added to the parent's slot_capacity.
   644  	//   "FAILED" - Slot pool is failed to be activated by the backend.
   645  	State string `json:"state,omitempty"`
   646  
   647  	// ServerResponse contains the HTTP response code and headers from the
   648  	// server.
   649  	googleapi.ServerResponse `json:"-"`
   650  
   651  	// ForceSendFields is a list of field names (e.g. "CommitmentEndTime")
   652  	// to unconditionally include in API requests. By default, fields with
   653  	// empty values are omitted from API requests. However, any non-pointer,
   654  	// non-interface field appearing in ForceSendFields will be sent to the
   655  	// server regardless of whether the field is empty or not. This may be
   656  	// used to include empty fields in Patch requests.
   657  	ForceSendFields []string `json:"-"`
   658  
   659  	// NullFields is a list of field names (e.g. "CommitmentEndTime") to
   660  	// include in API requests with the JSON null value. By default, fields
   661  	// with empty values are omitted from API requests. However, any field
   662  	// with an empty value appearing in NullFields will be sent to the
   663  	// server as null. It is an error if a field in this list has a
   664  	// non-empty value. This may be used to include null fields in Patch
   665  	// requests.
   666  	NullFields []string `json:"-"`
   667  }
   668  
   669  func (s *SlotPool) MarshalJSON() ([]byte, error) {
   670  	type NoMethod SlotPool
   671  	raw := NoMethod(*s)
   672  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   673  }
   674  
   675  // Status: The `Status` type defines a logical error model that is
   676  // suitable for different programming environments, including REST APIs
   677  // and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each
   678  // `Status` message contains three pieces of data: error code, error
   679  // message, and error details. You can find out more about this error
   680  // model and how to work with it in the [API Design
   681  // Guide](https://cloud.google.com/apis/design/errors).
   682  type Status struct {
   683  	// Code: The status code, which should be an enum value of
   684  	// google.rpc.Code.
   685  	Code int64 `json:"code,omitempty"`
   686  
   687  	// Details: A list of messages that carry the error details. There is a
   688  	// common set of message types for APIs to use.
   689  	Details []googleapi.RawMessage `json:"details,omitempty"`
   690  
   691  	// Message: A developer-facing error message, which should be in
   692  	// English. Any user-facing error message should be localized and sent
   693  	// in the google.rpc.Status.details field, or localized by the client.
   694  	Message string `json:"message,omitempty"`
   695  
   696  	// ForceSendFields is a list of field names (e.g. "Code") to
   697  	// unconditionally include in API requests. By default, fields with
   698  	// empty values are omitted from API requests. However, any non-pointer,
   699  	// non-interface field appearing in ForceSendFields will be sent to the
   700  	// server regardless of whether the field is empty or not. This may be
   701  	// used to include empty fields in Patch requests.
   702  	ForceSendFields []string `json:"-"`
   703  
   704  	// NullFields is a list of field names (e.g. "Code") to include in API
   705  	// requests with the JSON null value. By default, fields with empty
   706  	// values are omitted from API requests. However, any field with an
   707  	// empty value appearing in NullFields will be sent to the server as
   708  	// null. It is an error if a field in this list has a non-empty value.
   709  	// This may be used to include null fields in Patch requests.
   710  	NullFields []string `json:"-"`
   711  }
   712  
   713  func (s *Status) MarshalJSON() ([]byte, error) {
   714  	type NoMethod Status
   715  	raw := NoMethod(*s)
   716  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   717  }
   718  
   719  // method id "bigqueryreservation.projects.locations.searchReservationGrants":
   720  
   721  type ProjectsLocationsSearchReservationGrantsCall struct {
   722  	s            *Service
   723  	parent       string
   724  	urlParams_   gensupport.URLParams
   725  	ifNoneMatch_ string
   726  	ctx_         context.Context
   727  	header_      http.Header
   728  }
   729  
   730  // SearchReservationGrants: Look up grants for a specified resource for
   731  // a particular region. If the request is about a project: 1) Grants
   732  // created on the project will be returned if they exist. 2) Otherwise
   733  // grants created on the closest ancestor will be returned. 3) Grants
   734  // for different JobTypes will all be returned. Same logic applies if
   735  // the request is about a folder. If the request is about an
   736  // organization, then grants created on the organization will be
   737  // returned (organization doesn't have ancestors). Comparing to
   738  // ListReservationGrants, there are two behavior differences: 1)
   739  // permission on the grantee will be verified in this API. 2) Hierarchy
   740  // lookup (project->folder->organization) happens in this API.
   741  func (r *ProjectsLocationsService) SearchReservationGrants(parent string) *ProjectsLocationsSearchReservationGrantsCall {
   742  	c := &ProjectsLocationsSearchReservationGrantsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   743  	c.parent = parent
   744  	return c
   745  }
   746  
   747  // PageSize sets the optional parameter "pageSize": The maximum number
   748  // of items to return.
   749  func (c *ProjectsLocationsSearchReservationGrantsCall) PageSize(pageSize int64) *ProjectsLocationsSearchReservationGrantsCall {
   750  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   751  	return c
   752  }
   753  
   754  // PageToken sets the optional parameter "pageToken": The
   755  // next_page_token value returned from a previous List request, if any.
   756  func (c *ProjectsLocationsSearchReservationGrantsCall) PageToken(pageToken string) *ProjectsLocationsSearchReservationGrantsCall {
   757  	c.urlParams_.Set("pageToken", pageToken)
   758  	return c
   759  }
   760  
   761  // Query sets the optional parameter "query": Please specify resource
   762  // name as grantee in the query. e.g., "grantee=projects/myproject"
   763  // "grantee=folders/123" "grantee=organizations/456"
   764  func (c *ProjectsLocationsSearchReservationGrantsCall) Query(query string) *ProjectsLocationsSearchReservationGrantsCall {
   765  	c.urlParams_.Set("query", query)
   766  	return c
   767  }
   768  
   769  // Fields allows partial responses to be retrieved. See
   770  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
   771  // for more information.
   772  func (c *ProjectsLocationsSearchReservationGrantsCall) Fields(s ...googleapi.Field) *ProjectsLocationsSearchReservationGrantsCall {
   773  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   774  	return c
   775  }
   776  
   777  // IfNoneMatch sets the optional parameter which makes the operation
   778  // fail if the object's ETag matches the given value. This is useful for
   779  // getting updates only after the object has changed since the last
   780  // request. Use googleapi.IsNotModified to check whether the response
   781  // error from Do is the result of In-None-Match.
   782  func (c *ProjectsLocationsSearchReservationGrantsCall) IfNoneMatch(entityTag string) *ProjectsLocationsSearchReservationGrantsCall {
   783  	c.ifNoneMatch_ = entityTag
   784  	return c
   785  }
   786  
   787  // Context sets the context to be used in this call's Do method. Any
   788  // pending HTTP request will be aborted if the provided context is
   789  // canceled.
   790  func (c *ProjectsLocationsSearchReservationGrantsCall) Context(ctx context.Context) *ProjectsLocationsSearchReservationGrantsCall {
   791  	c.ctx_ = ctx
   792  	return c
   793  }
   794  
   795  // Header returns an http.Header that can be modified by the caller to
   796  // add HTTP headers to the request.
   797  func (c *ProjectsLocationsSearchReservationGrantsCall) Header() http.Header {
   798  	if c.header_ == nil {
   799  		c.header_ = make(http.Header)
   800  	}
   801  	return c.header_
   802  }
   803  
   804  func (c *ProjectsLocationsSearchReservationGrantsCall) doRequest(alt string) (*http.Response, error) {
   805  	reqHeaders := make(http.Header)
   806  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201209")
   807  	for k, v := range c.header_ {
   808  		reqHeaders[k] = v
   809  	}
   810  	reqHeaders.Set("User-Agent", c.s.userAgent())
   811  	if c.ifNoneMatch_ != "" {
   812  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   813  	}
   814  	var body io.Reader = nil
   815  	c.urlParams_.Set("alt", alt)
   816  	c.urlParams_.Set("prettyPrint", "false")
   817  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+parent}:SearchReservationGrants")
   818  	urls += "?" + c.urlParams_.Encode()
   819  	req, err := http.NewRequest("GET", urls, body)
   820  	if err != nil {
   821  		return nil, err
   822  	}
   823  	req.Header = reqHeaders
   824  	googleapi.Expand(req.URL, map[string]string{
   825  		"parent": c.parent,
   826  	})
   827  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   828  }
   829  
   830  // Do executes the "bigqueryreservation.projects.locations.searchReservationGrants" call.
   831  // Exactly one of *SearchReservationGrantsResponse or error will be
   832  // non-nil. Any non-2xx status code is an error. Response headers are in
   833  // either *SearchReservationGrantsResponse.ServerResponse.Header or (if
   834  // a response was returned at all) in error.(*googleapi.Error).Header.
   835  // Use googleapi.IsNotModified to check whether the returned error was
   836  // because http.StatusNotModified was returned.
   837  func (c *ProjectsLocationsSearchReservationGrantsCall) Do(opts ...googleapi.CallOption) (*SearchReservationGrantsResponse, error) {
   838  	gensupport.SetOptions(c.urlParams_, opts...)
   839  	res, err := c.doRequest("json")
   840  	if res != nil && res.StatusCode == http.StatusNotModified {
   841  		if res.Body != nil {
   842  			res.Body.Close()
   843  		}
   844  		return nil, &googleapi.Error{
   845  			Code:   res.StatusCode,
   846  			Header: res.Header,
   847  		}
   848  	}
   849  	if err != nil {
   850  		return nil, err
   851  	}
   852  	defer googleapi.CloseBody(res)
   853  	if err := googleapi.CheckResponse(res); err != nil {
   854  		return nil, err
   855  	}
   856  	ret := &SearchReservationGrantsResponse{
   857  		ServerResponse: googleapi.ServerResponse{
   858  			Header:         res.Header,
   859  			HTTPStatusCode: res.StatusCode,
   860  		},
   861  	}
   862  	target := &ret
   863  	if err := gensupport.DecodeResponse(target, res); err != nil {
   864  		return nil, err
   865  	}
   866  	return ret, nil
   867  	// {
   868  	//   "description": "Look up grants for a specified resource for a particular region. If the request is about a project: 1) Grants created on the project will be returned if they exist. 2) Otherwise grants created on the closest ancestor will be returned. 3) Grants for different JobTypes will all be returned. Same logic applies if the request is about a folder. If the request is about an organization, then grants created on the organization will be returned (organization doesn't have ancestors). Comparing to ListReservationGrants, there are two behavior differences: 1) permission on the grantee will be verified in this API. 2) Hierarchy lookup (project-\u003efolder-\u003eorganization) happens in this API.",
   869  	//   "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}:SearchReservationGrants",
   870  	//   "httpMethod": "GET",
   871  	//   "id": "bigqueryreservation.projects.locations.searchReservationGrants",
   872  	//   "parameterOrder": [
   873  	//     "parent"
   874  	//   ],
   875  	//   "parameters": {
   876  	//     "pageSize": {
   877  	//       "description": "The maximum number of items to return.",
   878  	//       "format": "int32",
   879  	//       "location": "query",
   880  	//       "type": "integer"
   881  	//     },
   882  	//     "pageToken": {
   883  	//       "description": "The next_page_token value returned from a previous List request, if any.",
   884  	//       "location": "query",
   885  	//       "type": "string"
   886  	//     },
   887  	//     "parent": {
   888  	//       "description": "The parent resource name (containing project and location), which owns the grants. e.g.: \"projects/myproject/locations/us-central1\".",
   889  	//       "location": "path",
   890  	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
   891  	//       "required": true,
   892  	//       "type": "string"
   893  	//     },
   894  	//     "query": {
   895  	//       "description": "Please specify resource name as grantee in the query. e.g., \"grantee=projects/myproject\" \"grantee=folders/123\" \"grantee=organizations/456\"",
   896  	//       "location": "query",
   897  	//       "type": "string"
   898  	//     }
   899  	//   },
   900  	//   "path": "v1alpha2/{+parent}:SearchReservationGrants",
   901  	//   "response": {
   902  	//     "$ref": "SearchReservationGrantsResponse"
   903  	//   },
   904  	//   "scopes": [
   905  	//     "https://www.googleapis.com/auth/bigquery",
   906  	//     "https://www.googleapis.com/auth/cloud-platform"
   907  	//   ]
   908  	// }
   909  
   910  }
   911  
   912  // Pages invokes f for each page of results.
   913  // A non-nil error returned from f will halt the iteration.
   914  // The provided context supersedes any context provided to the Context method.
   915  func (c *ProjectsLocationsSearchReservationGrantsCall) Pages(ctx context.Context, f func(*SearchReservationGrantsResponse) error) error {
   916  	c.ctx_ = ctx
   917  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
   918  	for {
   919  		x, err := c.Do()
   920  		if err != nil {
   921  			return err
   922  		}
   923  		if err := f(x); err != nil {
   924  			return err
   925  		}
   926  		if x.NextPageToken == "" {
   927  			return nil
   928  		}
   929  		c.PageToken(x.NextPageToken)
   930  	}
   931  }
   932  
   933  // method id "bigqueryreservation.projects.locations.operations.cancel":
   934  
   935  type ProjectsLocationsOperationsCancelCall struct {
   936  	s          *Service
   937  	name       string
   938  	urlParams_ gensupport.URLParams
   939  	ctx_       context.Context
   940  	header_    http.Header
   941  }
   942  
   943  // Cancel: Starts asynchronous cancellation on a long-running operation.
   944  // The server makes a best effort to cancel the operation, but success
   945  // is not guaranteed. If the server doesn't support this method, it
   946  // returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use
   947  // Operations.GetOperation or other methods to check whether the
   948  // cancellation succeeded or whether the operation completed despite
   949  // cancellation. On successful cancellation, the operation is not
   950  // deleted; instead, it becomes an operation with an Operation.error
   951  // value with a google.rpc.Status.code of 1, corresponding to
   952  // `Code.CANCELLED`.
   953  func (r *ProjectsLocationsOperationsService) Cancel(name string) *ProjectsLocationsOperationsCancelCall {
   954  	c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   955  	c.name = name
   956  	return c
   957  }
   958  
   959  // Fields allows partial responses to be retrieved. See
   960  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
   961  // for more information.
   962  func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
   963  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   964  	return c
   965  }
   966  
   967  // Context sets the context to be used in this call's Do method. Any
   968  // pending HTTP request will be aborted if the provided context is
   969  // canceled.
   970  func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
   971  	c.ctx_ = ctx
   972  	return c
   973  }
   974  
   975  // Header returns an http.Header that can be modified by the caller to
   976  // add HTTP headers to the request.
   977  func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
   978  	if c.header_ == nil {
   979  		c.header_ = make(http.Header)
   980  	}
   981  	return c.header_
   982  }
   983  
   984  func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
   985  	reqHeaders := make(http.Header)
   986  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201209")
   987  	for k, v := range c.header_ {
   988  		reqHeaders[k] = v
   989  	}
   990  	reqHeaders.Set("User-Agent", c.s.userAgent())
   991  	var body io.Reader = nil
   992  	c.urlParams_.Set("alt", alt)
   993  	c.urlParams_.Set("prettyPrint", "false")
   994  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+name}:cancel")
   995  	urls += "?" + c.urlParams_.Encode()
   996  	req, err := http.NewRequest("POST", urls, body)
   997  	if err != nil {
   998  		return nil, err
   999  	}
  1000  	req.Header = reqHeaders
  1001  	googleapi.Expand(req.URL, map[string]string{
  1002  		"name": c.name,
  1003  	})
  1004  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1005  }
  1006  
  1007  // Do executes the "bigqueryreservation.projects.locations.operations.cancel" call.
  1008  // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  1009  // code is an error. Response headers are in either
  1010  // *Empty.ServerResponse.Header or (if a response was returned at all)
  1011  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1012  // check whether the returned error was because http.StatusNotModified
  1013  // was returned.
  1014  func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1015  	gensupport.SetOptions(c.urlParams_, opts...)
  1016  	res, err := c.doRequest("json")
  1017  	if res != nil && res.StatusCode == http.StatusNotModified {
  1018  		if res.Body != nil {
  1019  			res.Body.Close()
  1020  		}
  1021  		return nil, &googleapi.Error{
  1022  			Code:   res.StatusCode,
  1023  			Header: res.Header,
  1024  		}
  1025  	}
  1026  	if err != nil {
  1027  		return nil, err
  1028  	}
  1029  	defer googleapi.CloseBody(res)
  1030  	if err := googleapi.CheckResponse(res); err != nil {
  1031  		return nil, err
  1032  	}
  1033  	ret := &Empty{
  1034  		ServerResponse: googleapi.ServerResponse{
  1035  			Header:         res.Header,
  1036  			HTTPStatusCode: res.StatusCode,
  1037  		},
  1038  	}
  1039  	target := &ret
  1040  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1041  		return nil, err
  1042  	}
  1043  	return ret, nil
  1044  	// {
  1045  	//   "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.",
  1046  	//   "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel",
  1047  	//   "httpMethod": "POST",
  1048  	//   "id": "bigqueryreservation.projects.locations.operations.cancel",
  1049  	//   "parameterOrder": [
  1050  	//     "name"
  1051  	//   ],
  1052  	//   "parameters": {
  1053  	//     "name": {
  1054  	//       "description": "The name of the operation resource to be cancelled.",
  1055  	//       "location": "path",
  1056  	//       "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  1057  	//       "required": true,
  1058  	//       "type": "string"
  1059  	//     }
  1060  	//   },
  1061  	//   "path": "v1alpha2/{+name}:cancel",
  1062  	//   "response": {
  1063  	//     "$ref": "Empty"
  1064  	//   },
  1065  	//   "scopes": [
  1066  	//     "https://www.googleapis.com/auth/bigquery",
  1067  	//     "https://www.googleapis.com/auth/cloud-platform"
  1068  	//   ]
  1069  	// }
  1070  
  1071  }
  1072  
  1073  // method id "bigqueryreservation.projects.locations.operations.get":
  1074  
  1075  type ProjectsLocationsOperationsGetCall struct {
  1076  	s            *Service
  1077  	name         string
  1078  	urlParams_   gensupport.URLParams
  1079  	ifNoneMatch_ string
  1080  	ctx_         context.Context
  1081  	header_      http.Header
  1082  }
  1083  
  1084  // Get: Gets the latest state of a long-running operation. Clients can
  1085  // use this method to poll the operation result at intervals as
  1086  // recommended by the API service.
  1087  func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  1088  	c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1089  	c.name = name
  1090  	return c
  1091  }
  1092  
  1093  // Fields allows partial responses to be retrieved. See
  1094  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1095  // for more information.
  1096  func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  1097  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1098  	return c
  1099  }
  1100  
  1101  // IfNoneMatch sets the optional parameter which makes the operation
  1102  // fail if the object's ETag matches the given value. This is useful for
  1103  // getting updates only after the object has changed since the last
  1104  // request. Use googleapi.IsNotModified to check whether the response
  1105  // error from Do is the result of In-None-Match.
  1106  func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  1107  	c.ifNoneMatch_ = entityTag
  1108  	return c
  1109  }
  1110  
  1111  // Context sets the context to be used in this call's Do method. Any
  1112  // pending HTTP request will be aborted if the provided context is
  1113  // canceled.
  1114  func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  1115  	c.ctx_ = ctx
  1116  	return c
  1117  }
  1118  
  1119  // Header returns an http.Header that can be modified by the caller to
  1120  // add HTTP headers to the request.
  1121  func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  1122  	if c.header_ == nil {
  1123  		c.header_ = make(http.Header)
  1124  	}
  1125  	return c.header_
  1126  }
  1127  
  1128  func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  1129  	reqHeaders := make(http.Header)
  1130  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201209")
  1131  	for k, v := range c.header_ {
  1132  		reqHeaders[k] = v
  1133  	}
  1134  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1135  	if c.ifNoneMatch_ != "" {
  1136  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1137  	}
  1138  	var body io.Reader = nil
  1139  	c.urlParams_.Set("alt", alt)
  1140  	c.urlParams_.Set("prettyPrint", "false")
  1141  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+name}")
  1142  	urls += "?" + c.urlParams_.Encode()
  1143  	req, err := http.NewRequest("GET", urls, body)
  1144  	if err != nil {
  1145  		return nil, err
  1146  	}
  1147  	req.Header = reqHeaders
  1148  	googleapi.Expand(req.URL, map[string]string{
  1149  		"name": c.name,
  1150  	})
  1151  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1152  }
  1153  
  1154  // Do executes the "bigqueryreservation.projects.locations.operations.get" call.
  1155  // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1156  // status code is an error. Response headers are in either
  1157  // *Operation.ServerResponse.Header or (if a response was returned at
  1158  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1159  // to check whether the returned error was because
  1160  // http.StatusNotModified was returned.
  1161  func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1162  	gensupport.SetOptions(c.urlParams_, opts...)
  1163  	res, err := c.doRequest("json")
  1164  	if res != nil && res.StatusCode == http.StatusNotModified {
  1165  		if res.Body != nil {
  1166  			res.Body.Close()
  1167  		}
  1168  		return nil, &googleapi.Error{
  1169  			Code:   res.StatusCode,
  1170  			Header: res.Header,
  1171  		}
  1172  	}
  1173  	if err != nil {
  1174  		return nil, err
  1175  	}
  1176  	defer googleapi.CloseBody(res)
  1177  	if err := googleapi.CheckResponse(res); err != nil {
  1178  		return nil, err
  1179  	}
  1180  	ret := &Operation{
  1181  		ServerResponse: googleapi.ServerResponse{
  1182  			Header:         res.Header,
  1183  			HTTPStatusCode: res.StatusCode,
  1184  		},
  1185  	}
  1186  	target := &ret
  1187  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1188  		return nil, err
  1189  	}
  1190  	return ret, nil
  1191  	// {
  1192  	//   "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
  1193  	//   "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}",
  1194  	//   "httpMethod": "GET",
  1195  	//   "id": "bigqueryreservation.projects.locations.operations.get",
  1196  	//   "parameterOrder": [
  1197  	//     "name"
  1198  	//   ],
  1199  	//   "parameters": {
  1200  	//     "name": {
  1201  	//       "description": "The name of the operation resource.",
  1202  	//       "location": "path",
  1203  	//       "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
  1204  	//       "required": true,
  1205  	//       "type": "string"
  1206  	//     }
  1207  	//   },
  1208  	//   "path": "v1alpha2/{+name}",
  1209  	//   "response": {
  1210  	//     "$ref": "Operation"
  1211  	//   },
  1212  	//   "scopes": [
  1213  	//     "https://www.googleapis.com/auth/bigquery",
  1214  	//     "https://www.googleapis.com/auth/cloud-platform"
  1215  	//   ]
  1216  	// }
  1217  
  1218  }
  1219  
  1220  // method id "bigqueryreservation.projects.locations.reservationGrants.create":
  1221  
  1222  type ProjectsLocationsReservationGrantsCreateCall struct {
  1223  	s                *Service
  1224  	parent           string
  1225  	reservationgrant *ReservationGrant
  1226  	urlParams_       gensupport.URLParams
  1227  	ctx_             context.Context
  1228  	header_          http.Header
  1229  }
  1230  
  1231  // Create: Returns `google.rpc.Code.PERMISSION_DENIED` if user does not
  1232  // have 'bigquery.admin' permissions on the project using the
  1233  // reservation and the project that owns this reservation. Returns
  1234  // `google.rpc.Code.INVALID_ARGUMENT` when location of the grant does
  1235  // not match location of the reservation.
  1236  func (r *ProjectsLocationsReservationGrantsService) Create(parent string, reservationgrant *ReservationGrant) *ProjectsLocationsReservationGrantsCreateCall {
  1237  	c := &ProjectsLocationsReservationGrantsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1238  	c.parent = parent
  1239  	c.reservationgrant = reservationgrant
  1240  	return c
  1241  }
  1242  
  1243  // Fields allows partial responses to be retrieved. See
  1244  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1245  // for more information.
  1246  func (c *ProjectsLocationsReservationGrantsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsReservationGrantsCreateCall {
  1247  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1248  	return c
  1249  }
  1250  
  1251  // Context sets the context to be used in this call's Do method. Any
  1252  // pending HTTP request will be aborted if the provided context is
  1253  // canceled.
  1254  func (c *ProjectsLocationsReservationGrantsCreateCall) Context(ctx context.Context) *ProjectsLocationsReservationGrantsCreateCall {
  1255  	c.ctx_ = ctx
  1256  	return c
  1257  }
  1258  
  1259  // Header returns an http.Header that can be modified by the caller to
  1260  // add HTTP headers to the request.
  1261  func (c *ProjectsLocationsReservationGrantsCreateCall) Header() http.Header {
  1262  	if c.header_ == nil {
  1263  		c.header_ = make(http.Header)
  1264  	}
  1265  	return c.header_
  1266  }
  1267  
  1268  func (c *ProjectsLocationsReservationGrantsCreateCall) doRequest(alt string) (*http.Response, error) {
  1269  	reqHeaders := make(http.Header)
  1270  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201209")
  1271  	for k, v := range c.header_ {
  1272  		reqHeaders[k] = v
  1273  	}
  1274  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1275  	var body io.Reader = nil
  1276  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservationgrant)
  1277  	if err != nil {
  1278  		return nil, err
  1279  	}
  1280  	reqHeaders.Set("Content-Type", "application/json")
  1281  	c.urlParams_.Set("alt", alt)
  1282  	c.urlParams_.Set("prettyPrint", "false")
  1283  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+parent}/reservationGrants")
  1284  	urls += "?" + c.urlParams_.Encode()
  1285  	req, err := http.NewRequest("POST", urls, body)
  1286  	if err != nil {
  1287  		return nil, err
  1288  	}
  1289  	req.Header = reqHeaders
  1290  	googleapi.Expand(req.URL, map[string]string{
  1291  		"parent": c.parent,
  1292  	})
  1293  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1294  }
  1295  
  1296  // Do executes the "bigqueryreservation.projects.locations.reservationGrants.create" call.
  1297  // Exactly one of *ReservationGrant or error will be non-nil. Any
  1298  // non-2xx status code is an error. Response headers are in either
  1299  // *ReservationGrant.ServerResponse.Header or (if a response was
  1300  // returned at all) in error.(*googleapi.Error).Header. Use
  1301  // googleapi.IsNotModified to check whether the returned error was
  1302  // because http.StatusNotModified was returned.
  1303  func (c *ProjectsLocationsReservationGrantsCreateCall) Do(opts ...googleapi.CallOption) (*ReservationGrant, error) {
  1304  	gensupport.SetOptions(c.urlParams_, opts...)
  1305  	res, err := c.doRequest("json")
  1306  	if res != nil && res.StatusCode == http.StatusNotModified {
  1307  		if res.Body != nil {
  1308  			res.Body.Close()
  1309  		}
  1310  		return nil, &googleapi.Error{
  1311  			Code:   res.StatusCode,
  1312  			Header: res.Header,
  1313  		}
  1314  	}
  1315  	if err != nil {
  1316  		return nil, err
  1317  	}
  1318  	defer googleapi.CloseBody(res)
  1319  	if err := googleapi.CheckResponse(res); err != nil {
  1320  		return nil, err
  1321  	}
  1322  	ret := &ReservationGrant{
  1323  		ServerResponse: googleapi.ServerResponse{
  1324  			Header:         res.Header,
  1325  			HTTPStatusCode: res.StatusCode,
  1326  		},
  1327  	}
  1328  	target := &ret
  1329  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1330  		return nil, err
  1331  	}
  1332  	return ret, nil
  1333  	// {
  1334  	//   "description": "Returns `google.rpc.Code.PERMISSION_DENIED` if user does not have 'bigquery.admin' permissions on the project using the reservation and the project that owns this reservation. Returns `google.rpc.Code.INVALID_ARGUMENT` when location of the grant does not match location of the reservation.",
  1335  	//   "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}/reservationGrants",
  1336  	//   "httpMethod": "POST",
  1337  	//   "id": "bigqueryreservation.projects.locations.reservationGrants.create",
  1338  	//   "parameterOrder": [
  1339  	//     "parent"
  1340  	//   ],
  1341  	//   "parameters": {
  1342  	//     "parent": {
  1343  	//       "description": "The parent resource name of the reservation grant E.g.: projects/myproject/location/eu.",
  1344  	//       "location": "path",
  1345  	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
  1346  	//       "required": true,
  1347  	//       "type": "string"
  1348  	//     }
  1349  	//   },
  1350  	//   "path": "v1alpha2/{+parent}/reservationGrants",
  1351  	//   "request": {
  1352  	//     "$ref": "ReservationGrant"
  1353  	//   },
  1354  	//   "response": {
  1355  	//     "$ref": "ReservationGrant"
  1356  	//   },
  1357  	//   "scopes": [
  1358  	//     "https://www.googleapis.com/auth/bigquery",
  1359  	//     "https://www.googleapis.com/auth/cloud-platform"
  1360  	//   ]
  1361  	// }
  1362  
  1363  }
  1364  
  1365  // method id "bigqueryreservation.projects.locations.reservationGrants.delete":
  1366  
  1367  type ProjectsLocationsReservationGrantsDeleteCall struct {
  1368  	s          *Service
  1369  	name       string
  1370  	urlParams_ gensupport.URLParams
  1371  	ctx_       context.Context
  1372  	header_    http.Header
  1373  }
  1374  
  1375  // Delete: Deletes a reservation grant. No expansion will happen. E.g:
  1376  // organizationA contains project1 and project2. Reservation res1
  1377  // exists. CreateReservationGrant was invoked previously and following
  1378  // grants were created explicitly: Then deletion of won't affect . After
  1379  // deletion of , queries from project1 will still use res1, while
  1380  // queries from project2 will use on-demand mode.
  1381  func (r *ProjectsLocationsReservationGrantsService) Delete(name string) *ProjectsLocationsReservationGrantsDeleteCall {
  1382  	c := &ProjectsLocationsReservationGrantsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1383  	c.name = name
  1384  	return c
  1385  }
  1386  
  1387  // Fields allows partial responses to be retrieved. See
  1388  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1389  // for more information.
  1390  func (c *ProjectsLocationsReservationGrantsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsReservationGrantsDeleteCall {
  1391  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1392  	return c
  1393  }
  1394  
  1395  // Context sets the context to be used in this call's Do method. Any
  1396  // pending HTTP request will be aborted if the provided context is
  1397  // canceled.
  1398  func (c *ProjectsLocationsReservationGrantsDeleteCall) Context(ctx context.Context) *ProjectsLocationsReservationGrantsDeleteCall {
  1399  	c.ctx_ = ctx
  1400  	return c
  1401  }
  1402  
  1403  // Header returns an http.Header that can be modified by the caller to
  1404  // add HTTP headers to the request.
  1405  func (c *ProjectsLocationsReservationGrantsDeleteCall) Header() http.Header {
  1406  	if c.header_ == nil {
  1407  		c.header_ = make(http.Header)
  1408  	}
  1409  	return c.header_
  1410  }
  1411  
  1412  func (c *ProjectsLocationsReservationGrantsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1413  	reqHeaders := make(http.Header)
  1414  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201209")
  1415  	for k, v := range c.header_ {
  1416  		reqHeaders[k] = v
  1417  	}
  1418  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1419  	var body io.Reader = nil
  1420  	c.urlParams_.Set("alt", alt)
  1421  	c.urlParams_.Set("prettyPrint", "false")
  1422  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+name}")
  1423  	urls += "?" + c.urlParams_.Encode()
  1424  	req, err := http.NewRequest("DELETE", urls, body)
  1425  	if err != nil {
  1426  		return nil, err
  1427  	}
  1428  	req.Header = reqHeaders
  1429  	googleapi.Expand(req.URL, map[string]string{
  1430  		"name": c.name,
  1431  	})
  1432  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1433  }
  1434  
  1435  // Do executes the "bigqueryreservation.projects.locations.reservationGrants.delete" call.
  1436  // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  1437  // code is an error. Response headers are in either
  1438  // *Empty.ServerResponse.Header or (if a response was returned at all)
  1439  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1440  // check whether the returned error was because http.StatusNotModified
  1441  // was returned.
  1442  func (c *ProjectsLocationsReservationGrantsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1443  	gensupport.SetOptions(c.urlParams_, opts...)
  1444  	res, err := c.doRequest("json")
  1445  	if res != nil && res.StatusCode == http.StatusNotModified {
  1446  		if res.Body != nil {
  1447  			res.Body.Close()
  1448  		}
  1449  		return nil, &googleapi.Error{
  1450  			Code:   res.StatusCode,
  1451  			Header: res.Header,
  1452  		}
  1453  	}
  1454  	if err != nil {
  1455  		return nil, err
  1456  	}
  1457  	defer googleapi.CloseBody(res)
  1458  	if err := googleapi.CheckResponse(res); err != nil {
  1459  		return nil, err
  1460  	}
  1461  	ret := &Empty{
  1462  		ServerResponse: googleapi.ServerResponse{
  1463  			Header:         res.Header,
  1464  			HTTPStatusCode: res.StatusCode,
  1465  		},
  1466  	}
  1467  	target := &ret
  1468  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1469  		return nil, err
  1470  	}
  1471  	return ret, nil
  1472  	// {
  1473  	//   "description": "Deletes a reservation grant. No expansion will happen. E.g: organizationA contains project1 and project2. Reservation res1 exists. CreateReservationGrant was invoked previously and following grants were created explicitly: Then deletion of won't affect . After deletion of , queries from project1 will still use res1, while queries from project2 will use on-demand mode.",
  1474  	//   "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}/reservationGrants/{reservationGrantsId}",
  1475  	//   "httpMethod": "DELETE",
  1476  	//   "id": "bigqueryreservation.projects.locations.reservationGrants.delete",
  1477  	//   "parameterOrder": [
  1478  	//     "name"
  1479  	//   ],
  1480  	//   "parameters": {
  1481  	//     "name": {
  1482  	//       "description": "Name of the resource, e.g.: projects/myproject/locations/eu/reservationGrants/123",
  1483  	//       "location": "path",
  1484  	//       "pattern": "^projects/[^/]+/locations/[^/]+/reservationGrants/[^/]+$",
  1485  	//       "required": true,
  1486  	//       "type": "string"
  1487  	//     }
  1488  	//   },
  1489  	//   "path": "v1alpha2/{+name}",
  1490  	//   "response": {
  1491  	//     "$ref": "Empty"
  1492  	//   },
  1493  	//   "scopes": [
  1494  	//     "https://www.googleapis.com/auth/bigquery",
  1495  	//     "https://www.googleapis.com/auth/cloud-platform"
  1496  	//   ]
  1497  	// }
  1498  
  1499  }
  1500  
  1501  // method id "bigqueryreservation.projects.locations.reservationGrants.list":
  1502  
  1503  type ProjectsLocationsReservationGrantsListCall struct {
  1504  	s            *Service
  1505  	parent       string
  1506  	urlParams_   gensupport.URLParams
  1507  	ifNoneMatch_ string
  1508  	ctx_         context.Context
  1509  	header_      http.Header
  1510  }
  1511  
  1512  // List: Lists reservation grants. Only explicitly created grants will
  1513  // be returned. E.g: organizationA contains project1 and project2.
  1514  // Reservation res1 exists. CreateReservationGrant was invoked
  1515  // previously and following grants were created explicitly: Then this
  1516  // API will just return the above two grants for reservation res1, and
  1517  // no expansion/merge will happen.
  1518  func (r *ProjectsLocationsReservationGrantsService) List(parent string) *ProjectsLocationsReservationGrantsListCall {
  1519  	c := &ProjectsLocationsReservationGrantsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1520  	c.parent = parent
  1521  	return c
  1522  }
  1523  
  1524  // PageSize sets the optional parameter "pageSize": The maximum number
  1525  // of items to return.
  1526  func (c *ProjectsLocationsReservationGrantsListCall) PageSize(pageSize int64) *ProjectsLocationsReservationGrantsListCall {
  1527  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1528  	return c
  1529  }
  1530  
  1531  // PageToken sets the optional parameter "pageToken": The
  1532  // next_page_token value returned from a previous List request, if any.
  1533  func (c *ProjectsLocationsReservationGrantsListCall) PageToken(pageToken string) *ProjectsLocationsReservationGrantsListCall {
  1534  	c.urlParams_.Set("pageToken", pageToken)
  1535  	return c
  1536  }
  1537  
  1538  // Fields allows partial responses to be retrieved. See
  1539  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1540  // for more information.
  1541  func (c *ProjectsLocationsReservationGrantsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsReservationGrantsListCall {
  1542  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1543  	return c
  1544  }
  1545  
  1546  // IfNoneMatch sets the optional parameter which makes the operation
  1547  // fail if the object's ETag matches the given value. This is useful for
  1548  // getting updates only after the object has changed since the last
  1549  // request. Use googleapi.IsNotModified to check whether the response
  1550  // error from Do is the result of In-None-Match.
  1551  func (c *ProjectsLocationsReservationGrantsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsReservationGrantsListCall {
  1552  	c.ifNoneMatch_ = entityTag
  1553  	return c
  1554  }
  1555  
  1556  // Context sets the context to be used in this call's Do method. Any
  1557  // pending HTTP request will be aborted if the provided context is
  1558  // canceled.
  1559  func (c *ProjectsLocationsReservationGrantsListCall) Context(ctx context.Context) *ProjectsLocationsReservationGrantsListCall {
  1560  	c.ctx_ = ctx
  1561  	return c
  1562  }
  1563  
  1564  // Header returns an http.Header that can be modified by the caller to
  1565  // add HTTP headers to the request.
  1566  func (c *ProjectsLocationsReservationGrantsListCall) Header() http.Header {
  1567  	if c.header_ == nil {
  1568  		c.header_ = make(http.Header)
  1569  	}
  1570  	return c.header_
  1571  }
  1572  
  1573  func (c *ProjectsLocationsReservationGrantsListCall) doRequest(alt string) (*http.Response, error) {
  1574  	reqHeaders := make(http.Header)
  1575  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201209")
  1576  	for k, v := range c.header_ {
  1577  		reqHeaders[k] = v
  1578  	}
  1579  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1580  	if c.ifNoneMatch_ != "" {
  1581  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1582  	}
  1583  	var body io.Reader = nil
  1584  	c.urlParams_.Set("alt", alt)
  1585  	c.urlParams_.Set("prettyPrint", "false")
  1586  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+parent}/reservationGrants")
  1587  	urls += "?" + c.urlParams_.Encode()
  1588  	req, err := http.NewRequest("GET", urls, body)
  1589  	if err != nil {
  1590  		return nil, err
  1591  	}
  1592  	req.Header = reqHeaders
  1593  	googleapi.Expand(req.URL, map[string]string{
  1594  		"parent": c.parent,
  1595  	})
  1596  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1597  }
  1598  
  1599  // Do executes the "bigqueryreservation.projects.locations.reservationGrants.list" call.
  1600  // Exactly one of *ListReservationGrantsResponse or error will be
  1601  // non-nil. Any non-2xx status code is an error. Response headers are in
  1602  // either *ListReservationGrantsResponse.ServerResponse.Header or (if a
  1603  // response was returned at all) in error.(*googleapi.Error).Header. Use
  1604  // googleapi.IsNotModified to check whether the returned error was
  1605  // because http.StatusNotModified was returned.
  1606  func (c *ProjectsLocationsReservationGrantsListCall) Do(opts ...googleapi.CallOption) (*ListReservationGrantsResponse, error) {
  1607  	gensupport.SetOptions(c.urlParams_, opts...)
  1608  	res, err := c.doRequest("json")
  1609  	if res != nil && res.StatusCode == http.StatusNotModified {
  1610  		if res.Body != nil {
  1611  			res.Body.Close()
  1612  		}
  1613  		return nil, &googleapi.Error{
  1614  			Code:   res.StatusCode,
  1615  			Header: res.Header,
  1616  		}
  1617  	}
  1618  	if err != nil {
  1619  		return nil, err
  1620  	}
  1621  	defer googleapi.CloseBody(res)
  1622  	if err := googleapi.CheckResponse(res); err != nil {
  1623  		return nil, err
  1624  	}
  1625  	ret := &ListReservationGrantsResponse{
  1626  		ServerResponse: googleapi.ServerResponse{
  1627  			Header:         res.Header,
  1628  			HTTPStatusCode: res.StatusCode,
  1629  		},
  1630  	}
  1631  	target := &ret
  1632  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1633  		return nil, err
  1634  	}
  1635  	return ret, nil
  1636  	// {
  1637  	//   "description": "Lists reservation grants. Only explicitly created grants will be returned. E.g: organizationA contains project1 and project2. Reservation res1 exists. CreateReservationGrant was invoked previously and following grants were created explicitly: Then this API will just return the above two grants for reservation res1, and no expansion/merge will happen.",
  1638  	//   "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}/reservationGrants",
  1639  	//   "httpMethod": "GET",
  1640  	//   "id": "bigqueryreservation.projects.locations.reservationGrants.list",
  1641  	//   "parameterOrder": [
  1642  	//     "parent"
  1643  	//   ],
  1644  	//   "parameters": {
  1645  	//     "pageSize": {
  1646  	//       "description": "The maximum number of items to return.",
  1647  	//       "format": "int32",
  1648  	//       "location": "query",
  1649  	//       "type": "integer"
  1650  	//     },
  1651  	//     "pageToken": {
  1652  	//       "description": "The next_page_token value returned from a previous List request, if any.",
  1653  	//       "location": "query",
  1654  	//       "type": "string"
  1655  	//     },
  1656  	//     "parent": {
  1657  	//       "description": "The parent resource name e.g.: projects/myproject/location/eu.",
  1658  	//       "location": "path",
  1659  	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
  1660  	//       "required": true,
  1661  	//       "type": "string"
  1662  	//     }
  1663  	//   },
  1664  	//   "path": "v1alpha2/{+parent}/reservationGrants",
  1665  	//   "response": {
  1666  	//     "$ref": "ListReservationGrantsResponse"
  1667  	//   },
  1668  	//   "scopes": [
  1669  	//     "https://www.googleapis.com/auth/bigquery",
  1670  	//     "https://www.googleapis.com/auth/cloud-platform"
  1671  	//   ]
  1672  	// }
  1673  
  1674  }
  1675  
  1676  // Pages invokes f for each page of results.
  1677  // A non-nil error returned from f will halt the iteration.
  1678  // The provided context supersedes any context provided to the Context method.
  1679  func (c *ProjectsLocationsReservationGrantsListCall) Pages(ctx context.Context, f func(*ListReservationGrantsResponse) error) error {
  1680  	c.ctx_ = ctx
  1681  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1682  	for {
  1683  		x, err := c.Do()
  1684  		if err != nil {
  1685  			return err
  1686  		}
  1687  		if err := f(x); err != nil {
  1688  			return err
  1689  		}
  1690  		if x.NextPageToken == "" {
  1691  			return nil
  1692  		}
  1693  		c.PageToken(x.NextPageToken)
  1694  	}
  1695  }
  1696  
  1697  // method id "bigqueryreservation.projects.locations.reservations.create":
  1698  
  1699  type ProjectsLocationsReservationsCreateCall struct {
  1700  	s           *Service
  1701  	parent      string
  1702  	reservation *Reservation
  1703  	urlParams_  gensupport.URLParams
  1704  	ctx_        context.Context
  1705  	header_     http.Header
  1706  }
  1707  
  1708  // Create: Creates a new reservation resource. Multiple reservations are
  1709  // created if the ancestor reservations do not exist.
  1710  func (r *ProjectsLocationsReservationsService) Create(parent string, reservation *Reservation) *ProjectsLocationsReservationsCreateCall {
  1711  	c := &ProjectsLocationsReservationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1712  	c.parent = parent
  1713  	c.reservation = reservation
  1714  	return c
  1715  }
  1716  
  1717  // ReservationId sets the optional parameter "reservationId": The
  1718  // reservation ID relative to the parent, e.g., "dev". This field must
  1719  // only contain alphanumeric characters.
  1720  func (c *ProjectsLocationsReservationsCreateCall) ReservationId(reservationId string) *ProjectsLocationsReservationsCreateCall {
  1721  	c.urlParams_.Set("reservationId", reservationId)
  1722  	return c
  1723  }
  1724  
  1725  // Fields allows partial responses to be retrieved. See
  1726  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1727  // for more information.
  1728  func (c *ProjectsLocationsReservationsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsReservationsCreateCall {
  1729  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1730  	return c
  1731  }
  1732  
  1733  // Context sets the context to be used in this call's Do method. Any
  1734  // pending HTTP request will be aborted if the provided context is
  1735  // canceled.
  1736  func (c *ProjectsLocationsReservationsCreateCall) Context(ctx context.Context) *ProjectsLocationsReservationsCreateCall {
  1737  	c.ctx_ = ctx
  1738  	return c
  1739  }
  1740  
  1741  // Header returns an http.Header that can be modified by the caller to
  1742  // add HTTP headers to the request.
  1743  func (c *ProjectsLocationsReservationsCreateCall) Header() http.Header {
  1744  	if c.header_ == nil {
  1745  		c.header_ = make(http.Header)
  1746  	}
  1747  	return c.header_
  1748  }
  1749  
  1750  func (c *ProjectsLocationsReservationsCreateCall) doRequest(alt string) (*http.Response, error) {
  1751  	reqHeaders := make(http.Header)
  1752  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201209")
  1753  	for k, v := range c.header_ {
  1754  		reqHeaders[k] = v
  1755  	}
  1756  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1757  	var body io.Reader = nil
  1758  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation)
  1759  	if err != nil {
  1760  		return nil, err
  1761  	}
  1762  	reqHeaders.Set("Content-Type", "application/json")
  1763  	c.urlParams_.Set("alt", alt)
  1764  	c.urlParams_.Set("prettyPrint", "false")
  1765  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+parent}/reservations")
  1766  	urls += "?" + c.urlParams_.Encode()
  1767  	req, err := http.NewRequest("POST", urls, body)
  1768  	if err != nil {
  1769  		return nil, err
  1770  	}
  1771  	req.Header = reqHeaders
  1772  	googleapi.Expand(req.URL, map[string]string{
  1773  		"parent": c.parent,
  1774  	})
  1775  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1776  }
  1777  
  1778  // Do executes the "bigqueryreservation.projects.locations.reservations.create" call.
  1779  // Exactly one of *Reservation or error will be non-nil. Any non-2xx
  1780  // status code is an error. Response headers are in either
  1781  // *Reservation.ServerResponse.Header or (if a response was returned at
  1782  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1783  // to check whether the returned error was because
  1784  // http.StatusNotModified was returned.
  1785  func (c *ProjectsLocationsReservationsCreateCall) Do(opts ...googleapi.CallOption) (*Reservation, error) {
  1786  	gensupport.SetOptions(c.urlParams_, opts...)
  1787  	res, err := c.doRequest("json")
  1788  	if res != nil && res.StatusCode == http.StatusNotModified {
  1789  		if res.Body != nil {
  1790  			res.Body.Close()
  1791  		}
  1792  		return nil, &googleapi.Error{
  1793  			Code:   res.StatusCode,
  1794  			Header: res.Header,
  1795  		}
  1796  	}
  1797  	if err != nil {
  1798  		return nil, err
  1799  	}
  1800  	defer googleapi.CloseBody(res)
  1801  	if err := googleapi.CheckResponse(res); err != nil {
  1802  		return nil, err
  1803  	}
  1804  	ret := &Reservation{
  1805  		ServerResponse: googleapi.ServerResponse{
  1806  			Header:         res.Header,
  1807  			HTTPStatusCode: res.StatusCode,
  1808  		},
  1809  	}
  1810  	target := &ret
  1811  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1812  		return nil, err
  1813  	}
  1814  	return ret, nil
  1815  	// {
  1816  	//   "description": "Creates a new reservation resource. Multiple reservations are created if the ancestor reservations do not exist.",
  1817  	//   "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}/reservations",
  1818  	//   "httpMethod": "POST",
  1819  	//   "id": "bigqueryreservation.projects.locations.reservations.create",
  1820  	//   "parameterOrder": [
  1821  	//     "parent"
  1822  	//   ],
  1823  	//   "parameters": {
  1824  	//     "parent": {
  1825  	//       "description": "Project, location, and (optionally) reservation name. E.g., projects/myproject/locations/us-central1/reservations/parent",
  1826  	//       "location": "path",
  1827  	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
  1828  	//       "required": true,
  1829  	//       "type": "string"
  1830  	//     },
  1831  	//     "reservationId": {
  1832  	//       "description": "The reservation ID relative to the parent, e.g., \"dev\". This field must only contain alphanumeric characters.",
  1833  	//       "location": "query",
  1834  	//       "type": "string"
  1835  	//     }
  1836  	//   },
  1837  	//   "path": "v1alpha2/{+parent}/reservations",
  1838  	//   "request": {
  1839  	//     "$ref": "Reservation"
  1840  	//   },
  1841  	//   "response": {
  1842  	//     "$ref": "Reservation"
  1843  	//   },
  1844  	//   "scopes": [
  1845  	//     "https://www.googleapis.com/auth/bigquery",
  1846  	//     "https://www.googleapis.com/auth/cloud-platform"
  1847  	//   ]
  1848  	// }
  1849  
  1850  }
  1851  
  1852  // method id "bigqueryreservation.projects.locations.reservations.createReservation":
  1853  
  1854  type ProjectsLocationsReservationsCreateReservationCall struct {
  1855  	s           *Service
  1856  	parent      string
  1857  	reservation *Reservation
  1858  	urlParams_  gensupport.URLParams
  1859  	ctx_        context.Context
  1860  	header_     http.Header
  1861  }
  1862  
  1863  // CreateReservation: Creates a new reservation resource. Multiple
  1864  // reservations are created if the ancestor reservations do not exist.
  1865  func (r *ProjectsLocationsReservationsService) CreateReservation(parent string, reservation *Reservation) *ProjectsLocationsReservationsCreateReservationCall {
  1866  	c := &ProjectsLocationsReservationsCreateReservationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1867  	c.parent = parent
  1868  	c.reservation = reservation
  1869  	return c
  1870  }
  1871  
  1872  // ReservationId sets the optional parameter "reservationId": The
  1873  // reservation ID relative to the parent, e.g., "dev". This field must
  1874  // only contain alphanumeric characters.
  1875  func (c *ProjectsLocationsReservationsCreateReservationCall) ReservationId(reservationId string) *ProjectsLocationsReservationsCreateReservationCall {
  1876  	c.urlParams_.Set("reservationId", reservationId)
  1877  	return c
  1878  }
  1879  
  1880  // Fields allows partial responses to be retrieved. See
  1881  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1882  // for more information.
  1883  func (c *ProjectsLocationsReservationsCreateReservationCall) Fields(s ...googleapi.Field) *ProjectsLocationsReservationsCreateReservationCall {
  1884  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1885  	return c
  1886  }
  1887  
  1888  // Context sets the context to be used in this call's Do method. Any
  1889  // pending HTTP request will be aborted if the provided context is
  1890  // canceled.
  1891  func (c *ProjectsLocationsReservationsCreateReservationCall) Context(ctx context.Context) *ProjectsLocationsReservationsCreateReservationCall {
  1892  	c.ctx_ = ctx
  1893  	return c
  1894  }
  1895  
  1896  // Header returns an http.Header that can be modified by the caller to
  1897  // add HTTP headers to the request.
  1898  func (c *ProjectsLocationsReservationsCreateReservationCall) Header() http.Header {
  1899  	if c.header_ == nil {
  1900  		c.header_ = make(http.Header)
  1901  	}
  1902  	return c.header_
  1903  }
  1904  
  1905  func (c *ProjectsLocationsReservationsCreateReservationCall) doRequest(alt string) (*http.Response, error) {
  1906  	reqHeaders := make(http.Header)
  1907  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201209")
  1908  	for k, v := range c.header_ {
  1909  		reqHeaders[k] = v
  1910  	}
  1911  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1912  	var body io.Reader = nil
  1913  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation)
  1914  	if err != nil {
  1915  		return nil, err
  1916  	}
  1917  	reqHeaders.Set("Content-Type", "application/json")
  1918  	c.urlParams_.Set("alt", alt)
  1919  	c.urlParams_.Set("prettyPrint", "false")
  1920  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+parent}")
  1921  	urls += "?" + c.urlParams_.Encode()
  1922  	req, err := http.NewRequest("POST", urls, body)
  1923  	if err != nil {
  1924  		return nil, err
  1925  	}
  1926  	req.Header = reqHeaders
  1927  	googleapi.Expand(req.URL, map[string]string{
  1928  		"parent": c.parent,
  1929  	})
  1930  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1931  }
  1932  
  1933  // Do executes the "bigqueryreservation.projects.locations.reservations.createReservation" call.
  1934  // Exactly one of *Reservation or error will be non-nil. Any non-2xx
  1935  // status code is an error. Response headers are in either
  1936  // *Reservation.ServerResponse.Header or (if a response was returned at
  1937  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1938  // to check whether the returned error was because
  1939  // http.StatusNotModified was returned.
  1940  func (c *ProjectsLocationsReservationsCreateReservationCall) Do(opts ...googleapi.CallOption) (*Reservation, error) {
  1941  	gensupport.SetOptions(c.urlParams_, opts...)
  1942  	res, err := c.doRequest("json")
  1943  	if res != nil && res.StatusCode == http.StatusNotModified {
  1944  		if res.Body != nil {
  1945  			res.Body.Close()
  1946  		}
  1947  		return nil, &googleapi.Error{
  1948  			Code:   res.StatusCode,
  1949  			Header: res.Header,
  1950  		}
  1951  	}
  1952  	if err != nil {
  1953  		return nil, err
  1954  	}
  1955  	defer googleapi.CloseBody(res)
  1956  	if err := googleapi.CheckResponse(res); err != nil {
  1957  		return nil, err
  1958  	}
  1959  	ret := &Reservation{
  1960  		ServerResponse: googleapi.ServerResponse{
  1961  			Header:         res.Header,
  1962  			HTTPStatusCode: res.StatusCode,
  1963  		},
  1964  	}
  1965  	target := &ret
  1966  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1967  		return nil, err
  1968  	}
  1969  	return ret, nil
  1970  	// {
  1971  	//   "description": "Creates a new reservation resource. Multiple reservations are created if the ancestor reservations do not exist.",
  1972  	//   "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}/reservations/{reservationsId}",
  1973  	//   "httpMethod": "POST",
  1974  	//   "id": "bigqueryreservation.projects.locations.reservations.createReservation",
  1975  	//   "parameterOrder": [
  1976  	//     "parent"
  1977  	//   ],
  1978  	//   "parameters": {
  1979  	//     "parent": {
  1980  	//       "description": "Project, location, and (optionally) reservation name. E.g., projects/myproject/locations/us-central1/reservations/parent",
  1981  	//       "location": "path",
  1982  	//       "pattern": "^projects/[^/]+/locations/[^/]+/reservations/.*$",
  1983  	//       "required": true,
  1984  	//       "type": "string"
  1985  	//     },
  1986  	//     "reservationId": {
  1987  	//       "description": "The reservation ID relative to the parent, e.g., \"dev\". This field must only contain alphanumeric characters.",
  1988  	//       "location": "query",
  1989  	//       "type": "string"
  1990  	//     }
  1991  	//   },
  1992  	//   "path": "v1alpha2/{+parent}",
  1993  	//   "request": {
  1994  	//     "$ref": "Reservation"
  1995  	//   },
  1996  	//   "response": {
  1997  	//     "$ref": "Reservation"
  1998  	//   },
  1999  	//   "scopes": [
  2000  	//     "https://www.googleapis.com/auth/bigquery",
  2001  	//     "https://www.googleapis.com/auth/cloud-platform"
  2002  	//   ]
  2003  	// }
  2004  
  2005  }
  2006  
  2007  // method id "bigqueryreservation.projects.locations.reservations.delete":
  2008  
  2009  type ProjectsLocationsReservationsDeleteCall struct {
  2010  	s          *Service
  2011  	name       string
  2012  	urlParams_ gensupport.URLParams
  2013  	ctx_       context.Context
  2014  	header_    http.Header
  2015  }
  2016  
  2017  // Delete: Deletes a reservation. Returns
  2018  // `google.rpc.Code.FAILED_PRECONDITION` in the following cases: 1. When
  2019  // reservation has child reservations. This check can be bypassed by
  2020  // setting DeleteReservationRequest.force flag to true. 2. When
  2021  // top-level reservation with slot pools is being deleted.
  2022  func (r *ProjectsLocationsReservationsService) Delete(name string) *ProjectsLocationsReservationsDeleteCall {
  2023  	c := &ProjectsLocationsReservationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2024  	c.name = name
  2025  	return c
  2026  }
  2027  
  2028  // Force sets the optional parameter "force": If true, deletes all the
  2029  // child reservations of the given reservation. Otherwise, attempting to
  2030  // delete a reservation that has child reservations will fail with error
  2031  // code `google.rpc.Code.FAILED_PRECONDITION`.
  2032  func (c *ProjectsLocationsReservationsDeleteCall) Force(force bool) *ProjectsLocationsReservationsDeleteCall {
  2033  	c.urlParams_.Set("force", fmt.Sprint(force))
  2034  	return c
  2035  }
  2036  
  2037  // Fields allows partial responses to be retrieved. See
  2038  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2039  // for more information.
  2040  func (c *ProjectsLocationsReservationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsReservationsDeleteCall {
  2041  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2042  	return c
  2043  }
  2044  
  2045  // Context sets the context to be used in this call's Do method. Any
  2046  // pending HTTP request will be aborted if the provided context is
  2047  // canceled.
  2048  func (c *ProjectsLocationsReservationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsReservationsDeleteCall {
  2049  	c.ctx_ = ctx
  2050  	return c
  2051  }
  2052  
  2053  // Header returns an http.Header that can be modified by the caller to
  2054  // add HTTP headers to the request.
  2055  func (c *ProjectsLocationsReservationsDeleteCall) Header() http.Header {
  2056  	if c.header_ == nil {
  2057  		c.header_ = make(http.Header)
  2058  	}
  2059  	return c.header_
  2060  }
  2061  
  2062  func (c *ProjectsLocationsReservationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2063  	reqHeaders := make(http.Header)
  2064  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201209")
  2065  	for k, v := range c.header_ {
  2066  		reqHeaders[k] = v
  2067  	}
  2068  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2069  	var body io.Reader = nil
  2070  	c.urlParams_.Set("alt", alt)
  2071  	c.urlParams_.Set("prettyPrint", "false")
  2072  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+name}")
  2073  	urls += "?" + c.urlParams_.Encode()
  2074  	req, err := http.NewRequest("DELETE", urls, body)
  2075  	if err != nil {
  2076  		return nil, err
  2077  	}
  2078  	req.Header = reqHeaders
  2079  	googleapi.Expand(req.URL, map[string]string{
  2080  		"name": c.name,
  2081  	})
  2082  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2083  }
  2084  
  2085  // Do executes the "bigqueryreservation.projects.locations.reservations.delete" call.
  2086  // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2087  // code is an error. Response headers are in either
  2088  // *Empty.ServerResponse.Header or (if a response was returned at all)
  2089  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2090  // check whether the returned error was because http.StatusNotModified
  2091  // was returned.
  2092  func (c *ProjectsLocationsReservationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2093  	gensupport.SetOptions(c.urlParams_, opts...)
  2094  	res, err := c.doRequest("json")
  2095  	if res != nil && res.StatusCode == http.StatusNotModified {
  2096  		if res.Body != nil {
  2097  			res.Body.Close()
  2098  		}
  2099  		return nil, &googleapi.Error{
  2100  			Code:   res.StatusCode,
  2101  			Header: res.Header,
  2102  		}
  2103  	}
  2104  	if err != nil {
  2105  		return nil, err
  2106  	}
  2107  	defer googleapi.CloseBody(res)
  2108  	if err := googleapi.CheckResponse(res); err != nil {
  2109  		return nil, err
  2110  	}
  2111  	ret := &Empty{
  2112  		ServerResponse: googleapi.ServerResponse{
  2113  			Header:         res.Header,
  2114  			HTTPStatusCode: res.StatusCode,
  2115  		},
  2116  	}
  2117  	target := &ret
  2118  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2119  		return nil, err
  2120  	}
  2121  	return ret, nil
  2122  	// {
  2123  	//   "description": "Deletes a reservation. Returns `google.rpc.Code.FAILED_PRECONDITION` in the following cases: 1. When reservation has child reservations. This check can be bypassed by setting DeleteReservationRequest.force flag to true. 2. When top-level reservation with slot pools is being deleted.",
  2124  	//   "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}/reservations/{reservationsId}",
  2125  	//   "httpMethod": "DELETE",
  2126  	//   "id": "bigqueryreservation.projects.locations.reservations.delete",
  2127  	//   "parameterOrder": [
  2128  	//     "name"
  2129  	//   ],
  2130  	//   "parameters": {
  2131  	//     "force": {
  2132  	//       "description": "If true, deletes all the child reservations of the given reservation. Otherwise, attempting to delete a reservation that has child reservations will fail with error code `google.rpc.Code.FAILED_PRECONDITION`.",
  2133  	//       "location": "query",
  2134  	//       "type": "boolean"
  2135  	//     },
  2136  	//     "name": {
  2137  	//       "description": "Resource name of the reservation to retrieve. E.g., projects/myproject/locations/us-central1/reservations/my_reservation",
  2138  	//       "location": "path",
  2139  	//       "pattern": "^projects/[^/]+/locations/[^/]+/reservations/.*$",
  2140  	//       "required": true,
  2141  	//       "type": "string"
  2142  	//     }
  2143  	//   },
  2144  	//   "path": "v1alpha2/{+name}",
  2145  	//   "response": {
  2146  	//     "$ref": "Empty"
  2147  	//   },
  2148  	//   "scopes": [
  2149  	//     "https://www.googleapis.com/auth/bigquery",
  2150  	//     "https://www.googleapis.com/auth/cloud-platform"
  2151  	//   ]
  2152  	// }
  2153  
  2154  }
  2155  
  2156  // method id "bigqueryreservation.projects.locations.reservations.get":
  2157  
  2158  type ProjectsLocationsReservationsGetCall struct {
  2159  	s            *Service
  2160  	name         string
  2161  	urlParams_   gensupport.URLParams
  2162  	ifNoneMatch_ string
  2163  	ctx_         context.Context
  2164  	header_      http.Header
  2165  }
  2166  
  2167  // Get: Returns information about the reservation.
  2168  func (r *ProjectsLocationsReservationsService) Get(name string) *ProjectsLocationsReservationsGetCall {
  2169  	c := &ProjectsLocationsReservationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2170  	c.name = name
  2171  	return c
  2172  }
  2173  
  2174  // Fields allows partial responses to be retrieved. See
  2175  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2176  // for more information.
  2177  func (c *ProjectsLocationsReservationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsReservationsGetCall {
  2178  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2179  	return c
  2180  }
  2181  
  2182  // IfNoneMatch sets the optional parameter which makes the operation
  2183  // fail if the object's ETag matches the given value. This is useful for
  2184  // getting updates only after the object has changed since the last
  2185  // request. Use googleapi.IsNotModified to check whether the response
  2186  // error from Do is the result of In-None-Match.
  2187  func (c *ProjectsLocationsReservationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsReservationsGetCall {
  2188  	c.ifNoneMatch_ = entityTag
  2189  	return c
  2190  }
  2191  
  2192  // Context sets the context to be used in this call's Do method. Any
  2193  // pending HTTP request will be aborted if the provided context is
  2194  // canceled.
  2195  func (c *ProjectsLocationsReservationsGetCall) Context(ctx context.Context) *ProjectsLocationsReservationsGetCall {
  2196  	c.ctx_ = ctx
  2197  	return c
  2198  }
  2199  
  2200  // Header returns an http.Header that can be modified by the caller to
  2201  // add HTTP headers to the request.
  2202  func (c *ProjectsLocationsReservationsGetCall) Header() http.Header {
  2203  	if c.header_ == nil {
  2204  		c.header_ = make(http.Header)
  2205  	}
  2206  	return c.header_
  2207  }
  2208  
  2209  func (c *ProjectsLocationsReservationsGetCall) doRequest(alt string) (*http.Response, error) {
  2210  	reqHeaders := make(http.Header)
  2211  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201209")
  2212  	for k, v := range c.header_ {
  2213  		reqHeaders[k] = v
  2214  	}
  2215  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2216  	if c.ifNoneMatch_ != "" {
  2217  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2218  	}
  2219  	var body io.Reader = nil
  2220  	c.urlParams_.Set("alt", alt)
  2221  	c.urlParams_.Set("prettyPrint", "false")
  2222  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+name}")
  2223  	urls += "?" + c.urlParams_.Encode()
  2224  	req, err := http.NewRequest("GET", urls, body)
  2225  	if err != nil {
  2226  		return nil, err
  2227  	}
  2228  	req.Header = reqHeaders
  2229  	googleapi.Expand(req.URL, map[string]string{
  2230  		"name": c.name,
  2231  	})
  2232  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2233  }
  2234  
  2235  // Do executes the "bigqueryreservation.projects.locations.reservations.get" call.
  2236  // Exactly one of *Reservation or error will be non-nil. Any non-2xx
  2237  // status code is an error. Response headers are in either
  2238  // *Reservation.ServerResponse.Header or (if a response was returned at
  2239  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2240  // to check whether the returned error was because
  2241  // http.StatusNotModified was returned.
  2242  func (c *ProjectsLocationsReservationsGetCall) Do(opts ...googleapi.CallOption) (*Reservation, error) {
  2243  	gensupport.SetOptions(c.urlParams_, opts...)
  2244  	res, err := c.doRequest("json")
  2245  	if res != nil && res.StatusCode == http.StatusNotModified {
  2246  		if res.Body != nil {
  2247  			res.Body.Close()
  2248  		}
  2249  		return nil, &googleapi.Error{
  2250  			Code:   res.StatusCode,
  2251  			Header: res.Header,
  2252  		}
  2253  	}
  2254  	if err != nil {
  2255  		return nil, err
  2256  	}
  2257  	defer googleapi.CloseBody(res)
  2258  	if err := googleapi.CheckResponse(res); err != nil {
  2259  		return nil, err
  2260  	}
  2261  	ret := &Reservation{
  2262  		ServerResponse: googleapi.ServerResponse{
  2263  			Header:         res.Header,
  2264  			HTTPStatusCode: res.StatusCode,
  2265  		},
  2266  	}
  2267  	target := &ret
  2268  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2269  		return nil, err
  2270  	}
  2271  	return ret, nil
  2272  	// {
  2273  	//   "description": "Returns information about the reservation.",
  2274  	//   "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}/reservations/{reservationsId}",
  2275  	//   "httpMethod": "GET",
  2276  	//   "id": "bigqueryreservation.projects.locations.reservations.get",
  2277  	//   "parameterOrder": [
  2278  	//     "name"
  2279  	//   ],
  2280  	//   "parameters": {
  2281  	//     "name": {
  2282  	//       "description": "Resource name of the reservation to retrieve. E.g., projects/myproject/locations/us-central1/reservations/path/to/reserv",
  2283  	//       "location": "path",
  2284  	//       "pattern": "^projects/[^/]+/locations/[^/]+/reservations/.*$",
  2285  	//       "required": true,
  2286  	//       "type": "string"
  2287  	//     }
  2288  	//   },
  2289  	//   "path": "v1alpha2/{+name}",
  2290  	//   "response": {
  2291  	//     "$ref": "Reservation"
  2292  	//   },
  2293  	//   "scopes": [
  2294  	//     "https://www.googleapis.com/auth/bigquery",
  2295  	//     "https://www.googleapis.com/auth/cloud-platform"
  2296  	//   ]
  2297  	// }
  2298  
  2299  }
  2300  
  2301  // method id "bigqueryreservation.projects.locations.reservations.list":
  2302  
  2303  type ProjectsLocationsReservationsListCall struct {
  2304  	s            *Service
  2305  	parent       string
  2306  	urlParams_   gensupport.URLParams
  2307  	ifNoneMatch_ string
  2308  	ctx_         context.Context
  2309  	header_      http.Header
  2310  }
  2311  
  2312  // List: Lists all the reservations for the project in the specified
  2313  // location.
  2314  func (r *ProjectsLocationsReservationsService) List(parent string) *ProjectsLocationsReservationsListCall {
  2315  	c := &ProjectsLocationsReservationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2316  	c.parent = parent
  2317  	return c
  2318  }
  2319  
  2320  // Filter sets the optional parameter "filter": Can be used to filter
  2321  // out reservations based on names, capacity, etc, e.g.:
  2322  // filter="reservation.slot_capacity > 200" filter="reservation.name =
  2323  // \"*dev/*\"" Advanced filtering syntax can be
  2324  // [here](https://cloud.google.com/logging/docs/view/advanced-filters).
  2325  func (c *ProjectsLocationsReservationsListCall) Filter(filter string) *ProjectsLocationsReservationsListCall {
  2326  	c.urlParams_.Set("filter", filter)
  2327  	return c
  2328  }
  2329  
  2330  // PageSize sets the optional parameter "pageSize": The maximum number
  2331  // of items to return.
  2332  func (c *ProjectsLocationsReservationsListCall) PageSize(pageSize int64) *ProjectsLocationsReservationsListCall {
  2333  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2334  	return c
  2335  }
  2336  
  2337  // PageToken sets the optional parameter "pageToken": The
  2338  // next_page_token value returned from a previous List request, if any.
  2339  func (c *ProjectsLocationsReservationsListCall) PageToken(pageToken string) *ProjectsLocationsReservationsListCall {
  2340  	c.urlParams_.Set("pageToken", pageToken)
  2341  	return c
  2342  }
  2343  
  2344  // Fields allows partial responses to be retrieved. See
  2345  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2346  // for more information.
  2347  func (c *ProjectsLocationsReservationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsReservationsListCall {
  2348  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2349  	return c
  2350  }
  2351  
  2352  // IfNoneMatch sets the optional parameter which makes the operation
  2353  // fail if the object's ETag matches the given value. This is useful for
  2354  // getting updates only after the object has changed since the last
  2355  // request. Use googleapi.IsNotModified to check whether the response
  2356  // error from Do is the result of In-None-Match.
  2357  func (c *ProjectsLocationsReservationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsReservationsListCall {
  2358  	c.ifNoneMatch_ = entityTag
  2359  	return c
  2360  }
  2361  
  2362  // Context sets the context to be used in this call's Do method. Any
  2363  // pending HTTP request will be aborted if the provided context is
  2364  // canceled.
  2365  func (c *ProjectsLocationsReservationsListCall) Context(ctx context.Context) *ProjectsLocationsReservationsListCall {
  2366  	c.ctx_ = ctx
  2367  	return c
  2368  }
  2369  
  2370  // Header returns an http.Header that can be modified by the caller to
  2371  // add HTTP headers to the request.
  2372  func (c *ProjectsLocationsReservationsListCall) Header() http.Header {
  2373  	if c.header_ == nil {
  2374  		c.header_ = make(http.Header)
  2375  	}
  2376  	return c.header_
  2377  }
  2378  
  2379  func (c *ProjectsLocationsReservationsListCall) doRequest(alt string) (*http.Response, error) {
  2380  	reqHeaders := make(http.Header)
  2381  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201209")
  2382  	for k, v := range c.header_ {
  2383  		reqHeaders[k] = v
  2384  	}
  2385  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2386  	if c.ifNoneMatch_ != "" {
  2387  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2388  	}
  2389  	var body io.Reader = nil
  2390  	c.urlParams_.Set("alt", alt)
  2391  	c.urlParams_.Set("prettyPrint", "false")
  2392  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+parent}/reservations")
  2393  	urls += "?" + c.urlParams_.Encode()
  2394  	req, err := http.NewRequest("GET", urls, body)
  2395  	if err != nil {
  2396  		return nil, err
  2397  	}
  2398  	req.Header = reqHeaders
  2399  	googleapi.Expand(req.URL, map[string]string{
  2400  		"parent": c.parent,
  2401  	})
  2402  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2403  }
  2404  
  2405  // Do executes the "bigqueryreservation.projects.locations.reservations.list" call.
  2406  // Exactly one of *ListReservationsResponse or error will be non-nil.
  2407  // Any non-2xx status code is an error. Response headers are in either
  2408  // *ListReservationsResponse.ServerResponse.Header or (if a response was
  2409  // returned at all) in error.(*googleapi.Error).Header. Use
  2410  // googleapi.IsNotModified to check whether the returned error was
  2411  // because http.StatusNotModified was returned.
  2412  func (c *ProjectsLocationsReservationsListCall) Do(opts ...googleapi.CallOption) (*ListReservationsResponse, error) {
  2413  	gensupport.SetOptions(c.urlParams_, opts...)
  2414  	res, err := c.doRequest("json")
  2415  	if res != nil && res.StatusCode == http.StatusNotModified {
  2416  		if res.Body != nil {
  2417  			res.Body.Close()
  2418  		}
  2419  		return nil, &googleapi.Error{
  2420  			Code:   res.StatusCode,
  2421  			Header: res.Header,
  2422  		}
  2423  	}
  2424  	if err != nil {
  2425  		return nil, err
  2426  	}
  2427  	defer googleapi.CloseBody(res)
  2428  	if err := googleapi.CheckResponse(res); err != nil {
  2429  		return nil, err
  2430  	}
  2431  	ret := &ListReservationsResponse{
  2432  		ServerResponse: googleapi.ServerResponse{
  2433  			Header:         res.Header,
  2434  			HTTPStatusCode: res.StatusCode,
  2435  		},
  2436  	}
  2437  	target := &ret
  2438  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2439  		return nil, err
  2440  	}
  2441  	return ret, nil
  2442  	// {
  2443  	//   "description": "Lists all the reservations for the project in the specified location.",
  2444  	//   "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}/reservations",
  2445  	//   "httpMethod": "GET",
  2446  	//   "id": "bigqueryreservation.projects.locations.reservations.list",
  2447  	//   "parameterOrder": [
  2448  	//     "parent"
  2449  	//   ],
  2450  	//   "parameters": {
  2451  	//     "filter": {
  2452  	//       "description": "Can be used to filter out reservations based on names, capacity, etc, e.g.: filter=\"reservation.slot_capacity \u003e 200\" filter=\"reservation.name = \\\"*dev/*\\\"\" Advanced filtering syntax can be [here](https://cloud.google.com/logging/docs/view/advanced-filters).",
  2453  	//       "location": "query",
  2454  	//       "type": "string"
  2455  	//     },
  2456  	//     "pageSize": {
  2457  	//       "description": "The maximum number of items to return.",
  2458  	//       "format": "int32",
  2459  	//       "location": "query",
  2460  	//       "type": "integer"
  2461  	//     },
  2462  	//     "pageToken": {
  2463  	//       "description": "The next_page_token value returned from a previous List request, if any.",
  2464  	//       "location": "query",
  2465  	//       "type": "string"
  2466  	//     },
  2467  	//     "parent": {
  2468  	//       "description": "The parent resource name containing project and location, e.g.: \"projects/myproject/locations/us-central1\"",
  2469  	//       "location": "path",
  2470  	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
  2471  	//       "required": true,
  2472  	//       "type": "string"
  2473  	//     }
  2474  	//   },
  2475  	//   "path": "v1alpha2/{+parent}/reservations",
  2476  	//   "response": {
  2477  	//     "$ref": "ListReservationsResponse"
  2478  	//   },
  2479  	//   "scopes": [
  2480  	//     "https://www.googleapis.com/auth/bigquery",
  2481  	//     "https://www.googleapis.com/auth/cloud-platform"
  2482  	//   ]
  2483  	// }
  2484  
  2485  }
  2486  
  2487  // Pages invokes f for each page of results.
  2488  // A non-nil error returned from f will halt the iteration.
  2489  // The provided context supersedes any context provided to the Context method.
  2490  func (c *ProjectsLocationsReservationsListCall) Pages(ctx context.Context, f func(*ListReservationsResponse) error) error {
  2491  	c.ctx_ = ctx
  2492  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2493  	for {
  2494  		x, err := c.Do()
  2495  		if err != nil {
  2496  			return err
  2497  		}
  2498  		if err := f(x); err != nil {
  2499  			return err
  2500  		}
  2501  		if x.NextPageToken == "" {
  2502  			return nil
  2503  		}
  2504  		c.PageToken(x.NextPageToken)
  2505  	}
  2506  }
  2507  
  2508  // method id "bigqueryreservation.projects.locations.reservations.patch":
  2509  
  2510  type ProjectsLocationsReservationsPatchCall struct {
  2511  	s           *Service
  2512  	name        string
  2513  	reservation *Reservation
  2514  	urlParams_  gensupport.URLParams
  2515  	ctx_        context.Context
  2516  	header_     http.Header
  2517  }
  2518  
  2519  // Patch: Updates an existing reservation resource. Applicable only for
  2520  // child reservations.
  2521  func (r *ProjectsLocationsReservationsService) Patch(name string, reservation *Reservation) *ProjectsLocationsReservationsPatchCall {
  2522  	c := &ProjectsLocationsReservationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2523  	c.name = name
  2524  	c.reservation = reservation
  2525  	return c
  2526  }
  2527  
  2528  // UpdateMask sets the optional parameter "updateMask": Standard field
  2529  // mask for the set of fields to be updated.
  2530  func (c *ProjectsLocationsReservationsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsReservationsPatchCall {
  2531  	c.urlParams_.Set("updateMask", updateMask)
  2532  	return c
  2533  }
  2534  
  2535  // Fields allows partial responses to be retrieved. See
  2536  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2537  // for more information.
  2538  func (c *ProjectsLocationsReservationsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsReservationsPatchCall {
  2539  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2540  	return c
  2541  }
  2542  
  2543  // Context sets the context to be used in this call's Do method. Any
  2544  // pending HTTP request will be aborted if the provided context is
  2545  // canceled.
  2546  func (c *ProjectsLocationsReservationsPatchCall) Context(ctx context.Context) *ProjectsLocationsReservationsPatchCall {
  2547  	c.ctx_ = ctx
  2548  	return c
  2549  }
  2550  
  2551  // Header returns an http.Header that can be modified by the caller to
  2552  // add HTTP headers to the request.
  2553  func (c *ProjectsLocationsReservationsPatchCall) Header() http.Header {
  2554  	if c.header_ == nil {
  2555  		c.header_ = make(http.Header)
  2556  	}
  2557  	return c.header_
  2558  }
  2559  
  2560  func (c *ProjectsLocationsReservationsPatchCall) doRequest(alt string) (*http.Response, error) {
  2561  	reqHeaders := make(http.Header)
  2562  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201209")
  2563  	for k, v := range c.header_ {
  2564  		reqHeaders[k] = v
  2565  	}
  2566  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2567  	var body io.Reader = nil
  2568  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.reservation)
  2569  	if err != nil {
  2570  		return nil, err
  2571  	}
  2572  	reqHeaders.Set("Content-Type", "application/json")
  2573  	c.urlParams_.Set("alt", alt)
  2574  	c.urlParams_.Set("prettyPrint", "false")
  2575  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+name}")
  2576  	urls += "?" + c.urlParams_.Encode()
  2577  	req, err := http.NewRequest("PATCH", urls, body)
  2578  	if err != nil {
  2579  		return nil, err
  2580  	}
  2581  	req.Header = reqHeaders
  2582  	googleapi.Expand(req.URL, map[string]string{
  2583  		"name": c.name,
  2584  	})
  2585  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2586  }
  2587  
  2588  // Do executes the "bigqueryreservation.projects.locations.reservations.patch" call.
  2589  // Exactly one of *Reservation or error will be non-nil. Any non-2xx
  2590  // status code is an error. Response headers are in either
  2591  // *Reservation.ServerResponse.Header or (if a response was returned at
  2592  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2593  // to check whether the returned error was because
  2594  // http.StatusNotModified was returned.
  2595  func (c *ProjectsLocationsReservationsPatchCall) Do(opts ...googleapi.CallOption) (*Reservation, error) {
  2596  	gensupport.SetOptions(c.urlParams_, opts...)
  2597  	res, err := c.doRequest("json")
  2598  	if res != nil && res.StatusCode == http.StatusNotModified {
  2599  		if res.Body != nil {
  2600  			res.Body.Close()
  2601  		}
  2602  		return nil, &googleapi.Error{
  2603  			Code:   res.StatusCode,
  2604  			Header: res.Header,
  2605  		}
  2606  	}
  2607  	if err != nil {
  2608  		return nil, err
  2609  	}
  2610  	defer googleapi.CloseBody(res)
  2611  	if err := googleapi.CheckResponse(res); err != nil {
  2612  		return nil, err
  2613  	}
  2614  	ret := &Reservation{
  2615  		ServerResponse: googleapi.ServerResponse{
  2616  			Header:         res.Header,
  2617  			HTTPStatusCode: res.StatusCode,
  2618  		},
  2619  	}
  2620  	target := &ret
  2621  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2622  		return nil, err
  2623  	}
  2624  	return ret, nil
  2625  	// {
  2626  	//   "description": "Updates an existing reservation resource. Applicable only for child reservations.",
  2627  	//   "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}/reservations/{reservationsId}/{reservationsId1}",
  2628  	//   "httpMethod": "PATCH",
  2629  	//   "id": "bigqueryreservation.projects.locations.reservations.patch",
  2630  	//   "parameterOrder": [
  2631  	//     "name"
  2632  	//   ],
  2633  	//   "parameters": {
  2634  	//     "name": {
  2635  	//       "description": "The resource name of the reservation, e.g., \"projects/*/locations/*/reservations/dev/team/product\". Reservation names (e.g., \"dev/team/product\") exceeding a depth of six will fail with `google.rpc.Code.INVALID_ARGUMENT`.",
  2636  	//       "location": "path",
  2637  	//       "pattern": "^projects/[^/]+/locations/[^/]+/reservations/[^/]+/.*$",
  2638  	//       "required": true,
  2639  	//       "type": "string"
  2640  	//     },
  2641  	//     "updateMask": {
  2642  	//       "description": "Standard field mask for the set of fields to be updated.",
  2643  	//       "format": "google-fieldmask",
  2644  	//       "location": "query",
  2645  	//       "type": "string"
  2646  	//     }
  2647  	//   },
  2648  	//   "path": "v1alpha2/{+name}",
  2649  	//   "request": {
  2650  	//     "$ref": "Reservation"
  2651  	//   },
  2652  	//   "response": {
  2653  	//     "$ref": "Reservation"
  2654  	//   },
  2655  	//   "scopes": [
  2656  	//     "https://www.googleapis.com/auth/bigquery",
  2657  	//     "https://www.googleapis.com/auth/cloud-platform"
  2658  	//   ]
  2659  	// }
  2660  
  2661  }
  2662  
  2663  // method id "bigqueryreservation.projects.locations.reservations.slotPools.delete":
  2664  
  2665  type ProjectsLocationsReservationsSlotPoolsDeleteCall struct {
  2666  	s          *Service
  2667  	name       string
  2668  	urlParams_ gensupport.URLParams
  2669  	ctx_       context.Context
  2670  	header_    http.Header
  2671  }
  2672  
  2673  // Delete: Deletes a slot pool. Attempting to delete slot pool before
  2674  // its commitment_end_time will fail with the error code
  2675  // `google.rpc.Code.FAILED_PRECONDITION`.
  2676  func (r *ProjectsLocationsReservationsSlotPoolsService) Delete(name string) *ProjectsLocationsReservationsSlotPoolsDeleteCall {
  2677  	c := &ProjectsLocationsReservationsSlotPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2678  	c.name = name
  2679  	return c
  2680  }
  2681  
  2682  // Fields allows partial responses to be retrieved. See
  2683  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2684  // for more information.
  2685  func (c *ProjectsLocationsReservationsSlotPoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsReservationsSlotPoolsDeleteCall {
  2686  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2687  	return c
  2688  }
  2689  
  2690  // Context sets the context to be used in this call's Do method. Any
  2691  // pending HTTP request will be aborted if the provided context is
  2692  // canceled.
  2693  func (c *ProjectsLocationsReservationsSlotPoolsDeleteCall) Context(ctx context.Context) *ProjectsLocationsReservationsSlotPoolsDeleteCall {
  2694  	c.ctx_ = ctx
  2695  	return c
  2696  }
  2697  
  2698  // Header returns an http.Header that can be modified by the caller to
  2699  // add HTTP headers to the request.
  2700  func (c *ProjectsLocationsReservationsSlotPoolsDeleteCall) Header() http.Header {
  2701  	if c.header_ == nil {
  2702  		c.header_ = make(http.Header)
  2703  	}
  2704  	return c.header_
  2705  }
  2706  
  2707  func (c *ProjectsLocationsReservationsSlotPoolsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2708  	reqHeaders := make(http.Header)
  2709  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201209")
  2710  	for k, v := range c.header_ {
  2711  		reqHeaders[k] = v
  2712  	}
  2713  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2714  	var body io.Reader = nil
  2715  	c.urlParams_.Set("alt", alt)
  2716  	c.urlParams_.Set("prettyPrint", "false")
  2717  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+name}")
  2718  	urls += "?" + c.urlParams_.Encode()
  2719  	req, err := http.NewRequest("DELETE", urls, body)
  2720  	if err != nil {
  2721  		return nil, err
  2722  	}
  2723  	req.Header = reqHeaders
  2724  	googleapi.Expand(req.URL, map[string]string{
  2725  		"name": c.name,
  2726  	})
  2727  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2728  }
  2729  
  2730  // Do executes the "bigqueryreservation.projects.locations.reservations.slotPools.delete" call.
  2731  // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2732  // code is an error. Response headers are in either
  2733  // *Empty.ServerResponse.Header or (if a response was returned at all)
  2734  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2735  // check whether the returned error was because http.StatusNotModified
  2736  // was returned.
  2737  func (c *ProjectsLocationsReservationsSlotPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2738  	gensupport.SetOptions(c.urlParams_, opts...)
  2739  	res, err := c.doRequest("json")
  2740  	if res != nil && res.StatusCode == http.StatusNotModified {
  2741  		if res.Body != nil {
  2742  			res.Body.Close()
  2743  		}
  2744  		return nil, &googleapi.Error{
  2745  			Code:   res.StatusCode,
  2746  			Header: res.Header,
  2747  		}
  2748  	}
  2749  	if err != nil {
  2750  		return nil, err
  2751  	}
  2752  	defer googleapi.CloseBody(res)
  2753  	if err := googleapi.CheckResponse(res); err != nil {
  2754  		return nil, err
  2755  	}
  2756  	ret := &Empty{
  2757  		ServerResponse: googleapi.ServerResponse{
  2758  			Header:         res.Header,
  2759  			HTTPStatusCode: res.StatusCode,
  2760  		},
  2761  	}
  2762  	target := &ret
  2763  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2764  		return nil, err
  2765  	}
  2766  	return ret, nil
  2767  	// {
  2768  	//   "description": "Deletes a slot pool. Attempting to delete slot pool before its commitment_end_time will fail with the error code `google.rpc.Code.FAILED_PRECONDITION`.",
  2769  	//   "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}/reservations/{reservationsId}/slotPools/{slotPoolsId}",
  2770  	//   "httpMethod": "DELETE",
  2771  	//   "id": "bigqueryreservation.projects.locations.reservations.slotPools.delete",
  2772  	//   "parameterOrder": [
  2773  	//     "name"
  2774  	//   ],
  2775  	//   "parameters": {
  2776  	//     "name": {
  2777  	//       "description": "Resource name of the slot pool to delete. E.g., projects/myproject/locations/us-central1/reservations/my_reservation/slotPools/123",
  2778  	//       "location": "path",
  2779  	//       "pattern": "^projects/[^/]+/locations/[^/]+/reservations/[^/]+/slotPools/[^/]+$",
  2780  	//       "required": true,
  2781  	//       "type": "string"
  2782  	//     }
  2783  	//   },
  2784  	//   "path": "v1alpha2/{+name}",
  2785  	//   "response": {
  2786  	//     "$ref": "Empty"
  2787  	//   },
  2788  	//   "scopes": [
  2789  	//     "https://www.googleapis.com/auth/bigquery",
  2790  	//     "https://www.googleapis.com/auth/cloud-platform"
  2791  	//   ]
  2792  	// }
  2793  
  2794  }
  2795  
  2796  // method id "bigqueryreservation.projects.locations.reservations.slotPools.get":
  2797  
  2798  type ProjectsLocationsReservationsSlotPoolsGetCall struct {
  2799  	s            *Service
  2800  	name         string
  2801  	urlParams_   gensupport.URLParams
  2802  	ifNoneMatch_ string
  2803  	ctx_         context.Context
  2804  	header_      http.Header
  2805  }
  2806  
  2807  // Get: Returns information about the slot pool.
  2808  func (r *ProjectsLocationsReservationsSlotPoolsService) Get(name string) *ProjectsLocationsReservationsSlotPoolsGetCall {
  2809  	c := &ProjectsLocationsReservationsSlotPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2810  	c.name = name
  2811  	return c
  2812  }
  2813  
  2814  // Fields allows partial responses to be retrieved. See
  2815  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2816  // for more information.
  2817  func (c *ProjectsLocationsReservationsSlotPoolsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsReservationsSlotPoolsGetCall {
  2818  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2819  	return c
  2820  }
  2821  
  2822  // IfNoneMatch sets the optional parameter which makes the operation
  2823  // fail if the object's ETag matches the given value. This is useful for
  2824  // getting updates only after the object has changed since the last
  2825  // request. Use googleapi.IsNotModified to check whether the response
  2826  // error from Do is the result of In-None-Match.
  2827  func (c *ProjectsLocationsReservationsSlotPoolsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsReservationsSlotPoolsGetCall {
  2828  	c.ifNoneMatch_ = entityTag
  2829  	return c
  2830  }
  2831  
  2832  // Context sets the context to be used in this call's Do method. Any
  2833  // pending HTTP request will be aborted if the provided context is
  2834  // canceled.
  2835  func (c *ProjectsLocationsReservationsSlotPoolsGetCall) Context(ctx context.Context) *ProjectsLocationsReservationsSlotPoolsGetCall {
  2836  	c.ctx_ = ctx
  2837  	return c
  2838  }
  2839  
  2840  // Header returns an http.Header that can be modified by the caller to
  2841  // add HTTP headers to the request.
  2842  func (c *ProjectsLocationsReservationsSlotPoolsGetCall) Header() http.Header {
  2843  	if c.header_ == nil {
  2844  		c.header_ = make(http.Header)
  2845  	}
  2846  	return c.header_
  2847  }
  2848  
  2849  func (c *ProjectsLocationsReservationsSlotPoolsGetCall) doRequest(alt string) (*http.Response, error) {
  2850  	reqHeaders := make(http.Header)
  2851  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201209")
  2852  	for k, v := range c.header_ {
  2853  		reqHeaders[k] = v
  2854  	}
  2855  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2856  	if c.ifNoneMatch_ != "" {
  2857  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2858  	}
  2859  	var body io.Reader = nil
  2860  	c.urlParams_.Set("alt", alt)
  2861  	c.urlParams_.Set("prettyPrint", "false")
  2862  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+name}")
  2863  	urls += "?" + c.urlParams_.Encode()
  2864  	req, err := http.NewRequest("GET", urls, body)
  2865  	if err != nil {
  2866  		return nil, err
  2867  	}
  2868  	req.Header = reqHeaders
  2869  	googleapi.Expand(req.URL, map[string]string{
  2870  		"name": c.name,
  2871  	})
  2872  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2873  }
  2874  
  2875  // Do executes the "bigqueryreservation.projects.locations.reservations.slotPools.get" call.
  2876  // Exactly one of *SlotPool or error will be non-nil. Any non-2xx status
  2877  // code is an error. Response headers are in either
  2878  // *SlotPool.ServerResponse.Header or (if a response was returned at
  2879  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2880  // to check whether the returned error was because
  2881  // http.StatusNotModified was returned.
  2882  func (c *ProjectsLocationsReservationsSlotPoolsGetCall) Do(opts ...googleapi.CallOption) (*SlotPool, error) {
  2883  	gensupport.SetOptions(c.urlParams_, opts...)
  2884  	res, err := c.doRequest("json")
  2885  	if res != nil && res.StatusCode == http.StatusNotModified {
  2886  		if res.Body != nil {
  2887  			res.Body.Close()
  2888  		}
  2889  		return nil, &googleapi.Error{
  2890  			Code:   res.StatusCode,
  2891  			Header: res.Header,
  2892  		}
  2893  	}
  2894  	if err != nil {
  2895  		return nil, err
  2896  	}
  2897  	defer googleapi.CloseBody(res)
  2898  	if err := googleapi.CheckResponse(res); err != nil {
  2899  		return nil, err
  2900  	}
  2901  	ret := &SlotPool{
  2902  		ServerResponse: googleapi.ServerResponse{
  2903  			Header:         res.Header,
  2904  			HTTPStatusCode: res.StatusCode,
  2905  		},
  2906  	}
  2907  	target := &ret
  2908  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2909  		return nil, err
  2910  	}
  2911  	return ret, nil
  2912  	// {
  2913  	//   "description": "Returns information about the slot pool.",
  2914  	//   "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}/reservations/{reservationsId}/slotPools/{slotPoolsId}",
  2915  	//   "httpMethod": "GET",
  2916  	//   "id": "bigqueryreservation.projects.locations.reservations.slotPools.get",
  2917  	//   "parameterOrder": [
  2918  	//     "name"
  2919  	//   ],
  2920  	//   "parameters": {
  2921  	//     "name": {
  2922  	//       "description": "Resource name of the slot pool to retrieve. E.g., projects/myproject/locations/us-central1/reservations/my_reservation/slotPools/123",
  2923  	//       "location": "path",
  2924  	//       "pattern": "^projects/[^/]+/locations/[^/]+/reservations/[^/]+/slotPools/[^/]+$",
  2925  	//       "required": true,
  2926  	//       "type": "string"
  2927  	//     }
  2928  	//   },
  2929  	//   "path": "v1alpha2/{+name}",
  2930  	//   "response": {
  2931  	//     "$ref": "SlotPool"
  2932  	//   },
  2933  	//   "scopes": [
  2934  	//     "https://www.googleapis.com/auth/bigquery",
  2935  	//     "https://www.googleapis.com/auth/cloud-platform"
  2936  	//   ]
  2937  	// }
  2938  
  2939  }
  2940  
  2941  // method id "bigqueryreservation.projects.locations.reservations.slotPools.list":
  2942  
  2943  type ProjectsLocationsReservationsSlotPoolsListCall struct {
  2944  	s            *Service
  2945  	parent       string
  2946  	urlParams_   gensupport.URLParams
  2947  	ifNoneMatch_ string
  2948  	ctx_         context.Context
  2949  	header_      http.Header
  2950  }
  2951  
  2952  // List: Lists all the slot pools for the reservation.
  2953  func (r *ProjectsLocationsReservationsSlotPoolsService) List(parent string) *ProjectsLocationsReservationsSlotPoolsListCall {
  2954  	c := &ProjectsLocationsReservationsSlotPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2955  	c.parent = parent
  2956  	return c
  2957  }
  2958  
  2959  // PageSize sets the optional parameter "pageSize": The maximum number
  2960  // of items to return.
  2961  func (c *ProjectsLocationsReservationsSlotPoolsListCall) PageSize(pageSize int64) *ProjectsLocationsReservationsSlotPoolsListCall {
  2962  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2963  	return c
  2964  }
  2965  
  2966  // PageToken sets the optional parameter "pageToken": The
  2967  // next_page_token value returned from a previous List request, if any.
  2968  func (c *ProjectsLocationsReservationsSlotPoolsListCall) PageToken(pageToken string) *ProjectsLocationsReservationsSlotPoolsListCall {
  2969  	c.urlParams_.Set("pageToken", pageToken)
  2970  	return c
  2971  }
  2972  
  2973  // Fields allows partial responses to be retrieved. See
  2974  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2975  // for more information.
  2976  func (c *ProjectsLocationsReservationsSlotPoolsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsReservationsSlotPoolsListCall {
  2977  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2978  	return c
  2979  }
  2980  
  2981  // IfNoneMatch sets the optional parameter which makes the operation
  2982  // fail if the object's ETag matches the given value. This is useful for
  2983  // getting updates only after the object has changed since the last
  2984  // request. Use googleapi.IsNotModified to check whether the response
  2985  // error from Do is the result of In-None-Match.
  2986  func (c *ProjectsLocationsReservationsSlotPoolsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsReservationsSlotPoolsListCall {
  2987  	c.ifNoneMatch_ = entityTag
  2988  	return c
  2989  }
  2990  
  2991  // Context sets the context to be used in this call's Do method. Any
  2992  // pending HTTP request will be aborted if the provided context is
  2993  // canceled.
  2994  func (c *ProjectsLocationsReservationsSlotPoolsListCall) Context(ctx context.Context) *ProjectsLocationsReservationsSlotPoolsListCall {
  2995  	c.ctx_ = ctx
  2996  	return c
  2997  }
  2998  
  2999  // Header returns an http.Header that can be modified by the caller to
  3000  // add HTTP headers to the request.
  3001  func (c *ProjectsLocationsReservationsSlotPoolsListCall) Header() http.Header {
  3002  	if c.header_ == nil {
  3003  		c.header_ = make(http.Header)
  3004  	}
  3005  	return c.header_
  3006  }
  3007  
  3008  func (c *ProjectsLocationsReservationsSlotPoolsListCall) doRequest(alt string) (*http.Response, error) {
  3009  	reqHeaders := make(http.Header)
  3010  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201209")
  3011  	for k, v := range c.header_ {
  3012  		reqHeaders[k] = v
  3013  	}
  3014  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3015  	if c.ifNoneMatch_ != "" {
  3016  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3017  	}
  3018  	var body io.Reader = nil
  3019  	c.urlParams_.Set("alt", alt)
  3020  	c.urlParams_.Set("prettyPrint", "false")
  3021  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha2/{+parent}/slotPools")
  3022  	urls += "?" + c.urlParams_.Encode()
  3023  	req, err := http.NewRequest("GET", urls, body)
  3024  	if err != nil {
  3025  		return nil, err
  3026  	}
  3027  	req.Header = reqHeaders
  3028  	googleapi.Expand(req.URL, map[string]string{
  3029  		"parent": c.parent,
  3030  	})
  3031  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3032  }
  3033  
  3034  // Do executes the "bigqueryreservation.projects.locations.reservations.slotPools.list" call.
  3035  // Exactly one of *ListSlotPoolsResponse or error will be non-nil. Any
  3036  // non-2xx status code is an error. Response headers are in either
  3037  // *ListSlotPoolsResponse.ServerResponse.Header or (if a response was
  3038  // returned at all) in error.(*googleapi.Error).Header. Use
  3039  // googleapi.IsNotModified to check whether the returned error was
  3040  // because http.StatusNotModified was returned.
  3041  func (c *ProjectsLocationsReservationsSlotPoolsListCall) Do(opts ...googleapi.CallOption) (*ListSlotPoolsResponse, error) {
  3042  	gensupport.SetOptions(c.urlParams_, opts...)
  3043  	res, err := c.doRequest("json")
  3044  	if res != nil && res.StatusCode == http.StatusNotModified {
  3045  		if res.Body != nil {
  3046  			res.Body.Close()
  3047  		}
  3048  		return nil, &googleapi.Error{
  3049  			Code:   res.StatusCode,
  3050  			Header: res.Header,
  3051  		}
  3052  	}
  3053  	if err != nil {
  3054  		return nil, err
  3055  	}
  3056  	defer googleapi.CloseBody(res)
  3057  	if err := googleapi.CheckResponse(res); err != nil {
  3058  		return nil, err
  3059  	}
  3060  	ret := &ListSlotPoolsResponse{
  3061  		ServerResponse: googleapi.ServerResponse{
  3062  			Header:         res.Header,
  3063  			HTTPStatusCode: res.StatusCode,
  3064  		},
  3065  	}
  3066  	target := &ret
  3067  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3068  		return nil, err
  3069  	}
  3070  	return ret, nil
  3071  	// {
  3072  	//   "description": "Lists all the slot pools for the reservation.",
  3073  	//   "flatPath": "v1alpha2/projects/{projectsId}/locations/{locationsId}/reservations/{reservationsId}/slotPools",
  3074  	//   "httpMethod": "GET",
  3075  	//   "id": "bigqueryreservation.projects.locations.reservations.slotPools.list",
  3076  	//   "parameterOrder": [
  3077  	//     "parent"
  3078  	//   ],
  3079  	//   "parameters": {
  3080  	//     "pageSize": {
  3081  	//       "description": "The maximum number of items to return.",
  3082  	//       "format": "int32",
  3083  	//       "location": "query",
  3084  	//       "type": "integer"
  3085  	//     },
  3086  	//     "pageToken": {
  3087  	//       "description": "The next_page_token value returned from a previous List request, if any.",
  3088  	//       "location": "query",
  3089  	//       "type": "string"
  3090  	//     },
  3091  	//     "parent": {
  3092  	//       "description": "Resource name of the parent reservation. Only top-level reservations can have slot pools. E.g., projects/myproject/locations/us-central1/reservations/my_reservation",
  3093  	//       "location": "path",
  3094  	//       "pattern": "^projects/[^/]+/locations/[^/]+/reservations/[^/]+$",
  3095  	//       "required": true,
  3096  	//       "type": "string"
  3097  	//     }
  3098  	//   },
  3099  	//   "path": "v1alpha2/{+parent}/slotPools",
  3100  	//   "response": {
  3101  	//     "$ref": "ListSlotPoolsResponse"
  3102  	//   },
  3103  	//   "scopes": [
  3104  	//     "https://www.googleapis.com/auth/bigquery",
  3105  	//     "https://www.googleapis.com/auth/cloud-platform"
  3106  	//   ]
  3107  	// }
  3108  
  3109  }
  3110  
  3111  // Pages invokes f for each page of results.
  3112  // A non-nil error returned from f will halt the iteration.
  3113  // The provided context supersedes any context provided to the Context method.
  3114  func (c *ProjectsLocationsReservationsSlotPoolsListCall) Pages(ctx context.Context, f func(*ListSlotPoolsResponse) error) error {
  3115  	c.ctx_ = ctx
  3116  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3117  	for {
  3118  		x, err := c.Do()
  3119  		if err != nil {
  3120  			return err
  3121  		}
  3122  		if err := f(x); err != nil {
  3123  			return err
  3124  		}
  3125  		if x.NextPageToken == "" {
  3126  			return nil
  3127  		}
  3128  		c.PageToken(x.NextPageToken)
  3129  	}
  3130  }
  3131  

View as plain text