1// Copyright 2020 Google LLC.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Code generated file. DO NOT EDIT.
6
7// Package notebooks provides access to the Notebooks API.
8//
9// For product documentation, see: https://cloud.google.com/ai-platform/notebooks/docs/
10//
11// Creating a client
12//
13// Usage example:
14//
15//   import "google.golang.org/api/notebooks/v1"
16//   ...
17//   ctx := context.Background()
18//   notebooksService, err := notebooks.NewService(ctx)
19//
20// In this example, Google Application Default Credentials are used for authentication.
21//
22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
23//
24// Other authentication options
25//
26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
27//
28//   notebooksService, err := notebooks.NewService(ctx, option.WithAPIKey("AIza..."))
29//
30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
31//
32//   config := &oauth2.Config{...}
33//   // ...
34//   token, err := config.Exchange(ctx, ...)
35//   notebooksService, err := notebooks.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
36//
37// See https://godoc.org/google.golang.org/api/option/ for details on options.
38package notebooks // import "google.golang.org/api/notebooks/v1"
39
40import (
41	"bytes"
42	"context"
43	"encoding/json"
44	"errors"
45	"fmt"
46	"io"
47	"net/http"
48	"net/url"
49	"strconv"
50	"strings"
51
52	googleapi "google.golang.org/api/googleapi"
53	gensupport "google.golang.org/api/internal/gensupport"
54	option "google.golang.org/api/option"
55	internaloption "google.golang.org/api/option/internaloption"
56	htransport "google.golang.org/api/transport/http"
57)
58
59// Always reference these packages, just in case the auto-generated code
60// below doesn't.
61var _ = bytes.NewBuffer
62var _ = strconv.Itoa
63var _ = fmt.Sprintf
64var _ = json.NewDecoder
65var _ = io.Copy
66var _ = url.Parse
67var _ = gensupport.MarshalJSON
68var _ = googleapi.Version
69var _ = errors.New
70var _ = strings.Replace
71var _ = context.Canceled
72var _ = internaloption.WithDefaultEndpoint
73
74const apiId = "notebooks:v1"
75const apiName = "notebooks"
76const apiVersion = "v1"
77const basePath = "https://notebooks.googleapis.com/"
78const mtlsBasePath = "https://notebooks.mtls.googleapis.com/"
79
80// OAuth2 scopes used by this API.
81const (
82	// View and manage your data across Google Cloud Platform services
83	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
84)
85
86// NewService creates a new Service.
87func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
88	scopesOption := option.WithScopes(
89		"https://www.googleapis.com/auth/cloud-platform",
90	)
91	// NOTE: prepend, so we don't override user-specified scopes.
92	opts = append([]option.ClientOption{scopesOption}, opts...)
93	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
94	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
95	client, endpoint, err := htransport.NewClient(ctx, opts...)
96	if err != nil {
97		return nil, err
98	}
99	s, err := New(client)
100	if err != nil {
101		return nil, err
102	}
103	if endpoint != "" {
104		s.BasePath = endpoint
105	}
106	return s, nil
107}
108
109// New creates a new Service. It uses the provided http.Client for requests.
110//
111// Deprecated: please use NewService instead.
112// To provide a custom HTTP client, use option.WithHTTPClient.
113// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
114func New(client *http.Client) (*Service, error) {
115	if client == nil {
116		return nil, errors.New("client is nil")
117	}
118	s := &Service{client: client, BasePath: basePath}
119	s.Projects = NewProjectsService(s)
120	return s, nil
121}
122
123type Service struct {
124	client    *http.Client
125	BasePath  string // API endpoint base URL
126	UserAgent string // optional additional User-Agent fragment
127
128	Projects *ProjectsService
129}
130
131func (s *Service) userAgent() string {
132	if s.UserAgent == "" {
133		return googleapi.UserAgent
134	}
135	return googleapi.UserAgent + " " + s.UserAgent
136}
137
138func NewProjectsService(s *Service) *ProjectsService {
139	rs := &ProjectsService{s: s}
140	rs.Locations = NewProjectsLocationsService(s)
141	return rs
142}
143
144type ProjectsService struct {
145	s *Service
146
147	Locations *ProjectsLocationsService
148}
149
150func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
151	rs := &ProjectsLocationsService{s: s}
152	rs.Environments = NewProjectsLocationsEnvironmentsService(s)
153	rs.Instances = NewProjectsLocationsInstancesService(s)
154	rs.Operations = NewProjectsLocationsOperationsService(s)
155	return rs
156}
157
158type ProjectsLocationsService struct {
159	s *Service
160
161	Environments *ProjectsLocationsEnvironmentsService
162
163	Instances *ProjectsLocationsInstancesService
164
165	Operations *ProjectsLocationsOperationsService
166}
167
168func NewProjectsLocationsEnvironmentsService(s *Service) *ProjectsLocationsEnvironmentsService {
169	rs := &ProjectsLocationsEnvironmentsService{s: s}
170	return rs
171}
172
173type ProjectsLocationsEnvironmentsService struct {
174	s *Service
175}
176
177func NewProjectsLocationsInstancesService(s *Service) *ProjectsLocationsInstancesService {
178	rs := &ProjectsLocationsInstancesService{s: s}
179	return rs
180}
181
182type ProjectsLocationsInstancesService struct {
183	s *Service
184}
185
186func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
187	rs := &ProjectsLocationsOperationsService{s: s}
188	return rs
189}
190
191type ProjectsLocationsOperationsService struct {
192	s *Service
193}
194
195// AcceleratorConfig: Definition of a hardware accelerator. Note that
196// not all combinations of `type` and `core_count` are valid. Check
197// [GPUs on Compute Engine](/compute/docs/gpus/#gpus-list) to find a
198// valid combination. TPUs are not supported.
199type AcceleratorConfig struct {
200	// CoreCount: Count of cores of this accelerator.
201	CoreCount int64 `json:"coreCount,omitempty,string"`
202
203	// Type: Type of this accelerator.
204	//
205	// Possible values:
206	//   "ACCELERATOR_TYPE_UNSPECIFIED" - Accelerator type is not specified.
207	//   "NVIDIA_TESLA_K80" - Accelerator type is Nvidia Tesla K80.
208	//   "NVIDIA_TESLA_P100" - Accelerator type is Nvidia Tesla P100.
209	//   "NVIDIA_TESLA_V100" - Accelerator type is Nvidia Tesla V100.
210	//   "NVIDIA_TESLA_P4" - Accelerator type is Nvidia Tesla P4.
211	//   "NVIDIA_TESLA_T4" - Accelerator type is Nvidia Tesla T4.
212	//   "NVIDIA_TESLA_A100" - Accelerator type is Nvidia Tesla A100.
213	//   "NVIDIA_TESLA_T4_VWS" - Accelerator type is NVIDIA Tesla T4 Virtual
214	// Workstations.
215	//   "NVIDIA_TESLA_P100_VWS" - Accelerator type is NVIDIA Tesla P100
216	// Virtual Workstations.
217	//   "NVIDIA_TESLA_P4_VWS" - Accelerator type is NVIDIA Tesla P4 Virtual
218	// Workstations.
219	//   "TPU_V2" - (Coming soon) Accelerator type is TPU V2.
220	//   "TPU_V3" - (Coming soon) Accelerator type is TPU V3.
221	Type string `json:"type,omitempty"`
222
223	// ForceSendFields is a list of field names (e.g. "CoreCount") to
224	// unconditionally include in API requests. By default, fields with
225	// empty values are omitted from API requests. However, any non-pointer,
226	// non-interface field appearing in ForceSendFields will be sent to the
227	// server regardless of whether the field is empty or not. This may be
228	// used to include empty fields in Patch requests.
229	ForceSendFields []string `json:"-"`
230
231	// NullFields is a list of field names (e.g. "CoreCount") to include in
232	// API requests with the JSON null value. By default, fields with empty
233	// values are omitted from API requests. However, any field with an
234	// empty value appearing in NullFields will be sent to the server as
235	// null. It is an error if a field in this list has a non-empty value.
236	// This may be used to include null fields in Patch requests.
237	NullFields []string `json:"-"`
238}
239
240func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
241	type NoMethod AcceleratorConfig
242	raw := NoMethod(*s)
243	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
244}
245
246// Binding: Associates `members` with a `role`.
247type 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
250	// current request. If the condition evaluates to `false`, then this
251	// binding does not apply to the current request. However, a different
252	// role binding might grant the same role to one or more of the members
253	// in this binding. To learn which resources support conditions in their
254	// IAM policies, see the [IAM
255	// documentation](https://cloud.google.com/iam/help/conditions/resource-p
256	// olicies).
257	Condition *Expr `json:"condition,omitempty"`
258
259	// Members: Specifies the identities requesting access for a Cloud
260	// Platform resource. `members` can have the following values: *
261	// `allUsers`: A special identifier that represents anyone who is on the
262	// internet; with or without a Google account. *
263	// `allAuthenticatedUsers`: A special identifier that represents anyone
264	// who is authenticated with a Google account or a service account. *
265	// `user:{emailid}`: An email address that represents a specific Google
266	// account. For example, `alice@example.com` . *
267	// `serviceAccount:{emailid}`: An email address that represents a
268	// service account. For example,
269	// `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An
270	// email address that represents a Google group. For example,
271	// `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An
272	// email address (plus unique identifier) representing a user that has
273	// been recently deleted. For example,
274	// `alice@example.com?uid=123456789012345678901`. If the user is
275	// recovered, this value reverts to `user:{emailid}` and the recovered
276	// user retains the role in the binding. *
277	// `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address
278	// (plus unique identifier) representing a service account that has been
279	// recently deleted. For example,
280	// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
281	// If the service account is undeleted, this value reverts to
282	// `serviceAccount:{emailid}` and the undeleted service account retains
283	// the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`:
284	// An email address (plus unique identifier) representing a Google group
285	// that has been recently deleted. For example,
286	// `admins@example.com?uid=123456789012345678901`. If the group is
287	// recovered, this value reverts to `group:{emailid}` and the recovered
288	// group retains the role in the binding. * `domain:{domain}`: The G
289	// Suite domain (primary) that represents all the users of that domain.
290	// For example, `google.com` or `example.com`.
291	Members []string `json:"members,omitempty"`
292
293	// Role: Role that is assigned to `members`. For example,
294	// `roles/viewer`, `roles/editor`, or `roles/owner`.
295	Role string `json:"role,omitempty"`
296
297	// ForceSendFields is a list of field names (e.g. "Condition") to
298	// unconditionally include in API requests. By default, fields with
299	// empty values are omitted from API requests. However, any non-pointer,
300	// non-interface field appearing in ForceSendFields will be sent to the
301	// server regardless of whether the field is empty or not. This may be
302	// used to include empty fields in Patch requests.
303	ForceSendFields []string `json:"-"`
304
305	// NullFields is a list of field names (e.g. "Condition") to include in
306	// API requests with the JSON null value. By default, fields with empty
307	// values are omitted from API requests. However, any field with an
308	// empty value appearing in NullFields will be sent to the server as
309	// null. It is an error if a field in this list has a non-empty value.
310	// This may be used to include null fields in Patch requests.
311	NullFields []string `json:"-"`
312}
313
314func (s *Binding) MarshalJSON() ([]byte, error) {
315	type NoMethod Binding
316	raw := NoMethod(*s)
317	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
318}
319
320// CancelOperationRequest: The request message for
321// Operations.CancelOperation.
322type CancelOperationRequest struct {
323}
324
325// ContainerImage: Definition of a container image for starting a
326// notebook instance with the environment installed in a container.
327type ContainerImage struct {
328	// Repository: Required. The path to the container image repository. For
329	// example: `gcr.io/{project_id}/{image_name}`
330	Repository string `json:"repository,omitempty"`
331
332	// Tag: The tag of the container image. If not specified, this defaults
333	// to the latest tag.
334	Tag string `json:"tag,omitempty"`
335
336	// ForceSendFields is a list of field names (e.g. "Repository") to
337	// unconditionally include in API requests. By default, fields with
338	// empty values are omitted from API requests. However, any non-pointer,
339	// non-interface field appearing in ForceSendFields will be sent to the
340	// server regardless of whether the field is empty or not. This may be
341	// used to include empty fields in Patch requests.
342	ForceSendFields []string `json:"-"`
343
344	// NullFields is a list of field names (e.g. "Repository") to include in
345	// API requests with the JSON null value. By default, fields with empty
346	// values are omitted from API requests. However, any field with an
347	// empty value appearing in NullFields will be sent to the server as
348	// null. It is an error if a field in this list has a non-empty value.
349	// This may be used to include null fields in Patch requests.
350	NullFields []string `json:"-"`
351}
352
353func (s *ContainerImage) MarshalJSON() ([]byte, error) {
354	type NoMethod ContainerImage
355	raw := NoMethod(*s)
356	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
357}
358
359// Disk: An instance-attached disk resource.
360type Disk struct {
361	// AutoDelete: Indicates whether the disk will be auto-deleted when the
362	// instance is deleted (but not when the disk is detached from the
363	// instance).
364	AutoDelete bool `json:"autoDelete,omitempty"`
365
366	// Boot: Indicates that this is a boot disk. The virtual machine will
367	// use the first partition of the disk for its root filesystem.
368	Boot bool `json:"boot,omitempty"`
369
370	// DeviceName: Indicates a unique device name of your choice that is
371	// reflected into the /dev/disk/by-id/google-* tree of a Linux operating
372	// system running within the instance. This name can be used to
373	// reference the device for mounting, resizing, and so on, from within
374	// the instance. If not specified, the server chooses a default device
375	// name to apply to this disk, in the form persistent-disk-x, where x is
376	// a number assigned by Google Compute Engine.This field is only
377	// applicable for persistent disks.
378	DeviceName string `json:"deviceName,omitempty"`
379
380	// DiskSizeGb: Indicates the size of the disk in base-2 GB.
381	DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
382
383	// GuestOsFeatures: Indicates a list of features to enable on the guest
384	// operating system. Applicable only for bootable images. Read Enabling
385	// guest operating system features to see a list of available options.
386	GuestOsFeatures []*GuestOsFeature `json:"guestOsFeatures,omitempty"`
387
388	// Index: A zero-based index to this disk, where 0 is reserved for the
389	// boot disk. If you have many disks attached to an instance, each disk
390	// would have a unique index number.
391	Index int64 `json:"index,omitempty,string"`
392
393	// Interface: Indicates the disk interface to use for attaching this
394	// disk, which is either SCSI or NVME. The default is SCSI. Persistent
395	// disks must always use SCSI and the request will fail if you attempt
396	// to attach a persistent disk in any other format than SCSI. Local SSDs
397	// can use either NVME or SCSI. For performance characteristics of SCSI
398	// over NVMe, see Local SSD performance. Valid values: NVME SCSI
399	Interface string `json:"interface,omitempty"`
400
401	// Kind: Type of the resource. Always compute#attachedDisk for attached
402	// disks.
403	Kind string `json:"kind,omitempty"`
404
405	// Licenses: A list of publicly visible licenses. Reserved for Google's
406	// use. A License represents billing and aggregate usage data for public
407	// and marketplace images.
408	Licenses []string `json:"licenses,omitempty"`
409
410	// Mode: The mode in which to attach this disk, either READ_WRITE or
411	// READ_ONLY. If not specified, the default is to attach the disk in
412	// READ_WRITE mode. Valid values: READ_ONLY READ_WRITE
413	Mode string `json:"mode,omitempty"`
414
415	// Source: Indicates a valid partial or full URL to an existing
416	// Persistent Disk resource.
417	Source string `json:"source,omitempty"`
418
419	// Type: Indicates the type of the disk, either SCRATCH or PERSISTENT.
420	// Valid values: PERSISTENT SCRATCH
421	Type string `json:"type,omitempty"`
422
423	// ForceSendFields is a list of field names (e.g. "AutoDelete") to
424	// unconditionally include in API requests. By default, fields with
425	// empty values are omitted from API requests. However, any non-pointer,
426	// non-interface field appearing in ForceSendFields will be sent to the
427	// server regardless of whether the field is empty or not. This may be
428	// used to include empty fields in Patch requests.
429	ForceSendFields []string `json:"-"`
430
431	// NullFields is a list of field names (e.g. "AutoDelete") to include in
432	// API requests with the JSON null value. By default, fields with empty
433	// values are omitted from API requests. However, any field with an
434	// empty value appearing in NullFields will be sent to the server as
435	// null. It is an error if a field in this list has a non-empty value.
436	// This may be used to include null fields in Patch requests.
437	NullFields []string `json:"-"`
438}
439
440func (s *Disk) MarshalJSON() ([]byte, error) {
441	type NoMethod Disk
442	raw := NoMethod(*s)
443	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
444}
445
446// Empty: A generic empty message that you can re-use to avoid defining
447// duplicated empty messages in your APIs. A typical example is to use
448// it as the request or the response type of an API method. For
449// instance: service Foo { rpc Bar(google.protobuf.Empty) returns
450// (google.protobuf.Empty); } The JSON representation for `Empty` is
451// empty JSON object `{}`.
452type Empty struct {
453	// ServerResponse contains the HTTP response code and headers from the
454	// server.
455	googleapi.ServerResponse `json:"-"`
456}
457
458// Environment: Definition of a software environment that is used to
459// start a notebook instance.
460type Environment struct {
461	// ContainerImage: Use a container image to start the notebook instance.
462	ContainerImage *ContainerImage `json:"containerImage,omitempty"`
463
464	// CreateTime: Output only. The time at which this environment was
465	// created.
466	CreateTime string `json:"createTime,omitempty"`
467
468	// Description: A brief description of this environment.
469	Description string `json:"description,omitempty"`
470
471	// DisplayName: Display name of this environment for the UI.
472	DisplayName string `json:"displayName,omitempty"`
473
474	// Name: Output only. Name of this environment. Format:
475	// `projects/{project_id}/locations/{location}/environments/{environment_
476	// id}`
477	Name string `json:"name,omitempty"`
478
479	// PostStartupScript: Path to a Bash script that automatically runs
480	// after a notebook instance fully boots up. The path must be a URL or
481	// Cloud Storage path. Example: "gs://path-to-file/file-name"
482	PostStartupScript string `json:"postStartupScript,omitempty"`
483
484	// VmImage: Use a Compute Engine VM image to start the notebook
485	// instance.
486	VmImage *VmImage `json:"vmImage,omitempty"`
487
488	// ServerResponse contains the HTTP response code and headers from the
489	// server.
490	googleapi.ServerResponse `json:"-"`
491
492	// ForceSendFields is a list of field names (e.g. "ContainerImage") to
493	// unconditionally include in API requests. By default, fields with
494	// empty values are omitted from API requests. However, any non-pointer,
495	// non-interface field appearing in ForceSendFields will be sent to the
496	// server regardless of whether the field is empty or not. This may be
497	// used to include empty fields in Patch requests.
498	ForceSendFields []string `json:"-"`
499
500	// NullFields is a list of field names (e.g. "ContainerImage") to
501	// include in API requests with the JSON null value. By default, fields
502	// with empty values are omitted from API requests. However, any field
503	// with an empty value appearing in NullFields will be sent to the
504	// server as null. It is an error if a field in this list has a
505	// non-empty value. This may be used to include null fields in Patch
506	// requests.
507	NullFields []string `json:"-"`
508}
509
510func (s *Environment) MarshalJSON() ([]byte, error) {
511	type NoMethod Environment
512	raw := NoMethod(*s)
513	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
514}
515
516// Expr: Represents a textual expression in the Common Expression
517// Language (CEL) syntax. CEL is a C-like expression language. The
518// syntax and semantics of CEL are documented at
519// https://github.com/google/cel-spec. Example (Comparison): title:
520// "Summary size limit" description: "Determines if a summary is less
521// than 100 chars" expression: "document.summary.size() < 100" Example
522// (Equality): title: "Requestor is owner" description: "Determines if
523// requestor is the document owner" expression: "document.owner ==
524// request.auth.claims.email" Example (Logic): title: "Public documents"
525// description: "Determine whether the document should be publicly
526// visible" expression: "document.type != 'private' && document.type !=
527// 'internal'" Example (Data Manipulation): title: "Notification string"
528// description: "Create a notification string with a timestamp."
529// expression: "'New message received at ' +
530// string(document.create_time)" The exact variables and functions that
531// may be referenced within an expression are determined by the service
532// that evaluates it. See the service documentation for additional
533// information.
534type Expr struct {
535	// Description: Optional. Description of the expression. This is a
536	// longer text which describes the expression, e.g. when hovered over it
537	// in a UI.
538	Description string `json:"description,omitempty"`
539
540	// Expression: Textual representation of an expression in Common
541	// Expression Language syntax.
542	Expression string `json:"expression,omitempty"`
543
544	// Location: Optional. String indicating the location of the expression
545	// for error reporting, e.g. a file name and a position in the file.
546	Location string `json:"location,omitempty"`
547
548	// Title: Optional. Title for the expression, i.e. a short string
549	// describing its purpose. This can be used e.g. in UIs which allow to
550	// enter the expression.
551	Title string `json:"title,omitempty"`
552
553	// ForceSendFields is a list of field names (e.g. "Description") to
554	// unconditionally include in API requests. By default, fields with
555	// empty values are omitted from API requests. However, any non-pointer,
556	// non-interface field appearing in ForceSendFields will be sent to the
557	// server regardless of whether the field is empty or not. This may be
558	// used to include empty fields in Patch requests.
559	ForceSendFields []string `json:"-"`
560
561	// NullFields is a list of field names (e.g. "Description") to include
562	// in API requests with the JSON null value. By default, fields with
563	// empty values are omitted from API requests. However, any field with
564	// an empty value appearing in NullFields will be sent to the server as
565	// null. It is an error if a field in this list has a non-empty value.
566	// This may be used to include null fields in Patch requests.
567	NullFields []string `json:"-"`
568}
569
570func (s *Expr) MarshalJSON() ([]byte, error) {
571	type NoMethod Expr
572	raw := NoMethod(*s)
573	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
574}
575
576// GuestOsFeature: Guest OS features for boot disk.
577type GuestOsFeature struct {
578	// Type: The ID of a supported feature. Read Enabling guest operating
579	// system features to see a list of available options. Valid values:
580	// FEATURE_TYPE_UNSPECIFIED MULTI_IP_SUBNET SECURE_BOOT UEFI_COMPATIBLE
581	// VIRTIO_SCSI_MULTIQUEUE WINDOWS
582	Type string `json:"type,omitempty"`
583
584	// ForceSendFields is a list of field names (e.g. "Type") to
585	// unconditionally include in API requests. By default, fields with
586	// empty values are omitted from API requests. However, any non-pointer,
587	// non-interface field appearing in ForceSendFields will be sent to the
588	// server regardless of whether the field is empty or not. This may be
589	// used to include empty fields in Patch requests.
590	ForceSendFields []string `json:"-"`
591
592	// NullFields is a list of field names (e.g. "Type") to include in API
593	// requests with the JSON null value. By default, fields with empty
594	// values are omitted from API requests. However, any field with an
595	// empty value appearing in NullFields will be sent to the server as
596	// null. It is an error if a field in this list has a non-empty value.
597	// This may be used to include null fields in Patch requests.
598	NullFields []string `json:"-"`
599}
600
601func (s *GuestOsFeature) MarshalJSON() ([]byte, error) {
602	type NoMethod GuestOsFeature
603	raw := NoMethod(*s)
604	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
605}
606
607// Instance: The definition of a notebook instance.
608type Instance struct {
609	// AcceleratorConfig: The hardware accelerator used on this instance. If
610	// you use accelerators, make sure that your configuration has [enough
611	// vCPUs and memory to support the `machine_type` you have
612	// selected](/compute/docs/gpus/#gpus-list).
613	AcceleratorConfig *AcceleratorConfig `json:"acceleratorConfig,omitempty"`
614
615	// BootDiskSizeGb: Input only. The size of the boot disk in GB attached
616	// to this instance, up to a maximum of 64000 GB (64 TB). The minimum
617	// recommended value is 100 GB. If not specified, this defaults to 100.
618	BootDiskSizeGb int64 `json:"bootDiskSizeGb,omitempty,string"`
619
620	// BootDiskType: Input only. The type of the boot disk attached to this
621	// instance, defaults to standard persistent disk (`PD_STANDARD`).
622	//
623	// Possible values:
624	//   "DISK_TYPE_UNSPECIFIED" - Disk type not set.
625	//   "PD_STANDARD" - Standard persistent disk type.
626	//   "PD_SSD" - SSD persistent disk type.
627	//   "PD_BALANCED" - Balanced persistent disk type.
628	BootDiskType string `json:"bootDiskType,omitempty"`
629
630	// ContainerImage: Use a container image to start the notebook instance.
631	ContainerImage *ContainerImage `json:"containerImage,omitempty"`
632
633	// CreateTime: Output only. Instance creation time.
634	CreateTime string `json:"createTime,omitempty"`
635
636	// CustomGpuDriverPath: Specify a custom Cloud Storage path where the
637	// GPU driver is stored. If not specified, we'll automatically choose
638	// from official GPU drivers.
639	CustomGpuDriverPath string `json:"customGpuDriverPath,omitempty"`
640
641	// DataDiskSizeGb: Input only. The size of the data disk in GB attached
642	// to this instance, up to a maximum of 64000 GB (64 TB). You can choose
643	// the size of the data disk based on how big your notebooks and data
644	// are. If not specified, this defaults to 100.
645	DataDiskSizeGb int64 `json:"dataDiskSizeGb,omitempty,string"`
646
647	// DataDiskType: Input only. The type of the data disk attached to this
648	// instance, defaults to standard persistent disk (`PD_STANDARD`).
649	//
650	// Possible values:
651	//   "DISK_TYPE_UNSPECIFIED" - Disk type not set.
652	//   "PD_STANDARD" - Standard persistent disk type.
653	//   "PD_SSD" - SSD persistent disk type.
654	//   "PD_BALANCED" - Balanced persistent disk type.
655	DataDiskType string `json:"dataDiskType,omitempty"`
656
657	// DiskEncryption: Input only. Disk encryption method used on the boot
658	// and data disks, defaults to GMEK.
659	//
660	// Possible values:
661	//   "DISK_ENCRYPTION_UNSPECIFIED" - Disk encryption is not specified.
662	//   "GMEK" - Use Google managed encryption keys to encrypt the boot
663	// disk.
664	//   "CMEK" - Use customer managed encryption keys to encrypt the boot
665	// disk.
666	DiskEncryption string `json:"diskEncryption,omitempty"`
667
668	// Disks: Output only. Attached disks to notebook instance.
669	Disks []*Disk `json:"disks,omitempty"`
670
671	// InstallGpuDriver: Whether the end user authorizes Google Cloud to
672	// install GPU driver on this instance. If this field is empty or set to
673	// false, the GPU driver won't be installed. Only applicable to
674	// instances with GPUs.
675	InstallGpuDriver bool `json:"installGpuDriver,omitempty"`
676
677	// InstanceOwners: Input only. The owner of this instance after
678	// creation. Format: `alias@example.com` Currently supports one owner
679	// only. If not specified, all of the service account users of your VM
680	// instance's service account can use the instance.
681	InstanceOwners []string `json:"instanceOwners,omitempty"`
682
683	// KmsKey: Input only. The KMS key used to encrypt the disks, only
684	// applicable if disk_encryption is CMEK. Format:
685	// `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cry
686	// ptoKeys/{key_id}` Learn more about [using your own encryption
687	// keys](/kms/docs/quickstart).
688	KmsKey string `json:"kmsKey,omitempty"`
689
690	// Labels: Labels to apply to this instance. These can be later modified
691	// by the setLabels method.
692	Labels map[string]string `json:"labels,omitempty"`
693
694	// MachineType: Required. The [Compute Engine machine
695	// type](/compute/docs/machine-types) of this instance.
696	MachineType string `json:"machineType,omitempty"`
697
698	// Metadata: Custom metadata to apply to this instance.
699	Metadata map[string]string `json:"metadata,omitempty"`
700
701	// Name: Output only. The name of this notebook instance. Format:
702	// `projects/{project_id}/locations/{location}/instances/{instance_id}`
703	Name string `json:"name,omitempty"`
704
705	// Network: The name of the VPC that this instance is in. Format:
706	// `projects/{project_id}/global/networks/{network_id}`
707	Network string `json:"network,omitempty"`
708
709	// NoProxyAccess: If true, the notebook instance will not register with
710	// the proxy.
711	NoProxyAccess bool `json:"noProxyAccess,omitempty"`
712
713	// NoPublicIp: If true, no public IP will be assigned to this instance.
714	NoPublicIp bool `json:"noPublicIp,omitempty"`
715
716	// NoRemoveDataDisk: Input only. If true, the data disk will not be auto
717	// deleted when deleting the instance.
718	NoRemoveDataDisk bool `json:"noRemoveDataDisk,omitempty"`
719
720	// PostStartupScript: Path to a Bash script that automatically runs
721	// after a notebook instance fully boots up. The path must be a URL or
722	// Cloud Storage path (gs://path-to-file/file-name).
723	PostStartupScript string `json:"postStartupScript,omitempty"`
724
725	// ProxyUri: Output only. The proxy endpoint that is used to access the
726	// Jupyter notebook.
727	ProxyUri string `json:"proxyUri,omitempty"`
728
729	// ServiceAccount: The service account on this instance, giving access
730	// to other Google Cloud services. You can use any service account
731	// within the same project, but you must have the service account user
732	// permission to use the instance. If not specified, the [Compute Engine
733	// default service
734	// account](https://cloud.google.com/compute/docs/access/service-accounts
735	// #default_service_account) is used.
736	ServiceAccount string `json:"serviceAccount,omitempty"`
737
738	// State: Output only. The state of this instance.
739	//
740	// Possible values:
741	//   "STATE_UNSPECIFIED" - State is not specified.
742	//   "STARTING" - The control logic is starting the instance.
743	//   "PROVISIONING" - The control logic is installing required
744	// frameworks and registering the instance with notebook proxy
745	//   "ACTIVE" - The instance is running.
746	//   "STOPPING" - The control logic is stopping the instance.
747	//   "STOPPED" - The instance is stopped.
748	//   "DELETED" - The instance is deleted.
749	//   "UPGRADING" - The instance is upgrading.
750	//   "INITIALIZING" - The instance is being created.
751	//   "REGISTERING" - The instance is getting registered.
752	State string `json:"state,omitempty"`
753
754	// Subnet: The name of the subnet that this instance is in. Format:
755	// `projects/{project_id}/regions/{region}/subnetworks/{subnetwork_id}`
756	Subnet string `json:"subnet,omitempty"`
757
758	// UpdateTime: Output only. Instance update time.
759	UpdateTime string `json:"updateTime,omitempty"`
760
761	// UpgradeHistory: The upgrade history of this instance.
762	UpgradeHistory []*UpgradeHistoryEntry `json:"upgradeHistory,omitempty"`
763
764	// VmImage: Use a Compute Engine VM image to start the notebook
765	// instance.
766	VmImage *VmImage `json:"vmImage,omitempty"`
767
768	// ServerResponse contains the HTTP response code and headers from the
769	// server.
770	googleapi.ServerResponse `json:"-"`
771
772	// ForceSendFields is a list of field names (e.g. "AcceleratorConfig")
773	// to unconditionally include in API requests. By default, fields with
774	// empty values are omitted from API requests. However, any non-pointer,
775	// non-interface field appearing in ForceSendFields will be sent to the
776	// server regardless of whether the field is empty or not. This may be
777	// used to include empty fields in Patch requests.
778	ForceSendFields []string `json:"-"`
779
780	// NullFields is a list of field names (e.g. "AcceleratorConfig") to
781	// include in API requests with the JSON null value. By default, fields
782	// with empty values are omitted from API requests. However, any field
783	// with an empty value appearing in NullFields will be sent to the
784	// server as null. It is an error if a field in this list has a
785	// non-empty value. This may be used to include null fields in Patch
786	// requests.
787	NullFields []string `json:"-"`
788}
789
790func (s *Instance) MarshalJSON() ([]byte, error) {
791	type NoMethod Instance
792	raw := NoMethod(*s)
793	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
794}
795
796// IsInstanceUpgradeableResponse: Response for checking if a notebook
797// instance is upgradeable.
798type IsInstanceUpgradeableResponse struct {
799	// UpgradeInfo: Additional information about upgrade.
800	UpgradeInfo string `json:"upgradeInfo,omitempty"`
801
802	// UpgradeVersion: The version this instance will be upgraded to if
803	// calling the upgrade endpoint. This field will only be populated if
804	// field upgradeable is true.
805	UpgradeVersion string `json:"upgradeVersion,omitempty"`
806
807	// Upgradeable: If an instance is upgradeable.
808	Upgradeable bool `json:"upgradeable,omitempty"`
809
810	// ServerResponse contains the HTTP response code and headers from the
811	// server.
812	googleapi.ServerResponse `json:"-"`
813
814	// ForceSendFields is a list of field names (e.g. "UpgradeInfo") to
815	// unconditionally include in API requests. By default, fields with
816	// empty values are omitted from API requests. However, any non-pointer,
817	// non-interface field appearing in ForceSendFields will be sent to the
818	// server regardless of whether the field is empty or not. This may be
819	// used to include empty fields in Patch requests.
820	ForceSendFields []string `json:"-"`
821
822	// NullFields is a list of field names (e.g. "UpgradeInfo") to include
823	// in API requests with the JSON null value. By default, fields with
824	// empty values are omitted from API requests. However, any field with
825	// an empty value appearing in NullFields will be sent to the server as
826	// null. It is an error if a field in this list has a non-empty value.
827	// This may be used to include null fields in Patch requests.
828	NullFields []string `json:"-"`
829}
830
831func (s *IsInstanceUpgradeableResponse) MarshalJSON() ([]byte, error) {
832	type NoMethod IsInstanceUpgradeableResponse
833	raw := NoMethod(*s)
834	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
835}
836
837// ListEnvironmentsResponse: Response for listing environments.
838type ListEnvironmentsResponse struct {
839	// Environments: A list of returned environments.
840	Environments []*Environment `json:"environments,omitempty"`
841
842	// NextPageToken: A page token that can be used to continue listing from
843	// the last result in the next list call.
844	NextPageToken string `json:"nextPageToken,omitempty"`
845
846	// Unreachable: Locations that could not be reached.
847	Unreachable []string `json:"unreachable,omitempty"`
848
849	// ServerResponse contains the HTTP response code and headers from the
850	// server.
851	googleapi.ServerResponse `json:"-"`
852
853	// ForceSendFields is a list of field names (e.g. "Environments") to
854	// unconditionally include in API requests. By default, fields with
855	// empty values are omitted from API requests. However, any non-pointer,
856	// non-interface field appearing in ForceSendFields will be sent to the
857	// server regardless of whether the field is empty or not. This may be
858	// used to include empty fields in Patch requests.
859	ForceSendFields []string `json:"-"`
860
861	// NullFields is a list of field names (e.g. "Environments") to include
862	// in API requests with the JSON null value. By default, fields with
863	// empty values are omitted from API requests. However, any field with
864	// an empty value appearing in NullFields will be sent to the server as
865	// null. It is an error if a field in this list has a non-empty value.
866	// This may be used to include null fields in Patch requests.
867	NullFields []string `json:"-"`
868}
869
870func (s *ListEnvironmentsResponse) MarshalJSON() ([]byte, error) {
871	type NoMethod ListEnvironmentsResponse
872	raw := NoMethod(*s)
873	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
874}
875
876// ListInstancesResponse: Response for listing notebook instances.
877type ListInstancesResponse struct {
878	// Instances: A list of returned instances.
879	Instances []*Instance `json:"instances,omitempty"`
880
881	// NextPageToken: Page token that can be used to continue listing from
882	// the last result in the next list call.
883	NextPageToken string `json:"nextPageToken,omitempty"`
884
885	// Unreachable: Locations that could not be reached. For example,
886	// ['us-west1-a', 'us-central1-b']. A ListInstancesResponse will only
887	// contain either instances or unreachables,
888	Unreachable []string `json:"unreachable,omitempty"`
889
890	// ServerResponse contains the HTTP response code and headers from the
891	// server.
892	googleapi.ServerResponse `json:"-"`
893
894	// ForceSendFields is a list of field names (e.g. "Instances") to
895	// unconditionally include in API requests. By default, fields with
896	// empty values are omitted from API requests. However, any non-pointer,
897	// non-interface field appearing in ForceSendFields will be sent to the
898	// server regardless of whether the field is empty or not. This may be
899	// used to include empty fields in Patch requests.
900	ForceSendFields []string `json:"-"`
901
902	// NullFields is a list of field names (e.g. "Instances") to include in
903	// API requests with the JSON null value. By default, fields with empty
904	// values are omitted from API requests. However, any field with an
905	// empty value appearing in NullFields will be sent to the server as
906	// null. It is an error if a field in this list has a non-empty value.
907	// This may be used to include null fields in Patch requests.
908	NullFields []string `json:"-"`
909}
910
911func (s *ListInstancesResponse) MarshalJSON() ([]byte, error) {
912	type NoMethod ListInstancesResponse
913	raw := NoMethod(*s)
914	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
915}
916
917// ListLocationsResponse: The response message for
918// Locations.ListLocations.
919type ListLocationsResponse struct {
920	// Locations: A list of locations that matches the specified filter in
921	// the request.
922	Locations []*Location `json:"locations,omitempty"`
923
924	// NextPageToken: The standard List next-page token.
925	NextPageToken string `json:"nextPageToken,omitempty"`
926
927	// ServerResponse contains the HTTP response code and headers from the
928	// server.
929	googleapi.ServerResponse `json:"-"`
930
931	// ForceSendFields is a list of field names (e.g. "Locations") to
932	// unconditionally include in API requests. By default, fields with
933	// empty values are omitted from API requests. However, any non-pointer,
934	// non-interface field appearing in ForceSendFields will be sent to the
935	// server regardless of whether the field is empty or not. This may be
936	// used to include empty fields in Patch requests.
937	ForceSendFields []string `json:"-"`
938
939	// NullFields is a list of field names (e.g. "Locations") to include in
940	// API requests with the JSON null value. By default, fields with empty
941	// values are omitted from API requests. However, any field with an
942	// empty value appearing in NullFields will be sent to the server as
943	// null. It is an error if a field in this list has a non-empty value.
944	// This may be used to include null fields in Patch requests.
945	NullFields []string `json:"-"`
946}
947
948func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
949	type NoMethod ListLocationsResponse
950	raw := NoMethod(*s)
951	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
952}
953
954// ListOperationsResponse: The response message for
955// Operations.ListOperations.
956type ListOperationsResponse struct {
957	// NextPageToken: The standard List next-page token.
958	NextPageToken string `json:"nextPageToken,omitempty"`
959
960	// Operations: A list of operations that matches the specified filter in
961	// the request.
962	Operations []*Operation `json:"operations,omitempty"`
963
964	// ServerResponse contains the HTTP response code and headers from the
965	// server.
966	googleapi.ServerResponse `json:"-"`
967
968	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
969	// unconditionally include in API requests. By default, fields with
970	// empty values are omitted from API requests. However, any non-pointer,
971	// non-interface field appearing in ForceSendFields will be sent to the
972	// server regardless of whether the field is empty or not. This may be
973	// used to include empty fields in Patch requests.
974	ForceSendFields []string `json:"-"`
975
976	// NullFields is a list of field names (e.g. "NextPageToken") to include
977	// in API requests with the JSON null value. By default, fields with
978	// empty values are omitted from API requests. However, any field with
979	// an empty value appearing in NullFields will be sent to the server as
980	// null. It is an error if a field in this list has a non-empty value.
981	// This may be used to include null fields in Patch requests.
982	NullFields []string `json:"-"`
983}
984
985func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
986	type NoMethod ListOperationsResponse
987	raw := NoMethod(*s)
988	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
989}
990
991// Location: A resource that represents Google Cloud Platform location.
992type Location struct {
993	// DisplayName: The friendly name for this location, typically a nearby
994	// city name. For example, "Tokyo".
995	DisplayName string `json:"displayName,omitempty"`
996
997	// Labels: Cross-service attributes for the location. For example
998	// {"cloud.googleapis.com/region": "us-east1"}
999	Labels map[string]string `json:"labels,omitempty"`
1000
1001	// LocationId: The canonical id for this location. For example:
1002	// "us-east1".
1003	LocationId string `json:"locationId,omitempty"`
1004
1005	// Metadata: Service-specific metadata. For example the available
1006	// capacity at the given location.
1007	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1008
1009	// Name: Resource name for the location, which may vary between
1010	// implementations. For example:
1011	// "projects/example-project/locations/us-east1"
1012	Name string `json:"name,omitempty"`
1013
1014	// ServerResponse contains the HTTP response code and headers from the
1015	// server.
1016	googleapi.ServerResponse `json:"-"`
1017
1018	// ForceSendFields is a list of field names (e.g. "DisplayName") to
1019	// unconditionally include in API requests. By default, fields with
1020	// empty values are omitted from API requests. However, any non-pointer,
1021	// non-interface field appearing in ForceSendFields will be sent to the
1022	// server regardless of whether the field is empty or not. This may be
1023	// used to include empty fields in Patch requests.
1024	ForceSendFields []string `json:"-"`
1025
1026	// NullFields is a list of field names (e.g. "DisplayName") to include
1027	// in API requests with the JSON null value. By default, fields with
1028	// empty values are omitted from API requests. However, any field with
1029	// an empty value appearing in NullFields will be sent to the server as
1030	// null. It is an error if a field in this list has a non-empty value.
1031	// This may be used to include null fields in Patch requests.
1032	NullFields []string `json:"-"`
1033}
1034
1035func (s *Location) MarshalJSON() ([]byte, error) {
1036	type NoMethod Location
1037	raw := NoMethod(*s)
1038	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1039}
1040
1041// Operation: This resource represents a long-running operation that is
1042// the result of a network API call.
1043type Operation struct {
1044	// Done: If the value is `false`, it means the operation is still in
1045	// progress. If `true`, the operation is completed, and either `error`
1046	// or `response` is available.
1047	Done bool `json:"done,omitempty"`
1048
1049	// Error: The error result of the operation in case of failure or
1050	// cancellation.
1051	Error *Status `json:"error,omitempty"`
1052
1053	// Metadata: Service-specific metadata associated with the operation. It
1054	// typically contains progress information and common metadata such as
1055	// create time. Some services might not provide such metadata. Any
1056	// method that returns a long-running operation should document the
1057	// metadata type, if any.
1058	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1059
1060	// Name: The server-assigned name, which is only unique within the same
1061	// service that originally returns it. If you use the default HTTP
1062	// mapping, the `name` should be a resource name ending with
1063	// `operations/{unique_id}`.
1064	Name string `json:"name,omitempty"`
1065
1066	// Response: The normal response of the operation in case of success. If
1067	// the original method returns no data on success, such as `Delete`, the
1068	// response is `google.protobuf.Empty`. If the original method is
1069	// standard `Get`/`Create`/`Update`, the response should be the
1070	// resource. For other methods, the response should have the type
1071	// `XxxResponse`, where `Xxx` is the original method name. For example,
1072	// if the original method name is `TakeSnapshot()`, the inferred
1073	// response type is `TakeSnapshotResponse`.
1074	Response googleapi.RawMessage `json:"response,omitempty"`
1075
1076	// ServerResponse contains the HTTP response code and headers from the
1077	// server.
1078	googleapi.ServerResponse `json:"-"`
1079
1080	// ForceSendFields is a list of field names (e.g. "Done") to
1081	// unconditionally include in API requests. By default, fields with
1082	// empty values are omitted from API requests. However, any non-pointer,
1083	// non-interface field appearing in ForceSendFields will be sent to the
1084	// server regardless of whether the field is empty or not. This may be
1085	// used to include empty fields in Patch requests.
1086	ForceSendFields []string `json:"-"`
1087
1088	// NullFields is a list of field names (e.g. "Done") to include in API
1089	// requests with the JSON null value. By default, fields with empty
1090	// values are omitted from API requests. However, any field with an
1091	// empty value appearing in NullFields will be sent to the server as
1092	// null. It is an error if a field in this list has a non-empty value.
1093	// This may be used to include null fields in Patch requests.
1094	NullFields []string `json:"-"`
1095}
1096
1097func (s *Operation) MarshalJSON() ([]byte, error) {
1098	type NoMethod Operation
1099	raw := NoMethod(*s)
1100	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1101}
1102
1103// OperationMetadata: Represents the metadata of the long-running
1104// operation.
1105type OperationMetadata struct {
1106	// ApiVersion: API version used to start the operation.
1107	ApiVersion string `json:"apiVersion,omitempty"`
1108
1109	// CreateTime: The time the operation was created.
1110	CreateTime string `json:"createTime,omitempty"`
1111
1112	// EndTime: The time the operation finished running.
1113	EndTime string `json:"endTime,omitempty"`
1114
1115	// Endpoint: API endpoint name of this operation.
1116	Endpoint string `json:"endpoint,omitempty"`
1117
1118	// RequestedCancellation: Identifies whether the user has requested
1119	// cancellation of the operation. Operations that have successfully been
1120	// cancelled have Operation.error value with a google.rpc.Status.code of
1121	// 1, corresponding to `Code.CANCELLED`.
1122	RequestedCancellation bool `json:"requestedCancellation,omitempty"`
1123
1124	// StatusMessage: Human-readable status of the operation, if any.
1125	StatusMessage string `json:"statusMessage,omitempty"`
1126
1127	// Target: Server-defined resource path for the target of the operation.
1128	Target string `json:"target,omitempty"`
1129
1130	// Verb: Name of the verb executed by the operation.
1131	Verb string `json:"verb,omitempty"`
1132
1133	// ForceSendFields is a list of field names (e.g. "ApiVersion") to
1134	// unconditionally include in API requests. By default, fields with
1135	// empty values are omitted from API requests. However, any non-pointer,
1136	// non-interface field appearing in ForceSendFields will be sent to the
1137	// server regardless of whether the field is empty or not. This may be
1138	// used to include empty fields in Patch requests.
1139	ForceSendFields []string `json:"-"`
1140
1141	// NullFields is a list of field names (e.g. "ApiVersion") to include in
1142	// API requests with the JSON null value. By default, fields with empty
1143	// values are omitted from API requests. However, any field with an
1144	// empty value appearing in NullFields will be sent to the server as
1145	// null. It is an error if a field in this list has a non-empty value.
1146	// This may be used to include null fields in Patch requests.
1147	NullFields []string `json:"-"`
1148}
1149
1150func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
1151	type NoMethod OperationMetadata
1152	raw := NoMethod(*s)
1153	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1154}
1155
1156// Policy: An Identity and Access Management (IAM) policy, which
1157// specifies access controls for Google Cloud resources. A `Policy` is a
1158// collection of `bindings`. A `binding` binds one or more `members` to
1159// a single `role`. Members can be user accounts, service accounts,
1160// Google groups, and domains (such as G Suite). A `role` is a named
1161// list of permissions; each `role` can be an IAM predefined role or a
1162// user-created custom role. For some types of Google Cloud resources, a
1163// `binding` can also specify a `condition`, which is a logical
1164// expression that allows access to a resource only if the expression
1165// evaluates to `true`. A condition can add constraints based on
1166// attributes of the request, the resource, or both. To learn which
1167// resources support conditions in their IAM policies, see the [IAM
1168// documentation](https://cloud.google.com/iam/help/conditions/resource-p
1169// olicies). **JSON example:** { "bindings": [ { "role":
1170// "roles/resourcemanager.organizationAdmin", "members": [
1171// "user:mike@example.com", "group:admins@example.com",
1172// "domain:google.com",
1173// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, {
1174// "role": "roles/resourcemanager.organizationViewer", "members": [
1175// "user:eve@example.com" ], "condition": { "title": "expirable access",
1176// "description": "Does not grant access after Sep 2020", "expression":
1177// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ],
1178// "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: -
1179// members: - user:mike@example.com - group:admins@example.com -
1180// domain:google.com -
1181// serviceAccount:my-project-id@appspot.gserviceaccount.com role:
1182// roles/resourcemanager.organizationAdmin - members: -
1183// user:eve@example.com role: roles/resourcemanager.organizationViewer
1184// condition: title: expirable access description: Does not grant access
1185// after Sep 2020 expression: request.time <
1186// timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version:
1187// 3 For a description of IAM and its features, see the [IAM
1188// documentation](https://cloud.google.com/iam/docs/).
1189type Policy struct {
1190	// Bindings: Associates a list of `members` to a `role`. Optionally, may
1191	// specify a `condition` that determines how and when the `bindings` are
1192	// applied. Each of the `bindings` must contain at least one member.
1193	Bindings []*Binding `json:"bindings,omitempty"`
1194
1195	// Etag: `etag` is used for optimistic concurrency control as a way to
1196	// help prevent simultaneous updates of a policy from overwriting each
1197	// other. It is strongly suggested that systems make use of the `etag`
1198	// in the read-modify-write cycle to perform policy updates in order to
1199	// avoid race conditions: An `etag` is returned in the response to
1200	// `getIamPolicy`, and systems are expected to put that etag in the
1201	// request to `setIamPolicy` to ensure that their change will be applied
1202	// to the same version of the policy. **Important:** If you use IAM
1203	// Conditions, you must include the `etag` field whenever you call
1204	// `setIamPolicy`. If you omit this field, then IAM allows you to
1205	// overwrite a version `3` policy with a version `1` policy, and all of
1206	// the conditions in the version `3` policy are lost.
1207	Etag string `json:"etag,omitempty"`
1208
1209	// Version: Specifies the format of the policy. Valid values are `0`,
1210	// `1`, and `3`. Requests that specify an invalid value are rejected.
1211	// Any operation that affects conditional role bindings must specify
1212	// version `3`. This requirement applies to the following operations: *
1213	// Getting a policy that includes a conditional role binding * Adding a
1214	// conditional role binding to a policy * Changing a conditional role
1215	// binding in a policy * Removing any role binding, with or without a
1216	// condition, from a policy that includes conditions **Important:** If
1217	// you use IAM Conditions, you must include the `etag` field whenever
1218	// you call `setIamPolicy`. If you omit this field, then IAM allows you
1219	// to overwrite a version `3` policy with a version `1` policy, and all
1220	// of the conditions in the version `3` policy are lost. If a policy
1221	// does not include any conditions, operations on that policy may
1222	// specify any valid version or leave the field unset. To learn which
1223	// resources support conditions in their IAM policies, see the [IAM
1224	// documentation](https://cloud.google.com/iam/help/conditions/resource-p
1225	// olicies).
1226	Version int64 `json:"version,omitempty"`
1227
1228	// ServerResponse contains the HTTP response code and headers from the
1229	// server.
1230	googleapi.ServerResponse `json:"-"`
1231
1232	// ForceSendFields is a list of field names (e.g. "Bindings") to
1233	// unconditionally include in API requests. By default, fields with
1234	// empty values are omitted from API requests. However, any non-pointer,
1235	// non-interface field appearing in ForceSendFields will be sent to the
1236	// server regardless of whether the field is empty or not. This may be
1237	// used to include empty fields in Patch requests.
1238	ForceSendFields []string `json:"-"`
1239
1240	// NullFields is a list of field names (e.g. "Bindings") to include in
1241	// API requests with the JSON null value. By default, fields with empty
1242	// values are omitted from API requests. However, any field with an
1243	// empty value appearing in NullFields will be sent to the server as
1244	// null. It is an error if a field in this list has a non-empty value.
1245	// This may be used to include null fields in Patch requests.
1246	NullFields []string `json:"-"`
1247}
1248
1249func (s *Policy) MarshalJSON() ([]byte, error) {
1250	type NoMethod Policy
1251	raw := NoMethod(*s)
1252	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1253}
1254
1255// RegisterInstanceRequest: Request for registering a notebook instance.
1256type RegisterInstanceRequest struct {
1257	// InstanceId: Required. User defined unique ID of this instance. The
1258	// `instance_id` must be 1 to 63 characters long and contain only
1259	// lowercase letters, numeric characters, and dashes. The first
1260	// character must be a lowercase letter and the last character cannot be
1261	// a dash.
1262	InstanceId string `json:"instanceId,omitempty"`
1263
1264	// ForceSendFields is a list of field names (e.g. "InstanceId") to
1265	// unconditionally include in API requests. By default, fields with
1266	// empty values are omitted from API requests. However, any non-pointer,
1267	// non-interface field appearing in ForceSendFields will be sent to the
1268	// server regardless of whether the field is empty or not. This may be
1269	// used to include empty fields in Patch requests.
1270	ForceSendFields []string `json:"-"`
1271
1272	// NullFields is a list of field names (e.g. "InstanceId") to include in
1273	// API requests with the JSON null value. By default, fields with empty
1274	// values are omitted from API requests. However, any field with an
1275	// empty value appearing in NullFields will be sent to the server as
1276	// null. It is an error if a field in this list has a non-empty value.
1277	// This may be used to include null fields in Patch requests.
1278	NullFields []string `json:"-"`
1279}
1280
1281func (s *RegisterInstanceRequest) MarshalJSON() ([]byte, error) {
1282	type NoMethod RegisterInstanceRequest
1283	raw := NoMethod(*s)
1284	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1285}
1286
1287// ReportInstanceInfoRequest: Request for notebook instances to report
1288// information to Notebooks API.
1289type ReportInstanceInfoRequest struct {
1290	// Metadata: The metadata reported to Notebooks API. This will be merged
1291	// to the instance metadata store
1292	Metadata map[string]string `json:"metadata,omitempty"`
1293
1294	// VmId: Required. The VM hardware token for authenticating the VM.
1295	// https://cloud.google.com/compute/docs/instances/verifying-instance-identity
1296	VmId string `json:"vmId,omitempty"`
1297
1298	// ForceSendFields is a list of field names (e.g. "Metadata") to
1299	// unconditionally include in API requests. By default, fields with
1300	// empty values are omitted from API requests. However, any non-pointer,
1301	// non-interface field appearing in ForceSendFields will be sent to the
1302	// server regardless of whether the field is empty or not. This may be
1303	// used to include empty fields in Patch requests.
1304	ForceSendFields []string `json:"-"`
1305
1306	// NullFields is a list of field names (e.g. "Metadata") to include in
1307	// API requests with the JSON null value. By default, fields with empty
1308	// values are omitted from API requests. However, any field with an
1309	// empty value appearing in NullFields will be sent to the server as
1310	// null. It is an error if a field in this list has a non-empty value.
1311	// This may be used to include null fields in Patch requests.
1312	NullFields []string `json:"-"`
1313}
1314
1315func (s *ReportInstanceInfoRequest) MarshalJSON() ([]byte, error) {
1316	type NoMethod ReportInstanceInfoRequest
1317	raw := NoMethod(*s)
1318	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1319}
1320
1321// ResetInstanceRequest: Request for reseting a notebook instance
1322type ResetInstanceRequest struct {
1323}
1324
1325// SetIamPolicyRequest: Request message for `SetIamPolicy` method.
1326type SetIamPolicyRequest struct {
1327	// Policy: REQUIRED: The complete policy to be applied to the
1328	// `resource`. The size of the policy is limited to a few 10s of KB. An
1329	// empty policy is a valid policy but certain Cloud Platform services
1330	// (such as Projects) might reject them.
1331	Policy *Policy `json:"policy,omitempty"`
1332
1333	// ForceSendFields is a list of field names (e.g. "Policy") to
1334	// unconditionally include in API requests. By default, fields with
1335	// empty values are omitted from API requests. However, any non-pointer,
1336	// non-interface field appearing in ForceSendFields will be sent to the
1337	// server regardless of whether the field is empty or not. This may be
1338	// used to include empty fields in Patch requests.
1339	ForceSendFields []string `json:"-"`
1340
1341	// NullFields is a list of field names (e.g. "Policy") to include in API
1342	// requests with the JSON null value. By default, fields with empty
1343	// values are omitted from API requests. However, any field with an
1344	// empty value appearing in NullFields will be sent to the server as
1345	// null. It is an error if a field in this list has a non-empty value.
1346	// This may be used to include null fields in Patch requests.
1347	NullFields []string `json:"-"`
1348}
1349
1350func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
1351	type NoMethod SetIamPolicyRequest
1352	raw := NoMethod(*s)
1353	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1354}
1355
1356// SetInstanceAcceleratorRequest: Request for setting instance
1357// accelerator.
1358type SetInstanceAcceleratorRequest struct {
1359	// CoreCount: Required. Count of cores of this accelerator. Note that
1360	// not all combinations of `type` and `core_count` are valid. Check
1361	// [GPUs on Compute
1362	// Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to
1363	// find a valid combination. TPUs are not supported.
1364	CoreCount int64 `json:"coreCount,omitempty,string"`
1365
1366	// Type: Required. Type of this accelerator.
1367	//
1368	// Possible values:
1369	//   "ACCELERATOR_TYPE_UNSPECIFIED" - Accelerator type is not specified.
1370	//   "NVIDIA_TESLA_K80" - Accelerator type is Nvidia Tesla K80.
1371	//   "NVIDIA_TESLA_P100" - Accelerator type is Nvidia Tesla P100.
1372	//   "NVIDIA_TESLA_V100" - Accelerator type is Nvidia Tesla V100.
1373	//   "NVIDIA_TESLA_P4" - Accelerator type is Nvidia Tesla P4.
1374	//   "NVIDIA_TESLA_T4" - Accelerator type is Nvidia Tesla T4.
1375	//   "NVIDIA_TESLA_A100" - Accelerator type is Nvidia Tesla A100.
1376	//   "NVIDIA_TESLA_T4_VWS" - Accelerator type is NVIDIA Tesla T4 Virtual
1377	// Workstations.
1378	//   "NVIDIA_TESLA_P100_VWS" - Accelerator type is NVIDIA Tesla P100
1379	// Virtual Workstations.
1380	//   "NVIDIA_TESLA_P4_VWS" - Accelerator type is NVIDIA Tesla P4 Virtual
1381	// Workstations.
1382	//   "TPU_V2" - (Coming soon) Accelerator type is TPU V2.
1383	//   "TPU_V3" - (Coming soon) Accelerator type is TPU V3.
1384	Type string `json:"type,omitempty"`
1385
1386	// ForceSendFields is a list of field names (e.g. "CoreCount") to
1387	// unconditionally include in API requests. By default, fields with
1388	// empty values are omitted from API requests. However, any non-pointer,
1389	// non-interface field appearing in ForceSendFields will be sent to the
1390	// server regardless of whether the field is empty or not. This may be
1391	// used to include empty fields in Patch requests.
1392	ForceSendFields []string `json:"-"`
1393
1394	// NullFields is a list of field names (e.g. "CoreCount") to include in
1395	// API requests with the JSON null value. By default, fields with empty
1396	// values are omitted from API requests. However, any field with an
1397	// empty value appearing in NullFields will be sent to the server as
1398	// null. It is an error if a field in this list has a non-empty value.
1399	// This may be used to include null fields in Patch requests.
1400	NullFields []string `json:"-"`
1401}
1402
1403func (s *SetInstanceAcceleratorRequest) MarshalJSON() ([]byte, error) {
1404	type NoMethod SetInstanceAcceleratorRequest
1405	raw := NoMethod(*s)
1406	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1407}
1408
1409// SetInstanceLabelsRequest: Request for setting instance labels.
1410type SetInstanceLabelsRequest struct {
1411	// Labels: Labels to apply to this instance. These can be later modified
1412	// by the setLabels method
1413	Labels map[string]string `json:"labels,omitempty"`
1414
1415	// ForceSendFields is a list of field names (e.g. "Labels") to
1416	// unconditionally include in API requests. By default, fields with
1417	// empty values are omitted from API requests. However, any non-pointer,
1418	// non-interface field appearing in ForceSendFields will be sent to the
1419	// server regardless of whether the field is empty or not. This may be
1420	// used to include empty fields in Patch requests.
1421	ForceSendFields []string `json:"-"`
1422
1423	// NullFields is a list of field names (e.g. "Labels") to include in API
1424	// requests with the JSON null value. By default, fields with empty
1425	// values are omitted from API requests. However, any field with an
1426	// empty value appearing in NullFields will be sent to the server as
1427	// null. It is an error if a field in this list has a non-empty value.
1428	// This may be used to include null fields in Patch requests.
1429	NullFields []string `json:"-"`
1430}
1431
1432func (s *SetInstanceLabelsRequest) MarshalJSON() ([]byte, error) {
1433	type NoMethod SetInstanceLabelsRequest
1434	raw := NoMethod(*s)
1435	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1436}
1437
1438// SetInstanceMachineTypeRequest: Request for setting instance machine
1439// type.
1440type SetInstanceMachineTypeRequest struct {
1441	// MachineType: Required. The [Compute Engine machine
1442	// type](https://cloud.google.com/compute/docs/machine-types).
1443	MachineType string `json:"machineType,omitempty"`
1444
1445	// ForceSendFields is a list of field names (e.g. "MachineType") to
1446	// unconditionally include in API requests. By default, fields with
1447	// empty values are omitted from API requests. However, any non-pointer,
1448	// non-interface field appearing in ForceSendFields will be sent to the
1449	// server regardless of whether the field is empty or not. This may be
1450	// used to include empty fields in Patch requests.
1451	ForceSendFields []string `json:"-"`
1452
1453	// NullFields is a list of field names (e.g. "MachineType") to include
1454	// in API requests with the JSON null value. By default, fields with
1455	// empty values are omitted from API requests. However, any field with
1456	// an empty value appearing in NullFields will be sent to the server as
1457	// null. It is an error if a field in this list has a non-empty value.
1458	// This may be used to include null fields in Patch requests.
1459	NullFields []string `json:"-"`
1460}
1461
1462func (s *SetInstanceMachineTypeRequest) MarshalJSON() ([]byte, error) {
1463	type NoMethod SetInstanceMachineTypeRequest
1464	raw := NoMethod(*s)
1465	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1466}
1467
1468// StartInstanceRequest: Request for starting a notebook instance
1469type StartInstanceRequest struct {
1470}
1471
1472// Status: The `Status` type defines a logical error model that is
1473// suitable for different programming environments, including REST APIs
1474// and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each
1475// `Status` message contains three pieces of data: error code, error
1476// message, and error details. You can find out more about this error
1477// model and how to work with it in the [API Design
1478// Guide](https://cloud.google.com/apis/design/errors).
1479type Status struct {
1480	// Code: The status code, which should be an enum value of
1481	// google.rpc.Code.
1482	Code int64 `json:"code,omitempty"`
1483
1484	// Details: A list of messages that carry the error details. There is a
1485	// common set of message types for APIs to use.
1486	Details []googleapi.RawMessage `json:"details,omitempty"`
1487
1488	// Message: A developer-facing error message, which should be in
1489	// English. Any user-facing error message should be localized and sent
1490	// in the google.rpc.Status.details field, or localized by the client.
1491	Message string `json:"message,omitempty"`
1492
1493	// ForceSendFields is a list of field names (e.g. "Code") to
1494	// unconditionally include in API requests. By default, fields with
1495	// empty values are omitted from API requests. However, any non-pointer,
1496	// non-interface field appearing in ForceSendFields will be sent to the
1497	// server regardless of whether the field is empty or not. This may be
1498	// used to include empty fields in Patch requests.
1499	ForceSendFields []string `json:"-"`
1500
1501	// NullFields is a list of field names (e.g. "Code") to include in API
1502	// requests with the JSON null value. By default, fields with empty
1503	// values are omitted from API requests. However, any field with an
1504	// empty value appearing in NullFields will be sent to the server as
1505	// null. It is an error if a field in this list has a non-empty value.
1506	// This may be used to include null fields in Patch requests.
1507	NullFields []string `json:"-"`
1508}
1509
1510func (s *Status) MarshalJSON() ([]byte, error) {
1511	type NoMethod Status
1512	raw := NoMethod(*s)
1513	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1514}
1515
1516// StopInstanceRequest: Request for stopping a notebook instance
1517type StopInstanceRequest struct {
1518}
1519
1520// TestIamPermissionsRequest: Request message for `TestIamPermissions`
1521// method.
1522type TestIamPermissionsRequest struct {
1523	// Permissions: The set of permissions to check for the `resource`.
1524	// Permissions with wildcards (such as '*' or 'storage.*') are not
1525	// allowed. For more information see [IAM
1526	// Overview](https://cloud.google.com/iam/docs/overview#permissions).
1527	Permissions []string `json:"permissions,omitempty"`
1528
1529	// ForceSendFields is a list of field names (e.g. "Permissions") to
1530	// unconditionally include in API requests. By default, fields with
1531	// empty values are omitted from API requests. However, any non-pointer,
1532	// non-interface field appearing in ForceSendFields will be sent to the
1533	// server regardless of whether the field is empty or not. This may be
1534	// used to include empty fields in Patch requests.
1535	ForceSendFields []string `json:"-"`
1536
1537	// NullFields is a list of field names (e.g. "Permissions") to include
1538	// in API requests with the JSON null value. By default, fields with
1539	// empty values are omitted from API requests. However, any field with
1540	// an empty value appearing in NullFields will be sent to the server as
1541	// null. It is an error if a field in this list has a non-empty value.
1542	// This may be used to include null fields in Patch requests.
1543	NullFields []string `json:"-"`
1544}
1545
1546func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
1547	type NoMethod TestIamPermissionsRequest
1548	raw := NoMethod(*s)
1549	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1550}
1551
1552// TestIamPermissionsResponse: Response message for `TestIamPermissions`
1553// method.
1554type TestIamPermissionsResponse struct {
1555	// Permissions: A subset of `TestPermissionsRequest.permissions` that
1556	// the caller is allowed.
1557	Permissions []string `json:"permissions,omitempty"`
1558
1559	// ServerResponse contains the HTTP response code and headers from the
1560	// server.
1561	googleapi.ServerResponse `json:"-"`
1562
1563	// ForceSendFields is a list of field names (e.g. "Permissions") to
1564	// unconditionally include in API requests. By default, fields with
1565	// empty values are omitted from API requests. However, any non-pointer,
1566	// non-interface field appearing in ForceSendFields will be sent to the
1567	// server regardless of whether the field is empty or not. This may be
1568	// used to include empty fields in Patch requests.
1569	ForceSendFields []string `json:"-"`
1570
1571	// NullFields is a list of field names (e.g. "Permissions") to include
1572	// in API requests with the JSON null value. By default, fields with
1573	// empty values are omitted from API requests. However, any field with
1574	// an empty value appearing in NullFields will be sent to the server as
1575	// null. It is an error if a field in this list has a non-empty value.
1576	// This may be used to include null fields in Patch requests.
1577	NullFields []string `json:"-"`
1578}
1579
1580func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
1581	type NoMethod TestIamPermissionsResponse
1582	raw := NoMethod(*s)
1583	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1584}
1585
1586type UpgradeHistoryEntry struct {
1587	// ContainerImage: The container image before this instance upgrade.
1588	ContainerImage string `json:"containerImage,omitempty"`
1589
1590	// CreateTime: The time that this instance upgrade history entry is
1591	// created.
1592	CreateTime string `json:"createTime,omitempty"`
1593
1594	// Framework: The framework of this notebook instance.
1595	Framework string `json:"framework,omitempty"`
1596
1597	// Snapshot: The snapshot of the boot disk of this notebook instance
1598	// before upgrade.
1599	Snapshot string `json:"snapshot,omitempty"`
1600
1601	// State: The state of this instance upgrade history entry.
1602	//
1603	// Possible values:
1604	//   "STATE_UNSPECIFIED" - State is not specified.
1605	//   "STARTED" - The instance upgrade is started.
1606	//   "SUCCEEDED" - The instance upgrade is succeeded.
1607	//   "FAILED" - The instance upgrade is failed.
1608	State string `json:"state,omitempty"`
1609
1610	// Version: The version of the notebook instance before this upgrade.
1611	Version string `json:"version,omitempty"`
1612
1613	// VmImage: The VM image before this instance upgrade.
1614	VmImage string `json:"vmImage,omitempty"`
1615
1616	// ForceSendFields is a list of field names (e.g. "ContainerImage") to
1617	// unconditionally include in API requests. By default, fields with
1618	// empty values are omitted from API requests. However, any non-pointer,
1619	// non-interface field appearing in ForceSendFields will be sent to the
1620	// server regardless of whether the field is empty or not. This may be
1621	// used to include empty fields in Patch requests.
1622	ForceSendFields []string `json:"-"`
1623
1624	// NullFields is a list of field names (e.g. "ContainerImage") to
1625	// include in API requests with the JSON null value. By default, fields
1626	// with empty values are omitted from API requests. However, any field
1627	// with an empty value appearing in NullFields will be sent to the
1628	// server as null. It is an error if a field in this list has a
1629	// non-empty value. This may be used to include null fields in Patch
1630	// requests.
1631	NullFields []string `json:"-"`
1632}
1633
1634func (s *UpgradeHistoryEntry) MarshalJSON() ([]byte, error) {
1635	type NoMethod UpgradeHistoryEntry
1636	raw := NoMethod(*s)
1637	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1638}
1639
1640// UpgradeInstanceInternalRequest: Request for upgrading a notebook
1641// instance from within the VM
1642type UpgradeInstanceInternalRequest struct {
1643	// VmId: Required. The VM hardware token for authenticating the VM.
1644	// https://cloud.google.com/compute/docs/instances/verifying-instance-identity
1645	VmId string `json:"vmId,omitempty"`
1646
1647	// ForceSendFields is a list of field names (e.g. "VmId") to
1648	// unconditionally include in API requests. By default, fields with
1649	// empty values are omitted from API requests. However, any non-pointer,
1650	// non-interface field appearing in ForceSendFields will be sent to the
1651	// server regardless of whether the field is empty or not. This may be
1652	// used to include empty fields in Patch requests.
1653	ForceSendFields []string `json:"-"`
1654
1655	// NullFields is a list of field names (e.g. "VmId") to include in API
1656	// requests with the JSON null value. By default, fields with empty
1657	// values are omitted from API requests. However, any field with an
1658	// empty value appearing in NullFields will be sent to the server as
1659	// null. It is an error if a field in this list has a non-empty value.
1660	// This may be used to include null fields in Patch requests.
1661	NullFields []string `json:"-"`
1662}
1663
1664func (s *UpgradeInstanceInternalRequest) MarshalJSON() ([]byte, error) {
1665	type NoMethod UpgradeInstanceInternalRequest
1666	raw := NoMethod(*s)
1667	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1668}
1669
1670// UpgradeInstanceRequest: Request for upgrading a notebook instance
1671type UpgradeInstanceRequest struct {
1672}
1673
1674// VmImage: Definition of a custom Compute Engine virtual machine image
1675// for starting a notebook instance with the environment installed
1676// directly on the VM.
1677type VmImage struct {
1678	// ImageFamily: Use this VM image family to find the image; the newest
1679	// image in this family will be used.
1680	ImageFamily string `json:"imageFamily,omitempty"`
1681
1682	// ImageName: Use VM image name to find the image.
1683	ImageName string `json:"imageName,omitempty"`
1684
1685	// Project: Required. The name of the Google Cloud project that this VM
1686	// image belongs to. Format: `projects/{project_id}`
1687	Project string `json:"project,omitempty"`
1688
1689	// ForceSendFields is a list of field names (e.g. "ImageFamily") to
1690	// unconditionally include in API requests. By default, fields with
1691	// empty values are omitted from API requests. However, any non-pointer,
1692	// non-interface field appearing in ForceSendFields will be sent to the
1693	// server regardless of whether the field is empty or not. This may be
1694	// used to include empty fields in Patch requests.
1695	ForceSendFields []string `json:"-"`
1696
1697	// NullFields is a list of field names (e.g. "ImageFamily") to include
1698	// in API requests with the JSON null value. By default, fields with
1699	// empty values are omitted from API requests. However, any field with
1700	// an empty value appearing in NullFields will be sent to the server as
1701	// null. It is an error if a field in this list has a non-empty value.
1702	// This may be used to include null fields in Patch requests.
1703	NullFields []string `json:"-"`
1704}
1705
1706func (s *VmImage) MarshalJSON() ([]byte, error) {
1707	type NoMethod VmImage
1708	raw := NoMethod(*s)
1709	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1710}
1711
1712// method id "notebooks.projects.locations.get":
1713
1714type ProjectsLocationsGetCall struct {
1715	s            *Service
1716	name         string
1717	urlParams_   gensupport.URLParams
1718	ifNoneMatch_ string
1719	ctx_         context.Context
1720	header_      http.Header
1721}
1722
1723// Get: Gets information about a location.
1724func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
1725	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1726	c.name = name
1727	return c
1728}
1729
1730// Fields allows partial responses to be retrieved. See
1731// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1732// for more information.
1733func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
1734	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1735	return c
1736}
1737
1738// IfNoneMatch sets the optional parameter which makes the operation
1739// fail if the object's ETag matches the given value. This is useful for
1740// getting updates only after the object has changed since the last
1741// request. Use googleapi.IsNotModified to check whether the response
1742// error from Do is the result of In-None-Match.
1743func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
1744	c.ifNoneMatch_ = entityTag
1745	return c
1746}
1747
1748// Context sets the context to be used in this call's Do method. Any
1749// pending HTTP request will be aborted if the provided context is
1750// canceled.
1751func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
1752	c.ctx_ = ctx
1753	return c
1754}
1755
1756// Header returns an http.Header that can be modified by the caller to
1757// add HTTP headers to the request.
1758func (c *ProjectsLocationsGetCall) Header() http.Header {
1759	if c.header_ == nil {
1760		c.header_ = make(http.Header)
1761	}
1762	return c.header_
1763}
1764
1765func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
1766	reqHeaders := make(http.Header)
1767	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
1768	for k, v := range c.header_ {
1769		reqHeaders[k] = v
1770	}
1771	reqHeaders.Set("User-Agent", c.s.userAgent())
1772	if c.ifNoneMatch_ != "" {
1773		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1774	}
1775	var body io.Reader = nil
1776	c.urlParams_.Set("alt", alt)
1777	c.urlParams_.Set("prettyPrint", "false")
1778	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1779	urls += "?" + c.urlParams_.Encode()
1780	req, err := http.NewRequest("GET", urls, body)
1781	if err != nil {
1782		return nil, err
1783	}
1784	req.Header = reqHeaders
1785	googleapi.Expand(req.URL, map[string]string{
1786		"name": c.name,
1787	})
1788	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1789}
1790
1791// Do executes the "notebooks.projects.locations.get" call.
1792// Exactly one of *Location or error will be non-nil. Any non-2xx status
1793// code is an error. Response headers are in either
1794// *Location.ServerResponse.Header or (if a response was returned at
1795// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
1796// to check whether the returned error was because
1797// http.StatusNotModified was returned.
1798func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
1799	gensupport.SetOptions(c.urlParams_, opts...)
1800	res, err := c.doRequest("json")
1801	if res != nil && res.StatusCode == http.StatusNotModified {
1802		if res.Body != nil {
1803			res.Body.Close()
1804		}
1805		return nil, &googleapi.Error{
1806			Code:   res.StatusCode,
1807			Header: res.Header,
1808		}
1809	}
1810	if err != nil {
1811		return nil, err
1812	}
1813	defer googleapi.CloseBody(res)
1814	if err := googleapi.CheckResponse(res); err != nil {
1815		return nil, err
1816	}
1817	ret := &Location{
1818		ServerResponse: googleapi.ServerResponse{
1819			Header:         res.Header,
1820			HTTPStatusCode: res.StatusCode,
1821		},
1822	}
1823	target := &ret
1824	if err := gensupport.DecodeResponse(target, res); err != nil {
1825		return nil, err
1826	}
1827	return ret, nil
1828	// {
1829	//   "description": "Gets information about a location.",
1830	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}",
1831	//   "httpMethod": "GET",
1832	//   "id": "notebooks.projects.locations.get",
1833	//   "parameterOrder": [
1834	//     "name"
1835	//   ],
1836	//   "parameters": {
1837	//     "name": {
1838	//       "description": "Resource name for the location.",
1839	//       "location": "path",
1840	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
1841	//       "required": true,
1842	//       "type": "string"
1843	//     }
1844	//   },
1845	//   "path": "v1/{+name}",
1846	//   "response": {
1847	//     "$ref": "Location"
1848	//   },
1849	//   "scopes": [
1850	//     "https://www.googleapis.com/auth/cloud-platform"
1851	//   ]
1852	// }
1853
1854}
1855
1856// method id "notebooks.projects.locations.list":
1857
1858type ProjectsLocationsListCall struct {
1859	s            *Service
1860	name         string
1861	urlParams_   gensupport.URLParams
1862	ifNoneMatch_ string
1863	ctx_         context.Context
1864	header_      http.Header
1865}
1866
1867// List: Lists information about the supported locations for this
1868// service.
1869func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
1870	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1871	c.name = name
1872	return c
1873}
1874
1875// Filter sets the optional parameter "filter": The standard list
1876// filter.
1877func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
1878	c.urlParams_.Set("filter", filter)
1879	return c
1880}
1881
1882// PageSize sets the optional parameter "pageSize": The standard list
1883// page size.
1884func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
1885	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1886	return c
1887}
1888
1889// PageToken sets the optional parameter "pageToken": The standard list
1890// page token.
1891func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
1892	c.urlParams_.Set("pageToken", pageToken)
1893	return c
1894}
1895
1896// Fields allows partial responses to be retrieved. See
1897// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1898// for more information.
1899func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
1900	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1901	return c
1902}
1903
1904// IfNoneMatch sets the optional parameter which makes the operation
1905// fail if the object's ETag matches the given value. This is useful for
1906// getting updates only after the object has changed since the last
1907// request. Use googleapi.IsNotModified to check whether the response
1908// error from Do is the result of In-None-Match.
1909func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
1910	c.ifNoneMatch_ = entityTag
1911	return c
1912}
1913
1914// Context sets the context to be used in this call's Do method. Any
1915// pending HTTP request will be aborted if the provided context is
1916// canceled.
1917func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
1918	c.ctx_ = ctx
1919	return c
1920}
1921
1922// Header returns an http.Header that can be modified by the caller to
1923// add HTTP headers to the request.
1924func (c *ProjectsLocationsListCall) Header() http.Header {
1925	if c.header_ == nil {
1926		c.header_ = make(http.Header)
1927	}
1928	return c.header_
1929}
1930
1931func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
1932	reqHeaders := make(http.Header)
1933	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
1934	for k, v := range c.header_ {
1935		reqHeaders[k] = v
1936	}
1937	reqHeaders.Set("User-Agent", c.s.userAgent())
1938	if c.ifNoneMatch_ != "" {
1939		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1940	}
1941	var body io.Reader = nil
1942	c.urlParams_.Set("alt", alt)
1943	c.urlParams_.Set("prettyPrint", "false")
1944	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
1945	urls += "?" + c.urlParams_.Encode()
1946	req, err := http.NewRequest("GET", urls, body)
1947	if err != nil {
1948		return nil, err
1949	}
1950	req.Header = reqHeaders
1951	googleapi.Expand(req.URL, map[string]string{
1952		"name": c.name,
1953	})
1954	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1955}
1956
1957// Do executes the "notebooks.projects.locations.list" call.
1958// Exactly one of *ListLocationsResponse or error will be non-nil. Any
1959// non-2xx status code is an error. Response headers are in either
1960// *ListLocationsResponse.ServerResponse.Header or (if a response was
1961// returned at all) in error.(*googleapi.Error).Header. Use
1962// googleapi.IsNotModified to check whether the returned error was
1963// because http.StatusNotModified was returned.
1964func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
1965	gensupport.SetOptions(c.urlParams_, opts...)
1966	res, err := c.doRequest("json")
1967	if res != nil && res.StatusCode == http.StatusNotModified {
1968		if res.Body != nil {
1969			res.Body.Close()
1970		}
1971		return nil, &googleapi.Error{
1972			Code:   res.StatusCode,
1973			Header: res.Header,
1974		}
1975	}
1976	if err != nil {
1977		return nil, err
1978	}
1979	defer googleapi.CloseBody(res)
1980	if err := googleapi.CheckResponse(res); err != nil {
1981		return nil, err
1982	}
1983	ret := &ListLocationsResponse{
1984		ServerResponse: googleapi.ServerResponse{
1985			Header:         res.Header,
1986			HTTPStatusCode: res.StatusCode,
1987		},
1988	}
1989	target := &ret
1990	if err := gensupport.DecodeResponse(target, res); err != nil {
1991		return nil, err
1992	}
1993	return ret, nil
1994	// {
1995	//   "description": "Lists information about the supported locations for this service.",
1996	//   "flatPath": "v1/projects/{projectsId}/locations",
1997	//   "httpMethod": "GET",
1998	//   "id": "notebooks.projects.locations.list",
1999	//   "parameterOrder": [
2000	//     "name"
2001	//   ],
2002	//   "parameters": {
2003	//     "filter": {
2004	//       "description": "The standard list filter.",
2005	//       "location": "query",
2006	//       "type": "string"
2007	//     },
2008	//     "name": {
2009	//       "description": "The resource that owns the locations collection, if applicable.",
2010	//       "location": "path",
2011	//       "pattern": "^projects/[^/]+$",
2012	//       "required": true,
2013	//       "type": "string"
2014	//     },
2015	//     "pageSize": {
2016	//       "description": "The standard list page size.",
2017	//       "format": "int32",
2018	//       "location": "query",
2019	//       "type": "integer"
2020	//     },
2021	//     "pageToken": {
2022	//       "description": "The standard list page token.",
2023	//       "location": "query",
2024	//       "type": "string"
2025	//     }
2026	//   },
2027	//   "path": "v1/{+name}/locations",
2028	//   "response": {
2029	//     "$ref": "ListLocationsResponse"
2030	//   },
2031	//   "scopes": [
2032	//     "https://www.googleapis.com/auth/cloud-platform"
2033	//   ]
2034	// }
2035
2036}
2037
2038// Pages invokes f for each page of results.
2039// A non-nil error returned from f will halt the iteration.
2040// The provided context supersedes any context provided to the Context method.
2041func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
2042	c.ctx_ = ctx
2043	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
2044	for {
2045		x, err := c.Do()
2046		if err != nil {
2047			return err
2048		}
2049		if err := f(x); err != nil {
2050			return err
2051		}
2052		if x.NextPageToken == "" {
2053			return nil
2054		}
2055		c.PageToken(x.NextPageToken)
2056	}
2057}
2058
2059// method id "notebooks.projects.locations.environments.create":
2060
2061type ProjectsLocationsEnvironmentsCreateCall struct {
2062	s           *Service
2063	parent      string
2064	environment *Environment
2065	urlParams_  gensupport.URLParams
2066	ctx_        context.Context
2067	header_     http.Header
2068}
2069
2070// Create: Creates a new Environment.
2071func (r *ProjectsLocationsEnvironmentsService) Create(parent string, environment *Environment) *ProjectsLocationsEnvironmentsCreateCall {
2072	c := &ProjectsLocationsEnvironmentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2073	c.parent = parent
2074	c.environment = environment
2075	return c
2076}
2077
2078// EnvironmentId sets the optional parameter "environmentId": Required.
2079// User-defined unique ID of this environment. The `environment_id` must
2080// be 1 to 63 characters long and contain only lowercase letters,
2081// numeric characters, and dashes. The first character must be a
2082// lowercase letter and the last character cannot be a dash.
2083func (c *ProjectsLocationsEnvironmentsCreateCall) EnvironmentId(environmentId string) *ProjectsLocationsEnvironmentsCreateCall {
2084	c.urlParams_.Set("environmentId", environmentId)
2085	return c
2086}
2087
2088// Fields allows partial responses to be retrieved. See
2089// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2090// for more information.
2091func (c *ProjectsLocationsEnvironmentsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsCreateCall {
2092	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2093	return c
2094}
2095
2096// Context sets the context to be used in this call's Do method. Any
2097// pending HTTP request will be aborted if the provided context is
2098// canceled.
2099func (c *ProjectsLocationsEnvironmentsCreateCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsCreateCall {
2100	c.ctx_ = ctx
2101	return c
2102}
2103
2104// Header returns an http.Header that can be modified by the caller to
2105// add HTTP headers to the request.
2106func (c *ProjectsLocationsEnvironmentsCreateCall) Header() http.Header {
2107	if c.header_ == nil {
2108		c.header_ = make(http.Header)
2109	}
2110	return c.header_
2111}
2112
2113func (c *ProjectsLocationsEnvironmentsCreateCall) doRequest(alt string) (*http.Response, error) {
2114	reqHeaders := make(http.Header)
2115	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
2116	for k, v := range c.header_ {
2117		reqHeaders[k] = v
2118	}
2119	reqHeaders.Set("User-Agent", c.s.userAgent())
2120	var body io.Reader = nil
2121	body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment)
2122	if err != nil {
2123		return nil, err
2124	}
2125	reqHeaders.Set("Content-Type", "application/json")
2126	c.urlParams_.Set("alt", alt)
2127	c.urlParams_.Set("prettyPrint", "false")
2128	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/environments")
2129	urls += "?" + c.urlParams_.Encode()
2130	req, err := http.NewRequest("POST", urls, body)
2131	if err != nil {
2132		return nil, err
2133	}
2134	req.Header = reqHeaders
2135	googleapi.Expand(req.URL, map[string]string{
2136		"parent": c.parent,
2137	})
2138	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2139}
2140
2141// Do executes the "notebooks.projects.locations.environments.create" call.
2142// Exactly one of *Operation or error will be non-nil. Any non-2xx
2143// status code is an error. Response headers are in either
2144// *Operation.ServerResponse.Header or (if a response was returned at
2145// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
2146// to check whether the returned error was because
2147// http.StatusNotModified was returned.
2148func (c *ProjectsLocationsEnvironmentsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2149	gensupport.SetOptions(c.urlParams_, opts...)
2150	res, err := c.doRequest("json")
2151	if res != nil && res.StatusCode == http.StatusNotModified {
2152		if res.Body != nil {
2153			res.Body.Close()
2154		}
2155		return nil, &googleapi.Error{
2156			Code:   res.StatusCode,
2157			Header: res.Header,
2158		}
2159	}
2160	if err != nil {
2161		return nil, err
2162	}
2163	defer googleapi.CloseBody(res)
2164	if err := googleapi.CheckResponse(res); err != nil {
2165		return nil, err
2166	}
2167	ret := &Operation{
2168		ServerResponse: googleapi.ServerResponse{
2169			Header:         res.Header,
2170			HTTPStatusCode: res.StatusCode,
2171		},
2172	}
2173	target := &ret
2174	if err := gensupport.DecodeResponse(target, res); err != nil {
2175		return nil, err
2176	}
2177	return ret, nil
2178	// {
2179	//   "description": "Creates a new Environment.",
2180	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments",
2181	//   "httpMethod": "POST",
2182	//   "id": "notebooks.projects.locations.environments.create",
2183	//   "parameterOrder": [
2184	//     "parent"
2185	//   ],
2186	//   "parameters": {
2187	//     "environmentId": {
2188	//       "description": "Required. User-defined unique ID of this environment. The `environment_id` must be 1 to 63 characters long and contain only lowercase letters, numeric characters, and dashes. The first character must be a lowercase letter and the last character cannot be a dash.",
2189	//       "location": "query",
2190	//       "type": "string"
2191	//     },
2192	//     "parent": {
2193	//       "description": "Required. Format: `projects/{project_id}/locations/{location}`",
2194	//       "location": "path",
2195	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
2196	//       "required": true,
2197	//       "type": "string"
2198	//     }
2199	//   },
2200	//   "path": "v1/{+parent}/environments",
2201	//   "request": {
2202	//     "$ref": "Environment"
2203	//   },
2204	//   "response": {
2205	//     "$ref": "Operation"
2206	//   },
2207	//   "scopes": [
2208	//     "https://www.googleapis.com/auth/cloud-platform"
2209	//   ]
2210	// }
2211
2212}
2213
2214// method id "notebooks.projects.locations.environments.delete":
2215
2216type ProjectsLocationsEnvironmentsDeleteCall struct {
2217	s          *Service
2218	name       string
2219	urlParams_ gensupport.URLParams
2220	ctx_       context.Context
2221	header_    http.Header
2222}
2223
2224// Delete: Deletes a single Environment.
2225func (r *ProjectsLocationsEnvironmentsService) Delete(name string) *ProjectsLocationsEnvironmentsDeleteCall {
2226	c := &ProjectsLocationsEnvironmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2227	c.name = name
2228	return c
2229}
2230
2231// Fields allows partial responses to be retrieved. See
2232// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2233// for more information.
2234func (c *ProjectsLocationsEnvironmentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsDeleteCall {
2235	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2236	return c
2237}
2238
2239// Context sets the context to be used in this call's Do method. Any
2240// pending HTTP request will be aborted if the provided context is
2241// canceled.
2242func (c *ProjectsLocationsEnvironmentsDeleteCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsDeleteCall {
2243	c.ctx_ = ctx
2244	return c
2245}
2246
2247// Header returns an http.Header that can be modified by the caller to
2248// add HTTP headers to the request.
2249func (c *ProjectsLocationsEnvironmentsDeleteCall) Header() http.Header {
2250	if c.header_ == nil {
2251		c.header_ = make(http.Header)
2252	}
2253	return c.header_
2254}
2255
2256func (c *ProjectsLocationsEnvironmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
2257	reqHeaders := make(http.Header)
2258	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
2259	for k, v := range c.header_ {
2260		reqHeaders[k] = v
2261	}
2262	reqHeaders.Set("User-Agent", c.s.userAgent())
2263	var body io.Reader = nil
2264	c.urlParams_.Set("alt", alt)
2265	c.urlParams_.Set("prettyPrint", "false")
2266	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2267	urls += "?" + c.urlParams_.Encode()
2268	req, err := http.NewRequest("DELETE", urls, body)
2269	if err != nil {
2270		return nil, err
2271	}
2272	req.Header = reqHeaders
2273	googleapi.Expand(req.URL, map[string]string{
2274		"name": c.name,
2275	})
2276	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2277}
2278
2279// Do executes the "notebooks.projects.locations.environments.delete" call.
2280// Exactly one of *Operation or error will be non-nil. Any non-2xx
2281// status code is an error. Response headers are in either
2282// *Operation.ServerResponse.Header or (if a response was returned at
2283// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
2284// to check whether the returned error was because
2285// http.StatusNotModified was returned.
2286func (c *ProjectsLocationsEnvironmentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2287	gensupport.SetOptions(c.urlParams_, opts...)
2288	res, err := c.doRequest("json")
2289	if res != nil && res.StatusCode == http.StatusNotModified {
2290		if res.Body != nil {
2291			res.Body.Close()
2292		}
2293		return nil, &googleapi.Error{
2294			Code:   res.StatusCode,
2295			Header: res.Header,
2296		}
2297	}
2298	if err != nil {
2299		return nil, err
2300	}
2301	defer googleapi.CloseBody(res)
2302	if err := googleapi.CheckResponse(res); err != nil {
2303		return nil, err
2304	}
2305	ret := &Operation{
2306		ServerResponse: googleapi.ServerResponse{
2307			Header:         res.Header,
2308			HTTPStatusCode: res.StatusCode,
2309		},
2310	}
2311	target := &ret
2312	if err := gensupport.DecodeResponse(target, res); err != nil {
2313		return nil, err
2314	}
2315	return ret, nil
2316	// {
2317	//   "description": "Deletes a single Environment.",
2318	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}",
2319	//   "httpMethod": "DELETE",
2320	//   "id": "notebooks.projects.locations.environments.delete",
2321	//   "parameterOrder": [
2322	//     "name"
2323	//   ],
2324	//   "parameters": {
2325	//     "name": {
2326	//       "description": "Required. Format: `projects/{project_id}/locations/{location}/environments/{environment_id}`",
2327	//       "location": "path",
2328	//       "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$",
2329	//       "required": true,
2330	//       "type": "string"
2331	//     }
2332	//   },
2333	//   "path": "v1/{+name}",
2334	//   "response": {
2335	//     "$ref": "Operation"
2336	//   },
2337	//   "scopes": [
2338	//     "https://www.googleapis.com/auth/cloud-platform"
2339	//   ]
2340	// }
2341
2342}
2343
2344// method id "notebooks.projects.locations.environments.get":
2345
2346type ProjectsLocationsEnvironmentsGetCall struct {
2347	s            *Service
2348	name         string
2349	urlParams_   gensupport.URLParams
2350	ifNoneMatch_ string
2351	ctx_         context.Context
2352	header_      http.Header
2353}
2354
2355// Get: Gets details of a single Environment.
2356func (r *ProjectsLocationsEnvironmentsService) Get(name string) *ProjectsLocationsEnvironmentsGetCall {
2357	c := &ProjectsLocationsEnvironmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2358	c.name = name
2359	return c
2360}
2361
2362// Fields allows partial responses to be retrieved. See
2363// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2364// for more information.
2365func (c *ProjectsLocationsEnvironmentsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsGetCall {
2366	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2367	return c
2368}
2369
2370// IfNoneMatch sets the optional parameter which makes the operation
2371// fail if the object's ETag matches the given value. This is useful for
2372// getting updates only after the object has changed since the last
2373// request. Use googleapi.IsNotModified to check whether the response
2374// error from Do is the result of In-None-Match.
2375func (c *ProjectsLocationsEnvironmentsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsEnvironmentsGetCall {
2376	c.ifNoneMatch_ = entityTag
2377	return c
2378}
2379
2380// Context sets the context to be used in this call's Do method. Any
2381// pending HTTP request will be aborted if the provided context is
2382// canceled.
2383func (c *ProjectsLocationsEnvironmentsGetCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsGetCall {
2384	c.ctx_ = ctx
2385	return c
2386}
2387
2388// Header returns an http.Header that can be modified by the caller to
2389// add HTTP headers to the request.
2390func (c *ProjectsLocationsEnvironmentsGetCall) Header() http.Header {
2391	if c.header_ == nil {
2392		c.header_ = make(http.Header)
2393	}
2394	return c.header_
2395}
2396
2397func (c *ProjectsLocationsEnvironmentsGetCall) doRequest(alt string) (*http.Response, error) {
2398	reqHeaders := make(http.Header)
2399	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
2400	for k, v := range c.header_ {
2401		reqHeaders[k] = v
2402	}
2403	reqHeaders.Set("User-Agent", c.s.userAgent())
2404	if c.ifNoneMatch_ != "" {
2405		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2406	}
2407	var body io.Reader = nil
2408	c.urlParams_.Set("alt", alt)
2409	c.urlParams_.Set("prettyPrint", "false")
2410	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2411	urls += "?" + c.urlParams_.Encode()
2412	req, err := http.NewRequest("GET", urls, body)
2413	if err != nil {
2414		return nil, err
2415	}
2416	req.Header = reqHeaders
2417	googleapi.Expand(req.URL, map[string]string{
2418		"name": c.name,
2419	})
2420	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2421}
2422
2423// Do executes the "notebooks.projects.locations.environments.get" call.
2424// Exactly one of *Environment or error will be non-nil. Any non-2xx
2425// status code is an error. Response headers are in either
2426// *Environment.ServerResponse.Header or (if a response was returned at
2427// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
2428// to check whether the returned error was because
2429// http.StatusNotModified was returned.
2430func (c *ProjectsLocationsEnvironmentsGetCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
2431	gensupport.SetOptions(c.urlParams_, opts...)
2432	res, err := c.doRequest("json")
2433	if res != nil && res.StatusCode == http.StatusNotModified {
2434		if res.Body != nil {
2435			res.Body.Close()
2436		}
2437		return nil, &googleapi.Error{
2438			Code:   res.StatusCode,
2439			Header: res.Header,
2440		}
2441	}
2442	if err != nil {
2443		return nil, err
2444	}
2445	defer googleapi.CloseBody(res)
2446	if err := googleapi.CheckResponse(res); err != nil {
2447		return nil, err
2448	}
2449	ret := &Environment{
2450		ServerResponse: googleapi.ServerResponse{
2451			Header:         res.Header,
2452			HTTPStatusCode: res.StatusCode,
2453		},
2454	}
2455	target := &ret
2456	if err := gensupport.DecodeResponse(target, res); err != nil {
2457		return nil, err
2458	}
2459	return ret, nil
2460	// {
2461	//   "description": "Gets details of a single Environment.",
2462	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments/{environmentsId}",
2463	//   "httpMethod": "GET",
2464	//   "id": "notebooks.projects.locations.environments.get",
2465	//   "parameterOrder": [
2466	//     "name"
2467	//   ],
2468	//   "parameters": {
2469	//     "name": {
2470	//       "description": "Required. Format: `projects/{project_id}/locations/{location}/environments/{environment_id}`",
2471	//       "location": "path",
2472	//       "pattern": "^projects/[^/]+/locations/[^/]+/environments/[^/]+$",
2473	//       "required": true,
2474	//       "type": "string"
2475	//     }
2476	//   },
2477	//   "path": "v1/{+name}",
2478	//   "response": {
2479	//     "$ref": "Environment"
2480	//   },
2481	//   "scopes": [
2482	//     "https://www.googleapis.com/auth/cloud-platform"
2483	//   ]
2484	// }
2485
2486}
2487
2488// method id "notebooks.projects.locations.environments.list":
2489
2490type ProjectsLocationsEnvironmentsListCall struct {
2491	s            *Service
2492	parent       string
2493	urlParams_   gensupport.URLParams
2494	ifNoneMatch_ string
2495	ctx_         context.Context
2496	header_      http.Header
2497}
2498
2499// List: Lists environments in a project.
2500func (r *ProjectsLocationsEnvironmentsService) List(parent string) *ProjectsLocationsEnvironmentsListCall {
2501	c := &ProjectsLocationsEnvironmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2502	c.parent = parent
2503	return c
2504}
2505
2506// PageSize sets the optional parameter "pageSize": Maximum return size
2507// of the list call.
2508func (c *ProjectsLocationsEnvironmentsListCall) PageSize(pageSize int64) *ProjectsLocationsEnvironmentsListCall {
2509	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2510	return c
2511}
2512
2513// PageToken sets the optional parameter "pageToken": A previous
2514// returned page token that can be used to continue listing from the
2515// last result.
2516func (c *ProjectsLocationsEnvironmentsListCall) PageToken(pageToken string) *ProjectsLocationsEnvironmentsListCall {
2517	c.urlParams_.Set("pageToken", pageToken)
2518	return c
2519}
2520
2521// Fields allows partial responses to be retrieved. See
2522// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2523// for more information.
2524func (c *ProjectsLocationsEnvironmentsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsEnvironmentsListCall {
2525	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2526	return c
2527}
2528
2529// IfNoneMatch sets the optional parameter which makes the operation
2530// fail if the object's ETag matches the given value. This is useful for
2531// getting updates only after the object has changed since the last
2532// request. Use googleapi.IsNotModified to check whether the response
2533// error from Do is the result of In-None-Match.
2534func (c *ProjectsLocationsEnvironmentsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsEnvironmentsListCall {
2535	c.ifNoneMatch_ = entityTag
2536	return c
2537}
2538
2539// Context sets the context to be used in this call's Do method. Any
2540// pending HTTP request will be aborted if the provided context is
2541// canceled.
2542func (c *ProjectsLocationsEnvironmentsListCall) Context(ctx context.Context) *ProjectsLocationsEnvironmentsListCall {
2543	c.ctx_ = ctx
2544	return c
2545}
2546
2547// Header returns an http.Header that can be modified by the caller to
2548// add HTTP headers to the request.
2549func (c *ProjectsLocationsEnvironmentsListCall) Header() http.Header {
2550	if c.header_ == nil {
2551		c.header_ = make(http.Header)
2552	}
2553	return c.header_
2554}
2555
2556func (c *ProjectsLocationsEnvironmentsListCall) doRequest(alt string) (*http.Response, error) {
2557	reqHeaders := make(http.Header)
2558	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
2559	for k, v := range c.header_ {
2560		reqHeaders[k] = v
2561	}
2562	reqHeaders.Set("User-Agent", c.s.userAgent())
2563	if c.ifNoneMatch_ != "" {
2564		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2565	}
2566	var body io.Reader = nil
2567	c.urlParams_.Set("alt", alt)
2568	c.urlParams_.Set("prettyPrint", "false")
2569	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/environments")
2570	urls += "?" + c.urlParams_.Encode()
2571	req, err := http.NewRequest("GET", urls, body)
2572	if err != nil {
2573		return nil, err
2574	}
2575	req.Header = reqHeaders
2576	googleapi.Expand(req.URL, map[string]string{
2577		"parent": c.parent,
2578	})
2579	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2580}
2581
2582// Do executes the "notebooks.projects.locations.environments.list" call.
2583// Exactly one of *ListEnvironmentsResponse or error will be non-nil.
2584// Any non-2xx status code is an error. Response headers are in either
2585// *ListEnvironmentsResponse.ServerResponse.Header or (if a response was
2586// returned at all) in error.(*googleapi.Error).Header. Use
2587// googleapi.IsNotModified to check whether the returned error was
2588// because http.StatusNotModified was returned.
2589func (c *ProjectsLocationsEnvironmentsListCall) Do(opts ...googleapi.CallOption) (*ListEnvironmentsResponse, error) {
2590	gensupport.SetOptions(c.urlParams_, opts...)
2591	res, err := c.doRequest("json")
2592	if res != nil && res.StatusCode == http.StatusNotModified {
2593		if res.Body != nil {
2594			res.Body.Close()
2595		}
2596		return nil, &googleapi.Error{
2597			Code:   res.StatusCode,
2598			Header: res.Header,
2599		}
2600	}
2601	if err != nil {
2602		return nil, err
2603	}
2604	defer googleapi.CloseBody(res)
2605	if err := googleapi.CheckResponse(res); err != nil {
2606		return nil, err
2607	}
2608	ret := &ListEnvironmentsResponse{
2609		ServerResponse: googleapi.ServerResponse{
2610			Header:         res.Header,
2611			HTTPStatusCode: res.StatusCode,
2612		},
2613	}
2614	target := &ret
2615	if err := gensupport.DecodeResponse(target, res); err != nil {
2616		return nil, err
2617	}
2618	return ret, nil
2619	// {
2620	//   "description": "Lists environments in a project.",
2621	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/environments",
2622	//   "httpMethod": "GET",
2623	//   "id": "notebooks.projects.locations.environments.list",
2624	//   "parameterOrder": [
2625	//     "parent"
2626	//   ],
2627	//   "parameters": {
2628	//     "pageSize": {
2629	//       "description": "Maximum return size of the list call.",
2630	//       "format": "int32",
2631	//       "location": "query",
2632	//       "type": "integer"
2633	//     },
2634	//     "pageToken": {
2635	//       "description": "A previous returned page token that can be used to continue listing from the last result.",
2636	//       "location": "query",
2637	//       "type": "string"
2638	//     },
2639	//     "parent": {
2640	//       "description": "Required. Format: `projects/{project_id}/locations/{location}`",
2641	//       "location": "path",
2642	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
2643	//       "required": true,
2644	//       "type": "string"
2645	//     }
2646	//   },
2647	//   "path": "v1/{+parent}/environments",
2648	//   "response": {
2649	//     "$ref": "ListEnvironmentsResponse"
2650	//   },
2651	//   "scopes": [
2652	//     "https://www.googleapis.com/auth/cloud-platform"
2653	//   ]
2654	// }
2655
2656}
2657
2658// Pages invokes f for each page of results.
2659// A non-nil error returned from f will halt the iteration.
2660// The provided context supersedes any context provided to the Context method.
2661func (c *ProjectsLocationsEnvironmentsListCall) Pages(ctx context.Context, f func(*ListEnvironmentsResponse) error) error {
2662	c.ctx_ = ctx
2663	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
2664	for {
2665		x, err := c.Do()
2666		if err != nil {
2667			return err
2668		}
2669		if err := f(x); err != nil {
2670			return err
2671		}
2672		if x.NextPageToken == "" {
2673			return nil
2674		}
2675		c.PageToken(x.NextPageToken)
2676	}
2677}
2678
2679// method id "notebooks.projects.locations.instances.create":
2680
2681type ProjectsLocationsInstancesCreateCall struct {
2682	s          *Service
2683	parent     string
2684	instance   *Instance
2685	urlParams_ gensupport.URLParams
2686	ctx_       context.Context
2687	header_    http.Header
2688}
2689
2690// Create: Creates a new Instance in a given project and location.
2691func (r *ProjectsLocationsInstancesService) Create(parent string, instance *Instance) *ProjectsLocationsInstancesCreateCall {
2692	c := &ProjectsLocationsInstancesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2693	c.parent = parent
2694	c.instance = instance
2695	return c
2696}
2697
2698// InstanceId sets the optional parameter "instanceId": Required.
2699// User-defined unique ID of this instance.
2700func (c *ProjectsLocationsInstancesCreateCall) InstanceId(instanceId string) *ProjectsLocationsInstancesCreateCall {
2701	c.urlParams_.Set("instanceId", instanceId)
2702	return c
2703}
2704
2705// Fields allows partial responses to be retrieved. See
2706// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2707// for more information.
2708func (c *ProjectsLocationsInstancesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesCreateCall {
2709	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2710	return c
2711}
2712
2713// Context sets the context to be used in this call's Do method. Any
2714// pending HTTP request will be aborted if the provided context is
2715// canceled.
2716func (c *ProjectsLocationsInstancesCreateCall) Context(ctx context.Context) *ProjectsLocationsInstancesCreateCall {
2717	c.ctx_ = ctx
2718	return c
2719}
2720
2721// Header returns an http.Header that can be modified by the caller to
2722// add HTTP headers to the request.
2723func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header {
2724	if c.header_ == nil {
2725		c.header_ = make(http.Header)
2726	}
2727	return c.header_
2728}
2729
2730func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) {
2731	reqHeaders := make(http.Header)
2732	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
2733	for k, v := range c.header_ {
2734		reqHeaders[k] = v
2735	}
2736	reqHeaders.Set("User-Agent", c.s.userAgent())
2737	var body io.Reader = nil
2738	body, err := googleapi.WithoutDataWrapper.JSONReader(c.instance)
2739	if err != nil {
2740		return nil, err
2741	}
2742	reqHeaders.Set("Content-Type", "application/json")
2743	c.urlParams_.Set("alt", alt)
2744	c.urlParams_.Set("prettyPrint", "false")
2745	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances")
2746	urls += "?" + c.urlParams_.Encode()
2747	req, err := http.NewRequest("POST", urls, body)
2748	if err != nil {
2749		return nil, err
2750	}
2751	req.Header = reqHeaders
2752	googleapi.Expand(req.URL, map[string]string{
2753		"parent": c.parent,
2754	})
2755	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2756}
2757
2758// Do executes the "notebooks.projects.locations.instances.create" call.
2759// Exactly one of *Operation or error will be non-nil. Any non-2xx
2760// status code is an error. Response headers are in either
2761// *Operation.ServerResponse.Header or (if a response was returned at
2762// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
2763// to check whether the returned error was because
2764// http.StatusNotModified was returned.
2765func (c *ProjectsLocationsInstancesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2766	gensupport.SetOptions(c.urlParams_, opts...)
2767	res, err := c.doRequest("json")
2768	if res != nil && res.StatusCode == http.StatusNotModified {
2769		if res.Body != nil {
2770			res.Body.Close()
2771		}
2772		return nil, &googleapi.Error{
2773			Code:   res.StatusCode,
2774			Header: res.Header,
2775		}
2776	}
2777	if err != nil {
2778		return nil, err
2779	}
2780	defer googleapi.CloseBody(res)
2781	if err := googleapi.CheckResponse(res); err != nil {
2782		return nil, err
2783	}
2784	ret := &Operation{
2785		ServerResponse: googleapi.ServerResponse{
2786			Header:         res.Header,
2787			HTTPStatusCode: res.StatusCode,
2788		},
2789	}
2790	target := &ret
2791	if err := gensupport.DecodeResponse(target, res); err != nil {
2792		return nil, err
2793	}
2794	return ret, nil
2795	// {
2796	//   "description": "Creates a new Instance in a given project and location.",
2797	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances",
2798	//   "httpMethod": "POST",
2799	//   "id": "notebooks.projects.locations.instances.create",
2800	//   "parameterOrder": [
2801	//     "parent"
2802	//   ],
2803	//   "parameters": {
2804	//     "instanceId": {
2805	//       "description": "Required. User-defined unique ID of this instance.",
2806	//       "location": "query",
2807	//       "type": "string"
2808	//     },
2809	//     "parent": {
2810	//       "description": "Required. Format: `parent=projects/{project_id}/locations/{location}`",
2811	//       "location": "path",
2812	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
2813	//       "required": true,
2814	//       "type": "string"
2815	//     }
2816	//   },
2817	//   "path": "v1/{+parent}/instances",
2818	//   "request": {
2819	//     "$ref": "Instance"
2820	//   },
2821	//   "response": {
2822	//     "$ref": "Operation"
2823	//   },
2824	//   "scopes": [
2825	//     "https://www.googleapis.com/auth/cloud-platform"
2826	//   ]
2827	// }
2828
2829}
2830
2831// method id "notebooks.projects.locations.instances.delete":
2832
2833type ProjectsLocationsInstancesDeleteCall struct {
2834	s          *Service
2835	name       string
2836	urlParams_ gensupport.URLParams
2837	ctx_       context.Context
2838	header_    http.Header
2839}
2840
2841// Delete: Deletes a single Instance.
2842func (r *ProjectsLocationsInstancesService) Delete(name string) *ProjectsLocationsInstancesDeleteCall {
2843	c := &ProjectsLocationsInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2844	c.name = name
2845	return c
2846}
2847
2848// Fields allows partial responses to be retrieved. See
2849// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2850// for more information.
2851func (c *ProjectsLocationsInstancesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDeleteCall {
2852	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2853	return c
2854}
2855
2856// Context sets the context to be used in this call's Do method. Any
2857// pending HTTP request will be aborted if the provided context is
2858// canceled.
2859func (c *ProjectsLocationsInstancesDeleteCall) Context(ctx context.Context) *ProjectsLocationsInstancesDeleteCall {
2860	c.ctx_ = ctx
2861	return c
2862}
2863
2864// Header returns an http.Header that can be modified by the caller to
2865// add HTTP headers to the request.
2866func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header {
2867	if c.header_ == nil {
2868		c.header_ = make(http.Header)
2869	}
2870	return c.header_
2871}
2872
2873func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
2874	reqHeaders := make(http.Header)
2875	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
2876	for k, v := range c.header_ {
2877		reqHeaders[k] = v
2878	}
2879	reqHeaders.Set("User-Agent", c.s.userAgent())
2880	var body io.Reader = nil
2881	c.urlParams_.Set("alt", alt)
2882	c.urlParams_.Set("prettyPrint", "false")
2883	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2884	urls += "?" + c.urlParams_.Encode()
2885	req, err := http.NewRequest("DELETE", urls, body)
2886	if err != nil {
2887		return nil, err
2888	}
2889	req.Header = reqHeaders
2890	googleapi.Expand(req.URL, map[string]string{
2891		"name": c.name,
2892	})
2893	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2894}
2895
2896// Do executes the "notebooks.projects.locations.instances.delete" call.
2897// Exactly one of *Operation or error will be non-nil. Any non-2xx
2898// status code is an error. Response headers are in either
2899// *Operation.ServerResponse.Header or (if a response was returned at
2900// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
2901// to check whether the returned error was because
2902// http.StatusNotModified was returned.
2903func (c *ProjectsLocationsInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
2904	gensupport.SetOptions(c.urlParams_, opts...)
2905	res, err := c.doRequest("json")
2906	if res != nil && res.StatusCode == http.StatusNotModified {
2907		if res.Body != nil {
2908			res.Body.Close()
2909		}
2910		return nil, &googleapi.Error{
2911			Code:   res.StatusCode,
2912			Header: res.Header,
2913		}
2914	}
2915	if err != nil {
2916		return nil, err
2917	}
2918	defer googleapi.CloseBody(res)
2919	if err := googleapi.CheckResponse(res); err != nil {
2920		return nil, err
2921	}
2922	ret := &Operation{
2923		ServerResponse: googleapi.ServerResponse{
2924			Header:         res.Header,
2925			HTTPStatusCode: res.StatusCode,
2926		},
2927	}
2928	target := &ret
2929	if err := gensupport.DecodeResponse(target, res); err != nil {
2930		return nil, err
2931	}
2932	return ret, nil
2933	// {
2934	//   "description": "Deletes a single Instance.",
2935	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}",
2936	//   "httpMethod": "DELETE",
2937	//   "id": "notebooks.projects.locations.instances.delete",
2938	//   "parameterOrder": [
2939	//     "name"
2940	//   ],
2941	//   "parameters": {
2942	//     "name": {
2943	//       "description": "Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`",
2944	//       "location": "path",
2945	//       "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
2946	//       "required": true,
2947	//       "type": "string"
2948	//     }
2949	//   },
2950	//   "path": "v1/{+name}",
2951	//   "response": {
2952	//     "$ref": "Operation"
2953	//   },
2954	//   "scopes": [
2955	//     "https://www.googleapis.com/auth/cloud-platform"
2956	//   ]
2957	// }
2958
2959}
2960
2961// method id "notebooks.projects.locations.instances.get":
2962
2963type ProjectsLocationsInstancesGetCall struct {
2964	s            *Service
2965	name         string
2966	urlParams_   gensupport.URLParams
2967	ifNoneMatch_ string
2968	ctx_         context.Context
2969	header_      http.Header
2970}
2971
2972// Get: Gets details of a single Instance.
2973func (r *ProjectsLocationsInstancesService) Get(name string) *ProjectsLocationsInstancesGetCall {
2974	c := &ProjectsLocationsInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2975	c.name = name
2976	return c
2977}
2978
2979// Fields allows partial responses to be retrieved. See
2980// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2981// for more information.
2982func (c *ProjectsLocationsInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetCall {
2983	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2984	return c
2985}
2986
2987// IfNoneMatch sets the optional parameter which makes the operation
2988// fail if the object's ETag matches the given value. This is useful for
2989// getting updates only after the object has changed since the last
2990// request. Use googleapi.IsNotModified to check whether the response
2991// error from Do is the result of In-None-Match.
2992func (c *ProjectsLocationsInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetCall {
2993	c.ifNoneMatch_ = entityTag
2994	return c
2995}
2996
2997// Context sets the context to be used in this call's Do method. Any
2998// pending HTTP request will be aborted if the provided context is
2999// canceled.
3000func (c *ProjectsLocationsInstancesGetCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetCall {
3001	c.ctx_ = ctx
3002	return c
3003}
3004
3005// Header returns an http.Header that can be modified by the caller to
3006// add HTTP headers to the request.
3007func (c *ProjectsLocationsInstancesGetCall) Header() http.Header {
3008	if c.header_ == nil {
3009		c.header_ = make(http.Header)
3010	}
3011	return c.header_
3012}
3013
3014func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Response, error) {
3015	reqHeaders := make(http.Header)
3016	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
3017	for k, v := range c.header_ {
3018		reqHeaders[k] = v
3019	}
3020	reqHeaders.Set("User-Agent", c.s.userAgent())
3021	if c.ifNoneMatch_ != "" {
3022		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3023	}
3024	var body io.Reader = nil
3025	c.urlParams_.Set("alt", alt)
3026	c.urlParams_.Set("prettyPrint", "false")
3027	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3028	urls += "?" + c.urlParams_.Encode()
3029	req, err := http.NewRequest("GET", urls, body)
3030	if err != nil {
3031		return nil, err
3032	}
3033	req.Header = reqHeaders
3034	googleapi.Expand(req.URL, map[string]string{
3035		"name": c.name,
3036	})
3037	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3038}
3039
3040// Do executes the "notebooks.projects.locations.instances.get" call.
3041// Exactly one of *Instance or error will be non-nil. Any non-2xx status
3042// code is an error. Response headers are in either
3043// *Instance.ServerResponse.Header or (if a response was returned at
3044// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3045// to check whether the returned error was because
3046// http.StatusNotModified was returned.
3047func (c *ProjectsLocationsInstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, 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, &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, err
3065	}
3066	ret := &Instance{
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	//   "description": "Gets details of a single Instance.",
3079	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}",
3080	//   "httpMethod": "GET",
3081	//   "id": "notebooks.projects.locations.instances.get",
3082	//   "parameterOrder": [
3083	//     "name"
3084	//   ],
3085	//   "parameters": {
3086	//     "name": {
3087	//       "description": "Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`",
3088	//       "location": "path",
3089	//       "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
3090	//       "required": true,
3091	//       "type": "string"
3092	//     }
3093	//   },
3094	//   "path": "v1/{+name}",
3095	//   "response": {
3096	//     "$ref": "Instance"
3097	//   },
3098	//   "scopes": [
3099	//     "https://www.googleapis.com/auth/cloud-platform"
3100	//   ]
3101	// }
3102
3103}
3104
3105// method id "notebooks.projects.locations.instances.getIamPolicy":
3106
3107type ProjectsLocationsInstancesGetIamPolicyCall struct {
3108	s            *Service
3109	resource     string
3110	urlParams_   gensupport.URLParams
3111	ifNoneMatch_ string
3112	ctx_         context.Context
3113	header_      http.Header
3114}
3115
3116// GetIamPolicy: Gets the access control policy for a resource. Returns
3117// an empty policy if the resource exists and does not have a policy
3118// set.
3119func (r *ProjectsLocationsInstancesService) GetIamPolicy(resource string) *ProjectsLocationsInstancesGetIamPolicyCall {
3120	c := &ProjectsLocationsInstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3121	c.resource = resource
3122	return c
3123}
3124
3125// OptionsRequestedPolicyVersion sets the optional parameter
3126// "options.requestedPolicyVersion": The policy format version to be
3127// returned. Valid values are 0, 1, and 3. Requests specifying an
3128// invalid value will be rejected. Requests for policies with any
3129// conditional bindings must specify version 3. Policies without any
3130// conditional bindings may specify any valid value or leave the field
3131// unset. To learn which resources support conditions in their IAM
3132// policies, see the [IAM
3133// documentation](https://cloud.google.com/iam/help/conditions/resource-p
3134// olicies).
3135func (c *ProjectsLocationsInstancesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsInstancesGetIamPolicyCall {
3136	c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
3137	return c
3138}
3139
3140// Fields allows partial responses to be retrieved. See
3141// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3142// for more information.
3143func (c *ProjectsLocationsInstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetIamPolicyCall {
3144	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3145	return c
3146}
3147
3148// IfNoneMatch sets the optional parameter which makes the operation
3149// fail if the object's ETag matches the given value. This is useful for
3150// getting updates only after the object has changed since the last
3151// request. Use googleapi.IsNotModified to check whether the response
3152// error from Do is the result of In-None-Match.
3153func (c *ProjectsLocationsInstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetIamPolicyCall {
3154	c.ifNoneMatch_ = entityTag
3155	return c
3156}
3157
3158// Context sets the context to be used in this call's Do method. Any
3159// pending HTTP request will be aborted if the provided context is
3160// canceled.
3161func (c *ProjectsLocationsInstancesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetIamPolicyCall {
3162	c.ctx_ = ctx
3163	return c
3164}
3165
3166// Header returns an http.Header that can be modified by the caller to
3167// add HTTP headers to the request.
3168func (c *ProjectsLocationsInstancesGetIamPolicyCall) Header() http.Header {
3169	if c.header_ == nil {
3170		c.header_ = make(http.Header)
3171	}
3172	return c.header_
3173}
3174
3175func (c *ProjectsLocationsInstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3176	reqHeaders := make(http.Header)
3177	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
3178	for k, v := range c.header_ {
3179		reqHeaders[k] = v
3180	}
3181	reqHeaders.Set("User-Agent", c.s.userAgent())
3182	if c.ifNoneMatch_ != "" {
3183		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3184	}
3185	var body io.Reader = nil
3186	c.urlParams_.Set("alt", alt)
3187	c.urlParams_.Set("prettyPrint", "false")
3188	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
3189	urls += "?" + c.urlParams_.Encode()
3190	req, err := http.NewRequest("GET", urls, body)
3191	if err != nil {
3192		return nil, err
3193	}
3194	req.Header = reqHeaders
3195	googleapi.Expand(req.URL, map[string]string{
3196		"resource": c.resource,
3197	})
3198	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3199}
3200
3201// Do executes the "notebooks.projects.locations.instances.getIamPolicy" call.
3202// Exactly one of *Policy or error will be non-nil. Any non-2xx status
3203// code is an error. Response headers are in either
3204// *Policy.ServerResponse.Header or (if a response was returned at all)
3205// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3206// check whether the returned error was because http.StatusNotModified
3207// was returned.
3208func (c *ProjectsLocationsInstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3209	gensupport.SetOptions(c.urlParams_, opts...)
3210	res, err := c.doRequest("json")
3211	if res != nil && res.StatusCode == http.StatusNotModified {
3212		if res.Body != nil {
3213			res.Body.Close()
3214		}
3215		return nil, &googleapi.Error{
3216			Code:   res.StatusCode,
3217			Header: res.Header,
3218		}
3219	}
3220	if err != nil {
3221		return nil, err
3222	}
3223	defer googleapi.CloseBody(res)
3224	if err := googleapi.CheckResponse(res); err != nil {
3225		return nil, err
3226	}
3227	ret := &Policy{
3228		ServerResponse: googleapi.ServerResponse{
3229			Header:         res.Header,
3230			HTTPStatusCode: res.StatusCode,
3231		},
3232	}
3233	target := &ret
3234	if err := gensupport.DecodeResponse(target, res); err != nil {
3235		return nil, err
3236	}
3237	return ret, nil
3238	// {
3239	//   "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
3240	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:getIamPolicy",
3241	//   "httpMethod": "GET",
3242	//   "id": "notebooks.projects.locations.instances.getIamPolicy",
3243	//   "parameterOrder": [
3244	//     "resource"
3245	//   ],
3246	//   "parameters": {
3247	//     "options.requestedPolicyVersion": {
3248	//       "description": "Optional. The policy format version to be returned. Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected. Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).",
3249	//       "format": "int32",
3250	//       "location": "query",
3251	//       "type": "integer"
3252	//     },
3253	//     "resource": {
3254	//       "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
3255	//       "location": "path",
3256	//       "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
3257	//       "required": true,
3258	//       "type": "string"
3259	//     }
3260	//   },
3261	//   "path": "v1/{+resource}:getIamPolicy",
3262	//   "response": {
3263	//     "$ref": "Policy"
3264	//   },
3265	//   "scopes": [
3266	//     "https://www.googleapis.com/auth/cloud-platform"
3267	//   ]
3268	// }
3269
3270}
3271
3272// method id "notebooks.projects.locations.instances.isUpgradeable":
3273
3274type ProjectsLocationsInstancesIsUpgradeableCall struct {
3275	s                *Service
3276	notebookInstance string
3277	urlParams_       gensupport.URLParams
3278	ifNoneMatch_     string
3279	ctx_             context.Context
3280	header_          http.Header
3281}
3282
3283// IsUpgradeable: Check if a notebook instance is upgradable.
3284func (r *ProjectsLocationsInstancesService) IsUpgradeable(notebookInstance string) *ProjectsLocationsInstancesIsUpgradeableCall {
3285	c := &ProjectsLocationsInstancesIsUpgradeableCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3286	c.notebookInstance = notebookInstance
3287	return c
3288}
3289
3290// Fields allows partial responses to be retrieved. See
3291// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3292// for more information.
3293func (c *ProjectsLocationsInstancesIsUpgradeableCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesIsUpgradeableCall {
3294	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3295	return c
3296}
3297
3298// IfNoneMatch sets the optional parameter which makes the operation
3299// fail if the object's ETag matches the given value. This is useful for
3300// getting updates only after the object has changed since the last
3301// request. Use googleapi.IsNotModified to check whether the response
3302// error from Do is the result of In-None-Match.
3303func (c *ProjectsLocationsInstancesIsUpgradeableCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesIsUpgradeableCall {
3304	c.ifNoneMatch_ = entityTag
3305	return c
3306}
3307
3308// Context sets the context to be used in this call's Do method. Any
3309// pending HTTP request will be aborted if the provided context is
3310// canceled.
3311func (c *ProjectsLocationsInstancesIsUpgradeableCall) Context(ctx context.Context) *ProjectsLocationsInstancesIsUpgradeableCall {
3312	c.ctx_ = ctx
3313	return c
3314}
3315
3316// Header returns an http.Header that can be modified by the caller to
3317// add HTTP headers to the request.
3318func (c *ProjectsLocationsInstancesIsUpgradeableCall) Header() http.Header {
3319	if c.header_ == nil {
3320		c.header_ = make(http.Header)
3321	}
3322	return c.header_
3323}
3324
3325func (c *ProjectsLocationsInstancesIsUpgradeableCall) doRequest(alt string) (*http.Response, error) {
3326	reqHeaders := make(http.Header)
3327	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
3328	for k, v := range c.header_ {
3329		reqHeaders[k] = v
3330	}
3331	reqHeaders.Set("User-Agent", c.s.userAgent())
3332	if c.ifNoneMatch_ != "" {
3333		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3334	}
3335	var body io.Reader = nil
3336	c.urlParams_.Set("alt", alt)
3337	c.urlParams_.Set("prettyPrint", "false")
3338	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+notebookInstance}:isUpgradeable")
3339	urls += "?" + c.urlParams_.Encode()
3340	req, err := http.NewRequest("GET", urls, body)
3341	if err != nil {
3342		return nil, err
3343	}
3344	req.Header = reqHeaders
3345	googleapi.Expand(req.URL, map[string]string{
3346		"notebookInstance": c.notebookInstance,
3347	})
3348	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3349}
3350
3351// Do executes the "notebooks.projects.locations.instances.isUpgradeable" call.
3352// Exactly one of *IsInstanceUpgradeableResponse or error will be
3353// non-nil. Any non-2xx status code is an error. Response headers are in
3354// either *IsInstanceUpgradeableResponse.ServerResponse.Header or (if a
3355// response was returned at all) in error.(*googleapi.Error).Header. Use
3356// googleapi.IsNotModified to check whether the returned error was
3357// because http.StatusNotModified was returned.
3358func (c *ProjectsLocationsInstancesIsUpgradeableCall) Do(opts ...googleapi.CallOption) (*IsInstanceUpgradeableResponse, error) {
3359	gensupport.SetOptions(c.urlParams_, opts...)
3360	res, err := c.doRequest("json")
3361	if res != nil && res.StatusCode == http.StatusNotModified {
3362		if res.Body != nil {
3363			res.Body.Close()
3364		}
3365		return nil, &googleapi.Error{
3366			Code:   res.StatusCode,
3367			Header: res.Header,
3368		}
3369	}
3370	if err != nil {
3371		return nil, err
3372	}
3373	defer googleapi.CloseBody(res)
3374	if err := googleapi.CheckResponse(res); err != nil {
3375		return nil, err
3376	}
3377	ret := &IsInstanceUpgradeableResponse{
3378		ServerResponse: googleapi.ServerResponse{
3379			Header:         res.Header,
3380			HTTPStatusCode: res.StatusCode,
3381		},
3382	}
3383	target := &ret
3384	if err := gensupport.DecodeResponse(target, res); err != nil {
3385		return nil, err
3386	}
3387	return ret, nil
3388	// {
3389	//   "description": "Check if a notebook instance is upgradable.",
3390	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:isUpgradeable",
3391	//   "httpMethod": "GET",
3392	//   "id": "notebooks.projects.locations.instances.isUpgradeable",
3393	//   "parameterOrder": [
3394	//     "notebookInstance"
3395	//   ],
3396	//   "parameters": {
3397	//     "notebookInstance": {
3398	//       "description": "Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`",
3399	//       "location": "path",
3400	//       "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
3401	//       "required": true,
3402	//       "type": "string"
3403	//     }
3404	//   },
3405	//   "path": "v1/{+notebookInstance}:isUpgradeable",
3406	//   "response": {
3407	//     "$ref": "IsInstanceUpgradeableResponse"
3408	//   },
3409	//   "scopes": [
3410	//     "https://www.googleapis.com/auth/cloud-platform"
3411	//   ]
3412	// }
3413
3414}
3415
3416// method id "notebooks.projects.locations.instances.list":
3417
3418type ProjectsLocationsInstancesListCall struct {
3419	s            *Service
3420	parent       string
3421	urlParams_   gensupport.URLParams
3422	ifNoneMatch_ string
3423	ctx_         context.Context
3424	header_      http.Header
3425}
3426
3427// List: Lists instances in a given project and location.
3428func (r *ProjectsLocationsInstancesService) List(parent string) *ProjectsLocationsInstancesListCall {
3429	c := &ProjectsLocationsInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3430	c.parent = parent
3431	return c
3432}
3433
3434// PageSize sets the optional parameter "pageSize": Maximum return size
3435// of the list call.
3436func (c *ProjectsLocationsInstancesListCall) PageSize(pageSize int64) *ProjectsLocationsInstancesListCall {
3437	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3438	return c
3439}
3440
3441// PageToken sets the optional parameter "pageToken": A previous
3442// returned page token that can be used to continue listing from the
3443// last result.
3444func (c *ProjectsLocationsInstancesListCall) PageToken(pageToken string) *ProjectsLocationsInstancesListCall {
3445	c.urlParams_.Set("pageToken", pageToken)
3446	return c
3447}
3448
3449// Fields allows partial responses to be retrieved. See
3450// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3451// for more information.
3452func (c *ProjectsLocationsInstancesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesListCall {
3453	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3454	return c
3455}
3456
3457// IfNoneMatch sets the optional parameter which makes the operation
3458// fail if the object's ETag matches the given value. This is useful for
3459// getting updates only after the object has changed since the last
3460// request. Use googleapi.IsNotModified to check whether the response
3461// error from Do is the result of In-None-Match.
3462func (c *ProjectsLocationsInstancesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesListCall {
3463	c.ifNoneMatch_ = entityTag
3464	return c
3465}
3466
3467// Context sets the context to be used in this call's Do method. Any
3468// pending HTTP request will be aborted if the provided context is
3469// canceled.
3470func (c *ProjectsLocationsInstancesListCall) Context(ctx context.Context) *ProjectsLocationsInstancesListCall {
3471	c.ctx_ = ctx
3472	return c
3473}
3474
3475// Header returns an http.Header that can be modified by the caller to
3476// add HTTP headers to the request.
3477func (c *ProjectsLocationsInstancesListCall) Header() http.Header {
3478	if c.header_ == nil {
3479		c.header_ = make(http.Header)
3480	}
3481	return c.header_
3482}
3483
3484func (c *ProjectsLocationsInstancesListCall) doRequest(alt string) (*http.Response, error) {
3485	reqHeaders := make(http.Header)
3486	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
3487	for k, v := range c.header_ {
3488		reqHeaders[k] = v
3489	}
3490	reqHeaders.Set("User-Agent", c.s.userAgent())
3491	if c.ifNoneMatch_ != "" {
3492		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3493	}
3494	var body io.Reader = nil
3495	c.urlParams_.Set("alt", alt)
3496	c.urlParams_.Set("prettyPrint", "false")
3497	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances")
3498	urls += "?" + c.urlParams_.Encode()
3499	req, err := http.NewRequest("GET", urls, body)
3500	if err != nil {
3501		return nil, err
3502	}
3503	req.Header = reqHeaders
3504	googleapi.Expand(req.URL, map[string]string{
3505		"parent": c.parent,
3506	})
3507	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3508}
3509
3510// Do executes the "notebooks.projects.locations.instances.list" call.
3511// Exactly one of *ListInstancesResponse or error will be non-nil. Any
3512// non-2xx status code is an error. Response headers are in either
3513// *ListInstancesResponse.ServerResponse.Header or (if a response was
3514// returned at all) in error.(*googleapi.Error).Header. Use
3515// googleapi.IsNotModified to check whether the returned error was
3516// because http.StatusNotModified was returned.
3517func (c *ProjectsLocationsInstancesListCall) Do(opts ...googleapi.CallOption) (*ListInstancesResponse, error) {
3518	gensupport.SetOptions(c.urlParams_, opts...)
3519	res, err := c.doRequest("json")
3520	if res != nil && res.StatusCode == http.StatusNotModified {
3521		if res.Body != nil {
3522			res.Body.Close()
3523		}
3524		return nil, &googleapi.Error{
3525			Code:   res.StatusCode,
3526			Header: res.Header,
3527		}
3528	}
3529	if err != nil {
3530		return nil, err
3531	}
3532	defer googleapi.CloseBody(res)
3533	if err := googleapi.CheckResponse(res); err != nil {
3534		return nil, err
3535	}
3536	ret := &ListInstancesResponse{
3537		ServerResponse: googleapi.ServerResponse{
3538			Header:         res.Header,
3539			HTTPStatusCode: res.StatusCode,
3540		},
3541	}
3542	target := &ret
3543	if err := gensupport.DecodeResponse(target, res); err != nil {
3544		return nil, err
3545	}
3546	return ret, nil
3547	// {
3548	//   "description": "Lists instances in a given project and location.",
3549	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances",
3550	//   "httpMethod": "GET",
3551	//   "id": "notebooks.projects.locations.instances.list",
3552	//   "parameterOrder": [
3553	//     "parent"
3554	//   ],
3555	//   "parameters": {
3556	//     "pageSize": {
3557	//       "description": "Maximum return size of the list call.",
3558	//       "format": "int32",
3559	//       "location": "query",
3560	//       "type": "integer"
3561	//     },
3562	//     "pageToken": {
3563	//       "description": "A previous returned page token that can be used to continue listing from the last result.",
3564	//       "location": "query",
3565	//       "type": "string"
3566	//     },
3567	//     "parent": {
3568	//       "description": "Required. Format: `parent=projects/{project_id}/locations/{location}`",
3569	//       "location": "path",
3570	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
3571	//       "required": true,
3572	//       "type": "string"
3573	//     }
3574	//   },
3575	//   "path": "v1/{+parent}/instances",
3576	//   "response": {
3577	//     "$ref": "ListInstancesResponse"
3578	//   },
3579	//   "scopes": [
3580	//     "https://www.googleapis.com/auth/cloud-platform"
3581	//   ]
3582	// }
3583
3584}
3585
3586// Pages invokes f for each page of results.
3587// A non-nil error returned from f will halt the iteration.
3588// The provided context supersedes any context provided to the Context method.
3589func (c *ProjectsLocationsInstancesListCall) Pages(ctx context.Context, f func(*ListInstancesResponse) error) error {
3590	c.ctx_ = ctx
3591	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
3592	for {
3593		x, err := c.Do()
3594		if err != nil {
3595			return err
3596		}
3597		if err := f(x); err != nil {
3598			return err
3599		}
3600		if x.NextPageToken == "" {
3601			return nil
3602		}
3603		c.PageToken(x.NextPageToken)
3604	}
3605}
3606
3607// method id "notebooks.projects.locations.instances.register":
3608
3609type ProjectsLocationsInstancesRegisterCall struct {
3610	s                       *Service
3611	parent                  string
3612	registerinstancerequest *RegisterInstanceRequest
3613	urlParams_              gensupport.URLParams
3614	ctx_                    context.Context
3615	header_                 http.Header
3616}
3617
3618// Register: Registers an existing legacy notebook instance to the
3619// Notebooks API server. Legacy instances are instances created with the
3620// legacy Compute Engine calls. They are not manageable by the Notebooks
3621// API out of the box. This call makes these instances manageable by the
3622// Notebooks API.
3623func (r *ProjectsLocationsInstancesService) Register(parent string, registerinstancerequest *RegisterInstanceRequest) *ProjectsLocationsInstancesRegisterCall {
3624	c := &ProjectsLocationsInstancesRegisterCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3625	c.parent = parent
3626	c.registerinstancerequest = registerinstancerequest
3627	return c
3628}
3629
3630// Fields allows partial responses to be retrieved. See
3631// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3632// for more information.
3633func (c *ProjectsLocationsInstancesRegisterCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesRegisterCall {
3634	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3635	return c
3636}
3637
3638// Context sets the context to be used in this call's Do method. Any
3639// pending HTTP request will be aborted if the provided context is
3640// canceled.
3641func (c *ProjectsLocationsInstancesRegisterCall) Context(ctx context.Context) *ProjectsLocationsInstancesRegisterCall {
3642	c.ctx_ = ctx
3643	return c
3644}
3645
3646// Header returns an http.Header that can be modified by the caller to
3647// add HTTP headers to the request.
3648func (c *ProjectsLocationsInstancesRegisterCall) Header() http.Header {
3649	if c.header_ == nil {
3650		c.header_ = make(http.Header)
3651	}
3652	return c.header_
3653}
3654
3655func (c *ProjectsLocationsInstancesRegisterCall) doRequest(alt string) (*http.Response, error) {
3656	reqHeaders := make(http.Header)
3657	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
3658	for k, v := range c.header_ {
3659		reqHeaders[k] = v
3660	}
3661	reqHeaders.Set("User-Agent", c.s.userAgent())
3662	var body io.Reader = nil
3663	body, err := googleapi.WithoutDataWrapper.JSONReader(c.registerinstancerequest)
3664	if err != nil {
3665		return nil, err
3666	}
3667	reqHeaders.Set("Content-Type", "application/json")
3668	c.urlParams_.Set("alt", alt)
3669	c.urlParams_.Set("prettyPrint", "false")
3670	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances:register")
3671	urls += "?" + c.urlParams_.Encode()
3672	req, err := http.NewRequest("POST", urls, body)
3673	if err != nil {
3674		return nil, err
3675	}
3676	req.Header = reqHeaders
3677	googleapi.Expand(req.URL, map[string]string{
3678		"parent": c.parent,
3679	})
3680	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3681}
3682
3683// Do executes the "notebooks.projects.locations.instances.register" call.
3684// Exactly one of *Operation or error will be non-nil. Any non-2xx
3685// status code is an error. Response headers are in either
3686// *Operation.ServerResponse.Header or (if a response was returned at
3687// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3688// to check whether the returned error was because
3689// http.StatusNotModified was returned.
3690func (c *ProjectsLocationsInstancesRegisterCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3691	gensupport.SetOptions(c.urlParams_, opts...)
3692	res, err := c.doRequest("json")
3693	if res != nil && res.StatusCode == http.StatusNotModified {
3694		if res.Body != nil {
3695			res.Body.Close()
3696		}
3697		return nil, &googleapi.Error{
3698			Code:   res.StatusCode,
3699			Header: res.Header,
3700		}
3701	}
3702	if err != nil {
3703		return nil, err
3704	}
3705	defer googleapi.CloseBody(res)
3706	if err := googleapi.CheckResponse(res); err != nil {
3707		return nil, err
3708	}
3709	ret := &Operation{
3710		ServerResponse: googleapi.ServerResponse{
3711			Header:         res.Header,
3712			HTTPStatusCode: res.StatusCode,
3713		},
3714	}
3715	target := &ret
3716	if err := gensupport.DecodeResponse(target, res); err != nil {
3717		return nil, err
3718	}
3719	return ret, nil
3720	// {
3721	//   "description": "Registers an existing legacy notebook instance to the Notebooks API server. Legacy instances are instances created with the legacy Compute Engine calls. They are not manageable by the Notebooks API out of the box. This call makes these instances manageable by the Notebooks API.",
3722	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances:register",
3723	//   "httpMethod": "POST",
3724	//   "id": "notebooks.projects.locations.instances.register",
3725	//   "parameterOrder": [
3726	//     "parent"
3727	//   ],
3728	//   "parameters": {
3729	//     "parent": {
3730	//       "description": "Required. Format: `parent=projects/{project_id}/locations/{location}`",
3731	//       "location": "path",
3732	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
3733	//       "required": true,
3734	//       "type": "string"
3735	//     }
3736	//   },
3737	//   "path": "v1/{+parent}/instances:register",
3738	//   "request": {
3739	//     "$ref": "RegisterInstanceRequest"
3740	//   },
3741	//   "response": {
3742	//     "$ref": "Operation"
3743	//   },
3744	//   "scopes": [
3745	//     "https://www.googleapis.com/auth/cloud-platform"
3746	//   ]
3747	// }
3748
3749}
3750
3751// method id "notebooks.projects.locations.instances.report":
3752
3753type ProjectsLocationsInstancesReportCall struct {
3754	s                         *Service
3755	name                      string
3756	reportinstanceinforequest *ReportInstanceInfoRequest
3757	urlParams_                gensupport.URLParams
3758	ctx_                      context.Context
3759	header_                   http.Header
3760}
3761
3762// Report: Allows notebook instances to report their latest instance
3763// information to the Notebooks API server. The server will merge the
3764// reported information to the instance metadata store. Do not use this
3765// method directly.
3766func (r *ProjectsLocationsInstancesService) Report(name string, reportinstanceinforequest *ReportInstanceInfoRequest) *ProjectsLocationsInstancesReportCall {
3767	c := &ProjectsLocationsInstancesReportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3768	c.name = name
3769	c.reportinstanceinforequest = reportinstanceinforequest
3770	return c
3771}
3772
3773// Fields allows partial responses to be retrieved. See
3774// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3775// for more information.
3776func (c *ProjectsLocationsInstancesReportCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesReportCall {
3777	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3778	return c
3779}
3780
3781// Context sets the context to be used in this call's Do method. Any
3782// pending HTTP request will be aborted if the provided context is
3783// canceled.
3784func (c *ProjectsLocationsInstancesReportCall) Context(ctx context.Context) *ProjectsLocationsInstancesReportCall {
3785	c.ctx_ = ctx
3786	return c
3787}
3788
3789// Header returns an http.Header that can be modified by the caller to
3790// add HTTP headers to the request.
3791func (c *ProjectsLocationsInstancesReportCall) Header() http.Header {
3792	if c.header_ == nil {
3793		c.header_ = make(http.Header)
3794	}
3795	return c.header_
3796}
3797
3798func (c *ProjectsLocationsInstancesReportCall) doRequest(alt string) (*http.Response, error) {
3799	reqHeaders := make(http.Header)
3800	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
3801	for k, v := range c.header_ {
3802		reqHeaders[k] = v
3803	}
3804	reqHeaders.Set("User-Agent", c.s.userAgent())
3805	var body io.Reader = nil
3806	body, err := googleapi.WithoutDataWrapper.JSONReader(c.reportinstanceinforequest)
3807	if err != nil {
3808		return nil, err
3809	}
3810	reqHeaders.Set("Content-Type", "application/json")
3811	c.urlParams_.Set("alt", alt)
3812	c.urlParams_.Set("prettyPrint", "false")
3813	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:report")
3814	urls += "?" + c.urlParams_.Encode()
3815	req, err := http.NewRequest("POST", urls, body)
3816	if err != nil {
3817		return nil, err
3818	}
3819	req.Header = reqHeaders
3820	googleapi.Expand(req.URL, map[string]string{
3821		"name": c.name,
3822	})
3823	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3824}
3825
3826// Do executes the "notebooks.projects.locations.instances.report" call.
3827// Exactly one of *Operation or error will be non-nil. Any non-2xx
3828// status code is an error. Response headers are in either
3829// *Operation.ServerResponse.Header or (if a response was returned at
3830// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3831// to check whether the returned error was because
3832// http.StatusNotModified was returned.
3833func (c *ProjectsLocationsInstancesReportCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3834	gensupport.SetOptions(c.urlParams_, opts...)
3835	res, err := c.doRequest("json")
3836	if res != nil && res.StatusCode == http.StatusNotModified {
3837		if res.Body != nil {
3838			res.Body.Close()
3839		}
3840		return nil, &googleapi.Error{
3841			Code:   res.StatusCode,
3842			Header: res.Header,
3843		}
3844	}
3845	if err != nil {
3846		return nil, err
3847	}
3848	defer googleapi.CloseBody(res)
3849	if err := googleapi.CheckResponse(res); err != nil {
3850		return nil, err
3851	}
3852	ret := &Operation{
3853		ServerResponse: googleapi.ServerResponse{
3854			Header:         res.Header,
3855			HTTPStatusCode: res.StatusCode,
3856		},
3857	}
3858	target := &ret
3859	if err := gensupport.DecodeResponse(target, res); err != nil {
3860		return nil, err
3861	}
3862	return ret, nil
3863	// {
3864	//   "description": "Allows notebook instances to report their latest instance information to the Notebooks API server. The server will merge the reported information to the instance metadata store. Do not use this method directly.",
3865	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:report",
3866	//   "httpMethod": "POST",
3867	//   "id": "notebooks.projects.locations.instances.report",
3868	//   "parameterOrder": [
3869	//     "name"
3870	//   ],
3871	//   "parameters": {
3872	//     "name": {
3873	//       "description": "Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`",
3874	//       "location": "path",
3875	//       "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
3876	//       "required": true,
3877	//       "type": "string"
3878	//     }
3879	//   },
3880	//   "path": "v1/{+name}:report",
3881	//   "request": {
3882	//     "$ref": "ReportInstanceInfoRequest"
3883	//   },
3884	//   "response": {
3885	//     "$ref": "Operation"
3886	//   },
3887	//   "scopes": [
3888	//     "https://www.googleapis.com/auth/cloud-platform"
3889	//   ]
3890	// }
3891
3892}
3893
3894// method id "notebooks.projects.locations.instances.reset":
3895
3896type ProjectsLocationsInstancesResetCall struct {
3897	s                    *Service
3898	name                 string
3899	resetinstancerequest *ResetInstanceRequest
3900	urlParams_           gensupport.URLParams
3901	ctx_                 context.Context
3902	header_              http.Header
3903}
3904
3905// Reset: Resets a notebook instance.
3906func (r *ProjectsLocationsInstancesService) Reset(name string, resetinstancerequest *ResetInstanceRequest) *ProjectsLocationsInstancesResetCall {
3907	c := &ProjectsLocationsInstancesResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3908	c.name = name
3909	c.resetinstancerequest = resetinstancerequest
3910	return c
3911}
3912
3913// Fields allows partial responses to be retrieved. See
3914// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3915// for more information.
3916func (c *ProjectsLocationsInstancesResetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesResetCall {
3917	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3918	return c
3919}
3920
3921// Context sets the context to be used in this call's Do method. Any
3922// pending HTTP request will be aborted if the provided context is
3923// canceled.
3924func (c *ProjectsLocationsInstancesResetCall) Context(ctx context.Context) *ProjectsLocationsInstancesResetCall {
3925	c.ctx_ = ctx
3926	return c
3927}
3928
3929// Header returns an http.Header that can be modified by the caller to
3930// add HTTP headers to the request.
3931func (c *ProjectsLocationsInstancesResetCall) Header() http.Header {
3932	if c.header_ == nil {
3933		c.header_ = make(http.Header)
3934	}
3935	return c.header_
3936}
3937
3938func (c *ProjectsLocationsInstancesResetCall) doRequest(alt string) (*http.Response, error) {
3939	reqHeaders := make(http.Header)
3940	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
3941	for k, v := range c.header_ {
3942		reqHeaders[k] = v
3943	}
3944	reqHeaders.Set("User-Agent", c.s.userAgent())
3945	var body io.Reader = nil
3946	body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetinstancerequest)
3947	if err != nil {
3948		return nil, err
3949	}
3950	reqHeaders.Set("Content-Type", "application/json")
3951	c.urlParams_.Set("alt", alt)
3952	c.urlParams_.Set("prettyPrint", "false")
3953	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:reset")
3954	urls += "?" + c.urlParams_.Encode()
3955	req, err := http.NewRequest("POST", urls, body)
3956	if err != nil {
3957		return nil, err
3958	}
3959	req.Header = reqHeaders
3960	googleapi.Expand(req.URL, map[string]string{
3961		"name": c.name,
3962	})
3963	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3964}
3965
3966// Do executes the "notebooks.projects.locations.instances.reset" call.
3967// Exactly one of *Operation or error will be non-nil. Any non-2xx
3968// status code is an error. Response headers are in either
3969// *Operation.ServerResponse.Header or (if a response was returned at
3970// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3971// to check whether the returned error was because
3972// http.StatusNotModified was returned.
3973func (c *ProjectsLocationsInstancesResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
3974	gensupport.SetOptions(c.urlParams_, opts...)
3975	res, err := c.doRequest("json")
3976	if res != nil && res.StatusCode == http.StatusNotModified {
3977		if res.Body != nil {
3978			res.Body.Close()
3979		}
3980		return nil, &googleapi.Error{
3981			Code:   res.StatusCode,
3982			Header: res.Header,
3983		}
3984	}
3985	if err != nil {
3986		return nil, err
3987	}
3988	defer googleapi.CloseBody(res)
3989	if err := googleapi.CheckResponse(res); err != nil {
3990		return nil, err
3991	}
3992	ret := &Operation{
3993		ServerResponse: googleapi.ServerResponse{
3994			Header:         res.Header,
3995			HTTPStatusCode: res.StatusCode,
3996		},
3997	}
3998	target := &ret
3999	if err := gensupport.DecodeResponse(target, res); err != nil {
4000		return nil, err
4001	}
4002	return ret, nil
4003	// {
4004	//   "description": "Resets a notebook instance.",
4005	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:reset",
4006	//   "httpMethod": "POST",
4007	//   "id": "notebooks.projects.locations.instances.reset",
4008	//   "parameterOrder": [
4009	//     "name"
4010	//   ],
4011	//   "parameters": {
4012	//     "name": {
4013	//       "description": "Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`",
4014	//       "location": "path",
4015	//       "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
4016	//       "required": true,
4017	//       "type": "string"
4018	//     }
4019	//   },
4020	//   "path": "v1/{+name}:reset",
4021	//   "request": {
4022	//     "$ref": "ResetInstanceRequest"
4023	//   },
4024	//   "response": {
4025	//     "$ref": "Operation"
4026	//   },
4027	//   "scopes": [
4028	//     "https://www.googleapis.com/auth/cloud-platform"
4029	//   ]
4030	// }
4031
4032}
4033
4034// method id "notebooks.projects.locations.instances.setAccelerator":
4035
4036type ProjectsLocationsInstancesSetAcceleratorCall struct {
4037	s                             *Service
4038	name                          string
4039	setinstanceacceleratorrequest *SetInstanceAcceleratorRequest
4040	urlParams_                    gensupport.URLParams
4041	ctx_                          context.Context
4042	header_                       http.Header
4043}
4044
4045// SetAccelerator: Updates the guest accelerators of a single Instance.
4046func (r *ProjectsLocationsInstancesService) SetAccelerator(name string, setinstanceacceleratorrequest *SetInstanceAcceleratorRequest) *ProjectsLocationsInstancesSetAcceleratorCall {
4047	c := &ProjectsLocationsInstancesSetAcceleratorCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4048	c.name = name
4049	c.setinstanceacceleratorrequest = setinstanceacceleratorrequest
4050	return c
4051}
4052
4053// Fields allows partial responses to be retrieved. See
4054// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4055// for more information.
4056func (c *ProjectsLocationsInstancesSetAcceleratorCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesSetAcceleratorCall {
4057	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4058	return c
4059}
4060
4061// Context sets the context to be used in this call's Do method. Any
4062// pending HTTP request will be aborted if the provided context is
4063// canceled.
4064func (c *ProjectsLocationsInstancesSetAcceleratorCall) Context(ctx context.Context) *ProjectsLocationsInstancesSetAcceleratorCall {
4065	c.ctx_ = ctx
4066	return c
4067}
4068
4069// Header returns an http.Header that can be modified by the caller to
4070// add HTTP headers to the request.
4071func (c *ProjectsLocationsInstancesSetAcceleratorCall) Header() http.Header {
4072	if c.header_ == nil {
4073		c.header_ = make(http.Header)
4074	}
4075	return c.header_
4076}
4077
4078func (c *ProjectsLocationsInstancesSetAcceleratorCall) doRequest(alt string) (*http.Response, error) {
4079	reqHeaders := make(http.Header)
4080	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
4081	for k, v := range c.header_ {
4082		reqHeaders[k] = v
4083	}
4084	reqHeaders.Set("User-Agent", c.s.userAgent())
4085	var body io.Reader = nil
4086	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setinstanceacceleratorrequest)
4087	if err != nil {
4088		return nil, err
4089	}
4090	reqHeaders.Set("Content-Type", "application/json")
4091	c.urlParams_.Set("alt", alt)
4092	c.urlParams_.Set("prettyPrint", "false")
4093	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setAccelerator")
4094	urls += "?" + c.urlParams_.Encode()
4095	req, err := http.NewRequest("PATCH", urls, body)
4096	if err != nil {
4097		return nil, err
4098	}
4099	req.Header = reqHeaders
4100	googleapi.Expand(req.URL, map[string]string{
4101		"name": c.name,
4102	})
4103	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4104}
4105
4106// Do executes the "notebooks.projects.locations.instances.setAccelerator" call.
4107// Exactly one of *Operation or error will be non-nil. Any non-2xx
4108// status code is an error. Response headers are in either
4109// *Operation.ServerResponse.Header or (if a response was returned at
4110// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4111// to check whether the returned error was because
4112// http.StatusNotModified was returned.
4113func (c *ProjectsLocationsInstancesSetAcceleratorCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4114	gensupport.SetOptions(c.urlParams_, opts...)
4115	res, err := c.doRequest("json")
4116	if res != nil && res.StatusCode == http.StatusNotModified {
4117		if res.Body != nil {
4118			res.Body.Close()
4119		}
4120		return nil, &googleapi.Error{
4121			Code:   res.StatusCode,
4122			Header: res.Header,
4123		}
4124	}
4125	if err != nil {
4126		return nil, err
4127	}
4128	defer googleapi.CloseBody(res)
4129	if err := googleapi.CheckResponse(res); err != nil {
4130		return nil, err
4131	}
4132	ret := &Operation{
4133		ServerResponse: googleapi.ServerResponse{
4134			Header:         res.Header,
4135			HTTPStatusCode: res.StatusCode,
4136		},
4137	}
4138	target := &ret
4139	if err := gensupport.DecodeResponse(target, res); err != nil {
4140		return nil, err
4141	}
4142	return ret, nil
4143	// {
4144	//   "description": "Updates the guest accelerators of a single Instance.",
4145	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:setAccelerator",
4146	//   "httpMethod": "PATCH",
4147	//   "id": "notebooks.projects.locations.instances.setAccelerator",
4148	//   "parameterOrder": [
4149	//     "name"
4150	//   ],
4151	//   "parameters": {
4152	//     "name": {
4153	//       "description": "Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`",
4154	//       "location": "path",
4155	//       "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
4156	//       "required": true,
4157	//       "type": "string"
4158	//     }
4159	//   },
4160	//   "path": "v1/{+name}:setAccelerator",
4161	//   "request": {
4162	//     "$ref": "SetInstanceAcceleratorRequest"
4163	//   },
4164	//   "response": {
4165	//     "$ref": "Operation"
4166	//   },
4167	//   "scopes": [
4168	//     "https://www.googleapis.com/auth/cloud-platform"
4169	//   ]
4170	// }
4171
4172}
4173
4174// method id "notebooks.projects.locations.instances.setIamPolicy":
4175
4176type ProjectsLocationsInstancesSetIamPolicyCall struct {
4177	s                   *Service
4178	resource            string
4179	setiampolicyrequest *SetIamPolicyRequest
4180	urlParams_          gensupport.URLParams
4181	ctx_                context.Context
4182	header_             http.Header
4183}
4184
4185// SetIamPolicy: Sets the access control policy on the specified
4186// resource. Replaces any existing policy. Can return `NOT_FOUND`,
4187// `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
4188func (r *ProjectsLocationsInstancesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsInstancesSetIamPolicyCall {
4189	c := &ProjectsLocationsInstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4190	c.resource = resource
4191	c.setiampolicyrequest = setiampolicyrequest
4192	return c
4193}
4194
4195// Fields allows partial responses to be retrieved. See
4196// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4197// for more information.
4198func (c *ProjectsLocationsInstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesSetIamPolicyCall {
4199	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4200	return c
4201}
4202
4203// Context sets the context to be used in this call's Do method. Any
4204// pending HTTP request will be aborted if the provided context is
4205// canceled.
4206func (c *ProjectsLocationsInstancesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsInstancesSetIamPolicyCall {
4207	c.ctx_ = ctx
4208	return c
4209}
4210
4211// Header returns an http.Header that can be modified by the caller to
4212// add HTTP headers to the request.
4213func (c *ProjectsLocationsInstancesSetIamPolicyCall) Header() http.Header {
4214	if c.header_ == nil {
4215		c.header_ = make(http.Header)
4216	}
4217	return c.header_
4218}
4219
4220func (c *ProjectsLocationsInstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4221	reqHeaders := make(http.Header)
4222	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
4223	for k, v := range c.header_ {
4224		reqHeaders[k] = v
4225	}
4226	reqHeaders.Set("User-Agent", c.s.userAgent())
4227	var body io.Reader = nil
4228	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
4229	if err != nil {
4230		return nil, err
4231	}
4232	reqHeaders.Set("Content-Type", "application/json")
4233	c.urlParams_.Set("alt", alt)
4234	c.urlParams_.Set("prettyPrint", "false")
4235	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
4236	urls += "?" + c.urlParams_.Encode()
4237	req, err := http.NewRequest("POST", urls, body)
4238	if err != nil {
4239		return nil, err
4240	}
4241	req.Header = reqHeaders
4242	googleapi.Expand(req.URL, map[string]string{
4243		"resource": c.resource,
4244	})
4245	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4246}
4247
4248// Do executes the "notebooks.projects.locations.instances.setIamPolicy" call.
4249// Exactly one of *Policy or error will be non-nil. Any non-2xx status
4250// code is an error. Response headers are in either
4251// *Policy.ServerResponse.Header or (if a response was returned at all)
4252// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4253// check whether the returned error was because http.StatusNotModified
4254// was returned.
4255func (c *ProjectsLocationsInstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4256	gensupport.SetOptions(c.urlParams_, opts...)
4257	res, err := c.doRequest("json")
4258	if res != nil && res.StatusCode == http.StatusNotModified {
4259		if res.Body != nil {
4260			res.Body.Close()
4261		}
4262		return nil, &googleapi.Error{
4263			Code:   res.StatusCode,
4264			Header: res.Header,
4265		}
4266	}
4267	if err != nil {
4268		return nil, err
4269	}
4270	defer googleapi.CloseBody(res)
4271	if err := googleapi.CheckResponse(res); err != nil {
4272		return nil, err
4273	}
4274	ret := &Policy{
4275		ServerResponse: googleapi.ServerResponse{
4276			Header:         res.Header,
4277			HTTPStatusCode: res.StatusCode,
4278		},
4279	}
4280	target := &ret
4281	if err := gensupport.DecodeResponse(target, res); err != nil {
4282		return nil, err
4283	}
4284	return ret, nil
4285	// {
4286	//   "description": "Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.",
4287	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:setIamPolicy",
4288	//   "httpMethod": "POST",
4289	//   "id": "notebooks.projects.locations.instances.setIamPolicy",
4290	//   "parameterOrder": [
4291	//     "resource"
4292	//   ],
4293	//   "parameters": {
4294	//     "resource": {
4295	//       "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
4296	//       "location": "path",
4297	//       "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
4298	//       "required": true,
4299	//       "type": "string"
4300	//     }
4301	//   },
4302	//   "path": "v1/{+resource}:setIamPolicy",
4303	//   "request": {
4304	//     "$ref": "SetIamPolicyRequest"
4305	//   },
4306	//   "response": {
4307	//     "$ref": "Policy"
4308	//   },
4309	//   "scopes": [
4310	//     "https://www.googleapis.com/auth/cloud-platform"
4311	//   ]
4312	// }
4313
4314}
4315
4316// method id "notebooks.projects.locations.instances.setLabels":
4317
4318type ProjectsLocationsInstancesSetLabelsCall struct {
4319	s                        *Service
4320	name                     string
4321	setinstancelabelsrequest *SetInstanceLabelsRequest
4322	urlParams_               gensupport.URLParams
4323	ctx_                     context.Context
4324	header_                  http.Header
4325}
4326
4327// SetLabels: Replaces all the labels of an Instance.
4328func (r *ProjectsLocationsInstancesService) SetLabels(name string, setinstancelabelsrequest *SetInstanceLabelsRequest) *ProjectsLocationsInstancesSetLabelsCall {
4329	c := &ProjectsLocationsInstancesSetLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4330	c.name = name
4331	c.setinstancelabelsrequest = setinstancelabelsrequest
4332	return c
4333}
4334
4335// Fields allows partial responses to be retrieved. See
4336// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4337// for more information.
4338func (c *ProjectsLocationsInstancesSetLabelsCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesSetLabelsCall {
4339	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4340	return c
4341}
4342
4343// Context sets the context to be used in this call's Do method. Any
4344// pending HTTP request will be aborted if the provided context is
4345// canceled.
4346func (c *ProjectsLocationsInstancesSetLabelsCall) Context(ctx context.Context) *ProjectsLocationsInstancesSetLabelsCall {
4347	c.ctx_ = ctx
4348	return c
4349}
4350
4351// Header returns an http.Header that can be modified by the caller to
4352// add HTTP headers to the request.
4353func (c *ProjectsLocationsInstancesSetLabelsCall) Header() http.Header {
4354	if c.header_ == nil {
4355		c.header_ = make(http.Header)
4356	}
4357	return c.header_
4358}
4359
4360func (c *ProjectsLocationsInstancesSetLabelsCall) doRequest(alt string) (*http.Response, error) {
4361	reqHeaders := make(http.Header)
4362	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
4363	for k, v := range c.header_ {
4364		reqHeaders[k] = v
4365	}
4366	reqHeaders.Set("User-Agent", c.s.userAgent())
4367	var body io.Reader = nil
4368	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setinstancelabelsrequest)
4369	if err != nil {
4370		return nil, err
4371	}
4372	reqHeaders.Set("Content-Type", "application/json")
4373	c.urlParams_.Set("alt", alt)
4374	c.urlParams_.Set("prettyPrint", "false")
4375	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setLabels")
4376	urls += "?" + c.urlParams_.Encode()
4377	req, err := http.NewRequest("PATCH", urls, body)
4378	if err != nil {
4379		return nil, err
4380	}
4381	req.Header = reqHeaders
4382	googleapi.Expand(req.URL, map[string]string{
4383		"name": c.name,
4384	})
4385	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4386}
4387
4388// Do executes the "notebooks.projects.locations.instances.setLabels" call.
4389// Exactly one of *Operation or error will be non-nil. Any non-2xx
4390// status code is an error. Response headers are in either
4391// *Operation.ServerResponse.Header or (if a response was returned at
4392// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4393// to check whether the returned error was because
4394// http.StatusNotModified was returned.
4395func (c *ProjectsLocationsInstancesSetLabelsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4396	gensupport.SetOptions(c.urlParams_, opts...)
4397	res, err := c.doRequest("json")
4398	if res != nil && res.StatusCode == http.StatusNotModified {
4399		if res.Body != nil {
4400			res.Body.Close()
4401		}
4402		return nil, &googleapi.Error{
4403			Code:   res.StatusCode,
4404			Header: res.Header,
4405		}
4406	}
4407	if err != nil {
4408		return nil, err
4409	}
4410	defer googleapi.CloseBody(res)
4411	if err := googleapi.CheckResponse(res); err != nil {
4412		return nil, err
4413	}
4414	ret := &Operation{
4415		ServerResponse: googleapi.ServerResponse{
4416			Header:         res.Header,
4417			HTTPStatusCode: res.StatusCode,
4418		},
4419	}
4420	target := &ret
4421	if err := gensupport.DecodeResponse(target, res); err != nil {
4422		return nil, err
4423	}
4424	return ret, nil
4425	// {
4426	//   "description": "Replaces all the labels of an Instance.",
4427	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:setLabels",
4428	//   "httpMethod": "PATCH",
4429	//   "id": "notebooks.projects.locations.instances.setLabels",
4430	//   "parameterOrder": [
4431	//     "name"
4432	//   ],
4433	//   "parameters": {
4434	//     "name": {
4435	//       "description": "Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`",
4436	//       "location": "path",
4437	//       "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
4438	//       "required": true,
4439	//       "type": "string"
4440	//     }
4441	//   },
4442	//   "path": "v1/{+name}:setLabels",
4443	//   "request": {
4444	//     "$ref": "SetInstanceLabelsRequest"
4445	//   },
4446	//   "response": {
4447	//     "$ref": "Operation"
4448	//   },
4449	//   "scopes": [
4450	//     "https://www.googleapis.com/auth/cloud-platform"
4451	//   ]
4452	// }
4453
4454}
4455
4456// method id "notebooks.projects.locations.instances.setMachineType":
4457
4458type ProjectsLocationsInstancesSetMachineTypeCall struct {
4459	s                             *Service
4460	name                          string
4461	setinstancemachinetyperequest *SetInstanceMachineTypeRequest
4462	urlParams_                    gensupport.URLParams
4463	ctx_                          context.Context
4464	header_                       http.Header
4465}
4466
4467// SetMachineType: Updates the machine type of a single Instance.
4468func (r *ProjectsLocationsInstancesService) SetMachineType(name string, setinstancemachinetyperequest *SetInstanceMachineTypeRequest) *ProjectsLocationsInstancesSetMachineTypeCall {
4469	c := &ProjectsLocationsInstancesSetMachineTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4470	c.name = name
4471	c.setinstancemachinetyperequest = setinstancemachinetyperequest
4472	return c
4473}
4474
4475// Fields allows partial responses to be retrieved. See
4476// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4477// for more information.
4478func (c *ProjectsLocationsInstancesSetMachineTypeCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesSetMachineTypeCall {
4479	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4480	return c
4481}
4482
4483// Context sets the context to be used in this call's Do method. Any
4484// pending HTTP request will be aborted if the provided context is
4485// canceled.
4486func (c *ProjectsLocationsInstancesSetMachineTypeCall) Context(ctx context.Context) *ProjectsLocationsInstancesSetMachineTypeCall {
4487	c.ctx_ = ctx
4488	return c
4489}
4490
4491// Header returns an http.Header that can be modified by the caller to
4492// add HTTP headers to the request.
4493func (c *ProjectsLocationsInstancesSetMachineTypeCall) Header() http.Header {
4494	if c.header_ == nil {
4495		c.header_ = make(http.Header)
4496	}
4497	return c.header_
4498}
4499
4500func (c *ProjectsLocationsInstancesSetMachineTypeCall) doRequest(alt string) (*http.Response, error) {
4501	reqHeaders := make(http.Header)
4502	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
4503	for k, v := range c.header_ {
4504		reqHeaders[k] = v
4505	}
4506	reqHeaders.Set("User-Agent", c.s.userAgent())
4507	var body io.Reader = nil
4508	body, err := googleapi.WithoutDataWrapper.JSONReader(c.setinstancemachinetyperequest)
4509	if err != nil {
4510		return nil, err
4511	}
4512	reqHeaders.Set("Content-Type", "application/json")
4513	c.urlParams_.Set("alt", alt)
4514	c.urlParams_.Set("prettyPrint", "false")
4515	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setMachineType")
4516	urls += "?" + c.urlParams_.Encode()
4517	req, err := http.NewRequest("PATCH", urls, body)
4518	if err != nil {
4519		return nil, err
4520	}
4521	req.Header = reqHeaders
4522	googleapi.Expand(req.URL, map[string]string{
4523		"name": c.name,
4524	})
4525	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4526}
4527
4528// Do executes the "notebooks.projects.locations.instances.setMachineType" call.
4529// Exactly one of *Operation or error will be non-nil. Any non-2xx
4530// status code is an error. Response headers are in either
4531// *Operation.ServerResponse.Header or (if a response was returned at
4532// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4533// to check whether the returned error was because
4534// http.StatusNotModified was returned.
4535func (c *ProjectsLocationsInstancesSetMachineTypeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4536	gensupport.SetOptions(c.urlParams_, opts...)
4537	res, err := c.doRequest("json")
4538	if res != nil && res.StatusCode == http.StatusNotModified {
4539		if res.Body != nil {
4540			res.Body.Close()
4541		}
4542		return nil, &googleapi.Error{
4543			Code:   res.StatusCode,
4544			Header: res.Header,
4545		}
4546	}
4547	if err != nil {
4548		return nil, err
4549	}
4550	defer googleapi.CloseBody(res)
4551	if err := googleapi.CheckResponse(res); err != nil {
4552		return nil, err
4553	}
4554	ret := &Operation{
4555		ServerResponse: googleapi.ServerResponse{
4556			Header:         res.Header,
4557			HTTPStatusCode: res.StatusCode,
4558		},
4559	}
4560	target := &ret
4561	if err := gensupport.DecodeResponse(target, res); err != nil {
4562		return nil, err
4563	}
4564	return ret, nil
4565	// {
4566	//   "description": "Updates the machine type of a single Instance.",
4567	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:setMachineType",
4568	//   "httpMethod": "PATCH",
4569	//   "id": "notebooks.projects.locations.instances.setMachineType",
4570	//   "parameterOrder": [
4571	//     "name"
4572	//   ],
4573	//   "parameters": {
4574	//     "name": {
4575	//       "description": "Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`",
4576	//       "location": "path",
4577	//       "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
4578	//       "required": true,
4579	//       "type": "string"
4580	//     }
4581	//   },
4582	//   "path": "v1/{+name}:setMachineType",
4583	//   "request": {
4584	//     "$ref": "SetInstanceMachineTypeRequest"
4585	//   },
4586	//   "response": {
4587	//     "$ref": "Operation"
4588	//   },
4589	//   "scopes": [
4590	//     "https://www.googleapis.com/auth/cloud-platform"
4591	//   ]
4592	// }
4593
4594}
4595
4596// method id "notebooks.projects.locations.instances.start":
4597
4598type ProjectsLocationsInstancesStartCall struct {
4599	s                    *Service
4600	name                 string
4601	startinstancerequest *StartInstanceRequest
4602	urlParams_           gensupport.URLParams
4603	ctx_                 context.Context
4604	header_              http.Header
4605}
4606
4607// Start: Starts a notebook instance.
4608func (r *ProjectsLocationsInstancesService) Start(name string, startinstancerequest *StartInstanceRequest) *ProjectsLocationsInstancesStartCall {
4609	c := &ProjectsLocationsInstancesStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4610	c.name = name
4611	c.startinstancerequest = startinstancerequest
4612	return c
4613}
4614
4615// Fields allows partial responses to be retrieved. See
4616// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4617// for more information.
4618func (c *ProjectsLocationsInstancesStartCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesStartCall {
4619	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4620	return c
4621}
4622
4623// Context sets the context to be used in this call's Do method. Any
4624// pending HTTP request will be aborted if the provided context is
4625// canceled.
4626func (c *ProjectsLocationsInstancesStartCall) Context(ctx context.Context) *ProjectsLocationsInstancesStartCall {
4627	c.ctx_ = ctx
4628	return c
4629}
4630
4631// Header returns an http.Header that can be modified by the caller to
4632// add HTTP headers to the request.
4633func (c *ProjectsLocationsInstancesStartCall) Header() http.Header {
4634	if c.header_ == nil {
4635		c.header_ = make(http.Header)
4636	}
4637	return c.header_
4638}
4639
4640func (c *ProjectsLocationsInstancesStartCall) doRequest(alt string) (*http.Response, error) {
4641	reqHeaders := make(http.Header)
4642	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
4643	for k, v := range c.header_ {
4644		reqHeaders[k] = v
4645	}
4646	reqHeaders.Set("User-Agent", c.s.userAgent())
4647	var body io.Reader = nil
4648	body, err := googleapi.WithoutDataWrapper.JSONReader(c.startinstancerequest)
4649	if err != nil {
4650		return nil, err
4651	}
4652	reqHeaders.Set("Content-Type", "application/json")
4653	c.urlParams_.Set("alt", alt)
4654	c.urlParams_.Set("prettyPrint", "false")
4655	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:start")
4656	urls += "?" + c.urlParams_.Encode()
4657	req, err := http.NewRequest("POST", urls, body)
4658	if err != nil {
4659		return nil, err
4660	}
4661	req.Header = reqHeaders
4662	googleapi.Expand(req.URL, map[string]string{
4663		"name": c.name,
4664	})
4665	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4666}
4667
4668// Do executes the "notebooks.projects.locations.instances.start" call.
4669// Exactly one of *Operation or error will be non-nil. Any non-2xx
4670// status code is an error. Response headers are in either
4671// *Operation.ServerResponse.Header or (if a response was returned at
4672// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4673// to check whether the returned error was because
4674// http.StatusNotModified was returned.
4675func (c *ProjectsLocationsInstancesStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4676	gensupport.SetOptions(c.urlParams_, opts...)
4677	res, err := c.doRequest("json")
4678	if res != nil && res.StatusCode == http.StatusNotModified {
4679		if res.Body != nil {
4680			res.Body.Close()
4681		}
4682		return nil, &googleapi.Error{
4683			Code:   res.StatusCode,
4684			Header: res.Header,
4685		}
4686	}
4687	if err != nil {
4688		return nil, err
4689	}
4690	defer googleapi.CloseBody(res)
4691	if err := googleapi.CheckResponse(res); err != nil {
4692		return nil, err
4693	}
4694	ret := &Operation{
4695		ServerResponse: googleapi.ServerResponse{
4696			Header:         res.Header,
4697			HTTPStatusCode: res.StatusCode,
4698		},
4699	}
4700	target := &ret
4701	if err := gensupport.DecodeResponse(target, res); err != nil {
4702		return nil, err
4703	}
4704	return ret, nil
4705	// {
4706	//   "description": "Starts a notebook instance.",
4707	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:start",
4708	//   "httpMethod": "POST",
4709	//   "id": "notebooks.projects.locations.instances.start",
4710	//   "parameterOrder": [
4711	//     "name"
4712	//   ],
4713	//   "parameters": {
4714	//     "name": {
4715	//       "description": "Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`",
4716	//       "location": "path",
4717	//       "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
4718	//       "required": true,
4719	//       "type": "string"
4720	//     }
4721	//   },
4722	//   "path": "v1/{+name}:start",
4723	//   "request": {
4724	//     "$ref": "StartInstanceRequest"
4725	//   },
4726	//   "response": {
4727	//     "$ref": "Operation"
4728	//   },
4729	//   "scopes": [
4730	//     "https://www.googleapis.com/auth/cloud-platform"
4731	//   ]
4732	// }
4733
4734}
4735
4736// method id "notebooks.projects.locations.instances.stop":
4737
4738type ProjectsLocationsInstancesStopCall struct {
4739	s                   *Service
4740	name                string
4741	stopinstancerequest *StopInstanceRequest
4742	urlParams_          gensupport.URLParams
4743	ctx_                context.Context
4744	header_             http.Header
4745}
4746
4747// Stop: Stops a notebook instance.
4748func (r *ProjectsLocationsInstancesService) Stop(name string, stopinstancerequest *StopInstanceRequest) *ProjectsLocationsInstancesStopCall {
4749	c := &ProjectsLocationsInstancesStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4750	c.name = name
4751	c.stopinstancerequest = stopinstancerequest
4752	return c
4753}
4754
4755// Fields allows partial responses to be retrieved. See
4756// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4757// for more information.
4758func (c *ProjectsLocationsInstancesStopCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesStopCall {
4759	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4760	return c
4761}
4762
4763// Context sets the context to be used in this call's Do method. Any
4764// pending HTTP request will be aborted if the provided context is
4765// canceled.
4766func (c *ProjectsLocationsInstancesStopCall) Context(ctx context.Context) *ProjectsLocationsInstancesStopCall {
4767	c.ctx_ = ctx
4768	return c
4769}
4770
4771// Header returns an http.Header that can be modified by the caller to
4772// add HTTP headers to the request.
4773func (c *ProjectsLocationsInstancesStopCall) Header() http.Header {
4774	if c.header_ == nil {
4775		c.header_ = make(http.Header)
4776	}
4777	return c.header_
4778}
4779
4780func (c *ProjectsLocationsInstancesStopCall) doRequest(alt string) (*http.Response, error) {
4781	reqHeaders := make(http.Header)
4782	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
4783	for k, v := range c.header_ {
4784		reqHeaders[k] = v
4785	}
4786	reqHeaders.Set("User-Agent", c.s.userAgent())
4787	var body io.Reader = nil
4788	body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopinstancerequest)
4789	if err != nil {
4790		return nil, err
4791	}
4792	reqHeaders.Set("Content-Type", "application/json")
4793	c.urlParams_.Set("alt", alt)
4794	c.urlParams_.Set("prettyPrint", "false")
4795	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:stop")
4796	urls += "?" + c.urlParams_.Encode()
4797	req, err := http.NewRequest("POST", urls, body)
4798	if err != nil {
4799		return nil, err
4800	}
4801	req.Header = reqHeaders
4802	googleapi.Expand(req.URL, map[string]string{
4803		"name": c.name,
4804	})
4805	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4806}
4807
4808// Do executes the "notebooks.projects.locations.instances.stop" call.
4809// Exactly one of *Operation or error will be non-nil. Any non-2xx
4810// status code is an error. Response headers are in either
4811// *Operation.ServerResponse.Header or (if a response was returned at
4812// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4813// to check whether the returned error was because
4814// http.StatusNotModified was returned.
4815func (c *ProjectsLocationsInstancesStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
4816	gensupport.SetOptions(c.urlParams_, opts...)
4817	res, err := c.doRequest("json")
4818	if res != nil && res.StatusCode == http.StatusNotModified {
4819		if res.Body != nil {
4820			res.Body.Close()
4821		}
4822		return nil, &googleapi.Error{
4823			Code:   res.StatusCode,
4824			Header: res.Header,
4825		}
4826	}
4827	if err != nil {
4828		return nil, err
4829	}
4830	defer googleapi.CloseBody(res)
4831	if err := googleapi.CheckResponse(res); err != nil {
4832		return nil, err
4833	}
4834	ret := &Operation{
4835		ServerResponse: googleapi.ServerResponse{
4836			Header:         res.Header,
4837			HTTPStatusCode: res.StatusCode,
4838		},
4839	}
4840	target := &ret
4841	if err := gensupport.DecodeResponse(target, res); err != nil {
4842		return nil, err
4843	}
4844	return ret, nil
4845	// {
4846	//   "description": "Stops a notebook instance.",
4847	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:stop",
4848	//   "httpMethod": "POST",
4849	//   "id": "notebooks.projects.locations.instances.stop",
4850	//   "parameterOrder": [
4851	//     "name"
4852	//   ],
4853	//   "parameters": {
4854	//     "name": {
4855	//       "description": "Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`",
4856	//       "location": "path",
4857	//       "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
4858	//       "required": true,
4859	//       "type": "string"
4860	//     }
4861	//   },
4862	//   "path": "v1/{+name}:stop",
4863	//   "request": {
4864	//     "$ref": "StopInstanceRequest"
4865	//   },
4866	//   "response": {
4867	//     "$ref": "Operation"
4868	//   },
4869	//   "scopes": [
4870	//     "https://www.googleapis.com/auth/cloud-platform"
4871	//   ]
4872	// }
4873
4874}
4875
4876// method id "notebooks.projects.locations.instances.testIamPermissions":
4877
4878type ProjectsLocationsInstancesTestIamPermissionsCall struct {
4879	s                         *Service
4880	resource                  string
4881	testiampermissionsrequest *TestIamPermissionsRequest
4882	urlParams_                gensupport.URLParams
4883	ctx_                      context.Context
4884	header_                   http.Header
4885}
4886
4887// TestIamPermissions: Returns permissions that a caller has on the
4888// specified resource. If the resource does not exist, this will return
4889// an empty set of permissions, not a `NOT_FOUND` error. Note: This
4890// operation is designed to be used for building permission-aware UIs
4891// and command-line tools, not for authorization checking. This
4892// operation may "fail open" without warning.
4893func (r *ProjectsLocationsInstancesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsInstancesTestIamPermissionsCall {
4894	c := &ProjectsLocationsInstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4895	c.resource = resource
4896	c.testiampermissionsrequest = testiampermissionsrequest
4897	return c
4898}
4899
4900// Fields allows partial responses to be retrieved. See
4901// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4902// for more information.
4903func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesTestIamPermissionsCall {
4904	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4905	return c
4906}
4907
4908// Context sets the context to be used in this call's Do method. Any
4909// pending HTTP request will be aborted if the provided context is
4910// canceled.
4911func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsInstancesTestIamPermissionsCall {
4912	c.ctx_ = ctx
4913	return c
4914}
4915
4916// Header returns an http.Header that can be modified by the caller to
4917// add HTTP headers to the request.
4918func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Header() http.Header {
4919	if c.header_ == nil {
4920		c.header_ = make(http.Header)
4921	}
4922	return c.header_
4923}
4924
4925func (c *ProjectsLocationsInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
4926	reqHeaders := make(http.Header)
4927	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
4928	for k, v := range c.header_ {
4929		reqHeaders[k] = v
4930	}
4931	reqHeaders.Set("User-Agent", c.s.userAgent())
4932	var body io.Reader = nil
4933	body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
4934	if err != nil {
4935		return nil, err
4936	}
4937	reqHeaders.Set("Content-Type", "application/json")
4938	c.urlParams_.Set("alt", alt)
4939	c.urlParams_.Set("prettyPrint", "false")
4940	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
4941	urls += "?" + c.urlParams_.Encode()
4942	req, err := http.NewRequest("POST", urls, body)
4943	if err != nil {
4944		return nil, err
4945	}
4946	req.Header = reqHeaders
4947	googleapi.Expand(req.URL, map[string]string{
4948		"resource": c.resource,
4949	})
4950	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4951}
4952
4953// Do executes the "notebooks.projects.locations.instances.testIamPermissions" call.
4954// Exactly one of *TestIamPermissionsResponse or error will be non-nil.
4955// Any non-2xx status code is an error. Response headers are in either
4956// *TestIamPermissionsResponse.ServerResponse.Header or (if a response
4957// was returned at all) in error.(*googleapi.Error).Header. Use
4958// googleapi.IsNotModified to check whether the returned error was
4959// because http.StatusNotModified was returned.
4960func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
4961	gensupport.SetOptions(c.urlParams_, opts...)
4962	res, err := c.doRequest("json")
4963	if res != nil && res.StatusCode == http.StatusNotModified {
4964		if res.Body != nil {
4965			res.Body.Close()
4966		}
4967		return nil, &googleapi.Error{
4968			Code:   res.StatusCode,
4969			Header: res.Header,
4970		}
4971	}
4972	if err != nil {
4973		return nil, err
4974	}
4975	defer googleapi.CloseBody(res)
4976	if err := googleapi.CheckResponse(res); err != nil {
4977		return nil, err
4978	}
4979	ret := &TestIamPermissionsResponse{
4980		ServerResponse: googleapi.ServerResponse{
4981			Header:         res.Header,
4982			HTTPStatusCode: res.StatusCode,
4983		},
4984	}
4985	target := &ret
4986	if err := gensupport.DecodeResponse(target, res); err != nil {
4987		return nil, err
4988	}
4989	return ret, nil
4990	// {
4991	//   "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.",
4992	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:testIamPermissions",
4993	//   "httpMethod": "POST",
4994	//   "id": "notebooks.projects.locations.instances.testIamPermissions",
4995	//   "parameterOrder": [
4996	//     "resource"
4997	//   ],
4998	//   "parameters": {
4999	//     "resource": {
5000	//       "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
5001	//       "location": "path",
5002	//       "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
5003	//       "required": true,
5004	//       "type": "string"
5005	//     }
5006	//   },
5007	//   "path": "v1/{+resource}:testIamPermissions",
5008	//   "request": {
5009	//     "$ref": "TestIamPermissionsRequest"
5010	//   },
5011	//   "response": {
5012	//     "$ref": "TestIamPermissionsResponse"
5013	//   },
5014	//   "scopes": [
5015	//     "https://www.googleapis.com/auth/cloud-platform"
5016	//   ]
5017	// }
5018
5019}
5020
5021// method id "notebooks.projects.locations.instances.upgrade":
5022
5023type ProjectsLocationsInstancesUpgradeCall struct {
5024	s                      *Service
5025	name                   string
5026	upgradeinstancerequest *UpgradeInstanceRequest
5027	urlParams_             gensupport.URLParams
5028	ctx_                   context.Context
5029	header_                http.Header
5030}
5031
5032// Upgrade: Upgrades a notebook instance to the latest version.
5033func (r *ProjectsLocationsInstancesService) Upgrade(name string, upgradeinstancerequest *UpgradeInstanceRequest) *ProjectsLocationsInstancesUpgradeCall {
5034	c := &ProjectsLocationsInstancesUpgradeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5035	c.name = name
5036	c.upgradeinstancerequest = upgradeinstancerequest
5037	return c
5038}
5039
5040// Fields allows partial responses to be retrieved. See
5041// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5042// for more information.
5043func (c *ProjectsLocationsInstancesUpgradeCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesUpgradeCall {
5044	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5045	return c
5046}
5047
5048// Context sets the context to be used in this call's Do method. Any
5049// pending HTTP request will be aborted if the provided context is
5050// canceled.
5051func (c *ProjectsLocationsInstancesUpgradeCall) Context(ctx context.Context) *ProjectsLocationsInstancesUpgradeCall {
5052	c.ctx_ = ctx
5053	return c
5054}
5055
5056// Header returns an http.Header that can be modified by the caller to
5057// add HTTP headers to the request.
5058func (c *ProjectsLocationsInstancesUpgradeCall) Header() http.Header {
5059	if c.header_ == nil {
5060		c.header_ = make(http.Header)
5061	}
5062	return c.header_
5063}
5064
5065func (c *ProjectsLocationsInstancesUpgradeCall) doRequest(alt string) (*http.Response, error) {
5066	reqHeaders := make(http.Header)
5067	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
5068	for k, v := range c.header_ {
5069		reqHeaders[k] = v
5070	}
5071	reqHeaders.Set("User-Agent", c.s.userAgent())
5072	var body io.Reader = nil
5073	body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeinstancerequest)
5074	if err != nil {
5075		return nil, err
5076	}
5077	reqHeaders.Set("Content-Type", "application/json")
5078	c.urlParams_.Set("alt", alt)
5079	c.urlParams_.Set("prettyPrint", "false")
5080	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:upgrade")
5081	urls += "?" + c.urlParams_.Encode()
5082	req, err := http.NewRequest("POST", urls, body)
5083	if err != nil {
5084		return nil, err
5085	}
5086	req.Header = reqHeaders
5087	googleapi.Expand(req.URL, map[string]string{
5088		"name": c.name,
5089	})
5090	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5091}
5092
5093// Do executes the "notebooks.projects.locations.instances.upgrade" call.
5094// Exactly one of *Operation or error will be non-nil. Any non-2xx
5095// status code is an error. Response headers are in either
5096// *Operation.ServerResponse.Header or (if a response was returned at
5097// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5098// to check whether the returned error was because
5099// http.StatusNotModified was returned.
5100func (c *ProjectsLocationsInstancesUpgradeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5101	gensupport.SetOptions(c.urlParams_, opts...)
5102	res, err := c.doRequest("json")
5103	if res != nil && res.StatusCode == http.StatusNotModified {
5104		if res.Body != nil {
5105			res.Body.Close()
5106		}
5107		return nil, &googleapi.Error{
5108			Code:   res.StatusCode,
5109			Header: res.Header,
5110		}
5111	}
5112	if err != nil {
5113		return nil, err
5114	}
5115	defer googleapi.CloseBody(res)
5116	if err := googleapi.CheckResponse(res); err != nil {
5117		return nil, err
5118	}
5119	ret := &Operation{
5120		ServerResponse: googleapi.ServerResponse{
5121			Header:         res.Header,
5122			HTTPStatusCode: res.StatusCode,
5123		},
5124	}
5125	target := &ret
5126	if err := gensupport.DecodeResponse(target, res); err != nil {
5127		return nil, err
5128	}
5129	return ret, nil
5130	// {
5131	//   "description": "Upgrades a notebook instance to the latest version.",
5132	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:upgrade",
5133	//   "httpMethod": "POST",
5134	//   "id": "notebooks.projects.locations.instances.upgrade",
5135	//   "parameterOrder": [
5136	//     "name"
5137	//   ],
5138	//   "parameters": {
5139	//     "name": {
5140	//       "description": "Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`",
5141	//       "location": "path",
5142	//       "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
5143	//       "required": true,
5144	//       "type": "string"
5145	//     }
5146	//   },
5147	//   "path": "v1/{+name}:upgrade",
5148	//   "request": {
5149	//     "$ref": "UpgradeInstanceRequest"
5150	//   },
5151	//   "response": {
5152	//     "$ref": "Operation"
5153	//   },
5154	//   "scopes": [
5155	//     "https://www.googleapis.com/auth/cloud-platform"
5156	//   ]
5157	// }
5158
5159}
5160
5161// method id "notebooks.projects.locations.instances.upgradeInternal":
5162
5163type ProjectsLocationsInstancesUpgradeInternalCall struct {
5164	s                              *Service
5165	name                           string
5166	upgradeinstanceinternalrequest *UpgradeInstanceInternalRequest
5167	urlParams_                     gensupport.URLParams
5168	ctx_                           context.Context
5169	header_                        http.Header
5170}
5171
5172// UpgradeInternal: Allows notebook instances to call this endpoint to
5173// upgrade themselves. Do not use this method directly.
5174func (r *ProjectsLocationsInstancesService) UpgradeInternal(name string, upgradeinstanceinternalrequest *UpgradeInstanceInternalRequest) *ProjectsLocationsInstancesUpgradeInternalCall {
5175	c := &ProjectsLocationsInstancesUpgradeInternalCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5176	c.name = name
5177	c.upgradeinstanceinternalrequest = upgradeinstanceinternalrequest
5178	return c
5179}
5180
5181// Fields allows partial responses to be retrieved. See
5182// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5183// for more information.
5184func (c *ProjectsLocationsInstancesUpgradeInternalCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesUpgradeInternalCall {
5185	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5186	return c
5187}
5188
5189// Context sets the context to be used in this call's Do method. Any
5190// pending HTTP request will be aborted if the provided context is
5191// canceled.
5192func (c *ProjectsLocationsInstancesUpgradeInternalCall) Context(ctx context.Context) *ProjectsLocationsInstancesUpgradeInternalCall {
5193	c.ctx_ = ctx
5194	return c
5195}
5196
5197// Header returns an http.Header that can be modified by the caller to
5198// add HTTP headers to the request.
5199func (c *ProjectsLocationsInstancesUpgradeInternalCall) Header() http.Header {
5200	if c.header_ == nil {
5201		c.header_ = make(http.Header)
5202	}
5203	return c.header_
5204}
5205
5206func (c *ProjectsLocationsInstancesUpgradeInternalCall) doRequest(alt string) (*http.Response, error) {
5207	reqHeaders := make(http.Header)
5208	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
5209	for k, v := range c.header_ {
5210		reqHeaders[k] = v
5211	}
5212	reqHeaders.Set("User-Agent", c.s.userAgent())
5213	var body io.Reader = nil
5214	body, err := googleapi.WithoutDataWrapper.JSONReader(c.upgradeinstanceinternalrequest)
5215	if err != nil {
5216		return nil, err
5217	}
5218	reqHeaders.Set("Content-Type", "application/json")
5219	c.urlParams_.Set("alt", alt)
5220	c.urlParams_.Set("prettyPrint", "false")
5221	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:upgradeInternal")
5222	urls += "?" + c.urlParams_.Encode()
5223	req, err := http.NewRequest("POST", urls, body)
5224	if err != nil {
5225		return nil, err
5226	}
5227	req.Header = reqHeaders
5228	googleapi.Expand(req.URL, map[string]string{
5229		"name": c.name,
5230	})
5231	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5232}
5233
5234// Do executes the "notebooks.projects.locations.instances.upgradeInternal" call.
5235// Exactly one of *Operation or error will be non-nil. Any non-2xx
5236// status code is an error. Response headers are in either
5237// *Operation.ServerResponse.Header or (if a response was returned at
5238// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5239// to check whether the returned error was because
5240// http.StatusNotModified was returned.
5241func (c *ProjectsLocationsInstancesUpgradeInternalCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5242	gensupport.SetOptions(c.urlParams_, opts...)
5243	res, err := c.doRequest("json")
5244	if res != nil && res.StatusCode == http.StatusNotModified {
5245		if res.Body != nil {
5246			res.Body.Close()
5247		}
5248		return nil, &googleapi.Error{
5249			Code:   res.StatusCode,
5250			Header: res.Header,
5251		}
5252	}
5253	if err != nil {
5254		return nil, err
5255	}
5256	defer googleapi.CloseBody(res)
5257	if err := googleapi.CheckResponse(res); err != nil {
5258		return nil, err
5259	}
5260	ret := &Operation{
5261		ServerResponse: googleapi.ServerResponse{
5262			Header:         res.Header,
5263			HTTPStatusCode: res.StatusCode,
5264		},
5265	}
5266	target := &ret
5267	if err := gensupport.DecodeResponse(target, res); err != nil {
5268		return nil, err
5269	}
5270	return ret, nil
5271	// {
5272	//   "description": "Allows notebook instances to call this endpoint to upgrade themselves. Do not use this method directly.",
5273	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/instances/{instancesId}:upgradeInternal",
5274	//   "httpMethod": "POST",
5275	//   "id": "notebooks.projects.locations.instances.upgradeInternal",
5276	//   "parameterOrder": [
5277	//     "name"
5278	//   ],
5279	//   "parameters": {
5280	//     "name": {
5281	//       "description": "Required. Format: `projects/{project_id}/locations/{location}/instances/{instance_id}`",
5282	//       "location": "path",
5283	//       "pattern": "^projects/[^/]+/locations/[^/]+/instances/[^/]+$",
5284	//       "required": true,
5285	//       "type": "string"
5286	//     }
5287	//   },
5288	//   "path": "v1/{+name}:upgradeInternal",
5289	//   "request": {
5290	//     "$ref": "UpgradeInstanceInternalRequest"
5291	//   },
5292	//   "response": {
5293	//     "$ref": "Operation"
5294	//   },
5295	//   "scopes": [
5296	//     "https://www.googleapis.com/auth/cloud-platform"
5297	//   ]
5298	// }
5299
5300}
5301
5302// method id "notebooks.projects.locations.operations.cancel":
5303
5304type ProjectsLocationsOperationsCancelCall struct {
5305	s                      *Service
5306	name                   string
5307	canceloperationrequest *CancelOperationRequest
5308	urlParams_             gensupport.URLParams
5309	ctx_                   context.Context
5310	header_                http.Header
5311}
5312
5313// Cancel: Starts asynchronous cancellation on a long-running operation.
5314// The server makes a best effort to cancel the operation, but success
5315// is not guaranteed. If the server doesn't support this method, it
5316// returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use
5317// Operations.GetOperation or other methods to check whether the
5318// cancellation succeeded or whether the operation completed despite
5319// cancellation. On successful cancellation, the operation is not
5320// deleted; instead, it becomes an operation with an Operation.error
5321// value with a google.rpc.Status.code of 1, corresponding to
5322// `Code.CANCELLED`.
5323func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
5324	c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5325	c.name = name
5326	c.canceloperationrequest = canceloperationrequest
5327	return c
5328}
5329
5330// Fields allows partial responses to be retrieved. See
5331// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5332// for more information.
5333func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
5334	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5335	return c
5336}
5337
5338// Context sets the context to be used in this call's Do method. Any
5339// pending HTTP request will be aborted if the provided context is
5340// canceled.
5341func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
5342	c.ctx_ = ctx
5343	return c
5344}
5345
5346// Header returns an http.Header that can be modified by the caller to
5347// add HTTP headers to the request.
5348func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
5349	if c.header_ == nil {
5350		c.header_ = make(http.Header)
5351	}
5352	return c.header_
5353}
5354
5355func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
5356	reqHeaders := make(http.Header)
5357	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
5358	for k, v := range c.header_ {
5359		reqHeaders[k] = v
5360	}
5361	reqHeaders.Set("User-Agent", c.s.userAgent())
5362	var body io.Reader = nil
5363	body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
5364	if err != nil {
5365		return nil, err
5366	}
5367	reqHeaders.Set("Content-Type", "application/json")
5368	c.urlParams_.Set("alt", alt)
5369	c.urlParams_.Set("prettyPrint", "false")
5370	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
5371	urls += "?" + c.urlParams_.Encode()
5372	req, err := http.NewRequest("POST", urls, body)
5373	if err != nil {
5374		return nil, err
5375	}
5376	req.Header = reqHeaders
5377	googleapi.Expand(req.URL, map[string]string{
5378		"name": c.name,
5379	})
5380	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5381}
5382
5383// Do executes the "notebooks.projects.locations.operations.cancel" call.
5384// Exactly one of *Empty or error will be non-nil. Any non-2xx status
5385// code is an error. Response headers are in either
5386// *Empty.ServerResponse.Header or (if a response was returned at all)
5387// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5388// check whether the returned error was because http.StatusNotModified
5389// was returned.
5390func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
5391	gensupport.SetOptions(c.urlParams_, opts...)
5392	res, err := c.doRequest("json")
5393	if res != nil && res.StatusCode == http.StatusNotModified {
5394		if res.Body != nil {
5395			res.Body.Close()
5396		}
5397		return nil, &googleapi.Error{
5398			Code:   res.StatusCode,
5399			Header: res.Header,
5400		}
5401	}
5402	if err != nil {
5403		return nil, err
5404	}
5405	defer googleapi.CloseBody(res)
5406	if err := googleapi.CheckResponse(res); err != nil {
5407		return nil, err
5408	}
5409	ret := &Empty{
5410		ServerResponse: googleapi.ServerResponse{
5411			Header:         res.Header,
5412			HTTPStatusCode: res.StatusCode,
5413		},
5414	}
5415	target := &ret
5416	if err := gensupport.DecodeResponse(target, res); err != nil {
5417		return nil, err
5418	}
5419	return ret, nil
5420	// {
5421	//   "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.",
5422	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel",
5423	//   "httpMethod": "POST",
5424	//   "id": "notebooks.projects.locations.operations.cancel",
5425	//   "parameterOrder": [
5426	//     "name"
5427	//   ],
5428	//   "parameters": {
5429	//     "name": {
5430	//       "description": "The name of the operation resource to be cancelled.",
5431	//       "location": "path",
5432	//       "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
5433	//       "required": true,
5434	//       "type": "string"
5435	//     }
5436	//   },
5437	//   "path": "v1/{+name}:cancel",
5438	//   "request": {
5439	//     "$ref": "CancelOperationRequest"
5440	//   },
5441	//   "response": {
5442	//     "$ref": "Empty"
5443	//   },
5444	//   "scopes": [
5445	//     "https://www.googleapis.com/auth/cloud-platform"
5446	//   ]
5447	// }
5448
5449}
5450
5451// method id "notebooks.projects.locations.operations.delete":
5452
5453type ProjectsLocationsOperationsDeleteCall struct {
5454	s          *Service
5455	name       string
5456	urlParams_ gensupport.URLParams
5457	ctx_       context.Context
5458	header_    http.Header
5459}
5460
5461// Delete: Deletes a long-running operation. This method indicates that
5462// the client is no longer interested in the operation result. It does
5463// not cancel the operation. If the server doesn't support this method,
5464// it returns `google.rpc.Code.UNIMPLEMENTED`.
5465func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
5466	c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5467	c.name = name
5468	return c
5469}
5470
5471// Fields allows partial responses to be retrieved. See
5472// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5473// for more information.
5474func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
5475	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5476	return c
5477}
5478
5479// Context sets the context to be used in this call's Do method. Any
5480// pending HTTP request will be aborted if the provided context is
5481// canceled.
5482func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
5483	c.ctx_ = ctx
5484	return c
5485}
5486
5487// Header returns an http.Header that can be modified by the caller to
5488// add HTTP headers to the request.
5489func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
5490	if c.header_ == nil {
5491		c.header_ = make(http.Header)
5492	}
5493	return c.header_
5494}
5495
5496func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
5497	reqHeaders := make(http.Header)
5498	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
5499	for k, v := range c.header_ {
5500		reqHeaders[k] = v
5501	}
5502	reqHeaders.Set("User-Agent", c.s.userAgent())
5503	var body io.Reader = nil
5504	c.urlParams_.Set("alt", alt)
5505	c.urlParams_.Set("prettyPrint", "false")
5506	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5507	urls += "?" + c.urlParams_.Encode()
5508	req, err := http.NewRequest("DELETE", urls, body)
5509	if err != nil {
5510		return nil, err
5511	}
5512	req.Header = reqHeaders
5513	googleapi.Expand(req.URL, map[string]string{
5514		"name": c.name,
5515	})
5516	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5517}
5518
5519// Do executes the "notebooks.projects.locations.operations.delete" call.
5520// Exactly one of *Empty or error will be non-nil. Any non-2xx status
5521// code is an error. Response headers are in either
5522// *Empty.ServerResponse.Header or (if a response was returned at all)
5523// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5524// check whether the returned error was because http.StatusNotModified
5525// was returned.
5526func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
5527	gensupport.SetOptions(c.urlParams_, opts...)
5528	res, err := c.doRequest("json")
5529	if res != nil && res.StatusCode == http.StatusNotModified {
5530		if res.Body != nil {
5531			res.Body.Close()
5532		}
5533		return nil, &googleapi.Error{
5534			Code:   res.StatusCode,
5535			Header: res.Header,
5536		}
5537	}
5538	if err != nil {
5539		return nil, err
5540	}
5541	defer googleapi.CloseBody(res)
5542	if err := googleapi.CheckResponse(res); err != nil {
5543		return nil, err
5544	}
5545	ret := &Empty{
5546		ServerResponse: googleapi.ServerResponse{
5547			Header:         res.Header,
5548			HTTPStatusCode: res.StatusCode,
5549		},
5550	}
5551	target := &ret
5552	if err := gensupport.DecodeResponse(target, res); err != nil {
5553		return nil, err
5554	}
5555	return ret, nil
5556	// {
5557	//   "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.",
5558	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}",
5559	//   "httpMethod": "DELETE",
5560	//   "id": "notebooks.projects.locations.operations.delete",
5561	//   "parameterOrder": [
5562	//     "name"
5563	//   ],
5564	//   "parameters": {
5565	//     "name": {
5566	//       "description": "The name of the operation resource to be deleted.",
5567	//       "location": "path",
5568	//       "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
5569	//       "required": true,
5570	//       "type": "string"
5571	//     }
5572	//   },
5573	//   "path": "v1/{+name}",
5574	//   "response": {
5575	//     "$ref": "Empty"
5576	//   },
5577	//   "scopes": [
5578	//     "https://www.googleapis.com/auth/cloud-platform"
5579	//   ]
5580	// }
5581
5582}
5583
5584// method id "notebooks.projects.locations.operations.get":
5585
5586type ProjectsLocationsOperationsGetCall struct {
5587	s            *Service
5588	name         string
5589	urlParams_   gensupport.URLParams
5590	ifNoneMatch_ string
5591	ctx_         context.Context
5592	header_      http.Header
5593}
5594
5595// Get: Gets the latest state of a long-running operation. Clients can
5596// use this method to poll the operation result at intervals as
5597// recommended by the API service.
5598func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
5599	c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5600	c.name = name
5601	return c
5602}
5603
5604// Fields allows partial responses to be retrieved. See
5605// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5606// for more information.
5607func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
5608	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5609	return c
5610}
5611
5612// IfNoneMatch sets the optional parameter which makes the operation
5613// fail if the object's ETag matches the given value. This is useful for
5614// getting updates only after the object has changed since the last
5615// request. Use googleapi.IsNotModified to check whether the response
5616// error from Do is the result of In-None-Match.
5617func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
5618	c.ifNoneMatch_ = entityTag
5619	return c
5620}
5621
5622// Context sets the context to be used in this call's Do method. Any
5623// pending HTTP request will be aborted if the provided context is
5624// canceled.
5625func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
5626	c.ctx_ = ctx
5627	return c
5628}
5629
5630// Header returns an http.Header that can be modified by the caller to
5631// add HTTP headers to the request.
5632func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
5633	if c.header_ == nil {
5634		c.header_ = make(http.Header)
5635	}
5636	return c.header_
5637}
5638
5639func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
5640	reqHeaders := make(http.Header)
5641	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
5642	for k, v := range c.header_ {
5643		reqHeaders[k] = v
5644	}
5645	reqHeaders.Set("User-Agent", c.s.userAgent())
5646	if c.ifNoneMatch_ != "" {
5647		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5648	}
5649	var body io.Reader = nil
5650	c.urlParams_.Set("alt", alt)
5651	c.urlParams_.Set("prettyPrint", "false")
5652	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5653	urls += "?" + c.urlParams_.Encode()
5654	req, err := http.NewRequest("GET", urls, body)
5655	if err != nil {
5656		return nil, err
5657	}
5658	req.Header = reqHeaders
5659	googleapi.Expand(req.URL, map[string]string{
5660		"name": c.name,
5661	})
5662	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5663}
5664
5665// Do executes the "notebooks.projects.locations.operations.get" call.
5666// Exactly one of *Operation or error will be non-nil. Any non-2xx
5667// status code is an error. Response headers are in either
5668// *Operation.ServerResponse.Header or (if a response was returned at
5669// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5670// to check whether the returned error was because
5671// http.StatusNotModified was returned.
5672func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
5673	gensupport.SetOptions(c.urlParams_, opts...)
5674	res, err := c.doRequest("json")
5675	if res != nil && res.StatusCode == http.StatusNotModified {
5676		if res.Body != nil {
5677			res.Body.Close()
5678		}
5679		return nil, &googleapi.Error{
5680			Code:   res.StatusCode,
5681			Header: res.Header,
5682		}
5683	}
5684	if err != nil {
5685		return nil, err
5686	}
5687	defer googleapi.CloseBody(res)
5688	if err := googleapi.CheckResponse(res); err != nil {
5689		return nil, err
5690	}
5691	ret := &Operation{
5692		ServerResponse: googleapi.ServerResponse{
5693			Header:         res.Header,
5694			HTTPStatusCode: res.StatusCode,
5695		},
5696	}
5697	target := &ret
5698	if err := gensupport.DecodeResponse(target, res); err != nil {
5699		return nil, err
5700	}
5701	return ret, nil
5702	// {
5703	//   "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
5704	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}",
5705	//   "httpMethod": "GET",
5706	//   "id": "notebooks.projects.locations.operations.get",
5707	//   "parameterOrder": [
5708	//     "name"
5709	//   ],
5710	//   "parameters": {
5711	//     "name": {
5712	//       "description": "The name of the operation resource.",
5713	//       "location": "path",
5714	//       "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
5715	//       "required": true,
5716	//       "type": "string"
5717	//     }
5718	//   },
5719	//   "path": "v1/{+name}",
5720	//   "response": {
5721	//     "$ref": "Operation"
5722	//   },
5723	//   "scopes": [
5724	//     "https://www.googleapis.com/auth/cloud-platform"
5725	//   ]
5726	// }
5727
5728}
5729
5730// method id "notebooks.projects.locations.operations.list":
5731
5732type ProjectsLocationsOperationsListCall struct {
5733	s            *Service
5734	name         string
5735	urlParams_   gensupport.URLParams
5736	ifNoneMatch_ string
5737	ctx_         context.Context
5738	header_      http.Header
5739}
5740
5741// List: Lists operations that match the specified filter in the
5742// request. If the server doesn't support this method, it returns
5743// `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to
5744// override the binding to use different resource name schemes, such as
5745// `users/*/operations`. To override the binding, API services can add a
5746// binding such as "/v1/{name=users/*}/operations" to their service
5747// configuration. For backwards compatibility, the default name includes
5748// the operations collection id, however overriding users must ensure
5749// the name binding is the parent resource, without the operations
5750// collection id.
5751func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
5752	c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5753	c.name = name
5754	return c
5755}
5756
5757// Filter sets the optional parameter "filter": The standard list
5758// filter.
5759func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
5760	c.urlParams_.Set("filter", filter)
5761	return c
5762}
5763
5764// PageSize sets the optional parameter "pageSize": The standard list
5765// page size.
5766func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
5767	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5768	return c
5769}
5770
5771// PageToken sets the optional parameter "pageToken": The standard list
5772// page token.
5773func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
5774	c.urlParams_.Set("pageToken", pageToken)
5775	return c
5776}
5777
5778// Fields allows partial responses to be retrieved. See
5779// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5780// for more information.
5781func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
5782	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5783	return c
5784}
5785
5786// IfNoneMatch sets the optional parameter which makes the operation
5787// fail if the object's ETag matches the given value. This is useful for
5788// getting updates only after the object has changed since the last
5789// request. Use googleapi.IsNotModified to check whether the response
5790// error from Do is the result of In-None-Match.
5791func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
5792	c.ifNoneMatch_ = entityTag
5793	return c
5794}
5795
5796// Context sets the context to be used in this call's Do method. Any
5797// pending HTTP request will be aborted if the provided context is
5798// canceled.
5799func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
5800	c.ctx_ = ctx
5801	return c
5802}
5803
5804// Header returns an http.Header that can be modified by the caller to
5805// add HTTP headers to the request.
5806func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
5807	if c.header_ == nil {
5808		c.header_ = make(http.Header)
5809	}
5810	return c.header_
5811}
5812
5813func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
5814	reqHeaders := make(http.Header)
5815	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201124")
5816	for k, v := range c.header_ {
5817		reqHeaders[k] = v
5818	}
5819	reqHeaders.Set("User-Agent", c.s.userAgent())
5820	if c.ifNoneMatch_ != "" {
5821		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5822	}
5823	var body io.Reader = nil
5824	c.urlParams_.Set("alt", alt)
5825	c.urlParams_.Set("prettyPrint", "false")
5826	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
5827	urls += "?" + c.urlParams_.Encode()
5828	req, err := http.NewRequest("GET", urls, body)
5829	if err != nil {
5830		return nil, err
5831	}
5832	req.Header = reqHeaders
5833	googleapi.Expand(req.URL, map[string]string{
5834		"name": c.name,
5835	})
5836	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5837}
5838
5839// Do executes the "notebooks.projects.locations.operations.list" call.
5840// Exactly one of *ListOperationsResponse or error will be non-nil. Any
5841// non-2xx status code is an error. Response headers are in either
5842// *ListOperationsResponse.ServerResponse.Header or (if a response was
5843// returned at all) in error.(*googleapi.Error).Header. Use
5844// googleapi.IsNotModified to check whether the returned error was
5845// because http.StatusNotModified was returned.
5846func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
5847	gensupport.SetOptions(c.urlParams_, opts...)
5848	res, err := c.doRequest("json")
5849	if res != nil && res.StatusCode == http.StatusNotModified {
5850		if res.Body != nil {
5851			res.Body.Close()
5852		}
5853		return nil, &googleapi.Error{
5854			Code:   res.StatusCode,
5855			Header: res.Header,
5856		}
5857	}
5858	if err != nil {
5859		return nil, err
5860	}
5861	defer googleapi.CloseBody(res)
5862	if err := googleapi.CheckResponse(res); err != nil {
5863		return nil, err
5864	}
5865	ret := &ListOperationsResponse{
5866		ServerResponse: googleapi.ServerResponse{
5867			Header:         res.Header,
5868			HTTPStatusCode: res.StatusCode,
5869		},
5870	}
5871	target := &ret
5872	if err := gensupport.DecodeResponse(target, res); err != nil {
5873		return nil, err
5874	}
5875	return ret, nil
5876	// {
5877	//   "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.",
5878	//   "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations",
5879	//   "httpMethod": "GET",
5880	//   "id": "notebooks.projects.locations.operations.list",
5881	//   "parameterOrder": [
5882	//     "name"
5883	//   ],
5884	//   "parameters": {
5885	//     "filter": {
5886	//       "description": "The standard list filter.",
5887	//       "location": "query",
5888	//       "type": "string"
5889	//     },
5890	//     "name": {
5891	//       "description": "The name of the operation's parent resource.",
5892	//       "location": "path",
5893	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
5894	//       "required": true,
5895	//       "type": "string"
5896	//     },
5897	//     "pageSize": {
5898	//       "description": "The standard list page size.",
5899	//       "format": "int32",
5900	//       "location": "query",
5901	//       "type": "integer"
5902	//     },
5903	//     "pageToken": {
5904	//       "description": "The standard list page token.",
5905	//       "location": "query",
5906	//       "type": "string"
5907	//     }
5908	//   },
5909	//   "path": "v1/{+name}/operations",
5910	//   "response": {
5911	//     "$ref": "ListOperationsResponse"
5912	//   },
5913	//   "scopes": [
5914	//     "https://www.googleapis.com/auth/cloud-platform"
5915	//   ]
5916	// }
5917
5918}
5919
5920// Pages invokes f for each page of results.
5921// A non-nil error returned from f will halt the iteration.
5922// The provided context supersedes any context provided to the Context method.
5923func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
5924	c.ctx_ = ctx
5925	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
5926	for {
5927		x, err := c.Do()
5928		if err != nil {
5929			return err
5930		}
5931		if err := f(x); err != nil {
5932			return err
5933		}
5934		if x.NextPageToken == "" {
5935			return nil
5936		}
5937		c.PageToken(x.NextPageToken)
5938	}
5939}
5940