...

Source file src/google.golang.org/api/notebooks/v2/notebooks-gen.go

Documentation: google.golang.org/api/notebooks/v2

     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 notebooks provides access to the Notebooks API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/notebooks/docs/
    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/notebooks/v2"
    27  //	...
    28  //	ctx := context.Background()
    29  //	notebooksService, err := notebooks.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  //	notebooksService, err := notebooks.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  //	notebooksService, err := notebooks.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package notebooks // import "google.golang.org/api/notebooks/v2"
    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 = "notebooks:v2"
    90  const apiName = "notebooks"
    91  const apiVersion = "v2"
    92  const basePath = "https://notebooks.googleapis.com/"
    93  const basePathTemplate = "https://notebooks.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://notebooks.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.Instances = NewProjectsLocationsInstancesService(s)
   172  	rs.Operations = NewProjectsLocationsOperationsService(s)
   173  	return rs
   174  }
   175  
   176  type ProjectsLocationsService struct {
   177  	s *Service
   178  
   179  	Instances *ProjectsLocationsInstancesService
   180  
   181  	Operations *ProjectsLocationsOperationsService
   182  }
   183  
   184  func NewProjectsLocationsInstancesService(s *Service) *ProjectsLocationsInstancesService {
   185  	rs := &ProjectsLocationsInstancesService{s: s}
   186  	return rs
   187  }
   188  
   189  type ProjectsLocationsInstancesService struct {
   190  	s *Service
   191  }
   192  
   193  func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
   194  	rs := &ProjectsLocationsOperationsService{s: s}
   195  	return rs
   196  }
   197  
   198  type ProjectsLocationsOperationsService struct {
   199  	s *Service
   200  }
   201  
   202  // AcceleratorConfig: An accelerator configuration for a VM instance Definition
   203  // of a hardware accelerator. Note that there is no check on `type` and
   204  // `core_count` combinations. TPUs are not supported. See GPUs on Compute
   205  // Engine (https://cloud.google.com/compute/docs/gpus/#gpus-list) to find a
   206  // valid combination.
   207  type AcceleratorConfig struct {
   208  	// CoreCount: Optional. Count of cores of this accelerator.
   209  	CoreCount int64 `json:"coreCount,omitempty,string"`
   210  	// Type: Optional. Type of this accelerator.
   211  	//
   212  	// Possible values:
   213  	//   "ACCELERATOR_TYPE_UNSPECIFIED" - Accelerator type is not specified.
   214  	//   "NVIDIA_TESLA_P100" - Accelerator type is Nvidia Tesla P100.
   215  	//   "NVIDIA_TESLA_V100" - Accelerator type is Nvidia Tesla V100.
   216  	//   "NVIDIA_TESLA_P4" - Accelerator type is Nvidia Tesla P4.
   217  	//   "NVIDIA_TESLA_T4" - Accelerator type is Nvidia Tesla T4.
   218  	//   "NVIDIA_TESLA_A100" - Accelerator type is Nvidia Tesla A100 - 40GB.
   219  	//   "NVIDIA_A100_80GB" - Accelerator type is Nvidia Tesla A100 - 80GB.
   220  	//   "NVIDIA_L4" - Accelerator type is Nvidia Tesla L4.
   221  	//   "NVIDIA_TESLA_T4_VWS" - Accelerator type is NVIDIA Tesla T4 Virtual
   222  	// Workstations.
   223  	//   "NVIDIA_TESLA_P100_VWS" - Accelerator type is NVIDIA Tesla P100 Virtual
   224  	// Workstations.
   225  	//   "NVIDIA_TESLA_P4_VWS" - Accelerator type is NVIDIA Tesla P4 Virtual
   226  	// Workstations.
   227  	Type string `json:"type,omitempty"`
   228  	// ForceSendFields is a list of field names (e.g. "CoreCount") to
   229  	// unconditionally include in API requests. By default, fields with empty or
   230  	// default values are omitted from API requests. See
   231  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   232  	// details.
   233  	ForceSendFields []string `json:"-"`
   234  	// NullFields is a list of field names (e.g. "CoreCount") to include in API
   235  	// requests with the JSON null value. By default, fields with empty values are
   236  	// omitted from API requests. See
   237  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   238  	NullFields []string `json:"-"`
   239  }
   240  
   241  func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
   242  	type NoMethod AcceleratorConfig
   243  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   244  }
   245  
   246  // Binding: Associates `members`, or principals, with a `role`.
   247  type Binding struct {
   248  	// Condition: The condition that is associated with this binding. If the
   249  	// condition evaluates to `true`, then this binding applies to the current
   250  	// request. If the condition evaluates to `false`, then this binding does not
   251  	// apply to the current request. However, a different role binding might grant
   252  	// the same role to one or more of the principals in this binding. To learn
   253  	// which resources support conditions in their IAM policies, see the IAM
   254  	// documentation
   255  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
   256  	Condition *Expr `json:"condition,omitempty"`
   257  	// Members: Specifies the principals requesting access for a Google Cloud
   258  	// resource. `members` can have the following values: * `allUsers`: A special
   259  	// identifier that represents anyone who is on the internet; with or without a
   260  	// Google account. * `allAuthenticatedUsers`: A special identifier that
   261  	// represents anyone who is authenticated with a Google account or a service
   262  	// account. Does not include identities that come from external identity
   263  	// providers (IdPs) through identity federation. * `user:{emailid}`: An email
   264  	// address that represents a specific Google account. For example,
   265  	// `alice@example.com` . * `serviceAccount:{emailid}`: An email address that
   266  	// represents a Google service account. For example,
   267  	// `my-other-app@appspot.gserviceaccount.com`. *
   268  	// `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
   269  	// identifier for a Kubernetes service account
   270  	// (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
   271  	// For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
   272  	// `group:{emailid}`: An email address that represents a Google group. For
   273  	// example, `admins@example.com`. * `domain:{domain}`: The G Suite domain
   274  	// (primary) that represents all the users of that domain. For example,
   275  	// `google.com` or `example.com`. *
   276  	// `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub
   277  	// ject/{subject_attribute_value}`: A single identity in a workforce identity
   278  	// pool. *
   279  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   280  	// group/{group_id}`: All workforce identities in a group. *
   281  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   282  	// attribute.{attribute_name}/{attribute_value}`: All workforce identities with
   283  	// a specific attribute value. *
   284  	// `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
   285  	// *`: All identities in a workforce identity pool. *
   286  	// `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo
   287  	// rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single
   288  	// identity in a workload identity pool. *
   289  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   290  	// /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool
   291  	// group. *
   292  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   293  	// /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
   294  	// `: All identities in a workload identity pool with a certain attribute. *
   295  	// `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
   296  	// /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity
   297  	// pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
   298  	// unique identifier) representing a user that has been recently deleted. For
   299  	// example, `alice@example.com?uid=123456789012345678901`. If the user is
   300  	// recovered, this value reverts to `user:{emailid}` and the recovered user
   301  	// retains the role in the binding. *
   302  	// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
   303  	// unique identifier) representing a service account that has been recently
   304  	// deleted. For example,
   305  	// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the
   306  	// service account is undeleted, this value reverts to
   307  	// `serviceAccount:{emailid}` and the undeleted service account retains the
   308  	// role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
   309  	// address (plus unique identifier) representing a Google group that has been
   310  	// recently deleted. For example,
   311  	// `admins@example.com?uid=123456789012345678901`. If the group is recovered,
   312  	// this value reverts to `group:{emailid}` and the recovered group retains the
   313  	// role in the binding. *
   314  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool
   315  	// _id}/subject/{subject_attribute_value}`: Deleted single identity in a
   316  	// workforce identity pool. For example,
   317  	// `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po
   318  	// ol-id/subject/my-subject-attribute-value`.
   319  	Members []string `json:"members,omitempty"`
   320  	// Role: Role that is assigned to the list of `members`, or principals. For
   321  	// example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview
   322  	// of the IAM roles and permissions, see the IAM documentation
   323  	// (https://cloud.google.com/iam/docs/roles-overview). For a list of the
   324  	// available pre-defined roles, see here
   325  	// (https://cloud.google.com/iam/docs/understanding-roles).
   326  	Role string `json:"role,omitempty"`
   327  	// ForceSendFields is a list of field names (e.g. "Condition") to
   328  	// unconditionally include in API requests. By default, fields with empty or
   329  	// default values are omitted from API requests. See
   330  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   331  	// details.
   332  	ForceSendFields []string `json:"-"`
   333  	// NullFields is a list of field names (e.g. "Condition") to include in API
   334  	// requests with the JSON null value. By default, fields with empty values are
   335  	// omitted from API requests. See
   336  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   337  	NullFields []string `json:"-"`
   338  }
   339  
   340  func (s *Binding) MarshalJSON() ([]byte, error) {
   341  	type NoMethod Binding
   342  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   343  }
   344  
   345  // BootDisk: The definition of a boot disk.
   346  type BootDisk struct {
   347  	// DiskEncryption: Optional. Input only. Disk encryption method used on the
   348  	// boot and data disks, defaults to GMEK.
   349  	//
   350  	// Possible values:
   351  	//   "DISK_ENCRYPTION_UNSPECIFIED" - Disk encryption is not specified.
   352  	//   "GMEK" - Use Google managed encryption keys to encrypt the boot disk.
   353  	//   "CMEK" - Use customer managed encryption keys to encrypt the boot disk.
   354  	DiskEncryption string `json:"diskEncryption,omitempty"`
   355  	// DiskSizeGb: Optional. The size of the boot disk in GB attached to this
   356  	// instance, up to a maximum of 64000 GB (64 TB). If not specified, this
   357  	// defaults to the recommended value of 150GB.
   358  	DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
   359  	// DiskType: Optional. Indicates the type of the disk.
   360  	//
   361  	// Possible values:
   362  	//   "DISK_TYPE_UNSPECIFIED" - Disk type not set.
   363  	//   "PD_STANDARD" - Standard persistent disk type.
   364  	//   "PD_SSD" - SSD persistent disk type.
   365  	//   "PD_BALANCED" - Balanced persistent disk type.
   366  	//   "PD_EXTREME" - Extreme persistent disk type.
   367  	DiskType string `json:"diskType,omitempty"`
   368  	// KmsKey: Optional. Input only. The KMS key used to encrypt the disks, only
   369  	// applicable if disk_encryption is CMEK. Format:
   370  	// `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys
   371  	// /{key_id}` Learn more about using your own encryption keys.
   372  	KmsKey string `json:"kmsKey,omitempty"`
   373  	// ForceSendFields is a list of field names (e.g. "DiskEncryption") to
   374  	// unconditionally include in API requests. By default, fields with empty or
   375  	// default values are omitted from API requests. See
   376  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   377  	// details.
   378  	ForceSendFields []string `json:"-"`
   379  	// NullFields is a list of field names (e.g. "DiskEncryption") to include in
   380  	// API requests with the JSON null value. By default, fields with empty values
   381  	// are omitted from API requests. See
   382  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   383  	NullFields []string `json:"-"`
   384  }
   385  
   386  func (s *BootDisk) MarshalJSON() ([]byte, error) {
   387  	type NoMethod BootDisk
   388  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   389  }
   390  
   391  // CancelOperationRequest: The request message for Operations.CancelOperation.
   392  type CancelOperationRequest struct {
   393  }
   394  
   395  // CheckInstanceUpgradabilityResponse: Response for checking if a notebook
   396  // instance is upgradeable.
   397  type CheckInstanceUpgradabilityResponse struct {
   398  	// UpgradeImage: The new image self link this instance will be upgraded to if
   399  	// calling the upgrade endpoint. This field will only be populated if field
   400  	// upgradeable is true.
   401  	UpgradeImage string `json:"upgradeImage,omitempty"`
   402  	// UpgradeInfo: Additional information about upgrade.
   403  	UpgradeInfo string `json:"upgradeInfo,omitempty"`
   404  	// UpgradeVersion: The version this instance will be upgraded to if calling the
   405  	// upgrade endpoint. This field will only be populated if field upgradeable is
   406  	// true.
   407  	UpgradeVersion string `json:"upgradeVersion,omitempty"`
   408  	// Upgradeable: If an instance is upgradeable.
   409  	Upgradeable bool `json:"upgradeable,omitempty"`
   410  
   411  	// ServerResponse contains the HTTP response code and headers from the server.
   412  	googleapi.ServerResponse `json:"-"`
   413  	// ForceSendFields is a list of field names (e.g. "UpgradeImage") to
   414  	// unconditionally include in API requests. By default, fields with empty or
   415  	// default values are omitted from API requests. See
   416  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   417  	// details.
   418  	ForceSendFields []string `json:"-"`
   419  	// NullFields is a list of field names (e.g. "UpgradeImage") to include in API
   420  	// requests with the JSON null value. By default, fields with empty values are
   421  	// omitted from API requests. See
   422  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   423  	NullFields []string `json:"-"`
   424  }
   425  
   426  func (s *CheckInstanceUpgradabilityResponse) MarshalJSON() ([]byte, error) {
   427  	type NoMethod CheckInstanceUpgradabilityResponse
   428  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   429  }
   430  
   431  // Config: Response for getting WbI configurations in a location
   432  type Config struct {
   433  	// AvailableImages: Output only. The list of available images to create a WbI.
   434  	AvailableImages []*ImageRelease `json:"availableImages,omitempty"`
   435  	// DefaultValues: Output only. The default values for configuration.
   436  	DefaultValues *DefaultValues `json:"defaultValues,omitempty"`
   437  	// SupportedValues: Output only. The supported values for configuration.
   438  	SupportedValues *SupportedValues `json:"supportedValues,omitempty"`
   439  
   440  	// ServerResponse contains the HTTP response code and headers from the server.
   441  	googleapi.ServerResponse `json:"-"`
   442  	// ForceSendFields is a list of field names (e.g. "AvailableImages") to
   443  	// unconditionally include in API requests. By default, fields with empty or
   444  	// default values are omitted from API requests. See
   445  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   446  	// details.
   447  	ForceSendFields []string `json:"-"`
   448  	// NullFields is a list of field names (e.g. "AvailableImages") to include in
   449  	// API requests with the JSON null value. By default, fields with empty values
   450  	// are omitted from API requests. See
   451  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   452  	NullFields []string `json:"-"`
   453  }
   454  
   455  func (s *Config) MarshalJSON() ([]byte, error) {
   456  	type NoMethod Config
   457  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   458  }
   459  
   460  // ContainerImage: Definition of a container image for starting a notebook
   461  // instance with the environment installed in a container.
   462  type ContainerImage struct {
   463  	// Repository: Required. The path to the container image repository. For
   464  	// example: `gcr.io/{project_id}/{image_name}`
   465  	Repository string `json:"repository,omitempty"`
   466  	// Tag: Optional. The tag of the container image. If not specified, this
   467  	// defaults to the latest tag.
   468  	Tag string `json:"tag,omitempty"`
   469  	// ForceSendFields is a list of field names (e.g. "Repository") to
   470  	// unconditionally include in API requests. By default, fields with empty or
   471  	// default values are omitted from API requests. See
   472  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   473  	// details.
   474  	ForceSendFields []string `json:"-"`
   475  	// NullFields is a list of field names (e.g. "Repository") to include in API
   476  	// requests with the JSON null value. By default, fields with empty values are
   477  	// omitted from API requests. See
   478  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   479  	NullFields []string `json:"-"`
   480  }
   481  
   482  func (s *ContainerImage) MarshalJSON() ([]byte, error) {
   483  	type NoMethod ContainerImage
   484  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   485  }
   486  
   487  // DataDisk: An instance-attached disk resource.
   488  type DataDisk struct {
   489  	// DiskEncryption: Optional. Input only. Disk encryption method used on the
   490  	// boot and data disks, defaults to GMEK.
   491  	//
   492  	// Possible values:
   493  	//   "DISK_ENCRYPTION_UNSPECIFIED" - Disk encryption is not specified.
   494  	//   "GMEK" - Use Google managed encryption keys to encrypt the boot disk.
   495  	//   "CMEK" - Use customer managed encryption keys to encrypt the boot disk.
   496  	DiskEncryption string `json:"diskEncryption,omitempty"`
   497  	// DiskSizeGb: Optional. The size of the disk in GB attached to this VM
   498  	// instance, up to a maximum of 64000 GB (64 TB). If not specified, this
   499  	// defaults to 100.
   500  	DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
   501  	// DiskType: Optional. Input only. Indicates the type of the disk.
   502  	//
   503  	// Possible values:
   504  	//   "DISK_TYPE_UNSPECIFIED" - Disk type not set.
   505  	//   "PD_STANDARD" - Standard persistent disk type.
   506  	//   "PD_SSD" - SSD persistent disk type.
   507  	//   "PD_BALANCED" - Balanced persistent disk type.
   508  	//   "PD_EXTREME" - Extreme persistent disk type.
   509  	DiskType string `json:"diskType,omitempty"`
   510  	// KmsKey: Optional. Input only. The KMS key used to encrypt the disks, only
   511  	// applicable if disk_encryption is CMEK. Format:
   512  	// `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys
   513  	// /{key_id}` Learn more about using your own encryption keys.
   514  	KmsKey string `json:"kmsKey,omitempty"`
   515  	// ForceSendFields is a list of field names (e.g. "DiskEncryption") to
   516  	// unconditionally include in API requests. By default, fields with empty or
   517  	// default values are omitted from API requests. See
   518  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   519  	// details.
   520  	ForceSendFields []string `json:"-"`
   521  	// NullFields is a list of field names (e.g. "DiskEncryption") to include in
   522  	// API requests with the JSON null value. By default, fields with empty values
   523  	// are omitted from API requests. See
   524  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   525  	NullFields []string `json:"-"`
   526  }
   527  
   528  func (s *DataDisk) MarshalJSON() ([]byte, error) {
   529  	type NoMethod DataDisk
   530  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   531  }
   532  
   533  // DefaultValues: DefaultValues represents the default configuration values.
   534  type DefaultValues struct {
   535  	// MachineType: Output only. The default machine type used by the backend if
   536  	// not provided by the user.
   537  	MachineType string `json:"machineType,omitempty"`
   538  	// ForceSendFields is a list of field names (e.g. "MachineType") to
   539  	// unconditionally include in API requests. By default, fields with empty or
   540  	// default values are omitted from API requests. See
   541  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   542  	// details.
   543  	ForceSendFields []string `json:"-"`
   544  	// NullFields is a list of field names (e.g. "MachineType") to include in API
   545  	// requests with the JSON null value. By default, fields with empty values are
   546  	// omitted from API requests. See
   547  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   548  	NullFields []string `json:"-"`
   549  }
   550  
   551  func (s *DefaultValues) MarshalJSON() ([]byte, error) {
   552  	type NoMethod DefaultValues
   553  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   554  }
   555  
   556  // DiagnoseInstanceRequest: Request for creating a notebook instance diagnostic
   557  // file.
   558  type DiagnoseInstanceRequest struct {
   559  	// DiagnosticConfig: Required. Defines flags that are used to run the
   560  	// diagnostic tool
   561  	DiagnosticConfig *DiagnosticConfig `json:"diagnosticConfig,omitempty"`
   562  	// TimeoutMinutes: Optional. Maxmium amount of time in minutes before the
   563  	// operation times out.
   564  	TimeoutMinutes int64 `json:"timeoutMinutes,omitempty"`
   565  	// ForceSendFields is a list of field names (e.g. "DiagnosticConfig") to
   566  	// unconditionally include in API requests. By default, fields with empty or
   567  	// default values are omitted from API requests. See
   568  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   569  	// details.
   570  	ForceSendFields []string `json:"-"`
   571  	// NullFields is a list of field names (e.g. "DiagnosticConfig") to include in
   572  	// API requests with the JSON null value. By default, fields with empty values
   573  	// are omitted from API requests. See
   574  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   575  	NullFields []string `json:"-"`
   576  }
   577  
   578  func (s *DiagnoseInstanceRequest) MarshalJSON() ([]byte, error) {
   579  	type NoMethod DiagnoseInstanceRequest
   580  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   581  }
   582  
   583  // DiagnosticConfig: Defines flags that are used to run the diagnostic tool
   584  type DiagnosticConfig struct {
   585  	// EnableCopyHomeFilesFlag: Optional. Enables flag to copy all `/home/jupyter`
   586  	// folder contents
   587  	EnableCopyHomeFilesFlag bool `json:"enableCopyHomeFilesFlag,omitempty"`
   588  	// EnablePacketCaptureFlag: Optional. Enables flag to capture packets from the
   589  	// instance for 30 seconds
   590  	EnablePacketCaptureFlag bool `json:"enablePacketCaptureFlag,omitempty"`
   591  	// EnableRepairFlag: Optional. Enables flag to repair service for instance
   592  	EnableRepairFlag bool `json:"enableRepairFlag,omitempty"`
   593  	// GcsBucket: Required. User Cloud Storage bucket location (REQUIRED). Must be
   594  	// formatted with path prefix (`gs://$GCS_BUCKET`). Permissions: User Managed
   595  	// Notebooks: - storage.buckets.writer: Must be given to the project's service
   596  	// account attached to VM. Google Managed Notebooks: - storage.buckets.writer:
   597  	// Must be given to the project's service account or user credentials attached
   598  	// to VM depending on authentication mode. Cloud Storage bucket Log file will
   599  	// be written to `gs://$GCS_BUCKET/$RELATIVE_PATH/$VM_DATE_$TIME.tar.gz`
   600  	GcsBucket string `json:"gcsBucket,omitempty"`
   601  	// RelativePath: Optional. Defines the relative storage path in the Cloud
   602  	// Storage bucket where the diagnostic logs will be written: Default path will
   603  	// be the root directory of the Cloud Storage bucket
   604  	// (`gs://$GCS_BUCKET/$DATE_$TIME.tar.gz`) Example of full path where Log file
   605  	// will be written: `gs://$GCS_BUCKET/$RELATIVE_PATH/`
   606  	RelativePath string `json:"relativePath,omitempty"`
   607  	// ForceSendFields is a list of field names (e.g. "EnableCopyHomeFilesFlag") to
   608  	// unconditionally include in API requests. By default, fields with empty or
   609  	// default values are omitted from API requests. See
   610  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   611  	// details.
   612  	ForceSendFields []string `json:"-"`
   613  	// NullFields is a list of field names (e.g. "EnableCopyHomeFilesFlag") to
   614  	// include in API requests with the JSON null value. By default, fields with
   615  	// empty values are omitted from API requests. See
   616  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   617  	NullFields []string `json:"-"`
   618  }
   619  
   620  func (s *DiagnosticConfig) MarshalJSON() ([]byte, error) {
   621  	type NoMethod DiagnosticConfig
   622  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   623  }
   624  
   625  // Empty: A generic empty message that you can re-use to avoid defining
   626  // duplicated empty messages in your APIs. A typical example is to use it as
   627  // the request or the response type of an API method. For instance: service Foo
   628  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   629  type Empty struct {
   630  	// ServerResponse contains the HTTP response code and headers from the server.
   631  	googleapi.ServerResponse `json:"-"`
   632  }
   633  
   634  // Event: The definition of an Event for a managed / semi-managed notebook
   635  // instance.
   636  type Event struct {
   637  	// Details: Optional. Event details. This field is used to pass event
   638  	// information.
   639  	Details map[string]string `json:"details,omitempty"`
   640  	// ReportTime: Optional. Event report time.
   641  	ReportTime string `json:"reportTime,omitempty"`
   642  	// Type: Optional. Event type.
   643  	//
   644  	// Possible values:
   645  	//   "EVENT_TYPE_UNSPECIFIED" - Event is not specified.
   646  	//   "IDLE" - The instance / runtime is idle
   647  	//   "HEARTBEAT" - The instance / runtime is available. This event indicates
   648  	// that instance / runtime underlying compute is operational.
   649  	//   "HEALTH" - The instance / runtime health is available. This event
   650  	// indicates that instance / runtime health information.
   651  	//   "MAINTENANCE" - The instance / runtime is available. This event allows
   652  	// instance / runtime to send Host maintenance information to Control Plane.
   653  	// https://cloud.google.com/compute/docs/gpus/gpu-host-maintenance
   654  	//   "METADATA_CHANGE" - The instance / runtime is available. This event
   655  	// indicates that the instance had metadata that needs to be modified.
   656  	Type string `json:"type,omitempty"`
   657  	// ForceSendFields is a list of field names (e.g. "Details") to unconditionally
   658  	// include in API requests. By default, fields with empty or default values are
   659  	// omitted from API requests. See
   660  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   661  	// details.
   662  	ForceSendFields []string `json:"-"`
   663  	// NullFields is a list of field names (e.g. "Details") to include in API
   664  	// requests with the JSON null value. By default, fields with empty values are
   665  	// omitted from API requests. See
   666  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   667  	NullFields []string `json:"-"`
   668  }
   669  
   670  func (s *Event) MarshalJSON() ([]byte, error) {
   671  	type NoMethod Event
   672  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   673  }
   674  
   675  // Expr: Represents a textual expression in the Common Expression Language
   676  // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics
   677  // of CEL are documented at https://github.com/google/cel-spec. Example
   678  // (Comparison): title: "Summary size limit" description: "Determines if a
   679  // summary is less than 100 chars" expression: "document.summary.size() < 100"
   680  // Example (Equality): title: "Requestor is owner" description: "Determines if
   681  // requestor is the document owner" expression: "document.owner ==
   682  // request.auth.claims.email" Example (Logic): title: "Public documents"
   683  // description: "Determine whether the document should be publicly visible"
   684  // expression: "document.type != 'private' && document.type != 'internal'"
   685  // Example (Data Manipulation): title: "Notification string" description:
   686  // "Create a notification string with a timestamp." expression: "'New message
   687  // received at ' + string(document.create_time)" The exact variables and
   688  // functions that may be referenced within an expression are determined by the
   689  // service that evaluates it. See the service documentation for additional
   690  // information.
   691  type Expr struct {
   692  	// Description: Optional. Description of the expression. This is a longer text
   693  	// which describes the expression, e.g. when hovered over it in a UI.
   694  	Description string `json:"description,omitempty"`
   695  	// Expression: Textual representation of an expression in Common Expression
   696  	// Language syntax.
   697  	Expression string `json:"expression,omitempty"`
   698  	// Location: Optional. String indicating the location of the expression for
   699  	// error reporting, e.g. a file name and a position in the file.
   700  	Location string `json:"location,omitempty"`
   701  	// Title: Optional. Title for the expression, i.e. a short string describing
   702  	// its purpose. This can be used e.g. in UIs which allow to enter the
   703  	// expression.
   704  	Title string `json:"title,omitempty"`
   705  	// ForceSendFields is a list of field names (e.g. "Description") to
   706  	// unconditionally include in API requests. By default, fields with empty or
   707  	// default values are omitted from API requests. See
   708  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   709  	// details.
   710  	ForceSendFields []string `json:"-"`
   711  	// NullFields is a list of field names (e.g. "Description") to include in API
   712  	// requests with the JSON null value. By default, fields with empty values are
   713  	// omitted from API requests. See
   714  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   715  	NullFields []string `json:"-"`
   716  }
   717  
   718  func (s *Expr) MarshalJSON() ([]byte, error) {
   719  	type NoMethod Expr
   720  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   721  }
   722  
   723  // GPUDriverConfig: A GPU driver configuration
   724  type GPUDriverConfig struct {
   725  	// CustomGpuDriverPath: Optional. Specify a custom Cloud Storage path where the
   726  	// GPU driver is stored. If not specified, we'll automatically choose from
   727  	// official GPU drivers.
   728  	CustomGpuDriverPath string `json:"customGpuDriverPath,omitempty"`
   729  	// EnableGpuDriver: Optional. Whether the end user authorizes Google Cloud to
   730  	// install GPU driver on this VM instance. If this field is empty or set to
   731  	// false, the GPU driver won't be installed. Only applicable to instances with
   732  	// GPUs.
   733  	EnableGpuDriver bool `json:"enableGpuDriver,omitempty"`
   734  	// ForceSendFields is a list of field names (e.g. "CustomGpuDriverPath") to
   735  	// unconditionally include in API requests. By default, fields with empty or
   736  	// default values are omitted from API requests. See
   737  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   738  	// details.
   739  	ForceSendFields []string `json:"-"`
   740  	// NullFields is a list of field names (e.g. "CustomGpuDriverPath") to include
   741  	// in API requests with the JSON null value. By default, fields with empty
   742  	// values are omitted from API requests. See
   743  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   744  	NullFields []string `json:"-"`
   745  }
   746  
   747  func (s *GPUDriverConfig) MarshalJSON() ([]byte, error) {
   748  	type NoMethod GPUDriverConfig
   749  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   750  }
   751  
   752  // GceSetup: The definition of how to configure a VM instance outside of
   753  // Resources and Identity.
   754  type GceSetup struct {
   755  	// AcceleratorConfigs: Optional. The hardware accelerators used on this
   756  	// instance. If you use accelerators, make sure that your configuration has
   757  	// enough vCPUs and memory to support the `machine_type` you have selected
   758  	// (https://cloud.google.com/compute/docs/gpus/#gpus-list). Currently supports
   759  	// only one accelerator configuration.
   760  	AcceleratorConfigs []*AcceleratorConfig `json:"acceleratorConfigs,omitempty"`
   761  	// BootDisk: Optional. The boot disk for the VM.
   762  	BootDisk *BootDisk `json:"bootDisk,omitempty"`
   763  	// ContainerImage: Optional. Use a container image to start the notebook
   764  	// instance.
   765  	ContainerImage *ContainerImage `json:"containerImage,omitempty"`
   766  	// DataDisks: Optional. Data disks attached to the VM instance. Currently
   767  	// supports only one data disk.
   768  	DataDisks []*DataDisk `json:"dataDisks,omitempty"`
   769  	// DisablePublicIp: Optional. If true, no external IP will be assigned to this
   770  	// VM instance.
   771  	DisablePublicIp bool `json:"disablePublicIp,omitempty"`
   772  	// EnableIpForwarding: Optional. Flag to enable ip forwarding or not, default
   773  	// false/off. https://cloud.google.com/vpc/docs/using-routes#canipforward
   774  	EnableIpForwarding bool `json:"enableIpForwarding,omitempty"`
   775  	// GpuDriverConfig: Optional. Configuration for GPU drivers.
   776  	GpuDriverConfig *GPUDriverConfig `json:"gpuDriverConfig,omitempty"`
   777  	// MachineType: Optional. The machine type of the VM instance.
   778  	// https://cloud.google.com/compute/docs/machine-resource
   779  	MachineType string `json:"machineType,omitempty"`
   780  	// Metadata: Optional. Custom metadata to apply to this instance.
   781  	Metadata map[string]string `json:"metadata,omitempty"`
   782  	// NetworkInterfaces: Optional. The network interfaces for the VM. Supports
   783  	// only one interface.
   784  	NetworkInterfaces []*NetworkInterface `json:"networkInterfaces,omitempty"`
   785  	// ServiceAccounts: Optional. The service account that serves as an identity
   786  	// for the VM instance. Currently supports only one service account.
   787  	ServiceAccounts []*ServiceAccount `json:"serviceAccounts,omitempty"`
   788  	// ShieldedInstanceConfig: Optional. Shielded VM configuration. Images using
   789  	// supported Shielded VM features
   790  	// (https://cloud.google.com/compute/docs/instances/modifying-shielded-vm).
   791  	ShieldedInstanceConfig *ShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"`
   792  	// Tags: Optional. The Compute Engine tags to add to runtime (see Tagging
   793  	// instances
   794  	// (https://cloud.google.com/compute/docs/label-or-tag-resources#tags)).
   795  	Tags []string `json:"tags,omitempty"`
   796  	// VmImage: Optional. Use a Compute Engine VM image to start the notebook
   797  	// instance.
   798  	VmImage *VmImage `json:"vmImage,omitempty"`
   799  	// ForceSendFields is a list of field names (e.g. "AcceleratorConfigs") to
   800  	// unconditionally include in API requests. By default, fields with empty or
   801  	// default values are omitted from API requests. See
   802  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   803  	// details.
   804  	ForceSendFields []string `json:"-"`
   805  	// NullFields is a list of field names (e.g. "AcceleratorConfigs") to include
   806  	// in API requests with the JSON null value. By default, fields with empty
   807  	// values are omitted from API requests. See
   808  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   809  	NullFields []string `json:"-"`
   810  }
   811  
   812  func (s *GceSetup) MarshalJSON() ([]byte, error) {
   813  	type NoMethod GceSetup
   814  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   815  }
   816  
   817  // ImageRelease: ConfigImage represents an image release available to create a
   818  // WbI
   819  type ImageRelease struct {
   820  	// ImageName: Output only. The name of the image of the form
   821  	// workbench-instances-vYYYYmmdd--
   822  	ImageName string `json:"imageName,omitempty"`
   823  	// ReleaseName: Output only. The release of the image of the form m123
   824  	ReleaseName string `json:"releaseName,omitempty"`
   825  	// ForceSendFields is a list of field names (e.g. "ImageName") to
   826  	// unconditionally include in API requests. By default, fields with empty or
   827  	// default values are omitted from API requests. See
   828  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   829  	// details.
   830  	ForceSendFields []string `json:"-"`
   831  	// NullFields is a list of field names (e.g. "ImageName") to include in API
   832  	// requests with the JSON null value. By default, fields with empty values are
   833  	// omitted from API requests. See
   834  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   835  	NullFields []string `json:"-"`
   836  }
   837  
   838  func (s *ImageRelease) MarshalJSON() ([]byte, error) {
   839  	type NoMethod ImageRelease
   840  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   841  }
   842  
   843  // Instance: The definition of a notebook instance.
   844  type Instance struct {
   845  	// CreateTime: Output only. Instance creation time.
   846  	CreateTime string `json:"createTime,omitempty"`
   847  	// Creator: Output only. Email address of entity that sent original
   848  	// CreateInstance request.
   849  	Creator string `json:"creator,omitempty"`
   850  	// DisableProxyAccess: Optional. If true, the notebook instance will not
   851  	// register with the proxy.
   852  	DisableProxyAccess bool `json:"disableProxyAccess,omitempty"`
   853  	// GceSetup: Optional. Compute Engine setup for the notebook. Uses
   854  	// notebook-defined fields.
   855  	GceSetup *GceSetup `json:"gceSetup,omitempty"`
   856  	// HealthInfo: Output only. Additional information about instance health.
   857  	// Example: healthInfo": { "docker_proxy_agent_status": "1", "docker_status":
   858  	// "1", "jupyterlab_api_status": "-1", "jupyterlab_status": "-1", "updated":
   859  	// "2020-10-18 09:40:03.573409" }
   860  	HealthInfo map[string]string `json:"healthInfo,omitempty"`
   861  	// HealthState: Output only. Instance health_state.
   862  	//
   863  	// Possible values:
   864  	//   "HEALTH_STATE_UNSPECIFIED" - The instance substate is unknown.
   865  	//   "HEALTHY" - The instance is known to be in an healthy state (for example,
   866  	// critical daemons are running) Applies to ACTIVE state.
   867  	//   "UNHEALTHY" - The instance is known to be in an unhealthy state (for
   868  	// example, critical daemons are not running) Applies to ACTIVE state.
   869  	//   "AGENT_NOT_INSTALLED" - The instance has not installed health monitoring
   870  	// agent. Applies to ACTIVE state.
   871  	//   "AGENT_NOT_RUNNING" - The instance health monitoring agent is not running.
   872  	// Applies to ACTIVE state.
   873  	HealthState string `json:"healthState,omitempty"`
   874  	// Id: Output only. Unique ID of the resource.
   875  	Id string `json:"id,omitempty"`
   876  	// InstanceOwners: Optional. Input only. The owner of this instance after
   877  	// creation. Format: `alias@example.com` Currently supports one owner only. If
   878  	// not specified, all of the service account users of your VM instance's
   879  	// service account can use the instance.
   880  	InstanceOwners []string `json:"instanceOwners,omitempty"`
   881  	// Labels: Optional. Labels to apply to this instance. These can be later
   882  	// modified by the UpdateInstance method.
   883  	Labels map[string]string `json:"labels,omitempty"`
   884  	// Name: Output only. The name of this notebook instance. Format:
   885  	// `projects/{project_id}/locations/{location}/instances/{instance_id}`
   886  	Name string `json:"name,omitempty"`
   887  	// ProxyUri: Output only. The proxy endpoint that is used to access the Jupyter
   888  	// notebook.
   889  	ProxyUri string `json:"proxyUri,omitempty"`
   890  	// State: Output only. The state of this instance.
   891  	//
   892  	// Possible values:
   893  	//   "STATE_UNSPECIFIED" - State is not specified.
   894  	//   "STARTING" - The control logic is starting the instance.
   895  	//   "PROVISIONING" - The control logic is installing required frameworks and
   896  	// registering the instance with notebook proxy
   897  	//   "ACTIVE" - The instance is running.
   898  	//   "STOPPING" - The control logic is stopping the instance.
   899  	//   "STOPPED" - The instance is stopped.
   900  	//   "DELETED" - The instance is deleted.
   901  	//   "UPGRADING" - The instance is upgrading.
   902  	//   "INITIALIZING" - The instance is being created.
   903  	//   "SUSPENDING" - The instance is suspending.
   904  	//   "SUSPENDED" - The instance is suspended.
   905  	State string `json:"state,omitempty"`
   906  	// ThirdPartyProxyUrl: Output only. The workforce pools proxy endpoint that is
   907  	// used to access the Jupyter notebook.
   908  	ThirdPartyProxyUrl string `json:"thirdPartyProxyUrl,omitempty"`
   909  	// UpdateTime: Output only. Instance update time.
   910  	UpdateTime string `json:"updateTime,omitempty"`
   911  	// UpgradeHistory: Output only. The upgrade history of this instance.
   912  	UpgradeHistory []*UpgradeHistoryEntry `json:"upgradeHistory,omitempty"`
   913  
   914  	// ServerResponse contains the HTTP response code and headers from the server.
   915  	googleapi.ServerResponse `json:"-"`
   916  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   917  	// unconditionally include in API requests. By default, fields with empty or
   918  	// default values are omitted from API requests. See
   919  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   920  	// details.
   921  	ForceSendFields []string `json:"-"`
   922  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   923  	// requests with the JSON null value. By default, fields with empty values are
   924  	// omitted from API requests. See
   925  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   926  	NullFields []string `json:"-"`
   927  }
   928  
   929  func (s *Instance) MarshalJSON() ([]byte, error) {
   930  	type NoMethod Instance
   931  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   932  }
   933  
   934  // ListInstancesResponse: Response for listing notebook instances.
   935  type ListInstancesResponse struct {
   936  	// Instances: A list of returned instances.
   937  	Instances []*Instance `json:"instances,omitempty"`
   938  	// NextPageToken: Page token that can be used to continue listing from the last
   939  	// result in the next list call.
   940  	NextPageToken string `json:"nextPageToken,omitempty"`
   941  	// Unreachable: Locations that could not be reached. For example,
   942  	// ['us-west1-a', 'us-central1-b']. A ListInstancesResponse will only contain
   943  	// either instances or unreachables,
   944  	Unreachable []string `json:"unreachable,omitempty"`
   945  
   946  	// ServerResponse contains the HTTP response code and headers from the server.
   947  	googleapi.ServerResponse `json:"-"`
   948  	// ForceSendFields is a list of field names (e.g. "Instances") to
   949  	// unconditionally include in API requests. By default, fields with empty or
   950  	// default values are omitted from API requests. See
   951  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   952  	// details.
   953  	ForceSendFields []string `json:"-"`
   954  	// NullFields is a list of field names (e.g. "Instances") to include in API
   955  	// requests with the JSON null value. By default, fields with empty values are
   956  	// omitted from API requests. See
   957  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   958  	NullFields []string `json:"-"`
   959  }
   960  
   961  func (s *ListInstancesResponse) MarshalJSON() ([]byte, error) {
   962  	type NoMethod ListInstancesResponse
   963  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   964  }
   965  
   966  // ListLocationsResponse: The response message for Locations.ListLocations.
   967  type ListLocationsResponse struct {
   968  	// Locations: A list of locations that matches the specified filter in the
   969  	// request.
   970  	Locations []*Location `json:"locations,omitempty"`
   971  	// NextPageToken: The standard List next-page token.
   972  	NextPageToken string `json:"nextPageToken,omitempty"`
   973  
   974  	// ServerResponse contains the HTTP response code and headers from the server.
   975  	googleapi.ServerResponse `json:"-"`
   976  	// ForceSendFields is a list of field names (e.g. "Locations") to
   977  	// unconditionally include in API requests. By default, fields with empty or
   978  	// default values are omitted from API requests. See
   979  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   980  	// details.
   981  	ForceSendFields []string `json:"-"`
   982  	// NullFields is a list of field names (e.g. "Locations") to include in API
   983  	// requests with the JSON null value. By default, fields with empty values are
   984  	// omitted from API requests. See
   985  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   986  	NullFields []string `json:"-"`
   987  }
   988  
   989  func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
   990  	type NoMethod ListLocationsResponse
   991  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   992  }
   993  
   994  // ListOperationsResponse: The response message for Operations.ListOperations.
   995  type ListOperationsResponse struct {
   996  	// NextPageToken: The standard List next-page token.
   997  	NextPageToken string `json:"nextPageToken,omitempty"`
   998  	// Operations: A list of operations that matches the specified filter in the
   999  	// request.
  1000  	Operations []*Operation `json:"operations,omitempty"`
  1001  
  1002  	// ServerResponse contains the HTTP response code and headers from the server.
  1003  	googleapi.ServerResponse `json:"-"`
  1004  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1005  	// unconditionally include in API requests. By default, fields with empty or
  1006  	// default values are omitted from API requests. See
  1007  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1008  	// details.
  1009  	ForceSendFields []string `json:"-"`
  1010  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1011  	// requests with the JSON null value. By default, fields with empty values are
  1012  	// omitted from API requests. See
  1013  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1014  	NullFields []string `json:"-"`
  1015  }
  1016  
  1017  func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  1018  	type NoMethod ListOperationsResponse
  1019  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1020  }
  1021  
  1022  // Location: A resource that represents a Google Cloud location.
  1023  type Location struct {
  1024  	// DisplayName: The friendly name for this location, typically a nearby city
  1025  	// name. For example, "Tokyo".
  1026  	DisplayName string `json:"displayName,omitempty"`
  1027  	// Labels: Cross-service attributes for the location. For example
  1028  	// {"cloud.googleapis.com/region": "us-east1"}
  1029  	Labels map[string]string `json:"labels,omitempty"`
  1030  	// LocationId: The canonical id for this location. For example: "us-east1".
  1031  	LocationId string `json:"locationId,omitempty"`
  1032  	// Metadata: Service-specific metadata. For example the available capacity at
  1033  	// the given location.
  1034  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  1035  	// Name: Resource name for the location, which may vary between
  1036  	// implementations. For example:
  1037  	// "projects/example-project/locations/us-east1"
  1038  	Name string `json:"name,omitempty"`
  1039  
  1040  	// ServerResponse contains the HTTP response code and headers from the server.
  1041  	googleapi.ServerResponse `json:"-"`
  1042  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
  1043  	// unconditionally include in API requests. By default, fields with empty or
  1044  	// default values are omitted from API requests. See
  1045  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1046  	// details.
  1047  	ForceSendFields []string `json:"-"`
  1048  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
  1049  	// requests with the JSON null value. By default, fields with empty values are
  1050  	// omitted from API requests. See
  1051  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1052  	NullFields []string `json:"-"`
  1053  }
  1054  
  1055  func (s *Location) MarshalJSON() ([]byte, error) {
  1056  	type NoMethod Location
  1057  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1058  }
  1059  
  1060  // NetworkInterface: The definition of a network interface resource attached to
  1061  // a VM.
  1062  type NetworkInterface struct {
  1063  	// Network: Optional. The name of the VPC that this VM instance is in. Format:
  1064  	// `projects/{project_id}/global/networks/{network_id}`
  1065  	Network string `json:"network,omitempty"`
  1066  	// NicType: Optional. The type of vNIC to be used on this interface. This may
  1067  	// be gVNIC or VirtioNet.
  1068  	//
  1069  	// Possible values:
  1070  	//   "NIC_TYPE_UNSPECIFIED" - No type specified.
  1071  	//   "VIRTIO_NET" - VIRTIO
  1072  	//   "GVNIC" - GVNIC
  1073  	NicType string `json:"nicType,omitempty"`
  1074  	// Subnet: Optional. The name of the subnet that this VM instance is in.
  1075  	// Format: `projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}`
  1076  	Subnet string `json:"subnet,omitempty"`
  1077  	// ForceSendFields is a list of field names (e.g. "Network") to unconditionally
  1078  	// include in API requests. By default, fields with empty or default values are
  1079  	// omitted from API requests. See
  1080  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1081  	// details.
  1082  	ForceSendFields []string `json:"-"`
  1083  	// NullFields is a list of field names (e.g. "Network") to include in API
  1084  	// requests with the JSON null value. By default, fields with empty values are
  1085  	// omitted from API requests. See
  1086  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1087  	NullFields []string `json:"-"`
  1088  }
  1089  
  1090  func (s *NetworkInterface) MarshalJSON() ([]byte, error) {
  1091  	type NoMethod NetworkInterface
  1092  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1093  }
  1094  
  1095  // Operation: This resource represents a long-running operation that is the
  1096  // result of a network API call.
  1097  type Operation struct {
  1098  	// Done: If the value is `false`, it means the operation is still in progress.
  1099  	// If `true`, the operation is completed, and either `error` or `response` is
  1100  	// available.
  1101  	Done bool `json:"done,omitempty"`
  1102  	// Error: The error result of the operation in case of failure or cancellation.
  1103  	Error *Status `json:"error,omitempty"`
  1104  	// Metadata: Service-specific metadata associated with the operation. It
  1105  	// typically contains progress information and common metadata such as create
  1106  	// time. Some services might not provide such metadata. Any method that returns
  1107  	// a long-running operation should document the metadata type, if any.
  1108  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  1109  	// Name: The server-assigned name, which is only unique within the same service
  1110  	// that originally returns it. If you use the default HTTP mapping, the `name`
  1111  	// should be a resource name ending with `operations/{unique_id}`.
  1112  	Name string `json:"name,omitempty"`
  1113  	// Response: The normal, successful response of the operation. If the original
  1114  	// method returns no data on success, such as `Delete`, the response is
  1115  	// `google.protobuf.Empty`. If the original method is standard
  1116  	// `Get`/`Create`/`Update`, the response should be the resource. For other
  1117  	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
  1118  	// original method name. For example, if the original method name is
  1119  	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
  1120  	Response googleapi.RawMessage `json:"response,omitempty"`
  1121  
  1122  	// ServerResponse contains the HTTP response code and headers from the server.
  1123  	googleapi.ServerResponse `json:"-"`
  1124  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
  1125  	// include in API requests. By default, fields with empty or default values are
  1126  	// omitted from API requests. See
  1127  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1128  	// details.
  1129  	ForceSendFields []string `json:"-"`
  1130  	// NullFields is a list of field names (e.g. "Done") to include in API requests
  1131  	// with the JSON null value. By default, fields with empty values are omitted
  1132  	// from API requests. See
  1133  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1134  	NullFields []string `json:"-"`
  1135  }
  1136  
  1137  func (s *Operation) MarshalJSON() ([]byte, error) {
  1138  	type NoMethod Operation
  1139  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1140  }
  1141  
  1142  // OperationMetadata: Represents the metadata of the long-running operation.
  1143  type OperationMetadata struct {
  1144  	// ApiVersion: API version used to start the operation.
  1145  	ApiVersion string `json:"apiVersion,omitempty"`
  1146  	// CreateTime: The time the operation was created.
  1147  	CreateTime string `json:"createTime,omitempty"`
  1148  	// EndTime: The time the operation finished running.
  1149  	EndTime string `json:"endTime,omitempty"`
  1150  	// Endpoint: API endpoint name of this operation.
  1151  	Endpoint string `json:"endpoint,omitempty"`
  1152  	// RequestedCancellation: Identifies whether the user has requested
  1153  	// cancellation of the operation. Operations that have successfully been
  1154  	// cancelled have Operation.error value with a google.rpc.Status.code of 1,
  1155  	// corresponding to `Code.CANCELLED`.
  1156  	RequestedCancellation bool `json:"requestedCancellation,omitempty"`
  1157  	// StatusMessage: Human-readable status of the operation, if any.
  1158  	StatusMessage string `json:"statusMessage,omitempty"`
  1159  	// Target: Server-defined resource path for the target of the operation.
  1160  	Target string `json:"target,omitempty"`
  1161  	// Verb: Name of the verb executed by the operation.
  1162  	Verb string `json:"verb,omitempty"`
  1163  	// ForceSendFields is a list of field names (e.g. "ApiVersion") to
  1164  	// unconditionally include in API requests. By default, fields with empty or
  1165  	// default values are omitted from API requests. See
  1166  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1167  	// details.
  1168  	ForceSendFields []string `json:"-"`
  1169  	// NullFields is a list of field names (e.g. "ApiVersion") to include in API
  1170  	// requests with the JSON null value. By default, fields with empty values are
  1171  	// omitted from API requests. See
  1172  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1173  	NullFields []string `json:"-"`
  1174  }
  1175  
  1176  func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
  1177  	type NoMethod OperationMetadata
  1178  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1179  }
  1180  
  1181  // Policy: An Identity and Access Management (IAM) policy, which specifies
  1182  // access controls for Google Cloud resources. A `Policy` is a collection of
  1183  // `bindings`. A `binding` binds one or more `members`, or principals, to a
  1184  // single `role`. Principals can be user accounts, service accounts, Google
  1185  // groups, and domains (such as G Suite). A `role` is a named list of
  1186  // permissions; each `role` can be an IAM predefined role or a user-created
  1187  // custom role. For some types of Google Cloud resources, a `binding` can also
  1188  // specify a `condition`, which is a logical expression that allows access to a
  1189  // resource only if the expression evaluates to `true`. A condition can add
  1190  // constraints based on attributes of the request, the resource, or both. To
  1191  // learn which resources support conditions in their IAM policies, see the IAM
  1192  // documentation
  1193  // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
  1194  // example:** ``` { "bindings": [ { "role":
  1195  // "roles/resourcemanager.organizationAdmin", "members": [
  1196  // "user:mike@example.com", "group:admins@example.com", "domain:google.com",
  1197  // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role":
  1198  // "roles/resourcemanager.organizationViewer", "members": [
  1199  // "user:eve@example.com" ], "condition": { "title": "expirable access",
  1200  // "description": "Does not grant access after Sep 2020", "expression":
  1201  // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
  1202  // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
  1203  // members: - user:mike@example.com - group:admins@example.com -
  1204  // domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com
  1205  // role: roles/resourcemanager.organizationAdmin - members: -
  1206  // user:eve@example.com role: roles/resourcemanager.organizationViewer
  1207  // condition: title: expirable access description: Does not grant access after
  1208  // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
  1209  // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
  1210  // see the IAM documentation (https://cloud.google.com/iam/docs/).
  1211  type Policy struct {
  1212  	// Bindings: Associates a list of `members`, or principals, with a `role`.
  1213  	// Optionally, may specify a `condition` that determines how and when the
  1214  	// `bindings` are applied. Each of the `bindings` must contain at least one
  1215  	// principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
  1216  	// up to 250 of these principals can be Google groups. Each occurrence of a
  1217  	// principal counts towards these limits. For example, if the `bindings` grant
  1218  	// 50 different roles to `user:alice@example.com`, and not to any other
  1219  	// principal, then you can add another 1,450 principals to the `bindings` in
  1220  	// the `Policy`.
  1221  	Bindings []*Binding `json:"bindings,omitempty"`
  1222  	// Etag: `etag` is used for optimistic concurrency control as a way to help
  1223  	// prevent simultaneous updates of a policy from overwriting each other. It is
  1224  	// strongly suggested that systems make use of the `etag` in the
  1225  	// read-modify-write cycle to perform policy updates in order to avoid race
  1226  	// conditions: An `etag` is returned in the response to `getIamPolicy`, and
  1227  	// systems are expected to put that etag in the request to `setIamPolicy` to
  1228  	// ensure that their change will be applied to the same version of the policy.
  1229  	// **Important:** If you use IAM Conditions, you must include the `etag` field
  1230  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
  1231  	// you to overwrite a version `3` policy with a version `1` policy, and all of
  1232  	// the conditions in the version `3` policy are lost.
  1233  	Etag string `json:"etag,omitempty"`
  1234  	// Version: Specifies the format of the policy. Valid values are `0`, `1`, and
  1235  	// `3`. Requests that specify an invalid value are rejected. Any operation that
  1236  	// affects conditional role bindings must specify version `3`. This requirement
  1237  	// applies to the following operations: * Getting a policy that includes a
  1238  	// conditional role binding * Adding a conditional role binding to a policy *
  1239  	// Changing a conditional role binding in a policy * Removing any role binding,
  1240  	// with or without a condition, from a policy that includes conditions
  1241  	// **Important:** If you use IAM Conditions, you must include the `etag` field
  1242  	// whenever you call `setIamPolicy`. If you omit this field, then IAM allows
  1243  	// you to overwrite a version `3` policy with a version `1` policy, and all of
  1244  	// the conditions in the version `3` policy are lost. If a policy does not
  1245  	// include any conditions, operations on that policy may specify any valid
  1246  	// version or leave the field unset. To learn which resources support
  1247  	// conditions in their IAM policies, see the IAM documentation
  1248  	// (https://cloud.google.com/iam/help/conditions/resource-policies).
  1249  	Version int64 `json:"version,omitempty"`
  1250  
  1251  	// ServerResponse contains the HTTP response code and headers from the server.
  1252  	googleapi.ServerResponse `json:"-"`
  1253  	// ForceSendFields is a list of field names (e.g. "Bindings") to
  1254  	// unconditionally include in API requests. By default, fields with empty or
  1255  	// default values are omitted from API requests. See
  1256  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1257  	// details.
  1258  	ForceSendFields []string `json:"-"`
  1259  	// NullFields is a list of field names (e.g. "Bindings") to include in API
  1260  	// requests with the JSON null value. By default, fields with empty values are
  1261  	// omitted from API requests. See
  1262  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1263  	NullFields []string `json:"-"`
  1264  }
  1265  
  1266  func (s *Policy) MarshalJSON() ([]byte, error) {
  1267  	type NoMethod Policy
  1268  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1269  }
  1270  
  1271  // ReportInstanceInfoSystemRequest: Request for notebook instances to report
  1272  // information to Notebooks API.
  1273  type ReportInstanceInfoSystemRequest struct {
  1274  	// Event: Required. The Event to be reported.
  1275  	Event *Event `json:"event,omitempty"`
  1276  	// VmId: Required. The VM hardware token for authenticating the VM.
  1277  	// https://cloud.google.com/compute/docs/instances/verifying-instance-identity
  1278  	VmId string `json:"vmId,omitempty"`
  1279  	// ForceSendFields is a list of field names (e.g. "Event") to unconditionally
  1280  	// include in API requests. By default, fields with empty or default values are
  1281  	// omitted from API requests. See
  1282  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1283  	// details.
  1284  	ForceSendFields []string `json:"-"`
  1285  	// NullFields is a list of field names (e.g. "Event") to include in API
  1286  	// requests with the JSON null value. By default, fields with empty values are
  1287  	// omitted from API requests. See
  1288  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1289  	NullFields []string `json:"-"`
  1290  }
  1291  
  1292  func (s *ReportInstanceInfoSystemRequest) MarshalJSON() ([]byte, error) {
  1293  	type NoMethod ReportInstanceInfoSystemRequest
  1294  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1295  }
  1296  
  1297  // ResetInstanceRequest: Request for resetting a notebook instance
  1298  type ResetInstanceRequest struct {
  1299  }
  1300  
  1301  // ResizeDiskRequest: Request for resizing the notebook instance disks
  1302  type ResizeDiskRequest struct {
  1303  	// BootDisk: Required. The boot disk to be resized. Only disk_size_gb will be
  1304  	// used.
  1305  	BootDisk *BootDisk `json:"bootDisk,omitempty"`
  1306  	// DataDisk: Required. The data disk to be resized. Only disk_size_gb will be
  1307  	// used.
  1308  	DataDisk *DataDisk `json:"dataDisk,omitempty"`
  1309  	// ForceSendFields is a list of field names (e.g. "BootDisk") to
  1310  	// unconditionally include in API requests. By default, fields with empty or
  1311  	// default values are omitted from API requests. See
  1312  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1313  	// details.
  1314  	ForceSendFields []string `json:"-"`
  1315  	// NullFields is a list of field names (e.g. "BootDisk") to include in API
  1316  	// requests with the JSON null value. By default, fields with empty values are
  1317  	// omitted from API requests. See
  1318  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1319  	NullFields []string `json:"-"`
  1320  }
  1321  
  1322  func (s *ResizeDiskRequest) MarshalJSON() ([]byte, error) {
  1323  	type NoMethod ResizeDiskRequest
  1324  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1325  }
  1326  
  1327  // RollbackInstanceRequest: Request for rollbacking a notebook instance
  1328  type RollbackInstanceRequest struct {
  1329  	// RevisionId: Required. Output only. Revision Id
  1330  	RevisionId string `json:"revisionId,omitempty"`
  1331  	// TargetSnapshot: Required. The snapshot for rollback. Example:
  1332  	// "projects/test-project/global/snapshots/krwlzipynril".
  1333  	TargetSnapshot string `json:"targetSnapshot,omitempty"`
  1334  	// ForceSendFields is a list of field names (e.g. "RevisionId") to
  1335  	// unconditionally include in API requests. By default, fields with empty or
  1336  	// default values are omitted from API requests. See
  1337  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1338  	// details.
  1339  	ForceSendFields []string `json:"-"`
  1340  	// NullFields is a list of field names (e.g. "RevisionId") to include in API
  1341  	// requests with the JSON null value. By default, fields with empty values are
  1342  	// omitted from API requests. See
  1343  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1344  	NullFields []string `json:"-"`
  1345  }
  1346  
  1347  func (s *RollbackInstanceRequest) MarshalJSON() ([]byte, error) {
  1348  	type NoMethod RollbackInstanceRequest
  1349  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1350  }
  1351  
  1352  // ServiceAccount: A service account that acts as an identity.
  1353  type ServiceAccount struct {
  1354  	// Email: Optional. Email address of the service account.
  1355  	Email string `json:"email,omitempty"`
  1356  	// Scopes: Output only. The list of scopes to be made available for this
  1357  	// service account. Set by the CLH to
  1358  	// https://www.googleapis.com/auth/cloud-platform
  1359  	Scopes []string `json:"scopes,omitempty"`
  1360  	// ForceSendFields is a list of field names (e.g. "Email") to unconditionally
  1361  	// include in API requests. By default, fields with empty or default values are
  1362  	// omitted from API requests. See
  1363  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1364  	// details.
  1365  	ForceSendFields []string `json:"-"`
  1366  	// NullFields is a list of field names (e.g. "Email") to include in API
  1367  	// requests with the JSON null value. By default, fields with empty values are
  1368  	// omitted from API requests. See
  1369  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1370  	NullFields []string `json:"-"`
  1371  }
  1372  
  1373  func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  1374  	type NoMethod ServiceAccount
  1375  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1376  }
  1377  
  1378  // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
  1379  type SetIamPolicyRequest struct {
  1380  	// Policy: REQUIRED: The complete policy to be applied to the `resource`. The
  1381  	// size of the policy is limited to a few 10s of KB. An empty policy is a valid
  1382  	// policy but certain Google Cloud services (such as Projects) might reject
  1383  	// them.
  1384  	Policy *Policy `json:"policy,omitempty"`
  1385  	// ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
  1386  	// include in API requests. By default, fields with empty or default values are
  1387  	// omitted from API requests. See
  1388  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1389  	// details.
  1390  	ForceSendFields []string `json:"-"`
  1391  	// NullFields is a list of field names (e.g. "Policy") to include in API
  1392  	// requests with the JSON null value. By default, fields with empty values are
  1393  	// omitted from API requests. See
  1394  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1395  	NullFields []string `json:"-"`
  1396  }
  1397  
  1398  func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  1399  	type NoMethod SetIamPolicyRequest
  1400  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1401  }
  1402  
  1403  // ShieldedInstanceConfig: A set of Shielded Instance options. See Images using
  1404  // supported Shielded VM features
  1405  // (https://cloud.google.com/compute/docs/instances/modifying-shielded-vm). Not
  1406  // all combinations are valid.
  1407  type ShieldedInstanceConfig struct {
  1408  	// EnableIntegrityMonitoring: Optional. Defines whether the VM instance has
  1409  	// integrity monitoring enabled. Enables monitoring and attestation of the boot
  1410  	// integrity of the VM instance. The attestation is performed against the
  1411  	// integrity policy baseline. This baseline is initially derived from the
  1412  	// implicitly trusted boot image when the VM instance is created. Enabled by
  1413  	// default.
  1414  	EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"`
  1415  	// EnableSecureBoot: Optional. Defines whether the VM instance has Secure Boot
  1416  	// enabled. Secure Boot helps ensure that the system only runs authentic
  1417  	// software by verifying the digital signature of all boot components, and
  1418  	// halting the boot process if signature verification fails. Disabled by
  1419  	// default.
  1420  	EnableSecureBoot bool `json:"enableSecureBoot,omitempty"`
  1421  	// EnableVtpm: Optional. Defines whether the VM instance has the vTPM enabled.
  1422  	// Enabled by default.
  1423  	EnableVtpm bool `json:"enableVtpm,omitempty"`
  1424  	// ForceSendFields is a list of field names (e.g. "EnableIntegrityMonitoring")
  1425  	// to unconditionally include in API requests. By default, fields with empty or
  1426  	// default values are omitted from API requests. See
  1427  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1428  	// details.
  1429  	ForceSendFields []string `json:"-"`
  1430  	// NullFields is a list of field names (e.g. "EnableIntegrityMonitoring") to
  1431  	// include in API requests with the JSON null value. By default, fields with
  1432  	// empty values are omitted from API requests. See
  1433  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1434  	NullFields []string `json:"-"`
  1435  }
  1436  
  1437  func (s *ShieldedInstanceConfig) MarshalJSON() ([]byte, error) {
  1438  	type NoMethod ShieldedInstanceConfig
  1439  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1440  }
  1441  
  1442  // StartInstanceRequest: Request for starting a notebook instance
  1443  type StartInstanceRequest struct {
  1444  }
  1445  
  1446  // Status: The `Status` type defines a logical error model that is suitable for
  1447  // different programming environments, including REST APIs and RPC APIs. It is
  1448  // used by gRPC (https://github.com/grpc). Each `Status` message contains three
  1449  // pieces of data: error code, error message, and error details. You can find
  1450  // out more about this error model and how to work with it in the API Design
  1451  // Guide (https://cloud.google.com/apis/design/errors).
  1452  type Status struct {
  1453  	// Code: The status code, which should be an enum value of google.rpc.Code.
  1454  	Code int64 `json:"code,omitempty"`
  1455  	// Details: A list of messages that carry the error details. There is a common
  1456  	// set of message types for APIs to use.
  1457  	Details []googleapi.RawMessage `json:"details,omitempty"`
  1458  	// Message: A developer-facing error message, which should be in English. Any
  1459  	// user-facing error message should be localized and sent in the
  1460  	// google.rpc.Status.details field, or localized by the client.
  1461  	Message string `json:"message,omitempty"`
  1462  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
  1463  	// include in API requests. By default, fields with empty or default values are
  1464  	// omitted from API requests. See
  1465  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1466  	// details.
  1467  	ForceSendFields []string `json:"-"`
  1468  	// NullFields is a list of field names (e.g. "Code") to include in API requests
  1469  	// with the JSON null value. By default, fields with empty values are omitted
  1470  	// from API requests. See
  1471  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1472  	NullFields []string `json:"-"`
  1473  }
  1474  
  1475  func (s *Status) MarshalJSON() ([]byte, error) {
  1476  	type NoMethod Status
  1477  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1478  }
  1479  
  1480  // StopInstanceRequest: Request for stopping a notebook instance
  1481  type StopInstanceRequest struct {
  1482  }
  1483  
  1484  // SupportedValues: SupportedValues represents the values supported by the
  1485  // configuration.
  1486  type SupportedValues struct {
  1487  	// AcceleratorTypes: Output only. The accelerator types supported by WbI.
  1488  	AcceleratorTypes []string `json:"acceleratorTypes,omitempty"`
  1489  	// MachineTypes: Output only. The machine types supported by WbI.
  1490  	MachineTypes []string `json:"machineTypes,omitempty"`
  1491  	// ForceSendFields is a list of field names (e.g. "AcceleratorTypes") to
  1492  	// unconditionally include in API requests. By default, fields with empty or
  1493  	// default values are omitted from API requests. See
  1494  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1495  	// details.
  1496  	ForceSendFields []string `json:"-"`
  1497  	// NullFields is a list of field names (e.g. "AcceleratorTypes") to include in
  1498  	// API requests with the JSON null value. By default, fields with empty values
  1499  	// are omitted from API requests. See
  1500  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1501  	NullFields []string `json:"-"`
  1502  }
  1503  
  1504  func (s *SupportedValues) MarshalJSON() ([]byte, error) {
  1505  	type NoMethod SupportedValues
  1506  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1507  }
  1508  
  1509  // TestIamPermissionsRequest: Request message for `TestIamPermissions` method.
  1510  type TestIamPermissionsRequest struct {
  1511  	// Permissions: The set of permissions to check for the `resource`. Permissions
  1512  	// with wildcards (such as `*` or `storage.*`) are not allowed. For more
  1513  	// information see IAM Overview
  1514  	// (https://cloud.google.com/iam/docs/overview#permissions).
  1515  	Permissions []string `json:"permissions,omitempty"`
  1516  	// ForceSendFields is a list of field names (e.g. "Permissions") to
  1517  	// unconditionally include in API requests. By default, fields with empty or
  1518  	// default values are omitted from API requests. See
  1519  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1520  	// details.
  1521  	ForceSendFields []string `json:"-"`
  1522  	// NullFields is a list of field names (e.g. "Permissions") to include in API
  1523  	// requests with the JSON null value. By default, fields with empty values are
  1524  	// omitted from API requests. See
  1525  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1526  	NullFields []string `json:"-"`
  1527  }
  1528  
  1529  func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  1530  	type NoMethod TestIamPermissionsRequest
  1531  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1532  }
  1533  
  1534  // TestIamPermissionsResponse: Response message for `TestIamPermissions`
  1535  // method.
  1536  type TestIamPermissionsResponse struct {
  1537  	// Permissions: A subset of `TestPermissionsRequest.permissions` that the
  1538  	// caller is allowed.
  1539  	Permissions []string `json:"permissions,omitempty"`
  1540  
  1541  	// ServerResponse contains the HTTP response code and headers from the server.
  1542  	googleapi.ServerResponse `json:"-"`
  1543  	// ForceSendFields is a list of field names (e.g. "Permissions") to
  1544  	// unconditionally include in API requests. By default, fields with empty or
  1545  	// default values are omitted from API requests. See
  1546  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1547  	// details.
  1548  	ForceSendFields []string `json:"-"`
  1549  	// NullFields is a list of field names (e.g. "Permissions") to include in API
  1550  	// requests with the JSON null value. By default, fields with empty values are
  1551  	// omitted from API requests. See
  1552  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1553  	NullFields []string `json:"-"`
  1554  }
  1555  
  1556  func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  1557  	type NoMethod TestIamPermissionsResponse
  1558  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1559  }
  1560  
  1561  // UpgradeHistoryEntry: The entry of VM image upgrade history.
  1562  type UpgradeHistoryEntry struct {
  1563  	// Action: Optional. Action. Rolloback or Upgrade.
  1564  	//
  1565  	// Possible values:
  1566  	//   "ACTION_UNSPECIFIED" - Operation is not specified.
  1567  	//   "UPGRADE" - Upgrade.
  1568  	//   "ROLLBACK" - Rollback.
  1569  	Action string `json:"action,omitempty"`
  1570  	// ContainerImage: Optional. The container image before this instance upgrade.
  1571  	ContainerImage string `json:"containerImage,omitempty"`
  1572  	// CreateTime: Immutable. The time that this instance upgrade history entry is
  1573  	// created.
  1574  	CreateTime string `json:"createTime,omitempty"`
  1575  	// Framework: Optional. The framework of this notebook instance.
  1576  	Framework string `json:"framework,omitempty"`
  1577  	// Snapshot: Optional. The snapshot of the boot disk of this notebook instance
  1578  	// before upgrade.
  1579  	Snapshot string `json:"snapshot,omitempty"`
  1580  	// State: Output only. The state of this instance upgrade history entry.
  1581  	//
  1582  	// Possible values:
  1583  	//   "STATE_UNSPECIFIED" - State is not specified.
  1584  	//   "STARTED" - The instance upgrade is started.
  1585  	//   "SUCCEEDED" - The instance upgrade is succeeded.
  1586  	//   "FAILED" - The instance upgrade is failed.
  1587  	State string `json:"state,omitempty"`
  1588  	// TargetVersion: Optional. Target VM Version, like m63.
  1589  	TargetVersion string `json:"targetVersion,omitempty"`
  1590  	// Version: Optional. The version of the notebook instance before this upgrade.
  1591  	Version string `json:"version,omitempty"`
  1592  	// VmImage: Optional. The VM image before this instance upgrade.
  1593  	VmImage string `json:"vmImage,omitempty"`
  1594  	// ForceSendFields is a list of field names (e.g. "Action") to unconditionally
  1595  	// include in API requests. By default, fields with empty or default values are
  1596  	// omitted from API requests. See
  1597  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1598  	// details.
  1599  	ForceSendFields []string `json:"-"`
  1600  	// NullFields is a list of field names (e.g. "Action") to include in API
  1601  	// requests with the JSON null value. By default, fields with empty values are
  1602  	// omitted from API requests. See
  1603  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1604  	NullFields []string `json:"-"`
  1605  }
  1606  
  1607  func (s *UpgradeHistoryEntry) MarshalJSON() ([]byte, error) {
  1608  	type NoMethod UpgradeHistoryEntry
  1609  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1610  }
  1611  
  1612  // UpgradeInstanceRequest: Request for upgrading a notebook instance
  1613  type UpgradeInstanceRequest struct {
  1614  }
  1615  
  1616  // UpgradeInstanceSystemRequest: Request for upgrading a notebook instance from
  1617  // within the VM
  1618  type UpgradeInstanceSystemRequest struct {
  1619  	// VmId: Required. The VM hardware token for authenticating the VM.
  1620  	// https://cloud.google.com/compute/docs/instances/verifying-instance-identity
  1621  	VmId string `json:"vmId,omitempty"`
  1622  	// ForceSendFields is a list of field names (e.g. "VmId") to unconditionally
  1623  	// include in API requests. By default, fields with empty or default values are
  1624  	// omitted from API requests. See
  1625  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1626  	// details.
  1627  	ForceSendFields []string `json:"-"`
  1628  	// NullFields is a list of field names (e.g. "VmId") to include in API requests
  1629  	// with the JSON null value. By default, fields with empty values are omitted
  1630  	// from API requests. See
  1631  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1632  	NullFields []string `json:"-"`
  1633  }
  1634  
  1635  func (s *UpgradeInstanceSystemRequest) MarshalJSON() ([]byte, error) {
  1636  	type NoMethod UpgradeInstanceSystemRequest
  1637  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1638  }
  1639  
  1640  // VmImage: Definition of a custom Compute Engine virtual machine image for
  1641  // starting a notebook instance with the environment installed directly on the
  1642  // VM.
  1643  type VmImage struct {
  1644  	// Family: Optional. Use this VM image family to find the image; the newest
  1645  	// image in this family will be used.
  1646  	Family string `json:"family,omitempty"`
  1647  	// Name: Optional. Use VM image name to find the image.
  1648  	Name string `json:"name,omitempty"`
  1649  	// Project: Required. The name of the Google Cloud project that this VM image
  1650  	// belongs to. Format: `{project_id}`
  1651  	Project string `json:"project,omitempty"`
  1652  	// ForceSendFields is a list of field names (e.g. "Family") to unconditionally
  1653  	// include in API requests. By default, fields with empty or default values are
  1654  	// omitted from API requests. See
  1655  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1656  	// details.
  1657  	ForceSendFields []string `json:"-"`
  1658  	// NullFields is a list of field names (e.g. "Family") to include in API
  1659  	// requests with the JSON null value. By default, fields with empty values are
  1660  	// omitted from API requests. See
  1661  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1662  	NullFields []string `json:"-"`
  1663  }
  1664  
  1665  func (s *VmImage) MarshalJSON() ([]byte, error) {
  1666  	type NoMethod VmImage
  1667  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1668  }
  1669  
  1670  type ProjectsLocationsGetCall struct {
  1671  	s            *Service
  1672  	name         string
  1673  	urlParams_   gensupport.URLParams
  1674  	ifNoneMatch_ string
  1675  	ctx_         context.Context
  1676  	header_      http.Header
  1677  }
  1678  
  1679  // Get: Gets information about a location.
  1680  //
  1681  // - name: Resource name for the location.
  1682  func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
  1683  	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1684  	c.name = name
  1685  	return c
  1686  }
  1687  
  1688  // Fields allows partial responses to be retrieved. See
  1689  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1690  // details.
  1691  func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
  1692  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1693  	return c
  1694  }
  1695  
  1696  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1697  // object's ETag matches the given value. This is useful for getting updates
  1698  // only after the object has changed since the last request.
  1699  func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
  1700  	c.ifNoneMatch_ = entityTag
  1701  	return c
  1702  }
  1703  
  1704  // Context sets the context to be used in this call's Do method.
  1705  func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
  1706  	c.ctx_ = ctx
  1707  	return c
  1708  }
  1709  
  1710  // Header returns a http.Header that can be modified by the caller to add
  1711  // headers to the request.
  1712  func (c *ProjectsLocationsGetCall) Header() http.Header {
  1713  	if c.header_ == nil {
  1714  		c.header_ = make(http.Header)
  1715  	}
  1716  	return c.header_
  1717  }
  1718  
  1719  func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  1720  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1721  	if c.ifNoneMatch_ != "" {
  1722  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1723  	}
  1724  	var body io.Reader = nil
  1725  	c.urlParams_.Set("alt", alt)
  1726  	c.urlParams_.Set("prettyPrint", "false")
  1727  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  1728  	urls += "?" + c.urlParams_.Encode()
  1729  	req, err := http.NewRequest("GET", urls, body)
  1730  	if err != nil {
  1731  		return nil, err
  1732  	}
  1733  	req.Header = reqHeaders
  1734  	googleapi.Expand(req.URL, map[string]string{
  1735  		"name": c.name,
  1736  	})
  1737  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1738  }
  1739  
  1740  // Do executes the "notebooks.projects.locations.get" call.
  1741  // Any non-2xx status code is an error. Response headers are in either
  1742  // *Location.ServerResponse.Header or (if a response was returned at all) in
  1743  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1744  // whether the returned error was because http.StatusNotModified was returned.
  1745  func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
  1746  	gensupport.SetOptions(c.urlParams_, opts...)
  1747  	res, err := c.doRequest("json")
  1748  	if res != nil && res.StatusCode == http.StatusNotModified {
  1749  		if res.Body != nil {
  1750  			res.Body.Close()
  1751  		}
  1752  		return nil, gensupport.WrapError(&googleapi.Error{
  1753  			Code:   res.StatusCode,
  1754  			Header: res.Header,
  1755  		})
  1756  	}
  1757  	if err != nil {
  1758  		return nil, err
  1759  	}
  1760  	defer googleapi.CloseBody(res)
  1761  	if err := googleapi.CheckResponse(res); err != nil {
  1762  		return nil, gensupport.WrapError(err)
  1763  	}
  1764  	ret := &Location{
  1765  		ServerResponse: googleapi.ServerResponse{
  1766  			Header:         res.Header,
  1767  			HTTPStatusCode: res.StatusCode,
  1768  		},
  1769  	}
  1770  	target := &ret
  1771  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1772  		return nil, err
  1773  	}
  1774  	return ret, nil
  1775  }
  1776  
  1777  type ProjectsLocationsListCall struct {
  1778  	s            *Service
  1779  	name         string
  1780  	urlParams_   gensupport.URLParams
  1781  	ifNoneMatch_ string
  1782  	ctx_         context.Context
  1783  	header_      http.Header
  1784  }
  1785  
  1786  // List: Lists information about the supported locations for this service.
  1787  //
  1788  // - name: The resource that owns the locations collection, if applicable.
  1789  func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
  1790  	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1791  	c.name = name
  1792  	return c
  1793  }
  1794  
  1795  // Filter sets the optional parameter "filter": A filter to narrow down results
  1796  // to a preferred subset. The filtering language accepts strings like
  1797  // "displayName=tokyo", and is documented in more detail in AIP-160
  1798  // (https://google.aip.dev/160).
  1799  func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
  1800  	c.urlParams_.Set("filter", filter)
  1801  	return c
  1802  }
  1803  
  1804  // PageSize sets the optional parameter "pageSize": The maximum number of
  1805  // results to return. If not set, the service selects a default.
  1806  func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
  1807  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1808  	return c
  1809  }
  1810  
  1811  // PageToken sets the optional parameter "pageToken": A page token received
  1812  // from the `next_page_token` field in the response. Send that page token to
  1813  // receive the subsequent page.
  1814  func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
  1815  	c.urlParams_.Set("pageToken", pageToken)
  1816  	return c
  1817  }
  1818  
  1819  // Fields allows partial responses to be retrieved. See
  1820  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1821  // details.
  1822  func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
  1823  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1824  	return c
  1825  }
  1826  
  1827  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1828  // object's ETag matches the given value. This is useful for getting updates
  1829  // only after the object has changed since the last request.
  1830  func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
  1831  	c.ifNoneMatch_ = entityTag
  1832  	return c
  1833  }
  1834  
  1835  // Context sets the context to be used in this call's Do method.
  1836  func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
  1837  	c.ctx_ = ctx
  1838  	return c
  1839  }
  1840  
  1841  // Header returns a http.Header that can be modified by the caller to add
  1842  // headers to the request.
  1843  func (c *ProjectsLocationsListCall) Header() http.Header {
  1844  	if c.header_ == nil {
  1845  		c.header_ = make(http.Header)
  1846  	}
  1847  	return c.header_
  1848  }
  1849  
  1850  func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  1851  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1852  	if c.ifNoneMatch_ != "" {
  1853  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1854  	}
  1855  	var body io.Reader = nil
  1856  	c.urlParams_.Set("alt", alt)
  1857  	c.urlParams_.Set("prettyPrint", "false")
  1858  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations")
  1859  	urls += "?" + c.urlParams_.Encode()
  1860  	req, err := http.NewRequest("GET", urls, body)
  1861  	if err != nil {
  1862  		return nil, err
  1863  	}
  1864  	req.Header = reqHeaders
  1865  	googleapi.Expand(req.URL, map[string]string{
  1866  		"name": c.name,
  1867  	})
  1868  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1869  }
  1870  
  1871  // Do executes the "notebooks.projects.locations.list" call.
  1872  // Any non-2xx status code is an error. Response headers are in either
  1873  // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
  1874  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1875  // check whether the returned error was because http.StatusNotModified was
  1876  // returned.
  1877  func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
  1878  	gensupport.SetOptions(c.urlParams_, opts...)
  1879  	res, err := c.doRequest("json")
  1880  	if res != nil && res.StatusCode == http.StatusNotModified {
  1881  		if res.Body != nil {
  1882  			res.Body.Close()
  1883  		}
  1884  		return nil, gensupport.WrapError(&googleapi.Error{
  1885  			Code:   res.StatusCode,
  1886  			Header: res.Header,
  1887  		})
  1888  	}
  1889  	if err != nil {
  1890  		return nil, err
  1891  	}
  1892  	defer googleapi.CloseBody(res)
  1893  	if err := googleapi.CheckResponse(res); err != nil {
  1894  		return nil, gensupport.WrapError(err)
  1895  	}
  1896  	ret := &ListLocationsResponse{
  1897  		ServerResponse: googleapi.ServerResponse{
  1898  			Header:         res.Header,
  1899  			HTTPStatusCode: res.StatusCode,
  1900  		},
  1901  	}
  1902  	target := &ret
  1903  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1904  		return nil, err
  1905  	}
  1906  	return ret, nil
  1907  }
  1908  
  1909  // Pages invokes f for each page of results.
  1910  // A non-nil error returned from f will halt the iteration.
  1911  // The provided context supersedes any context provided to the Context method.
  1912  func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
  1913  	c.ctx_ = ctx
  1914  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1915  	for {
  1916  		x, err := c.Do()
  1917  		if err != nil {
  1918  			return err
  1919  		}
  1920  		if err := f(x); err != nil {
  1921  			return err
  1922  		}
  1923  		if x.NextPageToken == "" {
  1924  			return nil
  1925  		}
  1926  		c.PageToken(x.NextPageToken)
  1927  	}
  1928  }
  1929  
  1930  type ProjectsLocationsInstancesCheckUpgradabilityCall struct {
  1931  	s                *Service
  1932  	notebookInstance string
  1933  	urlParams_       gensupport.URLParams
  1934  	ifNoneMatch_     string
  1935  	ctx_             context.Context
  1936  	header_          http.Header
  1937  }
  1938  
  1939  // CheckUpgradability: Checks whether a notebook instance is upgradable.
  1940  //
  1941  //   - notebookInstance: Format:
  1942  //     `projects/{project_id}/locations/{location}/instances/{instance_id}`.
  1943  func (r *ProjectsLocationsInstancesService) CheckUpgradability(notebookInstance string) *ProjectsLocationsInstancesCheckUpgradabilityCall {
  1944  	c := &ProjectsLocationsInstancesCheckUpgradabilityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1945  	c.notebookInstance = notebookInstance
  1946  	return c
  1947  }
  1948  
  1949  // Fields allows partial responses to be retrieved. See
  1950  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1951  // details.
  1952  func (c *ProjectsLocationsInstancesCheckUpgradabilityCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesCheckUpgradabilityCall {
  1953  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1954  	return c
  1955  }
  1956  
  1957  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1958  // object's ETag matches the given value. This is useful for getting updates
  1959  // only after the object has changed since the last request.
  1960  func (c *ProjectsLocationsInstancesCheckUpgradabilityCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesCheckUpgradabilityCall {
  1961  	c.ifNoneMatch_ = entityTag
  1962  	return c
  1963  }
  1964  
  1965  // Context sets the context to be used in this call's Do method.
  1966  func (c *ProjectsLocationsInstancesCheckUpgradabilityCall) Context(ctx context.Context) *ProjectsLocationsInstancesCheckUpgradabilityCall {
  1967  	c.ctx_ = ctx
  1968  	return c
  1969  }
  1970  
  1971  // Header returns a http.Header that can be modified by the caller to add
  1972  // headers to the request.
  1973  func (c *ProjectsLocationsInstancesCheckUpgradabilityCall) Header() http.Header {
  1974  	if c.header_ == nil {
  1975  		c.header_ = make(http.Header)
  1976  	}
  1977  	return c.header_
  1978  }
  1979  
  1980  func (c *ProjectsLocationsInstancesCheckUpgradabilityCall) doRequest(alt string) (*http.Response, error) {
  1981  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1982  	if c.ifNoneMatch_ != "" {
  1983  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1984  	}
  1985  	var body io.Reader = nil
  1986  	c.urlParams_.Set("alt", alt)
  1987  	c.urlParams_.Set("prettyPrint", "false")
  1988  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+notebookInstance}:checkUpgradability")
  1989  	urls += "?" + c.urlParams_.Encode()
  1990  	req, err := http.NewRequest("GET", urls, body)
  1991  	if err != nil {
  1992  		return nil, err
  1993  	}
  1994  	req.Header = reqHeaders
  1995  	googleapi.Expand(req.URL, map[string]string{
  1996  		"notebookInstance": c.notebookInstance,
  1997  	})
  1998  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1999  }
  2000  
  2001  // Do executes the "notebooks.projects.locations.instances.checkUpgradability" call.
  2002  // Any non-2xx status code is an error. Response headers are in either
  2003  // *CheckInstanceUpgradabilityResponse.ServerResponse.Header or (if a response
  2004  // was returned at all) in error.(*googleapi.Error).Header. Use
  2005  // googleapi.IsNotModified to check whether the returned error was because
  2006  // http.StatusNotModified was returned.
  2007  func (c *ProjectsLocationsInstancesCheckUpgradabilityCall) Do(opts ...googleapi.CallOption) (*CheckInstanceUpgradabilityResponse, error) {
  2008  	gensupport.SetOptions(c.urlParams_, opts...)
  2009  	res, err := c.doRequest("json")
  2010  	if res != nil && res.StatusCode == http.StatusNotModified {
  2011  		if res.Body != nil {
  2012  			res.Body.Close()
  2013  		}
  2014  		return nil, gensupport.WrapError(&googleapi.Error{
  2015  			Code:   res.StatusCode,
  2016  			Header: res.Header,
  2017  		})
  2018  	}
  2019  	if err != nil {
  2020  		return nil, err
  2021  	}
  2022  	defer googleapi.CloseBody(res)
  2023  	if err := googleapi.CheckResponse(res); err != nil {
  2024  		return nil, gensupport.WrapError(err)
  2025  	}
  2026  	ret := &CheckInstanceUpgradabilityResponse{
  2027  		ServerResponse: googleapi.ServerResponse{
  2028  			Header:         res.Header,
  2029  			HTTPStatusCode: res.StatusCode,
  2030  		},
  2031  	}
  2032  	target := &ret
  2033  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2034  		return nil, err
  2035  	}
  2036  	return ret, nil
  2037  }
  2038  
  2039  type ProjectsLocationsInstancesCreateCall struct {
  2040  	s          *Service
  2041  	parent     string
  2042  	instance   *Instance
  2043  	urlParams_ gensupport.URLParams
  2044  	ctx_       context.Context
  2045  	header_    http.Header
  2046  }
  2047  
  2048  // Create: Creates a new Instance in a given project and location.
  2049  //
  2050  // - parent: Format: `parent=projects/{project_id}/locations/{location}`.
  2051  func (r *ProjectsLocationsInstancesService) Create(parent string, instance *Instance) *ProjectsLocationsInstancesCreateCall {
  2052  	c := &ProjectsLocationsInstancesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2053  	c.parent = parent
  2054  	c.instance = instance
  2055  	return c
  2056  }
  2057  
  2058  // InstanceId sets the optional parameter "instanceId": Required. User-defined
  2059  // unique ID of this instance.
  2060  func (c *ProjectsLocationsInstancesCreateCall) InstanceId(instanceId string) *ProjectsLocationsInstancesCreateCall {
  2061  	c.urlParams_.Set("instanceId", instanceId)
  2062  	return c
  2063  }
  2064  
  2065  // RequestId sets the optional parameter "requestId": Idempotent request UUID.
  2066  func (c *ProjectsLocationsInstancesCreateCall) RequestId(requestId string) *ProjectsLocationsInstancesCreateCall {
  2067  	c.urlParams_.Set("requestId", requestId)
  2068  	return c
  2069  }
  2070  
  2071  // Fields allows partial responses to be retrieved. See
  2072  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2073  // details.
  2074  func (c *ProjectsLocationsInstancesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesCreateCall {
  2075  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2076  	return c
  2077  }
  2078  
  2079  // Context sets the context to be used in this call's Do method.
  2080  func (c *ProjectsLocationsInstancesCreateCall) Context(ctx context.Context) *ProjectsLocationsInstancesCreateCall {
  2081  	c.ctx_ = ctx
  2082  	return c
  2083  }
  2084  
  2085  // Header returns a http.Header that can be modified by the caller to add
  2086  // headers to the request.
  2087  func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header {
  2088  	if c.header_ == nil {
  2089  		c.header_ = make(http.Header)
  2090  	}
  2091  	return c.header_
  2092  }
  2093  
  2094  func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) {
  2095  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2096  	var body io.Reader = nil
  2097  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  2098  	if err != nil {
  2099  		return nil, err
  2100  	}
  2101  	c.urlParams_.Set("alt", alt)
  2102  	c.urlParams_.Set("prettyPrint", "false")
  2103  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/instances")
  2104  	urls += "?" + c.urlParams_.Encode()
  2105  	req, err := http.NewRequest("POST", urls, body)
  2106  	if err != nil {
  2107  		return nil, err
  2108  	}
  2109  	req.Header = reqHeaders
  2110  	googleapi.Expand(req.URL, map[string]string{
  2111  		"parent": c.parent,
  2112  	})
  2113  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2114  }
  2115  
  2116  // Do executes the "notebooks.projects.locations.instances.create" call.
  2117  // Any non-2xx status code is an error. Response headers are in either
  2118  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  2119  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2120  // whether the returned error was because http.StatusNotModified was returned.
  2121  func (c *ProjectsLocationsInstancesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2122  	gensupport.SetOptions(c.urlParams_, opts...)
  2123  	res, err := c.doRequest("json")
  2124  	if res != nil && res.StatusCode == http.StatusNotModified {
  2125  		if res.Body != nil {
  2126  			res.Body.Close()
  2127  		}
  2128  		return nil, gensupport.WrapError(&googleapi.Error{
  2129  			Code:   res.StatusCode,
  2130  			Header: res.Header,
  2131  		})
  2132  	}
  2133  	if err != nil {
  2134  		return nil, err
  2135  	}
  2136  	defer googleapi.CloseBody(res)
  2137  	if err := googleapi.CheckResponse(res); err != nil {
  2138  		return nil, gensupport.WrapError(err)
  2139  	}
  2140  	ret := &Operation{
  2141  		ServerResponse: googleapi.ServerResponse{
  2142  			Header:         res.Header,
  2143  			HTTPStatusCode: res.StatusCode,
  2144  		},
  2145  	}
  2146  	target := &ret
  2147  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2148  		return nil, err
  2149  	}
  2150  	return ret, nil
  2151  }
  2152  
  2153  type ProjectsLocationsInstancesDeleteCall struct {
  2154  	s          *Service
  2155  	name       string
  2156  	urlParams_ gensupport.URLParams
  2157  	ctx_       context.Context
  2158  	header_    http.Header
  2159  }
  2160  
  2161  // Delete: Deletes a single Instance.
  2162  //
  2163  //   - name: Format:
  2164  //     `projects/{project_id}/locations/{location}/instances/{instance_id}`.
  2165  func (r *ProjectsLocationsInstancesService) Delete(name string) *ProjectsLocationsInstancesDeleteCall {
  2166  	c := &ProjectsLocationsInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2167  	c.name = name
  2168  	return c
  2169  }
  2170  
  2171  // RequestId sets the optional parameter "requestId": Idempotent request UUID.
  2172  func (c *ProjectsLocationsInstancesDeleteCall) RequestId(requestId string) *ProjectsLocationsInstancesDeleteCall {
  2173  	c.urlParams_.Set("requestId", requestId)
  2174  	return c
  2175  }
  2176  
  2177  // Fields allows partial responses to be retrieved. See
  2178  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2179  // details.
  2180  func (c *ProjectsLocationsInstancesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDeleteCall {
  2181  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2182  	return c
  2183  }
  2184  
  2185  // Context sets the context to be used in this call's Do method.
  2186  func (c *ProjectsLocationsInstancesDeleteCall) Context(ctx context.Context) *ProjectsLocationsInstancesDeleteCall {
  2187  	c.ctx_ = ctx
  2188  	return c
  2189  }
  2190  
  2191  // Header returns a http.Header that can be modified by the caller to add
  2192  // headers to the request.
  2193  func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header {
  2194  	if c.header_ == nil {
  2195  		c.header_ = make(http.Header)
  2196  	}
  2197  	return c.header_
  2198  }
  2199  
  2200  func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  2201  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2202  	var body io.Reader = nil
  2203  	c.urlParams_.Set("alt", alt)
  2204  	c.urlParams_.Set("prettyPrint", "false")
  2205  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  2206  	urls += "?" + c.urlParams_.Encode()
  2207  	req, err := http.NewRequest("DELETE", urls, body)
  2208  	if err != nil {
  2209  		return nil, err
  2210  	}
  2211  	req.Header = reqHeaders
  2212  	googleapi.Expand(req.URL, map[string]string{
  2213  		"name": c.name,
  2214  	})
  2215  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2216  }
  2217  
  2218  // Do executes the "notebooks.projects.locations.instances.delete" call.
  2219  // Any non-2xx status code is an error. Response headers are in either
  2220  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  2221  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2222  // whether the returned error was because http.StatusNotModified was returned.
  2223  func (c *ProjectsLocationsInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2224  	gensupport.SetOptions(c.urlParams_, opts...)
  2225  	res, err := c.doRequest("json")
  2226  	if res != nil && res.StatusCode == http.StatusNotModified {
  2227  		if res.Body != nil {
  2228  			res.Body.Close()
  2229  		}
  2230  		return nil, gensupport.WrapError(&googleapi.Error{
  2231  			Code:   res.StatusCode,
  2232  			Header: res.Header,
  2233  		})
  2234  	}
  2235  	if err != nil {
  2236  		return nil, err
  2237  	}
  2238  	defer googleapi.CloseBody(res)
  2239  	if err := googleapi.CheckResponse(res); err != nil {
  2240  		return nil, gensupport.WrapError(err)
  2241  	}
  2242  	ret := &Operation{
  2243  		ServerResponse: googleapi.ServerResponse{
  2244  			Header:         res.Header,
  2245  			HTTPStatusCode: res.StatusCode,
  2246  		},
  2247  	}
  2248  	target := &ret
  2249  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2250  		return nil, err
  2251  	}
  2252  	return ret, nil
  2253  }
  2254  
  2255  type ProjectsLocationsInstancesDiagnoseCall struct {
  2256  	s                       *Service
  2257  	name                    string
  2258  	diagnoseinstancerequest *DiagnoseInstanceRequest
  2259  	urlParams_              gensupport.URLParams
  2260  	ctx_                    context.Context
  2261  	header_                 http.Header
  2262  }
  2263  
  2264  // Diagnose: Creates a Diagnostic File and runs Diagnostic Tool given an
  2265  // Instance.
  2266  //
  2267  //   - name: Format:
  2268  //     `projects/{project_id}/locations/{location}/instances/{instance_id}`.
  2269  func (r *ProjectsLocationsInstancesService) Diagnose(name string, diagnoseinstancerequest *DiagnoseInstanceRequest) *ProjectsLocationsInstancesDiagnoseCall {
  2270  	c := &ProjectsLocationsInstancesDiagnoseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2271  	c.name = name
  2272  	c.diagnoseinstancerequest = diagnoseinstancerequest
  2273  	return c
  2274  }
  2275  
  2276  // Fields allows partial responses to be retrieved. See
  2277  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2278  // details.
  2279  func (c *ProjectsLocationsInstancesDiagnoseCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDiagnoseCall {
  2280  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2281  	return c
  2282  }
  2283  
  2284  // Context sets the context to be used in this call's Do method.
  2285  func (c *ProjectsLocationsInstancesDiagnoseCall) Context(ctx context.Context) *ProjectsLocationsInstancesDiagnoseCall {
  2286  	c.ctx_ = ctx
  2287  	return c
  2288  }
  2289  
  2290  // Header returns a http.Header that can be modified by the caller to add
  2291  // headers to the request.
  2292  func (c *ProjectsLocationsInstancesDiagnoseCall) Header() http.Header {
  2293  	if c.header_ == nil {
  2294  		c.header_ = make(http.Header)
  2295  	}
  2296  	return c.header_
  2297  }
  2298  
  2299  func (c *ProjectsLocationsInstancesDiagnoseCall) doRequest(alt string) (*http.Response, error) {
  2300  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2301  	var body io.Reader = nil
  2302  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.diagnoseinstancerequest)
  2303  	if err != nil {
  2304  		return nil, err
  2305  	}
  2306  	c.urlParams_.Set("alt", alt)
  2307  	c.urlParams_.Set("prettyPrint", "false")
  2308  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:diagnose")
  2309  	urls += "?" + c.urlParams_.Encode()
  2310  	req, err := http.NewRequest("POST", urls, body)
  2311  	if err != nil {
  2312  		return nil, err
  2313  	}
  2314  	req.Header = reqHeaders
  2315  	googleapi.Expand(req.URL, map[string]string{
  2316  		"name": c.name,
  2317  	})
  2318  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2319  }
  2320  
  2321  // Do executes the "notebooks.projects.locations.instances.diagnose" call.
  2322  // Any non-2xx status code is an error. Response headers are in either
  2323  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  2324  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2325  // whether the returned error was because http.StatusNotModified was returned.
  2326  func (c *ProjectsLocationsInstancesDiagnoseCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2327  	gensupport.SetOptions(c.urlParams_, opts...)
  2328  	res, err := c.doRequest("json")
  2329  	if res != nil && res.StatusCode == http.StatusNotModified {
  2330  		if res.Body != nil {
  2331  			res.Body.Close()
  2332  		}
  2333  		return nil, gensupport.WrapError(&googleapi.Error{
  2334  			Code:   res.StatusCode,
  2335  			Header: res.Header,
  2336  		})
  2337  	}
  2338  	if err != nil {
  2339  		return nil, err
  2340  	}
  2341  	defer googleapi.CloseBody(res)
  2342  	if err := googleapi.CheckResponse(res); err != nil {
  2343  		return nil, gensupport.WrapError(err)
  2344  	}
  2345  	ret := &Operation{
  2346  		ServerResponse: googleapi.ServerResponse{
  2347  			Header:         res.Header,
  2348  			HTTPStatusCode: res.StatusCode,
  2349  		},
  2350  	}
  2351  	target := &ret
  2352  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2353  		return nil, err
  2354  	}
  2355  	return ret, nil
  2356  }
  2357  
  2358  type ProjectsLocationsInstancesGetCall struct {
  2359  	s            *Service
  2360  	name         string
  2361  	urlParams_   gensupport.URLParams
  2362  	ifNoneMatch_ string
  2363  	ctx_         context.Context
  2364  	header_      http.Header
  2365  }
  2366  
  2367  // Get: Gets details of a single Instance.
  2368  //
  2369  //   - name: Format:
  2370  //     `projects/{project_id}/locations/{location}/instances/{instance_id}`.
  2371  func (r *ProjectsLocationsInstancesService) Get(name string) *ProjectsLocationsInstancesGetCall {
  2372  	c := &ProjectsLocationsInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2373  	c.name = name
  2374  	return c
  2375  }
  2376  
  2377  // Fields allows partial responses to be retrieved. See
  2378  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2379  // details.
  2380  func (c *ProjectsLocationsInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetCall {
  2381  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2382  	return c
  2383  }
  2384  
  2385  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2386  // object's ETag matches the given value. This is useful for getting updates
  2387  // only after the object has changed since the last request.
  2388  func (c *ProjectsLocationsInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetCall {
  2389  	c.ifNoneMatch_ = entityTag
  2390  	return c
  2391  }
  2392  
  2393  // Context sets the context to be used in this call's Do method.
  2394  func (c *ProjectsLocationsInstancesGetCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetCall {
  2395  	c.ctx_ = ctx
  2396  	return c
  2397  }
  2398  
  2399  // Header returns a http.Header that can be modified by the caller to add
  2400  // headers to the request.
  2401  func (c *ProjectsLocationsInstancesGetCall) Header() http.Header {
  2402  	if c.header_ == nil {
  2403  		c.header_ = make(http.Header)
  2404  	}
  2405  	return c.header_
  2406  }
  2407  
  2408  func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  2409  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2410  	if c.ifNoneMatch_ != "" {
  2411  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2412  	}
  2413  	var body io.Reader = nil
  2414  	c.urlParams_.Set("alt", alt)
  2415  	c.urlParams_.Set("prettyPrint", "false")
  2416  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  2417  	urls += "?" + c.urlParams_.Encode()
  2418  	req, err := http.NewRequest("GET", urls, body)
  2419  	if err != nil {
  2420  		return nil, err
  2421  	}
  2422  	req.Header = reqHeaders
  2423  	googleapi.Expand(req.URL, map[string]string{
  2424  		"name": c.name,
  2425  	})
  2426  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2427  }
  2428  
  2429  // Do executes the "notebooks.projects.locations.instances.get" call.
  2430  // Any non-2xx status code is an error. Response headers are in either
  2431  // *Instance.ServerResponse.Header or (if a response was returned at all) in
  2432  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2433  // whether the returned error was because http.StatusNotModified was returned.
  2434  func (c *ProjectsLocationsInstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  2435  	gensupport.SetOptions(c.urlParams_, opts...)
  2436  	res, err := c.doRequest("json")
  2437  	if res != nil && res.StatusCode == http.StatusNotModified {
  2438  		if res.Body != nil {
  2439  			res.Body.Close()
  2440  		}
  2441  		return nil, gensupport.WrapError(&googleapi.Error{
  2442  			Code:   res.StatusCode,
  2443  			Header: res.Header,
  2444  		})
  2445  	}
  2446  	if err != nil {
  2447  		return nil, err
  2448  	}
  2449  	defer googleapi.CloseBody(res)
  2450  	if err := googleapi.CheckResponse(res); err != nil {
  2451  		return nil, gensupport.WrapError(err)
  2452  	}
  2453  	ret := &Instance{
  2454  		ServerResponse: googleapi.ServerResponse{
  2455  			Header:         res.Header,
  2456  			HTTPStatusCode: res.StatusCode,
  2457  		},
  2458  	}
  2459  	target := &ret
  2460  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2461  		return nil, err
  2462  	}
  2463  	return ret, nil
  2464  }
  2465  
  2466  type ProjectsLocationsInstancesGetConfigCall struct {
  2467  	s            *Service
  2468  	name         string
  2469  	urlParams_   gensupport.URLParams
  2470  	ifNoneMatch_ string
  2471  	ctx_         context.Context
  2472  	header_      http.Header
  2473  }
  2474  
  2475  // GetConfig: Gets general backend configurations that might also affect the
  2476  // frontend. Location is required by CCFE. Although we could bypass it to send
  2477  // location- less request directly to the backend job, we would need CPE
  2478  // (go/cloud-cpe). Having the location might also be useful depending on the
  2479  // query.
  2480  //
  2481  // - name: Format: `projects/{project_id}/locations/{location}`.
  2482  func (r *ProjectsLocationsInstancesService) GetConfig(name string) *ProjectsLocationsInstancesGetConfigCall {
  2483  	c := &ProjectsLocationsInstancesGetConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2484  	c.name = name
  2485  	return c
  2486  }
  2487  
  2488  // Fields allows partial responses to be retrieved. See
  2489  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2490  // details.
  2491  func (c *ProjectsLocationsInstancesGetConfigCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetConfigCall {
  2492  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2493  	return c
  2494  }
  2495  
  2496  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2497  // object's ETag matches the given value. This is useful for getting updates
  2498  // only after the object has changed since the last request.
  2499  func (c *ProjectsLocationsInstancesGetConfigCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetConfigCall {
  2500  	c.ifNoneMatch_ = entityTag
  2501  	return c
  2502  }
  2503  
  2504  // Context sets the context to be used in this call's Do method.
  2505  func (c *ProjectsLocationsInstancesGetConfigCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetConfigCall {
  2506  	c.ctx_ = ctx
  2507  	return c
  2508  }
  2509  
  2510  // Header returns a http.Header that can be modified by the caller to add
  2511  // headers to the request.
  2512  func (c *ProjectsLocationsInstancesGetConfigCall) Header() http.Header {
  2513  	if c.header_ == nil {
  2514  		c.header_ = make(http.Header)
  2515  	}
  2516  	return c.header_
  2517  }
  2518  
  2519  func (c *ProjectsLocationsInstancesGetConfigCall) doRequest(alt string) (*http.Response, error) {
  2520  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2521  	if c.ifNoneMatch_ != "" {
  2522  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2523  	}
  2524  	var body io.Reader = nil
  2525  	c.urlParams_.Set("alt", alt)
  2526  	c.urlParams_.Set("prettyPrint", "false")
  2527  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/instances:getConfig")
  2528  	urls += "?" + c.urlParams_.Encode()
  2529  	req, err := http.NewRequest("GET", urls, body)
  2530  	if err != nil {
  2531  		return nil, err
  2532  	}
  2533  	req.Header = reqHeaders
  2534  	googleapi.Expand(req.URL, map[string]string{
  2535  		"name": c.name,
  2536  	})
  2537  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2538  }
  2539  
  2540  // Do executes the "notebooks.projects.locations.instances.getConfig" call.
  2541  // Any non-2xx status code is an error. Response headers are in either
  2542  // *Config.ServerResponse.Header or (if a response was returned at all) in
  2543  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2544  // whether the returned error was because http.StatusNotModified was returned.
  2545  func (c *ProjectsLocationsInstancesGetConfigCall) Do(opts ...googleapi.CallOption) (*Config, error) {
  2546  	gensupport.SetOptions(c.urlParams_, opts...)
  2547  	res, err := c.doRequest("json")
  2548  	if res != nil && res.StatusCode == http.StatusNotModified {
  2549  		if res.Body != nil {
  2550  			res.Body.Close()
  2551  		}
  2552  		return nil, gensupport.WrapError(&googleapi.Error{
  2553  			Code:   res.StatusCode,
  2554  			Header: res.Header,
  2555  		})
  2556  	}
  2557  	if err != nil {
  2558  		return nil, err
  2559  	}
  2560  	defer googleapi.CloseBody(res)
  2561  	if err := googleapi.CheckResponse(res); err != nil {
  2562  		return nil, gensupport.WrapError(err)
  2563  	}
  2564  	ret := &Config{
  2565  		ServerResponse: googleapi.ServerResponse{
  2566  			Header:         res.Header,
  2567  			HTTPStatusCode: res.StatusCode,
  2568  		},
  2569  	}
  2570  	target := &ret
  2571  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2572  		return nil, err
  2573  	}
  2574  	return ret, nil
  2575  }
  2576  
  2577  type ProjectsLocationsInstancesGetIamPolicyCall struct {
  2578  	s            *Service
  2579  	resource     string
  2580  	urlParams_   gensupport.URLParams
  2581  	ifNoneMatch_ string
  2582  	ctx_         context.Context
  2583  	header_      http.Header
  2584  }
  2585  
  2586  // GetIamPolicy: Gets the access control policy for a resource. Returns an
  2587  // empty policy if the resource exists and does not have a policy set.
  2588  //
  2589  //   - resource: REQUIRED: The resource for which the policy is being requested.
  2590  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  2591  //     for the appropriate value for this field.
  2592  func (r *ProjectsLocationsInstancesService) GetIamPolicy(resource string) *ProjectsLocationsInstancesGetIamPolicyCall {
  2593  	c := &ProjectsLocationsInstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2594  	c.resource = resource
  2595  	return c
  2596  }
  2597  
  2598  // OptionsRequestedPolicyVersion sets the optional parameter
  2599  // "options.requestedPolicyVersion": The maximum policy version that will be
  2600  // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
  2601  // an invalid value will be rejected. Requests for policies with any
  2602  // conditional role bindings must specify version 3. Policies with no
  2603  // conditional role bindings may specify any valid value or leave the field
  2604  // unset. The policy in the response might use the policy version that you
  2605  // specified, or it might use a lower policy version. For example, if you
  2606  // specify version 3, but the policy has no conditional role bindings, the
  2607  // response uses version 1. To learn which resources support conditions in
  2608  // their IAM policies, see the IAM documentation
  2609  // (https://cloud.google.com/iam/help/conditions/resource-policies).
  2610  func (c *ProjectsLocationsInstancesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsInstancesGetIamPolicyCall {
  2611  	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
  2612  	return c
  2613  }
  2614  
  2615  // Fields allows partial responses to be retrieved. See
  2616  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2617  // details.
  2618  func (c *ProjectsLocationsInstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetIamPolicyCall {
  2619  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2620  	return c
  2621  }
  2622  
  2623  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2624  // object's ETag matches the given value. This is useful for getting updates
  2625  // only after the object has changed since the last request.
  2626  func (c *ProjectsLocationsInstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetIamPolicyCall {
  2627  	c.ifNoneMatch_ = entityTag
  2628  	return c
  2629  }
  2630  
  2631  // Context sets the context to be used in this call's Do method.
  2632  func (c *ProjectsLocationsInstancesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetIamPolicyCall {
  2633  	c.ctx_ = ctx
  2634  	return c
  2635  }
  2636  
  2637  // Header returns a http.Header that can be modified by the caller to add
  2638  // headers to the request.
  2639  func (c *ProjectsLocationsInstancesGetIamPolicyCall) Header() http.Header {
  2640  	if c.header_ == nil {
  2641  		c.header_ = make(http.Header)
  2642  	}
  2643  	return c.header_
  2644  }
  2645  
  2646  func (c *ProjectsLocationsInstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2647  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2648  	if c.ifNoneMatch_ != "" {
  2649  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2650  	}
  2651  	var body io.Reader = nil
  2652  	c.urlParams_.Set("alt", alt)
  2653  	c.urlParams_.Set("prettyPrint", "false")
  2654  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:getIamPolicy")
  2655  	urls += "?" + c.urlParams_.Encode()
  2656  	req, err := http.NewRequest("GET", urls, body)
  2657  	if err != nil {
  2658  		return nil, err
  2659  	}
  2660  	req.Header = reqHeaders
  2661  	googleapi.Expand(req.URL, map[string]string{
  2662  		"resource": c.resource,
  2663  	})
  2664  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2665  }
  2666  
  2667  // Do executes the "notebooks.projects.locations.instances.getIamPolicy" call.
  2668  // Any non-2xx status code is an error. Response headers are in either
  2669  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  2670  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2671  // whether the returned error was because http.StatusNotModified was returned.
  2672  func (c *ProjectsLocationsInstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2673  	gensupport.SetOptions(c.urlParams_, opts...)
  2674  	res, err := c.doRequest("json")
  2675  	if res != nil && res.StatusCode == http.StatusNotModified {
  2676  		if res.Body != nil {
  2677  			res.Body.Close()
  2678  		}
  2679  		return nil, gensupport.WrapError(&googleapi.Error{
  2680  			Code:   res.StatusCode,
  2681  			Header: res.Header,
  2682  		})
  2683  	}
  2684  	if err != nil {
  2685  		return nil, err
  2686  	}
  2687  	defer googleapi.CloseBody(res)
  2688  	if err := googleapi.CheckResponse(res); err != nil {
  2689  		return nil, gensupport.WrapError(err)
  2690  	}
  2691  	ret := &Policy{
  2692  		ServerResponse: googleapi.ServerResponse{
  2693  			Header:         res.Header,
  2694  			HTTPStatusCode: res.StatusCode,
  2695  		},
  2696  	}
  2697  	target := &ret
  2698  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2699  		return nil, err
  2700  	}
  2701  	return ret, nil
  2702  }
  2703  
  2704  type ProjectsLocationsInstancesListCall struct {
  2705  	s            *Service
  2706  	parent       string
  2707  	urlParams_   gensupport.URLParams
  2708  	ifNoneMatch_ string
  2709  	ctx_         context.Context
  2710  	header_      http.Header
  2711  }
  2712  
  2713  // List: Lists instances in a given project and location.
  2714  //
  2715  // - parent: Format: `parent=projects/{project_id}/locations/{location}`.
  2716  func (r *ProjectsLocationsInstancesService) List(parent string) *ProjectsLocationsInstancesListCall {
  2717  	c := &ProjectsLocationsInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2718  	c.parent = parent
  2719  	return c
  2720  }
  2721  
  2722  // Filter sets the optional parameter "filter": List filter.
  2723  func (c *ProjectsLocationsInstancesListCall) Filter(filter string) *ProjectsLocationsInstancesListCall {
  2724  	c.urlParams_.Set("filter", filter)
  2725  	return c
  2726  }
  2727  
  2728  // OrderBy sets the optional parameter "orderBy": Sort results. Supported
  2729  // values are "name", "name desc" or "" (unsorted).
  2730  func (c *ProjectsLocationsInstancesListCall) OrderBy(orderBy string) *ProjectsLocationsInstancesListCall {
  2731  	c.urlParams_.Set("orderBy", orderBy)
  2732  	return c
  2733  }
  2734  
  2735  // PageSize sets the optional parameter "pageSize": Maximum return size of the
  2736  // list call.
  2737  func (c *ProjectsLocationsInstancesListCall) PageSize(pageSize int64) *ProjectsLocationsInstancesListCall {
  2738  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2739  	return c
  2740  }
  2741  
  2742  // PageToken sets the optional parameter "pageToken": A previous returned page
  2743  // token that can be used to continue listing from the last result.
  2744  func (c *ProjectsLocationsInstancesListCall) PageToken(pageToken string) *ProjectsLocationsInstancesListCall {
  2745  	c.urlParams_.Set("pageToken", pageToken)
  2746  	return c
  2747  }
  2748  
  2749  // Fields allows partial responses to be retrieved. See
  2750  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2751  // details.
  2752  func (c *ProjectsLocationsInstancesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesListCall {
  2753  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2754  	return c
  2755  }
  2756  
  2757  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2758  // object's ETag matches the given value. This is useful for getting updates
  2759  // only after the object has changed since the last request.
  2760  func (c *ProjectsLocationsInstancesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesListCall {
  2761  	c.ifNoneMatch_ = entityTag
  2762  	return c
  2763  }
  2764  
  2765  // Context sets the context to be used in this call's Do method.
  2766  func (c *ProjectsLocationsInstancesListCall) Context(ctx context.Context) *ProjectsLocationsInstancesListCall {
  2767  	c.ctx_ = ctx
  2768  	return c
  2769  }
  2770  
  2771  // Header returns a http.Header that can be modified by the caller to add
  2772  // headers to the request.
  2773  func (c *ProjectsLocationsInstancesListCall) Header() http.Header {
  2774  	if c.header_ == nil {
  2775  		c.header_ = make(http.Header)
  2776  	}
  2777  	return c.header_
  2778  }
  2779  
  2780  func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Response, error) {
  2781  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2782  	if c.ifNoneMatch_ != "" {
  2783  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2784  	}
  2785  	var body io.Reader = nil
  2786  	c.urlParams_.Set("alt", alt)
  2787  	c.urlParams_.Set("prettyPrint", "false")
  2788  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/instances")
  2789  	urls += "?" + c.urlParams_.Encode()
  2790  	req, err := http.NewRequest("GET", urls, body)
  2791  	if err != nil {
  2792  		return nil, err
  2793  	}
  2794  	req.Header = reqHeaders
  2795  	googleapi.Expand(req.URL, map[string]string{
  2796  		"parent": c.parent,
  2797  	})
  2798  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2799  }
  2800  
  2801  // Do executes the "notebooks.projects.locations.instances.list" call.
  2802  // Any non-2xx status code is an error. Response headers are in either
  2803  // *ListInstancesResponse.ServerResponse.Header or (if a response was returned
  2804  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2805  // check whether the returned error was because http.StatusNotModified was
  2806  // returned.
  2807  func (c *ProjectsLocationsInstancesListCall) Do(opts ...googleapi.CallOption) (*ListInstancesResponse, error) {
  2808  	gensupport.SetOptions(c.urlParams_, opts...)
  2809  	res, err := c.doRequest("json")
  2810  	if res != nil && res.StatusCode == http.StatusNotModified {
  2811  		if res.Body != nil {
  2812  			res.Body.Close()
  2813  		}
  2814  		return nil, gensupport.WrapError(&googleapi.Error{
  2815  			Code:   res.StatusCode,
  2816  			Header: res.Header,
  2817  		})
  2818  	}
  2819  	if err != nil {
  2820  		return nil, err
  2821  	}
  2822  	defer googleapi.CloseBody(res)
  2823  	if err := googleapi.CheckResponse(res); err != nil {
  2824  		return nil, gensupport.WrapError(err)
  2825  	}
  2826  	ret := &ListInstancesResponse{
  2827  		ServerResponse: googleapi.ServerResponse{
  2828  			Header:         res.Header,
  2829  			HTTPStatusCode: res.StatusCode,
  2830  		},
  2831  	}
  2832  	target := &ret
  2833  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2834  		return nil, err
  2835  	}
  2836  	return ret, nil
  2837  }
  2838  
  2839  // Pages invokes f for each page of results.
  2840  // A non-nil error returned from f will halt the iteration.
  2841  // The provided context supersedes any context provided to the Context method.
  2842  func (c *ProjectsLocationsInstancesListCall) Pages(ctx context.Context, f func(*ListInstancesResponse) error) error {
  2843  	c.ctx_ = ctx
  2844  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2845  	for {
  2846  		x, err := c.Do()
  2847  		if err != nil {
  2848  			return err
  2849  		}
  2850  		if err := f(x); err != nil {
  2851  			return err
  2852  		}
  2853  		if x.NextPageToken == "" {
  2854  			return nil
  2855  		}
  2856  		c.PageToken(x.NextPageToken)
  2857  	}
  2858  }
  2859  
  2860  type ProjectsLocationsInstancesPatchCall struct {
  2861  	s          *Service
  2862  	name       string
  2863  	instance   *Instance
  2864  	urlParams_ gensupport.URLParams
  2865  	ctx_       context.Context
  2866  	header_    http.Header
  2867  }
  2868  
  2869  // Patch: UpdateInstance updates an Instance.
  2870  //
  2871  //   - name: Output only. The name of this notebook instance. Format:
  2872  //     `projects/{project_id}/locations/{location}/instances/{instance_id}`.
  2873  func (r *ProjectsLocationsInstancesService) Patch(name string, instance *Instance) *ProjectsLocationsInstancesPatchCall {
  2874  	c := &ProjectsLocationsInstancesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2875  	c.name = name
  2876  	c.instance = instance
  2877  	return c
  2878  }
  2879  
  2880  // RequestId sets the optional parameter "requestId": Idempotent request UUID.
  2881  func (c *ProjectsLocationsInstancesPatchCall) RequestId(requestId string) *ProjectsLocationsInstancesPatchCall {
  2882  	c.urlParams_.Set("requestId", requestId)
  2883  	return c
  2884  }
  2885  
  2886  // UpdateMask sets the optional parameter "updateMask": Required. Mask used to
  2887  // update an instance
  2888  func (c *ProjectsLocationsInstancesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsInstancesPatchCall {
  2889  	c.urlParams_.Set("updateMask", updateMask)
  2890  	return c
  2891  }
  2892  
  2893  // Fields allows partial responses to be retrieved. See
  2894  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2895  // details.
  2896  func (c *ProjectsLocationsInstancesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesPatchCall {
  2897  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2898  	return c
  2899  }
  2900  
  2901  // Context sets the context to be used in this call's Do method.
  2902  func (c *ProjectsLocationsInstancesPatchCall) Context(ctx context.Context) *ProjectsLocationsInstancesPatchCall {
  2903  	c.ctx_ = ctx
  2904  	return c
  2905  }
  2906  
  2907  // Header returns a http.Header that can be modified by the caller to add
  2908  // headers to the request.
  2909  func (c *ProjectsLocationsInstancesPatchCall) Header() http.Header {
  2910  	if c.header_ == nil {
  2911  		c.header_ = make(http.Header)
  2912  	}
  2913  	return c.header_
  2914  }
  2915  
  2916  func (c *ProjectsLocationsInstancesPatchCall) doRequest(alt string) (*http.Response, error) {
  2917  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2918  	var body io.Reader = nil
  2919  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
  2920  	if err != nil {
  2921  		return nil, err
  2922  	}
  2923  	c.urlParams_.Set("alt", alt)
  2924  	c.urlParams_.Set("prettyPrint", "false")
  2925  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  2926  	urls += "?" + c.urlParams_.Encode()
  2927  	req, err := http.NewRequest("PATCH", urls, body)
  2928  	if err != nil {
  2929  		return nil, err
  2930  	}
  2931  	req.Header = reqHeaders
  2932  	googleapi.Expand(req.URL, map[string]string{
  2933  		"name": c.name,
  2934  	})
  2935  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2936  }
  2937  
  2938  // Do executes the "notebooks.projects.locations.instances.patch" call.
  2939  // Any non-2xx status code is an error. Response headers are in either
  2940  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  2941  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2942  // whether the returned error was because http.StatusNotModified was returned.
  2943  func (c *ProjectsLocationsInstancesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2944  	gensupport.SetOptions(c.urlParams_, opts...)
  2945  	res, err := c.doRequest("json")
  2946  	if res != nil && res.StatusCode == http.StatusNotModified {
  2947  		if res.Body != nil {
  2948  			res.Body.Close()
  2949  		}
  2950  		return nil, gensupport.WrapError(&googleapi.Error{
  2951  			Code:   res.StatusCode,
  2952  			Header: res.Header,
  2953  		})
  2954  	}
  2955  	if err != nil {
  2956  		return nil, err
  2957  	}
  2958  	defer googleapi.CloseBody(res)
  2959  	if err := googleapi.CheckResponse(res); err != nil {
  2960  		return nil, gensupport.WrapError(err)
  2961  	}
  2962  	ret := &Operation{
  2963  		ServerResponse: googleapi.ServerResponse{
  2964  			Header:         res.Header,
  2965  			HTTPStatusCode: res.StatusCode,
  2966  		},
  2967  	}
  2968  	target := &ret
  2969  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2970  		return nil, err
  2971  	}
  2972  	return ret, nil
  2973  }
  2974  
  2975  type ProjectsLocationsInstancesReportInfoSystemCall struct {
  2976  	s                               *Service
  2977  	name                            string
  2978  	reportinstanceinfosystemrequest *ReportInstanceInfoSystemRequest
  2979  	urlParams_                      gensupport.URLParams
  2980  	ctx_                            context.Context
  2981  	header_                         http.Header
  2982  }
  2983  
  2984  // ReportInfoSystem: Allows notebook instances to report their latest instance
  2985  // information to the Notebooks API server. The server will merge the reported
  2986  // information to the instance metadata store. Do not use this method directly.
  2987  //
  2988  //   - name: Format:
  2989  //     `projects/{project_id}/locations/{location}/instances/{instance_id}`.
  2990  func (r *ProjectsLocationsInstancesService) ReportInfoSystem(name string, reportinstanceinfosystemrequest *ReportInstanceInfoSystemRequest) *ProjectsLocationsInstancesReportInfoSystemCall {
  2991  	c := &ProjectsLocationsInstancesReportInfoSystemCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2992  	c.name = name
  2993  	c.reportinstanceinfosystemrequest = reportinstanceinfosystemrequest
  2994  	return c
  2995  }
  2996  
  2997  // Fields allows partial responses to be retrieved. See
  2998  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2999  // details.
  3000  func (c *ProjectsLocationsInstancesReportInfoSystemCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesReportInfoSystemCall {
  3001  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3002  	return c
  3003  }
  3004  
  3005  // Context sets the context to be used in this call's Do method.
  3006  func (c *ProjectsLocationsInstancesReportInfoSystemCall) Context(ctx context.Context) *ProjectsLocationsInstancesReportInfoSystemCall {
  3007  	c.ctx_ = ctx
  3008  	return c
  3009  }
  3010  
  3011  // Header returns a http.Header that can be modified by the caller to add
  3012  // headers to the request.
  3013  func (c *ProjectsLocationsInstancesReportInfoSystemCall) Header() http.Header {
  3014  	if c.header_ == nil {
  3015  		c.header_ = make(http.Header)
  3016  	}
  3017  	return c.header_
  3018  }
  3019  
  3020  func (c *ProjectsLocationsInstancesReportInfoSystemCall) doRequest(alt string) (*http.Response, error) {
  3021  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3022  	var body io.Reader = nil
  3023  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportinstanceinfosystemrequest)
  3024  	if err != nil {
  3025  		return nil, err
  3026  	}
  3027  	c.urlParams_.Set("alt", alt)
  3028  	c.urlParams_.Set("prettyPrint", "false")
  3029  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:reportInfoSystem")
  3030  	urls += "?" + c.urlParams_.Encode()
  3031  	req, err := http.NewRequest("POST", urls, body)
  3032  	if err != nil {
  3033  		return nil, err
  3034  	}
  3035  	req.Header = reqHeaders
  3036  	googleapi.Expand(req.URL, map[string]string{
  3037  		"name": c.name,
  3038  	})
  3039  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3040  }
  3041  
  3042  // Do executes the "notebooks.projects.locations.instances.reportInfoSystem" call.
  3043  // Any non-2xx status code is an error. Response headers are in either
  3044  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3045  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3046  // whether the returned error was because http.StatusNotModified was returned.
  3047  func (c *ProjectsLocationsInstancesReportInfoSystemCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3048  	gensupport.SetOptions(c.urlParams_, opts...)
  3049  	res, err := c.doRequest("json")
  3050  	if res != nil && res.StatusCode == http.StatusNotModified {
  3051  		if res.Body != nil {
  3052  			res.Body.Close()
  3053  		}
  3054  		return nil, gensupport.WrapError(&googleapi.Error{
  3055  			Code:   res.StatusCode,
  3056  			Header: res.Header,
  3057  		})
  3058  	}
  3059  	if err != nil {
  3060  		return nil, err
  3061  	}
  3062  	defer googleapi.CloseBody(res)
  3063  	if err := googleapi.CheckResponse(res); err != nil {
  3064  		return nil, gensupport.WrapError(err)
  3065  	}
  3066  	ret := &Operation{
  3067  		ServerResponse: googleapi.ServerResponse{
  3068  			Header:         res.Header,
  3069  			HTTPStatusCode: res.StatusCode,
  3070  		},
  3071  	}
  3072  	target := &ret
  3073  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3074  		return nil, err
  3075  	}
  3076  	return ret, nil
  3077  }
  3078  
  3079  type ProjectsLocationsInstancesResetCall struct {
  3080  	s                    *Service
  3081  	name                 string
  3082  	resetinstancerequest *ResetInstanceRequest
  3083  	urlParams_           gensupport.URLParams
  3084  	ctx_                 context.Context
  3085  	header_              http.Header
  3086  }
  3087  
  3088  // Reset: Resets a notebook instance.
  3089  //
  3090  //   - name: Format:
  3091  //     `projects/{project_id}/locations/{location}/instances/{instance_id}`.
  3092  func (r *ProjectsLocationsInstancesService) Reset(name string, resetinstancerequest *ResetInstanceRequest) *ProjectsLocationsInstancesResetCall {
  3093  	c := &ProjectsLocationsInstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3094  	c.name = name
  3095  	c.resetinstancerequest = resetinstancerequest
  3096  	return c
  3097  }
  3098  
  3099  // Fields allows partial responses to be retrieved. See
  3100  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3101  // details.
  3102  func (c *ProjectsLocationsInstancesResetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesResetCall {
  3103  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3104  	return c
  3105  }
  3106  
  3107  // Context sets the context to be used in this call's Do method.
  3108  func (c *ProjectsLocationsInstancesResetCall) Context(ctx context.Context) *ProjectsLocationsInstancesResetCall {
  3109  	c.ctx_ = ctx
  3110  	return c
  3111  }
  3112  
  3113  // Header returns a http.Header that can be modified by the caller to add
  3114  // headers to the request.
  3115  func (c *ProjectsLocationsInstancesResetCall) Header() http.Header {
  3116  	if c.header_ == nil {
  3117  		c.header_ = make(http.Header)
  3118  	}
  3119  	return c.header_
  3120  }
  3121  
  3122  func (c *ProjectsLocationsInstancesResetCall) doRequest(alt string) (*http.Response, error) {
  3123  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3124  	var body io.Reader = nil
  3125  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetinstancerequest)
  3126  	if err != nil {
  3127  		return nil, err
  3128  	}
  3129  	c.urlParams_.Set("alt", alt)
  3130  	c.urlParams_.Set("prettyPrint", "false")
  3131  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:reset")
  3132  	urls += "?" + c.urlParams_.Encode()
  3133  	req, err := http.NewRequest("POST", urls, body)
  3134  	if err != nil {
  3135  		return nil, err
  3136  	}
  3137  	req.Header = reqHeaders
  3138  	googleapi.Expand(req.URL, map[string]string{
  3139  		"name": c.name,
  3140  	})
  3141  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3142  }
  3143  
  3144  // Do executes the "notebooks.projects.locations.instances.reset" call.
  3145  // Any non-2xx status code is an error. Response headers are in either
  3146  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3147  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3148  // whether the returned error was because http.StatusNotModified was returned.
  3149  func (c *ProjectsLocationsInstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3150  	gensupport.SetOptions(c.urlParams_, opts...)
  3151  	res, err := c.doRequest("json")
  3152  	if res != nil && res.StatusCode == http.StatusNotModified {
  3153  		if res.Body != nil {
  3154  			res.Body.Close()
  3155  		}
  3156  		return nil, gensupport.WrapError(&googleapi.Error{
  3157  			Code:   res.StatusCode,
  3158  			Header: res.Header,
  3159  		})
  3160  	}
  3161  	if err != nil {
  3162  		return nil, err
  3163  	}
  3164  	defer googleapi.CloseBody(res)
  3165  	if err := googleapi.CheckResponse(res); err != nil {
  3166  		return nil, gensupport.WrapError(err)
  3167  	}
  3168  	ret := &Operation{
  3169  		ServerResponse: googleapi.ServerResponse{
  3170  			Header:         res.Header,
  3171  			HTTPStatusCode: res.StatusCode,
  3172  		},
  3173  	}
  3174  	target := &ret
  3175  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3176  		return nil, err
  3177  	}
  3178  	return ret, nil
  3179  }
  3180  
  3181  type ProjectsLocationsInstancesResizeDiskCall struct {
  3182  	s                 *Service
  3183  	notebookInstance  string
  3184  	resizediskrequest *ResizeDiskRequest
  3185  	urlParams_        gensupport.URLParams
  3186  	ctx_              context.Context
  3187  	header_           http.Header
  3188  }
  3189  
  3190  // ResizeDisk: Resize a notebook instance disk to a higher capacity.
  3191  //
  3192  //   - notebookInstance: Format:
  3193  //     `projects/{project_id}/locations/{location}/instances/{instance_id}`.
  3194  func (r *ProjectsLocationsInstancesService) ResizeDisk(notebookInstance string, resizediskrequest *ResizeDiskRequest) *ProjectsLocationsInstancesResizeDiskCall {
  3195  	c := &ProjectsLocationsInstancesResizeDiskCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3196  	c.notebookInstance = notebookInstance
  3197  	c.resizediskrequest = resizediskrequest
  3198  	return c
  3199  }
  3200  
  3201  // Fields allows partial responses to be retrieved. See
  3202  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3203  // details.
  3204  func (c *ProjectsLocationsInstancesResizeDiskCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesResizeDiskCall {
  3205  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3206  	return c
  3207  }
  3208  
  3209  // Context sets the context to be used in this call's Do method.
  3210  func (c *ProjectsLocationsInstancesResizeDiskCall) Context(ctx context.Context) *ProjectsLocationsInstancesResizeDiskCall {
  3211  	c.ctx_ = ctx
  3212  	return c
  3213  }
  3214  
  3215  // Header returns a http.Header that can be modified by the caller to add
  3216  // headers to the request.
  3217  func (c *ProjectsLocationsInstancesResizeDiskCall) Header() http.Header {
  3218  	if c.header_ == nil {
  3219  		c.header_ = make(http.Header)
  3220  	}
  3221  	return c.header_
  3222  }
  3223  
  3224  func (c *ProjectsLocationsInstancesResizeDiskCall) doRequest(alt string) (*http.Response, error) {
  3225  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3226  	var body io.Reader = nil
  3227  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.resizediskrequest)
  3228  	if err != nil {
  3229  		return nil, err
  3230  	}
  3231  	c.urlParams_.Set("alt", alt)
  3232  	c.urlParams_.Set("prettyPrint", "false")
  3233  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+notebookInstance}:resizeDisk")
  3234  	urls += "?" + c.urlParams_.Encode()
  3235  	req, err := http.NewRequest("POST", urls, body)
  3236  	if err != nil {
  3237  		return nil, err
  3238  	}
  3239  	req.Header = reqHeaders
  3240  	googleapi.Expand(req.URL, map[string]string{
  3241  		"notebookInstance": c.notebookInstance,
  3242  	})
  3243  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3244  }
  3245  
  3246  // Do executes the "notebooks.projects.locations.instances.resizeDisk" call.
  3247  // Any non-2xx status code is an error. Response headers are in either
  3248  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3249  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3250  // whether the returned error was because http.StatusNotModified was returned.
  3251  func (c *ProjectsLocationsInstancesResizeDiskCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3252  	gensupport.SetOptions(c.urlParams_, opts...)
  3253  	res, err := c.doRequest("json")
  3254  	if res != nil && res.StatusCode == http.StatusNotModified {
  3255  		if res.Body != nil {
  3256  			res.Body.Close()
  3257  		}
  3258  		return nil, gensupport.WrapError(&googleapi.Error{
  3259  			Code:   res.StatusCode,
  3260  			Header: res.Header,
  3261  		})
  3262  	}
  3263  	if err != nil {
  3264  		return nil, err
  3265  	}
  3266  	defer googleapi.CloseBody(res)
  3267  	if err := googleapi.CheckResponse(res); err != nil {
  3268  		return nil, gensupport.WrapError(err)
  3269  	}
  3270  	ret := &Operation{
  3271  		ServerResponse: googleapi.ServerResponse{
  3272  			Header:         res.Header,
  3273  			HTTPStatusCode: res.StatusCode,
  3274  		},
  3275  	}
  3276  	target := &ret
  3277  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3278  		return nil, err
  3279  	}
  3280  	return ret, nil
  3281  }
  3282  
  3283  type ProjectsLocationsInstancesRollbackCall struct {
  3284  	s                       *Service
  3285  	name                    string
  3286  	rollbackinstancerequest *RollbackInstanceRequest
  3287  	urlParams_              gensupport.URLParams
  3288  	ctx_                    context.Context
  3289  	header_                 http.Header
  3290  }
  3291  
  3292  // Rollback: Rollbacks a notebook instance to the previous version.
  3293  //
  3294  //   - name: Format:
  3295  //     `projects/{project_id}/locations/{location}/instances/{instance_id}`.
  3296  func (r *ProjectsLocationsInstancesService) Rollback(name string, rollbackinstancerequest *RollbackInstanceRequest) *ProjectsLocationsInstancesRollbackCall {
  3297  	c := &ProjectsLocationsInstancesRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3298  	c.name = name
  3299  	c.rollbackinstancerequest = rollbackinstancerequest
  3300  	return c
  3301  }
  3302  
  3303  // Fields allows partial responses to be retrieved. See
  3304  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3305  // details.
  3306  func (c *ProjectsLocationsInstancesRollbackCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesRollbackCall {
  3307  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3308  	return c
  3309  }
  3310  
  3311  // Context sets the context to be used in this call's Do method.
  3312  func (c *ProjectsLocationsInstancesRollbackCall) Context(ctx context.Context) *ProjectsLocationsInstancesRollbackCall {
  3313  	c.ctx_ = ctx
  3314  	return c
  3315  }
  3316  
  3317  // Header returns a http.Header that can be modified by the caller to add
  3318  // headers to the request.
  3319  func (c *ProjectsLocationsInstancesRollbackCall) Header() http.Header {
  3320  	if c.header_ == nil {
  3321  		c.header_ = make(http.Header)
  3322  	}
  3323  	return c.header_
  3324  }
  3325  
  3326  func (c *ProjectsLocationsInstancesRollbackCall) doRequest(alt string) (*http.Response, error) {
  3327  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3328  	var body io.Reader = nil
  3329  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackinstancerequest)
  3330  	if err != nil {
  3331  		return nil, err
  3332  	}
  3333  	c.urlParams_.Set("alt", alt)
  3334  	c.urlParams_.Set("prettyPrint", "false")
  3335  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:rollback")
  3336  	urls += "?" + c.urlParams_.Encode()
  3337  	req, err := http.NewRequest("POST", urls, body)
  3338  	if err != nil {
  3339  		return nil, err
  3340  	}
  3341  	req.Header = reqHeaders
  3342  	googleapi.Expand(req.URL, map[string]string{
  3343  		"name": c.name,
  3344  	})
  3345  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3346  }
  3347  
  3348  // Do executes the "notebooks.projects.locations.instances.rollback" call.
  3349  // Any non-2xx status code is an error. Response headers are in either
  3350  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3351  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3352  // whether the returned error was because http.StatusNotModified was returned.
  3353  func (c *ProjectsLocationsInstancesRollbackCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3354  	gensupport.SetOptions(c.urlParams_, opts...)
  3355  	res, err := c.doRequest("json")
  3356  	if res != nil && res.StatusCode == http.StatusNotModified {
  3357  		if res.Body != nil {
  3358  			res.Body.Close()
  3359  		}
  3360  		return nil, gensupport.WrapError(&googleapi.Error{
  3361  			Code:   res.StatusCode,
  3362  			Header: res.Header,
  3363  		})
  3364  	}
  3365  	if err != nil {
  3366  		return nil, err
  3367  	}
  3368  	defer googleapi.CloseBody(res)
  3369  	if err := googleapi.CheckResponse(res); err != nil {
  3370  		return nil, gensupport.WrapError(err)
  3371  	}
  3372  	ret := &Operation{
  3373  		ServerResponse: googleapi.ServerResponse{
  3374  			Header:         res.Header,
  3375  			HTTPStatusCode: res.StatusCode,
  3376  		},
  3377  	}
  3378  	target := &ret
  3379  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3380  		return nil, err
  3381  	}
  3382  	return ret, nil
  3383  }
  3384  
  3385  type ProjectsLocationsInstancesSetIamPolicyCall struct {
  3386  	s                   *Service
  3387  	resource            string
  3388  	setiampolicyrequest *SetIamPolicyRequest
  3389  	urlParams_          gensupport.URLParams
  3390  	ctx_                context.Context
  3391  	header_             http.Header
  3392  }
  3393  
  3394  // SetIamPolicy: Sets the access control policy on the specified resource.
  3395  // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
  3396  // and `PERMISSION_DENIED` errors.
  3397  //
  3398  //   - resource: REQUIRED: The resource for which the policy is being specified.
  3399  //     See Resource names (https://cloud.google.com/apis/design/resource_names)
  3400  //     for the appropriate value for this field.
  3401  func (r *ProjectsLocationsInstancesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsInstancesSetIamPolicyCall {
  3402  	c := &ProjectsLocationsInstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3403  	c.resource = resource
  3404  	c.setiampolicyrequest = setiampolicyrequest
  3405  	return c
  3406  }
  3407  
  3408  // Fields allows partial responses to be retrieved. See
  3409  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3410  // details.
  3411  func (c *ProjectsLocationsInstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesSetIamPolicyCall {
  3412  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3413  	return c
  3414  }
  3415  
  3416  // Context sets the context to be used in this call's Do method.
  3417  func (c *ProjectsLocationsInstancesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsInstancesSetIamPolicyCall {
  3418  	c.ctx_ = ctx
  3419  	return c
  3420  }
  3421  
  3422  // Header returns a http.Header that can be modified by the caller to add
  3423  // headers to the request.
  3424  func (c *ProjectsLocationsInstancesSetIamPolicyCall) Header() http.Header {
  3425  	if c.header_ == nil {
  3426  		c.header_ = make(http.Header)
  3427  	}
  3428  	return c.header_
  3429  }
  3430  
  3431  func (c *ProjectsLocationsInstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3432  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3433  	var body io.Reader = nil
  3434  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  3435  	if err != nil {
  3436  		return nil, err
  3437  	}
  3438  	c.urlParams_.Set("alt", alt)
  3439  	c.urlParams_.Set("prettyPrint", "false")
  3440  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:setIamPolicy")
  3441  	urls += "?" + c.urlParams_.Encode()
  3442  	req, err := http.NewRequest("POST", urls, body)
  3443  	if err != nil {
  3444  		return nil, err
  3445  	}
  3446  	req.Header = reqHeaders
  3447  	googleapi.Expand(req.URL, map[string]string{
  3448  		"resource": c.resource,
  3449  	})
  3450  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3451  }
  3452  
  3453  // Do executes the "notebooks.projects.locations.instances.setIamPolicy" call.
  3454  // Any non-2xx status code is an error. Response headers are in either
  3455  // *Policy.ServerResponse.Header or (if a response was returned at all) in
  3456  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3457  // whether the returned error was because http.StatusNotModified was returned.
  3458  func (c *ProjectsLocationsInstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3459  	gensupport.SetOptions(c.urlParams_, opts...)
  3460  	res, err := c.doRequest("json")
  3461  	if res != nil && res.StatusCode == http.StatusNotModified {
  3462  		if res.Body != nil {
  3463  			res.Body.Close()
  3464  		}
  3465  		return nil, gensupport.WrapError(&googleapi.Error{
  3466  			Code:   res.StatusCode,
  3467  			Header: res.Header,
  3468  		})
  3469  	}
  3470  	if err != nil {
  3471  		return nil, err
  3472  	}
  3473  	defer googleapi.CloseBody(res)
  3474  	if err := googleapi.CheckResponse(res); err != nil {
  3475  		return nil, gensupport.WrapError(err)
  3476  	}
  3477  	ret := &Policy{
  3478  		ServerResponse: googleapi.ServerResponse{
  3479  			Header:         res.Header,
  3480  			HTTPStatusCode: res.StatusCode,
  3481  		},
  3482  	}
  3483  	target := &ret
  3484  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3485  		return nil, err
  3486  	}
  3487  	return ret, nil
  3488  }
  3489  
  3490  type ProjectsLocationsInstancesStartCall struct {
  3491  	s                    *Service
  3492  	name                 string
  3493  	startinstancerequest *StartInstanceRequest
  3494  	urlParams_           gensupport.URLParams
  3495  	ctx_                 context.Context
  3496  	header_              http.Header
  3497  }
  3498  
  3499  // Start: Starts a notebook instance.
  3500  //
  3501  //   - name: Format:
  3502  //     `projects/{project_id}/locations/{location}/instances/{instance_id}`.
  3503  func (r *ProjectsLocationsInstancesService) Start(name string, startinstancerequest *StartInstanceRequest) *ProjectsLocationsInstancesStartCall {
  3504  	c := &ProjectsLocationsInstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3505  	c.name = name
  3506  	c.startinstancerequest = startinstancerequest
  3507  	return c
  3508  }
  3509  
  3510  // Fields allows partial responses to be retrieved. See
  3511  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3512  // details.
  3513  func (c *ProjectsLocationsInstancesStartCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesStartCall {
  3514  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3515  	return c
  3516  }
  3517  
  3518  // Context sets the context to be used in this call's Do method.
  3519  func (c *ProjectsLocationsInstancesStartCall) Context(ctx context.Context) *ProjectsLocationsInstancesStartCall {
  3520  	c.ctx_ = ctx
  3521  	return c
  3522  }
  3523  
  3524  // Header returns a http.Header that can be modified by the caller to add
  3525  // headers to the request.
  3526  func (c *ProjectsLocationsInstancesStartCall) Header() http.Header {
  3527  	if c.header_ == nil {
  3528  		c.header_ = make(http.Header)
  3529  	}
  3530  	return c.header_
  3531  }
  3532  
  3533  func (c *ProjectsLocationsInstancesStartCall) doRequest(alt string) (*http.Response, error) {
  3534  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3535  	var body io.Reader = nil
  3536  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.startinstancerequest)
  3537  	if err != nil {
  3538  		return nil, err
  3539  	}
  3540  	c.urlParams_.Set("alt", alt)
  3541  	c.urlParams_.Set("prettyPrint", "false")
  3542  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:start")
  3543  	urls += "?" + c.urlParams_.Encode()
  3544  	req, err := http.NewRequest("POST", urls, body)
  3545  	if err != nil {
  3546  		return nil, err
  3547  	}
  3548  	req.Header = reqHeaders
  3549  	googleapi.Expand(req.URL, map[string]string{
  3550  		"name": c.name,
  3551  	})
  3552  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3553  }
  3554  
  3555  // Do executes the "notebooks.projects.locations.instances.start" call.
  3556  // Any non-2xx status code is an error. Response headers are in either
  3557  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3558  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3559  // whether the returned error was because http.StatusNotModified was returned.
  3560  func (c *ProjectsLocationsInstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3561  	gensupport.SetOptions(c.urlParams_, opts...)
  3562  	res, err := c.doRequest("json")
  3563  	if res != nil && res.StatusCode == http.StatusNotModified {
  3564  		if res.Body != nil {
  3565  			res.Body.Close()
  3566  		}
  3567  		return nil, gensupport.WrapError(&googleapi.Error{
  3568  			Code:   res.StatusCode,
  3569  			Header: res.Header,
  3570  		})
  3571  	}
  3572  	if err != nil {
  3573  		return nil, err
  3574  	}
  3575  	defer googleapi.CloseBody(res)
  3576  	if err := googleapi.CheckResponse(res); err != nil {
  3577  		return nil, gensupport.WrapError(err)
  3578  	}
  3579  	ret := &Operation{
  3580  		ServerResponse: googleapi.ServerResponse{
  3581  			Header:         res.Header,
  3582  			HTTPStatusCode: res.StatusCode,
  3583  		},
  3584  	}
  3585  	target := &ret
  3586  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3587  		return nil, err
  3588  	}
  3589  	return ret, nil
  3590  }
  3591  
  3592  type ProjectsLocationsInstancesStopCall struct {
  3593  	s                   *Service
  3594  	name                string
  3595  	stopinstancerequest *StopInstanceRequest
  3596  	urlParams_          gensupport.URLParams
  3597  	ctx_                context.Context
  3598  	header_             http.Header
  3599  }
  3600  
  3601  // Stop: Stops a notebook instance.
  3602  //
  3603  //   - name: Format:
  3604  //     `projects/{project_id}/locations/{location}/instances/{instance_id}`.
  3605  func (r *ProjectsLocationsInstancesService) Stop(name string, stopinstancerequest *StopInstanceRequest) *ProjectsLocationsInstancesStopCall {
  3606  	c := &ProjectsLocationsInstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3607  	c.name = name
  3608  	c.stopinstancerequest = stopinstancerequest
  3609  	return c
  3610  }
  3611  
  3612  // Fields allows partial responses to be retrieved. See
  3613  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3614  // details.
  3615  func (c *ProjectsLocationsInstancesStopCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesStopCall {
  3616  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3617  	return c
  3618  }
  3619  
  3620  // Context sets the context to be used in this call's Do method.
  3621  func (c *ProjectsLocationsInstancesStopCall) Context(ctx context.Context) *ProjectsLocationsInstancesStopCall {
  3622  	c.ctx_ = ctx
  3623  	return c
  3624  }
  3625  
  3626  // Header returns a http.Header that can be modified by the caller to add
  3627  // headers to the request.
  3628  func (c *ProjectsLocationsInstancesStopCall) Header() http.Header {
  3629  	if c.header_ == nil {
  3630  		c.header_ = make(http.Header)
  3631  	}
  3632  	return c.header_
  3633  }
  3634  
  3635  func (c *ProjectsLocationsInstancesStopCall) doRequest(alt string) (*http.Response, error) {
  3636  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3637  	var body io.Reader = nil
  3638  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopinstancerequest)
  3639  	if err != nil {
  3640  		return nil, err
  3641  	}
  3642  	c.urlParams_.Set("alt", alt)
  3643  	c.urlParams_.Set("prettyPrint", "false")
  3644  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:stop")
  3645  	urls += "?" + c.urlParams_.Encode()
  3646  	req, err := http.NewRequest("POST", urls, body)
  3647  	if err != nil {
  3648  		return nil, err
  3649  	}
  3650  	req.Header = reqHeaders
  3651  	googleapi.Expand(req.URL, map[string]string{
  3652  		"name": c.name,
  3653  	})
  3654  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3655  }
  3656  
  3657  // Do executes the "notebooks.projects.locations.instances.stop" call.
  3658  // Any non-2xx status code is an error. Response headers are in either
  3659  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3660  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3661  // whether the returned error was because http.StatusNotModified was returned.
  3662  func (c *ProjectsLocationsInstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3663  	gensupport.SetOptions(c.urlParams_, opts...)
  3664  	res, err := c.doRequest("json")
  3665  	if res != nil && res.StatusCode == http.StatusNotModified {
  3666  		if res.Body != nil {
  3667  			res.Body.Close()
  3668  		}
  3669  		return nil, gensupport.WrapError(&googleapi.Error{
  3670  			Code:   res.StatusCode,
  3671  			Header: res.Header,
  3672  		})
  3673  	}
  3674  	if err != nil {
  3675  		return nil, err
  3676  	}
  3677  	defer googleapi.CloseBody(res)
  3678  	if err := googleapi.CheckResponse(res); err != nil {
  3679  		return nil, gensupport.WrapError(err)
  3680  	}
  3681  	ret := &Operation{
  3682  		ServerResponse: googleapi.ServerResponse{
  3683  			Header:         res.Header,
  3684  			HTTPStatusCode: res.StatusCode,
  3685  		},
  3686  	}
  3687  	target := &ret
  3688  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3689  		return nil, err
  3690  	}
  3691  	return ret, nil
  3692  }
  3693  
  3694  type ProjectsLocationsInstancesTestIamPermissionsCall struct {
  3695  	s                         *Service
  3696  	resource                  string
  3697  	testiampermissionsrequest *TestIamPermissionsRequest
  3698  	urlParams_                gensupport.URLParams
  3699  	ctx_                      context.Context
  3700  	header_                   http.Header
  3701  }
  3702  
  3703  // TestIamPermissions: Returns permissions that a caller has on the specified
  3704  // resource. If the resource does not exist, this will return an empty set of
  3705  // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
  3706  // used for building permission-aware UIs and command-line tools, not for
  3707  // authorization checking. This operation may "fail open" without warning.
  3708  //
  3709  //   - resource: REQUIRED: The resource for which the policy detail is being
  3710  //     requested. See Resource names
  3711  //     (https://cloud.google.com/apis/design/resource_names) for the appropriate
  3712  //     value for this field.
  3713  func (r *ProjectsLocationsInstancesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsInstancesTestIamPermissionsCall {
  3714  	c := &ProjectsLocationsInstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3715  	c.resource = resource
  3716  	c.testiampermissionsrequest = testiampermissionsrequest
  3717  	return c
  3718  }
  3719  
  3720  // Fields allows partial responses to be retrieved. See
  3721  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3722  // details.
  3723  func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesTestIamPermissionsCall {
  3724  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3725  	return c
  3726  }
  3727  
  3728  // Context sets the context to be used in this call's Do method.
  3729  func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsInstancesTestIamPermissionsCall {
  3730  	c.ctx_ = ctx
  3731  	return c
  3732  }
  3733  
  3734  // Header returns a http.Header that can be modified by the caller to add
  3735  // headers to the request.
  3736  func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Header() http.Header {
  3737  	if c.header_ == nil {
  3738  		c.header_ = make(http.Header)
  3739  	}
  3740  	return c.header_
  3741  }
  3742  
  3743  func (c *ProjectsLocationsInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  3744  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3745  	var body io.Reader = nil
  3746  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  3747  	if err != nil {
  3748  		return nil, err
  3749  	}
  3750  	c.urlParams_.Set("alt", alt)
  3751  	c.urlParams_.Set("prettyPrint", "false")
  3752  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+resource}:testIamPermissions")
  3753  	urls += "?" + c.urlParams_.Encode()
  3754  	req, err := http.NewRequest("POST", urls, body)
  3755  	if err != nil {
  3756  		return nil, err
  3757  	}
  3758  	req.Header = reqHeaders
  3759  	googleapi.Expand(req.URL, map[string]string{
  3760  		"resource": c.resource,
  3761  	})
  3762  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3763  }
  3764  
  3765  // Do executes the "notebooks.projects.locations.instances.testIamPermissions" call.
  3766  // Any non-2xx status code is an error. Response headers are in either
  3767  // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
  3768  // returned at all) in error.(*googleapi.Error).Header. Use
  3769  // googleapi.IsNotModified to check whether the returned error was because
  3770  // http.StatusNotModified was returned.
  3771  func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  3772  	gensupport.SetOptions(c.urlParams_, opts...)
  3773  	res, err := c.doRequest("json")
  3774  	if res != nil && res.StatusCode == http.StatusNotModified {
  3775  		if res.Body != nil {
  3776  			res.Body.Close()
  3777  		}
  3778  		return nil, gensupport.WrapError(&googleapi.Error{
  3779  			Code:   res.StatusCode,
  3780  			Header: res.Header,
  3781  		})
  3782  	}
  3783  	if err != nil {
  3784  		return nil, err
  3785  	}
  3786  	defer googleapi.CloseBody(res)
  3787  	if err := googleapi.CheckResponse(res); err != nil {
  3788  		return nil, gensupport.WrapError(err)
  3789  	}
  3790  	ret := &TestIamPermissionsResponse{
  3791  		ServerResponse: googleapi.ServerResponse{
  3792  			Header:         res.Header,
  3793  			HTTPStatusCode: res.StatusCode,
  3794  		},
  3795  	}
  3796  	target := &ret
  3797  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3798  		return nil, err
  3799  	}
  3800  	return ret, nil
  3801  }
  3802  
  3803  type ProjectsLocationsInstancesUpgradeCall struct {
  3804  	s                      *Service
  3805  	name                   string
  3806  	upgradeinstancerequest *UpgradeInstanceRequest
  3807  	urlParams_             gensupport.URLParams
  3808  	ctx_                   context.Context
  3809  	header_                http.Header
  3810  }
  3811  
  3812  // Upgrade: Upgrades a notebook instance to the latest version.
  3813  //
  3814  //   - name: Format:
  3815  //     `projects/{project_id}/locations/{location}/instances/{instance_id}`.
  3816  func (r *ProjectsLocationsInstancesService) Upgrade(name string, upgradeinstancerequest *UpgradeInstanceRequest) *ProjectsLocationsInstancesUpgradeCall {
  3817  	c := &ProjectsLocationsInstancesUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3818  	c.name = name
  3819  	c.upgradeinstancerequest = upgradeinstancerequest
  3820  	return c
  3821  }
  3822  
  3823  // Fields allows partial responses to be retrieved. See
  3824  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3825  // details.
  3826  func (c *ProjectsLocationsInstancesUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesUpgradeCall {
  3827  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3828  	return c
  3829  }
  3830  
  3831  // Context sets the context to be used in this call's Do method.
  3832  func (c *ProjectsLocationsInstancesUpgradeCall) Context(ctx context.Context) *ProjectsLocationsInstancesUpgradeCall {
  3833  	c.ctx_ = ctx
  3834  	return c
  3835  }
  3836  
  3837  // Header returns a http.Header that can be modified by the caller to add
  3838  // headers to the request.
  3839  func (c *ProjectsLocationsInstancesUpgradeCall) Header() http.Header {
  3840  	if c.header_ == nil {
  3841  		c.header_ = make(http.Header)
  3842  	}
  3843  	return c.header_
  3844  }
  3845  
  3846  func (c *ProjectsLocationsInstancesUpgradeCall) doRequest(alt string) (*http.Response, error) {
  3847  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3848  	var body io.Reader = nil
  3849  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeinstancerequest)
  3850  	if err != nil {
  3851  		return nil, err
  3852  	}
  3853  	c.urlParams_.Set("alt", alt)
  3854  	c.urlParams_.Set("prettyPrint", "false")
  3855  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:upgrade")
  3856  	urls += "?" + c.urlParams_.Encode()
  3857  	req, err := http.NewRequest("POST", urls, body)
  3858  	if err != nil {
  3859  		return nil, err
  3860  	}
  3861  	req.Header = reqHeaders
  3862  	googleapi.Expand(req.URL, map[string]string{
  3863  		"name": c.name,
  3864  	})
  3865  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3866  }
  3867  
  3868  // Do executes the "notebooks.projects.locations.instances.upgrade" call.
  3869  // Any non-2xx status code is an error. Response headers are in either
  3870  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3871  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3872  // whether the returned error was because http.StatusNotModified was returned.
  3873  func (c *ProjectsLocationsInstancesUpgradeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3874  	gensupport.SetOptions(c.urlParams_, opts...)
  3875  	res, err := c.doRequest("json")
  3876  	if res != nil && res.StatusCode == http.StatusNotModified {
  3877  		if res.Body != nil {
  3878  			res.Body.Close()
  3879  		}
  3880  		return nil, gensupport.WrapError(&googleapi.Error{
  3881  			Code:   res.StatusCode,
  3882  			Header: res.Header,
  3883  		})
  3884  	}
  3885  	if err != nil {
  3886  		return nil, err
  3887  	}
  3888  	defer googleapi.CloseBody(res)
  3889  	if err := googleapi.CheckResponse(res); err != nil {
  3890  		return nil, gensupport.WrapError(err)
  3891  	}
  3892  	ret := &Operation{
  3893  		ServerResponse: googleapi.ServerResponse{
  3894  			Header:         res.Header,
  3895  			HTTPStatusCode: res.StatusCode,
  3896  		},
  3897  	}
  3898  	target := &ret
  3899  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3900  		return nil, err
  3901  	}
  3902  	return ret, nil
  3903  }
  3904  
  3905  type ProjectsLocationsInstancesUpgradeSystemCall struct {
  3906  	s                            *Service
  3907  	name                         string
  3908  	upgradeinstancesystemrequest *UpgradeInstanceSystemRequest
  3909  	urlParams_                   gensupport.URLParams
  3910  	ctx_                         context.Context
  3911  	header_                      http.Header
  3912  }
  3913  
  3914  // UpgradeSystem: Allows notebook instances to upgrade themselves. Do not use
  3915  // this method directly.
  3916  //
  3917  //   - name: Format:
  3918  //     `projects/{project_id}/locations/{location}/instances/{instance_id}`.
  3919  func (r *ProjectsLocationsInstancesService) UpgradeSystem(name string, upgradeinstancesystemrequest *UpgradeInstanceSystemRequest) *ProjectsLocationsInstancesUpgradeSystemCall {
  3920  	c := &ProjectsLocationsInstancesUpgradeSystemCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3921  	c.name = name
  3922  	c.upgradeinstancesystemrequest = upgradeinstancesystemrequest
  3923  	return c
  3924  }
  3925  
  3926  // Fields allows partial responses to be retrieved. See
  3927  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3928  // details.
  3929  func (c *ProjectsLocationsInstancesUpgradeSystemCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesUpgradeSystemCall {
  3930  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3931  	return c
  3932  }
  3933  
  3934  // Context sets the context to be used in this call's Do method.
  3935  func (c *ProjectsLocationsInstancesUpgradeSystemCall) Context(ctx context.Context) *ProjectsLocationsInstancesUpgradeSystemCall {
  3936  	c.ctx_ = ctx
  3937  	return c
  3938  }
  3939  
  3940  // Header returns a http.Header that can be modified by the caller to add
  3941  // headers to the request.
  3942  func (c *ProjectsLocationsInstancesUpgradeSystemCall) Header() http.Header {
  3943  	if c.header_ == nil {
  3944  		c.header_ = make(http.Header)
  3945  	}
  3946  	return c.header_
  3947  }
  3948  
  3949  func (c *ProjectsLocationsInstancesUpgradeSystemCall) doRequest(alt string) (*http.Response, error) {
  3950  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3951  	var body io.Reader = nil
  3952  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeinstancesystemrequest)
  3953  	if err != nil {
  3954  		return nil, err
  3955  	}
  3956  	c.urlParams_.Set("alt", alt)
  3957  	c.urlParams_.Set("prettyPrint", "false")
  3958  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:upgradeSystem")
  3959  	urls += "?" + c.urlParams_.Encode()
  3960  	req, err := http.NewRequest("POST", urls, body)
  3961  	if err != nil {
  3962  		return nil, err
  3963  	}
  3964  	req.Header = reqHeaders
  3965  	googleapi.Expand(req.URL, map[string]string{
  3966  		"name": c.name,
  3967  	})
  3968  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3969  }
  3970  
  3971  // Do executes the "notebooks.projects.locations.instances.upgradeSystem" call.
  3972  // Any non-2xx status code is an error. Response headers are in either
  3973  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3974  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3975  // whether the returned error was because http.StatusNotModified was returned.
  3976  func (c *ProjectsLocationsInstancesUpgradeSystemCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3977  	gensupport.SetOptions(c.urlParams_, opts...)
  3978  	res, err := c.doRequest("json")
  3979  	if res != nil && res.StatusCode == http.StatusNotModified {
  3980  		if res.Body != nil {
  3981  			res.Body.Close()
  3982  		}
  3983  		return nil, gensupport.WrapError(&googleapi.Error{
  3984  			Code:   res.StatusCode,
  3985  			Header: res.Header,
  3986  		})
  3987  	}
  3988  	if err != nil {
  3989  		return nil, err
  3990  	}
  3991  	defer googleapi.CloseBody(res)
  3992  	if err := googleapi.CheckResponse(res); err != nil {
  3993  		return nil, gensupport.WrapError(err)
  3994  	}
  3995  	ret := &Operation{
  3996  		ServerResponse: googleapi.ServerResponse{
  3997  			Header:         res.Header,
  3998  			HTTPStatusCode: res.StatusCode,
  3999  		},
  4000  	}
  4001  	target := &ret
  4002  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4003  		return nil, err
  4004  	}
  4005  	return ret, nil
  4006  }
  4007  
  4008  type ProjectsLocationsOperationsCancelCall struct {
  4009  	s                      *Service
  4010  	name                   string
  4011  	canceloperationrequest *CancelOperationRequest
  4012  	urlParams_             gensupport.URLParams
  4013  	ctx_                   context.Context
  4014  	header_                http.Header
  4015  }
  4016  
  4017  // Cancel: Starts asynchronous cancellation on a long-running operation. The
  4018  // server makes a best effort to cancel the operation, but success is not
  4019  // guaranteed. If the server doesn't support this method, it returns
  4020  // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
  4021  // other methods to check whether the cancellation succeeded or whether the
  4022  // operation completed despite cancellation. On successful cancellation, the
  4023  // operation is not deleted; instead, it becomes an operation with an
  4024  // Operation.error value with a google.rpc.Status.code of 1, corresponding to
  4025  // `Code.CANCELLED`.
  4026  //
  4027  // - name: The name of the operation resource to be cancelled.
  4028  func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
  4029  	c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4030  	c.name = name
  4031  	c.canceloperationrequest = canceloperationrequest
  4032  	return c
  4033  }
  4034  
  4035  // Fields allows partial responses to be retrieved. See
  4036  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4037  // details.
  4038  func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
  4039  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4040  	return c
  4041  }
  4042  
  4043  // Context sets the context to be used in this call's Do method.
  4044  func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
  4045  	c.ctx_ = ctx
  4046  	return c
  4047  }
  4048  
  4049  // Header returns a http.Header that can be modified by the caller to add
  4050  // headers to the request.
  4051  func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
  4052  	if c.header_ == nil {
  4053  		c.header_ = make(http.Header)
  4054  	}
  4055  	return c.header_
  4056  }
  4057  
  4058  func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  4059  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4060  	var body io.Reader = nil
  4061  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
  4062  	if err != nil {
  4063  		return nil, err
  4064  	}
  4065  	c.urlParams_.Set("alt", alt)
  4066  	c.urlParams_.Set("prettyPrint", "false")
  4067  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel")
  4068  	urls += "?" + c.urlParams_.Encode()
  4069  	req, err := http.NewRequest("POST", urls, body)
  4070  	if err != nil {
  4071  		return nil, err
  4072  	}
  4073  	req.Header = reqHeaders
  4074  	googleapi.Expand(req.URL, map[string]string{
  4075  		"name": c.name,
  4076  	})
  4077  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4078  }
  4079  
  4080  // Do executes the "notebooks.projects.locations.operations.cancel" call.
  4081  // Any non-2xx status code is an error. Response headers are in either
  4082  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  4083  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4084  // whether the returned error was because http.StatusNotModified was returned.
  4085  func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4086  	gensupport.SetOptions(c.urlParams_, opts...)
  4087  	res, err := c.doRequest("json")
  4088  	if res != nil && res.StatusCode == http.StatusNotModified {
  4089  		if res.Body != nil {
  4090  			res.Body.Close()
  4091  		}
  4092  		return nil, gensupport.WrapError(&googleapi.Error{
  4093  			Code:   res.StatusCode,
  4094  			Header: res.Header,
  4095  		})
  4096  	}
  4097  	if err != nil {
  4098  		return nil, err
  4099  	}
  4100  	defer googleapi.CloseBody(res)
  4101  	if err := googleapi.CheckResponse(res); err != nil {
  4102  		return nil, gensupport.WrapError(err)
  4103  	}
  4104  	ret := &Empty{
  4105  		ServerResponse: googleapi.ServerResponse{
  4106  			Header:         res.Header,
  4107  			HTTPStatusCode: res.StatusCode,
  4108  		},
  4109  	}
  4110  	target := &ret
  4111  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4112  		return nil, err
  4113  	}
  4114  	return ret, nil
  4115  }
  4116  
  4117  type ProjectsLocationsOperationsDeleteCall struct {
  4118  	s          *Service
  4119  	name       string
  4120  	urlParams_ gensupport.URLParams
  4121  	ctx_       context.Context
  4122  	header_    http.Header
  4123  }
  4124  
  4125  // Delete: Deletes a long-running operation. This method indicates that the
  4126  // client is no longer interested in the operation result. It does not cancel
  4127  // the operation. If the server doesn't support this method, it returns
  4128  // `google.rpc.Code.UNIMPLEMENTED`.
  4129  //
  4130  // - name: The name of the operation resource to be deleted.
  4131  func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
  4132  	c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4133  	c.name = name
  4134  	return c
  4135  }
  4136  
  4137  // Fields allows partial responses to be retrieved. See
  4138  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4139  // details.
  4140  func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
  4141  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4142  	return c
  4143  }
  4144  
  4145  // Context sets the context to be used in this call's Do method.
  4146  func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
  4147  	c.ctx_ = ctx
  4148  	return c
  4149  }
  4150  
  4151  // Header returns a http.Header that can be modified by the caller to add
  4152  // headers to the request.
  4153  func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
  4154  	if c.header_ == nil {
  4155  		c.header_ = make(http.Header)
  4156  	}
  4157  	return c.header_
  4158  }
  4159  
  4160  func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4161  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4162  	var body io.Reader = nil
  4163  	c.urlParams_.Set("alt", alt)
  4164  	c.urlParams_.Set("prettyPrint", "false")
  4165  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  4166  	urls += "?" + c.urlParams_.Encode()
  4167  	req, err := http.NewRequest("DELETE", urls, body)
  4168  	if err != nil {
  4169  		return nil, err
  4170  	}
  4171  	req.Header = reqHeaders
  4172  	googleapi.Expand(req.URL, map[string]string{
  4173  		"name": c.name,
  4174  	})
  4175  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4176  }
  4177  
  4178  // Do executes the "notebooks.projects.locations.operations.delete" call.
  4179  // Any non-2xx status code is an error. Response headers are in either
  4180  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  4181  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4182  // whether the returned error was because http.StatusNotModified was returned.
  4183  func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4184  	gensupport.SetOptions(c.urlParams_, opts...)
  4185  	res, err := c.doRequest("json")
  4186  	if res != nil && res.StatusCode == http.StatusNotModified {
  4187  		if res.Body != nil {
  4188  			res.Body.Close()
  4189  		}
  4190  		return nil, gensupport.WrapError(&googleapi.Error{
  4191  			Code:   res.StatusCode,
  4192  			Header: res.Header,
  4193  		})
  4194  	}
  4195  	if err != nil {
  4196  		return nil, err
  4197  	}
  4198  	defer googleapi.CloseBody(res)
  4199  	if err := googleapi.CheckResponse(res); err != nil {
  4200  		return nil, gensupport.WrapError(err)
  4201  	}
  4202  	ret := &Empty{
  4203  		ServerResponse: googleapi.ServerResponse{
  4204  			Header:         res.Header,
  4205  			HTTPStatusCode: res.StatusCode,
  4206  		},
  4207  	}
  4208  	target := &ret
  4209  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4210  		return nil, err
  4211  	}
  4212  	return ret, nil
  4213  }
  4214  
  4215  type ProjectsLocationsOperationsGetCall struct {
  4216  	s            *Service
  4217  	name         string
  4218  	urlParams_   gensupport.URLParams
  4219  	ifNoneMatch_ string
  4220  	ctx_         context.Context
  4221  	header_      http.Header
  4222  }
  4223  
  4224  // Get: Gets the latest state of a long-running operation. Clients can use this
  4225  // method to poll the operation result at intervals as recommended by the API
  4226  // service.
  4227  //
  4228  // - name: The name of the operation resource.
  4229  func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
  4230  	c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4231  	c.name = name
  4232  	return c
  4233  }
  4234  
  4235  // Fields allows partial responses to be retrieved. See
  4236  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4237  // details.
  4238  func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
  4239  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4240  	return c
  4241  }
  4242  
  4243  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4244  // object's ETag matches the given value. This is useful for getting updates
  4245  // only after the object has changed since the last request.
  4246  func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
  4247  	c.ifNoneMatch_ = entityTag
  4248  	return c
  4249  }
  4250  
  4251  // Context sets the context to be used in this call's Do method.
  4252  func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
  4253  	c.ctx_ = ctx
  4254  	return c
  4255  }
  4256  
  4257  // Header returns a http.Header that can be modified by the caller to add
  4258  // headers to the request.
  4259  func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
  4260  	if c.header_ == nil {
  4261  		c.header_ = make(http.Header)
  4262  	}
  4263  	return c.header_
  4264  }
  4265  
  4266  func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  4267  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4268  	if c.ifNoneMatch_ != "" {
  4269  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4270  	}
  4271  	var body io.Reader = nil
  4272  	c.urlParams_.Set("alt", alt)
  4273  	c.urlParams_.Set("prettyPrint", "false")
  4274  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
  4275  	urls += "?" + c.urlParams_.Encode()
  4276  	req, err := http.NewRequest("GET", urls, body)
  4277  	if err != nil {
  4278  		return nil, err
  4279  	}
  4280  	req.Header = reqHeaders
  4281  	googleapi.Expand(req.URL, map[string]string{
  4282  		"name": c.name,
  4283  	})
  4284  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4285  }
  4286  
  4287  // Do executes the "notebooks.projects.locations.operations.get" call.
  4288  // Any non-2xx status code is an error. Response headers are in either
  4289  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  4290  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4291  // whether the returned error was because http.StatusNotModified was returned.
  4292  func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4293  	gensupport.SetOptions(c.urlParams_, opts...)
  4294  	res, err := c.doRequest("json")
  4295  	if res != nil && res.StatusCode == http.StatusNotModified {
  4296  		if res.Body != nil {
  4297  			res.Body.Close()
  4298  		}
  4299  		return nil, gensupport.WrapError(&googleapi.Error{
  4300  			Code:   res.StatusCode,
  4301  			Header: res.Header,
  4302  		})
  4303  	}
  4304  	if err != nil {
  4305  		return nil, err
  4306  	}
  4307  	defer googleapi.CloseBody(res)
  4308  	if err := googleapi.CheckResponse(res); err != nil {
  4309  		return nil, gensupport.WrapError(err)
  4310  	}
  4311  	ret := &Operation{
  4312  		ServerResponse: googleapi.ServerResponse{
  4313  			Header:         res.Header,
  4314  			HTTPStatusCode: res.StatusCode,
  4315  		},
  4316  	}
  4317  	target := &ret
  4318  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4319  		return nil, err
  4320  	}
  4321  	return ret, nil
  4322  }
  4323  
  4324  type ProjectsLocationsOperationsListCall struct {
  4325  	s            *Service
  4326  	name         string
  4327  	urlParams_   gensupport.URLParams
  4328  	ifNoneMatch_ string
  4329  	ctx_         context.Context
  4330  	header_      http.Header
  4331  }
  4332  
  4333  // List: Lists operations that match the specified filter in the request. If
  4334  // the server doesn't support this method, it returns `UNIMPLEMENTED`.
  4335  //
  4336  // - name: The name of the operation's parent resource.
  4337  func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
  4338  	c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4339  	c.name = name
  4340  	return c
  4341  }
  4342  
  4343  // Filter sets the optional parameter "filter": The standard list filter.
  4344  func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
  4345  	c.urlParams_.Set("filter", filter)
  4346  	return c
  4347  }
  4348  
  4349  // PageSize sets the optional parameter "pageSize": The standard list page
  4350  // size.
  4351  func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
  4352  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4353  	return c
  4354  }
  4355  
  4356  // PageToken sets the optional parameter "pageToken": The standard list page
  4357  // token.
  4358  func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
  4359  	c.urlParams_.Set("pageToken", pageToken)
  4360  	return c
  4361  }
  4362  
  4363  // Fields allows partial responses to be retrieved. See
  4364  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4365  // details.
  4366  func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
  4367  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4368  	return c
  4369  }
  4370  
  4371  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4372  // object's ETag matches the given value. This is useful for getting updates
  4373  // only after the object has changed since the last request.
  4374  func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
  4375  	c.ifNoneMatch_ = entityTag
  4376  	return c
  4377  }
  4378  
  4379  // Context sets the context to be used in this call's Do method.
  4380  func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
  4381  	c.ctx_ = ctx
  4382  	return c
  4383  }
  4384  
  4385  // Header returns a http.Header that can be modified by the caller to add
  4386  // headers to the request.
  4387  func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
  4388  	if c.header_ == nil {
  4389  		c.header_ = make(http.Header)
  4390  	}
  4391  	return c.header_
  4392  }
  4393  
  4394  func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  4395  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4396  	if c.ifNoneMatch_ != "" {
  4397  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4398  	}
  4399  	var body io.Reader = nil
  4400  	c.urlParams_.Set("alt", alt)
  4401  	c.urlParams_.Set("prettyPrint", "false")
  4402  	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations")
  4403  	urls += "?" + c.urlParams_.Encode()
  4404  	req, err := http.NewRequest("GET", urls, body)
  4405  	if err != nil {
  4406  		return nil, err
  4407  	}
  4408  	req.Header = reqHeaders
  4409  	googleapi.Expand(req.URL, map[string]string{
  4410  		"name": c.name,
  4411  	})
  4412  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4413  }
  4414  
  4415  // Do executes the "notebooks.projects.locations.operations.list" call.
  4416  // Any non-2xx status code is an error. Response headers are in either
  4417  // *ListOperationsResponse.ServerResponse.Header or (if a response was returned
  4418  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4419  // check whether the returned error was because http.StatusNotModified was
  4420  // returned.
  4421  func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  4422  	gensupport.SetOptions(c.urlParams_, opts...)
  4423  	res, err := c.doRequest("json")
  4424  	if res != nil && res.StatusCode == http.StatusNotModified {
  4425  		if res.Body != nil {
  4426  			res.Body.Close()
  4427  		}
  4428  		return nil, gensupport.WrapError(&googleapi.Error{
  4429  			Code:   res.StatusCode,
  4430  			Header: res.Header,
  4431  		})
  4432  	}
  4433  	if err != nil {
  4434  		return nil, err
  4435  	}
  4436  	defer googleapi.CloseBody(res)
  4437  	if err := googleapi.CheckResponse(res); err != nil {
  4438  		return nil, gensupport.WrapError(err)
  4439  	}
  4440  	ret := &ListOperationsResponse{
  4441  		ServerResponse: googleapi.ServerResponse{
  4442  			Header:         res.Header,
  4443  			HTTPStatusCode: res.StatusCode,
  4444  		},
  4445  	}
  4446  	target := &ret
  4447  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4448  		return nil, err
  4449  	}
  4450  	return ret, nil
  4451  }
  4452  
  4453  // Pages invokes f for each page of results.
  4454  // A non-nil error returned from f will halt the iteration.
  4455  // The provided context supersedes any context provided to the Context method.
  4456  func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  4457  	c.ctx_ = ctx
  4458  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4459  	for {
  4460  		x, err := c.Do()
  4461  		if err != nil {
  4462  			return err
  4463  		}
  4464  		if err := f(x); err != nil {
  4465  			return err
  4466  		}
  4467  		if x.NextPageToken == "" {
  4468  			return nil
  4469  		}
  4470  		c.PageToken(x.NextPageToken)
  4471  	}
  4472  }
  4473  

View as plain text