...

Source file src/google.golang.org/api/cloudshell/v1/cloudshell-gen.go

Documentation: google.golang.org/api/cloudshell/v1

     1  // Copyright 2024 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package cloudshell provides access to the Cloud Shell API.
     8  //
     9  // For product documentation, see: https://cloud.google.com/shell/docs/
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/cloudshell/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	cloudshellService, err := cloudshell.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // To use an API key for authentication (note: some APIs do not support API
    38  // keys), use [google.golang.org/api/option.WithAPIKey]:
    39  //
    40  //	cloudshellService, err := cloudshell.NewService(ctx, option.WithAPIKey("AIza..."))
    41  //
    42  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    43  // flow, use [google.golang.org/api/option.WithTokenSource]:
    44  //
    45  //	config := &oauth2.Config{...}
    46  //	// ...
    47  //	token, err := config.Exchange(ctx, ...)
    48  //	cloudshellService, err := cloudshell.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package cloudshell // import "google.golang.org/api/cloudshell/v1"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "cloudshell:v1"
    90  const apiName = "cloudshell"
    91  const apiVersion = "v1"
    92  const basePath = "https://cloudshell.googleapis.com/"
    93  const basePathTemplate = "https://cloudshell.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://cloudshell.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// See, edit, configure, and delete your Google Cloud data and see the email
    99  	// address for your Google Account.
   100  	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
   101  )
   102  
   103  // NewService creates a new Service.
   104  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   105  	scopesOption := internaloption.WithDefaultScopes(
   106  		"https://www.googleapis.com/auth/cloud-platform",
   107  	)
   108  	// NOTE: prepend, so we don't override user-specified scopes.
   109  	opts = append([]option.ClientOption{scopesOption}, opts...)
   110  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   111  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   112  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   113  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   114  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   115  	if err != nil {
   116  		return nil, err
   117  	}
   118  	s, err := New(client)
   119  	if err != nil {
   120  		return nil, err
   121  	}
   122  	if endpoint != "" {
   123  		s.BasePath = endpoint
   124  	}
   125  	return s, nil
   126  }
   127  
   128  // New creates a new Service. It uses the provided http.Client for requests.
   129  //
   130  // Deprecated: please use NewService instead.
   131  // To provide a custom HTTP client, use option.WithHTTPClient.
   132  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   133  func New(client *http.Client) (*Service, error) {
   134  	if client == nil {
   135  		return nil, errors.New("client is nil")
   136  	}
   137  	s := &Service{client: client, BasePath: basePath}
   138  	s.Operations = NewOperationsService(s)
   139  	s.Users = NewUsersService(s)
   140  	return s, nil
   141  }
   142  
   143  type Service struct {
   144  	client    *http.Client
   145  	BasePath  string // API endpoint base URL
   146  	UserAgent string // optional additional User-Agent fragment
   147  
   148  	Operations *OperationsService
   149  
   150  	Users *UsersService
   151  }
   152  
   153  func (s *Service) userAgent() string {
   154  	if s.UserAgent == "" {
   155  		return googleapi.UserAgent
   156  	}
   157  	return googleapi.UserAgent + " " + s.UserAgent
   158  }
   159  
   160  func NewOperationsService(s *Service) *OperationsService {
   161  	rs := &OperationsService{s: s}
   162  	return rs
   163  }
   164  
   165  type OperationsService struct {
   166  	s *Service
   167  }
   168  
   169  func NewUsersService(s *Service) *UsersService {
   170  	rs := &UsersService{s: s}
   171  	rs.Environments = NewUsersEnvironmentsService(s)
   172  	return rs
   173  }
   174  
   175  type UsersService struct {
   176  	s *Service
   177  
   178  	Environments *UsersEnvironmentsService
   179  }
   180  
   181  func NewUsersEnvironmentsService(s *Service) *UsersEnvironmentsService {
   182  	rs := &UsersEnvironmentsService{s: s}
   183  	return rs
   184  }
   185  
   186  type UsersEnvironmentsService struct {
   187  	s *Service
   188  }
   189  
   190  // AddPublicKeyMetadata: Message included in the metadata field of operations
   191  // returned from AddPublicKey.
   192  type AddPublicKeyMetadata struct {
   193  }
   194  
   195  // AddPublicKeyRequest: Request message for AddPublicKey.
   196  type AddPublicKeyRequest struct {
   197  	// Key: Key that should be added to the environment. Supported formats are
   198  	// `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256` (see
   199  	// RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and `ecdsa-sha2-nistp521` (see
   200  	// RFC5656). It should be structured as <format> <content>, where <content>
   201  	// part is encoded with Base64.
   202  	Key string `json:"key,omitempty"`
   203  	// ForceSendFields is a list of field names (e.g. "Key") to unconditionally
   204  	// include in API requests. By default, fields with empty or default values are
   205  	// omitted from API requests. See
   206  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   207  	// details.
   208  	ForceSendFields []string `json:"-"`
   209  	// NullFields is a list of field names (e.g. "Key") to include in API requests
   210  	// with the JSON null value. By default, fields with empty values are omitted
   211  	// from API requests. See
   212  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   213  	NullFields []string `json:"-"`
   214  }
   215  
   216  func (s *AddPublicKeyRequest) MarshalJSON() ([]byte, error) {
   217  	type NoMethod AddPublicKeyRequest
   218  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   219  }
   220  
   221  // AddPublicKeyResponse: Response message for AddPublicKey.
   222  type AddPublicKeyResponse struct {
   223  	// Key: Key that was added to the environment.
   224  	Key string `json:"key,omitempty"`
   225  	// ForceSendFields is a list of field names (e.g. "Key") to unconditionally
   226  	// include in API requests. By default, fields with empty or default values are
   227  	// omitted from API requests. See
   228  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   229  	// details.
   230  	ForceSendFields []string `json:"-"`
   231  	// NullFields is a list of field names (e.g. "Key") to include in API requests
   232  	// with the JSON null value. By default, fields with empty values are omitted
   233  	// from API requests. See
   234  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   235  	NullFields []string `json:"-"`
   236  }
   237  
   238  func (s *AddPublicKeyResponse) MarshalJSON() ([]byte, error) {
   239  	type NoMethod AddPublicKeyResponse
   240  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   241  }
   242  
   243  // AuthorizeEnvironmentMetadata: Message included in the metadata field of
   244  // operations returned from AuthorizeEnvironment.
   245  type AuthorizeEnvironmentMetadata struct {
   246  }
   247  
   248  // AuthorizeEnvironmentRequest: Request message for AuthorizeEnvironment.
   249  type AuthorizeEnvironmentRequest struct {
   250  	// AccessToken: The OAuth access token that should be sent to the environment.
   251  	AccessToken string `json:"accessToken,omitempty"`
   252  	// ExpireTime: The time when the credentials expire. If not set, defaults to
   253  	// one hour from when the server received the request.
   254  	ExpireTime string `json:"expireTime,omitempty"`
   255  	// IdToken: The OAuth ID token that should be sent to the environment.
   256  	IdToken string `json:"idToken,omitempty"`
   257  	// ForceSendFields is a list of field names (e.g. "AccessToken") to
   258  	// unconditionally include in API requests. By default, fields with empty or
   259  	// default values are omitted from API requests. See
   260  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   261  	// details.
   262  	ForceSendFields []string `json:"-"`
   263  	// NullFields is a list of field names (e.g. "AccessToken") to include in API
   264  	// requests with the JSON null value. By default, fields with empty values are
   265  	// omitted from API requests. See
   266  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   267  	NullFields []string `json:"-"`
   268  }
   269  
   270  func (s *AuthorizeEnvironmentRequest) MarshalJSON() ([]byte, error) {
   271  	type NoMethod AuthorizeEnvironmentRequest
   272  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   273  }
   274  
   275  // AuthorizeEnvironmentResponse: Response message for AuthorizeEnvironment.
   276  type AuthorizeEnvironmentResponse struct {
   277  }
   278  
   279  // CancelOperationRequest: The request message for Operations.CancelOperation.
   280  type CancelOperationRequest struct {
   281  }
   282  
   283  // CreateEnvironmentMetadata: Message included in the metadata field of
   284  // operations returned from CreateEnvironment.
   285  type CreateEnvironmentMetadata struct {
   286  }
   287  
   288  // DeleteEnvironmentMetadata: Message included in the metadata field of
   289  // operations returned from DeleteEnvironment.
   290  type DeleteEnvironmentMetadata struct {
   291  }
   292  
   293  // Empty: A generic empty message that you can re-use to avoid defining
   294  // duplicated empty messages in your APIs. A typical example is to use it as
   295  // the request or the response type of an API method. For instance: service Foo
   296  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   297  type Empty struct {
   298  	// ServerResponse contains the HTTP response code and headers from the server.
   299  	googleapi.ServerResponse `json:"-"`
   300  }
   301  
   302  // Environment: A Cloud Shell environment, which is defined as the combination
   303  // of a Docker image specifying what is installed on the environment and a home
   304  // directory containing the user's data that will remain across sessions. Each
   305  // user has at least an environment with the ID "default".
   306  type Environment struct {
   307  	// DockerImage: Required. Immutable. Full path to the Docker image used to run
   308  	// this environment, e.g. "gcr.io/dev-con/cloud-devshell:latest".
   309  	DockerImage string `json:"dockerImage,omitempty"`
   310  	// Id: Output only. The environment's identifier, unique among the user's
   311  	// environments.
   312  	Id string `json:"id,omitempty"`
   313  	// Name: Immutable. Full name of this resource, in the format
   314  	// `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the
   315  	// email address of the user to whom this environment belongs, and
   316  	// `{environment_id}` is the identifier of this environment. For example,
   317  	// `users/someone@example.com/environments/default`.
   318  	Name string `json:"name,omitempty"`
   319  	// PublicKeys: Output only. Public keys associated with the environment.
   320  	// Clients can connect to this environment via SSH only if they possess a
   321  	// private key corresponding to at least one of these public keys. Keys can be
   322  	// added to or removed from the environment using the AddPublicKey and
   323  	// RemovePublicKey methods.
   324  	PublicKeys []string `json:"publicKeys,omitempty"`
   325  	// SshHost: Output only. Host to which clients can connect to initiate SSH
   326  	// sessions with the environment.
   327  	SshHost string `json:"sshHost,omitempty"`
   328  	// SshPort: Output only. Port to which clients can connect to initiate SSH
   329  	// sessions with the environment.
   330  	SshPort int64 `json:"sshPort,omitempty"`
   331  	// SshUsername: Output only. Username that clients should use when initiating
   332  	// SSH sessions with the environment.
   333  	SshUsername string `json:"sshUsername,omitempty"`
   334  	// State: Output only. Current execution state of this environment.
   335  	//
   336  	// Possible values:
   337  	//   "STATE_UNSPECIFIED" - The environment's states is unknown.
   338  	//   "SUSPENDED" - The environment is not running and can't be connected to.
   339  	// Starting the environment will transition it to the PENDING state.
   340  	//   "PENDING" - The environment is being started but is not yet ready to
   341  	// accept connections.
   342  	//   "RUNNING" - The environment is running and ready to accept connections. It
   343  	// will automatically transition back to DISABLED after a period of inactivity
   344  	// or if another environment is started.
   345  	//   "DELETING" - The environment is being deleted and can't be connected to.
   346  	State string `json:"state,omitempty"`
   347  	// WebHost: Output only. Host to which clients can connect to initiate HTTPS or
   348  	// WSS connections with the environment.
   349  	WebHost string `json:"webHost,omitempty"`
   350  
   351  	// ServerResponse contains the HTTP response code and headers from the server.
   352  	googleapi.ServerResponse `json:"-"`
   353  	// ForceSendFields is a list of field names (e.g. "DockerImage") to
   354  	// unconditionally include in API requests. By default, fields with empty or
   355  	// default values are omitted from API requests. See
   356  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   357  	// details.
   358  	ForceSendFields []string `json:"-"`
   359  	// NullFields is a list of field names (e.g. "DockerImage") to include in API
   360  	// requests with the JSON null value. By default, fields with empty values are
   361  	// omitted from API requests. See
   362  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   363  	NullFields []string `json:"-"`
   364  }
   365  
   366  func (s *Environment) MarshalJSON() ([]byte, error) {
   367  	type NoMethod Environment
   368  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   369  }
   370  
   371  // ListOperationsResponse: The response message for Operations.ListOperations.
   372  type ListOperationsResponse struct {
   373  	// NextPageToken: The standard List next-page token.
   374  	NextPageToken string `json:"nextPageToken,omitempty"`
   375  	// Operations: A list of operations that matches the specified filter in the
   376  	// request.
   377  	Operations []*Operation `json:"operations,omitempty"`
   378  
   379  	// ServerResponse contains the HTTP response code and headers from the server.
   380  	googleapi.ServerResponse `json:"-"`
   381  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   382  	// unconditionally include in API requests. By default, fields with empty or
   383  	// default values are omitted from API requests. See
   384  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   385  	// details.
   386  	ForceSendFields []string `json:"-"`
   387  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   388  	// requests with the JSON null value. By default, fields with empty values are
   389  	// omitted from API requests. See
   390  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   391  	NullFields []string `json:"-"`
   392  }
   393  
   394  func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
   395  	type NoMethod ListOperationsResponse
   396  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   397  }
   398  
   399  // Operation: This resource represents a long-running operation that is the
   400  // result of a network API call.
   401  type Operation struct {
   402  	// Done: If the value is `false`, it means the operation is still in progress.
   403  	// If `true`, the operation is completed, and either `error` or `response` is
   404  	// available.
   405  	Done bool `json:"done,omitempty"`
   406  	// Error: The error result of the operation in case of failure or cancellation.
   407  	Error *Status `json:"error,omitempty"`
   408  	// Metadata: Service-specific metadata associated with the operation. It
   409  	// typically contains progress information and common metadata such as create
   410  	// time. Some services might not provide such metadata. Any method that returns
   411  	// a long-running operation should document the metadata type, if any.
   412  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   413  	// Name: The server-assigned name, which is only unique within the same service
   414  	// that originally returns it. If you use the default HTTP mapping, the `name`
   415  	// should be a resource name ending with `operations/{unique_id}`.
   416  	Name string `json:"name,omitempty"`
   417  	// Response: The normal, successful response of the operation. If the original
   418  	// method returns no data on success, such as `Delete`, the response is
   419  	// `google.protobuf.Empty`. If the original method is standard
   420  	// `Get`/`Create`/`Update`, the response should be the resource. For other
   421  	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
   422  	// original method name. For example, if the original method name is
   423  	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
   424  	Response googleapi.RawMessage `json:"response,omitempty"`
   425  
   426  	// ServerResponse contains the HTTP response code and headers from the server.
   427  	googleapi.ServerResponse `json:"-"`
   428  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
   429  	// include in API requests. By default, fields with empty or default values are
   430  	// omitted from API requests. See
   431  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   432  	// details.
   433  	ForceSendFields []string `json:"-"`
   434  	// NullFields is a list of field names (e.g. "Done") to include in API requests
   435  	// with the JSON null value. By default, fields with empty values are omitted
   436  	// from API requests. See
   437  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   438  	NullFields []string `json:"-"`
   439  }
   440  
   441  func (s *Operation) MarshalJSON() ([]byte, error) {
   442  	type NoMethod Operation
   443  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   444  }
   445  
   446  // RemovePublicKeyMetadata: Message included in the metadata field of
   447  // operations returned from RemovePublicKey.
   448  type RemovePublicKeyMetadata struct {
   449  }
   450  
   451  // RemovePublicKeyRequest: Request message for RemovePublicKey.
   452  type RemovePublicKeyRequest struct {
   453  	// Key: Key that should be removed from the environment.
   454  	Key string `json:"key,omitempty"`
   455  	// ForceSendFields is a list of field names (e.g. "Key") to unconditionally
   456  	// include in API requests. By default, fields with empty or default values are
   457  	// omitted from API requests. See
   458  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   459  	// details.
   460  	ForceSendFields []string `json:"-"`
   461  	// NullFields is a list of field names (e.g. "Key") to include in API requests
   462  	// with the JSON null value. By default, fields with empty values are omitted
   463  	// from API requests. See
   464  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   465  	NullFields []string `json:"-"`
   466  }
   467  
   468  func (s *RemovePublicKeyRequest) MarshalJSON() ([]byte, error) {
   469  	type NoMethod RemovePublicKeyRequest
   470  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   471  }
   472  
   473  // RemovePublicKeyResponse: Response message for RemovePublicKey.
   474  type RemovePublicKeyResponse struct {
   475  }
   476  
   477  // StartEnvironmentMetadata: Message included in the metadata field of
   478  // operations returned from StartEnvironment.
   479  type StartEnvironmentMetadata struct {
   480  	// State: Current state of the environment being started.
   481  	//
   482  	// Possible values:
   483  	//   "STATE_UNSPECIFIED" - The environment's start state is unknown.
   484  	//   "STARTING" - The environment is in the process of being started, but no
   485  	// additional details are available.
   486  	//   "UNARCHIVING_DISK" - Startup is waiting for the user's disk to be
   487  	// unarchived. This can happen when the user returns to Cloud Shell after not
   488  	// having used it for a while, and suggests that startup will take longer than
   489  	// normal.
   490  	//   "AWAITING_COMPUTE_RESOURCES" - Startup is waiting for compute resources to
   491  	// be assigned to the environment. This should normally happen very quickly,
   492  	// but an environment might stay in this state for an extended period of time
   493  	// if the system is experiencing heavy load.
   494  	//   "FINISHED" - Startup has completed. If the start operation was successful,
   495  	// the user should be able to establish an SSH connection to their environment.
   496  	// Otherwise, the operation will contain details of the failure.
   497  	State string `json:"state,omitempty"`
   498  	// ForceSendFields is a list of field names (e.g. "State") to unconditionally
   499  	// include in API requests. By default, fields with empty or default values are
   500  	// omitted from API requests. See
   501  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   502  	// details.
   503  	ForceSendFields []string `json:"-"`
   504  	// NullFields is a list of field names (e.g. "State") to include in API
   505  	// requests with the JSON null value. By default, fields with empty values are
   506  	// omitted from API requests. See
   507  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   508  	NullFields []string `json:"-"`
   509  }
   510  
   511  func (s *StartEnvironmentMetadata) MarshalJSON() ([]byte, error) {
   512  	type NoMethod StartEnvironmentMetadata
   513  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   514  }
   515  
   516  // StartEnvironmentRequest: Request message for StartEnvironment.
   517  type StartEnvironmentRequest struct {
   518  	// AccessToken: The initial access token passed to the environment. If this is
   519  	// present and valid, the environment will be pre-authenticated with gcloud so
   520  	// that the user can run gcloud commands in Cloud Shell without having to log
   521  	// in. This code can be updated later by calling AuthorizeEnvironment.
   522  	AccessToken string `json:"accessToken,omitempty"`
   523  	// PublicKeys: Public keys that should be added to the environment before it is
   524  	// started.
   525  	PublicKeys []string `json:"publicKeys,omitempty"`
   526  	// ForceSendFields is a list of field names (e.g. "AccessToken") to
   527  	// unconditionally include in API requests. By default, fields with empty or
   528  	// default values are omitted from API requests. See
   529  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   530  	// details.
   531  	ForceSendFields []string `json:"-"`
   532  	// NullFields is a list of field names (e.g. "AccessToken") to include in API
   533  	// requests with the JSON null value. By default, fields with empty values are
   534  	// omitted from API requests. See
   535  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   536  	NullFields []string `json:"-"`
   537  }
   538  
   539  func (s *StartEnvironmentRequest) MarshalJSON() ([]byte, error) {
   540  	type NoMethod StartEnvironmentRequest
   541  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   542  }
   543  
   544  // StartEnvironmentResponse: Message included in the response field of
   545  // operations returned from StartEnvironment once the operation is complete.
   546  type StartEnvironmentResponse struct {
   547  	// Environment: Environment that was started.
   548  	Environment *Environment `json:"environment,omitempty"`
   549  	// ForceSendFields is a list of field names (e.g. "Environment") to
   550  	// unconditionally include in API requests. By default, fields with empty or
   551  	// default values are omitted from API requests. See
   552  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   553  	// details.
   554  	ForceSendFields []string `json:"-"`
   555  	// NullFields is a list of field names (e.g. "Environment") to include in API
   556  	// requests with the JSON null value. By default, fields with empty values are
   557  	// omitted from API requests. See
   558  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   559  	NullFields []string `json:"-"`
   560  }
   561  
   562  func (s *StartEnvironmentResponse) MarshalJSON() ([]byte, error) {
   563  	type NoMethod StartEnvironmentResponse
   564  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   565  }
   566  
   567  // Status: The `Status` type defines a logical error model that is suitable for
   568  // different programming environments, including REST APIs and RPC APIs. It is
   569  // used by gRPC (https://github.com/grpc). Each `Status` message contains three
   570  // pieces of data: error code, error message, and error details. You can find
   571  // out more about this error model and how to work with it in the API Design
   572  // Guide (https://cloud.google.com/apis/design/errors).
   573  type Status struct {
   574  	// Code: The status code, which should be an enum value of google.rpc.Code.
   575  	Code int64 `json:"code,omitempty"`
   576  	// Details: A list of messages that carry the error details. There is a common
   577  	// set of message types for APIs to use.
   578  	Details []googleapi.RawMessage `json:"details,omitempty"`
   579  	// Message: A developer-facing error message, which should be in English. Any
   580  	// user-facing error message should be localized and sent in the
   581  	// google.rpc.Status.details field, or localized by the client.
   582  	Message string `json:"message,omitempty"`
   583  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
   584  	// include in API requests. By default, fields with empty or default values are
   585  	// omitted from API requests. See
   586  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   587  	// details.
   588  	ForceSendFields []string `json:"-"`
   589  	// NullFields is a list of field names (e.g. "Code") to include in API requests
   590  	// with the JSON null value. By default, fields with empty values are omitted
   591  	// from API requests. See
   592  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   593  	NullFields []string `json:"-"`
   594  }
   595  
   596  func (s *Status) MarshalJSON() ([]byte, error) {
   597  	type NoMethod Status
   598  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   599  }
   600  
   601  type OperationsCancelCall struct {
   602  	s                      *Service
   603  	name                   string
   604  	canceloperationrequest *CancelOperationRequest
   605  	urlParams_             gensupport.URLParams
   606  	ctx_                   context.Context
   607  	header_                http.Header
   608  }
   609  
   610  // Cancel: Starts asynchronous cancellation on a long-running operation. The
   611  // server makes a best effort to cancel the operation, but success is not
   612  // guaranteed. If the server doesn't support this method, it returns
   613  // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
   614  // other methods to check whether the cancellation succeeded or whether the
   615  // operation completed despite cancellation. On successful cancellation, the
   616  // operation is not deleted; instead, it becomes an operation with an
   617  // Operation.error value with a google.rpc.Status.code of 1, corresponding to
   618  // `Code.CANCELLED`.
   619  //
   620  // - name: The name of the operation resource to be cancelled.
   621  func (r *OperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *OperationsCancelCall {
   622  	c := &OperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   623  	c.name = name
   624  	c.canceloperationrequest = canceloperationrequest
   625  	return c
   626  }
   627  
   628  // Fields allows partial responses to be retrieved. See
   629  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   630  // details.
   631  func (c *OperationsCancelCall) Fields(s ...googleapi.Field) *OperationsCancelCall {
   632  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   633  	return c
   634  }
   635  
   636  // Context sets the context to be used in this call's Do method.
   637  func (c *OperationsCancelCall) Context(ctx context.Context) *OperationsCancelCall {
   638  	c.ctx_ = ctx
   639  	return c
   640  }
   641  
   642  // Header returns a http.Header that can be modified by the caller to add
   643  // headers to the request.
   644  func (c *OperationsCancelCall) Header() http.Header {
   645  	if c.header_ == nil {
   646  		c.header_ = make(http.Header)
   647  	}
   648  	return c.header_
   649  }
   650  
   651  func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) {
   652  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
   653  	var body io.Reader = nil
   654  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
   655  	if err != nil {
   656  		return nil, err
   657  	}
   658  	c.urlParams_.Set("alt", alt)
   659  	c.urlParams_.Set("prettyPrint", "false")
   660  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
   661  	urls += "?" + c.urlParams_.Encode()
   662  	req, err := http.NewRequest("POST", urls, body)
   663  	if err != nil {
   664  		return nil, err
   665  	}
   666  	req.Header = reqHeaders
   667  	googleapi.Expand(req.URL, map[string]string{
   668  		"name": c.name,
   669  	})
   670  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   671  }
   672  
   673  // Do executes the "cloudshell.operations.cancel" call.
   674  // Any non-2xx status code is an error. Response headers are in either
   675  // *Empty.ServerResponse.Header or (if a response was returned at all) in
   676  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   677  // whether the returned error was because http.StatusNotModified was returned.
   678  func (c *OperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
   679  	gensupport.SetOptions(c.urlParams_, opts...)
   680  	res, err := c.doRequest("json")
   681  	if res != nil && res.StatusCode == http.StatusNotModified {
   682  		if res.Body != nil {
   683  			res.Body.Close()
   684  		}
   685  		return nil, gensupport.WrapError(&googleapi.Error{
   686  			Code:   res.StatusCode,
   687  			Header: res.Header,
   688  		})
   689  	}
   690  	if err != nil {
   691  		return nil, err
   692  	}
   693  	defer googleapi.CloseBody(res)
   694  	if err := googleapi.CheckResponse(res); err != nil {
   695  		return nil, gensupport.WrapError(err)
   696  	}
   697  	ret := &Empty{
   698  		ServerResponse: googleapi.ServerResponse{
   699  			Header:         res.Header,
   700  			HTTPStatusCode: res.StatusCode,
   701  		},
   702  	}
   703  	target := &ret
   704  	if err := gensupport.DecodeResponse(target, res); err != nil {
   705  		return nil, err
   706  	}
   707  	return ret, nil
   708  }
   709  
   710  type OperationsDeleteCall struct {
   711  	s          *Service
   712  	name       string
   713  	urlParams_ gensupport.URLParams
   714  	ctx_       context.Context
   715  	header_    http.Header
   716  }
   717  
   718  // Delete: Deletes a long-running operation. This method indicates that the
   719  // client is no longer interested in the operation result. It does not cancel
   720  // the operation. If the server doesn't support this method, it returns
   721  // `google.rpc.Code.UNIMPLEMENTED`.
   722  //
   723  // - name: The name of the operation resource to be deleted.
   724  func (r *OperationsService) Delete(name string) *OperationsDeleteCall {
   725  	c := &OperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   726  	c.name = name
   727  	return c
   728  }
   729  
   730  // Fields allows partial responses to be retrieved. See
   731  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   732  // details.
   733  func (c *OperationsDeleteCall) Fields(s ...googleapi.Field) *OperationsDeleteCall {
   734  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   735  	return c
   736  }
   737  
   738  // Context sets the context to be used in this call's Do method.
   739  func (c *OperationsDeleteCall) Context(ctx context.Context) *OperationsDeleteCall {
   740  	c.ctx_ = ctx
   741  	return c
   742  }
   743  
   744  // Header returns a http.Header that can be modified by the caller to add
   745  // headers to the request.
   746  func (c *OperationsDeleteCall) Header() http.Header {
   747  	if c.header_ == nil {
   748  		c.header_ = make(http.Header)
   749  	}
   750  	return c.header_
   751  }
   752  
   753  func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
   754  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   755  	var body io.Reader = nil
   756  	c.urlParams_.Set("alt", alt)
   757  	c.urlParams_.Set("prettyPrint", "false")
   758  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
   759  	urls += "?" + c.urlParams_.Encode()
   760  	req, err := http.NewRequest("DELETE", urls, body)
   761  	if err != nil {
   762  		return nil, err
   763  	}
   764  	req.Header = reqHeaders
   765  	googleapi.Expand(req.URL, map[string]string{
   766  		"name": c.name,
   767  	})
   768  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   769  }
   770  
   771  // Do executes the "cloudshell.operations.delete" call.
   772  // Any non-2xx status code is an error. Response headers are in either
   773  // *Empty.ServerResponse.Header or (if a response was returned at all) in
   774  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   775  // whether the returned error was because http.StatusNotModified was returned.
   776  func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
   777  	gensupport.SetOptions(c.urlParams_, opts...)
   778  	res, err := c.doRequest("json")
   779  	if res != nil && res.StatusCode == http.StatusNotModified {
   780  		if res.Body != nil {
   781  			res.Body.Close()
   782  		}
   783  		return nil, gensupport.WrapError(&googleapi.Error{
   784  			Code:   res.StatusCode,
   785  			Header: res.Header,
   786  		})
   787  	}
   788  	if err != nil {
   789  		return nil, err
   790  	}
   791  	defer googleapi.CloseBody(res)
   792  	if err := googleapi.CheckResponse(res); err != nil {
   793  		return nil, gensupport.WrapError(err)
   794  	}
   795  	ret := &Empty{
   796  		ServerResponse: googleapi.ServerResponse{
   797  			Header:         res.Header,
   798  			HTTPStatusCode: res.StatusCode,
   799  		},
   800  	}
   801  	target := &ret
   802  	if err := gensupport.DecodeResponse(target, res); err != nil {
   803  		return nil, err
   804  	}
   805  	return ret, nil
   806  }
   807  
   808  type OperationsGetCall struct {
   809  	s            *Service
   810  	name         string
   811  	urlParams_   gensupport.URLParams
   812  	ifNoneMatch_ string
   813  	ctx_         context.Context
   814  	header_      http.Header
   815  }
   816  
   817  // Get: Gets the latest state of a long-running operation. Clients can use this
   818  // method to poll the operation result at intervals as recommended by the API
   819  // service.
   820  //
   821  // - name: The name of the operation resource.
   822  func (r *OperationsService) Get(name string) *OperationsGetCall {
   823  	c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   824  	c.name = name
   825  	return c
   826  }
   827  
   828  // Fields allows partial responses to be retrieved. See
   829  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   830  // details.
   831  func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
   832  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   833  	return c
   834  }
   835  
   836  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   837  // object's ETag matches the given value. This is useful for getting updates
   838  // only after the object has changed since the last request.
   839  func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
   840  	c.ifNoneMatch_ = entityTag
   841  	return c
   842  }
   843  
   844  // Context sets the context to be used in this call's Do method.
   845  func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
   846  	c.ctx_ = ctx
   847  	return c
   848  }
   849  
   850  // Header returns a http.Header that can be modified by the caller to add
   851  // headers to the request.
   852  func (c *OperationsGetCall) Header() http.Header {
   853  	if c.header_ == nil {
   854  		c.header_ = make(http.Header)
   855  	}
   856  	return c.header_
   857  }
   858  
   859  func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
   860  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   861  	if c.ifNoneMatch_ != "" {
   862  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   863  	}
   864  	var body io.Reader = nil
   865  	c.urlParams_.Set("alt", alt)
   866  	c.urlParams_.Set("prettyPrint", "false")
   867  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
   868  	urls += "?" + c.urlParams_.Encode()
   869  	req, err := http.NewRequest("GET", urls, body)
   870  	if err != nil {
   871  		return nil, err
   872  	}
   873  	req.Header = reqHeaders
   874  	googleapi.Expand(req.URL, map[string]string{
   875  		"name": c.name,
   876  	})
   877  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   878  }
   879  
   880  // Do executes the "cloudshell.operations.get" call.
   881  // Any non-2xx status code is an error. Response headers are in either
   882  // *Operation.ServerResponse.Header or (if a response was returned at all) in
   883  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   884  // whether the returned error was because http.StatusNotModified was returned.
   885  func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
   886  	gensupport.SetOptions(c.urlParams_, opts...)
   887  	res, err := c.doRequest("json")
   888  	if res != nil && res.StatusCode == http.StatusNotModified {
   889  		if res.Body != nil {
   890  			res.Body.Close()
   891  		}
   892  		return nil, gensupport.WrapError(&googleapi.Error{
   893  			Code:   res.StatusCode,
   894  			Header: res.Header,
   895  		})
   896  	}
   897  	if err != nil {
   898  		return nil, err
   899  	}
   900  	defer googleapi.CloseBody(res)
   901  	if err := googleapi.CheckResponse(res); err != nil {
   902  		return nil, gensupport.WrapError(err)
   903  	}
   904  	ret := &Operation{
   905  		ServerResponse: googleapi.ServerResponse{
   906  			Header:         res.Header,
   907  			HTTPStatusCode: res.StatusCode,
   908  		},
   909  	}
   910  	target := &ret
   911  	if err := gensupport.DecodeResponse(target, res); err != nil {
   912  		return nil, err
   913  	}
   914  	return ret, nil
   915  }
   916  
   917  type OperationsListCall struct {
   918  	s            *Service
   919  	name         string
   920  	urlParams_   gensupport.URLParams
   921  	ifNoneMatch_ string
   922  	ctx_         context.Context
   923  	header_      http.Header
   924  }
   925  
   926  // List: Lists operations that match the specified filter in the request. If
   927  // the server doesn't support this method, it returns `UNIMPLEMENTED`.
   928  //
   929  // - name: The name of the operation's parent resource.
   930  func (r *OperationsService) List(name string) *OperationsListCall {
   931  	c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   932  	c.name = name
   933  	return c
   934  }
   935  
   936  // Filter sets the optional parameter "filter": The standard list filter.
   937  func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
   938  	c.urlParams_.Set("filter", filter)
   939  	return c
   940  }
   941  
   942  // PageSize sets the optional parameter "pageSize": The standard list page
   943  // size.
   944  func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall {
   945  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   946  	return c
   947  }
   948  
   949  // PageToken sets the optional parameter "pageToken": The standard list page
   950  // token.
   951  func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
   952  	c.urlParams_.Set("pageToken", pageToken)
   953  	return c
   954  }
   955  
   956  // Fields allows partial responses to be retrieved. See
   957  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   958  // details.
   959  func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
   960  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   961  	return c
   962  }
   963  
   964  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   965  // object's ETag matches the given value. This is useful for getting updates
   966  // only after the object has changed since the last request.
   967  func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
   968  	c.ifNoneMatch_ = entityTag
   969  	return c
   970  }
   971  
   972  // Context sets the context to be used in this call's Do method.
   973  func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
   974  	c.ctx_ = ctx
   975  	return c
   976  }
   977  
   978  // Header returns a http.Header that can be modified by the caller to add
   979  // headers to the request.
   980  func (c *OperationsListCall) Header() http.Header {
   981  	if c.header_ == nil {
   982  		c.header_ = make(http.Header)
   983  	}
   984  	return c.header_
   985  }
   986  
   987  func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
   988  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   989  	if c.ifNoneMatch_ != "" {
   990  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   991  	}
   992  	var body io.Reader = nil
   993  	c.urlParams_.Set("alt", alt)
   994  	c.urlParams_.Set("prettyPrint", "false")
   995  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
   996  	urls += "?" + c.urlParams_.Encode()
   997  	req, err := http.NewRequest("GET", urls, body)
   998  	if err != nil {
   999  		return nil, err
  1000  	}
  1001  	req.Header = reqHeaders
  1002  	googleapi.Expand(req.URL, map[string]string{
  1003  		"name": c.name,
  1004  	})
  1005  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1006  }
  1007  
  1008  // Do executes the "cloudshell.operations.list" call.
  1009  // Any non-2xx status code is an error. Response headers are in either
  1010  // *ListOperationsResponse.ServerResponse.Header or (if a response was returned
  1011  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1012  // check whether the returned error was because http.StatusNotModified was
  1013  // returned.
  1014  func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  1015  	gensupport.SetOptions(c.urlParams_, opts...)
  1016  	res, err := c.doRequest("json")
  1017  	if res != nil && res.StatusCode == http.StatusNotModified {
  1018  		if res.Body != nil {
  1019  			res.Body.Close()
  1020  		}
  1021  		return nil, gensupport.WrapError(&googleapi.Error{
  1022  			Code:   res.StatusCode,
  1023  			Header: res.Header,
  1024  		})
  1025  	}
  1026  	if err != nil {
  1027  		return nil, err
  1028  	}
  1029  	defer googleapi.CloseBody(res)
  1030  	if err := googleapi.CheckResponse(res); err != nil {
  1031  		return nil, gensupport.WrapError(err)
  1032  	}
  1033  	ret := &ListOperationsResponse{
  1034  		ServerResponse: googleapi.ServerResponse{
  1035  			Header:         res.Header,
  1036  			HTTPStatusCode: res.StatusCode,
  1037  		},
  1038  	}
  1039  	target := &ret
  1040  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1041  		return nil, err
  1042  	}
  1043  	return ret, nil
  1044  }
  1045  
  1046  // Pages invokes f for each page of results.
  1047  // A non-nil error returned from f will halt the iteration.
  1048  // The provided context supersedes any context provided to the Context method.
  1049  func (c *OperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  1050  	c.ctx_ = ctx
  1051  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1052  	for {
  1053  		x, err := c.Do()
  1054  		if err != nil {
  1055  			return err
  1056  		}
  1057  		if err := f(x); err != nil {
  1058  			return err
  1059  		}
  1060  		if x.NextPageToken == "" {
  1061  			return nil
  1062  		}
  1063  		c.PageToken(x.NextPageToken)
  1064  	}
  1065  }
  1066  
  1067  type UsersEnvironmentsAddPublicKeyCall struct {
  1068  	s                   *Service
  1069  	environment         string
  1070  	addpublickeyrequest *AddPublicKeyRequest
  1071  	urlParams_          gensupport.URLParams
  1072  	ctx_                context.Context
  1073  	header_             http.Header
  1074  }
  1075  
  1076  // AddPublicKey: Adds a public SSH key to an environment, allowing clients with
  1077  // the corresponding private key to connect to that environment via SSH. If a
  1078  // key with the same content already exists, this will error with
  1079  // ALREADY_EXISTS.
  1080  //
  1081  //   - environment: Environment this key should be added to, e.g.
  1082  //     `users/me/environments/default`.
  1083  func (r *UsersEnvironmentsService) AddPublicKey(environment string, addpublickeyrequest *AddPublicKeyRequest) *UsersEnvironmentsAddPublicKeyCall {
  1084  	c := &UsersEnvironmentsAddPublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1085  	c.environment = environment
  1086  	c.addpublickeyrequest = addpublickeyrequest
  1087  	return c
  1088  }
  1089  
  1090  // Fields allows partial responses to be retrieved. See
  1091  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1092  // details.
  1093  func (c *UsersEnvironmentsAddPublicKeyCall) Fields(s ...googleapi.Field) *UsersEnvironmentsAddPublicKeyCall {
  1094  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1095  	return c
  1096  }
  1097  
  1098  // Context sets the context to be used in this call's Do method.
  1099  func (c *UsersEnvironmentsAddPublicKeyCall) Context(ctx context.Context) *UsersEnvironmentsAddPublicKeyCall {
  1100  	c.ctx_ = ctx
  1101  	return c
  1102  }
  1103  
  1104  // Header returns a http.Header that can be modified by the caller to add
  1105  // headers to the request.
  1106  func (c *UsersEnvironmentsAddPublicKeyCall) Header() http.Header {
  1107  	if c.header_ == nil {
  1108  		c.header_ = make(http.Header)
  1109  	}
  1110  	return c.header_
  1111  }
  1112  
  1113  func (c *UsersEnvironmentsAddPublicKeyCall) doRequest(alt string) (*http.Response, error) {
  1114  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1115  	var body io.Reader = nil
  1116  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.addpublickeyrequest)
  1117  	if err != nil {
  1118  		return nil, err
  1119  	}
  1120  	c.urlParams_.Set("alt", alt)
  1121  	c.urlParams_.Set("prettyPrint", "false")
  1122  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+environment}:addPublicKey")
  1123  	urls += "?" + c.urlParams_.Encode()
  1124  	req, err := http.NewRequest("POST", urls, body)
  1125  	if err != nil {
  1126  		return nil, err
  1127  	}
  1128  	req.Header = reqHeaders
  1129  	googleapi.Expand(req.URL, map[string]string{
  1130  		"environment": c.environment,
  1131  	})
  1132  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1133  }
  1134  
  1135  // Do executes the "cloudshell.users.environments.addPublicKey" call.
  1136  // Any non-2xx status code is an error. Response headers are in either
  1137  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1138  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1139  // whether the returned error was because http.StatusNotModified was returned.
  1140  func (c *UsersEnvironmentsAddPublicKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1141  	gensupport.SetOptions(c.urlParams_, opts...)
  1142  	res, err := c.doRequest("json")
  1143  	if res != nil && res.StatusCode == http.StatusNotModified {
  1144  		if res.Body != nil {
  1145  			res.Body.Close()
  1146  		}
  1147  		return nil, gensupport.WrapError(&googleapi.Error{
  1148  			Code:   res.StatusCode,
  1149  			Header: res.Header,
  1150  		})
  1151  	}
  1152  	if err != nil {
  1153  		return nil, err
  1154  	}
  1155  	defer googleapi.CloseBody(res)
  1156  	if err := googleapi.CheckResponse(res); err != nil {
  1157  		return nil, gensupport.WrapError(err)
  1158  	}
  1159  	ret := &Operation{
  1160  		ServerResponse: googleapi.ServerResponse{
  1161  			Header:         res.Header,
  1162  			HTTPStatusCode: res.StatusCode,
  1163  		},
  1164  	}
  1165  	target := &ret
  1166  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1167  		return nil, err
  1168  	}
  1169  	return ret, nil
  1170  }
  1171  
  1172  type UsersEnvironmentsAuthorizeCall struct {
  1173  	s                           *Service
  1174  	name                        string
  1175  	authorizeenvironmentrequest *AuthorizeEnvironmentRequest
  1176  	urlParams_                  gensupport.URLParams
  1177  	ctx_                        context.Context
  1178  	header_                     http.Header
  1179  }
  1180  
  1181  // Authorize: Sends OAuth credentials to a running environment on behalf of a
  1182  // user. When this completes, the environment will be authorized to run various
  1183  // Google Cloud command line tools without requiring the user to manually
  1184  // authenticate.
  1185  //
  1186  //   - name: Name of the resource that should receive the credentials, for
  1187  //     example `users/me/environments/default` or
  1188  //     `users/someone@example.com/environments/default`.
  1189  func (r *UsersEnvironmentsService) Authorize(name string, authorizeenvironmentrequest *AuthorizeEnvironmentRequest) *UsersEnvironmentsAuthorizeCall {
  1190  	c := &UsersEnvironmentsAuthorizeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1191  	c.name = name
  1192  	c.authorizeenvironmentrequest = authorizeenvironmentrequest
  1193  	return c
  1194  }
  1195  
  1196  // Fields allows partial responses to be retrieved. See
  1197  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1198  // details.
  1199  func (c *UsersEnvironmentsAuthorizeCall) Fields(s ...googleapi.Field) *UsersEnvironmentsAuthorizeCall {
  1200  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1201  	return c
  1202  }
  1203  
  1204  // Context sets the context to be used in this call's Do method.
  1205  func (c *UsersEnvironmentsAuthorizeCall) Context(ctx context.Context) *UsersEnvironmentsAuthorizeCall {
  1206  	c.ctx_ = ctx
  1207  	return c
  1208  }
  1209  
  1210  // Header returns a http.Header that can be modified by the caller to add
  1211  // headers to the request.
  1212  func (c *UsersEnvironmentsAuthorizeCall) Header() http.Header {
  1213  	if c.header_ == nil {
  1214  		c.header_ = make(http.Header)
  1215  	}
  1216  	return c.header_
  1217  }
  1218  
  1219  func (c *UsersEnvironmentsAuthorizeCall) doRequest(alt string) (*http.Response, error) {
  1220  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1221  	var body io.Reader = nil
  1222  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.authorizeenvironmentrequest)
  1223  	if err != nil {
  1224  		return nil, err
  1225  	}
  1226  	c.urlParams_.Set("alt", alt)
  1227  	c.urlParams_.Set("prettyPrint", "false")
  1228  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:authorize")
  1229  	urls += "?" + c.urlParams_.Encode()
  1230  	req, err := http.NewRequest("POST", urls, body)
  1231  	if err != nil {
  1232  		return nil, err
  1233  	}
  1234  	req.Header = reqHeaders
  1235  	googleapi.Expand(req.URL, map[string]string{
  1236  		"name": c.name,
  1237  	})
  1238  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1239  }
  1240  
  1241  // Do executes the "cloudshell.users.environments.authorize" call.
  1242  // Any non-2xx status code is an error. Response headers are in either
  1243  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1244  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1245  // whether the returned error was because http.StatusNotModified was returned.
  1246  func (c *UsersEnvironmentsAuthorizeCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1247  	gensupport.SetOptions(c.urlParams_, opts...)
  1248  	res, err := c.doRequest("json")
  1249  	if res != nil && res.StatusCode == http.StatusNotModified {
  1250  		if res.Body != nil {
  1251  			res.Body.Close()
  1252  		}
  1253  		return nil, gensupport.WrapError(&googleapi.Error{
  1254  			Code:   res.StatusCode,
  1255  			Header: res.Header,
  1256  		})
  1257  	}
  1258  	if err != nil {
  1259  		return nil, err
  1260  	}
  1261  	defer googleapi.CloseBody(res)
  1262  	if err := googleapi.CheckResponse(res); err != nil {
  1263  		return nil, gensupport.WrapError(err)
  1264  	}
  1265  	ret := &Operation{
  1266  		ServerResponse: googleapi.ServerResponse{
  1267  			Header:         res.Header,
  1268  			HTTPStatusCode: res.StatusCode,
  1269  		},
  1270  	}
  1271  	target := &ret
  1272  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1273  		return nil, err
  1274  	}
  1275  	return ret, nil
  1276  }
  1277  
  1278  type UsersEnvironmentsGetCall struct {
  1279  	s            *Service
  1280  	name         string
  1281  	urlParams_   gensupport.URLParams
  1282  	ifNoneMatch_ string
  1283  	ctx_         context.Context
  1284  	header_      http.Header
  1285  }
  1286  
  1287  // Get: Gets an environment. Returns NOT_FOUND if the environment does not
  1288  // exist.
  1289  //
  1290  //   - name: Name of the requested resource, for example
  1291  //     `users/me/environments/default` or
  1292  //     `users/someone@example.com/environments/default`.
  1293  func (r *UsersEnvironmentsService) Get(name string) *UsersEnvironmentsGetCall {
  1294  	c := &UsersEnvironmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1295  	c.name = name
  1296  	return c
  1297  }
  1298  
  1299  // Fields allows partial responses to be retrieved. See
  1300  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1301  // details.
  1302  func (c *UsersEnvironmentsGetCall) Fields(s ...googleapi.Field) *UsersEnvironmentsGetCall {
  1303  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1304  	return c
  1305  }
  1306  
  1307  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1308  // object's ETag matches the given value. This is useful for getting updates
  1309  // only after the object has changed since the last request.
  1310  func (c *UsersEnvironmentsGetCall) IfNoneMatch(entityTag string) *UsersEnvironmentsGetCall {
  1311  	c.ifNoneMatch_ = entityTag
  1312  	return c
  1313  }
  1314  
  1315  // Context sets the context to be used in this call's Do method.
  1316  func (c *UsersEnvironmentsGetCall) Context(ctx context.Context) *UsersEnvironmentsGetCall {
  1317  	c.ctx_ = ctx
  1318  	return c
  1319  }
  1320  
  1321  // Header returns a http.Header that can be modified by the caller to add
  1322  // headers to the request.
  1323  func (c *UsersEnvironmentsGetCall) Header() http.Header {
  1324  	if c.header_ == nil {
  1325  		c.header_ = make(http.Header)
  1326  	}
  1327  	return c.header_
  1328  }
  1329  
  1330  func (c *UsersEnvironmentsGetCall) doRequest(alt string) (*http.Response, error) {
  1331  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1332  	if c.ifNoneMatch_ != "" {
  1333  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1334  	}
  1335  	var body io.Reader = nil
  1336  	c.urlParams_.Set("alt", alt)
  1337  	c.urlParams_.Set("prettyPrint", "false")
  1338  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  1339  	urls += "?" + c.urlParams_.Encode()
  1340  	req, err := http.NewRequest("GET", urls, body)
  1341  	if err != nil {
  1342  		return nil, err
  1343  	}
  1344  	req.Header = reqHeaders
  1345  	googleapi.Expand(req.URL, map[string]string{
  1346  		"name": c.name,
  1347  	})
  1348  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1349  }
  1350  
  1351  // Do executes the "cloudshell.users.environments.get" call.
  1352  // Any non-2xx status code is an error. Response headers are in either
  1353  // *Environment.ServerResponse.Header or (if a response was returned at all) in
  1354  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1355  // whether the returned error was because http.StatusNotModified was returned.
  1356  func (c *UsersEnvironmentsGetCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  1357  	gensupport.SetOptions(c.urlParams_, opts...)
  1358  	res, err := c.doRequest("json")
  1359  	if res != nil && res.StatusCode == http.StatusNotModified {
  1360  		if res.Body != nil {
  1361  			res.Body.Close()
  1362  		}
  1363  		return nil, gensupport.WrapError(&googleapi.Error{
  1364  			Code:   res.StatusCode,
  1365  			Header: res.Header,
  1366  		})
  1367  	}
  1368  	if err != nil {
  1369  		return nil, err
  1370  	}
  1371  	defer googleapi.CloseBody(res)
  1372  	if err := googleapi.CheckResponse(res); err != nil {
  1373  		return nil, gensupport.WrapError(err)
  1374  	}
  1375  	ret := &Environment{
  1376  		ServerResponse: googleapi.ServerResponse{
  1377  			Header:         res.Header,
  1378  			HTTPStatusCode: res.StatusCode,
  1379  		},
  1380  	}
  1381  	target := &ret
  1382  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1383  		return nil, err
  1384  	}
  1385  	return ret, nil
  1386  }
  1387  
  1388  type UsersEnvironmentsRemovePublicKeyCall struct {
  1389  	s                      *Service
  1390  	environment            string
  1391  	removepublickeyrequest *RemovePublicKeyRequest
  1392  	urlParams_             gensupport.URLParams
  1393  	ctx_                   context.Context
  1394  	header_                http.Header
  1395  }
  1396  
  1397  // RemovePublicKey: Removes a public SSH key from an environment. Clients will
  1398  // no longer be able to connect to the environment using the corresponding
  1399  // private key. If a key with the same content is not present, this will error
  1400  // with NOT_FOUND.
  1401  //
  1402  //   - environment: Environment this key should be removed from, e.g.
  1403  //     `users/me/environments/default`.
  1404  func (r *UsersEnvironmentsService) RemovePublicKey(environment string, removepublickeyrequest *RemovePublicKeyRequest) *UsersEnvironmentsRemovePublicKeyCall {
  1405  	c := &UsersEnvironmentsRemovePublicKeyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1406  	c.environment = environment
  1407  	c.removepublickeyrequest = removepublickeyrequest
  1408  	return c
  1409  }
  1410  
  1411  // Fields allows partial responses to be retrieved. See
  1412  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1413  // details.
  1414  func (c *UsersEnvironmentsRemovePublicKeyCall) Fields(s ...googleapi.Field) *UsersEnvironmentsRemovePublicKeyCall {
  1415  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1416  	return c
  1417  }
  1418  
  1419  // Context sets the context to be used in this call's Do method.
  1420  func (c *UsersEnvironmentsRemovePublicKeyCall) Context(ctx context.Context) *UsersEnvironmentsRemovePublicKeyCall {
  1421  	c.ctx_ = ctx
  1422  	return c
  1423  }
  1424  
  1425  // Header returns a http.Header that can be modified by the caller to add
  1426  // headers to the request.
  1427  func (c *UsersEnvironmentsRemovePublicKeyCall) Header() http.Header {
  1428  	if c.header_ == nil {
  1429  		c.header_ = make(http.Header)
  1430  	}
  1431  	return c.header_
  1432  }
  1433  
  1434  func (c *UsersEnvironmentsRemovePublicKeyCall) doRequest(alt string) (*http.Response, error) {
  1435  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1436  	var body io.Reader = nil
  1437  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.removepublickeyrequest)
  1438  	if err != nil {
  1439  		return nil, err
  1440  	}
  1441  	c.urlParams_.Set("alt", alt)
  1442  	c.urlParams_.Set("prettyPrint", "false")
  1443  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+environment}:removePublicKey")
  1444  	urls += "?" + c.urlParams_.Encode()
  1445  	req, err := http.NewRequest("POST", urls, body)
  1446  	if err != nil {
  1447  		return nil, err
  1448  	}
  1449  	req.Header = reqHeaders
  1450  	googleapi.Expand(req.URL, map[string]string{
  1451  		"environment": c.environment,
  1452  	})
  1453  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1454  }
  1455  
  1456  // Do executes the "cloudshell.users.environments.removePublicKey" call.
  1457  // Any non-2xx status code is an error. Response headers are in either
  1458  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1459  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1460  // whether the returned error was because http.StatusNotModified was returned.
  1461  func (c *UsersEnvironmentsRemovePublicKeyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1462  	gensupport.SetOptions(c.urlParams_, opts...)
  1463  	res, err := c.doRequest("json")
  1464  	if res != nil && res.StatusCode == http.StatusNotModified {
  1465  		if res.Body != nil {
  1466  			res.Body.Close()
  1467  		}
  1468  		return nil, gensupport.WrapError(&googleapi.Error{
  1469  			Code:   res.StatusCode,
  1470  			Header: res.Header,
  1471  		})
  1472  	}
  1473  	if err != nil {
  1474  		return nil, err
  1475  	}
  1476  	defer googleapi.CloseBody(res)
  1477  	if err := googleapi.CheckResponse(res); err != nil {
  1478  		return nil, gensupport.WrapError(err)
  1479  	}
  1480  	ret := &Operation{
  1481  		ServerResponse: googleapi.ServerResponse{
  1482  			Header:         res.Header,
  1483  			HTTPStatusCode: res.StatusCode,
  1484  		},
  1485  	}
  1486  	target := &ret
  1487  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1488  		return nil, err
  1489  	}
  1490  	return ret, nil
  1491  }
  1492  
  1493  type UsersEnvironmentsStartCall struct {
  1494  	s                       *Service
  1495  	name                    string
  1496  	startenvironmentrequest *StartEnvironmentRequest
  1497  	urlParams_              gensupport.URLParams
  1498  	ctx_                    context.Context
  1499  	header_                 http.Header
  1500  }
  1501  
  1502  // Start: Starts an existing environment, allowing clients to connect to it.
  1503  // The returned operation will contain an instance of StartEnvironmentMetadata
  1504  // in its metadata field. Users can wait for the environment to start by
  1505  // polling this operation via GetOperation. Once the environment has finished
  1506  // starting and is ready to accept connections, the operation will contain a
  1507  // StartEnvironmentResponse in its response field.
  1508  //
  1509  //   - name: Name of the resource that should be started, for example
  1510  //     `users/me/environments/default` or
  1511  //     `users/someone@example.com/environments/default`.
  1512  func (r *UsersEnvironmentsService) Start(name string, startenvironmentrequest *StartEnvironmentRequest) *UsersEnvironmentsStartCall {
  1513  	c := &UsersEnvironmentsStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1514  	c.name = name
  1515  	c.startenvironmentrequest = startenvironmentrequest
  1516  	return c
  1517  }
  1518  
  1519  // Fields allows partial responses to be retrieved. See
  1520  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1521  // details.
  1522  func (c *UsersEnvironmentsStartCall) Fields(s ...googleapi.Field) *UsersEnvironmentsStartCall {
  1523  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1524  	return c
  1525  }
  1526  
  1527  // Context sets the context to be used in this call's Do method.
  1528  func (c *UsersEnvironmentsStartCall) Context(ctx context.Context) *UsersEnvironmentsStartCall {
  1529  	c.ctx_ = ctx
  1530  	return c
  1531  }
  1532  
  1533  // Header returns a http.Header that can be modified by the caller to add
  1534  // headers to the request.
  1535  func (c *UsersEnvironmentsStartCall) Header() http.Header {
  1536  	if c.header_ == nil {
  1537  		c.header_ = make(http.Header)
  1538  	}
  1539  	return c.header_
  1540  }
  1541  
  1542  func (c *UsersEnvironmentsStartCall) doRequest(alt string) (*http.Response, error) {
  1543  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1544  	var body io.Reader = nil
  1545  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.startenvironmentrequest)
  1546  	if err != nil {
  1547  		return nil, err
  1548  	}
  1549  	c.urlParams_.Set("alt", alt)
  1550  	c.urlParams_.Set("prettyPrint", "false")
  1551  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:start")
  1552  	urls += "?" + c.urlParams_.Encode()
  1553  	req, err := http.NewRequest("POST", urls, body)
  1554  	if err != nil {
  1555  		return nil, err
  1556  	}
  1557  	req.Header = reqHeaders
  1558  	googleapi.Expand(req.URL, map[string]string{
  1559  		"name": c.name,
  1560  	})
  1561  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1562  }
  1563  
  1564  // Do executes the "cloudshell.users.environments.start" call.
  1565  // Any non-2xx status code is an error. Response headers are in either
  1566  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  1567  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1568  // whether the returned error was because http.StatusNotModified was returned.
  1569  func (c *UsersEnvironmentsStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1570  	gensupport.SetOptions(c.urlParams_, opts...)
  1571  	res, err := c.doRequest("json")
  1572  	if res != nil && res.StatusCode == http.StatusNotModified {
  1573  		if res.Body != nil {
  1574  			res.Body.Close()
  1575  		}
  1576  		return nil, gensupport.WrapError(&googleapi.Error{
  1577  			Code:   res.StatusCode,
  1578  			Header: res.Header,
  1579  		})
  1580  	}
  1581  	if err != nil {
  1582  		return nil, err
  1583  	}
  1584  	defer googleapi.CloseBody(res)
  1585  	if err := googleapi.CheckResponse(res); err != nil {
  1586  		return nil, gensupport.WrapError(err)
  1587  	}
  1588  	ret := &Operation{
  1589  		ServerResponse: googleapi.ServerResponse{
  1590  			Header:         res.Header,
  1591  			HTTPStatusCode: res.StatusCode,
  1592  		},
  1593  	}
  1594  	target := &ret
  1595  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1596  		return nil, err
  1597  	}
  1598  	return ret, nil
  1599  }
  1600  

View as plain text