...

Source file src/google.golang.org/api/tpu/v2alpha1/tpu-gen.go

Documentation: google.golang.org/api/tpu/v2alpha1

     1  // Copyright 2024 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package tpu provides access to the Cloud TPU API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/tpu/
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/tpu/v2alpha1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	tpuService, err := tpu.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // To use an API key for authentication (note: some APIs do not support API
    38  // keys), use [google.golang.org/api/option.WithAPIKey]:
    39  //
    40  //	tpuService, err := tpu.NewService(ctx, option.WithAPIKey("AIza..."))
    41  //
    42  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    43  // flow, use [google.golang.org/api/option.WithTokenSource]:
    44  //
    45  //	config := &oauth2.Config{...}
    46  //	// ...
    47  //	token, err := config.Exchange(ctx, ...)
    48  //	tpuService, err := tpu.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package tpu // import "google.golang.org/api/tpu/v2alpha1"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "tpu:v2alpha1"
    90  const apiName = "tpu"
    91  const apiVersion = "v2alpha1"
    92  const basePath = "https://tpu.googleapis.com/"
    93  const basePathTemplate = "https://tpu.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://tpu.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// See, edit, configure, and delete your Google Cloud data and see the email
    99  	// address for your Google Account.
   100  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
   101  )
   102  
   103  // NewService creates a new Service.
   104  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   105  	scopesOption := internaloption.WithDefaultScopes(
   106  		"https://www.googleapis.com/auth/cloud-platform",
   107  	)
   108  	// NOTE: prepend, so we don't override user-specified scopes.
   109  	opts = append([]option.ClientOption{scopesOption}, opts...)
   110  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   111  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   112  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   113  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   114  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   115  	if err != nil {
   116  		return nil, err
   117  	}
   118  	s, err := New(client)
   119  	if err != nil {
   120  		return nil, err
   121  	}
   122  	if endpoint != "" {
   123  		s.BasePath = endpoint
   124  	}
   125  	return s, nil
   126  }
   127  
   128  // New creates a new Service. It uses the provided http.Client for requests.
   129  //
   130  // Deprecated: please use NewService instead.
   131  // To provide a custom HTTP client, use option.WithHTTPClient.
   132  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   133  func New(client *http.Client) (*Service, error) {
   134  	if client == nil {
   135  		return nil, errors.New("client is nil")
   136  	}
   137  	s := &Service{client: client, BasePath: basePath}
   138  	s.Projects = NewProjectsService(s)
   139  	return s, nil
   140  }
   141  
   142  type Service struct {
   143  	client    *http.Client
   144  	BasePath  string // API endpoint base URL
   145  	UserAgent string // optional additional User-Agent fragment
   146  
   147  	Projects *ProjectsService
   148  }
   149  
   150  func (s *Service) userAgent() string {
   151  	if s.UserAgent == "" {
   152  		return googleapi.UserAgent
   153  	}
   154  	return googleapi.UserAgent + " " + s.UserAgent
   155  }
   156  
   157  func NewProjectsService(s *Service) *ProjectsService {
   158  	rs := &ProjectsService{s: s}
   159  	rs.Locations = NewProjectsLocationsService(s)
   160  	return rs
   161  }
   162  
   163  type ProjectsService struct {
   164  	s *Service
   165  
   166  	Locations *ProjectsLocationsService
   167  }
   168  
   169  func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
   170  	rs := &ProjectsLocationsService{s: s}
   171  	rs.AcceleratorTypes = NewProjectsLocationsAcceleratorTypesService(s)
   172  	rs.Nodes = NewProjectsLocationsNodesService(s)
   173  	rs.Operations = NewProjectsLocationsOperationsService(s)
   174  	rs.QueuedResources = NewProjectsLocationsQueuedResourcesService(s)
   175  	rs.Reservations = NewProjectsLocationsReservationsService(s)
   176  	rs.RuntimeVersions = NewProjectsLocationsRuntimeVersionsService(s)
   177  	return rs
   178  }
   179  
   180  type ProjectsLocationsService struct {
   181  	s *Service
   182  
   183  	AcceleratorTypes *ProjectsLocationsAcceleratorTypesService
   184  
   185  	Nodes *ProjectsLocationsNodesService
   186  
   187  	Operations *ProjectsLocationsOperationsService
   188  
   189  	QueuedResources *ProjectsLocationsQueuedResourcesService
   190  
   191  	Reservations *ProjectsLocationsReservationsService
   192  
   193  	RuntimeVersions *ProjectsLocationsRuntimeVersionsService
   194  }
   195  
   196  func NewProjectsLocationsAcceleratorTypesService(s *Service) *ProjectsLocationsAcceleratorTypesService {
   197  	rs := &ProjectsLocationsAcceleratorTypesService{s: s}
   198  	return rs
   199  }
   200  
   201  type ProjectsLocationsAcceleratorTypesService struct {
   202  	s *Service
   203  }
   204  
   205  func NewProjectsLocationsNodesService(s *Service) *ProjectsLocationsNodesService {
   206  	rs := &ProjectsLocationsNodesService{s: s}
   207  	return rs
   208  }
   209  
   210  type ProjectsLocationsNodesService struct {
   211  	s *Service
   212  }
   213  
   214  func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
   215  	rs := &ProjectsLocationsOperationsService{s: s}
   216  	return rs
   217  }
   218  
   219  type ProjectsLocationsOperationsService struct {
   220  	s *Service
   221  }
   222  
   223  func NewProjectsLocationsQueuedResourcesService(s *Service) *ProjectsLocationsQueuedResourcesService {
   224  	rs := &ProjectsLocationsQueuedResourcesService{s: s}
   225  	return rs
   226  }
   227  
   228  type ProjectsLocationsQueuedResourcesService struct {
   229  	s *Service
   230  }
   231  
   232  func NewProjectsLocationsReservationsService(s *Service) *ProjectsLocationsReservationsService {
   233  	rs := &ProjectsLocationsReservationsService{s: s}
   234  	return rs
   235  }
   236  
   237  type ProjectsLocationsReservationsService struct {
   238  	s *Service
   239  }
   240  
   241  func NewProjectsLocationsRuntimeVersionsService(s *Service) *ProjectsLocationsRuntimeVersionsService {
   242  	rs := &ProjectsLocationsRuntimeVersionsService{s: s}
   243  	return rs
   244  }
   245  
   246  type ProjectsLocationsRuntimeVersionsService struct {
   247  	s *Service
   248  }
   249  
   250  // AcceleratorConfig: A TPU accelerator configuration.
   251  type AcceleratorConfig struct {
   252  	// Topology: Required. Topology of TPU in chips.
   253  	Topology string `json:"topology,omitempty"`
   254  	// Type: Required. Type of TPU.
   255  	//
   256  	// Possible values:
   257  	//   "TYPE_UNSPECIFIED" - Unspecified version.
   258  	//   "V2" - TPU v2.
   259  	//   "V3" - TPU v3.
   260  	//   "V4" - TPU v4.
   261  	//   "V5P" - TPU v5.
   262  	Type string `json:"type,omitempty"`
   263  	// ForceSendFields is a list of field names (e.g. "Topology") to
   264  	// unconditionally include in API requests. By default, fields with empty or
   265  	// default values are omitted from API requests. See
   266  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   267  	// details.
   268  	ForceSendFields []string `json:"-"`
   269  	// NullFields is a list of field names (e.g. "Topology") to include in API
   270  	// requests with the JSON null value. By default, fields with empty values are
   271  	// omitted from API requests. See
   272  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   273  	NullFields []string `json:"-"`
   274  }
   275  
   276  func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
   277  	type NoMethod AcceleratorConfig
   278  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   279  }
   280  
   281  // AcceleratorType: A accelerator type that a Node can be configured with.
   282  type AcceleratorType struct {
   283  	// AcceleratorConfigs: The accelerator config.
   284  	AcceleratorConfigs []*AcceleratorConfig `json:"acceleratorConfigs,omitempty"`
   285  	// Name: The resource name.
   286  	Name string `json:"name,omitempty"`
   287  	// Type: The accelerator type.
   288  	Type string `json:"type,omitempty"`
   289  
   290  	// ServerResponse contains the HTTP response code and headers from the server.
   291  	googleapi.ServerResponse `json:"-"`
   292  	// ForceSendFields is a list of field names (e.g. "AcceleratorConfigs") to
   293  	// unconditionally include in API requests. By default, fields with empty or
   294  	// default values are omitted from API requests. See
   295  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   296  	// details.
   297  	ForceSendFields []string `json:"-"`
   298  	// NullFields is a list of field names (e.g. "AcceleratorConfigs") to include
   299  	// in API requests with the JSON null value. By default, fields with empty
   300  	// values are omitted from API requests. See
   301  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   302  	NullFields []string `json:"-"`
   303  }
   304  
   305  func (s *AcceleratorType) MarshalJSON() ([]byte, error) {
   306  	type NoMethod AcceleratorType
   307  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   308  }
   309  
   310  // AcceptedData: Further data for the accepted state.
   311  type AcceptedData struct {
   312  }
   313  
   314  // AccessConfig: An access config attached to the TPU worker.
   315  type AccessConfig struct {
   316  	// ExternalIp: Output only. An external IP address associated with the TPU
   317  	// worker.
   318  	ExternalIp string `json:"externalIp,omitempty"`
   319  	// ForceSendFields is a list of field names (e.g. "ExternalIp") to
   320  	// unconditionally include in API requests. By default, fields with empty or
   321  	// default values are omitted from API requests. See
   322  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   323  	// details.
   324  	ForceSendFields []string `json:"-"`
   325  	// NullFields is a list of field names (e.g. "ExternalIp") to include in API
   326  	// requests with the JSON null value. By default, fields with empty values are
   327  	// omitted from API requests. See
   328  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   329  	NullFields []string `json:"-"`
   330  }
   331  
   332  func (s *AccessConfig) MarshalJSON() ([]byte, error) {
   333  	type NoMethod AccessConfig
   334  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   335  }
   336  
   337  // ActiveData: Further data for the active state.
   338  type ActiveData struct {
   339  }
   340  
   341  // AttachedDisk: A node-attached disk resource. Next ID: 8;
   342  type AttachedDisk struct {
   343  	// Mode: The mode in which to attach this disk. If not specified, the default
   344  	// is READ_WRITE mode. Only applicable to data_disks.
   345  	//
   346  	// Possible values:
   347  	//   "DISK_MODE_UNSPECIFIED" - The disk mode is not known/set.
   348  	//   "READ_WRITE" - Attaches the disk in read-write mode. Only one TPU node can
   349  	// attach a disk in read-write mode at a time.
   350  	//   "READ_ONLY" - Attaches the disk in read-only mode. Multiple TPU nodes can
   351  	// attach a disk in read-only mode at a time.
   352  	Mode string `json:"mode,omitempty"`
   353  	// SourceDisk: Specifies the full path to an existing disk. For example:
   354  	// "projects/my-project/zones/us-central1-c/disks/my-disk".
   355  	SourceDisk string `json:"sourceDisk,omitempty"`
   356  	// ForceSendFields is a list of field names (e.g. "Mode") to unconditionally
   357  	// include in API requests. By default, fields with empty or default values are
   358  	// omitted from API requests. See
   359  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   360  	// details.
   361  	ForceSendFields []string `json:"-"`
   362  	// NullFields is a list of field names (e.g. "Mode") to include in API requests
   363  	// with the JSON null value. By default, fields with empty values are omitted
   364  	// from API requests. See
   365  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   366  	NullFields []string `json:"-"`
   367  }
   368  
   369  func (s *AttachedDisk) MarshalJSON() ([]byte, error) {
   370  	type NoMethod AttachedDisk
   371  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   372  }
   373  
   374  // BestEffort: BestEffort tier definition.
   375  type BestEffort struct {
   376  }
   377  
   378  // BootDiskConfig: Boot disk configurations.
   379  type BootDiskConfig struct {
   380  	// CustomerEncryptionKey: Optional. Customer encryption key for boot disk.
   381  	CustomerEncryptionKey *CustomerEncryptionKey `json:"customerEncryptionKey,omitempty"`
   382  	// EnableConfidentialCompute: Optional. Whether the boot disk will be created
   383  	// with confidential compute mode.
   384  	EnableConfidentialCompute bool `json:"enableConfidentialCompute,omitempty"`
   385  	// ForceSendFields is a list of field names (e.g. "CustomerEncryptionKey") to
   386  	// unconditionally include in API requests. By default, fields with empty or
   387  	// default values are omitted from API requests. See
   388  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   389  	// details.
   390  	ForceSendFields []string `json:"-"`
   391  	// NullFields is a list of field names (e.g. "CustomerEncryptionKey") to
   392  	// include in API requests with the JSON null value. By default, fields with
   393  	// empty values are omitted from API requests. See
   394  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   395  	NullFields []string `json:"-"`
   396  }
   397  
   398  func (s *BootDiskConfig) MarshalJSON() ([]byte, error) {
   399  	type NoMethod BootDiskConfig
   400  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   401  }
   402  
   403  // CreatingData: Further data for the creating state.
   404  type CreatingData struct {
   405  }
   406  
   407  // CustomerEncryptionKey: Customer's encryption key.
   408  type CustomerEncryptionKey struct {
   409  	// KmsKeyName: The name of the encryption key that is stored in Google Cloud
   410  	// KMS. For example: "kmsKeyName":
   411  	// "projects/kms_project_id/locations/region/keyRings/
   412  	// key_region/cryptoKeys/key The fully-qualifed key name may be returned for
   413  	// resource GET requests. For example: "kmsKeyName":
   414  	// "projects/kms_project_id/locations/region/keyRings/
   415  	// key_region/cryptoKeys/key /cryptoKeyVersions/1
   416  	KmsKeyName string `json:"kmsKeyName,omitempty"`
   417  	// ForceSendFields is a list of field names (e.g. "KmsKeyName") to
   418  	// unconditionally include in API requests. By default, fields with empty or
   419  	// default values are omitted from API requests. See
   420  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   421  	// details.
   422  	ForceSendFields []string `json:"-"`
   423  	// NullFields is a list of field names (e.g. "KmsKeyName") to include in API
   424  	// requests with the JSON null value. By default, fields with empty values are
   425  	// omitted from API requests. See
   426  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   427  	NullFields []string `json:"-"`
   428  }
   429  
   430  func (s *CustomerEncryptionKey) MarshalJSON() ([]byte, error) {
   431  	type NoMethod CustomerEncryptionKey
   432  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   433  }
   434  
   435  // DeletingData: Further data for the deleting state.
   436  type DeletingData struct {
   437  }
   438  
   439  // Empty: A generic empty message that you can re-use to avoid defining
   440  // duplicated empty messages in your APIs. A typical example is to use it as
   441  // the request or the response type of an API method. For instance: service Foo
   442  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   443  type Empty struct {
   444  	// ServerResponse contains the HTTP response code and headers from the server.
   445  	googleapi.ServerResponse `json:"-"`
   446  }
   447  
   448  // FailedData: Further data for the failed state.
   449  type FailedData struct {
   450  	// Error: The error that caused the queued resource to enter the FAILED state.
   451  	Error *Status `json:"error,omitempty"`
   452  	// ForceSendFields is a list of field names (e.g. "Error") to unconditionally
   453  	// include in API requests. By default, fields with empty or default values are
   454  	// omitted from API requests. See
   455  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   456  	// details.
   457  	ForceSendFields []string `json:"-"`
   458  	// NullFields is a list of field names (e.g. "Error") to include in API
   459  	// requests with the JSON null value. By default, fields with empty values are
   460  	// omitted from API requests. See
   461  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   462  	NullFields []string `json:"-"`
   463  }
   464  
   465  func (s *FailedData) MarshalJSON() ([]byte, error) {
   466  	type NoMethod FailedData
   467  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   468  }
   469  
   470  // GenerateServiceIdentityRequest: Request for GenerateServiceIdentity.
   471  type GenerateServiceIdentityRequest struct {
   472  }
   473  
   474  // GenerateServiceIdentityResponse: Response for GenerateServiceIdentity.
   475  type GenerateServiceIdentityResponse struct {
   476  	// Identity: ServiceIdentity that was created or retrieved.
   477  	Identity *ServiceIdentity `json:"identity,omitempty"`
   478  
   479  	// ServerResponse contains the HTTP response code and headers from the server.
   480  	googleapi.ServerResponse `json:"-"`
   481  	// ForceSendFields is a list of field names (e.g. "Identity") to
   482  	// unconditionally include in API requests. By default, fields with empty or
   483  	// default values are omitted from API requests. See
   484  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   485  	// details.
   486  	ForceSendFields []string `json:"-"`
   487  	// NullFields is a list of field names (e.g. "Identity") to include in API
   488  	// requests with the JSON null value. By default, fields with empty values are
   489  	// omitted from API requests. See
   490  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   491  	NullFields []string `json:"-"`
   492  }
   493  
   494  func (s *GenerateServiceIdentityResponse) MarshalJSON() ([]byte, error) {
   495  	type NoMethod GenerateServiceIdentityResponse
   496  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   497  }
   498  
   499  // GetGuestAttributesRequest: Request for GetGuestAttributes.
   500  type GetGuestAttributesRequest struct {
   501  	// QueryPath: The guest attributes path to be queried.
   502  	QueryPath string `json:"queryPath,omitempty"`
   503  	// WorkerIds: The 0-based worker ID. If it is empty, all workers'
   504  	// GuestAttributes will be returned.
   505  	WorkerIds []string `json:"workerIds,omitempty"`
   506  	// ForceSendFields is a list of field names (e.g. "QueryPath") to
   507  	// unconditionally include in API requests. By default, fields with empty or
   508  	// default values are omitted from API requests. See
   509  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   510  	// details.
   511  	ForceSendFields []string `json:"-"`
   512  	// NullFields is a list of field names (e.g. "QueryPath") to include in API
   513  	// requests with the JSON null value. By default, fields with empty values are
   514  	// omitted from API requests. See
   515  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   516  	NullFields []string `json:"-"`
   517  }
   518  
   519  func (s *GetGuestAttributesRequest) MarshalJSON() ([]byte, error) {
   520  	type NoMethod GetGuestAttributesRequest
   521  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   522  }
   523  
   524  // GetGuestAttributesResponse: Response for GetGuestAttributes.
   525  type GetGuestAttributesResponse struct {
   526  	// GuestAttributes: The guest attributes for the TPU workers.
   527  	GuestAttributes []*GuestAttributes `json:"guestAttributes,omitempty"`
   528  
   529  	// ServerResponse contains the HTTP response code and headers from the server.
   530  	googleapi.ServerResponse `json:"-"`
   531  	// ForceSendFields is a list of field names (e.g. "GuestAttributes") to
   532  	// unconditionally include in API requests. By default, fields with empty or
   533  	// default values are omitted from API requests. See
   534  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   535  	// details.
   536  	ForceSendFields []string `json:"-"`
   537  	// NullFields is a list of field names (e.g. "GuestAttributes") to include in
   538  	// API requests with the JSON null value. By default, fields with empty values
   539  	// are omitted from API requests. See
   540  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   541  	NullFields []string `json:"-"`
   542  }
   543  
   544  func (s *GetGuestAttributesResponse) MarshalJSON() ([]byte, error) {
   545  	type NoMethod GetGuestAttributesResponse
   546  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   547  }
   548  
   549  // Guaranteed: Guaranteed tier definition.
   550  type Guaranteed struct {
   551  	// MinDuration: Optional. Defines the minimum duration of the guarantee. If
   552  	// specified, the requested resources will only be provisioned if they can be
   553  	// allocated for at least the given duration.
   554  	MinDuration string `json:"minDuration,omitempty"`
   555  	// Reserved: Optional. Specifies the request should be scheduled on reserved
   556  	// capacity.
   557  	Reserved bool `json:"reserved,omitempty"`
   558  	// ForceSendFields is a list of field names (e.g. "MinDuration") to
   559  	// unconditionally include in API requests. By default, fields with empty or
   560  	// default values are omitted from API requests. See
   561  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   562  	// details.
   563  	ForceSendFields []string `json:"-"`
   564  	// NullFields is a list of field names (e.g. "MinDuration") to include in API
   565  	// requests with the JSON null value. By default, fields with empty values are
   566  	// omitted from API requests. See
   567  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   568  	NullFields []string `json:"-"`
   569  }
   570  
   571  func (s *Guaranteed) MarshalJSON() ([]byte, error) {
   572  	type NoMethod Guaranteed
   573  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   574  }
   575  
   576  // GuestAttributes: A guest attributes.
   577  type GuestAttributes struct {
   578  	// QueryPath: The path to be queried. This can be the default namespace ('/')
   579  	// or a nested namespace ('/\/') or a specified key ('/\/\')
   580  	QueryPath string `json:"queryPath,omitempty"`
   581  	// QueryValue: The value of the requested queried path.
   582  	QueryValue *GuestAttributesValue `json:"queryValue,omitempty"`
   583  	// ForceSendFields is a list of field names (e.g. "QueryPath") to
   584  	// unconditionally include in API requests. By default, fields with empty or
   585  	// default values are omitted from API requests. See
   586  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   587  	// details.
   588  	ForceSendFields []string `json:"-"`
   589  	// NullFields is a list of field names (e.g. "QueryPath") to include in API
   590  	// requests with the JSON null value. By default, fields with empty values are
   591  	// omitted from API requests. See
   592  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   593  	NullFields []string `json:"-"`
   594  }
   595  
   596  func (s *GuestAttributes) MarshalJSON() ([]byte, error) {
   597  	type NoMethod GuestAttributes
   598  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   599  }
   600  
   601  // GuestAttributesEntry: A guest attributes namespace/key/value entry.
   602  type GuestAttributesEntry struct {
   603  	// Key: Key for the guest attribute entry.
   604  	Key string `json:"key,omitempty"`
   605  	// Namespace: Namespace for the guest attribute entry.
   606  	Namespace string `json:"namespace,omitempty"`
   607  	// Value: Value for the guest attribute entry.
   608  	Value string `json:"value,omitempty"`
   609  	// ForceSendFields is a list of field names (e.g. "Key") to unconditionally
   610  	// include in API requests. By default, fields with empty or default values are
   611  	// omitted from API requests. See
   612  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   613  	// details.
   614  	ForceSendFields []string `json:"-"`
   615  	// NullFields is a list of field names (e.g. "Key") to include in API requests
   616  	// with the JSON null value. By default, fields with empty values are omitted
   617  	// from API requests. See
   618  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   619  	NullFields []string `json:"-"`
   620  }
   621  
   622  func (s *GuestAttributesEntry) MarshalJSON() ([]byte, error) {
   623  	type NoMethod GuestAttributesEntry
   624  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   625  }
   626  
   627  // GuestAttributesValue: Array of guest attribute namespace/key/value tuples.
   628  type GuestAttributesValue struct {
   629  	// Items: The list of guest attributes entries.
   630  	Items []*GuestAttributesEntry `json:"items,omitempty"`
   631  	// ForceSendFields is a list of field names (e.g. "Items") to unconditionally
   632  	// include in API requests. By default, fields with empty or default values are
   633  	// omitted from API requests. See
   634  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   635  	// details.
   636  	ForceSendFields []string `json:"-"`
   637  	// NullFields is a list of field names (e.g. "Items") to include in API
   638  	// requests with the JSON null value. By default, fields with empty values are
   639  	// omitted from API requests. See
   640  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   641  	NullFields []string `json:"-"`
   642  }
   643  
   644  func (s *GuestAttributesValue) MarshalJSON() ([]byte, error) {
   645  	type NoMethod GuestAttributesValue
   646  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   647  }
   648  
   649  // Interval: Represents a time interval, encoded as a Timestamp start
   650  // (inclusive) and a Timestamp end (exclusive). The start must be less than or
   651  // equal to the end. When the start equals the end, the interval is empty
   652  // (matches no time). When both start and end are unspecified, the interval
   653  // matches any time.
   654  type Interval struct {
   655  	// EndTime: Optional. Exclusive end of the interval. If specified, a Timestamp
   656  	// matching this interval will have to be before the end.
   657  	EndTime string `json:"endTime,omitempty"`
   658  	// StartTime: Optional. Inclusive start of the interval. If specified, a
   659  	// Timestamp matching this interval will have to be the same or after the
   660  	// start.
   661  	StartTime string `json:"startTime,omitempty"`
   662  	// ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally
   663  	// include in API requests. By default, fields with empty or default values are
   664  	// omitted from API requests. See
   665  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   666  	// details.
   667  	ForceSendFields []string `json:"-"`
   668  	// NullFields is a list of field names (e.g. "EndTime") to include in API
   669  	// requests with the JSON null value. By default, fields with empty values are
   670  	// omitted from API requests. See
   671  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   672  	NullFields []string `json:"-"`
   673  }
   674  
   675  func (s *Interval) MarshalJSON() ([]byte, error) {
   676  	type NoMethod Interval
   677  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   678  }
   679  
   680  // ListAcceleratorTypesResponse: Response for ListAcceleratorTypes.
   681  type ListAcceleratorTypesResponse struct {
   682  	// AcceleratorTypes: The listed nodes.
   683  	AcceleratorTypes []*AcceleratorType `json:"acceleratorTypes,omitempty"`
   684  	// NextPageToken: The next page token or empty if none.
   685  	NextPageToken string `json:"nextPageToken,omitempty"`
   686  	// Unreachable: Locations that could not be reached.
   687  	Unreachable []string `json:"unreachable,omitempty"`
   688  
   689  	// ServerResponse contains the HTTP response code and headers from the server.
   690  	googleapi.ServerResponse `json:"-"`
   691  	// ForceSendFields is a list of field names (e.g. "AcceleratorTypes") to
   692  	// unconditionally include in API requests. By default, fields with empty or
   693  	// default values are omitted from API requests. See
   694  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   695  	// details.
   696  	ForceSendFields []string `json:"-"`
   697  	// NullFields is a list of field names (e.g. "AcceleratorTypes") to include in
   698  	// API requests with the JSON null value. By default, fields with empty values
   699  	// are omitted from API requests. See
   700  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   701  	NullFields []string `json:"-"`
   702  }
   703  
   704  func (s *ListAcceleratorTypesResponse) MarshalJSON() ([]byte, error) {
   705  	type NoMethod ListAcceleratorTypesResponse
   706  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   707  }
   708  
   709  // ListLocationsResponse: The response message for Locations.ListLocations.
   710  type ListLocationsResponse struct {
   711  	// Locations: A list of locations that matches the specified filter in the
   712  	// request.
   713  	Locations []*Location `json:"locations,omitempty"`
   714  	// NextPageToken: The standard List next-page token.
   715  	NextPageToken string `json:"nextPageToken,omitempty"`
   716  
   717  	// ServerResponse contains the HTTP response code and headers from the server.
   718  	googleapi.ServerResponse `json:"-"`
   719  	// ForceSendFields is a list of field names (e.g. "Locations") to
   720  	// unconditionally include in API requests. By default, fields with empty or
   721  	// default values are omitted from API requests. See
   722  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   723  	// details.
   724  	ForceSendFields []string `json:"-"`
   725  	// NullFields is a list of field names (e.g. "Locations") to include in API
   726  	// requests with the JSON null value. By default, fields with empty values are
   727  	// omitted from API requests. See
   728  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   729  	NullFields []string `json:"-"`
   730  }
   731  
   732  func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
   733  	type NoMethod ListLocationsResponse
   734  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   735  }
   736  
   737  // ListNodesResponse: Response for ListNodes.
   738  type ListNodesResponse struct {
   739  	// NextPageToken: The next page token or empty if none.
   740  	NextPageToken string `json:"nextPageToken,omitempty"`
   741  	// Nodes: The listed nodes.
   742  	Nodes []*Node `json:"nodes,omitempty"`
   743  	// Unreachable: Locations that could not be reached.
   744  	Unreachable []string `json:"unreachable,omitempty"`
   745  
   746  	// ServerResponse contains the HTTP response code and headers from the server.
   747  	googleapi.ServerResponse `json:"-"`
   748  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   749  	// unconditionally include in API requests. By default, fields with empty or
   750  	// default values are omitted from API requests. See
   751  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   752  	// details.
   753  	ForceSendFields []string `json:"-"`
   754  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   755  	// requests with the JSON null value. By default, fields with empty values are
   756  	// omitted from API requests. See
   757  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   758  	NullFields []string `json:"-"`
   759  }
   760  
   761  func (s *ListNodesResponse) MarshalJSON() ([]byte, error) {
   762  	type NoMethod ListNodesResponse
   763  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   764  }
   765  
   766  // ListOperationsResponse: The response message for Operations.ListOperations.
   767  type ListOperationsResponse struct {
   768  	// NextPageToken: The standard List next-page token.
   769  	NextPageToken string `json:"nextPageToken,omitempty"`
   770  	// Operations: A list of operations that matches the specified filter in the
   771  	// request.
   772  	Operations []*Operation `json:"operations,omitempty"`
   773  
   774  	// ServerResponse contains the HTTP response code and headers from the server.
   775  	googleapi.ServerResponse `json:"-"`
   776  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   777  	// unconditionally include in API requests. By default, fields with empty or
   778  	// default values are omitted from API requests. See
   779  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   780  	// details.
   781  	ForceSendFields []string `json:"-"`
   782  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   783  	// requests with the JSON null value. By default, fields with empty values are
   784  	// omitted from API requests. See
   785  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   786  	NullFields []string `json:"-"`
   787  }
   788  
   789  func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
   790  	type NoMethod ListOperationsResponse
   791  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   792  }
   793  
   794  // ListQueuedResourcesResponse: Response for ListQueuedResources.
   795  type ListQueuedResourcesResponse struct {
   796  	// NextPageToken: The next page token or empty if none.
   797  	NextPageToken string `json:"nextPageToken,omitempty"`
   798  	// QueuedResources: The listed queued resources.
   799  	QueuedResources []*QueuedResource `json:"queuedResources,omitempty"`
   800  	// Unreachable: Locations that could not be reached.
   801  	Unreachable []string `json:"unreachable,omitempty"`
   802  
   803  	// ServerResponse contains the HTTP response code and headers from the server.
   804  	googleapi.ServerResponse `json:"-"`
   805  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   806  	// unconditionally include in API requests. By default, fields with empty or
   807  	// default values are omitted from API requests. See
   808  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   809  	// details.
   810  	ForceSendFields []string `json:"-"`
   811  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   812  	// requests with the JSON null value. By default, fields with empty values are
   813  	// omitted from API requests. See
   814  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   815  	NullFields []string `json:"-"`
   816  }
   817  
   818  func (s *ListQueuedResourcesResponse) MarshalJSON() ([]byte, error) {
   819  	type NoMethod ListQueuedResourcesResponse
   820  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   821  }
   822  
   823  // ListReservationsResponse: Response for ListReservations.
   824  type ListReservationsResponse struct {
   825  	// NextPageToken: The next page token or empty if none.
   826  	NextPageToken string `json:"nextPageToken,omitempty"`
   827  	// Reservations: The listed reservations.
   828  	Reservations []*Reservation `json:"reservations,omitempty"`
   829  
   830  	// ServerResponse contains the HTTP response code and headers from the server.
   831  	googleapi.ServerResponse `json:"-"`
   832  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   833  	// unconditionally include in API requests. By default, fields with empty or
   834  	// default values are omitted from API requests. See
   835  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   836  	// details.
   837  	ForceSendFields []string `json:"-"`
   838  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   839  	// requests with the JSON null value. By default, fields with empty values are
   840  	// omitted from API requests. See
   841  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   842  	NullFields []string `json:"-"`
   843  }
   844  
   845  func (s *ListReservationsResponse) MarshalJSON() ([]byte, error) {
   846  	type NoMethod ListReservationsResponse
   847  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   848  }
   849  
   850  // ListRuntimeVersionsResponse: Response for ListRuntimeVersions.
   851  type ListRuntimeVersionsResponse struct {
   852  	// NextPageToken: The next page token or empty if none.
   853  	NextPageToken string `json:"nextPageToken,omitempty"`
   854  	// RuntimeVersions: The listed nodes.
   855  	RuntimeVersions []*RuntimeVersion `json:"runtimeVersions,omitempty"`
   856  	// Unreachable: Locations that could not be reached.
   857  	Unreachable []string `json:"unreachable,omitempty"`
   858  
   859  	// ServerResponse contains the HTTP response code and headers from the server.
   860  	googleapi.ServerResponse `json:"-"`
   861  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   862  	// unconditionally include in API requests. By default, fields with empty or
   863  	// default values are omitted from API requests. See
   864  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   865  	// details.
   866  	ForceSendFields []string `json:"-"`
   867  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   868  	// requests with the JSON null value. By default, fields with empty values are
   869  	// omitted from API requests. See
   870  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   871  	NullFields []string `json:"-"`
   872  }
   873  
   874  func (s *ListRuntimeVersionsResponse) MarshalJSON() ([]byte, error) {
   875  	type NoMethod ListRuntimeVersionsResponse
   876  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   877  }
   878  
   879  // Location: A resource that represents a Google Cloud location.
   880  type Location struct {
   881  	// DisplayName: The friendly name for this location, typically a nearby city
   882  	// name. For example, "Tokyo".
   883  	DisplayName string `json:"displayName,omitempty"`
   884  	// Labels: Cross-service attributes for the location. For example
   885  	// {"cloud.googleapis.com/region": "us-east1"}
   886  	Labels map[string]string `json:"labels,omitempty"`
   887  	// LocationId: The canonical id for this location. For example: "us-east1".
   888  	LocationId string `json:"locationId,omitempty"`
   889  	// Metadata: Service-specific metadata. For example the available capacity at
   890  	// the given location.
   891  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   892  	// Name: Resource name for the location, which may vary between
   893  	// implementations. For example:
   894  	// "projects/example-project/locations/us-east1"
   895  	Name string `json:"name,omitempty"`
   896  
   897  	// ServerResponse contains the HTTP response code and headers from the server.
   898  	googleapi.ServerResponse `json:"-"`
   899  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   900  	// unconditionally include in API requests. By default, fields with empty or
   901  	// default values are omitted from API requests. See
   902  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   903  	// details.
   904  	ForceSendFields []string `json:"-"`
   905  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
   906  	// requests with the JSON null value. By default, fields with empty values are
   907  	// omitted from API requests. See
   908  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   909  	NullFields []string `json:"-"`
   910  }
   911  
   912  func (s *Location) MarshalJSON() ([]byte, error) {
   913  	type NoMethod Location
   914  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   915  }
   916  
   917  // MultiNodeParams: Parameters to specify for multi-node QueuedResource
   918  // requests. This field must be populated in case of multi-node requests
   919  // instead of node_id. It's an error to specify both node_id and
   920  // multi_node_params.
   921  type MultiNodeParams struct {
   922  	// NodeCount: Required. Number of nodes with this spec. The system will attempt
   923  	// to provison "node_count" nodes as part of the request. This needs to be > 1.
   924  	NodeCount int64 `json:"nodeCount,omitempty"`
   925  	// NodeIdPrefix: Prefix of node_ids in case of multi-node request Should follow
   926  	// the `^[A-Za-z0-9_.~+%-]+$` regex format. If node_count = 3 and
   927  	// node_id_prefix = "np", node ids of nodes created will be "np-0", "np-1",
   928  	// "np-2". If this field is not provided we use queued_resource_id as the
   929  	// node_id_prefix.
   930  	NodeIdPrefix string `json:"nodeIdPrefix,omitempty"`
   931  	// ForceSendFields is a list of field names (e.g. "NodeCount") to
   932  	// unconditionally include in API requests. By default, fields with empty or
   933  	// default values are omitted from API requests. See
   934  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   935  	// details.
   936  	ForceSendFields []string `json:"-"`
   937  	// NullFields is a list of field names (e.g. "NodeCount") to include in API
   938  	// requests with the JSON null value. By default, fields with empty values are
   939  	// omitted from API requests. See
   940  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   941  	NullFields []string `json:"-"`
   942  }
   943  
   944  func (s *MultiNodeParams) MarshalJSON() ([]byte, error) {
   945  	type NoMethod MultiNodeParams
   946  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   947  }
   948  
   949  // NetworkConfig: Network related configurations.
   950  type NetworkConfig struct {
   951  	// CanIpForward: Allows the TPU node to send and receive packets with
   952  	// non-matching destination or source IPs. This is required if you plan to use
   953  	// the TPU workers to forward routes.
   954  	CanIpForward bool `json:"canIpForward,omitempty"`
   955  	// EnableExternalIps: Indicates that external IP addresses would be associated
   956  	// with the TPU workers. If set to false, the specified subnetwork or network
   957  	// should have Private Google Access enabled.
   958  	EnableExternalIps bool `json:"enableExternalIps,omitempty"`
   959  	// Network: The name of the network for the TPU node. It must be a preexisting
   960  	// Google Compute Engine network. If none is provided, "default" will be used.
   961  	Network string `json:"network,omitempty"`
   962  	// QueueCount: Optional. Specifies networking queue count for TPU VM instance's
   963  	// network interface.
   964  	QueueCount int64 `json:"queueCount,omitempty"`
   965  	// Subnetwork: The name of the subnetwork for the TPU node. It must be a
   966  	// preexisting Google Compute Engine subnetwork. If none is provided, "default"
   967  	// will be used.
   968  	Subnetwork string `json:"subnetwork,omitempty"`
   969  	// ForceSendFields is a list of field names (e.g. "CanIpForward") to
   970  	// unconditionally include in API requests. By default, fields with empty or
   971  	// default values are omitted from API requests. See
   972  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   973  	// details.
   974  	ForceSendFields []string `json:"-"`
   975  	// NullFields is a list of field names (e.g. "CanIpForward") to include in API
   976  	// requests with the JSON null value. By default, fields with empty values are
   977  	// omitted from API requests. See
   978  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   979  	NullFields []string `json:"-"`
   980  }
   981  
   982  func (s *NetworkConfig) MarshalJSON() ([]byte, error) {
   983  	type NoMethod NetworkConfig
   984  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   985  }
   986  
   987  // NetworkEndpoint: A network endpoint over which a TPU worker can be reached.
   988  type NetworkEndpoint struct {
   989  	// AccessConfig: The access config for the TPU worker.
   990  	AccessConfig *AccessConfig `json:"accessConfig,omitempty"`
   991  	// IpAddress: The internal IP address of this network endpoint.
   992  	IpAddress string `json:"ipAddress,omitempty"`
   993  	// Port: The port of this network endpoint.
   994  	Port int64 `json:"port,omitempty"`
   995  	// ForceSendFields is a list of field names (e.g. "AccessConfig") to
   996  	// unconditionally include in API requests. By default, fields with empty or
   997  	// default values are omitted from API requests. See
   998  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   999  	// details.
  1000  	ForceSendFields []string `json:"-"`
  1001  	// NullFields is a list of field names (e.g. "AccessConfig") to include in API
  1002  	// requests with the JSON null value. By default, fields with empty values are
  1003  	// omitted from API requests. See
  1004  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1005  	NullFields []string `json:"-"`
  1006  }
  1007  
  1008  func (s *NetworkEndpoint) MarshalJSON() ([]byte, error) {
  1009  	type NoMethod NetworkEndpoint
  1010  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1011  }
  1012  
  1013  // Node: A TPU instance.
  1014  type Node struct {
  1015  	// AcceleratorConfig: The AccleratorConfig for the TPU Node.
  1016  	AcceleratorConfig *AcceleratorConfig `json:"acceleratorConfig,omitempty"`
  1017  	// AcceleratorType: The type of hardware accelerators associated with this
  1018  	// node.
  1019  	AcceleratorType string `json:"acceleratorType,omitempty"`
  1020  	// ApiVersion: Output only. The API version that created this Node.
  1021  	//
  1022  	// Possible values:
  1023  	//   "API_VERSION_UNSPECIFIED" - API version is unknown.
  1024  	//   "V1_ALPHA1" - TPU API V1Alpha1 version.
  1025  	//   "V1" - TPU API V1 version.
  1026  	//   "V2_ALPHA1" - TPU API V2Alpha1 version.
  1027  	ApiVersion string `json:"apiVersion,omitempty"`
  1028  	// AutocheckpointEnabled: Optional. Whether Autocheckpoint is enabled.
  1029  	AutocheckpointEnabled bool `json:"autocheckpointEnabled,omitempty"`
  1030  	// BootDiskConfig: Optional. Boot disk configuration.
  1031  	BootDiskConfig *BootDiskConfig `json:"bootDiskConfig,omitempty"`
  1032  	// CidrBlock: The CIDR block that the TPU node will use when selecting an IP
  1033  	// address. This CIDR block must be a /29 block; the Compute Engine networks
  1034  	// API forbids a smaller block, and using a larger block would be wasteful (a
  1035  	// node can only consume one IP address). Errors will occur if the CIDR block
  1036  	// has already been used for a currently existing TPU node, the CIDR block
  1037  	// conflicts with any subnetworks in the user's provided network, or the
  1038  	// provided network is peered with another network that is using that CIDR
  1039  	// block.
  1040  	CidrBlock string `json:"cidrBlock,omitempty"`
  1041  	// CreateTime: Output only. The time when the node was created.
  1042  	CreateTime string `json:"createTime,omitempty"`
  1043  	// DataDisks: The additional data disks for the Node.
  1044  	DataDisks []*AttachedDisk `json:"dataDisks,omitempty"`
  1045  	// Description: The user-supplied description of the TPU. Maximum of 512
  1046  	// characters.
  1047  	Description string `json:"description,omitempty"`
  1048  	// Health: The health status of the TPU node.
  1049  	//
  1050  	// Possible values:
  1051  	//   "HEALTH_UNSPECIFIED" - Health status is unknown: not initialized or failed
  1052  	// to retrieve.
  1053  	//   "HEALTHY" - The resource is healthy.
  1054  	//   "TIMEOUT" - The resource is unresponsive.
  1055  	//   "UNHEALTHY_TENSORFLOW" - The in-guest ML stack is unhealthy.
  1056  	//   "UNHEALTHY_MAINTENANCE" - The node is under maintenance/priority boost
  1057  	// caused rescheduling and will resume running once rescheduled.
  1058  	Health string `json:"health,omitempty"`
  1059  	// HealthDescription: Output only. If this field is populated, it contains a
  1060  	// description of why the TPU Node is unhealthy.
  1061  	HealthDescription string `json:"healthDescription,omitempty"`
  1062  	// Id: Output only. The unique identifier for the TPU Node.
  1063  	Id int64 `json:"id,omitempty,string"`
  1064  	// Labels: Resource labels to represent user-provided metadata.
  1065  	Labels map[string]string `json:"labels,omitempty"`
  1066  	// Metadata: Custom metadata to apply to the TPU Node. Can set startup-script
  1067  	// and shutdown-script
  1068  	Metadata map[string]string `json:"metadata,omitempty"`
  1069  	// MultisliceNode: Output only. Whether the Node belongs to a Multislice group.
  1070  	MultisliceNode bool `json:"multisliceNode,omitempty"`
  1071  	// Name: Output only. Immutable. The name of the TPU.
  1072  	Name string `json:"name,omitempty"`
  1073  	// NetworkConfig: Network configurations for the TPU node.
  1074  	NetworkConfig *NetworkConfig `json:"networkConfig,omitempty"`
  1075  	// NetworkEndpoints: Output only. The network endpoints where TPU workers can
  1076  	// be accessed and sent work. It is recommended that runtime clients of the
  1077  	// node reach out to the 0th entry in this map first.
  1078  	NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
  1079  	// QueuedResource: Output only. The qualified name of the QueuedResource that
  1080  	// requested this Node.
  1081  	QueuedResource string `json:"queuedResource,omitempty"`
  1082  	// RuntimeVersion: Required. The runtime version running in the Node.
  1083  	RuntimeVersion string `json:"runtimeVersion,omitempty"`
  1084  	// SchedulingConfig: The scheduling options for this node.
  1085  	SchedulingConfig *SchedulingConfig `json:"schedulingConfig,omitempty"`
  1086  	// ServiceAccount: The Google Cloud Platform Service Account to be used by the
  1087  	// TPU node VMs. If None is specified, the default compute service account will
  1088  	// be used.
  1089  	ServiceAccount *ServiceAccount `json:"serviceAccount,omitempty"`
  1090  	// ShieldedInstanceConfig: Shielded Instance options.
  1091  	ShieldedInstanceConfig *ShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"`
  1092  	// State: Output only. The current state for the TPU Node.
  1093  	//
  1094  	// Possible values:
  1095  	//   "STATE_UNSPECIFIED" - TPU node state is not known/set.
  1096  	//   "CREATING" - TPU node is being created.
  1097  	//   "READY" - TPU node has been created.
  1098  	//   "RESTARTING" - TPU node is restarting.
  1099  	//   "REIMAGING" - TPU node is undergoing reimaging.
  1100  	//   "DELETING" - TPU node is being deleted.
  1101  	//   "REPAIRING" - TPU node is being repaired and may be unusable. Details can
  1102  	// be found in the 'help_description' field.
  1103  	//   "STOPPED" - TPU node is stopped.
  1104  	//   "STOPPING" - TPU node is currently stopping.
  1105  	//   "STARTING" - TPU node is currently starting.
  1106  	//   "PREEMPTED" - TPU node has been preempted. Only applies to Preemptible TPU
  1107  	// Nodes.
  1108  	//   "TERMINATED" - TPU node has been terminated due to maintenance or has
  1109  	// reached the end of its life cycle (for preemptible nodes).
  1110  	//   "HIDING" - TPU node is currently hiding.
  1111  	//   "HIDDEN" - TPU node has been hidden.
  1112  	//   "UNHIDING" - TPU node is currently unhiding.
  1113  	State string `json:"state,omitempty"`
  1114  	// Symptoms: Output only. The Symptoms that have occurred to the TPU Node.
  1115  	Symptoms []*Symptom `json:"symptoms,omitempty"`
  1116  	// Tags: Tags to apply to the TPU Node. Tags are used to identify valid sources
  1117  	// or targets for network firewalls.
  1118  	Tags []string `json:"tags,omitempty"`
  1119  
  1120  	// ServerResponse contains the HTTP response code and headers from the server.
  1121  	googleapi.ServerResponse `json:"-"`
  1122  	// ForceSendFields is a list of field names (e.g. "AcceleratorConfig") to
  1123  	// unconditionally include in API requests. By default, fields with empty or
  1124  	// default values are omitted from API requests. See
  1125  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1126  	// details.
  1127  	ForceSendFields []string `json:"-"`
  1128  	// NullFields is a list of field names (e.g. "AcceleratorConfig") to include in
  1129  	// API requests with the JSON null value. By default, fields with empty values
  1130  	// are omitted from API requests. See
  1131  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1132  	NullFields []string `json:"-"`
  1133  }
  1134  
  1135  func (s *Node) MarshalJSON() ([]byte, error) {
  1136  	type NoMethod Node
  1137  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1138  }
  1139  
  1140  // NodeSpec: Details of the TPU node(s) being requested. Users can request
  1141  // either a single node or multiple nodes. NodeSpec provides the specification
  1142  // for node(s) to be created.
  1143  type NodeSpec struct {
  1144  	// MultiNodeParams: Optional. Fields to specify in case of multi-node request.
  1145  	MultiNodeParams *MultiNodeParams `json:"multiNodeParams,omitempty"`
  1146  	// Node: Required. The node.
  1147  	Node *Node `json:"node,omitempty"`
  1148  	// NodeId: The unqualified resource name. Should follow the
  1149  	// `^[A-Za-z0-9_.~+%-]+$` regex format. This is only specified when requesting
  1150  	// a single node. In case of multi-node requests, multi_node_params must be
  1151  	// populated instead. It's an error to specify both node_id and
  1152  	// multi_node_params.
  1153  	NodeId string `json:"nodeId,omitempty"`
  1154  	// Parent: Required. The parent resource name.
  1155  	Parent string `json:"parent,omitempty"`
  1156  	// ForceSendFields is a list of field names (e.g. "MultiNodeParams") to
  1157  	// unconditionally include in API requests. By default, fields with empty or
  1158  	// default values are omitted from API requests. See
  1159  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1160  	// details.
  1161  	ForceSendFields []string `json:"-"`
  1162  	// NullFields is a list of field names (e.g. "MultiNodeParams") to include in
  1163  	// API requests with the JSON null value. By default, fields with empty values
  1164  	// are omitted from API requests. See
  1165  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1166  	NullFields []string `json:"-"`
  1167  }
  1168  
  1169  func (s *NodeSpec) MarshalJSON() ([]byte, error) {
  1170  	type NoMethod NodeSpec
  1171  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1172  }
  1173  
  1174  // Operation: This resource represents a long-running operation that is the
  1175  // result of a network API call.
  1176  type Operation struct {
  1177  	// Done: If the value is `false`, it means the operation is still in progress.
  1178  	// If `true`, the operation is completed, and either `error` or `response` is
  1179  	// available.
  1180  	Done bool `json:"done,omitempty"`
  1181  	// Error: The error result of the operation in case of failure or cancellation.
  1182  	Error *Status `json:"error,omitempty"`
  1183  	// Metadata: Service-specific metadata associated with the operation. It
  1184  	// typically contains progress information and common metadata such as create
  1185  	// time. Some services might not provide such metadata. Any method that returns
  1186  	// a long-running operation should document the metadata type, if any.
  1187  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  1188  	// Name: The server-assigned name, which is only unique within the same service
  1189  	// that originally returns it. If you use the default HTTP mapping, the `name`
  1190  	// should be a resource name ending with `operations/{unique_id}`.
  1191  	Name string `json:"name,omitempty"`
  1192  	// Response: The normal, successful response of the operation. If the original
  1193  	// method returns no data on success, such as `Delete`, the response is
  1194  	// `google.protobuf.Empty`. If the original method is standard
  1195  	// `Get`/`Create`/`Update`, the response should be the resource. For other
  1196  	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
  1197  	// original method name. For example, if the original method name is
  1198  	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
  1199  	Response googleapi.RawMessage `json:"response,omitempty"`
  1200  
  1201  	// ServerResponse contains the HTTP response code and headers from the server.
  1202  	googleapi.ServerResponse `json:"-"`
  1203  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
  1204  	// include in API requests. By default, fields with empty or default values are
  1205  	// omitted from API requests. See
  1206  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1207  	// details.
  1208  	ForceSendFields []string `json:"-"`
  1209  	// NullFields is a list of field names (e.g. "Done") to include in API requests
  1210  	// with the JSON null value. By default, fields with empty values are omitted
  1211  	// from API requests. See
  1212  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1213  	NullFields []string `json:"-"`
  1214  }
  1215  
  1216  func (s *Operation) MarshalJSON() ([]byte, error) {
  1217  	type NoMethod Operation
  1218  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1219  }
  1220  
  1221  // OperationMetadata: Metadata describing an Operation
  1222  type OperationMetadata struct {
  1223  	// ApiVersion: API version.
  1224  	ApiVersion string `json:"apiVersion,omitempty"`
  1225  	// CancelRequested: Specifies if cancellation was requested for the operation.
  1226  	CancelRequested bool `json:"cancelRequested,omitempty"`
  1227  	// CreateTime: The time the operation was created.
  1228  	CreateTime string `json:"createTime,omitempty"`
  1229  	// EndTime: The time the operation finished running.
  1230  	EndTime string `json:"endTime,omitempty"`
  1231  	// StatusDetail: Human-readable status of the operation, if any.
  1232  	StatusDetail string `json:"statusDetail,omitempty"`
  1233  	// Target: Target of the operation - for example
  1234  	// projects/project-1/connectivityTests/test-1
  1235  	Target string `json:"target,omitempty"`
  1236  	// Verb: Name of the verb executed by the operation.
  1237  	Verb string `json:"verb,omitempty"`
  1238  	// ForceSendFields is a list of field names (e.g. "ApiVersion") to
  1239  	// unconditionally include in API requests. By default, fields with empty or
  1240  	// default values are omitted from API requests. See
  1241  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1242  	// details.
  1243  	ForceSendFields []string `json:"-"`
  1244  	// NullFields is a list of field names (e.g. "ApiVersion") to include in API
  1245  	// requests with the JSON null value. By default, fields with empty values are
  1246  	// omitted from API requests. See
  1247  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1248  	NullFields []string `json:"-"`
  1249  }
  1250  
  1251  func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
  1252  	type NoMethod OperationMetadata
  1253  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1254  }
  1255  
  1256  // ProvisioningData: Further data for the provisioning state.
  1257  type ProvisioningData struct {
  1258  }
  1259  
  1260  // QueuedResource: A QueuedResource represents a request for resources that
  1261  // will be placed in a queue and fulfilled when the necessary resources are
  1262  // available.
  1263  type QueuedResource struct {
  1264  	// BestEffort: The BestEffort tier.
  1265  	BestEffort *BestEffort `json:"bestEffort,omitempty"`
  1266  	// CreateTime: Output only. The time when the QueuedResource was created.
  1267  	CreateTime string `json:"createTime,omitempty"`
  1268  	// Guaranteed: The Guaranteed tier.
  1269  	Guaranteed *Guaranteed `json:"guaranteed,omitempty"`
  1270  	// Name: Output only. Immutable. The name of the QueuedResource.
  1271  	Name string `json:"name,omitempty"`
  1272  	// QueueingPolicy: The queueing policy of the QueuedRequest.
  1273  	QueueingPolicy *QueueingPolicy `json:"queueingPolicy,omitempty"`
  1274  	// ReservationName: Name of the reservation in which the resource should be
  1275  	// provisioned. Format:
  1276  	// projects/{project}/locations/{zone}/reservations/{reservation}
  1277  	ReservationName string `json:"reservationName,omitempty"`
  1278  	// Spot: Optional. The Spot tier.
  1279  	Spot *Spot `json:"spot,omitempty"`
  1280  	// State: Output only. State of the QueuedResource request.
  1281  	State *QueuedResourceState `json:"state,omitempty"`
  1282  	// Tpu: Defines a TPU resource.
  1283  	Tpu *Tpu `json:"tpu,omitempty"`
  1284  
  1285  	// ServerResponse contains the HTTP response code and headers from the server.
  1286  	googleapi.ServerResponse `json:"-"`
  1287  	// ForceSendFields is a list of field names (e.g. "BestEffort") to
  1288  	// unconditionally include in API requests. By default, fields with empty or
  1289  	// default values are omitted from API requests. See
  1290  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1291  	// details.
  1292  	ForceSendFields []string `json:"-"`
  1293  	// NullFields is a list of field names (e.g. "BestEffort") to include in API
  1294  	// requests with the JSON null value. By default, fields with empty values are
  1295  	// omitted from API requests. See
  1296  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1297  	NullFields []string `json:"-"`
  1298  }
  1299  
  1300  func (s *QueuedResource) MarshalJSON() ([]byte, error) {
  1301  	type NoMethod QueuedResource
  1302  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1303  }
  1304  
  1305  // QueuedResourceState: QueuedResourceState defines the details of the
  1306  // QueuedResource request.
  1307  type QueuedResourceState struct {
  1308  	// AcceptedData: Further data for the accepted state.
  1309  	AcceptedData *AcceptedData `json:"acceptedData,omitempty"`
  1310  	// ActiveData: Further data for the active state.
  1311  	ActiveData *ActiveData `json:"activeData,omitempty"`
  1312  	// CreatingData: Further data for the creating state.
  1313  	CreatingData *CreatingData `json:"creatingData,omitempty"`
  1314  	// DeletingData: Further data for the deleting state.
  1315  	DeletingData *DeletingData `json:"deletingData,omitempty"`
  1316  	// FailedData: Further data for the failed state.
  1317  	FailedData *FailedData `json:"failedData,omitempty"`
  1318  	// ProvisioningData: Further data for the provisioning state.
  1319  	ProvisioningData *ProvisioningData `json:"provisioningData,omitempty"`
  1320  	// State: State of the QueuedResource request.
  1321  	//
  1322  	// Possible values:
  1323  	//   "STATE_UNSPECIFIED" - State of the QueuedResource request is not
  1324  	// known/set.
  1325  	//   "CREATING" - The QueuedResource request has been received. We're still
  1326  	// working on determining if we will be able to honor this request.
  1327  	//   "ACCEPTED" - The QueuedResource request has passed initial
  1328  	// validation/admission control and has been persisted in the queue.
  1329  	//   "PROVISIONING" - The QueuedResource request has been selected. The
  1330  	// associated resources are currently being provisioned (or very soon will
  1331  	// begin provisioning).
  1332  	//   "FAILED" - The request could not be completed. This may be due to some
  1333  	// late-discovered problem with the request itself, or due to unavailability of
  1334  	// resources within the constraints of the request (e.g., the 'valid until'
  1335  	// start timing constraint expired).
  1336  	//   "DELETING" - The QueuedResource is being deleted.
  1337  	//   "ACTIVE" - The resources specified in the QueuedResource request have been
  1338  	// provisioned and are ready for use by the end-user/consumer.
  1339  	//   "SUSPENDING" - The resources specified in the QueuedResource request are
  1340  	// being deleted. This may have been initiated by the user, or the Cloud TPU
  1341  	// service. Inspect the state data for more details.
  1342  	//   "SUSPENDED" - The resources specified in the QueuedResource request have
  1343  	// been deleted.
  1344  	//   "WAITING_FOR_RESOURCES" - The QueuedResource request has passed initial
  1345  	// validation and has been persisted in the queue. It will remain in this state
  1346  	// until there are sufficient free resources to begin provisioning your
  1347  	// request. Wait times will vary significantly depending on demand levels. When
  1348  	// demand is high, not all requests can be immediately provisioned. If you need
  1349  	// more reliable obtainability of TPUs consider purchasing a reservation. To
  1350  	// put a limit on how long you are willing to wait, use [timing
  1351  	// constraints](https://cloud.google.com/tpu/docs/queued-resources#request_a_que
  1352  	// ued_resource_before_a_specified_time).
  1353  	State string `json:"state,omitempty"`
  1354  	// StateInitiator: Output only. The initiator of the QueuedResources's current
  1355  	// state. Used to indicate whether the SUSPENDING/SUSPENDED state was initiated
  1356  	// by the user or the service.
  1357  	//
  1358  	// Possible values:
  1359  	//   "STATE_INITIATOR_UNSPECIFIED" - The state initiator is unspecified.
  1360  	//   "USER" - The current QueuedResource state was initiated by the user.
  1361  	//   "SERVICE" - The current QueuedResource state was initiated by the service.
  1362  	StateInitiator string `json:"stateInitiator,omitempty"`
  1363  	// SuspendedData: Further data for the suspended state.
  1364  	SuspendedData *SuspendedData `json:"suspendedData,omitempty"`
  1365  	// SuspendingData: Further data for the suspending state.
  1366  	SuspendingData *SuspendingData `json:"suspendingData,omitempty"`
  1367  	// ForceSendFields is a list of field names (e.g. "AcceptedData") to
  1368  	// unconditionally include in API requests. By default, fields with empty or
  1369  	// default values are omitted from API requests. See
  1370  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1371  	// details.
  1372  	ForceSendFields []string `json:"-"`
  1373  	// NullFields is a list of field names (e.g. "AcceptedData") to include in API
  1374  	// requests with the JSON null value. By default, fields with empty values are
  1375  	// omitted from API requests. See
  1376  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1377  	NullFields []string `json:"-"`
  1378  }
  1379  
  1380  func (s *QueuedResourceState) MarshalJSON() ([]byte, error) {
  1381  	type NoMethod QueuedResourceState
  1382  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1383  }
  1384  
  1385  // QueueingPolicy: Defines the policy of the QueuedRequest.
  1386  type QueueingPolicy struct {
  1387  	// ValidAfterDuration: A relative time after which resources may be created.
  1388  	ValidAfterDuration string `json:"validAfterDuration,omitempty"`
  1389  	// ValidAfterTime: An absolute time at which resources may be created.
  1390  	ValidAfterTime string `json:"validAfterTime,omitempty"`
  1391  	// ValidInterval: An absolute time interval within which resources may be
  1392  	// created.
  1393  	ValidInterval *Interval `json:"validInterval,omitempty"`
  1394  	// ValidUntilDuration: A relative time after which resources should not be
  1395  	// created. If the request cannot be fulfilled by this time the request will be
  1396  	// failed.
  1397  	ValidUntilDuration string `json:"validUntilDuration,omitempty"`
  1398  	// ValidUntilTime: An absolute time after which resources should not be
  1399  	// created. If the request cannot be fulfilled by this time the request will be
  1400  	// failed.
  1401  	ValidUntilTime string `json:"validUntilTime,omitempty"`
  1402  	// ForceSendFields is a list of field names (e.g. "ValidAfterDuration") to
  1403  	// unconditionally include in API requests. By default, fields with empty or
  1404  	// default values are omitted from API requests. See
  1405  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1406  	// details.
  1407  	ForceSendFields []string `json:"-"`
  1408  	// NullFields is a list of field names (e.g. "ValidAfterDuration") to include
  1409  	// in API requests with the JSON null value. By default, fields with empty
  1410  	// values are omitted from API requests. See
  1411  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1412  	NullFields []string `json:"-"`
  1413  }
  1414  
  1415  func (s *QueueingPolicy) MarshalJSON() ([]byte, error) {
  1416  	type NoMethod QueueingPolicy
  1417  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1418  }
  1419  
  1420  // Reservation: A reservation describes the amount of a resource 'allotted' for
  1421  // a defined period of time.
  1422  type Reservation struct {
  1423  	// Name: The reservation name with the format:
  1424  	// projects/{projectID}/locations/{location}/reservations/{reservationID}
  1425  	Name     string    `json:"name,omitempty"`
  1426  	Standard *Standard `json:"standard,omitempty"`
  1427  	// State: Output only. The state of the Reservation.
  1428  	//
  1429  	// Possible values:
  1430  	//   "STATE_UNSPECIFIED" - The Reservation state is unspecified.
  1431  	//   "APPROVED" - The Reservation has been approved.
  1432  	//   "PROVISIONING" - The Reservation is being provisioned.
  1433  	//   "ACTIVE" - The Reservation is active.
  1434  	//   "DEPROVISIONING" - The Reservation is being deprovisioned.
  1435  	//   "EXPIRED" - The Reservation is past its end date.
  1436  	//   "FAILED" - The Reservation encountered a failure during mutation.
  1437  	State string `json:"state,omitempty"`
  1438  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
  1439  	// include in API requests. By default, fields with empty or default values are
  1440  	// omitted from API requests. See
  1441  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1442  	// details.
  1443  	ForceSendFields []string `json:"-"`
  1444  	// NullFields is a list of field names (e.g. "Name") to include in API requests
  1445  	// with the JSON null value. By default, fields with empty values are omitted
  1446  	// from API requests. See
  1447  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1448  	NullFields []string `json:"-"`
  1449  }
  1450  
  1451  func (s *Reservation) MarshalJSON() ([]byte, error) {
  1452  	type NoMethod Reservation
  1453  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1454  }
  1455  
  1456  // ResetQueuedResourceRequest: Request for ResetQueuedResource.
  1457  type ResetQueuedResourceRequest struct {
  1458  }
  1459  
  1460  // RuntimeVersion: A runtime version that a Node can be configured with.
  1461  type RuntimeVersion struct {
  1462  	// Name: The resource name.
  1463  	Name string `json:"name,omitempty"`
  1464  	// Version: The runtime version.
  1465  	Version string `json:"version,omitempty"`
  1466  
  1467  	// ServerResponse contains the HTTP response code and headers from the server.
  1468  	googleapi.ServerResponse `json:"-"`
  1469  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
  1470  	// include in API requests. By default, fields with empty or default values are
  1471  	// omitted from API requests. See
  1472  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1473  	// details.
  1474  	ForceSendFields []string `json:"-"`
  1475  	// NullFields is a list of field names (e.g. "Name") to include in API requests
  1476  	// with the JSON null value. By default, fields with empty values are omitted
  1477  	// from API requests. See
  1478  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1479  	NullFields []string `json:"-"`
  1480  }
  1481  
  1482  func (s *RuntimeVersion) MarshalJSON() ([]byte, error) {
  1483  	type NoMethod RuntimeVersion
  1484  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1485  }
  1486  
  1487  // SchedulingConfig: Sets the scheduling options for this node.
  1488  type SchedulingConfig struct {
  1489  	// Preemptible: Defines whether the node is preemptible.
  1490  	Preemptible bool `json:"preemptible,omitempty"`
  1491  	// Reserved: Whether the node is created under a reservation.
  1492  	Reserved bool `json:"reserved,omitempty"`
  1493  	// Spot: Optional. Defines whether the node is Spot VM.
  1494  	Spot bool `json:"spot,omitempty"`
  1495  	// ForceSendFields is a list of field names (e.g. "Preemptible") to
  1496  	// unconditionally include in API requests. By default, fields with empty or
  1497  	// default values are omitted from API requests. See
  1498  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1499  	// details.
  1500  	ForceSendFields []string `json:"-"`
  1501  	// NullFields is a list of field names (e.g. "Preemptible") to include in API
  1502  	// requests with the JSON null value. By default, fields with empty values are
  1503  	// omitted from API requests. See
  1504  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1505  	NullFields []string `json:"-"`
  1506  }
  1507  
  1508  func (s *SchedulingConfig) MarshalJSON() ([]byte, error) {
  1509  	type NoMethod SchedulingConfig
  1510  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1511  }
  1512  
  1513  // ServiceAccount: A service account.
  1514  type ServiceAccount struct {
  1515  	// Email: Email address of the service account. If empty, default Compute
  1516  	// service account will be used.
  1517  	Email string `json:"email,omitempty"`
  1518  	// Scope: The list of scopes to be made available for this service account. If
  1519  	// empty, access to all Cloud APIs will be allowed.
  1520  	Scope []string `json:"scope,omitempty"`
  1521  	// ForceSendFields is a list of field names (e.g. "Email") to unconditionally
  1522  	// include in API requests. By default, fields with empty or default values are
  1523  	// omitted from API requests. See
  1524  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1525  	// details.
  1526  	ForceSendFields []string `json:"-"`
  1527  	// NullFields is a list of field names (e.g. "Email") to include in API
  1528  	// requests with the JSON null value. By default, fields with empty values are
  1529  	// omitted from API requests. See
  1530  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1531  	NullFields []string `json:"-"`
  1532  }
  1533  
  1534  func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  1535  	type NoMethod ServiceAccount
  1536  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1537  }
  1538  
  1539  // ServiceIdentity: The per-product per-project service identity for Cloud TPU
  1540  // service.
  1541  type ServiceIdentity struct {
  1542  	// Email: The email address of the service identity.
  1543  	Email string `json:"email,omitempty"`
  1544  	// ForceSendFields is a list of field names (e.g. "Email") to unconditionally
  1545  	// include in API requests. By default, fields with empty or default values are
  1546  	// omitted from API requests. See
  1547  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1548  	// details.
  1549  	ForceSendFields []string `json:"-"`
  1550  	// NullFields is a list of field names (e.g. "Email") to include in API
  1551  	// requests with the JSON null value. By default, fields with empty values are
  1552  	// omitted from API requests. See
  1553  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1554  	NullFields []string `json:"-"`
  1555  }
  1556  
  1557  func (s *ServiceIdentity) MarshalJSON() ([]byte, error) {
  1558  	type NoMethod ServiceIdentity
  1559  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1560  }
  1561  
  1562  // ShieldedInstanceConfig: A set of Shielded Instance options.
  1563  type ShieldedInstanceConfig struct {
  1564  	// EnableSecureBoot: Defines whether the instance has Secure Boot enabled.
  1565  	EnableSecureBoot bool `json:"enableSecureBoot,omitempty"`
  1566  	// ForceSendFields is a list of field names (e.g. "EnableSecureBoot") to
  1567  	// unconditionally include in API requests. By default, fields with empty or
  1568  	// default values are omitted from API requests. See
  1569  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1570  	// details.
  1571  	ForceSendFields []string `json:"-"`
  1572  	// NullFields is a list of field names (e.g. "EnableSecureBoot") to include in
  1573  	// API requests with the JSON null value. By default, fields with empty values
  1574  	// are omitted from API requests. See
  1575  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1576  	NullFields []string `json:"-"`
  1577  }
  1578  
  1579  func (s *ShieldedInstanceConfig) MarshalJSON() ([]byte, error) {
  1580  	type NoMethod ShieldedInstanceConfig
  1581  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1582  }
  1583  
  1584  // SimulateMaintenanceEventRequest: Request for SimulateMaintenanceEvent.
  1585  type SimulateMaintenanceEventRequest struct {
  1586  	// WorkerIds: The 0-based worker ID. If it is empty, worker ID 0 will be
  1587  	// selected for maintenance event simulation. A maintenance event will only be
  1588  	// fired on the first specified worker ID. Future implementations may support
  1589  	// firing on multiple workers.
  1590  	WorkerIds []string `json:"workerIds,omitempty"`
  1591  	// ForceSendFields is a list of field names (e.g. "WorkerIds") to
  1592  	// unconditionally include in API requests. By default, fields with empty or
  1593  	// default values are omitted from API requests. See
  1594  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1595  	// details.
  1596  	ForceSendFields []string `json:"-"`
  1597  	// NullFields is a list of field names (e.g. "WorkerIds") to include in API
  1598  	// requests with the JSON null value. By default, fields with empty values are
  1599  	// omitted from API requests. See
  1600  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1601  	NullFields []string `json:"-"`
  1602  }
  1603  
  1604  func (s *SimulateMaintenanceEventRequest) MarshalJSON() ([]byte, error) {
  1605  	type NoMethod SimulateMaintenanceEventRequest
  1606  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1607  }
  1608  
  1609  // Spot: Spot tier definition.
  1610  type Spot struct {
  1611  }
  1612  
  1613  type Standard struct {
  1614  	// Possible values:
  1615  	//   "CAPACITY_UNITS_UNSPECIFIED" - The capacity units is not known/set.
  1616  	//   "CORES" - The capacity unit is set to CORES.
  1617  	//   "CHIPS" - The capacity unit is set to CHIPS.
  1618  	CapacityUnits string `json:"capacityUnits,omitempty"`
  1619  	// Interval: The start and end time of the reservation.
  1620  	Interval *Interval `json:"interval,omitempty"`
  1621  	// ResourceType: The resource type of the reservation.
  1622  	ResourceType string `json:"resourceType,omitempty"`
  1623  	// Size: The size of the reservation, in the units specified in the
  1624  	// 'capacity_units' field.
  1625  	Size  int64  `json:"size,omitempty"`
  1626  	Usage *Usage `json:"usage,omitempty"`
  1627  	// ForceSendFields is a list of field names (e.g. "CapacityUnits") to
  1628  	// unconditionally include in API requests. By default, fields with empty or
  1629  	// default values are omitted from API requests. See
  1630  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1631  	// details.
  1632  	ForceSendFields []string `json:"-"`
  1633  	// NullFields is a list of field names (e.g. "CapacityUnits") to include in API
  1634  	// requests with the JSON null value. By default, fields with empty values are
  1635  	// omitted from API requests. See
  1636  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1637  	NullFields []string `json:"-"`
  1638  }
  1639  
  1640  func (s *Standard) MarshalJSON() ([]byte, error) {
  1641  	type NoMethod Standard
  1642  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1643  }
  1644  
  1645  // StartNodeRequest: Request for StartNode.
  1646  type StartNodeRequest struct {
  1647  }
  1648  
  1649  // Status: The `Status` type defines a logical error model that is suitable for
  1650  // different programming environments, including REST APIs and RPC APIs. It is
  1651  // used by gRPC (https://github.com/grpc). Each `Status` message contains three
  1652  // pieces of data: error code, error message, and error details. You can find
  1653  // out more about this error model and how to work with it in the API Design
  1654  // Guide (https://cloud.google.com/apis/design/errors).
  1655  type Status struct {
  1656  	// Code: The status code, which should be an enum value of google.rpc.Code.
  1657  	Code int64 `json:"code,omitempty"`
  1658  	// Details: A list of messages that carry the error details. There is a common
  1659  	// set of message types for APIs to use.
  1660  	Details []googleapi.RawMessage `json:"details,omitempty"`
  1661  	// Message: A developer-facing error message, which should be in English. Any
  1662  	// user-facing error message should be localized and sent in the
  1663  	// google.rpc.Status.details field, or localized by the client.
  1664  	Message string `json:"message,omitempty"`
  1665  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
  1666  	// include in API requests. By default, fields with empty or default values are
  1667  	// omitted from API requests. See
  1668  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1669  	// details.
  1670  	ForceSendFields []string `json:"-"`
  1671  	// NullFields is a list of field names (e.g. "Code") to include in API requests
  1672  	// with the JSON null value. By default, fields with empty values are omitted
  1673  	// from API requests. See
  1674  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1675  	NullFields []string `json:"-"`
  1676  }
  1677  
  1678  func (s *Status) MarshalJSON() ([]byte, error) {
  1679  	type NoMethod Status
  1680  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1681  }
  1682  
  1683  // StopNodeRequest: Request for StopNode.
  1684  type StopNodeRequest struct {
  1685  }
  1686  
  1687  // SuspendedData: Further data for the suspended state.
  1688  type SuspendedData struct {
  1689  }
  1690  
  1691  // SuspendingData: Further data for the suspending state.
  1692  type SuspendingData struct {
  1693  }
  1694  
  1695  // Symptom: A Symptom instance.
  1696  type Symptom struct {
  1697  	// CreateTime: Timestamp when the Symptom is created.
  1698  	CreateTime string `json:"createTime,omitempty"`
  1699  	// Details: Detailed information of the current Symptom.
  1700  	Details string `json:"details,omitempty"`
  1701  	// SymptomType: Type of the Symptom.
  1702  	//
  1703  	// Possible values:
  1704  	//   "SYMPTOM_TYPE_UNSPECIFIED" - Unspecified symptom.
  1705  	//   "LOW_MEMORY" - TPU VM memory is low.
  1706  	//   "OUT_OF_MEMORY" - TPU runtime is out of memory.
  1707  	//   "EXECUTE_TIMED_OUT" - TPU runtime execution has timed out.
  1708  	//   "MESH_BUILD_FAIL" - TPU runtime fails to construct a mesh that recognizes
  1709  	// each TPU device's neighbors.
  1710  	//   "HBM_OUT_OF_MEMORY" - TPU HBM is out of memory.
  1711  	//   "PROJECT_ABUSE" - Abusive behaviors have been identified on the current
  1712  	// project.
  1713  	SymptomType string `json:"symptomType,omitempty"`
  1714  	// WorkerId: A string used to uniquely distinguish a worker within a TPU node.
  1715  	WorkerId string `json:"workerId,omitempty"`
  1716  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
  1717  	// unconditionally include in API requests. By default, fields with empty or
  1718  	// default values are omitted from API requests. See
  1719  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1720  	// details.
  1721  	ForceSendFields []string `json:"-"`
  1722  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
  1723  	// requests with the JSON null value. By default, fields with empty values are
  1724  	// omitted from API requests. See
  1725  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1726  	NullFields []string `json:"-"`
  1727  }
  1728  
  1729  func (s *Symptom) MarshalJSON() ([]byte, error) {
  1730  	type NoMethod Symptom
  1731  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1732  }
  1733  
  1734  // Tpu: Details of the TPU resource(s) being requested.
  1735  type Tpu struct {
  1736  	// NodeSpec: The TPU node(s) being requested.
  1737  	NodeSpec []*NodeSpec `json:"nodeSpec,omitempty"`
  1738  	// ForceSendFields is a list of field names (e.g. "NodeSpec") to
  1739  	// unconditionally include in API requests. By default, fields with empty or
  1740  	// default values are omitted from API requests. See
  1741  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1742  	// details.
  1743  	ForceSendFields []string `json:"-"`
  1744  	// NullFields is a list of field names (e.g. "NodeSpec") to include in API
  1745  	// requests with the JSON null value. By default, fields with empty values are
  1746  	// omitted from API requests. See
  1747  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1748  	NullFields []string `json:"-"`
  1749  }
  1750  
  1751  func (s *Tpu) MarshalJSON() ([]byte, error) {
  1752  	type NoMethod Tpu
  1753  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1754  }
  1755  
  1756  type Usage struct {
  1757  	// Total: The real-time value of usage within the reservation, with the unit
  1758  	// specified in field capacity_units.
  1759  	Total int64 `json:"total,omitempty,string"`
  1760  	// ForceSendFields is a list of field names (e.g. "Total") to unconditionally
  1761  	// include in API requests. By default, fields with empty or default values are
  1762  	// omitted from API requests. See
  1763  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1764  	// details.
  1765  	ForceSendFields []string `json:"-"`
  1766  	// NullFields is a list of field names (e.g. "Total") to include in API
  1767  	// requests with the JSON null value. By default, fields with empty values are
  1768  	// omitted from API requests. See
  1769  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1770  	NullFields []string `json:"-"`
  1771  }
  1772  
  1773  func (s *Usage) MarshalJSON() ([]byte, error) {
  1774  	type NoMethod Usage
  1775  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1776  }
  1777  
  1778  type ProjectsLocationsGenerateServiceIdentityCall struct {
  1779  	s                              *Service
  1780  	parent                         string
  1781  	generateserviceidentityrequest *GenerateServiceIdentityRequest
  1782  	urlParams_                     gensupport.URLParams
  1783  	ctx_                           context.Context
  1784  	header_                        http.Header
  1785  }
  1786  
  1787  // GenerateServiceIdentity: Generates the Cloud TPU service identity for the
  1788  // project.
  1789  //
  1790  // - parent: The parent resource name.
  1791  func (r *ProjectsLocationsService) GenerateServiceIdentity(parent string, generateserviceidentityrequest *GenerateServiceIdentityRequest) *ProjectsLocationsGenerateServiceIdentityCall {
  1792  	c := &ProjectsLocationsGenerateServiceIdentityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1793  	c.parent = parent
  1794  	c.generateserviceidentityrequest = generateserviceidentityrequest
  1795  	return c
  1796  }
  1797  
  1798  // Fields allows partial responses to be retrieved. See
  1799  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1800  // details.
  1801  func (c *ProjectsLocationsGenerateServiceIdentityCall) Fields(s ...googleapi.Field) *ProjectsLocationsGenerateServiceIdentityCall {
  1802  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1803  	return c
  1804  }
  1805  
  1806  // Context sets the context to be used in this call's Do method.
  1807  func (c *ProjectsLocationsGenerateServiceIdentityCall) Context(ctx context.Context) *ProjectsLocationsGenerateServiceIdentityCall {
  1808  	c.ctx_ = ctx
  1809  	return c
  1810  }
  1811  
  1812  // Header returns a http.Header that can be modified by the caller to add
  1813  // headers to the request.
  1814  func (c *ProjectsLocationsGenerateServiceIdentityCall) Header() http.Header {
  1815  	if c.header_ == nil {
  1816  		c.header_ = make(http.Header)
  1817  	}
  1818  	return c.header_
  1819  }
  1820  
  1821  func (c *ProjectsLocationsGenerateServiceIdentityCall) doRequest(alt string) (*http.Response, error) {
  1822  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1823  	var body io.Reader = nil
  1824  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.generateserviceidentityrequest)
  1825  	if err != nil {
  1826  		return nil, err
  1827  	}
  1828  	c.urlParams_.Set("alt", alt)
  1829  	c.urlParams_.Set("prettyPrint", "false")
  1830  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+parent}:generateServiceIdentity")
  1831  	urls += "?" + c.urlParams_.Encode()
  1832  	req, err := http.NewRequest("POST", urls, body)
  1833  	if err != nil {
  1834  		return nil, err
  1835  	}
  1836  	req.Header = reqHeaders
  1837  	googleapi.Expand(req.URL, map[string]string{
  1838  		"parent": c.parent,
  1839  	})
  1840  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1841  }
  1842  
  1843  // Do executes the "tpu.projects.locations.generateServiceIdentity" call.
  1844  // Any non-2xx status code is an error. Response headers are in either
  1845  // *GenerateServiceIdentityResponse.ServerResponse.Header or (if a response was
  1846  // returned at all) in error.(*googleapi.Error).Header. Use
  1847  // googleapi.IsNotModified to check whether the returned error was because
  1848  // http.StatusNotModified was returned.
  1849  func (c *ProjectsLocationsGenerateServiceIdentityCall) Do(opts ...googleapi.CallOption) (*GenerateServiceIdentityResponse, error) {
  1850  	gensupport.SetOptions(c.urlParams_, opts...)
  1851  	res, err := c.doRequest("json")
  1852  	if res != nil && res.StatusCode == http.StatusNotModified {
  1853  		if res.Body != nil {
  1854  			res.Body.Close()
  1855  		}
  1856  		return nil, gensupport.WrapError(&googleapi.Error{
  1857  			Code:   res.StatusCode,
  1858  			Header: res.Header,
  1859  		})
  1860  	}
  1861  	if err != nil {
  1862  		return nil, err
  1863  	}
  1864  	defer googleapi.CloseBody(res)
  1865  	if err := googleapi.CheckResponse(res); err != nil {
  1866  		return nil, gensupport.WrapError(err)
  1867  	}
  1868  	ret := &GenerateServiceIdentityResponse{
  1869  		ServerResponse: googleapi.ServerResponse{
  1870  			Header:         res.Header,
  1871  			HTTPStatusCode: res.StatusCode,
  1872  		},
  1873  	}
  1874  	target := &ret
  1875  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1876  		return nil, err
  1877  	}
  1878  	return ret, nil
  1879  }
  1880  
  1881  type ProjectsLocationsGetCall struct {
  1882  	s            *Service
  1883  	name         string
  1884  	urlParams_   gensupport.URLParams
  1885  	ifNoneMatch_ string
  1886  	ctx_         context.Context
  1887  	header_      http.Header
  1888  }
  1889  
  1890  // Get: Gets information about a location.
  1891  //
  1892  // - name: Resource name for the location.
  1893  func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
  1894  	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1895  	c.name = name
  1896  	return c
  1897  }
  1898  
  1899  // Fields allows partial responses to be retrieved. See
  1900  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1901  // details.
  1902  func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
  1903  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1904  	return c
  1905  }
  1906  
  1907  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1908  // object's ETag matches the given value. This is useful for getting updates
  1909  // only after the object has changed since the last request.
  1910  func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
  1911  	c.ifNoneMatch_ = entityTag
  1912  	return c
  1913  }
  1914  
  1915  // Context sets the context to be used in this call's Do method.
  1916  func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
  1917  	c.ctx_ = ctx
  1918  	return c
  1919  }
  1920  
  1921  // Header returns a http.Header that can be modified by the caller to add
  1922  // headers to the request.
  1923  func (c *ProjectsLocationsGetCall) Header() http.Header {
  1924  	if c.header_ == nil {
  1925  		c.header_ = make(http.Header)
  1926  	}
  1927  	return c.header_
  1928  }
  1929  
  1930  func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  1931  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1932  	if c.ifNoneMatch_ != "" {
  1933  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1934  	}
  1935  	var body io.Reader = nil
  1936  	c.urlParams_.Set("alt", alt)
  1937  	c.urlParams_.Set("prettyPrint", "false")
  1938  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}")
  1939  	urls += "?" + c.urlParams_.Encode()
  1940  	req, err := http.NewRequest("GET", urls, body)
  1941  	if err != nil {
  1942  		return nil, err
  1943  	}
  1944  	req.Header = reqHeaders
  1945  	googleapi.Expand(req.URL, map[string]string{
  1946  		"name": c.name,
  1947  	})
  1948  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1949  }
  1950  
  1951  // Do executes the "tpu.projects.locations.get" call.
  1952  // Any non-2xx status code is an error. Response headers are in either
  1953  // *Location.ServerResponse.Header or (if a response was returned at all) in
  1954  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1955  // whether the returned error was because http.StatusNotModified was returned.
  1956  func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
  1957  	gensupport.SetOptions(c.urlParams_, opts...)
  1958  	res, err := c.doRequest("json")
  1959  	if res != nil && res.StatusCode == http.StatusNotModified {
  1960  		if res.Body != nil {
  1961  			res.Body.Close()
  1962  		}
  1963  		return nil, gensupport.WrapError(&googleapi.Error{
  1964  			Code:   res.StatusCode,
  1965  			Header: res.Header,
  1966  		})
  1967  	}
  1968  	if err != nil {
  1969  		return nil, err
  1970  	}
  1971  	defer googleapi.CloseBody(res)
  1972  	if err := googleapi.CheckResponse(res); err != nil {
  1973  		return nil, gensupport.WrapError(err)
  1974  	}
  1975  	ret := &Location{
  1976  		ServerResponse: googleapi.ServerResponse{
  1977  			Header:         res.Header,
  1978  			HTTPStatusCode: res.StatusCode,
  1979  		},
  1980  	}
  1981  	target := &ret
  1982  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1983  		return nil, err
  1984  	}
  1985  	return ret, nil
  1986  }
  1987  
  1988  type ProjectsLocationsListCall struct {
  1989  	s            *Service
  1990  	name         string
  1991  	urlParams_   gensupport.URLParams
  1992  	ifNoneMatch_ string
  1993  	ctx_         context.Context
  1994  	header_      http.Header
  1995  }
  1996  
  1997  // List: Lists information about the supported locations for this service.
  1998  //
  1999  // - name: The resource that owns the locations collection, if applicable.
  2000  func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
  2001  	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2002  	c.name = name
  2003  	return c
  2004  }
  2005  
  2006  // Filter sets the optional parameter "filter": A filter to narrow down results
  2007  // to a preferred subset. The filtering language accepts strings like
  2008  // "displayName=tokyo", and is documented in more detail in AIP-160
  2009  // (https://google.aip.dev/160).
  2010  func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
  2011  	c.urlParams_.Set("filter", filter)
  2012  	return c
  2013  }
  2014  
  2015  // PageSize sets the optional parameter "pageSize": The maximum number of
  2016  // results to return. If not set, the service selects a default.
  2017  func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
  2018  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2019  	return c
  2020  }
  2021  
  2022  // PageToken sets the optional parameter "pageToken": A page token received
  2023  // from the `next_page_token` field in the response. Send that page token to
  2024  // receive the subsequent page.
  2025  func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
  2026  	c.urlParams_.Set("pageToken", pageToken)
  2027  	return c
  2028  }
  2029  
  2030  // Fields allows partial responses to be retrieved. See
  2031  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2032  // details.
  2033  func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
  2034  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2035  	return c
  2036  }
  2037  
  2038  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2039  // object's ETag matches the given value. This is useful for getting updates
  2040  // only after the object has changed since the last request.
  2041  func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
  2042  	c.ifNoneMatch_ = entityTag
  2043  	return c
  2044  }
  2045  
  2046  // Context sets the context to be used in this call's Do method.
  2047  func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
  2048  	c.ctx_ = ctx
  2049  	return c
  2050  }
  2051  
  2052  // Header returns a http.Header that can be modified by the caller to add
  2053  // headers to the request.
  2054  func (c *ProjectsLocationsListCall) Header() http.Header {
  2055  	if c.header_ == nil {
  2056  		c.header_ = make(http.Header)
  2057  	}
  2058  	return c.header_
  2059  }
  2060  
  2061  func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  2062  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2063  	if c.ifNoneMatch_ != "" {
  2064  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2065  	}
  2066  	var body io.Reader = nil
  2067  	c.urlParams_.Set("alt", alt)
  2068  	c.urlParams_.Set("prettyPrint", "false")
  2069  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}/locations")
  2070  	urls += "?" + c.urlParams_.Encode()
  2071  	req, err := http.NewRequest("GET", urls, body)
  2072  	if err != nil {
  2073  		return nil, err
  2074  	}
  2075  	req.Header = reqHeaders
  2076  	googleapi.Expand(req.URL, map[string]string{
  2077  		"name": c.name,
  2078  	})
  2079  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2080  }
  2081  
  2082  // Do executes the "tpu.projects.locations.list" call.
  2083  // Any non-2xx status code is an error. Response headers are in either
  2084  // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
  2085  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2086  // check whether the returned error was because http.StatusNotModified was
  2087  // returned.
  2088  func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
  2089  	gensupport.SetOptions(c.urlParams_, opts...)
  2090  	res, err := c.doRequest("json")
  2091  	if res != nil && res.StatusCode == http.StatusNotModified {
  2092  		if res.Body != nil {
  2093  			res.Body.Close()
  2094  		}
  2095  		return nil, gensupport.WrapError(&googleapi.Error{
  2096  			Code:   res.StatusCode,
  2097  			Header: res.Header,
  2098  		})
  2099  	}
  2100  	if err != nil {
  2101  		return nil, err
  2102  	}
  2103  	defer googleapi.CloseBody(res)
  2104  	if err := googleapi.CheckResponse(res); err != nil {
  2105  		return nil, gensupport.WrapError(err)
  2106  	}
  2107  	ret := &ListLocationsResponse{
  2108  		ServerResponse: googleapi.ServerResponse{
  2109  			Header:         res.Header,
  2110  			HTTPStatusCode: res.StatusCode,
  2111  		},
  2112  	}
  2113  	target := &ret
  2114  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2115  		return nil, err
  2116  	}
  2117  	return ret, nil
  2118  }
  2119  
  2120  // Pages invokes f for each page of results.
  2121  // A non-nil error returned from f will halt the iteration.
  2122  // The provided context supersedes any context provided to the Context method.
  2123  func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
  2124  	c.ctx_ = ctx
  2125  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2126  	for {
  2127  		x, err := c.Do()
  2128  		if err != nil {
  2129  			return err
  2130  		}
  2131  		if err := f(x); err != nil {
  2132  			return err
  2133  		}
  2134  		if x.NextPageToken == "" {
  2135  			return nil
  2136  		}
  2137  		c.PageToken(x.NextPageToken)
  2138  	}
  2139  }
  2140  
  2141  type ProjectsLocationsAcceleratorTypesGetCall struct {
  2142  	s            *Service
  2143  	name         string
  2144  	urlParams_   gensupport.URLParams
  2145  	ifNoneMatch_ string
  2146  	ctx_         context.Context
  2147  	header_      http.Header
  2148  }
  2149  
  2150  // Get: Gets AcceleratorType.
  2151  //
  2152  // - name: The resource name.
  2153  func (r *ProjectsLocationsAcceleratorTypesService) Get(name string) *ProjectsLocationsAcceleratorTypesGetCall {
  2154  	c := &ProjectsLocationsAcceleratorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2155  	c.name = name
  2156  	return c
  2157  }
  2158  
  2159  // Fields allows partial responses to be retrieved. See
  2160  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2161  // details.
  2162  func (c *ProjectsLocationsAcceleratorTypesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsAcceleratorTypesGetCall {
  2163  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2164  	return c
  2165  }
  2166  
  2167  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2168  // object's ETag matches the given value. This is useful for getting updates
  2169  // only after the object has changed since the last request.
  2170  func (c *ProjectsLocationsAcceleratorTypesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsAcceleratorTypesGetCall {
  2171  	c.ifNoneMatch_ = entityTag
  2172  	return c
  2173  }
  2174  
  2175  // Context sets the context to be used in this call's Do method.
  2176  func (c *ProjectsLocationsAcceleratorTypesGetCall) Context(ctx context.Context) *ProjectsLocationsAcceleratorTypesGetCall {
  2177  	c.ctx_ = ctx
  2178  	return c
  2179  }
  2180  
  2181  // Header returns a http.Header that can be modified by the caller to add
  2182  // headers to the request.
  2183  func (c *ProjectsLocationsAcceleratorTypesGetCall) Header() http.Header {
  2184  	if c.header_ == nil {
  2185  		c.header_ = make(http.Header)
  2186  	}
  2187  	return c.header_
  2188  }
  2189  
  2190  func (c *ProjectsLocationsAcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) {
  2191  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2192  	if c.ifNoneMatch_ != "" {
  2193  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2194  	}
  2195  	var body io.Reader = nil
  2196  	c.urlParams_.Set("alt", alt)
  2197  	c.urlParams_.Set("prettyPrint", "false")
  2198  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}")
  2199  	urls += "?" + c.urlParams_.Encode()
  2200  	req, err := http.NewRequest("GET", urls, body)
  2201  	if err != nil {
  2202  		return nil, err
  2203  	}
  2204  	req.Header = reqHeaders
  2205  	googleapi.Expand(req.URL, map[string]string{
  2206  		"name": c.name,
  2207  	})
  2208  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2209  }
  2210  
  2211  // Do executes the "tpu.projects.locations.acceleratorTypes.get" call.
  2212  // Any non-2xx status code is an error. Response headers are in either
  2213  // *AcceleratorType.ServerResponse.Header or (if a response was returned at
  2214  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2215  // check whether the returned error was because http.StatusNotModified was
  2216  // returned.
  2217  func (c *ProjectsLocationsAcceleratorTypesGetCall) Do(opts ...googleapi.CallOption) (*AcceleratorType, error) {
  2218  	gensupport.SetOptions(c.urlParams_, opts...)
  2219  	res, err := c.doRequest("json")
  2220  	if res != nil && res.StatusCode == http.StatusNotModified {
  2221  		if res.Body != nil {
  2222  			res.Body.Close()
  2223  		}
  2224  		return nil, gensupport.WrapError(&googleapi.Error{
  2225  			Code:   res.StatusCode,
  2226  			Header: res.Header,
  2227  		})
  2228  	}
  2229  	if err != nil {
  2230  		return nil, err
  2231  	}
  2232  	defer googleapi.CloseBody(res)
  2233  	if err := googleapi.CheckResponse(res); err != nil {
  2234  		return nil, gensupport.WrapError(err)
  2235  	}
  2236  	ret := &AcceleratorType{
  2237  		ServerResponse: googleapi.ServerResponse{
  2238  			Header:         res.Header,
  2239  			HTTPStatusCode: res.StatusCode,
  2240  		},
  2241  	}
  2242  	target := &ret
  2243  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2244  		return nil, err
  2245  	}
  2246  	return ret, nil
  2247  }
  2248  
  2249  type ProjectsLocationsAcceleratorTypesListCall struct {
  2250  	s            *Service
  2251  	parent       string
  2252  	urlParams_   gensupport.URLParams
  2253  	ifNoneMatch_ string
  2254  	ctx_         context.Context
  2255  	header_      http.Header
  2256  }
  2257  
  2258  // List: Lists accelerator types supported by this API.
  2259  //
  2260  // - parent: The parent resource name.
  2261  func (r *ProjectsLocationsAcceleratorTypesService) List(parent string) *ProjectsLocationsAcceleratorTypesListCall {
  2262  	c := &ProjectsLocationsAcceleratorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2263  	c.parent = parent
  2264  	return c
  2265  }
  2266  
  2267  // Filter sets the optional parameter "filter": List filter.
  2268  func (c *ProjectsLocationsAcceleratorTypesListCall) Filter(filter string) *ProjectsLocationsAcceleratorTypesListCall {
  2269  	c.urlParams_.Set("filter", filter)
  2270  	return c
  2271  }
  2272  
  2273  // OrderBy sets the optional parameter "orderBy": Sort results.
  2274  func (c *ProjectsLocationsAcceleratorTypesListCall) OrderBy(orderBy string) *ProjectsLocationsAcceleratorTypesListCall {
  2275  	c.urlParams_.Set("orderBy", orderBy)
  2276  	return c
  2277  }
  2278  
  2279  // PageSize sets the optional parameter "pageSize": The maximum number of items
  2280  // to return.
  2281  func (c *ProjectsLocationsAcceleratorTypesListCall) PageSize(pageSize int64) *ProjectsLocationsAcceleratorTypesListCall {
  2282  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2283  	return c
  2284  }
  2285  
  2286  // PageToken sets the optional parameter "pageToken": The next_page_token value
  2287  // returned from a previous List request, if any.
  2288  func (c *ProjectsLocationsAcceleratorTypesListCall) PageToken(pageToken string) *ProjectsLocationsAcceleratorTypesListCall {
  2289  	c.urlParams_.Set("pageToken", pageToken)
  2290  	return c
  2291  }
  2292  
  2293  // Fields allows partial responses to be retrieved. See
  2294  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2295  // details.
  2296  func (c *ProjectsLocationsAcceleratorTypesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsAcceleratorTypesListCall {
  2297  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2298  	return c
  2299  }
  2300  
  2301  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2302  // object's ETag matches the given value. This is useful for getting updates
  2303  // only after the object has changed since the last request.
  2304  func (c *ProjectsLocationsAcceleratorTypesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsAcceleratorTypesListCall {
  2305  	c.ifNoneMatch_ = entityTag
  2306  	return c
  2307  }
  2308  
  2309  // Context sets the context to be used in this call's Do method.
  2310  func (c *ProjectsLocationsAcceleratorTypesListCall) Context(ctx context.Context) *ProjectsLocationsAcceleratorTypesListCall {
  2311  	c.ctx_ = ctx
  2312  	return c
  2313  }
  2314  
  2315  // Header returns a http.Header that can be modified by the caller to add
  2316  // headers to the request.
  2317  func (c *ProjectsLocationsAcceleratorTypesListCall) Header() http.Header {
  2318  	if c.header_ == nil {
  2319  		c.header_ = make(http.Header)
  2320  	}
  2321  	return c.header_
  2322  }
  2323  
  2324  func (c *ProjectsLocationsAcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) {
  2325  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2326  	if c.ifNoneMatch_ != "" {
  2327  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2328  	}
  2329  	var body io.Reader = nil
  2330  	c.urlParams_.Set("alt", alt)
  2331  	c.urlParams_.Set("prettyPrint", "false")
  2332  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+parent}/acceleratorTypes")
  2333  	urls += "?" + c.urlParams_.Encode()
  2334  	req, err := http.NewRequest("GET", urls, body)
  2335  	if err != nil {
  2336  		return nil, err
  2337  	}
  2338  	req.Header = reqHeaders
  2339  	googleapi.Expand(req.URL, map[string]string{
  2340  		"parent": c.parent,
  2341  	})
  2342  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2343  }
  2344  
  2345  // Do executes the "tpu.projects.locations.acceleratorTypes.list" call.
  2346  // Any non-2xx status code is an error. Response headers are in either
  2347  // *ListAcceleratorTypesResponse.ServerResponse.Header or (if a response was
  2348  // returned at all) in error.(*googleapi.Error).Header. Use
  2349  // googleapi.IsNotModified to check whether the returned error was because
  2350  // http.StatusNotModified was returned.
  2351  func (c *ProjectsLocationsAcceleratorTypesListCall) Do(opts ...googleapi.CallOption) (*ListAcceleratorTypesResponse, error) {
  2352  	gensupport.SetOptions(c.urlParams_, opts...)
  2353  	res, err := c.doRequest("json")
  2354  	if res != nil && res.StatusCode == http.StatusNotModified {
  2355  		if res.Body != nil {
  2356  			res.Body.Close()
  2357  		}
  2358  		return nil, gensupport.WrapError(&googleapi.Error{
  2359  			Code:   res.StatusCode,
  2360  			Header: res.Header,
  2361  		})
  2362  	}
  2363  	if err != nil {
  2364  		return nil, err
  2365  	}
  2366  	defer googleapi.CloseBody(res)
  2367  	if err := googleapi.CheckResponse(res); err != nil {
  2368  		return nil, gensupport.WrapError(err)
  2369  	}
  2370  	ret := &ListAcceleratorTypesResponse{
  2371  		ServerResponse: googleapi.ServerResponse{
  2372  			Header:         res.Header,
  2373  			HTTPStatusCode: res.StatusCode,
  2374  		},
  2375  	}
  2376  	target := &ret
  2377  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2378  		return nil, err
  2379  	}
  2380  	return ret, nil
  2381  }
  2382  
  2383  // Pages invokes f for each page of results.
  2384  // A non-nil error returned from f will halt the iteration.
  2385  // The provided context supersedes any context provided to the Context method.
  2386  func (c *ProjectsLocationsAcceleratorTypesListCall) Pages(ctx context.Context, f func(*ListAcceleratorTypesResponse) error) error {
  2387  	c.ctx_ = ctx
  2388  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2389  	for {
  2390  		x, err := c.Do()
  2391  		if err != nil {
  2392  			return err
  2393  		}
  2394  		if err := f(x); err != nil {
  2395  			return err
  2396  		}
  2397  		if x.NextPageToken == "" {
  2398  			return nil
  2399  		}
  2400  		c.PageToken(x.NextPageToken)
  2401  	}
  2402  }
  2403  
  2404  type ProjectsLocationsNodesCreateCall struct {
  2405  	s          *Service
  2406  	parent     string
  2407  	node       *Node
  2408  	urlParams_ gensupport.URLParams
  2409  	ctx_       context.Context
  2410  	header_    http.Header
  2411  }
  2412  
  2413  // Create: Creates a node.
  2414  //
  2415  // - parent: The parent resource name.
  2416  func (r *ProjectsLocationsNodesService) Create(parent string, node *Node) *ProjectsLocationsNodesCreateCall {
  2417  	c := &ProjectsLocationsNodesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2418  	c.parent = parent
  2419  	c.node = node
  2420  	return c
  2421  }
  2422  
  2423  // NodeId sets the optional parameter "nodeId": The unqualified resource name.
  2424  func (c *ProjectsLocationsNodesCreateCall) NodeId(nodeId string) *ProjectsLocationsNodesCreateCall {
  2425  	c.urlParams_.Set("nodeId", nodeId)
  2426  	return c
  2427  }
  2428  
  2429  // RequestId sets the optional parameter "requestId": Idempotent request UUID.
  2430  func (c *ProjectsLocationsNodesCreateCall) RequestId(requestId string) *ProjectsLocationsNodesCreateCall {
  2431  	c.urlParams_.Set("requestId", requestId)
  2432  	return c
  2433  }
  2434  
  2435  // Fields allows partial responses to be retrieved. See
  2436  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2437  // details.
  2438  func (c *ProjectsLocationsNodesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsNodesCreateCall {
  2439  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2440  	return c
  2441  }
  2442  
  2443  // Context sets the context to be used in this call's Do method.
  2444  func (c *ProjectsLocationsNodesCreateCall) Context(ctx context.Context) *ProjectsLocationsNodesCreateCall {
  2445  	c.ctx_ = ctx
  2446  	return c
  2447  }
  2448  
  2449  // Header returns a http.Header that can be modified by the caller to add
  2450  // headers to the request.
  2451  func (c *ProjectsLocationsNodesCreateCall) Header() http.Header {
  2452  	if c.header_ == nil {
  2453  		c.header_ = make(http.Header)
  2454  	}
  2455  	return c.header_
  2456  }
  2457  
  2458  func (c *ProjectsLocationsNodesCreateCall) doRequest(alt string) (*http.Response, error) {
  2459  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2460  	var body io.Reader = nil
  2461  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.node)
  2462  	if err != nil {
  2463  		return nil, err
  2464  	}
  2465  	c.urlParams_.Set("alt", alt)
  2466  	c.urlParams_.Set("prettyPrint", "false")
  2467  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+parent}/nodes")
  2468  	urls += "?" + c.urlParams_.Encode()
  2469  	req, err := http.NewRequest("POST", urls, body)
  2470  	if err != nil {
  2471  		return nil, err
  2472  	}
  2473  	req.Header = reqHeaders
  2474  	googleapi.Expand(req.URL, map[string]string{
  2475  		"parent": c.parent,
  2476  	})
  2477  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2478  }
  2479  
  2480  // Do executes the "tpu.projects.locations.nodes.create" call.
  2481  // Any non-2xx status code is an error. Response headers are in either
  2482  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  2483  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2484  // whether the returned error was because http.StatusNotModified was returned.
  2485  func (c *ProjectsLocationsNodesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2486  	gensupport.SetOptions(c.urlParams_, opts...)
  2487  	res, err := c.doRequest("json")
  2488  	if res != nil && res.StatusCode == http.StatusNotModified {
  2489  		if res.Body != nil {
  2490  			res.Body.Close()
  2491  		}
  2492  		return nil, gensupport.WrapError(&googleapi.Error{
  2493  			Code:   res.StatusCode,
  2494  			Header: res.Header,
  2495  		})
  2496  	}
  2497  	if err != nil {
  2498  		return nil, err
  2499  	}
  2500  	defer googleapi.CloseBody(res)
  2501  	if err := googleapi.CheckResponse(res); err != nil {
  2502  		return nil, gensupport.WrapError(err)
  2503  	}
  2504  	ret := &Operation{
  2505  		ServerResponse: googleapi.ServerResponse{
  2506  			Header:         res.Header,
  2507  			HTTPStatusCode: res.StatusCode,
  2508  		},
  2509  	}
  2510  	target := &ret
  2511  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2512  		return nil, err
  2513  	}
  2514  	return ret, nil
  2515  }
  2516  
  2517  type ProjectsLocationsNodesDeleteCall struct {
  2518  	s          *Service
  2519  	name       string
  2520  	urlParams_ gensupport.URLParams
  2521  	ctx_       context.Context
  2522  	header_    http.Header
  2523  }
  2524  
  2525  // Delete: Deletes a node.
  2526  //
  2527  // - name: The resource name.
  2528  func (r *ProjectsLocationsNodesService) Delete(name string) *ProjectsLocationsNodesDeleteCall {
  2529  	c := &ProjectsLocationsNodesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2530  	c.name = name
  2531  	return c
  2532  }
  2533  
  2534  // RequestId sets the optional parameter "requestId": Idempotent request UUID.
  2535  func (c *ProjectsLocationsNodesDeleteCall) RequestId(requestId string) *ProjectsLocationsNodesDeleteCall {
  2536  	c.urlParams_.Set("requestId", requestId)
  2537  	return c
  2538  }
  2539  
  2540  // Fields allows partial responses to be retrieved. See
  2541  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2542  // details.
  2543  func (c *ProjectsLocationsNodesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNodesDeleteCall {
  2544  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2545  	return c
  2546  }
  2547  
  2548  // Context sets the context to be used in this call's Do method.
  2549  func (c *ProjectsLocationsNodesDeleteCall) Context(ctx context.Context) *ProjectsLocationsNodesDeleteCall {
  2550  	c.ctx_ = ctx
  2551  	return c
  2552  }
  2553  
  2554  // Header returns a http.Header that can be modified by the caller to add
  2555  // headers to the request.
  2556  func (c *ProjectsLocationsNodesDeleteCall) Header() http.Header {
  2557  	if c.header_ == nil {
  2558  		c.header_ = make(http.Header)
  2559  	}
  2560  	return c.header_
  2561  }
  2562  
  2563  func (c *ProjectsLocationsNodesDeleteCall) doRequest(alt string) (*http.Response, error) {
  2564  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2565  	var body io.Reader = nil
  2566  	c.urlParams_.Set("alt", alt)
  2567  	c.urlParams_.Set("prettyPrint", "false")
  2568  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}")
  2569  	urls += "?" + c.urlParams_.Encode()
  2570  	req, err := http.NewRequest("DELETE", urls, body)
  2571  	if err != nil {
  2572  		return nil, err
  2573  	}
  2574  	req.Header = reqHeaders
  2575  	googleapi.Expand(req.URL, map[string]string{
  2576  		"name": c.name,
  2577  	})
  2578  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2579  }
  2580  
  2581  // Do executes the "tpu.projects.locations.nodes.delete" call.
  2582  // Any non-2xx status code is an error. Response headers are in either
  2583  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  2584  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2585  // whether the returned error was because http.StatusNotModified was returned.
  2586  func (c *ProjectsLocationsNodesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2587  	gensupport.SetOptions(c.urlParams_, opts...)
  2588  	res, err := c.doRequest("json")
  2589  	if res != nil && res.StatusCode == http.StatusNotModified {
  2590  		if res.Body != nil {
  2591  			res.Body.Close()
  2592  		}
  2593  		return nil, gensupport.WrapError(&googleapi.Error{
  2594  			Code:   res.StatusCode,
  2595  			Header: res.Header,
  2596  		})
  2597  	}
  2598  	if err != nil {
  2599  		return nil, err
  2600  	}
  2601  	defer googleapi.CloseBody(res)
  2602  	if err := googleapi.CheckResponse(res); err != nil {
  2603  		return nil, gensupport.WrapError(err)
  2604  	}
  2605  	ret := &Operation{
  2606  		ServerResponse: googleapi.ServerResponse{
  2607  			Header:         res.Header,
  2608  			HTTPStatusCode: res.StatusCode,
  2609  		},
  2610  	}
  2611  	target := &ret
  2612  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2613  		return nil, err
  2614  	}
  2615  	return ret, nil
  2616  }
  2617  
  2618  type ProjectsLocationsNodesGetCall struct {
  2619  	s            *Service
  2620  	name         string
  2621  	urlParams_   gensupport.URLParams
  2622  	ifNoneMatch_ string
  2623  	ctx_         context.Context
  2624  	header_      http.Header
  2625  }
  2626  
  2627  // Get: Gets the details of a node.
  2628  //
  2629  // - name: The resource name.
  2630  func (r *ProjectsLocationsNodesService) Get(name string) *ProjectsLocationsNodesGetCall {
  2631  	c := &ProjectsLocationsNodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2632  	c.name = name
  2633  	return c
  2634  }
  2635  
  2636  // Fields allows partial responses to be retrieved. See
  2637  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2638  // details.
  2639  func (c *ProjectsLocationsNodesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsNodesGetCall {
  2640  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2641  	return c
  2642  }
  2643  
  2644  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2645  // object's ETag matches the given value. This is useful for getting updates
  2646  // only after the object has changed since the last request.
  2647  func (c *ProjectsLocationsNodesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsNodesGetCall {
  2648  	c.ifNoneMatch_ = entityTag
  2649  	return c
  2650  }
  2651  
  2652  // Context sets the context to be used in this call's Do method.
  2653  func (c *ProjectsLocationsNodesGetCall) Context(ctx context.Context) *ProjectsLocationsNodesGetCall {
  2654  	c.ctx_ = ctx
  2655  	return c
  2656  }
  2657  
  2658  // Header returns a http.Header that can be modified by the caller to add
  2659  // headers to the request.
  2660  func (c *ProjectsLocationsNodesGetCall) Header() http.Header {
  2661  	if c.header_ == nil {
  2662  		c.header_ = make(http.Header)
  2663  	}
  2664  	return c.header_
  2665  }
  2666  
  2667  func (c *ProjectsLocationsNodesGetCall) doRequest(alt string) (*http.Response, error) {
  2668  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2669  	if c.ifNoneMatch_ != "" {
  2670  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2671  	}
  2672  	var body io.Reader = nil
  2673  	c.urlParams_.Set("alt", alt)
  2674  	c.urlParams_.Set("prettyPrint", "false")
  2675  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}")
  2676  	urls += "?" + c.urlParams_.Encode()
  2677  	req, err := http.NewRequest("GET", urls, body)
  2678  	if err != nil {
  2679  		return nil, err
  2680  	}
  2681  	req.Header = reqHeaders
  2682  	googleapi.Expand(req.URL, map[string]string{
  2683  		"name": c.name,
  2684  	})
  2685  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2686  }
  2687  
  2688  // Do executes the "tpu.projects.locations.nodes.get" call.
  2689  // Any non-2xx status code is an error. Response headers are in either
  2690  // *Node.ServerResponse.Header or (if a response was returned at all) in
  2691  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2692  // whether the returned error was because http.StatusNotModified was returned.
  2693  func (c *ProjectsLocationsNodesGetCall) Do(opts ...googleapi.CallOption) (*Node, error) {
  2694  	gensupport.SetOptions(c.urlParams_, opts...)
  2695  	res, err := c.doRequest("json")
  2696  	if res != nil && res.StatusCode == http.StatusNotModified {
  2697  		if res.Body != nil {
  2698  			res.Body.Close()
  2699  		}
  2700  		return nil, gensupport.WrapError(&googleapi.Error{
  2701  			Code:   res.StatusCode,
  2702  			Header: res.Header,
  2703  		})
  2704  	}
  2705  	if err != nil {
  2706  		return nil, err
  2707  	}
  2708  	defer googleapi.CloseBody(res)
  2709  	if err := googleapi.CheckResponse(res); err != nil {
  2710  		return nil, gensupport.WrapError(err)
  2711  	}
  2712  	ret := &Node{
  2713  		ServerResponse: googleapi.ServerResponse{
  2714  			Header:         res.Header,
  2715  			HTTPStatusCode: res.StatusCode,
  2716  		},
  2717  	}
  2718  	target := &ret
  2719  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2720  		return nil, err
  2721  	}
  2722  	return ret, nil
  2723  }
  2724  
  2725  type ProjectsLocationsNodesGetGuestAttributesCall struct {
  2726  	s                         *Service
  2727  	name                      string
  2728  	getguestattributesrequest *GetGuestAttributesRequest
  2729  	urlParams_                gensupport.URLParams
  2730  	ctx_                      context.Context
  2731  	header_                   http.Header
  2732  }
  2733  
  2734  // GetGuestAttributes: Retrieves the guest attributes for the node.
  2735  //
  2736  // - name: The resource name.
  2737  func (r *ProjectsLocationsNodesService) GetGuestAttributes(name string, getguestattributesrequest *GetGuestAttributesRequest) *ProjectsLocationsNodesGetGuestAttributesCall {
  2738  	c := &ProjectsLocationsNodesGetGuestAttributesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2739  	c.name = name
  2740  	c.getguestattributesrequest = getguestattributesrequest
  2741  	return c
  2742  }
  2743  
  2744  // Fields allows partial responses to be retrieved. See
  2745  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2746  // details.
  2747  func (c *ProjectsLocationsNodesGetGuestAttributesCall) Fields(s ...googleapi.Field) *ProjectsLocationsNodesGetGuestAttributesCall {
  2748  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2749  	return c
  2750  }
  2751  
  2752  // Context sets the context to be used in this call's Do method.
  2753  func (c *ProjectsLocationsNodesGetGuestAttributesCall) Context(ctx context.Context) *ProjectsLocationsNodesGetGuestAttributesCall {
  2754  	c.ctx_ = ctx
  2755  	return c
  2756  }
  2757  
  2758  // Header returns a http.Header that can be modified by the caller to add
  2759  // headers to the request.
  2760  func (c *ProjectsLocationsNodesGetGuestAttributesCall) Header() http.Header {
  2761  	if c.header_ == nil {
  2762  		c.header_ = make(http.Header)
  2763  	}
  2764  	return c.header_
  2765  }
  2766  
  2767  func (c *ProjectsLocationsNodesGetGuestAttributesCall) doRequest(alt string) (*http.Response, error) {
  2768  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2769  	var body io.Reader = nil
  2770  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.getguestattributesrequest)
  2771  	if err != nil {
  2772  		return nil, err
  2773  	}
  2774  	c.urlParams_.Set("alt", alt)
  2775  	c.urlParams_.Set("prettyPrint", "false")
  2776  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}:getGuestAttributes")
  2777  	urls += "?" + c.urlParams_.Encode()
  2778  	req, err := http.NewRequest("POST", urls, body)
  2779  	if err != nil {
  2780  		return nil, err
  2781  	}
  2782  	req.Header = reqHeaders
  2783  	googleapi.Expand(req.URL, map[string]string{
  2784  		"name": c.name,
  2785  	})
  2786  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2787  }
  2788  
  2789  // Do executes the "tpu.projects.locations.nodes.getGuestAttributes" call.
  2790  // Any non-2xx status code is an error. Response headers are in either
  2791  // *GetGuestAttributesResponse.ServerResponse.Header or (if a response was
  2792  // returned at all) in error.(*googleapi.Error).Header. Use
  2793  // googleapi.IsNotModified to check whether the returned error was because
  2794  // http.StatusNotModified was returned.
  2795  func (c *ProjectsLocationsNodesGetGuestAttributesCall) Do(opts ...googleapi.CallOption) (*GetGuestAttributesResponse, error) {
  2796  	gensupport.SetOptions(c.urlParams_, opts...)
  2797  	res, err := c.doRequest("json")
  2798  	if res != nil && res.StatusCode == http.StatusNotModified {
  2799  		if res.Body != nil {
  2800  			res.Body.Close()
  2801  		}
  2802  		return nil, gensupport.WrapError(&googleapi.Error{
  2803  			Code:   res.StatusCode,
  2804  			Header: res.Header,
  2805  		})
  2806  	}
  2807  	if err != nil {
  2808  		return nil, err
  2809  	}
  2810  	defer googleapi.CloseBody(res)
  2811  	if err := googleapi.CheckResponse(res); err != nil {
  2812  		return nil, gensupport.WrapError(err)
  2813  	}
  2814  	ret := &GetGuestAttributesResponse{
  2815  		ServerResponse: googleapi.ServerResponse{
  2816  			Header:         res.Header,
  2817  			HTTPStatusCode: res.StatusCode,
  2818  		},
  2819  	}
  2820  	target := &ret
  2821  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2822  		return nil, err
  2823  	}
  2824  	return ret, nil
  2825  }
  2826  
  2827  type ProjectsLocationsNodesListCall struct {
  2828  	s            *Service
  2829  	parent       string
  2830  	urlParams_   gensupport.URLParams
  2831  	ifNoneMatch_ string
  2832  	ctx_         context.Context
  2833  	header_      http.Header
  2834  }
  2835  
  2836  // List: Lists nodes.
  2837  //
  2838  // - parent: The parent resource name.
  2839  func (r *ProjectsLocationsNodesService) List(parent string) *ProjectsLocationsNodesListCall {
  2840  	c := &ProjectsLocationsNodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2841  	c.parent = parent
  2842  	return c
  2843  }
  2844  
  2845  // PageSize sets the optional parameter "pageSize": The maximum number of items
  2846  // to return.
  2847  func (c *ProjectsLocationsNodesListCall) PageSize(pageSize int64) *ProjectsLocationsNodesListCall {
  2848  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2849  	return c
  2850  }
  2851  
  2852  // PageToken sets the optional parameter "pageToken": The next_page_token value
  2853  // returned from a previous List request, if any.
  2854  func (c *ProjectsLocationsNodesListCall) PageToken(pageToken string) *ProjectsLocationsNodesListCall {
  2855  	c.urlParams_.Set("pageToken", pageToken)
  2856  	return c
  2857  }
  2858  
  2859  // Fields allows partial responses to be retrieved. See
  2860  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2861  // details.
  2862  func (c *ProjectsLocationsNodesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsNodesListCall {
  2863  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2864  	return c
  2865  }
  2866  
  2867  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2868  // object's ETag matches the given value. This is useful for getting updates
  2869  // only after the object has changed since the last request.
  2870  func (c *ProjectsLocationsNodesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsNodesListCall {
  2871  	c.ifNoneMatch_ = entityTag
  2872  	return c
  2873  }
  2874  
  2875  // Context sets the context to be used in this call's Do method.
  2876  func (c *ProjectsLocationsNodesListCall) Context(ctx context.Context) *ProjectsLocationsNodesListCall {
  2877  	c.ctx_ = ctx
  2878  	return c
  2879  }
  2880  
  2881  // Header returns a http.Header that can be modified by the caller to add
  2882  // headers to the request.
  2883  func (c *ProjectsLocationsNodesListCall) Header() http.Header {
  2884  	if c.header_ == nil {
  2885  		c.header_ = make(http.Header)
  2886  	}
  2887  	return c.header_
  2888  }
  2889  
  2890  func (c *ProjectsLocationsNodesListCall) doRequest(alt string) (*http.Response, error) {
  2891  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2892  	if c.ifNoneMatch_ != "" {
  2893  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2894  	}
  2895  	var body io.Reader = nil
  2896  	c.urlParams_.Set("alt", alt)
  2897  	c.urlParams_.Set("prettyPrint", "false")
  2898  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+parent}/nodes")
  2899  	urls += "?" + c.urlParams_.Encode()
  2900  	req, err := http.NewRequest("GET", urls, body)
  2901  	if err != nil {
  2902  		return nil, err
  2903  	}
  2904  	req.Header = reqHeaders
  2905  	googleapi.Expand(req.URL, map[string]string{
  2906  		"parent": c.parent,
  2907  	})
  2908  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2909  }
  2910  
  2911  // Do executes the "tpu.projects.locations.nodes.list" call.
  2912  // Any non-2xx status code is an error. Response headers are in either
  2913  // *ListNodesResponse.ServerResponse.Header or (if a response was returned at
  2914  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2915  // check whether the returned error was because http.StatusNotModified was
  2916  // returned.
  2917  func (c *ProjectsLocationsNodesListCall) Do(opts ...googleapi.CallOption) (*ListNodesResponse, error) {
  2918  	gensupport.SetOptions(c.urlParams_, opts...)
  2919  	res, err := c.doRequest("json")
  2920  	if res != nil && res.StatusCode == http.StatusNotModified {
  2921  		if res.Body != nil {
  2922  			res.Body.Close()
  2923  		}
  2924  		return nil, gensupport.WrapError(&googleapi.Error{
  2925  			Code:   res.StatusCode,
  2926  			Header: res.Header,
  2927  		})
  2928  	}
  2929  	if err != nil {
  2930  		return nil, err
  2931  	}
  2932  	defer googleapi.CloseBody(res)
  2933  	if err := googleapi.CheckResponse(res); err != nil {
  2934  		return nil, gensupport.WrapError(err)
  2935  	}
  2936  	ret := &ListNodesResponse{
  2937  		ServerResponse: googleapi.ServerResponse{
  2938  			Header:         res.Header,
  2939  			HTTPStatusCode: res.StatusCode,
  2940  		},
  2941  	}
  2942  	target := &ret
  2943  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2944  		return nil, err
  2945  	}
  2946  	return ret, nil
  2947  }
  2948  
  2949  // Pages invokes f for each page of results.
  2950  // A non-nil error returned from f will halt the iteration.
  2951  // The provided context supersedes any context provided to the Context method.
  2952  func (c *ProjectsLocationsNodesListCall) Pages(ctx context.Context, f func(*ListNodesResponse) error) error {
  2953  	c.ctx_ = ctx
  2954  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2955  	for {
  2956  		x, err := c.Do()
  2957  		if err != nil {
  2958  			return err
  2959  		}
  2960  		if err := f(x); err != nil {
  2961  			return err
  2962  		}
  2963  		if x.NextPageToken == "" {
  2964  			return nil
  2965  		}
  2966  		c.PageToken(x.NextPageToken)
  2967  	}
  2968  }
  2969  
  2970  type ProjectsLocationsNodesPatchCall struct {
  2971  	s          *Service
  2972  	name       string
  2973  	node       *Node
  2974  	urlParams_ gensupport.URLParams
  2975  	ctx_       context.Context
  2976  	header_    http.Header
  2977  }
  2978  
  2979  // Patch: Updates the configurations of a node.
  2980  //
  2981  // - name: Output only. Immutable. The name of the TPU.
  2982  func (r *ProjectsLocationsNodesService) Patch(name string, node *Node) *ProjectsLocationsNodesPatchCall {
  2983  	c := &ProjectsLocationsNodesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2984  	c.name = name
  2985  	c.node = node
  2986  	return c
  2987  }
  2988  
  2989  // UpdateMask sets the optional parameter "updateMask": Required. Mask of
  2990  // fields from Node to update. Supported fields: [description, tags, labels,
  2991  // metadata, network_config.enable_external_ips].
  2992  func (c *ProjectsLocationsNodesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsNodesPatchCall {
  2993  	c.urlParams_.Set("updateMask", updateMask)
  2994  	return c
  2995  }
  2996  
  2997  // Fields allows partial responses to be retrieved. See
  2998  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2999  // details.
  3000  func (c *ProjectsLocationsNodesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsNodesPatchCall {
  3001  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3002  	return c
  3003  }
  3004  
  3005  // Context sets the context to be used in this call's Do method.
  3006  func (c *ProjectsLocationsNodesPatchCall) Context(ctx context.Context) *ProjectsLocationsNodesPatchCall {
  3007  	c.ctx_ = ctx
  3008  	return c
  3009  }
  3010  
  3011  // Header returns a http.Header that can be modified by the caller to add
  3012  // headers to the request.
  3013  func (c *ProjectsLocationsNodesPatchCall) Header() http.Header {
  3014  	if c.header_ == nil {
  3015  		c.header_ = make(http.Header)
  3016  	}
  3017  	return c.header_
  3018  }
  3019  
  3020  func (c *ProjectsLocationsNodesPatchCall) doRequest(alt string) (*http.Response, error) {
  3021  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3022  	var body io.Reader = nil
  3023  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.node)
  3024  	if err != nil {
  3025  		return nil, err
  3026  	}
  3027  	c.urlParams_.Set("alt", alt)
  3028  	c.urlParams_.Set("prettyPrint", "false")
  3029  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}")
  3030  	urls += "?" + c.urlParams_.Encode()
  3031  	req, err := http.NewRequest("PATCH", urls, body)
  3032  	if err != nil {
  3033  		return nil, err
  3034  	}
  3035  	req.Header = reqHeaders
  3036  	googleapi.Expand(req.URL, map[string]string{
  3037  		"name": c.name,
  3038  	})
  3039  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3040  }
  3041  
  3042  // Do executes the "tpu.projects.locations.nodes.patch" call.
  3043  // Any non-2xx status code is an error. Response headers are in either
  3044  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3045  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3046  // whether the returned error was because http.StatusNotModified was returned.
  3047  func (c *ProjectsLocationsNodesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3048  	gensupport.SetOptions(c.urlParams_, opts...)
  3049  	res, err := c.doRequest("json")
  3050  	if res != nil && res.StatusCode == http.StatusNotModified {
  3051  		if res.Body != nil {
  3052  			res.Body.Close()
  3053  		}
  3054  		return nil, gensupport.WrapError(&googleapi.Error{
  3055  			Code:   res.StatusCode,
  3056  			Header: res.Header,
  3057  		})
  3058  	}
  3059  	if err != nil {
  3060  		return nil, err
  3061  	}
  3062  	defer googleapi.CloseBody(res)
  3063  	if err := googleapi.CheckResponse(res); err != nil {
  3064  		return nil, gensupport.WrapError(err)
  3065  	}
  3066  	ret := &Operation{
  3067  		ServerResponse: googleapi.ServerResponse{
  3068  			Header:         res.Header,
  3069  			HTTPStatusCode: res.StatusCode,
  3070  		},
  3071  	}
  3072  	target := &ret
  3073  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3074  		return nil, err
  3075  	}
  3076  	return ret, nil
  3077  }
  3078  
  3079  type ProjectsLocationsNodesSimulateMaintenanceEventCall struct {
  3080  	s                               *Service
  3081  	name                            string
  3082  	simulatemaintenanceeventrequest *SimulateMaintenanceEventRequest
  3083  	urlParams_                      gensupport.URLParams
  3084  	ctx_                            context.Context
  3085  	header_                         http.Header
  3086  }
  3087  
  3088  // SimulateMaintenanceEvent: Simulates a maintenance event.
  3089  //
  3090  // - name: The resource name.
  3091  func (r *ProjectsLocationsNodesService) SimulateMaintenanceEvent(name string, simulatemaintenanceeventrequest *SimulateMaintenanceEventRequest) *ProjectsLocationsNodesSimulateMaintenanceEventCall {
  3092  	c := &ProjectsLocationsNodesSimulateMaintenanceEventCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3093  	c.name = name
  3094  	c.simulatemaintenanceeventrequest = simulatemaintenanceeventrequest
  3095  	return c
  3096  }
  3097  
  3098  // Fields allows partial responses to be retrieved. See
  3099  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3100  // details.
  3101  func (c *ProjectsLocationsNodesSimulateMaintenanceEventCall) Fields(s ...googleapi.Field) *ProjectsLocationsNodesSimulateMaintenanceEventCall {
  3102  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3103  	return c
  3104  }
  3105  
  3106  // Context sets the context to be used in this call's Do method.
  3107  func (c *ProjectsLocationsNodesSimulateMaintenanceEventCall) Context(ctx context.Context) *ProjectsLocationsNodesSimulateMaintenanceEventCall {
  3108  	c.ctx_ = ctx
  3109  	return c
  3110  }
  3111  
  3112  // Header returns a http.Header that can be modified by the caller to add
  3113  // headers to the request.
  3114  func (c *ProjectsLocationsNodesSimulateMaintenanceEventCall) Header() http.Header {
  3115  	if c.header_ == nil {
  3116  		c.header_ = make(http.Header)
  3117  	}
  3118  	return c.header_
  3119  }
  3120  
  3121  func (c *ProjectsLocationsNodesSimulateMaintenanceEventCall) doRequest(alt string) (*http.Response, error) {
  3122  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3123  	var body io.Reader = nil
  3124  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.simulatemaintenanceeventrequest)
  3125  	if err != nil {
  3126  		return nil, err
  3127  	}
  3128  	c.urlParams_.Set("alt", alt)
  3129  	c.urlParams_.Set("prettyPrint", "false")
  3130  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}:simulateMaintenanceEvent")
  3131  	urls += "?" + c.urlParams_.Encode()
  3132  	req, err := http.NewRequest("POST", urls, body)
  3133  	if err != nil {
  3134  		return nil, err
  3135  	}
  3136  	req.Header = reqHeaders
  3137  	googleapi.Expand(req.URL, map[string]string{
  3138  		"name": c.name,
  3139  	})
  3140  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3141  }
  3142  
  3143  // Do executes the "tpu.projects.locations.nodes.simulateMaintenanceEvent" call.
  3144  // Any non-2xx status code is an error. Response headers are in either
  3145  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3146  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3147  // whether the returned error was because http.StatusNotModified was returned.
  3148  func (c *ProjectsLocationsNodesSimulateMaintenanceEventCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3149  	gensupport.SetOptions(c.urlParams_, opts...)
  3150  	res, err := c.doRequest("json")
  3151  	if res != nil && res.StatusCode == http.StatusNotModified {
  3152  		if res.Body != nil {
  3153  			res.Body.Close()
  3154  		}
  3155  		return nil, gensupport.WrapError(&googleapi.Error{
  3156  			Code:   res.StatusCode,
  3157  			Header: res.Header,
  3158  		})
  3159  	}
  3160  	if err != nil {
  3161  		return nil, err
  3162  	}
  3163  	defer googleapi.CloseBody(res)
  3164  	if err := googleapi.CheckResponse(res); err != nil {
  3165  		return nil, gensupport.WrapError(err)
  3166  	}
  3167  	ret := &Operation{
  3168  		ServerResponse: googleapi.ServerResponse{
  3169  			Header:         res.Header,
  3170  			HTTPStatusCode: res.StatusCode,
  3171  		},
  3172  	}
  3173  	target := &ret
  3174  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3175  		return nil, err
  3176  	}
  3177  	return ret, nil
  3178  }
  3179  
  3180  type ProjectsLocationsNodesStartCall struct {
  3181  	s                *Service
  3182  	name             string
  3183  	startnoderequest *StartNodeRequest
  3184  	urlParams_       gensupport.URLParams
  3185  	ctx_             context.Context
  3186  	header_          http.Header
  3187  }
  3188  
  3189  // Start: Starts a node.
  3190  //
  3191  // - name: The resource name.
  3192  func (r *ProjectsLocationsNodesService) Start(name string, startnoderequest *StartNodeRequest) *ProjectsLocationsNodesStartCall {
  3193  	c := &ProjectsLocationsNodesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3194  	c.name = name
  3195  	c.startnoderequest = startnoderequest
  3196  	return c
  3197  }
  3198  
  3199  // Fields allows partial responses to be retrieved. See
  3200  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3201  // details.
  3202  func (c *ProjectsLocationsNodesStartCall) Fields(s ...googleapi.Field) *ProjectsLocationsNodesStartCall {
  3203  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3204  	return c
  3205  }
  3206  
  3207  // Context sets the context to be used in this call's Do method.
  3208  func (c *ProjectsLocationsNodesStartCall) Context(ctx context.Context) *ProjectsLocationsNodesStartCall {
  3209  	c.ctx_ = ctx
  3210  	return c
  3211  }
  3212  
  3213  // Header returns a http.Header that can be modified by the caller to add
  3214  // headers to the request.
  3215  func (c *ProjectsLocationsNodesStartCall) Header() http.Header {
  3216  	if c.header_ == nil {
  3217  		c.header_ = make(http.Header)
  3218  	}
  3219  	return c.header_
  3220  }
  3221  
  3222  func (c *ProjectsLocationsNodesStartCall) doRequest(alt string) (*http.Response, error) {
  3223  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3224  	var body io.Reader = nil
  3225  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.startnoderequest)
  3226  	if err != nil {
  3227  		return nil, err
  3228  	}
  3229  	c.urlParams_.Set("alt", alt)
  3230  	c.urlParams_.Set("prettyPrint", "false")
  3231  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}:start")
  3232  	urls += "?" + c.urlParams_.Encode()
  3233  	req, err := http.NewRequest("POST", urls, body)
  3234  	if err != nil {
  3235  		return nil, err
  3236  	}
  3237  	req.Header = reqHeaders
  3238  	googleapi.Expand(req.URL, map[string]string{
  3239  		"name": c.name,
  3240  	})
  3241  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3242  }
  3243  
  3244  // Do executes the "tpu.projects.locations.nodes.start" call.
  3245  // Any non-2xx status code is an error. Response headers are in either
  3246  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3247  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3248  // whether the returned error was because http.StatusNotModified was returned.
  3249  func (c *ProjectsLocationsNodesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3250  	gensupport.SetOptions(c.urlParams_, opts...)
  3251  	res, err := c.doRequest("json")
  3252  	if res != nil && res.StatusCode == http.StatusNotModified {
  3253  		if res.Body != nil {
  3254  			res.Body.Close()
  3255  		}
  3256  		return nil, gensupport.WrapError(&googleapi.Error{
  3257  			Code:   res.StatusCode,
  3258  			Header: res.Header,
  3259  		})
  3260  	}
  3261  	if err != nil {
  3262  		return nil, err
  3263  	}
  3264  	defer googleapi.CloseBody(res)
  3265  	if err := googleapi.CheckResponse(res); err != nil {
  3266  		return nil, gensupport.WrapError(err)
  3267  	}
  3268  	ret := &Operation{
  3269  		ServerResponse: googleapi.ServerResponse{
  3270  			Header:         res.Header,
  3271  			HTTPStatusCode: res.StatusCode,
  3272  		},
  3273  	}
  3274  	target := &ret
  3275  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3276  		return nil, err
  3277  	}
  3278  	return ret, nil
  3279  }
  3280  
  3281  type ProjectsLocationsNodesStopCall struct {
  3282  	s               *Service
  3283  	name            string
  3284  	stopnoderequest *StopNodeRequest
  3285  	urlParams_      gensupport.URLParams
  3286  	ctx_            context.Context
  3287  	header_         http.Header
  3288  }
  3289  
  3290  // Stop: Stops a node. This operation is only available with single TPU nodes.
  3291  //
  3292  // - name: The resource name.
  3293  func (r *ProjectsLocationsNodesService) Stop(name string, stopnoderequest *StopNodeRequest) *ProjectsLocationsNodesStopCall {
  3294  	c := &ProjectsLocationsNodesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3295  	c.name = name
  3296  	c.stopnoderequest = stopnoderequest
  3297  	return c
  3298  }
  3299  
  3300  // Fields allows partial responses to be retrieved. See
  3301  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3302  // details.
  3303  func (c *ProjectsLocationsNodesStopCall) Fields(s ...googleapi.Field) *ProjectsLocationsNodesStopCall {
  3304  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3305  	return c
  3306  }
  3307  
  3308  // Context sets the context to be used in this call's Do method.
  3309  func (c *ProjectsLocationsNodesStopCall) Context(ctx context.Context) *ProjectsLocationsNodesStopCall {
  3310  	c.ctx_ = ctx
  3311  	return c
  3312  }
  3313  
  3314  // Header returns a http.Header that can be modified by the caller to add
  3315  // headers to the request.
  3316  func (c *ProjectsLocationsNodesStopCall) Header() http.Header {
  3317  	if c.header_ == nil {
  3318  		c.header_ = make(http.Header)
  3319  	}
  3320  	return c.header_
  3321  }
  3322  
  3323  func (c *ProjectsLocationsNodesStopCall) doRequest(alt string) (*http.Response, error) {
  3324  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3325  	var body io.Reader = nil
  3326  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopnoderequest)
  3327  	if err != nil {
  3328  		return nil, err
  3329  	}
  3330  	c.urlParams_.Set("alt", alt)
  3331  	c.urlParams_.Set("prettyPrint", "false")
  3332  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}:stop")
  3333  	urls += "?" + c.urlParams_.Encode()
  3334  	req, err := http.NewRequest("POST", urls, body)
  3335  	if err != nil {
  3336  		return nil, err
  3337  	}
  3338  	req.Header = reqHeaders
  3339  	googleapi.Expand(req.URL, map[string]string{
  3340  		"name": c.name,
  3341  	})
  3342  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3343  }
  3344  
  3345  // Do executes the "tpu.projects.locations.nodes.stop" call.
  3346  // Any non-2xx status code is an error. Response headers are in either
  3347  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3348  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3349  // whether the returned error was because http.StatusNotModified was returned.
  3350  func (c *ProjectsLocationsNodesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3351  	gensupport.SetOptions(c.urlParams_, opts...)
  3352  	res, err := c.doRequest("json")
  3353  	if res != nil && res.StatusCode == http.StatusNotModified {
  3354  		if res.Body != nil {
  3355  			res.Body.Close()
  3356  		}
  3357  		return nil, gensupport.WrapError(&googleapi.Error{
  3358  			Code:   res.StatusCode,
  3359  			Header: res.Header,
  3360  		})
  3361  	}
  3362  	if err != nil {
  3363  		return nil, err
  3364  	}
  3365  	defer googleapi.CloseBody(res)
  3366  	if err := googleapi.CheckResponse(res); err != nil {
  3367  		return nil, gensupport.WrapError(err)
  3368  	}
  3369  	ret := &Operation{
  3370  		ServerResponse: googleapi.ServerResponse{
  3371  			Header:         res.Header,
  3372  			HTTPStatusCode: res.StatusCode,
  3373  		},
  3374  	}
  3375  	target := &ret
  3376  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3377  		return nil, err
  3378  	}
  3379  	return ret, nil
  3380  }
  3381  
  3382  type ProjectsLocationsOperationsCancelCall struct {
  3383  	s          *Service
  3384  	name       string
  3385  	urlParams_ gensupport.URLParams
  3386  	ctx_       context.Context
  3387  	header_    http.Header
  3388  }
  3389  
  3390  // Cancel: Starts asynchronous cancellation on a long-running operation. The
  3391  // server makes a best effort to cancel the operation, but success is not
  3392  // guaranteed. If the server doesn't support this method, it returns
  3393  // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
  3394  // other methods to check whether the cancellation succeeded or whether the
  3395  // operation completed despite cancellation. On successful cancellation, the
  3396  // operation is not deleted; instead, it becomes an operation with an
  3397  // Operation.error value with a google.rpc.Status.code of 1, corresponding to
  3398  // `Code.CANCELLED`.
  3399  //
  3400  // - name: The name of the operation resource to be cancelled.
  3401  func (r *ProjectsLocationsOperationsService) Cancel(name string) *ProjectsLocationsOperationsCancelCall {
  3402  	c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3403  	c.name = name
  3404  	return c
  3405  }
  3406  
  3407  // Fields allows partial responses to be retrieved. See
  3408  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3409  // details.
  3410  func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
  3411  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3412  	return c
  3413  }
  3414  
  3415  // Context sets the context to be used in this call's Do method.
  3416  func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
  3417  	c.ctx_ = ctx
  3418  	return c
  3419  }
  3420  
  3421  // Header returns a http.Header that can be modified by the caller to add
  3422  // headers to the request.
  3423  func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
  3424  	if c.header_ == nil {
  3425  		c.header_ = make(http.Header)
  3426  	}
  3427  	return c.header_
  3428  }
  3429  
  3430  func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  3431  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3432  	var body io.Reader = nil
  3433  	c.urlParams_.Set("alt", alt)
  3434  	c.urlParams_.Set("prettyPrint", "false")
  3435  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}:cancel")
  3436  	urls += "?" + c.urlParams_.Encode()
  3437  	req, err := http.NewRequest("POST", urls, body)
  3438  	if err != nil {
  3439  		return nil, err
  3440  	}
  3441  	req.Header = reqHeaders
  3442  	googleapi.Expand(req.URL, map[string]string{
  3443  		"name": c.name,
  3444  	})
  3445  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3446  }
  3447  
  3448  // Do executes the "tpu.projects.locations.operations.cancel" call.
  3449  // Any non-2xx status code is an error. Response headers are in either
  3450  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  3451  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3452  // whether the returned error was because http.StatusNotModified was returned.
  3453  func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3454  	gensupport.SetOptions(c.urlParams_, opts...)
  3455  	res, err := c.doRequest("json")
  3456  	if res != nil && res.StatusCode == http.StatusNotModified {
  3457  		if res.Body != nil {
  3458  			res.Body.Close()
  3459  		}
  3460  		return nil, gensupport.WrapError(&googleapi.Error{
  3461  			Code:   res.StatusCode,
  3462  			Header: res.Header,
  3463  		})
  3464  	}
  3465  	if err != nil {
  3466  		return nil, err
  3467  	}
  3468  	defer googleapi.CloseBody(res)
  3469  	if err := googleapi.CheckResponse(res); err != nil {
  3470  		return nil, gensupport.WrapError(err)
  3471  	}
  3472  	ret := &Empty{
  3473  		ServerResponse: googleapi.ServerResponse{
  3474  			Header:         res.Header,
  3475  			HTTPStatusCode: res.StatusCode,
  3476  		},
  3477  	}
  3478  	target := &ret
  3479  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3480  		return nil, err
  3481  	}
  3482  	return ret, nil
  3483  }
  3484  
  3485  type ProjectsLocationsOperationsDeleteCall struct {
  3486  	s          *Service
  3487  	name       string
  3488  	urlParams_ gensupport.URLParams
  3489  	ctx_       context.Context
  3490  	header_    http.Header
  3491  }
  3492  
  3493  // Delete: Deletes a long-running operation. This method indicates that the
  3494  // client is no longer interested in the operation result. It does not cancel
  3495  // the operation. If the server doesn't support this method, it returns
  3496  // `google.rpc.Code.UNIMPLEMENTED`.
  3497  //
  3498  // - name: The name of the operation resource to be deleted.
  3499  func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
  3500  	c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3501  	c.name = name
  3502  	return c
  3503  }
  3504  
  3505  // Fields allows partial responses to be retrieved. See
  3506  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3507  // details.
  3508  func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
  3509  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3510  	return c
  3511  }
  3512  
  3513  // Context sets the context to be used in this call's Do method.
  3514  func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
  3515  	c.ctx_ = ctx
  3516  	return c
  3517  }
  3518  
  3519  // Header returns a http.Header that can be modified by the caller to add
  3520  // headers to the request.
  3521  func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
  3522  	if c.header_ == nil {
  3523  		c.header_ = make(http.Header)
  3524  	}
  3525  	return c.header_
  3526  }
  3527  
  3528  func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3529  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3530  	var body io.Reader = nil
  3531  	c.urlParams_.Set("alt", alt)
  3532  	c.urlParams_.Set("prettyPrint", "false")
  3533  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}")
  3534  	urls += "?" + c.urlParams_.Encode()
  3535  	req, err := http.NewRequest("DELETE", urls, body)
  3536  	if err != nil {
  3537  		return nil, err
  3538  	}
  3539  	req.Header = reqHeaders
  3540  	googleapi.Expand(req.URL, map[string]string{
  3541  		"name": c.name,
  3542  	})
  3543  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3544  }
  3545  
  3546  // Do executes the "tpu.projects.locations.operations.delete" call.
  3547  // Any non-2xx status code is an error. Response headers are in either
  3548  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  3549  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3550  // whether the returned error was because http.StatusNotModified was returned.
  3551  func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3552  	gensupport.SetOptions(c.urlParams_, opts...)
  3553  	res, err := c.doRequest("json")
  3554  	if res != nil && res.StatusCode == http.StatusNotModified {
  3555  		if res.Body != nil {
  3556  			res.Body.Close()
  3557  		}
  3558  		return nil, gensupport.WrapError(&googleapi.Error{
  3559  			Code:   res.StatusCode,
  3560  			Header: res.Header,
  3561  		})
  3562  	}
  3563  	if err != nil {
  3564  		return nil, err
  3565  	}
  3566  	defer googleapi.CloseBody(res)
  3567  	if err := googleapi.CheckResponse(res); err != nil {
  3568  		return nil, gensupport.WrapError(err)
  3569  	}
  3570  	ret := &Empty{
  3571  		ServerResponse: googleapi.ServerResponse{
  3572  			Header:         res.Header,
  3573  			HTTPStatusCode: res.StatusCode,
  3574  		},
  3575  	}
  3576  	target := &ret
  3577  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3578  		return nil, err
  3579  	}
  3580  	return ret, nil
  3581  }
  3582  
  3583  type ProjectsLocationsOperationsGetCall struct {
  3584  	s            *Service
  3585  	name         string
  3586  	urlParams_   gensupport.URLParams
  3587  	ifNoneMatch_ string
  3588  	ctx_         context.Context
  3589  	header_      http.Header
  3590  }
  3591  
  3592  // Get: Gets the latest state of a long-running operation. Clients can use this
  3593  // method to poll the operation result at intervals as recommended by the API
  3594  // service.
  3595  //
  3596  // - name: The name of the operation resource.
  3597  func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  3598  	c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3599  	c.name = name
  3600  	return c
  3601  }
  3602  
  3603  // Fields allows partial responses to be retrieved. See
  3604  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3605  // details.
  3606  func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  3607  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3608  	return c
  3609  }
  3610  
  3611  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3612  // object's ETag matches the given value. This is useful for getting updates
  3613  // only after the object has changed since the last request.
  3614  func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  3615  	c.ifNoneMatch_ = entityTag
  3616  	return c
  3617  }
  3618  
  3619  // Context sets the context to be used in this call's Do method.
  3620  func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  3621  	c.ctx_ = ctx
  3622  	return c
  3623  }
  3624  
  3625  // Header returns a http.Header that can be modified by the caller to add
  3626  // headers to the request.
  3627  func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  3628  	if c.header_ == nil {
  3629  		c.header_ = make(http.Header)
  3630  	}
  3631  	return c.header_
  3632  }
  3633  
  3634  func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  3635  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3636  	if c.ifNoneMatch_ != "" {
  3637  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3638  	}
  3639  	var body io.Reader = nil
  3640  	c.urlParams_.Set("alt", alt)
  3641  	c.urlParams_.Set("prettyPrint", "false")
  3642  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}")
  3643  	urls += "?" + c.urlParams_.Encode()
  3644  	req, err := http.NewRequest("GET", urls, body)
  3645  	if err != nil {
  3646  		return nil, err
  3647  	}
  3648  	req.Header = reqHeaders
  3649  	googleapi.Expand(req.URL, map[string]string{
  3650  		"name": c.name,
  3651  	})
  3652  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3653  }
  3654  
  3655  // Do executes the "tpu.projects.locations.operations.get" call.
  3656  // Any non-2xx status code is an error. Response headers are in either
  3657  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3658  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3659  // whether the returned error was because http.StatusNotModified was returned.
  3660  func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3661  	gensupport.SetOptions(c.urlParams_, opts...)
  3662  	res, err := c.doRequest("json")
  3663  	if res != nil && res.StatusCode == http.StatusNotModified {
  3664  		if res.Body != nil {
  3665  			res.Body.Close()
  3666  		}
  3667  		return nil, gensupport.WrapError(&googleapi.Error{
  3668  			Code:   res.StatusCode,
  3669  			Header: res.Header,
  3670  		})
  3671  	}
  3672  	if err != nil {
  3673  		return nil, err
  3674  	}
  3675  	defer googleapi.CloseBody(res)
  3676  	if err := googleapi.CheckResponse(res); err != nil {
  3677  		return nil, gensupport.WrapError(err)
  3678  	}
  3679  	ret := &Operation{
  3680  		ServerResponse: googleapi.ServerResponse{
  3681  			Header:         res.Header,
  3682  			HTTPStatusCode: res.StatusCode,
  3683  		},
  3684  	}
  3685  	target := &ret
  3686  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3687  		return nil, err
  3688  	}
  3689  	return ret, nil
  3690  }
  3691  
  3692  type ProjectsLocationsOperationsListCall struct {
  3693  	s            *Service
  3694  	name         string
  3695  	urlParams_   gensupport.URLParams
  3696  	ifNoneMatch_ string
  3697  	ctx_         context.Context
  3698  	header_      http.Header
  3699  }
  3700  
  3701  // List: Lists operations that match the specified filter in the request. If
  3702  // the server doesn't support this method, it returns `UNIMPLEMENTED`.
  3703  //
  3704  // - name: The name of the operation's parent resource.
  3705  func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
  3706  	c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3707  	c.name = name
  3708  	return c
  3709  }
  3710  
  3711  // Filter sets the optional parameter "filter": The standard list filter.
  3712  func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
  3713  	c.urlParams_.Set("filter", filter)
  3714  	return c
  3715  }
  3716  
  3717  // PageSize sets the optional parameter "pageSize": The standard list page
  3718  // size.
  3719  func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
  3720  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3721  	return c
  3722  }
  3723  
  3724  // PageToken sets the optional parameter "pageToken": The standard list page
  3725  // token.
  3726  func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
  3727  	c.urlParams_.Set("pageToken", pageToken)
  3728  	return c
  3729  }
  3730  
  3731  // Fields allows partial responses to be retrieved. See
  3732  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3733  // details.
  3734  func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  3735  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3736  	return c
  3737  }
  3738  
  3739  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3740  // object's ETag matches the given value. This is useful for getting updates
  3741  // only after the object has changed since the last request.
  3742  func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  3743  	c.ifNoneMatch_ = entityTag
  3744  	return c
  3745  }
  3746  
  3747  // Context sets the context to be used in this call's Do method.
  3748  func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  3749  	c.ctx_ = ctx
  3750  	return c
  3751  }
  3752  
  3753  // Header returns a http.Header that can be modified by the caller to add
  3754  // headers to the request.
  3755  func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  3756  	if c.header_ == nil {
  3757  		c.header_ = make(http.Header)
  3758  	}
  3759  	return c.header_
  3760  }
  3761  
  3762  func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  3763  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3764  	if c.ifNoneMatch_ != "" {
  3765  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3766  	}
  3767  	var body io.Reader = nil
  3768  	c.urlParams_.Set("alt", alt)
  3769  	c.urlParams_.Set("prettyPrint", "false")
  3770  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}/operations")
  3771  	urls += "?" + c.urlParams_.Encode()
  3772  	req, err := http.NewRequest("GET", urls, body)
  3773  	if err != nil {
  3774  		return nil, err
  3775  	}
  3776  	req.Header = reqHeaders
  3777  	googleapi.Expand(req.URL, map[string]string{
  3778  		"name": c.name,
  3779  	})
  3780  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3781  }
  3782  
  3783  // Do executes the "tpu.projects.locations.operations.list" call.
  3784  // Any non-2xx status code is an error. Response headers are in either
  3785  // *ListOperationsResponse.ServerResponse.Header or (if a response was returned
  3786  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3787  // check whether the returned error was because http.StatusNotModified was
  3788  // returned.
  3789  func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  3790  	gensupport.SetOptions(c.urlParams_, opts...)
  3791  	res, err := c.doRequest("json")
  3792  	if res != nil && res.StatusCode == http.StatusNotModified {
  3793  		if res.Body != nil {
  3794  			res.Body.Close()
  3795  		}
  3796  		return nil, gensupport.WrapError(&googleapi.Error{
  3797  			Code:   res.StatusCode,
  3798  			Header: res.Header,
  3799  		})
  3800  	}
  3801  	if err != nil {
  3802  		return nil, err
  3803  	}
  3804  	defer googleapi.CloseBody(res)
  3805  	if err := googleapi.CheckResponse(res); err != nil {
  3806  		return nil, gensupport.WrapError(err)
  3807  	}
  3808  	ret := &ListOperationsResponse{
  3809  		ServerResponse: googleapi.ServerResponse{
  3810  			Header:         res.Header,
  3811  			HTTPStatusCode: res.StatusCode,
  3812  		},
  3813  	}
  3814  	target := &ret
  3815  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3816  		return nil, err
  3817  	}
  3818  	return ret, nil
  3819  }
  3820  
  3821  // Pages invokes f for each page of results.
  3822  // A non-nil error returned from f will halt the iteration.
  3823  // The provided context supersedes any context provided to the Context method.
  3824  func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  3825  	c.ctx_ = ctx
  3826  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3827  	for {
  3828  		x, err := c.Do()
  3829  		if err != nil {
  3830  			return err
  3831  		}
  3832  		if err := f(x); err != nil {
  3833  			return err
  3834  		}
  3835  		if x.NextPageToken == "" {
  3836  			return nil
  3837  		}
  3838  		c.PageToken(x.NextPageToken)
  3839  	}
  3840  }
  3841  
  3842  type ProjectsLocationsQueuedResourcesCreateCall struct {
  3843  	s              *Service
  3844  	parent         string
  3845  	queuedresource *QueuedResource
  3846  	urlParams_     gensupport.URLParams
  3847  	ctx_           context.Context
  3848  	header_        http.Header
  3849  }
  3850  
  3851  // Create: Creates a QueuedResource TPU instance.
  3852  //
  3853  // - parent: The parent resource name.
  3854  func (r *ProjectsLocationsQueuedResourcesService) Create(parent string, queuedresource *QueuedResource) *ProjectsLocationsQueuedResourcesCreateCall {
  3855  	c := &ProjectsLocationsQueuedResourcesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3856  	c.parent = parent
  3857  	c.queuedresource = queuedresource
  3858  	return c
  3859  }
  3860  
  3861  // QueuedResourceId sets the optional parameter "queuedResourceId": The
  3862  // unqualified resource name. Should follow the `^[A-Za-z0-9_.~+%-]+$` regex
  3863  // format.
  3864  func (c *ProjectsLocationsQueuedResourcesCreateCall) QueuedResourceId(queuedResourceId string) *ProjectsLocationsQueuedResourcesCreateCall {
  3865  	c.urlParams_.Set("queuedResourceId", queuedResourceId)
  3866  	return c
  3867  }
  3868  
  3869  // RequestId sets the optional parameter "requestId": Idempotent request UUID.
  3870  func (c *ProjectsLocationsQueuedResourcesCreateCall) RequestId(requestId string) *ProjectsLocationsQueuedResourcesCreateCall {
  3871  	c.urlParams_.Set("requestId", requestId)
  3872  	return c
  3873  }
  3874  
  3875  // Fields allows partial responses to be retrieved. See
  3876  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3877  // details.
  3878  func (c *ProjectsLocationsQueuedResourcesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuedResourcesCreateCall {
  3879  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3880  	return c
  3881  }
  3882  
  3883  // Context sets the context to be used in this call's Do method.
  3884  func (c *ProjectsLocationsQueuedResourcesCreateCall) Context(ctx context.Context) *ProjectsLocationsQueuedResourcesCreateCall {
  3885  	c.ctx_ = ctx
  3886  	return c
  3887  }
  3888  
  3889  // Header returns a http.Header that can be modified by the caller to add
  3890  // headers to the request.
  3891  func (c *ProjectsLocationsQueuedResourcesCreateCall) Header() http.Header {
  3892  	if c.header_ == nil {
  3893  		c.header_ = make(http.Header)
  3894  	}
  3895  	return c.header_
  3896  }
  3897  
  3898  func (c *ProjectsLocationsQueuedResourcesCreateCall) doRequest(alt string) (*http.Response, error) {
  3899  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3900  	var body io.Reader = nil
  3901  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.queuedresource)
  3902  	if err != nil {
  3903  		return nil, err
  3904  	}
  3905  	c.urlParams_.Set("alt", alt)
  3906  	c.urlParams_.Set("prettyPrint", "false")
  3907  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+parent}/queuedResources")
  3908  	urls += "?" + c.urlParams_.Encode()
  3909  	req, err := http.NewRequest("POST", urls, body)
  3910  	if err != nil {
  3911  		return nil, err
  3912  	}
  3913  	req.Header = reqHeaders
  3914  	googleapi.Expand(req.URL, map[string]string{
  3915  		"parent": c.parent,
  3916  	})
  3917  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3918  }
  3919  
  3920  // Do executes the "tpu.projects.locations.queuedResources.create" call.
  3921  // Any non-2xx status code is an error. Response headers are in either
  3922  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3923  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3924  // whether the returned error was because http.StatusNotModified was returned.
  3925  func (c *ProjectsLocationsQueuedResourcesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3926  	gensupport.SetOptions(c.urlParams_, opts...)
  3927  	res, err := c.doRequest("json")
  3928  	if res != nil && res.StatusCode == http.StatusNotModified {
  3929  		if res.Body != nil {
  3930  			res.Body.Close()
  3931  		}
  3932  		return nil, gensupport.WrapError(&googleapi.Error{
  3933  			Code:   res.StatusCode,
  3934  			Header: res.Header,
  3935  		})
  3936  	}
  3937  	if err != nil {
  3938  		return nil, err
  3939  	}
  3940  	defer googleapi.CloseBody(res)
  3941  	if err := googleapi.CheckResponse(res); err != nil {
  3942  		return nil, gensupport.WrapError(err)
  3943  	}
  3944  	ret := &Operation{
  3945  		ServerResponse: googleapi.ServerResponse{
  3946  			Header:         res.Header,
  3947  			HTTPStatusCode: res.StatusCode,
  3948  		},
  3949  	}
  3950  	target := &ret
  3951  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3952  		return nil, err
  3953  	}
  3954  	return ret, nil
  3955  }
  3956  
  3957  type ProjectsLocationsQueuedResourcesDeleteCall struct {
  3958  	s          *Service
  3959  	name       string
  3960  	urlParams_ gensupport.URLParams
  3961  	ctx_       context.Context
  3962  	header_    http.Header
  3963  }
  3964  
  3965  // Delete: Deletes a QueuedResource TPU instance.
  3966  //
  3967  // - name: The resource name.
  3968  func (r *ProjectsLocationsQueuedResourcesService) Delete(name string) *ProjectsLocationsQueuedResourcesDeleteCall {
  3969  	c := &ProjectsLocationsQueuedResourcesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3970  	c.name = name
  3971  	return c
  3972  }
  3973  
  3974  // Force sets the optional parameter "force": If set to true, all running nodes
  3975  // belonging to this queued resource will be deleted first and then the queued
  3976  // resource will be deleted. Otherwise (i.e. force=false), the queued resource
  3977  // will only be deleted if its nodes have already been deleted or the queued
  3978  // resource is in the ACCEPTED, FAILED, or SUSPENDED state.
  3979  func (c *ProjectsLocationsQueuedResourcesDeleteCall) Force(force bool) *ProjectsLocationsQueuedResourcesDeleteCall {
  3980  	c.urlParams_.Set("force", fmt.Sprint(force))
  3981  	return c
  3982  }
  3983  
  3984  // RequestId sets the optional parameter "requestId": Idempotent request UUID.
  3985  func (c *ProjectsLocationsQueuedResourcesDeleteCall) RequestId(requestId string) *ProjectsLocationsQueuedResourcesDeleteCall {
  3986  	c.urlParams_.Set("requestId", requestId)
  3987  	return c
  3988  }
  3989  
  3990  // Fields allows partial responses to be retrieved. See
  3991  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3992  // details.
  3993  func (c *ProjectsLocationsQueuedResourcesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuedResourcesDeleteCall {
  3994  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3995  	return c
  3996  }
  3997  
  3998  // Context sets the context to be used in this call's Do method.
  3999  func (c *ProjectsLocationsQueuedResourcesDeleteCall) Context(ctx context.Context) *ProjectsLocationsQueuedResourcesDeleteCall {
  4000  	c.ctx_ = ctx
  4001  	return c
  4002  }
  4003  
  4004  // Header returns a http.Header that can be modified by the caller to add
  4005  // headers to the request.
  4006  func (c *ProjectsLocationsQueuedResourcesDeleteCall) Header() http.Header {
  4007  	if c.header_ == nil {
  4008  		c.header_ = make(http.Header)
  4009  	}
  4010  	return c.header_
  4011  }
  4012  
  4013  func (c *ProjectsLocationsQueuedResourcesDeleteCall) doRequest(alt string) (*http.Response, error) {
  4014  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4015  	var body io.Reader = nil
  4016  	c.urlParams_.Set("alt", alt)
  4017  	c.urlParams_.Set("prettyPrint", "false")
  4018  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}")
  4019  	urls += "?" + c.urlParams_.Encode()
  4020  	req, err := http.NewRequest("DELETE", urls, body)
  4021  	if err != nil {
  4022  		return nil, err
  4023  	}
  4024  	req.Header = reqHeaders
  4025  	googleapi.Expand(req.URL, map[string]string{
  4026  		"name": c.name,
  4027  	})
  4028  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4029  }
  4030  
  4031  // Do executes the "tpu.projects.locations.queuedResources.delete" call.
  4032  // Any non-2xx status code is an error. Response headers are in either
  4033  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  4034  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4035  // whether the returned error was because http.StatusNotModified was returned.
  4036  func (c *ProjectsLocationsQueuedResourcesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4037  	gensupport.SetOptions(c.urlParams_, opts...)
  4038  	res, err := c.doRequest("json")
  4039  	if res != nil && res.StatusCode == http.StatusNotModified {
  4040  		if res.Body != nil {
  4041  			res.Body.Close()
  4042  		}
  4043  		return nil, gensupport.WrapError(&googleapi.Error{
  4044  			Code:   res.StatusCode,
  4045  			Header: res.Header,
  4046  		})
  4047  	}
  4048  	if err != nil {
  4049  		return nil, err
  4050  	}
  4051  	defer googleapi.CloseBody(res)
  4052  	if err := googleapi.CheckResponse(res); err != nil {
  4053  		return nil, gensupport.WrapError(err)
  4054  	}
  4055  	ret := &Operation{
  4056  		ServerResponse: googleapi.ServerResponse{
  4057  			Header:         res.Header,
  4058  			HTTPStatusCode: res.StatusCode,
  4059  		},
  4060  	}
  4061  	target := &ret
  4062  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4063  		return nil, err
  4064  	}
  4065  	return ret, nil
  4066  }
  4067  
  4068  type ProjectsLocationsQueuedResourcesGetCall struct {
  4069  	s            *Service
  4070  	name         string
  4071  	urlParams_   gensupport.URLParams
  4072  	ifNoneMatch_ string
  4073  	ctx_         context.Context
  4074  	header_      http.Header
  4075  }
  4076  
  4077  // Get: Gets details of a queued resource.
  4078  //
  4079  // - name: The resource name.
  4080  func (r *ProjectsLocationsQueuedResourcesService) Get(name string) *ProjectsLocationsQueuedResourcesGetCall {
  4081  	c := &ProjectsLocationsQueuedResourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4082  	c.name = name
  4083  	return c
  4084  }
  4085  
  4086  // Fields allows partial responses to be retrieved. See
  4087  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4088  // details.
  4089  func (c *ProjectsLocationsQueuedResourcesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuedResourcesGetCall {
  4090  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4091  	return c
  4092  }
  4093  
  4094  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4095  // object's ETag matches the given value. This is useful for getting updates
  4096  // only after the object has changed since the last request.
  4097  func (c *ProjectsLocationsQueuedResourcesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsQueuedResourcesGetCall {
  4098  	c.ifNoneMatch_ = entityTag
  4099  	return c
  4100  }
  4101  
  4102  // Context sets the context to be used in this call's Do method.
  4103  func (c *ProjectsLocationsQueuedResourcesGetCall) Context(ctx context.Context) *ProjectsLocationsQueuedResourcesGetCall {
  4104  	c.ctx_ = ctx
  4105  	return c
  4106  }
  4107  
  4108  // Header returns a http.Header that can be modified by the caller to add
  4109  // headers to the request.
  4110  func (c *ProjectsLocationsQueuedResourcesGetCall) Header() http.Header {
  4111  	if c.header_ == nil {
  4112  		c.header_ = make(http.Header)
  4113  	}
  4114  	return c.header_
  4115  }
  4116  
  4117  func (c *ProjectsLocationsQueuedResourcesGetCall) doRequest(alt string) (*http.Response, error) {
  4118  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4119  	if c.ifNoneMatch_ != "" {
  4120  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4121  	}
  4122  	var body io.Reader = nil
  4123  	c.urlParams_.Set("alt", alt)
  4124  	c.urlParams_.Set("prettyPrint", "false")
  4125  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}")
  4126  	urls += "?" + c.urlParams_.Encode()
  4127  	req, err := http.NewRequest("GET", urls, body)
  4128  	if err != nil {
  4129  		return nil, err
  4130  	}
  4131  	req.Header = reqHeaders
  4132  	googleapi.Expand(req.URL, map[string]string{
  4133  		"name": c.name,
  4134  	})
  4135  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4136  }
  4137  
  4138  // Do executes the "tpu.projects.locations.queuedResources.get" call.
  4139  // Any non-2xx status code is an error. Response headers are in either
  4140  // *QueuedResource.ServerResponse.Header or (if a response was returned at all)
  4141  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4142  // whether the returned error was because http.StatusNotModified was returned.
  4143  func (c *ProjectsLocationsQueuedResourcesGetCall) Do(opts ...googleapi.CallOption) (*QueuedResource, error) {
  4144  	gensupport.SetOptions(c.urlParams_, opts...)
  4145  	res, err := c.doRequest("json")
  4146  	if res != nil && res.StatusCode == http.StatusNotModified {
  4147  		if res.Body != nil {
  4148  			res.Body.Close()
  4149  		}
  4150  		return nil, gensupport.WrapError(&googleapi.Error{
  4151  			Code:   res.StatusCode,
  4152  			Header: res.Header,
  4153  		})
  4154  	}
  4155  	if err != nil {
  4156  		return nil, err
  4157  	}
  4158  	defer googleapi.CloseBody(res)
  4159  	if err := googleapi.CheckResponse(res); err != nil {
  4160  		return nil, gensupport.WrapError(err)
  4161  	}
  4162  	ret := &QueuedResource{
  4163  		ServerResponse: googleapi.ServerResponse{
  4164  			Header:         res.Header,
  4165  			HTTPStatusCode: res.StatusCode,
  4166  		},
  4167  	}
  4168  	target := &ret
  4169  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4170  		return nil, err
  4171  	}
  4172  	return ret, nil
  4173  }
  4174  
  4175  type ProjectsLocationsQueuedResourcesListCall struct {
  4176  	s            *Service
  4177  	parent       string
  4178  	urlParams_   gensupport.URLParams
  4179  	ifNoneMatch_ string
  4180  	ctx_         context.Context
  4181  	header_      http.Header
  4182  }
  4183  
  4184  // List: Lists queued resources.
  4185  //
  4186  // - parent: The parent resource name.
  4187  func (r *ProjectsLocationsQueuedResourcesService) List(parent string) *ProjectsLocationsQueuedResourcesListCall {
  4188  	c := &ProjectsLocationsQueuedResourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4189  	c.parent = parent
  4190  	return c
  4191  }
  4192  
  4193  // PageSize sets the optional parameter "pageSize": The maximum number of items
  4194  // to return.
  4195  func (c *ProjectsLocationsQueuedResourcesListCall) PageSize(pageSize int64) *ProjectsLocationsQueuedResourcesListCall {
  4196  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4197  	return c
  4198  }
  4199  
  4200  // PageToken sets the optional parameter "pageToken": The next_page_token value
  4201  // returned from a previous List request, if any.
  4202  func (c *ProjectsLocationsQueuedResourcesListCall) PageToken(pageToken string) *ProjectsLocationsQueuedResourcesListCall {
  4203  	c.urlParams_.Set("pageToken", pageToken)
  4204  	return c
  4205  }
  4206  
  4207  // Fields allows partial responses to be retrieved. See
  4208  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4209  // details.
  4210  func (c *ProjectsLocationsQueuedResourcesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuedResourcesListCall {
  4211  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4212  	return c
  4213  }
  4214  
  4215  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4216  // object's ETag matches the given value. This is useful for getting updates
  4217  // only after the object has changed since the last request.
  4218  func (c *ProjectsLocationsQueuedResourcesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsQueuedResourcesListCall {
  4219  	c.ifNoneMatch_ = entityTag
  4220  	return c
  4221  }
  4222  
  4223  // Context sets the context to be used in this call's Do method.
  4224  func (c *ProjectsLocationsQueuedResourcesListCall) Context(ctx context.Context) *ProjectsLocationsQueuedResourcesListCall {
  4225  	c.ctx_ = ctx
  4226  	return c
  4227  }
  4228  
  4229  // Header returns a http.Header that can be modified by the caller to add
  4230  // headers to the request.
  4231  func (c *ProjectsLocationsQueuedResourcesListCall) Header() http.Header {
  4232  	if c.header_ == nil {
  4233  		c.header_ = make(http.Header)
  4234  	}
  4235  	return c.header_
  4236  }
  4237  
  4238  func (c *ProjectsLocationsQueuedResourcesListCall) doRequest(alt string) (*http.Response, error) {
  4239  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4240  	if c.ifNoneMatch_ != "" {
  4241  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4242  	}
  4243  	var body io.Reader = nil
  4244  	c.urlParams_.Set("alt", alt)
  4245  	c.urlParams_.Set("prettyPrint", "false")
  4246  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+parent}/queuedResources")
  4247  	urls += "?" + c.urlParams_.Encode()
  4248  	req, err := http.NewRequest("GET", urls, body)
  4249  	if err != nil {
  4250  		return nil, err
  4251  	}
  4252  	req.Header = reqHeaders
  4253  	googleapi.Expand(req.URL, map[string]string{
  4254  		"parent": c.parent,
  4255  	})
  4256  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4257  }
  4258  
  4259  // Do executes the "tpu.projects.locations.queuedResources.list" call.
  4260  // Any non-2xx status code is an error. Response headers are in either
  4261  // *ListQueuedResourcesResponse.ServerResponse.Header or (if a response was
  4262  // returned at all) in error.(*googleapi.Error).Header. Use
  4263  // googleapi.IsNotModified to check whether the returned error was because
  4264  // http.StatusNotModified was returned.
  4265  func (c *ProjectsLocationsQueuedResourcesListCall) Do(opts ...googleapi.CallOption) (*ListQueuedResourcesResponse, error) {
  4266  	gensupport.SetOptions(c.urlParams_, opts...)
  4267  	res, err := c.doRequest("json")
  4268  	if res != nil && res.StatusCode == http.StatusNotModified {
  4269  		if res.Body != nil {
  4270  			res.Body.Close()
  4271  		}
  4272  		return nil, gensupport.WrapError(&googleapi.Error{
  4273  			Code:   res.StatusCode,
  4274  			Header: res.Header,
  4275  		})
  4276  	}
  4277  	if err != nil {
  4278  		return nil, err
  4279  	}
  4280  	defer googleapi.CloseBody(res)
  4281  	if err := googleapi.CheckResponse(res); err != nil {
  4282  		return nil, gensupport.WrapError(err)
  4283  	}
  4284  	ret := &ListQueuedResourcesResponse{
  4285  		ServerResponse: googleapi.ServerResponse{
  4286  			Header:         res.Header,
  4287  			HTTPStatusCode: res.StatusCode,
  4288  		},
  4289  	}
  4290  	target := &ret
  4291  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4292  		return nil, err
  4293  	}
  4294  	return ret, nil
  4295  }
  4296  
  4297  // Pages invokes f for each page of results.
  4298  // A non-nil error returned from f will halt the iteration.
  4299  // The provided context supersedes any context provided to the Context method.
  4300  func (c *ProjectsLocationsQueuedResourcesListCall) Pages(ctx context.Context, f func(*ListQueuedResourcesResponse) error) error {
  4301  	c.ctx_ = ctx
  4302  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4303  	for {
  4304  		x, err := c.Do()
  4305  		if err != nil {
  4306  			return err
  4307  		}
  4308  		if err := f(x); err != nil {
  4309  			return err
  4310  		}
  4311  		if x.NextPageToken == "" {
  4312  			return nil
  4313  		}
  4314  		c.PageToken(x.NextPageToken)
  4315  	}
  4316  }
  4317  
  4318  type ProjectsLocationsQueuedResourcesResetCall struct {
  4319  	s                          *Service
  4320  	name                       string
  4321  	resetqueuedresourcerequest *ResetQueuedResourceRequest
  4322  	urlParams_                 gensupport.URLParams
  4323  	ctx_                       context.Context
  4324  	header_                    http.Header
  4325  }
  4326  
  4327  // Reset: Resets a QueuedResource TPU instance
  4328  //
  4329  // - name: The name of the queued resource.
  4330  func (r *ProjectsLocationsQueuedResourcesService) Reset(name string, resetqueuedresourcerequest *ResetQueuedResourceRequest) *ProjectsLocationsQueuedResourcesResetCall {
  4331  	c := &ProjectsLocationsQueuedResourcesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4332  	c.name = name
  4333  	c.resetqueuedresourcerequest = resetqueuedresourcerequest
  4334  	return c
  4335  }
  4336  
  4337  // Fields allows partial responses to be retrieved. See
  4338  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4339  // details.
  4340  func (c *ProjectsLocationsQueuedResourcesResetCall) Fields(s ...googleapi.Field) *ProjectsLocationsQueuedResourcesResetCall {
  4341  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4342  	return c
  4343  }
  4344  
  4345  // Context sets the context to be used in this call's Do method.
  4346  func (c *ProjectsLocationsQueuedResourcesResetCall) Context(ctx context.Context) *ProjectsLocationsQueuedResourcesResetCall {
  4347  	c.ctx_ = ctx
  4348  	return c
  4349  }
  4350  
  4351  // Header returns a http.Header that can be modified by the caller to add
  4352  // headers to the request.
  4353  func (c *ProjectsLocationsQueuedResourcesResetCall) Header() http.Header {
  4354  	if c.header_ == nil {
  4355  		c.header_ = make(http.Header)
  4356  	}
  4357  	return c.header_
  4358  }
  4359  
  4360  func (c *ProjectsLocationsQueuedResourcesResetCall) doRequest(alt string) (*http.Response, error) {
  4361  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4362  	var body io.Reader = nil
  4363  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetqueuedresourcerequest)
  4364  	if err != nil {
  4365  		return nil, err
  4366  	}
  4367  	c.urlParams_.Set("alt", alt)
  4368  	c.urlParams_.Set("prettyPrint", "false")
  4369  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}:reset")
  4370  	urls += "?" + c.urlParams_.Encode()
  4371  	req, err := http.NewRequest("POST", urls, body)
  4372  	if err != nil {
  4373  		return nil, err
  4374  	}
  4375  	req.Header = reqHeaders
  4376  	googleapi.Expand(req.URL, map[string]string{
  4377  		"name": c.name,
  4378  	})
  4379  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4380  }
  4381  
  4382  // Do executes the "tpu.projects.locations.queuedResources.reset" call.
  4383  // Any non-2xx status code is an error. Response headers are in either
  4384  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  4385  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4386  // whether the returned error was because http.StatusNotModified was returned.
  4387  func (c *ProjectsLocationsQueuedResourcesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4388  	gensupport.SetOptions(c.urlParams_, opts...)
  4389  	res, err := c.doRequest("json")
  4390  	if res != nil && res.StatusCode == http.StatusNotModified {
  4391  		if res.Body != nil {
  4392  			res.Body.Close()
  4393  		}
  4394  		return nil, gensupport.WrapError(&googleapi.Error{
  4395  			Code:   res.StatusCode,
  4396  			Header: res.Header,
  4397  		})
  4398  	}
  4399  	if err != nil {
  4400  		return nil, err
  4401  	}
  4402  	defer googleapi.CloseBody(res)
  4403  	if err := googleapi.CheckResponse(res); err != nil {
  4404  		return nil, gensupport.WrapError(err)
  4405  	}
  4406  	ret := &Operation{
  4407  		ServerResponse: googleapi.ServerResponse{
  4408  			Header:         res.Header,
  4409  			HTTPStatusCode: res.StatusCode,
  4410  		},
  4411  	}
  4412  	target := &ret
  4413  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4414  		return nil, err
  4415  	}
  4416  	return ret, nil
  4417  }
  4418  
  4419  type ProjectsLocationsReservationsListCall struct {
  4420  	s            *Service
  4421  	parent       string
  4422  	urlParams_   gensupport.URLParams
  4423  	ifNoneMatch_ string
  4424  	ctx_         context.Context
  4425  	header_      http.Header
  4426  }
  4427  
  4428  // List: Retrieves the reservations for the given project in the given
  4429  // location.
  4430  //
  4431  // - parent: The parent for reservations.
  4432  func (r *ProjectsLocationsReservationsService) List(parent string) *ProjectsLocationsReservationsListCall {
  4433  	c := &ProjectsLocationsReservationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4434  	c.parent = parent
  4435  	return c
  4436  }
  4437  
  4438  // PageSize sets the optional parameter "pageSize": The maximum number of items
  4439  // to return.
  4440  func (c *ProjectsLocationsReservationsListCall) PageSize(pageSize int64) *ProjectsLocationsReservationsListCall {
  4441  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4442  	return c
  4443  }
  4444  
  4445  // PageToken sets the optional parameter "pageToken": The next_page_token value
  4446  // returned from a previous List request, if any.
  4447  func (c *ProjectsLocationsReservationsListCall) PageToken(pageToken string) *ProjectsLocationsReservationsListCall {
  4448  	c.urlParams_.Set("pageToken", pageToken)
  4449  	return c
  4450  }
  4451  
  4452  // Fields allows partial responses to be retrieved. See
  4453  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4454  // details.
  4455  func (c *ProjectsLocationsReservationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsReservationsListCall {
  4456  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4457  	return c
  4458  }
  4459  
  4460  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4461  // object's ETag matches the given value. This is useful for getting updates
  4462  // only after the object has changed since the last request.
  4463  func (c *ProjectsLocationsReservationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsReservationsListCall {
  4464  	c.ifNoneMatch_ = entityTag
  4465  	return c
  4466  }
  4467  
  4468  // Context sets the context to be used in this call's Do method.
  4469  func (c *ProjectsLocationsReservationsListCall) Context(ctx context.Context) *ProjectsLocationsReservationsListCall {
  4470  	c.ctx_ = ctx
  4471  	return c
  4472  }
  4473  
  4474  // Header returns a http.Header that can be modified by the caller to add
  4475  // headers to the request.
  4476  func (c *ProjectsLocationsReservationsListCall) Header() http.Header {
  4477  	if c.header_ == nil {
  4478  		c.header_ = make(http.Header)
  4479  	}
  4480  	return c.header_
  4481  }
  4482  
  4483  func (c *ProjectsLocationsReservationsListCall) doRequest(alt string) (*http.Response, error) {
  4484  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4485  	if c.ifNoneMatch_ != "" {
  4486  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4487  	}
  4488  	var body io.Reader = nil
  4489  	c.urlParams_.Set("alt", alt)
  4490  	c.urlParams_.Set("prettyPrint", "false")
  4491  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+parent}/reservations")
  4492  	urls += "?" + c.urlParams_.Encode()
  4493  	req, err := http.NewRequest("GET", urls, body)
  4494  	if err != nil {
  4495  		return nil, err
  4496  	}
  4497  	req.Header = reqHeaders
  4498  	googleapi.Expand(req.URL, map[string]string{
  4499  		"parent": c.parent,
  4500  	})
  4501  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4502  }
  4503  
  4504  // Do executes the "tpu.projects.locations.reservations.list" call.
  4505  // Any non-2xx status code is an error. Response headers are in either
  4506  // *ListReservationsResponse.ServerResponse.Header or (if a response was
  4507  // returned at all) in error.(*googleapi.Error).Header. Use
  4508  // googleapi.IsNotModified to check whether the returned error was because
  4509  // http.StatusNotModified was returned.
  4510  func (c *ProjectsLocationsReservationsListCall) Do(opts ...googleapi.CallOption) (*ListReservationsResponse, error) {
  4511  	gensupport.SetOptions(c.urlParams_, opts...)
  4512  	res, err := c.doRequest("json")
  4513  	if res != nil && res.StatusCode == http.StatusNotModified {
  4514  		if res.Body != nil {
  4515  			res.Body.Close()
  4516  		}
  4517  		return nil, gensupport.WrapError(&googleapi.Error{
  4518  			Code:   res.StatusCode,
  4519  			Header: res.Header,
  4520  		})
  4521  	}
  4522  	if err != nil {
  4523  		return nil, err
  4524  	}
  4525  	defer googleapi.CloseBody(res)
  4526  	if err := googleapi.CheckResponse(res); err != nil {
  4527  		return nil, gensupport.WrapError(err)
  4528  	}
  4529  	ret := &ListReservationsResponse{
  4530  		ServerResponse: googleapi.ServerResponse{
  4531  			Header:         res.Header,
  4532  			HTTPStatusCode: res.StatusCode,
  4533  		},
  4534  	}
  4535  	target := &ret
  4536  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4537  		return nil, err
  4538  	}
  4539  	return ret, nil
  4540  }
  4541  
  4542  // Pages invokes f for each page of results.
  4543  // A non-nil error returned from f will halt the iteration.
  4544  // The provided context supersedes any context provided to the Context method.
  4545  func (c *ProjectsLocationsReservationsListCall) Pages(ctx context.Context, f func(*ListReservationsResponse) error) error {
  4546  	c.ctx_ = ctx
  4547  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4548  	for {
  4549  		x, err := c.Do()
  4550  		if err != nil {
  4551  			return err
  4552  		}
  4553  		if err := f(x); err != nil {
  4554  			return err
  4555  		}
  4556  		if x.NextPageToken == "" {
  4557  			return nil
  4558  		}
  4559  		c.PageToken(x.NextPageToken)
  4560  	}
  4561  }
  4562  
  4563  type ProjectsLocationsRuntimeVersionsGetCall struct {
  4564  	s            *Service
  4565  	name         string
  4566  	urlParams_   gensupport.URLParams
  4567  	ifNoneMatch_ string
  4568  	ctx_         context.Context
  4569  	header_      http.Header
  4570  }
  4571  
  4572  // Get: Gets a runtime version.
  4573  //
  4574  // - name: The resource name.
  4575  func (r *ProjectsLocationsRuntimeVersionsService) Get(name string) *ProjectsLocationsRuntimeVersionsGetCall {
  4576  	c := &ProjectsLocationsRuntimeVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4577  	c.name = name
  4578  	return c
  4579  }
  4580  
  4581  // Fields allows partial responses to be retrieved. See
  4582  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4583  // details.
  4584  func (c *ProjectsLocationsRuntimeVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsRuntimeVersionsGetCall {
  4585  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4586  	return c
  4587  }
  4588  
  4589  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4590  // object's ETag matches the given value. This is useful for getting updates
  4591  // only after the object has changed since the last request.
  4592  func (c *ProjectsLocationsRuntimeVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsRuntimeVersionsGetCall {
  4593  	c.ifNoneMatch_ = entityTag
  4594  	return c
  4595  }
  4596  
  4597  // Context sets the context to be used in this call's Do method.
  4598  func (c *ProjectsLocationsRuntimeVersionsGetCall) Context(ctx context.Context) *ProjectsLocationsRuntimeVersionsGetCall {
  4599  	c.ctx_ = ctx
  4600  	return c
  4601  }
  4602  
  4603  // Header returns a http.Header that can be modified by the caller to add
  4604  // headers to the request.
  4605  func (c *ProjectsLocationsRuntimeVersionsGetCall) Header() http.Header {
  4606  	if c.header_ == nil {
  4607  		c.header_ = make(http.Header)
  4608  	}
  4609  	return c.header_
  4610  }
  4611  
  4612  func (c *ProjectsLocationsRuntimeVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  4613  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4614  	if c.ifNoneMatch_ != "" {
  4615  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4616  	}
  4617  	var body io.Reader = nil
  4618  	c.urlParams_.Set("alt", alt)
  4619  	c.urlParams_.Set("prettyPrint", "false")
  4620  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+name}")
  4621  	urls += "?" + c.urlParams_.Encode()
  4622  	req, err := http.NewRequest("GET", urls, body)
  4623  	if err != nil {
  4624  		return nil, err
  4625  	}
  4626  	req.Header = reqHeaders
  4627  	googleapi.Expand(req.URL, map[string]string{
  4628  		"name": c.name,
  4629  	})
  4630  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4631  }
  4632  
  4633  // Do executes the "tpu.projects.locations.runtimeVersions.get" call.
  4634  // Any non-2xx status code is an error. Response headers are in either
  4635  // *RuntimeVersion.ServerResponse.Header or (if a response was returned at all)
  4636  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4637  // whether the returned error was because http.StatusNotModified was returned.
  4638  func (c *ProjectsLocationsRuntimeVersionsGetCall) Do(opts ...googleapi.CallOption) (*RuntimeVersion, error) {
  4639  	gensupport.SetOptions(c.urlParams_, opts...)
  4640  	res, err := c.doRequest("json")
  4641  	if res != nil && res.StatusCode == http.StatusNotModified {
  4642  		if res.Body != nil {
  4643  			res.Body.Close()
  4644  		}
  4645  		return nil, gensupport.WrapError(&googleapi.Error{
  4646  			Code:   res.StatusCode,
  4647  			Header: res.Header,
  4648  		})
  4649  	}
  4650  	if err != nil {
  4651  		return nil, err
  4652  	}
  4653  	defer googleapi.CloseBody(res)
  4654  	if err := googleapi.CheckResponse(res); err != nil {
  4655  		return nil, gensupport.WrapError(err)
  4656  	}
  4657  	ret := &RuntimeVersion{
  4658  		ServerResponse: googleapi.ServerResponse{
  4659  			Header:         res.Header,
  4660  			HTTPStatusCode: res.StatusCode,
  4661  		},
  4662  	}
  4663  	target := &ret
  4664  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4665  		return nil, err
  4666  	}
  4667  	return ret, nil
  4668  }
  4669  
  4670  type ProjectsLocationsRuntimeVersionsListCall struct {
  4671  	s            *Service
  4672  	parent       string
  4673  	urlParams_   gensupport.URLParams
  4674  	ifNoneMatch_ string
  4675  	ctx_         context.Context
  4676  	header_      http.Header
  4677  }
  4678  
  4679  // List: Lists runtime versions supported by this API.
  4680  //
  4681  // - parent: The parent resource name.
  4682  func (r *ProjectsLocationsRuntimeVersionsService) List(parent string) *ProjectsLocationsRuntimeVersionsListCall {
  4683  	c := &ProjectsLocationsRuntimeVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4684  	c.parent = parent
  4685  	return c
  4686  }
  4687  
  4688  // Filter sets the optional parameter "filter": List filter.
  4689  func (c *ProjectsLocationsRuntimeVersionsListCall) Filter(filter string) *ProjectsLocationsRuntimeVersionsListCall {
  4690  	c.urlParams_.Set("filter", filter)
  4691  	return c
  4692  }
  4693  
  4694  // OrderBy sets the optional parameter "orderBy": Sort results.
  4695  func (c *ProjectsLocationsRuntimeVersionsListCall) OrderBy(orderBy string) *ProjectsLocationsRuntimeVersionsListCall {
  4696  	c.urlParams_.Set("orderBy", orderBy)
  4697  	return c
  4698  }
  4699  
  4700  // PageSize sets the optional parameter "pageSize": The maximum number of items
  4701  // to return.
  4702  func (c *ProjectsLocationsRuntimeVersionsListCall) PageSize(pageSize int64) *ProjectsLocationsRuntimeVersionsListCall {
  4703  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4704  	return c
  4705  }
  4706  
  4707  // PageToken sets the optional parameter "pageToken": The next_page_token value
  4708  // returned from a previous List request, if any.
  4709  func (c *ProjectsLocationsRuntimeVersionsListCall) PageToken(pageToken string) *ProjectsLocationsRuntimeVersionsListCall {
  4710  	c.urlParams_.Set("pageToken", pageToken)
  4711  	return c
  4712  }
  4713  
  4714  // Fields allows partial responses to be retrieved. See
  4715  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4716  // details.
  4717  func (c *ProjectsLocationsRuntimeVersionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsRuntimeVersionsListCall {
  4718  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4719  	return c
  4720  }
  4721  
  4722  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4723  // object's ETag matches the given value. This is useful for getting updates
  4724  // only after the object has changed since the last request.
  4725  func (c *ProjectsLocationsRuntimeVersionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsRuntimeVersionsListCall {
  4726  	c.ifNoneMatch_ = entityTag
  4727  	return c
  4728  }
  4729  
  4730  // Context sets the context to be used in this call's Do method.
  4731  func (c *ProjectsLocationsRuntimeVersionsListCall) Context(ctx context.Context) *ProjectsLocationsRuntimeVersionsListCall {
  4732  	c.ctx_ = ctx
  4733  	return c
  4734  }
  4735  
  4736  // Header returns a http.Header that can be modified by the caller to add
  4737  // headers to the request.
  4738  func (c *ProjectsLocationsRuntimeVersionsListCall) Header() http.Header {
  4739  	if c.header_ == nil {
  4740  		c.header_ = make(http.Header)
  4741  	}
  4742  	return c.header_
  4743  }
  4744  
  4745  func (c *ProjectsLocationsRuntimeVersionsListCall) doRequest(alt string) (*http.Response, error) {
  4746  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4747  	if c.ifNoneMatch_ != "" {
  4748  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4749  	}
  4750  	var body io.Reader = nil
  4751  	c.urlParams_.Set("alt", alt)
  4752  	c.urlParams_.Set("prettyPrint", "false")
  4753  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2alpha1/{+parent}/runtimeVersions")
  4754  	urls += "?" + c.urlParams_.Encode()
  4755  	req, err := http.NewRequest("GET", urls, body)
  4756  	if err != nil {
  4757  		return nil, err
  4758  	}
  4759  	req.Header = reqHeaders
  4760  	googleapi.Expand(req.URL, map[string]string{
  4761  		"parent": c.parent,
  4762  	})
  4763  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4764  }
  4765  
  4766  // Do executes the "tpu.projects.locations.runtimeVersions.list" call.
  4767  // Any non-2xx status code is an error. Response headers are in either
  4768  // *ListRuntimeVersionsResponse.ServerResponse.Header or (if a response was
  4769  // returned at all) in error.(*googleapi.Error).Header. Use
  4770  // googleapi.IsNotModified to check whether the returned error was because
  4771  // http.StatusNotModified was returned.
  4772  func (c *ProjectsLocationsRuntimeVersionsListCall) Do(opts ...googleapi.CallOption) (*ListRuntimeVersionsResponse, error) {
  4773  	gensupport.SetOptions(c.urlParams_, opts...)
  4774  	res, err := c.doRequest("json")
  4775  	if res != nil && res.StatusCode == http.StatusNotModified {
  4776  		if res.Body != nil {
  4777  			res.Body.Close()
  4778  		}
  4779  		return nil, gensupport.WrapError(&googleapi.Error{
  4780  			Code:   res.StatusCode,
  4781  			Header: res.Header,
  4782  		})
  4783  	}
  4784  	if err != nil {
  4785  		return nil, err
  4786  	}
  4787  	defer googleapi.CloseBody(res)
  4788  	if err := googleapi.CheckResponse(res); err != nil {
  4789  		return nil, gensupport.WrapError(err)
  4790  	}
  4791  	ret := &ListRuntimeVersionsResponse{
  4792  		ServerResponse: googleapi.ServerResponse{
  4793  			Header:         res.Header,
  4794  			HTTPStatusCode: res.StatusCode,
  4795  		},
  4796  	}
  4797  	target := &ret
  4798  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4799  		return nil, err
  4800  	}
  4801  	return ret, nil
  4802  }
  4803  
  4804  // Pages invokes f for each page of results.
  4805  // A non-nil error returned from f will halt the iteration.
  4806  // The provided context supersedes any context provided to the Context method.
  4807  func (c *ProjectsLocationsRuntimeVersionsListCall) Pages(ctx context.Context, f func(*ListRuntimeVersionsResponse) error) error {
  4808  	c.ctx_ = ctx
  4809  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4810  	for {
  4811  		x, err := c.Do()
  4812  		if err != nil {
  4813  			return err
  4814  		}
  4815  		if err := f(x); err != nil {
  4816  			return err
  4817  		}
  4818  		if x.NextPageToken == "" {
  4819  			return nil
  4820  		}
  4821  		c.PageToken(x.NextPageToken)
  4822  	}
  4823  }
  4824  

View as plain text