...

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

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

     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/v1alpha1"
    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/v1alpha1"
    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:v1alpha1"
    90  const apiName = "tpu"
    91  const apiVersion = "v1alpha1"
    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.TensorflowVersions = NewProjectsLocationsTensorflowVersionsService(s)
   175  	return rs
   176  }
   177  
   178  type ProjectsLocationsService struct {
   179  	s *Service
   180  
   181  	AcceleratorTypes *ProjectsLocationsAcceleratorTypesService
   182  
   183  	Nodes *ProjectsLocationsNodesService
   184  
   185  	Operations *ProjectsLocationsOperationsService
   186  
   187  	TensorflowVersions *ProjectsLocationsTensorflowVersionsService
   188  }
   189  
   190  func NewProjectsLocationsAcceleratorTypesService(s *Service) *ProjectsLocationsAcceleratorTypesService {
   191  	rs := &ProjectsLocationsAcceleratorTypesService{s: s}
   192  	return rs
   193  }
   194  
   195  type ProjectsLocationsAcceleratorTypesService struct {
   196  	s *Service
   197  }
   198  
   199  func NewProjectsLocationsNodesService(s *Service) *ProjectsLocationsNodesService {
   200  	rs := &ProjectsLocationsNodesService{s: s}
   201  	return rs
   202  }
   203  
   204  type ProjectsLocationsNodesService struct {
   205  	s *Service
   206  }
   207  
   208  func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
   209  	rs := &ProjectsLocationsOperationsService{s: s}
   210  	return rs
   211  }
   212  
   213  type ProjectsLocationsOperationsService struct {
   214  	s *Service
   215  }
   216  
   217  func NewProjectsLocationsTensorflowVersionsService(s *Service) *ProjectsLocationsTensorflowVersionsService {
   218  	rs := &ProjectsLocationsTensorflowVersionsService{s: s}
   219  	return rs
   220  }
   221  
   222  type ProjectsLocationsTensorflowVersionsService struct {
   223  	s *Service
   224  }
   225  
   226  // AcceleratorType: A accelerator type that a Node can be configured with.
   227  type AcceleratorType struct {
   228  	// Name: The resource name.
   229  	Name string `json:"name,omitempty"`
   230  	// Type: the accelerator type.
   231  	Type string `json:"type,omitempty"`
   232  
   233  	// ServerResponse contains the HTTP response code and headers from the server.
   234  	googleapi.ServerResponse `json:"-"`
   235  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
   236  	// include in API requests. By default, fields with empty or default values are
   237  	// omitted from API requests. See
   238  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   239  	// details.
   240  	ForceSendFields []string `json:"-"`
   241  	// NullFields is a list of field names (e.g. "Name") to include in API requests
   242  	// with the JSON null value. By default, fields with empty values are omitted
   243  	// from API requests. See
   244  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   245  	NullFields []string `json:"-"`
   246  }
   247  
   248  func (s *AcceleratorType) MarshalJSON() ([]byte, error) {
   249  	type NoMethod AcceleratorType
   250  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   251  }
   252  
   253  // Empty: A generic empty message that you can re-use to avoid defining
   254  // duplicated empty messages in your APIs. A typical example is to use it as
   255  // the request or the response type of an API method. For instance: service Foo
   256  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   257  type Empty struct {
   258  	// ServerResponse contains the HTTP response code and headers from the server.
   259  	googleapi.ServerResponse `json:"-"`
   260  }
   261  
   262  // ListAcceleratorTypesResponse: Response for ListAcceleratorTypes.
   263  type ListAcceleratorTypesResponse struct {
   264  	// AcceleratorTypes: The listed nodes.
   265  	AcceleratorTypes []*AcceleratorType `json:"acceleratorTypes,omitempty"`
   266  	// NextPageToken: The next page token or empty if none.
   267  	NextPageToken string `json:"nextPageToken,omitempty"`
   268  	// Unreachable: Locations that could not be reached.
   269  	Unreachable []string `json:"unreachable,omitempty"`
   270  
   271  	// ServerResponse contains the HTTP response code and headers from the server.
   272  	googleapi.ServerResponse `json:"-"`
   273  	// ForceSendFields is a list of field names (e.g. "AcceleratorTypes") to
   274  	// unconditionally include in API requests. By default, fields with empty or
   275  	// default values are omitted from API requests. See
   276  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   277  	// details.
   278  	ForceSendFields []string `json:"-"`
   279  	// NullFields is a list of field names (e.g. "AcceleratorTypes") to include in
   280  	// API requests with the JSON null value. By default, fields with empty values
   281  	// are omitted from API requests. See
   282  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   283  	NullFields []string `json:"-"`
   284  }
   285  
   286  func (s *ListAcceleratorTypesResponse) MarshalJSON() ([]byte, error) {
   287  	type NoMethod ListAcceleratorTypesResponse
   288  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   289  }
   290  
   291  // ListLocationsResponse: The response message for Locations.ListLocations.
   292  type ListLocationsResponse struct {
   293  	// Locations: A list of locations that matches the specified filter in the
   294  	// request.
   295  	Locations []*Location `json:"locations,omitempty"`
   296  	// NextPageToken: The standard List next-page token.
   297  	NextPageToken string `json:"nextPageToken,omitempty"`
   298  
   299  	// ServerResponse contains the HTTP response code and headers from the server.
   300  	googleapi.ServerResponse `json:"-"`
   301  	// ForceSendFields is a list of field names (e.g. "Locations") to
   302  	// unconditionally include in API requests. By default, fields with empty or
   303  	// default values are omitted from API requests. See
   304  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   305  	// details.
   306  	ForceSendFields []string `json:"-"`
   307  	// NullFields is a list of field names (e.g. "Locations") to include in API
   308  	// requests with the JSON null value. By default, fields with empty values are
   309  	// omitted from API requests. See
   310  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   311  	NullFields []string `json:"-"`
   312  }
   313  
   314  func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
   315  	type NoMethod ListLocationsResponse
   316  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   317  }
   318  
   319  // ListNodesResponse: Response for ListNodes.
   320  type ListNodesResponse struct {
   321  	// NextPageToken: The next page token or empty if none.
   322  	NextPageToken string `json:"nextPageToken,omitempty"`
   323  	// Nodes: The listed nodes.
   324  	Nodes []*Node `json:"nodes,omitempty"`
   325  	// Unreachable: Locations that could not be reached.
   326  	Unreachable []string `json:"unreachable,omitempty"`
   327  
   328  	// ServerResponse contains the HTTP response code and headers from the server.
   329  	googleapi.ServerResponse `json:"-"`
   330  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   331  	// unconditionally include in API requests. By default, fields with empty or
   332  	// default values are omitted from API requests. See
   333  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   334  	// details.
   335  	ForceSendFields []string `json:"-"`
   336  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   337  	// requests with the JSON null value. By default, fields with empty values are
   338  	// omitted from API requests. See
   339  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   340  	NullFields []string `json:"-"`
   341  }
   342  
   343  func (s *ListNodesResponse) MarshalJSON() ([]byte, error) {
   344  	type NoMethod ListNodesResponse
   345  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   346  }
   347  
   348  // ListOperationsResponse: The response message for Operations.ListOperations.
   349  type ListOperationsResponse struct {
   350  	// NextPageToken: The standard List next-page token.
   351  	NextPageToken string `json:"nextPageToken,omitempty"`
   352  	// Operations: A list of operations that matches the specified filter in the
   353  	// request.
   354  	Operations []*Operation `json:"operations,omitempty"`
   355  
   356  	// ServerResponse contains the HTTP response code and headers from the server.
   357  	googleapi.ServerResponse `json:"-"`
   358  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   359  	// unconditionally include in API requests. By default, fields with empty or
   360  	// default values are omitted from API requests. See
   361  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   362  	// details.
   363  	ForceSendFields []string `json:"-"`
   364  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   365  	// requests with the JSON null value. By default, fields with empty values are
   366  	// omitted from API requests. See
   367  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   368  	NullFields []string `json:"-"`
   369  }
   370  
   371  func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
   372  	type NoMethod ListOperationsResponse
   373  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   374  }
   375  
   376  // ListTensorFlowVersionsResponse: Response for ListTensorFlowVersions.
   377  type ListTensorFlowVersionsResponse struct {
   378  	// NextPageToken: The next page token or empty if none.
   379  	NextPageToken string `json:"nextPageToken,omitempty"`
   380  	// TensorflowVersions: The listed nodes.
   381  	TensorflowVersions []*TensorFlowVersion `json:"tensorflowVersions,omitempty"`
   382  	// Unreachable: Locations that could not be reached.
   383  	Unreachable []string `json:"unreachable,omitempty"`
   384  
   385  	// ServerResponse contains the HTTP response code and headers from the server.
   386  	googleapi.ServerResponse `json:"-"`
   387  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   388  	// unconditionally include in API requests. By default, fields with empty or
   389  	// default values are omitted from API requests. See
   390  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   391  	// details.
   392  	ForceSendFields []string `json:"-"`
   393  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   394  	// requests with the JSON null value. By default, fields with empty values are
   395  	// omitted from API requests. See
   396  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   397  	NullFields []string `json:"-"`
   398  }
   399  
   400  func (s *ListTensorFlowVersionsResponse) MarshalJSON() ([]byte, error) {
   401  	type NoMethod ListTensorFlowVersionsResponse
   402  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   403  }
   404  
   405  // Location: A resource that represents a Google Cloud location.
   406  type Location struct {
   407  	// DisplayName: The friendly name for this location, typically a nearby city
   408  	// name. For example, "Tokyo".
   409  	DisplayName string `json:"displayName,omitempty"`
   410  	// Labels: Cross-service attributes for the location. For example
   411  	// {"cloud.googleapis.com/region": "us-east1"}
   412  	Labels map[string]string `json:"labels,omitempty"`
   413  	// LocationId: The canonical id for this location. For example: "us-east1".
   414  	LocationId string `json:"locationId,omitempty"`
   415  	// Metadata: Service-specific metadata. For example the available capacity at
   416  	// the given location.
   417  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   418  	// Name: Resource name for the location, which may vary between
   419  	// implementations. For example:
   420  	// "projects/example-project/locations/us-east1"
   421  	Name string `json:"name,omitempty"`
   422  
   423  	// ServerResponse contains the HTTP response code and headers from the server.
   424  	googleapi.ServerResponse `json:"-"`
   425  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   426  	// unconditionally include in API requests. By default, fields with empty or
   427  	// default values are omitted from API requests. See
   428  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   429  	// details.
   430  	ForceSendFields []string `json:"-"`
   431  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
   432  	// requests with the JSON null value. By default, fields with empty values are
   433  	// omitted from API requests. See
   434  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   435  	NullFields []string `json:"-"`
   436  }
   437  
   438  func (s *Location) MarshalJSON() ([]byte, error) {
   439  	type NoMethod Location
   440  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   441  }
   442  
   443  // NetworkEndpoint: A network endpoint over which a TPU worker can be reached.
   444  type NetworkEndpoint struct {
   445  	// IpAddress: The IP address of this network endpoint.
   446  	IpAddress string `json:"ipAddress,omitempty"`
   447  	// Port: The port of this network endpoint.
   448  	Port int64 `json:"port,omitempty"`
   449  	// ForceSendFields is a list of field names (e.g. "IpAddress") to
   450  	// unconditionally include in API requests. By default, fields with empty or
   451  	// default values are omitted from API requests. See
   452  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   453  	// details.
   454  	ForceSendFields []string `json:"-"`
   455  	// NullFields is a list of field names (e.g. "IpAddress") to include in API
   456  	// requests with the JSON null value. By default, fields with empty values are
   457  	// omitted from API requests. See
   458  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   459  	NullFields []string `json:"-"`
   460  }
   461  
   462  func (s *NetworkEndpoint) MarshalJSON() ([]byte, error) {
   463  	type NoMethod NetworkEndpoint
   464  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   465  }
   466  
   467  // Node: A TPU instance.
   468  type Node struct {
   469  	// AcceleratorType: Required. The type of hardware accelerators associated with
   470  	// this node.
   471  	AcceleratorType string `json:"acceleratorType,omitempty"`
   472  	// ApiVersion: Output only. The API version that created this Node.
   473  	//
   474  	// Possible values:
   475  	//   "API_VERSION_UNSPECIFIED" - API version is unknown.
   476  	//   "V1_ALPHA1" - TPU API V1Alpha1 version.
   477  	//   "V1" - TPU API V1 version.
   478  	//   "V2_ALPHA1" - TPU API V2Alpha1 version.
   479  	ApiVersion string `json:"apiVersion,omitempty"`
   480  	// CidrBlock: The CIDR block that the TPU node will use when selecting an IP
   481  	// address. This CIDR block must be a /29 block; the Compute Engine networks
   482  	// API forbids a smaller block, and using a larger block would be wasteful (a
   483  	// node can only consume one IP address). Errors will occur if the CIDR block
   484  	// has already been used for a currently existing TPU node, the CIDR block
   485  	// conflicts with any subnetworks in the user's provided network, or the
   486  	// provided network is peered with another network that is using that CIDR
   487  	// block.
   488  	CidrBlock string `json:"cidrBlock,omitempty"`
   489  	// CreateTime: Output only. The time when the node was created.
   490  	CreateTime string `json:"createTime,omitempty"`
   491  	// Description: The user-supplied description of the TPU. Maximum of 512
   492  	// characters.
   493  	Description string `json:"description,omitempty"`
   494  	// Health: The health status of the TPU node.
   495  	//
   496  	// Possible values:
   497  	//   "HEALTH_UNSPECIFIED" - Health status is unknown: not initialized or failed
   498  	// to retrieve.
   499  	//   "HEALTHY" - The resource is healthy.
   500  	//   "DEPRECATED_UNHEALTHY" - The resource is unhealthy.
   501  	//   "TIMEOUT" - The resource is unresponsive.
   502  	//   "UNHEALTHY_TENSORFLOW" - The in-guest ML stack is unhealthy.
   503  	//   "UNHEALTHY_MAINTENANCE" - The node is under maintenance/priority boost
   504  	// caused rescheduling and will resume running once rescheduled.
   505  	Health string `json:"health,omitempty"`
   506  	// HealthDescription: Output only. If this field is populated, it contains a
   507  	// description of why the TPU Node is unhealthy.
   508  	HealthDescription string `json:"healthDescription,omitempty"`
   509  	// IpAddress: Output only. DEPRECATED! Use network_endpoints instead. The
   510  	// network address for the TPU Node as visible to Compute Engine instances.
   511  	IpAddress string `json:"ipAddress,omitempty"`
   512  	// Labels: Resource labels to represent user-provided metadata.
   513  	Labels map[string]string `json:"labels,omitempty"`
   514  	// Name: Output only. Immutable. The name of the TPU
   515  	Name string `json:"name,omitempty"`
   516  	// Network: The name of a network they wish to peer the TPU node to. It must be
   517  	// a preexisting Compute Engine network inside of the project on which this API
   518  	// has been activated. If none is provided, "default" will be used.
   519  	Network string `json:"network,omitempty"`
   520  	// NetworkEndpoints: Output only. The network endpoints where TPU workers can
   521  	// be accessed and sent work. It is recommended that Tensorflow clients of the
   522  	// node reach out to the 0th entry in this map first.
   523  	NetworkEndpoints []*NetworkEndpoint `json:"networkEndpoints,omitempty"`
   524  	// Port: Output only. DEPRECATED! Use network_endpoints instead. The network
   525  	// port for the TPU Node as visible to Compute Engine instances.
   526  	Port string `json:"port,omitempty"`
   527  	// SchedulingConfig: The scheduling options for this node.
   528  	SchedulingConfig *SchedulingConfig `json:"schedulingConfig,omitempty"`
   529  	// ServiceAccount: Output only. The service account used to run the tensor flow
   530  	// services within the node. To share resources, including Google Cloud Storage
   531  	// data, with the Tensorflow job running in the Node, this account must have
   532  	// permissions to that data.
   533  	ServiceAccount string `json:"serviceAccount,omitempty"`
   534  	// State: Output only. The current state for the TPU Node.
   535  	//
   536  	// Possible values:
   537  	//   "STATE_UNSPECIFIED" - TPU node state is not known/set.
   538  	//   "CREATING" - TPU node is being created.
   539  	//   "READY" - TPU node has been created.
   540  	//   "RESTARTING" - TPU node is restarting.
   541  	//   "REIMAGING" - TPU node is undergoing reimaging.
   542  	//   "DELETING" - TPU node is being deleted.
   543  	//   "REPAIRING" - TPU node is being repaired and may be unusable. Details can
   544  	// be found in the `help_description` field.
   545  	//   "STOPPED" - TPU node is stopped.
   546  	//   "STOPPING" - TPU node is currently stopping.
   547  	//   "STARTING" - TPU node is currently starting.
   548  	//   "PREEMPTED" - TPU node has been preempted. Only applies to Preemptible TPU
   549  	// Nodes.
   550  	//   "TERMINATED" - TPU node has been terminated due to maintenance or has
   551  	// reached the end of its life cycle (for preemptible nodes).
   552  	//   "HIDING" - TPU node is currently hiding.
   553  	//   "HIDDEN" - TPU node has been hidden.
   554  	//   "UNHIDING" - TPU node is currently unhiding.
   555  	State string `json:"state,omitempty"`
   556  	// Symptoms: Output only. The Symptoms that have occurred to the TPU Node.
   557  	Symptoms []*Symptom `json:"symptoms,omitempty"`
   558  	// TensorflowVersion: Required. The version of Tensorflow running in the Node.
   559  	TensorflowVersion string `json:"tensorflowVersion,omitempty"`
   560  	// UseServiceNetworking: Whether the VPC peering for the node is set up through
   561  	// Service Networking API. The VPC Peering should be set up before provisioning
   562  	// the node. If this field is set, cidr_block field should not be specified. If
   563  	// the network, that you want to peer the TPU Node to, is Shared VPC networks,
   564  	// the node must be created with this this field enabled.
   565  	UseServiceNetworking bool `json:"useServiceNetworking,omitempty"`
   566  
   567  	// ServerResponse contains the HTTP response code and headers from the server.
   568  	googleapi.ServerResponse `json:"-"`
   569  	// ForceSendFields is a list of field names (e.g. "AcceleratorType") to
   570  	// unconditionally include in API requests. By default, fields with empty or
   571  	// default values are omitted from API requests. See
   572  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   573  	// details.
   574  	ForceSendFields []string `json:"-"`
   575  	// NullFields is a list of field names (e.g. "AcceleratorType") to include in
   576  	// API requests with the JSON null value. By default, fields with empty values
   577  	// are omitted from API requests. See
   578  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   579  	NullFields []string `json:"-"`
   580  }
   581  
   582  func (s *Node) MarshalJSON() ([]byte, error) {
   583  	type NoMethod Node
   584  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   585  }
   586  
   587  // Operation: This resource represents a long-running operation that is the
   588  // result of a network API call.
   589  type Operation struct {
   590  	// Done: If the value is `false`, it means the operation is still in progress.
   591  	// If `true`, the operation is completed, and either `error` or `response` is
   592  	// available.
   593  	Done bool `json:"done,omitempty"`
   594  	// Error: The error result of the operation in case of failure or cancellation.
   595  	Error *Status `json:"error,omitempty"`
   596  	// Metadata: Service-specific metadata associated with the operation. It
   597  	// typically contains progress information and common metadata such as create
   598  	// time. Some services might not provide such metadata. Any method that returns
   599  	// a long-running operation should document the metadata type, if any.
   600  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   601  	// Name: The server-assigned name, which is only unique within the same service
   602  	// that originally returns it. If you use the default HTTP mapping, the `name`
   603  	// should be a resource name ending with `operations/{unique_id}`.
   604  	Name string `json:"name,omitempty"`
   605  	// Response: The normal, successful response of the operation. If the original
   606  	// method returns no data on success, such as `Delete`, the response is
   607  	// `google.protobuf.Empty`. If the original method is standard
   608  	// `Get`/`Create`/`Update`, the response should be the resource. For other
   609  	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
   610  	// original method name. For example, if the original method name is
   611  	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
   612  	Response googleapi.RawMessage `json:"response,omitempty"`
   613  
   614  	// ServerResponse contains the HTTP response code and headers from the server.
   615  	googleapi.ServerResponse `json:"-"`
   616  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
   617  	// include in API requests. By default, fields with empty or default values are
   618  	// omitted from API requests. See
   619  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   620  	// details.
   621  	ForceSendFields []string `json:"-"`
   622  	// NullFields is a list of field names (e.g. "Done") to include in API requests
   623  	// with the JSON null value. By default, fields with empty values are omitted
   624  	// from API requests. See
   625  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   626  	NullFields []string `json:"-"`
   627  }
   628  
   629  func (s *Operation) MarshalJSON() ([]byte, error) {
   630  	type NoMethod Operation
   631  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   632  }
   633  
   634  // OperationMetadata: Metadata describing an Operation
   635  type OperationMetadata struct {
   636  	// ApiVersion: API version.
   637  	ApiVersion string `json:"apiVersion,omitempty"`
   638  	// CancelRequested: Specifies if cancellation was requested for the operation.
   639  	CancelRequested bool `json:"cancelRequested,omitempty"`
   640  	// CreateTime: The time the operation was created.
   641  	CreateTime string `json:"createTime,omitempty"`
   642  	// EndTime: The time the operation finished running.
   643  	EndTime string `json:"endTime,omitempty"`
   644  	// StatusDetail: Human-readable status of the operation, if any.
   645  	StatusDetail string `json:"statusDetail,omitempty"`
   646  	// Target: Target of the operation - for example
   647  	// projects/project-1/connectivityTests/test-1
   648  	Target string `json:"target,omitempty"`
   649  	// Verb: Name of the verb executed by the operation.
   650  	Verb string `json:"verb,omitempty"`
   651  	// ForceSendFields is a list of field names (e.g. "ApiVersion") to
   652  	// unconditionally include in API requests. By default, fields with empty or
   653  	// default values are omitted from API requests. See
   654  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   655  	// details.
   656  	ForceSendFields []string `json:"-"`
   657  	// NullFields is a list of field names (e.g. "ApiVersion") to include in API
   658  	// requests with the JSON null value. By default, fields with empty values are
   659  	// omitted from API requests. See
   660  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   661  	NullFields []string `json:"-"`
   662  }
   663  
   664  func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
   665  	type NoMethod OperationMetadata
   666  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   667  }
   668  
   669  // ReimageNodeRequest: Request for ReimageNode.
   670  type ReimageNodeRequest struct {
   671  	// TensorflowVersion: The version for reimage to create.
   672  	TensorflowVersion string `json:"tensorflowVersion,omitempty"`
   673  	// ForceSendFields is a list of field names (e.g. "TensorflowVersion") to
   674  	// unconditionally include in API requests. By default, fields with empty or
   675  	// default values are omitted from API requests. See
   676  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   677  	// details.
   678  	ForceSendFields []string `json:"-"`
   679  	// NullFields is a list of field names (e.g. "TensorflowVersion") to include in
   680  	// API requests with the JSON null value. By default, fields with empty values
   681  	// are omitted from API requests. See
   682  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   683  	NullFields []string `json:"-"`
   684  }
   685  
   686  func (s *ReimageNodeRequest) MarshalJSON() ([]byte, error) {
   687  	type NoMethod ReimageNodeRequest
   688  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   689  }
   690  
   691  // SchedulingConfig: Sets the scheduling options for this node.
   692  type SchedulingConfig struct {
   693  	// Preemptible: Defines whether the node is preemptible.
   694  	Preemptible bool `json:"preemptible,omitempty"`
   695  	// Reserved: Whether the node is created under a reservation.
   696  	Reserved bool `json:"reserved,omitempty"`
   697  	// ForceSendFields is a list of field names (e.g. "Preemptible") to
   698  	// unconditionally include in API requests. By default, fields with empty or
   699  	// default values are omitted from API requests. See
   700  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   701  	// details.
   702  	ForceSendFields []string `json:"-"`
   703  	// NullFields is a list of field names (e.g. "Preemptible") to include in API
   704  	// requests with the JSON null value. By default, fields with empty values are
   705  	// omitted from API requests. See
   706  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   707  	NullFields []string `json:"-"`
   708  }
   709  
   710  func (s *SchedulingConfig) MarshalJSON() ([]byte, error) {
   711  	type NoMethod SchedulingConfig
   712  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   713  }
   714  
   715  // StartNodeRequest: Request for StartNode.
   716  type StartNodeRequest struct {
   717  }
   718  
   719  // Status: The `Status` type defines a logical error model that is suitable for
   720  // different programming environments, including REST APIs and RPC APIs. It is
   721  // used by gRPC (https://github.com/grpc). Each `Status` message contains three
   722  // pieces of data: error code, error message, and error details. You can find
   723  // out more about this error model and how to work with it in the API Design
   724  // Guide (https://cloud.google.com/apis/design/errors).
   725  type Status struct {
   726  	// Code: The status code, which should be an enum value of google.rpc.Code.
   727  	Code int64 `json:"code,omitempty"`
   728  	// Details: A list of messages that carry the error details. There is a common
   729  	// set of message types for APIs to use.
   730  	Details []googleapi.RawMessage `json:"details,omitempty"`
   731  	// Message: A developer-facing error message, which should be in English. Any
   732  	// user-facing error message should be localized and sent in the
   733  	// google.rpc.Status.details field, or localized by the client.
   734  	Message string `json:"message,omitempty"`
   735  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
   736  	// include in API requests. By default, fields with empty or default values are
   737  	// omitted from API requests. See
   738  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   739  	// details.
   740  	ForceSendFields []string `json:"-"`
   741  	// NullFields is a list of field names (e.g. "Code") to include in API requests
   742  	// with the JSON null value. By default, fields with empty values are omitted
   743  	// from API requests. See
   744  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   745  	NullFields []string `json:"-"`
   746  }
   747  
   748  func (s *Status) MarshalJSON() ([]byte, error) {
   749  	type NoMethod Status
   750  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   751  }
   752  
   753  // StopNodeRequest: Request for StopNode.
   754  type StopNodeRequest struct {
   755  }
   756  
   757  // Symptom: A Symptom instance.
   758  type Symptom struct {
   759  	// CreateTime: Timestamp when the Symptom is created.
   760  	CreateTime string `json:"createTime,omitempty"`
   761  	// Details: Detailed information of the current Symptom.
   762  	Details string `json:"details,omitempty"`
   763  	// SymptomType: Type of the Symptom.
   764  	//
   765  	// Possible values:
   766  	//   "SYMPTOM_TYPE_UNSPECIFIED" - Unspecified symptom.
   767  	//   "LOW_MEMORY" - TPU VM memory is low.
   768  	//   "OUT_OF_MEMORY" - TPU runtime is out of memory.
   769  	//   "EXECUTE_TIMED_OUT" - TPU runtime execution has timed out.
   770  	//   "MESH_BUILD_FAIL" - TPU runtime fails to construct a mesh that recognizes
   771  	// each TPU device's neighbors.
   772  	//   "HBM_OUT_OF_MEMORY" - TPU HBM is out of memory.
   773  	//   "PROJECT_ABUSE" - Abusive behaviors have been identified on the current
   774  	// project.
   775  	SymptomType string `json:"symptomType,omitempty"`
   776  	// WorkerId: A string used to uniquely distinguish a worker within a TPU node.
   777  	WorkerId string `json:"workerId,omitempty"`
   778  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   779  	// unconditionally include in API requests. By default, fields with empty or
   780  	// default values are omitted from API requests. See
   781  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   782  	// details.
   783  	ForceSendFields []string `json:"-"`
   784  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   785  	// requests with the JSON null value. By default, fields with empty values are
   786  	// omitted from API requests. See
   787  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   788  	NullFields []string `json:"-"`
   789  }
   790  
   791  func (s *Symptom) MarshalJSON() ([]byte, error) {
   792  	type NoMethod Symptom
   793  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   794  }
   795  
   796  // TensorFlowVersion: A tensorflow version that a Node can be configured with.
   797  type TensorFlowVersion struct {
   798  	// Name: The resource name.
   799  	Name string `json:"name,omitempty"`
   800  	// Version: the tensorflow version.
   801  	Version string `json:"version,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. "Name") to unconditionally
   806  	// include in API requests. By default, fields with empty or default values are
   807  	// 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. "Name") to include in API requests
   812  	// with the JSON null value. By default, fields with empty values are omitted
   813  	// 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 *TensorFlowVersion) MarshalJSON() ([]byte, error) {
   819  	type NoMethod TensorFlowVersion
   820  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   821  }
   822  
   823  type ProjectsLocationsGetCall struct {
   824  	s            *Service
   825  	name         string
   826  	urlParams_   gensupport.URLParams
   827  	ifNoneMatch_ string
   828  	ctx_         context.Context
   829  	header_      http.Header
   830  }
   831  
   832  // Get: Gets information about a location.
   833  //
   834  // - name: Resource name for the location.
   835  func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
   836  	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   837  	c.name = name
   838  	return c
   839  }
   840  
   841  // Fields allows partial responses to be retrieved. See
   842  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   843  // details.
   844  func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
   845  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   846  	return c
   847  }
   848  
   849  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   850  // object's ETag matches the given value. This is useful for getting updates
   851  // only after the object has changed since the last request.
   852  func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
   853  	c.ifNoneMatch_ = entityTag
   854  	return c
   855  }
   856  
   857  // Context sets the context to be used in this call's Do method.
   858  func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
   859  	c.ctx_ = ctx
   860  	return c
   861  }
   862  
   863  // Header returns a http.Header that can be modified by the caller to add
   864  // headers to the request.
   865  func (c *ProjectsLocationsGetCall) Header() http.Header {
   866  	if c.header_ == nil {
   867  		c.header_ = make(http.Header)
   868  	}
   869  	return c.header_
   870  }
   871  
   872  func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
   873  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   874  	if c.ifNoneMatch_ != "" {
   875  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   876  	}
   877  	var body io.Reader = nil
   878  	c.urlParams_.Set("alt", alt)
   879  	c.urlParams_.Set("prettyPrint", "false")
   880  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
   881  	urls += "?" + c.urlParams_.Encode()
   882  	req, err := http.NewRequest("GET", urls, body)
   883  	if err != nil {
   884  		return nil, err
   885  	}
   886  	req.Header = reqHeaders
   887  	googleapi.Expand(req.URL, map[string]string{
   888  		"name": c.name,
   889  	})
   890  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   891  }
   892  
   893  // Do executes the "tpu.projects.locations.get" call.
   894  // Any non-2xx status code is an error. Response headers are in either
   895  // *Location.ServerResponse.Header or (if a response was returned at all) in
   896  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   897  // whether the returned error was because http.StatusNotModified was returned.
   898  func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
   899  	gensupport.SetOptions(c.urlParams_, opts...)
   900  	res, err := c.doRequest("json")
   901  	if res != nil && res.StatusCode == http.StatusNotModified {
   902  		if res.Body != nil {
   903  			res.Body.Close()
   904  		}
   905  		return nil, gensupport.WrapError(&googleapi.Error{
   906  			Code:   res.StatusCode,
   907  			Header: res.Header,
   908  		})
   909  	}
   910  	if err != nil {
   911  		return nil, err
   912  	}
   913  	defer googleapi.CloseBody(res)
   914  	if err := googleapi.CheckResponse(res); err != nil {
   915  		return nil, gensupport.WrapError(err)
   916  	}
   917  	ret := &Location{
   918  		ServerResponse: googleapi.ServerResponse{
   919  			Header:         res.Header,
   920  			HTTPStatusCode: res.StatusCode,
   921  		},
   922  	}
   923  	target := &ret
   924  	if err := gensupport.DecodeResponse(target, res); err != nil {
   925  		return nil, err
   926  	}
   927  	return ret, nil
   928  }
   929  
   930  type ProjectsLocationsListCall struct {
   931  	s            *Service
   932  	name         string
   933  	urlParams_   gensupport.URLParams
   934  	ifNoneMatch_ string
   935  	ctx_         context.Context
   936  	header_      http.Header
   937  }
   938  
   939  // List: Lists information about the supported locations for this service.
   940  //
   941  // - name: The resource that owns the locations collection, if applicable.
   942  func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
   943  	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   944  	c.name = name
   945  	return c
   946  }
   947  
   948  // Filter sets the optional parameter "filter": A filter to narrow down results
   949  // to a preferred subset. The filtering language accepts strings like
   950  // "displayName=tokyo", and is documented in more detail in AIP-160
   951  // (https://google.aip.dev/160).
   952  func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
   953  	c.urlParams_.Set("filter", filter)
   954  	return c
   955  }
   956  
   957  // PageSize sets the optional parameter "pageSize": The maximum number of
   958  // results to return. If not set, the service selects a default.
   959  func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
   960  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   961  	return c
   962  }
   963  
   964  // PageToken sets the optional parameter "pageToken": A page token received
   965  // from the `next_page_token` field in the response. Send that page token to
   966  // receive the subsequent page.
   967  func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
   968  	c.urlParams_.Set("pageToken", pageToken)
   969  	return c
   970  }
   971  
   972  // Fields allows partial responses to be retrieved. See
   973  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   974  // details.
   975  func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
   976  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   977  	return c
   978  }
   979  
   980  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   981  // object's ETag matches the given value. This is useful for getting updates
   982  // only after the object has changed since the last request.
   983  func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
   984  	c.ifNoneMatch_ = entityTag
   985  	return c
   986  }
   987  
   988  // Context sets the context to be used in this call's Do method.
   989  func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
   990  	c.ctx_ = ctx
   991  	return c
   992  }
   993  
   994  // Header returns a http.Header that can be modified by the caller to add
   995  // headers to the request.
   996  func (c *ProjectsLocationsListCall) Header() http.Header {
   997  	if c.header_ == nil {
   998  		c.header_ = make(http.Header)
   999  	}
  1000  	return c.header_
  1001  }
  1002  
  1003  func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  1004  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1005  	if c.ifNoneMatch_ != "" {
  1006  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1007  	}
  1008  	var body io.Reader = nil
  1009  	c.urlParams_.Set("alt", alt)
  1010  	c.urlParams_.Set("prettyPrint", "false")
  1011  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/locations")
  1012  	urls += "?" + c.urlParams_.Encode()
  1013  	req, err := http.NewRequest("GET", urls, body)
  1014  	if err != nil {
  1015  		return nil, err
  1016  	}
  1017  	req.Header = reqHeaders
  1018  	googleapi.Expand(req.URL, map[string]string{
  1019  		"name": c.name,
  1020  	})
  1021  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1022  }
  1023  
  1024  // Do executes the "tpu.projects.locations.list" call.
  1025  // Any non-2xx status code is an error. Response headers are in either
  1026  // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
  1027  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1028  // check whether the returned error was because http.StatusNotModified was
  1029  // returned.
  1030  func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
  1031  	gensupport.SetOptions(c.urlParams_, opts...)
  1032  	res, err := c.doRequest("json")
  1033  	if res != nil && res.StatusCode == http.StatusNotModified {
  1034  		if res.Body != nil {
  1035  			res.Body.Close()
  1036  		}
  1037  		return nil, gensupport.WrapError(&googleapi.Error{
  1038  			Code:   res.StatusCode,
  1039  			Header: res.Header,
  1040  		})
  1041  	}
  1042  	if err != nil {
  1043  		return nil, err
  1044  	}
  1045  	defer googleapi.CloseBody(res)
  1046  	if err := googleapi.CheckResponse(res); err != nil {
  1047  		return nil, gensupport.WrapError(err)
  1048  	}
  1049  	ret := &ListLocationsResponse{
  1050  		ServerResponse: googleapi.ServerResponse{
  1051  			Header:         res.Header,
  1052  			HTTPStatusCode: res.StatusCode,
  1053  		},
  1054  	}
  1055  	target := &ret
  1056  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1057  		return nil, err
  1058  	}
  1059  	return ret, nil
  1060  }
  1061  
  1062  // Pages invokes f for each page of results.
  1063  // A non-nil error returned from f will halt the iteration.
  1064  // The provided context supersedes any context provided to the Context method.
  1065  func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
  1066  	c.ctx_ = ctx
  1067  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1068  	for {
  1069  		x, err := c.Do()
  1070  		if err != nil {
  1071  			return err
  1072  		}
  1073  		if err := f(x); err != nil {
  1074  			return err
  1075  		}
  1076  		if x.NextPageToken == "" {
  1077  			return nil
  1078  		}
  1079  		c.PageToken(x.NextPageToken)
  1080  	}
  1081  }
  1082  
  1083  type ProjectsLocationsAcceleratorTypesGetCall struct {
  1084  	s            *Service
  1085  	name         string
  1086  	urlParams_   gensupport.URLParams
  1087  	ifNoneMatch_ string
  1088  	ctx_         context.Context
  1089  	header_      http.Header
  1090  }
  1091  
  1092  // Get: Gets AcceleratorType.
  1093  //
  1094  // - name: The resource name.
  1095  func (r *ProjectsLocationsAcceleratorTypesService) Get(name string) *ProjectsLocationsAcceleratorTypesGetCall {
  1096  	c := &ProjectsLocationsAcceleratorTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1097  	c.name = name
  1098  	return c
  1099  }
  1100  
  1101  // Fields allows partial responses to be retrieved. See
  1102  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1103  // details.
  1104  func (c *ProjectsLocationsAcceleratorTypesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsAcceleratorTypesGetCall {
  1105  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1106  	return c
  1107  }
  1108  
  1109  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1110  // object's ETag matches the given value. This is useful for getting updates
  1111  // only after the object has changed since the last request.
  1112  func (c *ProjectsLocationsAcceleratorTypesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsAcceleratorTypesGetCall {
  1113  	c.ifNoneMatch_ = entityTag
  1114  	return c
  1115  }
  1116  
  1117  // Context sets the context to be used in this call's Do method.
  1118  func (c *ProjectsLocationsAcceleratorTypesGetCall) Context(ctx context.Context) *ProjectsLocationsAcceleratorTypesGetCall {
  1119  	c.ctx_ = ctx
  1120  	return c
  1121  }
  1122  
  1123  // Header returns a http.Header that can be modified by the caller to add
  1124  // headers to the request.
  1125  func (c *ProjectsLocationsAcceleratorTypesGetCall) Header() http.Header {
  1126  	if c.header_ == nil {
  1127  		c.header_ = make(http.Header)
  1128  	}
  1129  	return c.header_
  1130  }
  1131  
  1132  func (c *ProjectsLocationsAcceleratorTypesGetCall) doRequest(alt string) (*http.Response, error) {
  1133  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1134  	if c.ifNoneMatch_ != "" {
  1135  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1136  	}
  1137  	var body io.Reader = nil
  1138  	c.urlParams_.Set("alt", alt)
  1139  	c.urlParams_.Set("prettyPrint", "false")
  1140  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  1141  	urls += "?" + c.urlParams_.Encode()
  1142  	req, err := http.NewRequest("GET", urls, body)
  1143  	if err != nil {
  1144  		return nil, err
  1145  	}
  1146  	req.Header = reqHeaders
  1147  	googleapi.Expand(req.URL, map[string]string{
  1148  		"name": c.name,
  1149  	})
  1150  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1151  }
  1152  
  1153  // Do executes the "tpu.projects.locations.acceleratorTypes.get" call.
  1154  // Any non-2xx status code is an error. Response headers are in either
  1155  // *AcceleratorType.ServerResponse.Header or (if a response was returned at
  1156  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1157  // check whether the returned error was because http.StatusNotModified was
  1158  // returned.
  1159  func (c *ProjectsLocationsAcceleratorTypesGetCall) Do(opts ...googleapi.CallOption) (*AcceleratorType, error) {
  1160  	gensupport.SetOptions(c.urlParams_, opts...)
  1161  	res, err := c.doRequest("json")
  1162  	if res != nil && res.StatusCode == http.StatusNotModified {
  1163  		if res.Body != nil {
  1164  			res.Body.Close()
  1165  		}
  1166  		return nil, gensupport.WrapError(&googleapi.Error{
  1167  			Code:   res.StatusCode,
  1168  			Header: res.Header,
  1169  		})
  1170  	}
  1171  	if err != nil {
  1172  		return nil, err
  1173  	}
  1174  	defer googleapi.CloseBody(res)
  1175  	if err := googleapi.CheckResponse(res); err != nil {
  1176  		return nil, gensupport.WrapError(err)
  1177  	}
  1178  	ret := &AcceleratorType{
  1179  		ServerResponse: googleapi.ServerResponse{
  1180  			Header:         res.Header,
  1181  			HTTPStatusCode: res.StatusCode,
  1182  		},
  1183  	}
  1184  	target := &ret
  1185  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1186  		return nil, err
  1187  	}
  1188  	return ret, nil
  1189  }
  1190  
  1191  type ProjectsLocationsAcceleratorTypesListCall struct {
  1192  	s            *Service
  1193  	parent       string
  1194  	urlParams_   gensupport.URLParams
  1195  	ifNoneMatch_ string
  1196  	ctx_         context.Context
  1197  	header_      http.Header
  1198  }
  1199  
  1200  // List: Lists accelerator types supported by this API.
  1201  //
  1202  // - parent: The parent resource name.
  1203  func (r *ProjectsLocationsAcceleratorTypesService) List(parent string) *ProjectsLocationsAcceleratorTypesListCall {
  1204  	c := &ProjectsLocationsAcceleratorTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1205  	c.parent = parent
  1206  	return c
  1207  }
  1208  
  1209  // Filter sets the optional parameter "filter": List filter.
  1210  func (c *ProjectsLocationsAcceleratorTypesListCall) Filter(filter string) *ProjectsLocationsAcceleratorTypesListCall {
  1211  	c.urlParams_.Set("filter", filter)
  1212  	return c
  1213  }
  1214  
  1215  // OrderBy sets the optional parameter "orderBy": Sort results.
  1216  func (c *ProjectsLocationsAcceleratorTypesListCall) OrderBy(orderBy string) *ProjectsLocationsAcceleratorTypesListCall {
  1217  	c.urlParams_.Set("orderBy", orderBy)
  1218  	return c
  1219  }
  1220  
  1221  // PageSize sets the optional parameter "pageSize": The maximum number of items
  1222  // to return.
  1223  func (c *ProjectsLocationsAcceleratorTypesListCall) PageSize(pageSize int64) *ProjectsLocationsAcceleratorTypesListCall {
  1224  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1225  	return c
  1226  }
  1227  
  1228  // PageToken sets the optional parameter "pageToken": The next_page_token value
  1229  // returned from a previous List request, if any.
  1230  func (c *ProjectsLocationsAcceleratorTypesListCall) PageToken(pageToken string) *ProjectsLocationsAcceleratorTypesListCall {
  1231  	c.urlParams_.Set("pageToken", pageToken)
  1232  	return c
  1233  }
  1234  
  1235  // Fields allows partial responses to be retrieved. See
  1236  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1237  // details.
  1238  func (c *ProjectsLocationsAcceleratorTypesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsAcceleratorTypesListCall {
  1239  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1240  	return c
  1241  }
  1242  
  1243  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1244  // object's ETag matches the given value. This is useful for getting updates
  1245  // only after the object has changed since the last request.
  1246  func (c *ProjectsLocationsAcceleratorTypesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsAcceleratorTypesListCall {
  1247  	c.ifNoneMatch_ = entityTag
  1248  	return c
  1249  }
  1250  
  1251  // Context sets the context to be used in this call's Do method.
  1252  func (c *ProjectsLocationsAcceleratorTypesListCall) Context(ctx context.Context) *ProjectsLocationsAcceleratorTypesListCall {
  1253  	c.ctx_ = ctx
  1254  	return c
  1255  }
  1256  
  1257  // Header returns a http.Header that can be modified by the caller to add
  1258  // headers to the request.
  1259  func (c *ProjectsLocationsAcceleratorTypesListCall) Header() http.Header {
  1260  	if c.header_ == nil {
  1261  		c.header_ = make(http.Header)
  1262  	}
  1263  	return c.header_
  1264  }
  1265  
  1266  func (c *ProjectsLocationsAcceleratorTypesListCall) doRequest(alt string) (*http.Response, error) {
  1267  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1268  	if c.ifNoneMatch_ != "" {
  1269  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1270  	}
  1271  	var body io.Reader = nil
  1272  	c.urlParams_.Set("alt", alt)
  1273  	c.urlParams_.Set("prettyPrint", "false")
  1274  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/acceleratorTypes")
  1275  	urls += "?" + c.urlParams_.Encode()
  1276  	req, err := http.NewRequest("GET", urls, body)
  1277  	if err != nil {
  1278  		return nil, err
  1279  	}
  1280  	req.Header = reqHeaders
  1281  	googleapi.Expand(req.URL, map[string]string{
  1282  		"parent": c.parent,
  1283  	})
  1284  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1285  }
  1286  
  1287  // Do executes the "tpu.projects.locations.acceleratorTypes.list" call.
  1288  // Any non-2xx status code is an error. Response headers are in either
  1289  // *ListAcceleratorTypesResponse.ServerResponse.Header or (if a response was
  1290  // returned at all) in error.(*googleapi.Error).Header. Use
  1291  // googleapi.IsNotModified to check whether the returned error was because
  1292  // http.StatusNotModified was returned.
  1293  func (c *ProjectsLocationsAcceleratorTypesListCall) Do(opts ...googleapi.CallOption) (*ListAcceleratorTypesResponse, error) {
  1294  	gensupport.SetOptions(c.urlParams_, opts...)
  1295  	res, err := c.doRequest("json")
  1296  	if res != nil && res.StatusCode == http.StatusNotModified {
  1297  		if res.Body != nil {
  1298  			res.Body.Close()
  1299  		}
  1300  		return nil, gensupport.WrapError(&googleapi.Error{
  1301  			Code:   res.StatusCode,
  1302  			Header: res.Header,
  1303  		})
  1304  	}
  1305  	if err != nil {
  1306  		return nil, err
  1307  	}
  1308  	defer googleapi.CloseBody(res)
  1309  	if err := googleapi.CheckResponse(res); err != nil {
  1310  		return nil, gensupport.WrapError(err)
  1311  	}
  1312  	ret := &ListAcceleratorTypesResponse{
  1313  		ServerResponse: googleapi.ServerResponse{
  1314  			Header:         res.Header,
  1315  			HTTPStatusCode: res.StatusCode,
  1316  		},
  1317  	}
  1318  	target := &ret
  1319  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1320  		return nil, err
  1321  	}
  1322  	return ret, nil
  1323  }
  1324  
  1325  // Pages invokes f for each page of results.
  1326  // A non-nil error returned from f will halt the iteration.
  1327  // The provided context supersedes any context provided to the Context method.
  1328  func (c *ProjectsLocationsAcceleratorTypesListCall) Pages(ctx context.Context, f func(*ListAcceleratorTypesResponse) error) error {
  1329  	c.ctx_ = ctx
  1330  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1331  	for {
  1332  		x, err := c.Do()
  1333  		if err != nil {
  1334  			return err
  1335  		}
  1336  		if err := f(x); err != nil {
  1337  			return err
  1338  		}
  1339  		if x.NextPageToken == "" {
  1340  			return nil
  1341  		}
  1342  		c.PageToken(x.NextPageToken)
  1343  	}
  1344  }
  1345  
  1346  type ProjectsLocationsNodesCreateCall struct {
  1347  	s          *Service
  1348  	parent     string
  1349  	node       *Node
  1350  	urlParams_ gensupport.URLParams
  1351  	ctx_       context.Context
  1352  	header_    http.Header
  1353  }
  1354  
  1355  // Create: Creates a node.
  1356  //
  1357  // - parent: The parent resource name.
  1358  func (r *ProjectsLocationsNodesService) Create(parent string, node *Node) *ProjectsLocationsNodesCreateCall {
  1359  	c := &ProjectsLocationsNodesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1360  	c.parent = parent
  1361  	c.node = node
  1362  	return c
  1363  }
  1364  
  1365  // NodeId sets the optional parameter "nodeId": The unqualified resource name.
  1366  func (c *ProjectsLocationsNodesCreateCall) NodeId(nodeId string) *ProjectsLocationsNodesCreateCall {
  1367  	c.urlParams_.Set("nodeId", nodeId)
  1368  	return c
  1369  }
  1370  
  1371  // RequestId sets the optional parameter "requestId": Idempotent request UUID.
  1372  func (c *ProjectsLocationsNodesCreateCall) RequestId(requestId string) *ProjectsLocationsNodesCreateCall {
  1373  	c.urlParams_.Set("requestId", requestId)
  1374  	return c
  1375  }
  1376  
  1377  // Fields allows partial responses to be retrieved. See
  1378  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1379  // details.
  1380  func (c *ProjectsLocationsNodesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsNodesCreateCall {
  1381  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1382  	return c
  1383  }
  1384  
  1385  // Context sets the context to be used in this call's Do method.
  1386  func (c *ProjectsLocationsNodesCreateCall) Context(ctx context.Context) *ProjectsLocationsNodesCreateCall {
  1387  	c.ctx_ = ctx
  1388  	return c
  1389  }
  1390  
  1391  // Header returns a http.Header that can be modified by the caller to add
  1392  // headers to the request.
  1393  func (c *ProjectsLocationsNodesCreateCall) Header() http.Header {
  1394  	if c.header_ == nil {
  1395  		c.header_ = make(http.Header)
  1396  	}
  1397  	return c.header_
  1398  }
  1399  
  1400  func (c *ProjectsLocationsNodesCreateCall) doRequest(alt string) (*http.Response, error) {
  1401  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1402  	var body io.Reader = nil
  1403  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.node)
  1404  	if err != nil {
  1405  		return nil, err
  1406  	}
  1407  	c.urlParams_.Set("alt", alt)
  1408  	c.urlParams_.Set("prettyPrint", "false")
  1409  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes")
  1410  	urls += "?" + c.urlParams_.Encode()
  1411  	req, err := http.NewRequest("POST", urls, body)
  1412  	if err != nil {
  1413  		return nil, err
  1414  	}
  1415  	req.Header = reqHeaders
  1416  	googleapi.Expand(req.URL, map[string]string{
  1417  		"parent": c.parent,
  1418  	})
  1419  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1420  }
  1421  
  1422  // Do executes the "tpu.projects.locations.nodes.create" call.
  1423  // Any non-2xx status code is an error. Response headers are in either
  1424  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1425  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1426  // whether the returned error was because http.StatusNotModified was returned.
  1427  func (c *ProjectsLocationsNodesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1428  	gensupport.SetOptions(c.urlParams_, opts...)
  1429  	res, err := c.doRequest("json")
  1430  	if res != nil && res.StatusCode == http.StatusNotModified {
  1431  		if res.Body != nil {
  1432  			res.Body.Close()
  1433  		}
  1434  		return nil, gensupport.WrapError(&googleapi.Error{
  1435  			Code:   res.StatusCode,
  1436  			Header: res.Header,
  1437  		})
  1438  	}
  1439  	if err != nil {
  1440  		return nil, err
  1441  	}
  1442  	defer googleapi.CloseBody(res)
  1443  	if err := googleapi.CheckResponse(res); err != nil {
  1444  		return nil, gensupport.WrapError(err)
  1445  	}
  1446  	ret := &Operation{
  1447  		ServerResponse: googleapi.ServerResponse{
  1448  			Header:         res.Header,
  1449  			HTTPStatusCode: res.StatusCode,
  1450  		},
  1451  	}
  1452  	target := &ret
  1453  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1454  		return nil, err
  1455  	}
  1456  	return ret, nil
  1457  }
  1458  
  1459  type ProjectsLocationsNodesDeleteCall struct {
  1460  	s          *Service
  1461  	name       string
  1462  	urlParams_ gensupport.URLParams
  1463  	ctx_       context.Context
  1464  	header_    http.Header
  1465  }
  1466  
  1467  // Delete: Deletes a node.
  1468  //
  1469  // - name: The resource name.
  1470  func (r *ProjectsLocationsNodesService) Delete(name string) *ProjectsLocationsNodesDeleteCall {
  1471  	c := &ProjectsLocationsNodesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1472  	c.name = name
  1473  	return c
  1474  }
  1475  
  1476  // RequestId sets the optional parameter "requestId": Idempotent request UUID.
  1477  func (c *ProjectsLocationsNodesDeleteCall) RequestId(requestId string) *ProjectsLocationsNodesDeleteCall {
  1478  	c.urlParams_.Set("requestId", requestId)
  1479  	return c
  1480  }
  1481  
  1482  // Fields allows partial responses to be retrieved. See
  1483  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1484  // details.
  1485  func (c *ProjectsLocationsNodesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsNodesDeleteCall {
  1486  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1487  	return c
  1488  }
  1489  
  1490  // Context sets the context to be used in this call's Do method.
  1491  func (c *ProjectsLocationsNodesDeleteCall) Context(ctx context.Context) *ProjectsLocationsNodesDeleteCall {
  1492  	c.ctx_ = ctx
  1493  	return c
  1494  }
  1495  
  1496  // Header returns a http.Header that can be modified by the caller to add
  1497  // headers to the request.
  1498  func (c *ProjectsLocationsNodesDeleteCall) Header() http.Header {
  1499  	if c.header_ == nil {
  1500  		c.header_ = make(http.Header)
  1501  	}
  1502  	return c.header_
  1503  }
  1504  
  1505  func (c *ProjectsLocationsNodesDeleteCall) doRequest(alt string) (*http.Response, error) {
  1506  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1507  	var body io.Reader = nil
  1508  	c.urlParams_.Set("alt", alt)
  1509  	c.urlParams_.Set("prettyPrint", "false")
  1510  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  1511  	urls += "?" + c.urlParams_.Encode()
  1512  	req, err := http.NewRequest("DELETE", urls, body)
  1513  	if err != nil {
  1514  		return nil, err
  1515  	}
  1516  	req.Header = reqHeaders
  1517  	googleapi.Expand(req.URL, map[string]string{
  1518  		"name": c.name,
  1519  	})
  1520  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1521  }
  1522  
  1523  // Do executes the "tpu.projects.locations.nodes.delete" call.
  1524  // Any non-2xx status code is an error. Response headers are in either
  1525  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1526  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1527  // whether the returned error was because http.StatusNotModified was returned.
  1528  func (c *ProjectsLocationsNodesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1529  	gensupport.SetOptions(c.urlParams_, opts...)
  1530  	res, err := c.doRequest("json")
  1531  	if res != nil && res.StatusCode == http.StatusNotModified {
  1532  		if res.Body != nil {
  1533  			res.Body.Close()
  1534  		}
  1535  		return nil, gensupport.WrapError(&googleapi.Error{
  1536  			Code:   res.StatusCode,
  1537  			Header: res.Header,
  1538  		})
  1539  	}
  1540  	if err != nil {
  1541  		return nil, err
  1542  	}
  1543  	defer googleapi.CloseBody(res)
  1544  	if err := googleapi.CheckResponse(res); err != nil {
  1545  		return nil, gensupport.WrapError(err)
  1546  	}
  1547  	ret := &Operation{
  1548  		ServerResponse: googleapi.ServerResponse{
  1549  			Header:         res.Header,
  1550  			HTTPStatusCode: res.StatusCode,
  1551  		},
  1552  	}
  1553  	target := &ret
  1554  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1555  		return nil, err
  1556  	}
  1557  	return ret, nil
  1558  }
  1559  
  1560  type ProjectsLocationsNodesGetCall struct {
  1561  	s            *Service
  1562  	name         string
  1563  	urlParams_   gensupport.URLParams
  1564  	ifNoneMatch_ string
  1565  	ctx_         context.Context
  1566  	header_      http.Header
  1567  }
  1568  
  1569  // Get: Gets the details of a node.
  1570  //
  1571  // - name: The resource name.
  1572  func (r *ProjectsLocationsNodesService) Get(name string) *ProjectsLocationsNodesGetCall {
  1573  	c := &ProjectsLocationsNodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1574  	c.name = name
  1575  	return c
  1576  }
  1577  
  1578  // Fields allows partial responses to be retrieved. See
  1579  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1580  // details.
  1581  func (c *ProjectsLocationsNodesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsNodesGetCall {
  1582  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1583  	return c
  1584  }
  1585  
  1586  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1587  // object's ETag matches the given value. This is useful for getting updates
  1588  // only after the object has changed since the last request.
  1589  func (c *ProjectsLocationsNodesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsNodesGetCall {
  1590  	c.ifNoneMatch_ = entityTag
  1591  	return c
  1592  }
  1593  
  1594  // Context sets the context to be used in this call's Do method.
  1595  func (c *ProjectsLocationsNodesGetCall) Context(ctx context.Context) *ProjectsLocationsNodesGetCall {
  1596  	c.ctx_ = ctx
  1597  	return c
  1598  }
  1599  
  1600  // Header returns a http.Header that can be modified by the caller to add
  1601  // headers to the request.
  1602  func (c *ProjectsLocationsNodesGetCall) Header() http.Header {
  1603  	if c.header_ == nil {
  1604  		c.header_ = make(http.Header)
  1605  	}
  1606  	return c.header_
  1607  }
  1608  
  1609  func (c *ProjectsLocationsNodesGetCall) doRequest(alt string) (*http.Response, error) {
  1610  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1611  	if c.ifNoneMatch_ != "" {
  1612  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1613  	}
  1614  	var body io.Reader = nil
  1615  	c.urlParams_.Set("alt", alt)
  1616  	c.urlParams_.Set("prettyPrint", "false")
  1617  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  1618  	urls += "?" + c.urlParams_.Encode()
  1619  	req, err := http.NewRequest("GET", urls, body)
  1620  	if err != nil {
  1621  		return nil, err
  1622  	}
  1623  	req.Header = reqHeaders
  1624  	googleapi.Expand(req.URL, map[string]string{
  1625  		"name": c.name,
  1626  	})
  1627  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1628  }
  1629  
  1630  // Do executes the "tpu.projects.locations.nodes.get" call.
  1631  // Any non-2xx status code is an error. Response headers are in either
  1632  // *Node.ServerResponse.Header or (if a response was returned at all) in
  1633  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1634  // whether the returned error was because http.StatusNotModified was returned.
  1635  func (c *ProjectsLocationsNodesGetCall) Do(opts ...googleapi.CallOption) (*Node, error) {
  1636  	gensupport.SetOptions(c.urlParams_, opts...)
  1637  	res, err := c.doRequest("json")
  1638  	if res != nil && res.StatusCode == http.StatusNotModified {
  1639  		if res.Body != nil {
  1640  			res.Body.Close()
  1641  		}
  1642  		return nil, gensupport.WrapError(&googleapi.Error{
  1643  			Code:   res.StatusCode,
  1644  			Header: res.Header,
  1645  		})
  1646  	}
  1647  	if err != nil {
  1648  		return nil, err
  1649  	}
  1650  	defer googleapi.CloseBody(res)
  1651  	if err := googleapi.CheckResponse(res); err != nil {
  1652  		return nil, gensupport.WrapError(err)
  1653  	}
  1654  	ret := &Node{
  1655  		ServerResponse: googleapi.ServerResponse{
  1656  			Header:         res.Header,
  1657  			HTTPStatusCode: res.StatusCode,
  1658  		},
  1659  	}
  1660  	target := &ret
  1661  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1662  		return nil, err
  1663  	}
  1664  	return ret, nil
  1665  }
  1666  
  1667  type ProjectsLocationsNodesListCall struct {
  1668  	s            *Service
  1669  	parent       string
  1670  	urlParams_   gensupport.URLParams
  1671  	ifNoneMatch_ string
  1672  	ctx_         context.Context
  1673  	header_      http.Header
  1674  }
  1675  
  1676  // List: Lists nodes.
  1677  //
  1678  // - parent: The parent resource name.
  1679  func (r *ProjectsLocationsNodesService) List(parent string) *ProjectsLocationsNodesListCall {
  1680  	c := &ProjectsLocationsNodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1681  	c.parent = parent
  1682  	return c
  1683  }
  1684  
  1685  // PageSize sets the optional parameter "pageSize": The maximum number of items
  1686  // to return.
  1687  func (c *ProjectsLocationsNodesListCall) PageSize(pageSize int64) *ProjectsLocationsNodesListCall {
  1688  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1689  	return c
  1690  }
  1691  
  1692  // PageToken sets the optional parameter "pageToken": The next_page_token value
  1693  // returned from a previous List request, if any.
  1694  func (c *ProjectsLocationsNodesListCall) PageToken(pageToken string) *ProjectsLocationsNodesListCall {
  1695  	c.urlParams_.Set("pageToken", pageToken)
  1696  	return c
  1697  }
  1698  
  1699  // Fields allows partial responses to be retrieved. See
  1700  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1701  // details.
  1702  func (c *ProjectsLocationsNodesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsNodesListCall {
  1703  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1704  	return c
  1705  }
  1706  
  1707  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1708  // object's ETag matches the given value. This is useful for getting updates
  1709  // only after the object has changed since the last request.
  1710  func (c *ProjectsLocationsNodesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsNodesListCall {
  1711  	c.ifNoneMatch_ = entityTag
  1712  	return c
  1713  }
  1714  
  1715  // Context sets the context to be used in this call's Do method.
  1716  func (c *ProjectsLocationsNodesListCall) Context(ctx context.Context) *ProjectsLocationsNodesListCall {
  1717  	c.ctx_ = ctx
  1718  	return c
  1719  }
  1720  
  1721  // Header returns a http.Header that can be modified by the caller to add
  1722  // headers to the request.
  1723  func (c *ProjectsLocationsNodesListCall) Header() http.Header {
  1724  	if c.header_ == nil {
  1725  		c.header_ = make(http.Header)
  1726  	}
  1727  	return c.header_
  1728  }
  1729  
  1730  func (c *ProjectsLocationsNodesListCall) doRequest(alt string) (*http.Response, error) {
  1731  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1732  	if c.ifNoneMatch_ != "" {
  1733  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1734  	}
  1735  	var body io.Reader = nil
  1736  	c.urlParams_.Set("alt", alt)
  1737  	c.urlParams_.Set("prettyPrint", "false")
  1738  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/nodes")
  1739  	urls += "?" + c.urlParams_.Encode()
  1740  	req, err := http.NewRequest("GET", urls, body)
  1741  	if err != nil {
  1742  		return nil, err
  1743  	}
  1744  	req.Header = reqHeaders
  1745  	googleapi.Expand(req.URL, map[string]string{
  1746  		"parent": c.parent,
  1747  	})
  1748  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1749  }
  1750  
  1751  // Do executes the "tpu.projects.locations.nodes.list" call.
  1752  // Any non-2xx status code is an error. Response headers are in either
  1753  // *ListNodesResponse.ServerResponse.Header or (if a response was returned at
  1754  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1755  // check whether the returned error was because http.StatusNotModified was
  1756  // returned.
  1757  func (c *ProjectsLocationsNodesListCall) Do(opts ...googleapi.CallOption) (*ListNodesResponse, error) {
  1758  	gensupport.SetOptions(c.urlParams_, opts...)
  1759  	res, err := c.doRequest("json")
  1760  	if res != nil && res.StatusCode == http.StatusNotModified {
  1761  		if res.Body != nil {
  1762  			res.Body.Close()
  1763  		}
  1764  		return nil, gensupport.WrapError(&googleapi.Error{
  1765  			Code:   res.StatusCode,
  1766  			Header: res.Header,
  1767  		})
  1768  	}
  1769  	if err != nil {
  1770  		return nil, err
  1771  	}
  1772  	defer googleapi.CloseBody(res)
  1773  	if err := googleapi.CheckResponse(res); err != nil {
  1774  		return nil, gensupport.WrapError(err)
  1775  	}
  1776  	ret := &ListNodesResponse{
  1777  		ServerResponse: googleapi.ServerResponse{
  1778  			Header:         res.Header,
  1779  			HTTPStatusCode: res.StatusCode,
  1780  		},
  1781  	}
  1782  	target := &ret
  1783  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1784  		return nil, err
  1785  	}
  1786  	return ret, nil
  1787  }
  1788  
  1789  // Pages invokes f for each page of results.
  1790  // A non-nil error returned from f will halt the iteration.
  1791  // The provided context supersedes any context provided to the Context method.
  1792  func (c *ProjectsLocationsNodesListCall) Pages(ctx context.Context, f func(*ListNodesResponse) error) error {
  1793  	c.ctx_ = ctx
  1794  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1795  	for {
  1796  		x, err := c.Do()
  1797  		if err != nil {
  1798  			return err
  1799  		}
  1800  		if err := f(x); err != nil {
  1801  			return err
  1802  		}
  1803  		if x.NextPageToken == "" {
  1804  			return nil
  1805  		}
  1806  		c.PageToken(x.NextPageToken)
  1807  	}
  1808  }
  1809  
  1810  type ProjectsLocationsNodesReimageCall struct {
  1811  	s                  *Service
  1812  	name               string
  1813  	reimagenoderequest *ReimageNodeRequest
  1814  	urlParams_         gensupport.URLParams
  1815  	ctx_               context.Context
  1816  	header_            http.Header
  1817  }
  1818  
  1819  // Reimage: Reimages a node's OS.
  1820  //
  1821  // - name: The resource name.
  1822  func (r *ProjectsLocationsNodesService) Reimage(name string, reimagenoderequest *ReimageNodeRequest) *ProjectsLocationsNodesReimageCall {
  1823  	c := &ProjectsLocationsNodesReimageCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1824  	c.name = name
  1825  	c.reimagenoderequest = reimagenoderequest
  1826  	return c
  1827  }
  1828  
  1829  // Fields allows partial responses to be retrieved. See
  1830  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1831  // details.
  1832  func (c *ProjectsLocationsNodesReimageCall) Fields(s ...googleapi.Field) *ProjectsLocationsNodesReimageCall {
  1833  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1834  	return c
  1835  }
  1836  
  1837  // Context sets the context to be used in this call's Do method.
  1838  func (c *ProjectsLocationsNodesReimageCall) Context(ctx context.Context) *ProjectsLocationsNodesReimageCall {
  1839  	c.ctx_ = ctx
  1840  	return c
  1841  }
  1842  
  1843  // Header returns a http.Header that can be modified by the caller to add
  1844  // headers to the request.
  1845  func (c *ProjectsLocationsNodesReimageCall) Header() http.Header {
  1846  	if c.header_ == nil {
  1847  		c.header_ = make(http.Header)
  1848  	}
  1849  	return c.header_
  1850  }
  1851  
  1852  func (c *ProjectsLocationsNodesReimageCall) doRequest(alt string) (*http.Response, error) {
  1853  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1854  	var body io.Reader = nil
  1855  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.reimagenoderequest)
  1856  	if err != nil {
  1857  		return nil, err
  1858  	}
  1859  	c.urlParams_.Set("alt", alt)
  1860  	c.urlParams_.Set("prettyPrint", "false")
  1861  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:reimage")
  1862  	urls += "?" + c.urlParams_.Encode()
  1863  	req, err := http.NewRequest("POST", urls, body)
  1864  	if err != nil {
  1865  		return nil, err
  1866  	}
  1867  	req.Header = reqHeaders
  1868  	googleapi.Expand(req.URL, map[string]string{
  1869  		"name": c.name,
  1870  	})
  1871  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1872  }
  1873  
  1874  // Do executes the "tpu.projects.locations.nodes.reimage" call.
  1875  // Any non-2xx status code is an error. Response headers are in either
  1876  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1877  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1878  // whether the returned error was because http.StatusNotModified was returned.
  1879  func (c *ProjectsLocationsNodesReimageCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1880  	gensupport.SetOptions(c.urlParams_, opts...)
  1881  	res, err := c.doRequest("json")
  1882  	if res != nil && res.StatusCode == http.StatusNotModified {
  1883  		if res.Body != nil {
  1884  			res.Body.Close()
  1885  		}
  1886  		return nil, gensupport.WrapError(&googleapi.Error{
  1887  			Code:   res.StatusCode,
  1888  			Header: res.Header,
  1889  		})
  1890  	}
  1891  	if err != nil {
  1892  		return nil, err
  1893  	}
  1894  	defer googleapi.CloseBody(res)
  1895  	if err := googleapi.CheckResponse(res); err != nil {
  1896  		return nil, gensupport.WrapError(err)
  1897  	}
  1898  	ret := &Operation{
  1899  		ServerResponse: googleapi.ServerResponse{
  1900  			Header:         res.Header,
  1901  			HTTPStatusCode: res.StatusCode,
  1902  		},
  1903  	}
  1904  	target := &ret
  1905  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1906  		return nil, err
  1907  	}
  1908  	return ret, nil
  1909  }
  1910  
  1911  type ProjectsLocationsNodesStartCall struct {
  1912  	s                *Service
  1913  	name             string
  1914  	startnoderequest *StartNodeRequest
  1915  	urlParams_       gensupport.URLParams
  1916  	ctx_             context.Context
  1917  	header_          http.Header
  1918  }
  1919  
  1920  // Start: Starts a node.
  1921  //
  1922  // - name: The resource name.
  1923  func (r *ProjectsLocationsNodesService) Start(name string, startnoderequest *StartNodeRequest) *ProjectsLocationsNodesStartCall {
  1924  	c := &ProjectsLocationsNodesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1925  	c.name = name
  1926  	c.startnoderequest = startnoderequest
  1927  	return c
  1928  }
  1929  
  1930  // Fields allows partial responses to be retrieved. See
  1931  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1932  // details.
  1933  func (c *ProjectsLocationsNodesStartCall) Fields(s ...googleapi.Field) *ProjectsLocationsNodesStartCall {
  1934  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1935  	return c
  1936  }
  1937  
  1938  // Context sets the context to be used in this call's Do method.
  1939  func (c *ProjectsLocationsNodesStartCall) Context(ctx context.Context) *ProjectsLocationsNodesStartCall {
  1940  	c.ctx_ = ctx
  1941  	return c
  1942  }
  1943  
  1944  // Header returns a http.Header that can be modified by the caller to add
  1945  // headers to the request.
  1946  func (c *ProjectsLocationsNodesStartCall) Header() http.Header {
  1947  	if c.header_ == nil {
  1948  		c.header_ = make(http.Header)
  1949  	}
  1950  	return c.header_
  1951  }
  1952  
  1953  func (c *ProjectsLocationsNodesStartCall) doRequest(alt string) (*http.Response, error) {
  1954  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1955  	var body io.Reader = nil
  1956  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.startnoderequest)
  1957  	if err != nil {
  1958  		return nil, err
  1959  	}
  1960  	c.urlParams_.Set("alt", alt)
  1961  	c.urlParams_.Set("prettyPrint", "false")
  1962  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:start")
  1963  	urls += "?" + c.urlParams_.Encode()
  1964  	req, err := http.NewRequest("POST", urls, body)
  1965  	if err != nil {
  1966  		return nil, err
  1967  	}
  1968  	req.Header = reqHeaders
  1969  	googleapi.Expand(req.URL, map[string]string{
  1970  		"name": c.name,
  1971  	})
  1972  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1973  }
  1974  
  1975  // Do executes the "tpu.projects.locations.nodes.start" call.
  1976  // Any non-2xx status code is an error. Response headers are in either
  1977  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1978  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1979  // whether the returned error was because http.StatusNotModified was returned.
  1980  func (c *ProjectsLocationsNodesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1981  	gensupport.SetOptions(c.urlParams_, opts...)
  1982  	res, err := c.doRequest("json")
  1983  	if res != nil && res.StatusCode == http.StatusNotModified {
  1984  		if res.Body != nil {
  1985  			res.Body.Close()
  1986  		}
  1987  		return nil, gensupport.WrapError(&googleapi.Error{
  1988  			Code:   res.StatusCode,
  1989  			Header: res.Header,
  1990  		})
  1991  	}
  1992  	if err != nil {
  1993  		return nil, err
  1994  	}
  1995  	defer googleapi.CloseBody(res)
  1996  	if err := googleapi.CheckResponse(res); err != nil {
  1997  		return nil, gensupport.WrapError(err)
  1998  	}
  1999  	ret := &Operation{
  2000  		ServerResponse: googleapi.ServerResponse{
  2001  			Header:         res.Header,
  2002  			HTTPStatusCode: res.StatusCode,
  2003  		},
  2004  	}
  2005  	target := &ret
  2006  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2007  		return nil, err
  2008  	}
  2009  	return ret, nil
  2010  }
  2011  
  2012  type ProjectsLocationsNodesStopCall struct {
  2013  	s               *Service
  2014  	name            string
  2015  	stopnoderequest *StopNodeRequest
  2016  	urlParams_      gensupport.URLParams
  2017  	ctx_            context.Context
  2018  	header_         http.Header
  2019  }
  2020  
  2021  // Stop: Stops a node. This operation is only available with single TPU nodes.
  2022  //
  2023  // - name: The resource name.
  2024  func (r *ProjectsLocationsNodesService) Stop(name string, stopnoderequest *StopNodeRequest) *ProjectsLocationsNodesStopCall {
  2025  	c := &ProjectsLocationsNodesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2026  	c.name = name
  2027  	c.stopnoderequest = stopnoderequest
  2028  	return c
  2029  }
  2030  
  2031  // Fields allows partial responses to be retrieved. See
  2032  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2033  // details.
  2034  func (c *ProjectsLocationsNodesStopCall) Fields(s ...googleapi.Field) *ProjectsLocationsNodesStopCall {
  2035  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2036  	return c
  2037  }
  2038  
  2039  // Context sets the context to be used in this call's Do method.
  2040  func (c *ProjectsLocationsNodesStopCall) Context(ctx context.Context) *ProjectsLocationsNodesStopCall {
  2041  	c.ctx_ = ctx
  2042  	return c
  2043  }
  2044  
  2045  // Header returns a http.Header that can be modified by the caller to add
  2046  // headers to the request.
  2047  func (c *ProjectsLocationsNodesStopCall) Header() http.Header {
  2048  	if c.header_ == nil {
  2049  		c.header_ = make(http.Header)
  2050  	}
  2051  	return c.header_
  2052  }
  2053  
  2054  func (c *ProjectsLocationsNodesStopCall) doRequest(alt string) (*http.Response, error) {
  2055  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2056  	var body io.Reader = nil
  2057  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopnoderequest)
  2058  	if err != nil {
  2059  		return nil, err
  2060  	}
  2061  	c.urlParams_.Set("alt", alt)
  2062  	c.urlParams_.Set("prettyPrint", "false")
  2063  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:stop")
  2064  	urls += "?" + c.urlParams_.Encode()
  2065  	req, err := http.NewRequest("POST", urls, body)
  2066  	if err != nil {
  2067  		return nil, err
  2068  	}
  2069  	req.Header = reqHeaders
  2070  	googleapi.Expand(req.URL, map[string]string{
  2071  		"name": c.name,
  2072  	})
  2073  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2074  }
  2075  
  2076  // Do executes the "tpu.projects.locations.nodes.stop" call.
  2077  // Any non-2xx status code is an error. Response headers are in either
  2078  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  2079  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2080  // whether the returned error was because http.StatusNotModified was returned.
  2081  func (c *ProjectsLocationsNodesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2082  	gensupport.SetOptions(c.urlParams_, opts...)
  2083  	res, err := c.doRequest("json")
  2084  	if res != nil && res.StatusCode == http.StatusNotModified {
  2085  		if res.Body != nil {
  2086  			res.Body.Close()
  2087  		}
  2088  		return nil, gensupport.WrapError(&googleapi.Error{
  2089  			Code:   res.StatusCode,
  2090  			Header: res.Header,
  2091  		})
  2092  	}
  2093  	if err != nil {
  2094  		return nil, err
  2095  	}
  2096  	defer googleapi.CloseBody(res)
  2097  	if err := googleapi.CheckResponse(res); err != nil {
  2098  		return nil, gensupport.WrapError(err)
  2099  	}
  2100  	ret := &Operation{
  2101  		ServerResponse: googleapi.ServerResponse{
  2102  			Header:         res.Header,
  2103  			HTTPStatusCode: res.StatusCode,
  2104  		},
  2105  	}
  2106  	target := &ret
  2107  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2108  		return nil, err
  2109  	}
  2110  	return ret, nil
  2111  }
  2112  
  2113  type ProjectsLocationsOperationsCancelCall struct {
  2114  	s          *Service
  2115  	name       string
  2116  	urlParams_ gensupport.URLParams
  2117  	ctx_       context.Context
  2118  	header_    http.Header
  2119  }
  2120  
  2121  // Cancel: Starts asynchronous cancellation on a long-running operation. The
  2122  // server makes a best effort to cancel the operation, but success is not
  2123  // guaranteed. If the server doesn't support this method, it returns
  2124  // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
  2125  // other methods to check whether the cancellation succeeded or whether the
  2126  // operation completed despite cancellation. On successful cancellation, the
  2127  // operation is not deleted; instead, it becomes an operation with an
  2128  // Operation.error value with a google.rpc.Status.code of 1, corresponding to
  2129  // `Code.CANCELLED`.
  2130  //
  2131  // - name: The name of the operation resource to be cancelled.
  2132  func (r *ProjectsLocationsOperationsService) Cancel(name string) *ProjectsLocationsOperationsCancelCall {
  2133  	c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2134  	c.name = name
  2135  	return c
  2136  }
  2137  
  2138  // Fields allows partial responses to be retrieved. See
  2139  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2140  // details.
  2141  func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
  2142  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2143  	return c
  2144  }
  2145  
  2146  // Context sets the context to be used in this call's Do method.
  2147  func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
  2148  	c.ctx_ = ctx
  2149  	return c
  2150  }
  2151  
  2152  // Header returns a http.Header that can be modified by the caller to add
  2153  // headers to the request.
  2154  func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
  2155  	if c.header_ == nil {
  2156  		c.header_ = make(http.Header)
  2157  	}
  2158  	return c.header_
  2159  }
  2160  
  2161  func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  2162  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2163  	var body io.Reader = nil
  2164  	c.urlParams_.Set("alt", alt)
  2165  	c.urlParams_.Set("prettyPrint", "false")
  2166  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:cancel")
  2167  	urls += "?" + c.urlParams_.Encode()
  2168  	req, err := http.NewRequest("POST", urls, body)
  2169  	if err != nil {
  2170  		return nil, err
  2171  	}
  2172  	req.Header = reqHeaders
  2173  	googleapi.Expand(req.URL, map[string]string{
  2174  		"name": c.name,
  2175  	})
  2176  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2177  }
  2178  
  2179  // Do executes the "tpu.projects.locations.operations.cancel" call.
  2180  // Any non-2xx status code is an error. Response headers are in either
  2181  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2182  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2183  // whether the returned error was because http.StatusNotModified was returned.
  2184  func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2185  	gensupport.SetOptions(c.urlParams_, opts...)
  2186  	res, err := c.doRequest("json")
  2187  	if res != nil && res.StatusCode == http.StatusNotModified {
  2188  		if res.Body != nil {
  2189  			res.Body.Close()
  2190  		}
  2191  		return nil, gensupport.WrapError(&googleapi.Error{
  2192  			Code:   res.StatusCode,
  2193  			Header: res.Header,
  2194  		})
  2195  	}
  2196  	if err != nil {
  2197  		return nil, err
  2198  	}
  2199  	defer googleapi.CloseBody(res)
  2200  	if err := googleapi.CheckResponse(res); err != nil {
  2201  		return nil, gensupport.WrapError(err)
  2202  	}
  2203  	ret := &Empty{
  2204  		ServerResponse: googleapi.ServerResponse{
  2205  			Header:         res.Header,
  2206  			HTTPStatusCode: res.StatusCode,
  2207  		},
  2208  	}
  2209  	target := &ret
  2210  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2211  		return nil, err
  2212  	}
  2213  	return ret, nil
  2214  }
  2215  
  2216  type ProjectsLocationsOperationsDeleteCall struct {
  2217  	s          *Service
  2218  	name       string
  2219  	urlParams_ gensupport.URLParams
  2220  	ctx_       context.Context
  2221  	header_    http.Header
  2222  }
  2223  
  2224  // Delete: Deletes a long-running operation. This method indicates that the
  2225  // client is no longer interested in the operation result. It does not cancel
  2226  // the operation. If the server doesn't support this method, it returns
  2227  // `google.rpc.Code.UNIMPLEMENTED`.
  2228  //
  2229  // - name: The name of the operation resource to be deleted.
  2230  func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
  2231  	c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2232  	c.name = name
  2233  	return c
  2234  }
  2235  
  2236  // Fields allows partial responses to be retrieved. See
  2237  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2238  // details.
  2239  func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
  2240  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2241  	return c
  2242  }
  2243  
  2244  // Context sets the context to be used in this call's Do method.
  2245  func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
  2246  	c.ctx_ = ctx
  2247  	return c
  2248  }
  2249  
  2250  // Header returns a http.Header that can be modified by the caller to add
  2251  // headers to the request.
  2252  func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
  2253  	if c.header_ == nil {
  2254  		c.header_ = make(http.Header)
  2255  	}
  2256  	return c.header_
  2257  }
  2258  
  2259  func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2260  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2261  	var body io.Reader = nil
  2262  	c.urlParams_.Set("alt", alt)
  2263  	c.urlParams_.Set("prettyPrint", "false")
  2264  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  2265  	urls += "?" + c.urlParams_.Encode()
  2266  	req, err := http.NewRequest("DELETE", urls, body)
  2267  	if err != nil {
  2268  		return nil, err
  2269  	}
  2270  	req.Header = reqHeaders
  2271  	googleapi.Expand(req.URL, map[string]string{
  2272  		"name": c.name,
  2273  	})
  2274  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2275  }
  2276  
  2277  // Do executes the "tpu.projects.locations.operations.delete" call.
  2278  // Any non-2xx status code is an error. Response headers are in either
  2279  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2280  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2281  // whether the returned error was because http.StatusNotModified was returned.
  2282  func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2283  	gensupport.SetOptions(c.urlParams_, opts...)
  2284  	res, err := c.doRequest("json")
  2285  	if res != nil && res.StatusCode == http.StatusNotModified {
  2286  		if res.Body != nil {
  2287  			res.Body.Close()
  2288  		}
  2289  		return nil, gensupport.WrapError(&googleapi.Error{
  2290  			Code:   res.StatusCode,
  2291  			Header: res.Header,
  2292  		})
  2293  	}
  2294  	if err != nil {
  2295  		return nil, err
  2296  	}
  2297  	defer googleapi.CloseBody(res)
  2298  	if err := googleapi.CheckResponse(res); err != nil {
  2299  		return nil, gensupport.WrapError(err)
  2300  	}
  2301  	ret := &Empty{
  2302  		ServerResponse: googleapi.ServerResponse{
  2303  			Header:         res.Header,
  2304  			HTTPStatusCode: res.StatusCode,
  2305  		},
  2306  	}
  2307  	target := &ret
  2308  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2309  		return nil, err
  2310  	}
  2311  	return ret, nil
  2312  }
  2313  
  2314  type ProjectsLocationsOperationsGetCall struct {
  2315  	s            *Service
  2316  	name         string
  2317  	urlParams_   gensupport.URLParams
  2318  	ifNoneMatch_ string
  2319  	ctx_         context.Context
  2320  	header_      http.Header
  2321  }
  2322  
  2323  // Get: Gets the latest state of a long-running operation. Clients can use this
  2324  // method to poll the operation result at intervals as recommended by the API
  2325  // service.
  2326  //
  2327  // - name: The name of the operation resource.
  2328  func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  2329  	c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2330  	c.name = name
  2331  	return c
  2332  }
  2333  
  2334  // Fields allows partial responses to be retrieved. See
  2335  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2336  // details.
  2337  func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  2338  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2339  	return c
  2340  }
  2341  
  2342  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2343  // object's ETag matches the given value. This is useful for getting updates
  2344  // only after the object has changed since the last request.
  2345  func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  2346  	c.ifNoneMatch_ = entityTag
  2347  	return c
  2348  }
  2349  
  2350  // Context sets the context to be used in this call's Do method.
  2351  func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  2352  	c.ctx_ = ctx
  2353  	return c
  2354  }
  2355  
  2356  // Header returns a http.Header that can be modified by the caller to add
  2357  // headers to the request.
  2358  func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  2359  	if c.header_ == nil {
  2360  		c.header_ = make(http.Header)
  2361  	}
  2362  	return c.header_
  2363  }
  2364  
  2365  func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  2366  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2367  	if c.ifNoneMatch_ != "" {
  2368  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2369  	}
  2370  	var body io.Reader = nil
  2371  	c.urlParams_.Set("alt", alt)
  2372  	c.urlParams_.Set("prettyPrint", "false")
  2373  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  2374  	urls += "?" + c.urlParams_.Encode()
  2375  	req, err := http.NewRequest("GET", urls, body)
  2376  	if err != nil {
  2377  		return nil, err
  2378  	}
  2379  	req.Header = reqHeaders
  2380  	googleapi.Expand(req.URL, map[string]string{
  2381  		"name": c.name,
  2382  	})
  2383  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2384  }
  2385  
  2386  // Do executes the "tpu.projects.locations.operations.get" call.
  2387  // Any non-2xx status code is an error. Response headers are in either
  2388  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  2389  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2390  // whether the returned error was because http.StatusNotModified was returned.
  2391  func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2392  	gensupport.SetOptions(c.urlParams_, opts...)
  2393  	res, err := c.doRequest("json")
  2394  	if res != nil && res.StatusCode == http.StatusNotModified {
  2395  		if res.Body != nil {
  2396  			res.Body.Close()
  2397  		}
  2398  		return nil, gensupport.WrapError(&googleapi.Error{
  2399  			Code:   res.StatusCode,
  2400  			Header: res.Header,
  2401  		})
  2402  	}
  2403  	if err != nil {
  2404  		return nil, err
  2405  	}
  2406  	defer googleapi.CloseBody(res)
  2407  	if err := googleapi.CheckResponse(res); err != nil {
  2408  		return nil, gensupport.WrapError(err)
  2409  	}
  2410  	ret := &Operation{
  2411  		ServerResponse: googleapi.ServerResponse{
  2412  			Header:         res.Header,
  2413  			HTTPStatusCode: res.StatusCode,
  2414  		},
  2415  	}
  2416  	target := &ret
  2417  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2418  		return nil, err
  2419  	}
  2420  	return ret, nil
  2421  }
  2422  
  2423  type ProjectsLocationsOperationsListCall struct {
  2424  	s            *Service
  2425  	name         string
  2426  	urlParams_   gensupport.URLParams
  2427  	ifNoneMatch_ string
  2428  	ctx_         context.Context
  2429  	header_      http.Header
  2430  }
  2431  
  2432  // List: Lists operations that match the specified filter in the request. If
  2433  // the server doesn't support this method, it returns `UNIMPLEMENTED`.
  2434  //
  2435  // - name: The name of the operation's parent resource.
  2436  func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
  2437  	c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2438  	c.name = name
  2439  	return c
  2440  }
  2441  
  2442  // Filter sets the optional parameter "filter": The standard list filter.
  2443  func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
  2444  	c.urlParams_.Set("filter", filter)
  2445  	return c
  2446  }
  2447  
  2448  // PageSize sets the optional parameter "pageSize": The standard list page
  2449  // size.
  2450  func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
  2451  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2452  	return c
  2453  }
  2454  
  2455  // PageToken sets the optional parameter "pageToken": The standard list page
  2456  // token.
  2457  func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
  2458  	c.urlParams_.Set("pageToken", pageToken)
  2459  	return c
  2460  }
  2461  
  2462  // Fields allows partial responses to be retrieved. See
  2463  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2464  // details.
  2465  func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  2466  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2467  	return c
  2468  }
  2469  
  2470  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2471  // object's ETag matches the given value. This is useful for getting updates
  2472  // only after the object has changed since the last request.
  2473  func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  2474  	c.ifNoneMatch_ = entityTag
  2475  	return c
  2476  }
  2477  
  2478  // Context sets the context to be used in this call's Do method.
  2479  func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  2480  	c.ctx_ = ctx
  2481  	return c
  2482  }
  2483  
  2484  // Header returns a http.Header that can be modified by the caller to add
  2485  // headers to the request.
  2486  func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  2487  	if c.header_ == nil {
  2488  		c.header_ = make(http.Header)
  2489  	}
  2490  	return c.header_
  2491  }
  2492  
  2493  func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  2494  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2495  	if c.ifNoneMatch_ != "" {
  2496  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2497  	}
  2498  	var body io.Reader = nil
  2499  	c.urlParams_.Set("alt", alt)
  2500  	c.urlParams_.Set("prettyPrint", "false")
  2501  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}/operations")
  2502  	urls += "?" + c.urlParams_.Encode()
  2503  	req, err := http.NewRequest("GET", urls, body)
  2504  	if err != nil {
  2505  		return nil, err
  2506  	}
  2507  	req.Header = reqHeaders
  2508  	googleapi.Expand(req.URL, map[string]string{
  2509  		"name": c.name,
  2510  	})
  2511  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2512  }
  2513  
  2514  // Do executes the "tpu.projects.locations.operations.list" call.
  2515  // Any non-2xx status code is an error. Response headers are in either
  2516  // *ListOperationsResponse.ServerResponse.Header or (if a response was returned
  2517  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2518  // check whether the returned error was because http.StatusNotModified was
  2519  // returned.
  2520  func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  2521  	gensupport.SetOptions(c.urlParams_, opts...)
  2522  	res, err := c.doRequest("json")
  2523  	if res != nil && res.StatusCode == http.StatusNotModified {
  2524  		if res.Body != nil {
  2525  			res.Body.Close()
  2526  		}
  2527  		return nil, gensupport.WrapError(&googleapi.Error{
  2528  			Code:   res.StatusCode,
  2529  			Header: res.Header,
  2530  		})
  2531  	}
  2532  	if err != nil {
  2533  		return nil, err
  2534  	}
  2535  	defer googleapi.CloseBody(res)
  2536  	if err := googleapi.CheckResponse(res); err != nil {
  2537  		return nil, gensupport.WrapError(err)
  2538  	}
  2539  	ret := &ListOperationsResponse{
  2540  		ServerResponse: googleapi.ServerResponse{
  2541  			Header:         res.Header,
  2542  			HTTPStatusCode: res.StatusCode,
  2543  		},
  2544  	}
  2545  	target := &ret
  2546  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2547  		return nil, err
  2548  	}
  2549  	return ret, nil
  2550  }
  2551  
  2552  // Pages invokes f for each page of results.
  2553  // A non-nil error returned from f will halt the iteration.
  2554  // The provided context supersedes any context provided to the Context method.
  2555  func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  2556  	c.ctx_ = ctx
  2557  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2558  	for {
  2559  		x, err := c.Do()
  2560  		if err != nil {
  2561  			return err
  2562  		}
  2563  		if err := f(x); err != nil {
  2564  			return err
  2565  		}
  2566  		if x.NextPageToken == "" {
  2567  			return nil
  2568  		}
  2569  		c.PageToken(x.NextPageToken)
  2570  	}
  2571  }
  2572  
  2573  type ProjectsLocationsTensorflowVersionsGetCall struct {
  2574  	s            *Service
  2575  	name         string
  2576  	urlParams_   gensupport.URLParams
  2577  	ifNoneMatch_ string
  2578  	ctx_         context.Context
  2579  	header_      http.Header
  2580  }
  2581  
  2582  // Get: Gets TensorFlow Version.
  2583  //
  2584  // - name: The resource name.
  2585  func (r *ProjectsLocationsTensorflowVersionsService) Get(name string) *ProjectsLocationsTensorflowVersionsGetCall {
  2586  	c := &ProjectsLocationsTensorflowVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2587  	c.name = name
  2588  	return c
  2589  }
  2590  
  2591  // Fields allows partial responses to be retrieved. See
  2592  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2593  // details.
  2594  func (c *ProjectsLocationsTensorflowVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsTensorflowVersionsGetCall {
  2595  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2596  	return c
  2597  }
  2598  
  2599  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2600  // object's ETag matches the given value. This is useful for getting updates
  2601  // only after the object has changed since the last request.
  2602  func (c *ProjectsLocationsTensorflowVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsTensorflowVersionsGetCall {
  2603  	c.ifNoneMatch_ = entityTag
  2604  	return c
  2605  }
  2606  
  2607  // Context sets the context to be used in this call's Do method.
  2608  func (c *ProjectsLocationsTensorflowVersionsGetCall) Context(ctx context.Context) *ProjectsLocationsTensorflowVersionsGetCall {
  2609  	c.ctx_ = ctx
  2610  	return c
  2611  }
  2612  
  2613  // Header returns a http.Header that can be modified by the caller to add
  2614  // headers to the request.
  2615  func (c *ProjectsLocationsTensorflowVersionsGetCall) Header() http.Header {
  2616  	if c.header_ == nil {
  2617  		c.header_ = make(http.Header)
  2618  	}
  2619  	return c.header_
  2620  }
  2621  
  2622  func (c *ProjectsLocationsTensorflowVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  2623  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2624  	if c.ifNoneMatch_ != "" {
  2625  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2626  	}
  2627  	var body io.Reader = nil
  2628  	c.urlParams_.Set("alt", alt)
  2629  	c.urlParams_.Set("prettyPrint", "false")
  2630  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  2631  	urls += "?" + c.urlParams_.Encode()
  2632  	req, err := http.NewRequest("GET", urls, body)
  2633  	if err != nil {
  2634  		return nil, err
  2635  	}
  2636  	req.Header = reqHeaders
  2637  	googleapi.Expand(req.URL, map[string]string{
  2638  		"name": c.name,
  2639  	})
  2640  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2641  }
  2642  
  2643  // Do executes the "tpu.projects.locations.tensorflowVersions.get" call.
  2644  // Any non-2xx status code is an error. Response headers are in either
  2645  // *TensorFlowVersion.ServerResponse.Header or (if a response was returned at
  2646  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2647  // check whether the returned error was because http.StatusNotModified was
  2648  // returned.
  2649  func (c *ProjectsLocationsTensorflowVersionsGetCall) Do(opts ...googleapi.CallOption) (*TensorFlowVersion, error) {
  2650  	gensupport.SetOptions(c.urlParams_, opts...)
  2651  	res, err := c.doRequest("json")
  2652  	if res != nil && res.StatusCode == http.StatusNotModified {
  2653  		if res.Body != nil {
  2654  			res.Body.Close()
  2655  		}
  2656  		return nil, gensupport.WrapError(&googleapi.Error{
  2657  			Code:   res.StatusCode,
  2658  			Header: res.Header,
  2659  		})
  2660  	}
  2661  	if err != nil {
  2662  		return nil, err
  2663  	}
  2664  	defer googleapi.CloseBody(res)
  2665  	if err := googleapi.CheckResponse(res); err != nil {
  2666  		return nil, gensupport.WrapError(err)
  2667  	}
  2668  	ret := &TensorFlowVersion{
  2669  		ServerResponse: googleapi.ServerResponse{
  2670  			Header:         res.Header,
  2671  			HTTPStatusCode: res.StatusCode,
  2672  		},
  2673  	}
  2674  	target := &ret
  2675  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2676  		return nil, err
  2677  	}
  2678  	return ret, nil
  2679  }
  2680  
  2681  type ProjectsLocationsTensorflowVersionsListCall struct {
  2682  	s            *Service
  2683  	parent       string
  2684  	urlParams_   gensupport.URLParams
  2685  	ifNoneMatch_ string
  2686  	ctx_         context.Context
  2687  	header_      http.Header
  2688  }
  2689  
  2690  // List: Lists TensorFlow versions supported by this API.
  2691  //
  2692  // - parent: The parent resource name.
  2693  func (r *ProjectsLocationsTensorflowVersionsService) List(parent string) *ProjectsLocationsTensorflowVersionsListCall {
  2694  	c := &ProjectsLocationsTensorflowVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2695  	c.parent = parent
  2696  	return c
  2697  }
  2698  
  2699  // Filter sets the optional parameter "filter": List filter.
  2700  func (c *ProjectsLocationsTensorflowVersionsListCall) Filter(filter string) *ProjectsLocationsTensorflowVersionsListCall {
  2701  	c.urlParams_.Set("filter", filter)
  2702  	return c
  2703  }
  2704  
  2705  // OrderBy sets the optional parameter "orderBy": Sort results.
  2706  func (c *ProjectsLocationsTensorflowVersionsListCall) OrderBy(orderBy string) *ProjectsLocationsTensorflowVersionsListCall {
  2707  	c.urlParams_.Set("orderBy", orderBy)
  2708  	return c
  2709  }
  2710  
  2711  // PageSize sets the optional parameter "pageSize": The maximum number of items
  2712  // to return.
  2713  func (c *ProjectsLocationsTensorflowVersionsListCall) PageSize(pageSize int64) *ProjectsLocationsTensorflowVersionsListCall {
  2714  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2715  	return c
  2716  }
  2717  
  2718  // PageToken sets the optional parameter "pageToken": The next_page_token value
  2719  // returned from a previous List request, if any.
  2720  func (c *ProjectsLocationsTensorflowVersionsListCall) PageToken(pageToken string) *ProjectsLocationsTensorflowVersionsListCall {
  2721  	c.urlParams_.Set("pageToken", pageToken)
  2722  	return c
  2723  }
  2724  
  2725  // Fields allows partial responses to be retrieved. See
  2726  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2727  // details.
  2728  func (c *ProjectsLocationsTensorflowVersionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsTensorflowVersionsListCall {
  2729  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2730  	return c
  2731  }
  2732  
  2733  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2734  // object's ETag matches the given value. This is useful for getting updates
  2735  // only after the object has changed since the last request.
  2736  func (c *ProjectsLocationsTensorflowVersionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsTensorflowVersionsListCall {
  2737  	c.ifNoneMatch_ = entityTag
  2738  	return c
  2739  }
  2740  
  2741  // Context sets the context to be used in this call's Do method.
  2742  func (c *ProjectsLocationsTensorflowVersionsListCall) Context(ctx context.Context) *ProjectsLocationsTensorflowVersionsListCall {
  2743  	c.ctx_ = ctx
  2744  	return c
  2745  }
  2746  
  2747  // Header returns a http.Header that can be modified by the caller to add
  2748  // headers to the request.
  2749  func (c *ProjectsLocationsTensorflowVersionsListCall) Header() http.Header {
  2750  	if c.header_ == nil {
  2751  		c.header_ = make(http.Header)
  2752  	}
  2753  	return c.header_
  2754  }
  2755  
  2756  func (c *ProjectsLocationsTensorflowVersionsListCall) doRequest(alt string) (*http.Response, error) {
  2757  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2758  	if c.ifNoneMatch_ != "" {
  2759  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2760  	}
  2761  	var body io.Reader = nil
  2762  	c.urlParams_.Set("alt", alt)
  2763  	c.urlParams_.Set("prettyPrint", "false")
  2764  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/tensorflowVersions")
  2765  	urls += "?" + c.urlParams_.Encode()
  2766  	req, err := http.NewRequest("GET", urls, body)
  2767  	if err != nil {
  2768  		return nil, err
  2769  	}
  2770  	req.Header = reqHeaders
  2771  	googleapi.Expand(req.URL, map[string]string{
  2772  		"parent": c.parent,
  2773  	})
  2774  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2775  }
  2776  
  2777  // Do executes the "tpu.projects.locations.tensorflowVersions.list" call.
  2778  // Any non-2xx status code is an error. Response headers are in either
  2779  // *ListTensorFlowVersionsResponse.ServerResponse.Header or (if a response was
  2780  // returned at all) in error.(*googleapi.Error).Header. Use
  2781  // googleapi.IsNotModified to check whether the returned error was because
  2782  // http.StatusNotModified was returned.
  2783  func (c *ProjectsLocationsTensorflowVersionsListCall) Do(opts ...googleapi.CallOption) (*ListTensorFlowVersionsResponse, error) {
  2784  	gensupport.SetOptions(c.urlParams_, opts...)
  2785  	res, err := c.doRequest("json")
  2786  	if res != nil && res.StatusCode == http.StatusNotModified {
  2787  		if res.Body != nil {
  2788  			res.Body.Close()
  2789  		}
  2790  		return nil, gensupport.WrapError(&googleapi.Error{
  2791  			Code:   res.StatusCode,
  2792  			Header: res.Header,
  2793  		})
  2794  	}
  2795  	if err != nil {
  2796  		return nil, err
  2797  	}
  2798  	defer googleapi.CloseBody(res)
  2799  	if err := googleapi.CheckResponse(res); err != nil {
  2800  		return nil, gensupport.WrapError(err)
  2801  	}
  2802  	ret := &ListTensorFlowVersionsResponse{
  2803  		ServerResponse: googleapi.ServerResponse{
  2804  			Header:         res.Header,
  2805  			HTTPStatusCode: res.StatusCode,
  2806  		},
  2807  	}
  2808  	target := &ret
  2809  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2810  		return nil, err
  2811  	}
  2812  	return ret, nil
  2813  }
  2814  
  2815  // Pages invokes f for each page of results.
  2816  // A non-nil error returned from f will halt the iteration.
  2817  // The provided context supersedes any context provided to the Context method.
  2818  func (c *ProjectsLocationsTensorflowVersionsListCall) Pages(ctx context.Context, f func(*ListTensorFlowVersionsResponse) error) error {
  2819  	c.ctx_ = ctx
  2820  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2821  	for {
  2822  		x, err := c.Do()
  2823  		if err != nil {
  2824  			return err
  2825  		}
  2826  		if err := f(x); err != nil {
  2827  			return err
  2828  		}
  2829  		if x.NextPageToken == "" {
  2830  			return nil
  2831  		}
  2832  		c.PageToken(x.NextPageToken)
  2833  	}
  2834  }
  2835  

View as plain text