You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1290 lines
44 KiB

  1. // Package cloudshell provides access to the Cloud Shell API.
  2. //
  3. // See https://cloud.google.com/shell/docs/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/cloudshell/v1alpha1"
  8. // ...
  9. // cloudshellService, err := cloudshell.New(oauthHttpClient)
  10. package cloudshell // import "google.golang.org/api/cloudshell/v1alpha1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "cloudshell:v1alpha1"
  41. const apiName = "cloudshell"
  42. const apiVersion = "v1alpha1"
  43. const basePath = "https://cloudshell.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. )
  49. func New(client *http.Client) (*Service, error) {
  50. if client == nil {
  51. return nil, errors.New("client is nil")
  52. }
  53. s := &Service{client: client, BasePath: basePath}
  54. s.Users = NewUsersService(s)
  55. return s, nil
  56. }
  57. type Service struct {
  58. client *http.Client
  59. BasePath string // API endpoint base URL
  60. UserAgent string // optional additional User-Agent fragment
  61. Users *UsersService
  62. }
  63. func (s *Service) userAgent() string {
  64. if s.UserAgent == "" {
  65. return googleapi.UserAgent
  66. }
  67. return googleapi.UserAgent + " " + s.UserAgent
  68. }
  69. func NewUsersService(s *Service) *UsersService {
  70. rs := &UsersService{s: s}
  71. rs.Environments = NewUsersEnvironmentsService(s)
  72. return rs
  73. }
  74. type UsersService struct {
  75. s *Service
  76. Environments *UsersEnvironmentsService
  77. }
  78. func NewUsersEnvironmentsService(s *Service) *UsersEnvironmentsService {
  79. rs := &UsersEnvironmentsService{s: s}
  80. rs.PublicKeys = NewUsersEnvironmentsPublicKeysService(s)
  81. return rs
  82. }
  83. type UsersEnvironmentsService struct {
  84. s *Service
  85. PublicKeys *UsersEnvironmentsPublicKeysService
  86. }
  87. func NewUsersEnvironmentsPublicKeysService(s *Service) *UsersEnvironmentsPublicKeysService {
  88. rs := &UsersEnvironmentsPublicKeysService{s: s}
  89. return rs
  90. }
  91. type UsersEnvironmentsPublicKeysService struct {
  92. s *Service
  93. }
  94. // CreatePublicKeyRequest: Request message for CreatePublicKey.
  95. type CreatePublicKeyRequest struct {
  96. // Key: Key that should be added to the environment.
  97. Key *PublicKey `json:"key,omitempty"`
  98. // ForceSendFields is a list of field names (e.g. "Key") to
  99. // unconditionally include in API requests. By default, fields with
  100. // empty values are omitted from API requests. However, any non-pointer,
  101. // non-interface field appearing in ForceSendFields will be sent to the
  102. // server regardless of whether the field is empty or not. This may be
  103. // used to include empty fields in Patch requests.
  104. ForceSendFields []string `json:"-"`
  105. // NullFields is a list of field names (e.g. "Key") to include in API
  106. // requests with the JSON null value. By default, fields with empty
  107. // values are omitted from API requests. However, any field with an
  108. // empty value appearing in NullFields will be sent to the server as
  109. // null. It is an error if a field in this list has a non-empty value.
  110. // This may be used to include null fields in Patch requests.
  111. NullFields []string `json:"-"`
  112. }
  113. func (s *CreatePublicKeyRequest) MarshalJSON() ([]byte, error) {
  114. type NoMethod CreatePublicKeyRequest
  115. raw := NoMethod(*s)
  116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  117. }
  118. // Empty: A generic empty message that you can re-use to avoid defining
  119. // duplicated
  120. // empty messages in your APIs. A typical example is to use it as the
  121. // request
  122. // or the response type of an API method. For instance:
  123. //
  124. // service Foo {
  125. // rpc Bar(google.protobuf.Empty) returns
  126. // (google.protobuf.Empty);
  127. // }
  128. //
  129. // The JSON representation for `Empty` is empty JSON object `{}`.
  130. type Empty struct {
  131. // ServerResponse contains the HTTP response code and headers from the
  132. // server.
  133. googleapi.ServerResponse `json:"-"`
  134. }
  135. // Environment: A Cloud Shell environment, which is defined as the
  136. // combination of a Docker
  137. // image specifying what is installed on the environment and a home
  138. // directory
  139. // containing the user's data that will remain across sessions. Each
  140. // user has a
  141. // single environment with the ID "default".
  142. type Environment struct {
  143. // DockerImage: Required. Full path to the Docker image used to run this
  144. // environment, e.g.
  145. // "gcr.io/dev-con/cloud-devshell:latest".
  146. DockerImage string `json:"dockerImage,omitempty"`
  147. // Id: Output only. The environment's identifier, which is always
  148. // "default".
  149. Id string `json:"id,omitempty"`
  150. // Name: Output only. Full name of this resource, in the
  151. // format
  152. // `users/{owner_email}/environments/{environment_id}`. `{owner_email}`
  153. // is the
  154. // email address of the user to whom this environment belongs,
  155. // and
  156. // `{environment_id}` is the identifier of this environment. For
  157. // example,
  158. // `users/someone@example.com/environments/default`.
  159. Name string `json:"name,omitempty"`
  160. // PublicKeys: Output only. Public keys associated with the environment.
  161. // Clients can
  162. // connect to this environment via SSH only if they possess a private
  163. // key
  164. // corresponding to at least one of these public keys. Keys can be added
  165. // to or
  166. // removed from the environment using the CreatePublicKey and
  167. // DeletePublicKey
  168. // methods.
  169. PublicKeys []*PublicKey `json:"publicKeys,omitempty"`
  170. // SshHost: Output only. Host to which clients can connect to initiate
  171. // SSH sessions
  172. // with the environment.
  173. SshHost string `json:"sshHost,omitempty"`
  174. // SshPort: Output only. Port to which clients can connect to initiate
  175. // SSH sessions
  176. // with the environment.
  177. SshPort int64 `json:"sshPort,omitempty"`
  178. // SshUsername: Output only. Username that clients should use when
  179. // initiating SSH sessions
  180. // with the environment.
  181. SshUsername string `json:"sshUsername,omitempty"`
  182. // State: Output only. Current execution state of this environment.
  183. //
  184. // Possible values:
  185. // "STATE_UNSPECIFIED" - The environment's states is unknown.
  186. // "DISABLED" - The environment is not running and can't be connected
  187. // to. Starting the
  188. // environment will transition it to the STARTING state.
  189. // "STARTING" - The environment is being started but is not yet ready
  190. // to accept
  191. // connections.
  192. // "RUNNING" - The environment is running and ready to accept
  193. // connections. It will
  194. // automatically transition back to DISABLED after a period of
  195. // inactivity or
  196. // if another environment is started.
  197. State string `json:"state,omitempty"`
  198. // ServerResponse contains the HTTP response code and headers from the
  199. // server.
  200. googleapi.ServerResponse `json:"-"`
  201. // ForceSendFields is a list of field names (e.g. "DockerImage") to
  202. // unconditionally include in API requests. By default, fields with
  203. // empty values are omitted from API requests. However, any non-pointer,
  204. // non-interface field appearing in ForceSendFields will be sent to the
  205. // server regardless of whether the field is empty or not. This may be
  206. // used to include empty fields in Patch requests.
  207. ForceSendFields []string `json:"-"`
  208. // NullFields is a list of field names (e.g. "DockerImage") to include
  209. // in API requests with the JSON null value. By default, fields with
  210. // empty values are omitted from API requests. However, any field with
  211. // an empty value appearing in NullFields will be sent to the server as
  212. // null. It is an error if a field in this list has a non-empty value.
  213. // This may be used to include null fields in Patch requests.
  214. NullFields []string `json:"-"`
  215. }
  216. func (s *Environment) MarshalJSON() ([]byte, error) {
  217. type NoMethod Environment
  218. raw := NoMethod(*s)
  219. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  220. }
  221. // Operation: This resource represents a long-running operation that is
  222. // the result of a
  223. // network API call.
  224. type Operation struct {
  225. // Done: If the value is `false`, it means the operation is still in
  226. // progress.
  227. // If `true`, the operation is completed, and either `error` or
  228. // `response` is
  229. // available.
  230. Done bool `json:"done,omitempty"`
  231. // Error: The error result of the operation in case of failure or
  232. // cancellation.
  233. Error *Status `json:"error,omitempty"`
  234. // Metadata: Service-specific metadata associated with the operation.
  235. // It typically
  236. // contains progress information and common metadata such as create
  237. // time.
  238. // Some services might not provide such metadata. Any method that
  239. // returns a
  240. // long-running operation should document the metadata type, if any.
  241. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  242. // Name: The server-assigned name, which is only unique within the same
  243. // service that
  244. // originally returns it. If you use the default HTTP mapping,
  245. // the
  246. // `name` should have the format of `operations/some/unique/name`.
  247. Name string `json:"name,omitempty"`
  248. // Response: The normal response of the operation in case of success.
  249. // If the original
  250. // method returns no data on success, such as `Delete`, the response
  251. // is
  252. // `google.protobuf.Empty`. If the original method is
  253. // standard
  254. // `Get`/`Create`/`Update`, the response should be the resource. For
  255. // other
  256. // methods, the response should have the type `XxxResponse`, where
  257. // `Xxx`
  258. // is the original method name. For example, if the original method
  259. // name
  260. // is `TakeSnapshot()`, the inferred response type
  261. // is
  262. // `TakeSnapshotResponse`.
  263. Response googleapi.RawMessage `json:"response,omitempty"`
  264. // ServerResponse contains the HTTP response code and headers from the
  265. // server.
  266. googleapi.ServerResponse `json:"-"`
  267. // ForceSendFields is a list of field names (e.g. "Done") to
  268. // unconditionally include in API requests. By default, fields with
  269. // empty values are omitted from API requests. However, any non-pointer,
  270. // non-interface field appearing in ForceSendFields will be sent to the
  271. // server regardless of whether the field is empty or not. This may be
  272. // used to include empty fields in Patch requests.
  273. ForceSendFields []string `json:"-"`
  274. // NullFields is a list of field names (e.g. "Done") to include in API
  275. // requests with the JSON null value. By default, fields with empty
  276. // values are omitted from API requests. However, any field with an
  277. // empty value appearing in NullFields will be sent to the server as
  278. // null. It is an error if a field in this list has a non-empty value.
  279. // This may be used to include null fields in Patch requests.
  280. NullFields []string `json:"-"`
  281. }
  282. func (s *Operation) MarshalJSON() ([]byte, error) {
  283. type NoMethod Operation
  284. raw := NoMethod(*s)
  285. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  286. }
  287. // PublicKey: A public SSH key, corresponding to a private SSH key held
  288. // by the client.
  289. type PublicKey struct {
  290. // Format: Required. Format of this key's content.
  291. //
  292. // Possible values:
  293. // "FORMAT_UNSPECIFIED" - Unknown format. Do not use.
  294. // "SSH_DSS" - `ssh-dss` key format (see RFC4253).
  295. // "SSH_RSA" - `ssh-rsa` key format (see RFC4253).
  296. // "ECDSA_SHA2_NISTP256" - `ecdsa-sha2-nistp256` key format (see
  297. // RFC5656).
  298. // "ECDSA_SHA2_NISTP384" - `ecdsa-sha2-nistp384` key format (see
  299. // RFC5656).
  300. // "ECDSA_SHA2_NISTP521" - `ecdsa-sha2-nistp521` key format (see
  301. // RFC5656).
  302. Format string `json:"format,omitempty"`
  303. // Key: Required. Content of this key.
  304. Key string `json:"key,omitempty"`
  305. // Name: Output only. Full name of this resource, in the
  306. // format
  307. // `users/{owner_email}/environments/{environment_id}/publicKeys/{
  308. // key_id}`.
  309. // `{owner_email}` is the email address of the user to whom the key
  310. // belongs.
  311. // `{environment_id}` is the identifier of the environment to which the
  312. // key
  313. // grants access. `{key_id}` is the unique identifier of the key. For
  314. // example,
  315. // `users/someone@example.com/environments/default/publicKeys/my
  316. // Key`.
  317. Name string `json:"name,omitempty"`
  318. // ServerResponse contains the HTTP response code and headers from the
  319. // server.
  320. googleapi.ServerResponse `json:"-"`
  321. // ForceSendFields is a list of field names (e.g. "Format") to
  322. // unconditionally include in API requests. By default, fields with
  323. // empty values are omitted from API requests. However, any non-pointer,
  324. // non-interface field appearing in ForceSendFields will be sent to the
  325. // server regardless of whether the field is empty or not. This may be
  326. // used to include empty fields in Patch requests.
  327. ForceSendFields []string `json:"-"`
  328. // NullFields is a list of field names (e.g. "Format") to include in API
  329. // requests with the JSON null value. By default, fields with empty
  330. // values are omitted from API requests. However, any field with an
  331. // empty value appearing in NullFields will be sent to the server as
  332. // null. It is an error if a field in this list has a non-empty value.
  333. // This may be used to include null fields in Patch requests.
  334. NullFields []string `json:"-"`
  335. }
  336. func (s *PublicKey) MarshalJSON() ([]byte, error) {
  337. type NoMethod PublicKey
  338. raw := NoMethod(*s)
  339. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  340. }
  341. // StartEnvironmentMetadata: Message included in the metadata field of
  342. // operations returned from
  343. // StartEnvironment.
  344. type StartEnvironmentMetadata struct {
  345. // State: Current state of the environment being started.
  346. //
  347. // Possible values:
  348. // "STATE_UNSPECIFIED" - The environment's start state is unknown.
  349. // "STARTING" - The environment is in the process of being started,
  350. // but no additional
  351. // details are available.
  352. // "UNARCHIVING_DISK" - Startup is waiting for the user's disk to be
  353. // unarchived. This can happen
  354. // when the user returns to Cloud Shell after not having used it for
  355. // a
  356. // while, and suggests that startup will take longer than normal.
  357. // "FINISHED" - Startup is complete and the user should be able to
  358. // establish an SSH
  359. // connection to their environment.
  360. State string `json:"state,omitempty"`
  361. // ForceSendFields is a list of field names (e.g. "State") to
  362. // unconditionally include in API requests. By default, fields with
  363. // empty values are omitted from API requests. However, any non-pointer,
  364. // non-interface field appearing in ForceSendFields will be sent to the
  365. // server regardless of whether the field is empty or not. This may be
  366. // used to include empty fields in Patch requests.
  367. ForceSendFields []string `json:"-"`
  368. // NullFields is a list of field names (e.g. "State") to include in API
  369. // requests with the JSON null value. By default, fields with empty
  370. // values are omitted from API requests. However, any field with an
  371. // empty value appearing in NullFields will be sent to the server as
  372. // null. It is an error if a field in this list has a non-empty value.
  373. // This may be used to include null fields in Patch requests.
  374. NullFields []string `json:"-"`
  375. }
  376. func (s *StartEnvironmentMetadata) MarshalJSON() ([]byte, error) {
  377. type NoMethod StartEnvironmentMetadata
  378. raw := NoMethod(*s)
  379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  380. }
  381. // StartEnvironmentRequest: Request message for StartEnvironment.
  382. type StartEnvironmentRequest struct {
  383. }
  384. // StartEnvironmentResponse: Message included in the response field of
  385. // operations returned from
  386. // StartEnvironment once the
  387. // operation is complete.
  388. type StartEnvironmentResponse struct {
  389. // Environment: Environment that was started.
  390. Environment *Environment `json:"environment,omitempty"`
  391. // ForceSendFields is a list of field names (e.g. "Environment") to
  392. // unconditionally include in API requests. By default, fields with
  393. // empty values are omitted from API requests. However, any non-pointer,
  394. // non-interface field appearing in ForceSendFields will be sent to the
  395. // server regardless of whether the field is empty or not. This may be
  396. // used to include empty fields in Patch requests.
  397. ForceSendFields []string `json:"-"`
  398. // NullFields is a list of field names (e.g. "Environment") to include
  399. // in API requests with the JSON null value. By default, fields with
  400. // empty values are omitted from API requests. However, any field with
  401. // an empty value appearing in NullFields will be sent to the server as
  402. // null. It is an error if a field in this list has a non-empty value.
  403. // This may be used to include null fields in Patch requests.
  404. NullFields []string `json:"-"`
  405. }
  406. func (s *StartEnvironmentResponse) MarshalJSON() ([]byte, error) {
  407. type NoMethod StartEnvironmentResponse
  408. raw := NoMethod(*s)
  409. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  410. }
  411. // Status: The `Status` type defines a logical error model that is
  412. // suitable for different
  413. // programming environments, including REST APIs and RPC APIs. It is
  414. // used by
  415. // [gRPC](https://github.com/grpc). The error model is designed to
  416. // be:
  417. //
  418. // - Simple to use and understand for most users
  419. // - Flexible enough to meet unexpected needs
  420. //
  421. // # Overview
  422. //
  423. // The `Status` message contains three pieces of data: error code, error
  424. // message,
  425. // and error details. The error code should be an enum value
  426. // of
  427. // google.rpc.Code, but it may accept additional error codes if needed.
  428. // The
  429. // error message should be a developer-facing English message that
  430. // helps
  431. // developers *understand* and *resolve* the error. If a localized
  432. // user-facing
  433. // error message is needed, put the localized message in the error
  434. // details or
  435. // localize it in the client. The optional error details may contain
  436. // arbitrary
  437. // information about the error. There is a predefined set of error
  438. // detail types
  439. // in the package `google.rpc` that can be used for common error
  440. // conditions.
  441. //
  442. // # Language mapping
  443. //
  444. // The `Status` message is the logical representation of the error
  445. // model, but it
  446. // is not necessarily the actual wire format. When the `Status` message
  447. // is
  448. // exposed in different client libraries and different wire protocols,
  449. // it can be
  450. // mapped differently. For example, it will likely be mapped to some
  451. // exceptions
  452. // in Java, but more likely mapped to some error codes in C.
  453. //
  454. // # Other uses
  455. //
  456. // The error model and the `Status` message can be used in a variety
  457. // of
  458. // environments, either with or without APIs, to provide a
  459. // consistent developer experience across different
  460. // environments.
  461. //
  462. // Example uses of this error model include:
  463. //
  464. // - Partial errors. If a service needs to return partial errors to the
  465. // client,
  466. // it may embed the `Status` in the normal response to indicate the
  467. // partial
  468. // errors.
  469. //
  470. // - Workflow errors. A typical workflow has multiple steps. Each step
  471. // may
  472. // have a `Status` message for error reporting.
  473. //
  474. // - Batch operations. If a client uses batch request and batch
  475. // response, the
  476. // `Status` message should be used directly inside batch response,
  477. // one for
  478. // each error sub-response.
  479. //
  480. // - Asynchronous operations. If an API call embeds asynchronous
  481. // operation
  482. // results in its response, the status of those operations should
  483. // be
  484. // represented directly using the `Status` message.
  485. //
  486. // - Logging. If some API errors are stored in logs, the message
  487. // `Status` could
  488. // be used directly after any stripping needed for security/privacy
  489. // reasons.
  490. type Status struct {
  491. // Code: The status code, which should be an enum value of
  492. // google.rpc.Code.
  493. Code int64 `json:"code,omitempty"`
  494. // Details: A list of messages that carry the error details. There is a
  495. // common set of
  496. // message types for APIs to use.
  497. Details []googleapi.RawMessage `json:"details,omitempty"`
  498. // Message: A developer-facing error message, which should be in
  499. // English. Any
  500. // user-facing error message should be localized and sent in
  501. // the
  502. // google.rpc.Status.details field, or localized by the client.
  503. Message string `json:"message,omitempty"`
  504. // ForceSendFields is a list of field names (e.g. "Code") to
  505. // unconditionally include in API requests. By default, fields with
  506. // empty values are omitted from API requests. However, any non-pointer,
  507. // non-interface field appearing in ForceSendFields will be sent to the
  508. // server regardless of whether the field is empty or not. This may be
  509. // used to include empty fields in Patch requests.
  510. ForceSendFields []string `json:"-"`
  511. // NullFields is a list of field names (e.g. "Code") to include in API
  512. // requests with the JSON null value. By default, fields with empty
  513. // values are omitted from API requests. However, any field with an
  514. // empty value appearing in NullFields will be sent to the server as
  515. // null. It is an error if a field in this list has a non-empty value.
  516. // This may be used to include null fields in Patch requests.
  517. NullFields []string `json:"-"`
  518. }
  519. func (s *Status) MarshalJSON() ([]byte, error) {
  520. type NoMethod Status
  521. raw := NoMethod(*s)
  522. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  523. }
  524. // method id "cloudshell.users.environments.get":
  525. type UsersEnvironmentsGetCall struct {
  526. s *Service
  527. name string
  528. urlParams_ gensupport.URLParams
  529. ifNoneMatch_ string
  530. ctx_ context.Context
  531. header_ http.Header
  532. }
  533. // Get: Gets an environment. Returns NOT_FOUND if the environment does
  534. // not exist.
  535. func (r *UsersEnvironmentsService) Get(name string) *UsersEnvironmentsGetCall {
  536. c := &UsersEnvironmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  537. c.name = name
  538. return c
  539. }
  540. // Fields allows partial responses to be retrieved. See
  541. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  542. // for more information.
  543. func (c *UsersEnvironmentsGetCall) Fields(s ...googleapi.Field) *UsersEnvironmentsGetCall {
  544. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  545. return c
  546. }
  547. // IfNoneMatch sets the optional parameter which makes the operation
  548. // fail if the object's ETag matches the given value. This is useful for
  549. // getting updates only after the object has changed since the last
  550. // request. Use googleapi.IsNotModified to check whether the response
  551. // error from Do is the result of In-None-Match.
  552. func (c *UsersEnvironmentsGetCall) IfNoneMatch(entityTag string) *UsersEnvironmentsGetCall {
  553. c.ifNoneMatch_ = entityTag
  554. return c
  555. }
  556. // Context sets the context to be used in this call's Do method. Any
  557. // pending HTTP request will be aborted if the provided context is
  558. // canceled.
  559. func (c *UsersEnvironmentsGetCall) Context(ctx context.Context) *UsersEnvironmentsGetCall {
  560. c.ctx_ = ctx
  561. return c
  562. }
  563. // Header returns an http.Header that can be modified by the caller to
  564. // add HTTP headers to the request.
  565. func (c *UsersEnvironmentsGetCall) Header() http.Header {
  566. if c.header_ == nil {
  567. c.header_ = make(http.Header)
  568. }
  569. return c.header_
  570. }
  571. func (c *UsersEnvironmentsGetCall) doRequest(alt string) (*http.Response, error) {
  572. reqHeaders := make(http.Header)
  573. for k, v := range c.header_ {
  574. reqHeaders[k] = v
  575. }
  576. reqHeaders.Set("User-Agent", c.s.userAgent())
  577. if c.ifNoneMatch_ != "" {
  578. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  579. }
  580. var body io.Reader = nil
  581. c.urlParams_.Set("alt", alt)
  582. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  583. urls += "?" + c.urlParams_.Encode()
  584. req, _ := http.NewRequest("GET", urls, body)
  585. req.Header = reqHeaders
  586. googleapi.Expand(req.URL, map[string]string{
  587. "name": c.name,
  588. })
  589. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  590. }
  591. // Do executes the "cloudshell.users.environments.get" call.
  592. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  593. // status code is an error. Response headers are in either
  594. // *Environment.ServerResponse.Header or (if a response was returned at
  595. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  596. // to check whether the returned error was because
  597. // http.StatusNotModified was returned.
  598. func (c *UsersEnvironmentsGetCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  599. gensupport.SetOptions(c.urlParams_, opts...)
  600. res, err := c.doRequest("json")
  601. if res != nil && res.StatusCode == http.StatusNotModified {
  602. if res.Body != nil {
  603. res.Body.Close()
  604. }
  605. return nil, &googleapi.Error{
  606. Code: res.StatusCode,
  607. Header: res.Header,
  608. }
  609. }
  610. if err != nil {
  611. return nil, err
  612. }
  613. defer googleapi.CloseBody(res)
  614. if err := googleapi.CheckResponse(res); err != nil {
  615. return nil, err
  616. }
  617. ret := &Environment{
  618. ServerResponse: googleapi.ServerResponse{
  619. Header: res.Header,
  620. HTTPStatusCode: res.StatusCode,
  621. },
  622. }
  623. target := &ret
  624. if err := gensupport.DecodeResponse(target, res); err != nil {
  625. return nil, err
  626. }
  627. return ret, nil
  628. // {
  629. // "description": "Gets an environment. Returns NOT_FOUND if the environment does not exist.",
  630. // "flatPath": "v1alpha1/users/{usersId}/environments/{environmentsId}",
  631. // "httpMethod": "GET",
  632. // "id": "cloudshell.users.environments.get",
  633. // "parameterOrder": [
  634. // "name"
  635. // ],
  636. // "parameters": {
  637. // "name": {
  638. // "description": "Name of the requested resource, for example `users/me/environments/default`\nor `users/someone@example.com/environments/default`.",
  639. // "location": "path",
  640. // "pattern": "^users/[^/]+/environments/[^/]+$",
  641. // "required": true,
  642. // "type": "string"
  643. // }
  644. // },
  645. // "path": "v1alpha1/{+name}",
  646. // "response": {
  647. // "$ref": "Environment"
  648. // },
  649. // "scopes": [
  650. // "https://www.googleapis.com/auth/cloud-platform"
  651. // ]
  652. // }
  653. }
  654. // method id "cloudshell.users.environments.patch":
  655. type UsersEnvironmentsPatchCall struct {
  656. s *Service
  657. name string
  658. environment *Environment
  659. urlParams_ gensupport.URLParams
  660. ctx_ context.Context
  661. header_ http.Header
  662. }
  663. // Patch: Updates an existing environment.
  664. func (r *UsersEnvironmentsService) Patch(name string, environment *Environment) *UsersEnvironmentsPatchCall {
  665. c := &UsersEnvironmentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  666. c.name = name
  667. c.environment = environment
  668. return c
  669. }
  670. // UpdateMask sets the optional parameter "updateMask": Mask specifying
  671. // which fields in the environment should be updated.
  672. func (c *UsersEnvironmentsPatchCall) UpdateMask(updateMask string) *UsersEnvironmentsPatchCall {
  673. c.urlParams_.Set("updateMask", updateMask)
  674. return c
  675. }
  676. // Fields allows partial responses to be retrieved. See
  677. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  678. // for more information.
  679. func (c *UsersEnvironmentsPatchCall) Fields(s ...googleapi.Field) *UsersEnvironmentsPatchCall {
  680. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  681. return c
  682. }
  683. // Context sets the context to be used in this call's Do method. Any
  684. // pending HTTP request will be aborted if the provided context is
  685. // canceled.
  686. func (c *UsersEnvironmentsPatchCall) Context(ctx context.Context) *UsersEnvironmentsPatchCall {
  687. c.ctx_ = ctx
  688. return c
  689. }
  690. // Header returns an http.Header that can be modified by the caller to
  691. // add HTTP headers to the request.
  692. func (c *UsersEnvironmentsPatchCall) Header() http.Header {
  693. if c.header_ == nil {
  694. c.header_ = make(http.Header)
  695. }
  696. return c.header_
  697. }
  698. func (c *UsersEnvironmentsPatchCall) doRequest(alt string) (*http.Response, error) {
  699. reqHeaders := make(http.Header)
  700. for k, v := range c.header_ {
  701. reqHeaders[k] = v
  702. }
  703. reqHeaders.Set("User-Agent", c.s.userAgent())
  704. var body io.Reader = nil
  705. body, err := googleapi.WithoutDataWrapper.JSONReader(c.environment)
  706. if err != nil {
  707. return nil, err
  708. }
  709. reqHeaders.Set("Content-Type", "application/json")
  710. c.urlParams_.Set("alt", alt)
  711. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  712. urls += "?" + c.urlParams_.Encode()
  713. req, _ := http.NewRequest("PATCH", urls, body)
  714. req.Header = reqHeaders
  715. googleapi.Expand(req.URL, map[string]string{
  716. "name": c.name,
  717. })
  718. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  719. }
  720. // Do executes the "cloudshell.users.environments.patch" call.
  721. // Exactly one of *Environment or error will be non-nil. Any non-2xx
  722. // status code is an error. Response headers are in either
  723. // *Environment.ServerResponse.Header or (if a response was returned at
  724. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  725. // to check whether the returned error was because
  726. // http.StatusNotModified was returned.
  727. func (c *UsersEnvironmentsPatchCall) Do(opts ...googleapi.CallOption) (*Environment, error) {
  728. gensupport.SetOptions(c.urlParams_, opts...)
  729. res, err := c.doRequest("json")
  730. if res != nil && res.StatusCode == http.StatusNotModified {
  731. if res.Body != nil {
  732. res.Body.Close()
  733. }
  734. return nil, &googleapi.Error{
  735. Code: res.StatusCode,
  736. Header: res.Header,
  737. }
  738. }
  739. if err != nil {
  740. return nil, err
  741. }
  742. defer googleapi.CloseBody(res)
  743. if err := googleapi.CheckResponse(res); err != nil {
  744. return nil, err
  745. }
  746. ret := &Environment{
  747. ServerResponse: googleapi.ServerResponse{
  748. Header: res.Header,
  749. HTTPStatusCode: res.StatusCode,
  750. },
  751. }
  752. target := &ret
  753. if err := gensupport.DecodeResponse(target, res); err != nil {
  754. return nil, err
  755. }
  756. return ret, nil
  757. // {
  758. // "description": "Updates an existing environment.",
  759. // "flatPath": "v1alpha1/users/{usersId}/environments/{environmentsId}",
  760. // "httpMethod": "PATCH",
  761. // "id": "cloudshell.users.environments.patch",
  762. // "parameterOrder": [
  763. // "name"
  764. // ],
  765. // "parameters": {
  766. // "name": {
  767. // "description": "Name of the resource to be updated, for example\n`users/me/environments/default` or\n`users/someone@example.com/environments/default`.",
  768. // "location": "path",
  769. // "pattern": "^users/[^/]+/environments/[^/]+$",
  770. // "required": true,
  771. // "type": "string"
  772. // },
  773. // "updateMask": {
  774. // "description": "Mask specifying which fields in the environment should be updated.",
  775. // "format": "google-fieldmask",
  776. // "location": "query",
  777. // "type": "string"
  778. // }
  779. // },
  780. // "path": "v1alpha1/{+name}",
  781. // "request": {
  782. // "$ref": "Environment"
  783. // },
  784. // "response": {
  785. // "$ref": "Environment"
  786. // },
  787. // "scopes": [
  788. // "https://www.googleapis.com/auth/cloud-platform"
  789. // ]
  790. // }
  791. }
  792. // method id "cloudshell.users.environments.start":
  793. type UsersEnvironmentsStartCall struct {
  794. s *Service
  795. name string
  796. startenvironmentrequest *StartEnvironmentRequest
  797. urlParams_ gensupport.URLParams
  798. ctx_ context.Context
  799. header_ http.Header
  800. }
  801. // Start: Starts an existing environment, allowing clients to connect to
  802. // it. The
  803. // returned operation will contain an instance of
  804. // StartEnvironmentMetadata in
  805. // its metadata field. Users can wait for the environment to start by
  806. // polling
  807. // this operation via GetOperation. Once the environment has finished
  808. // starting
  809. // and is ready to accept connections, the operation will contain
  810. // a
  811. // StartEnvironmentResponse in its response field.
  812. func (r *UsersEnvironmentsService) Start(name string, startenvironmentrequest *StartEnvironmentRequest) *UsersEnvironmentsStartCall {
  813. c := &UsersEnvironmentsStartCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  814. c.name = name
  815. c.startenvironmentrequest = startenvironmentrequest
  816. return c
  817. }
  818. // Fields allows partial responses to be retrieved. See
  819. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  820. // for more information.
  821. func (c *UsersEnvironmentsStartCall) Fields(s ...googleapi.Field) *UsersEnvironmentsStartCall {
  822. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  823. return c
  824. }
  825. // Context sets the context to be used in this call's Do method. Any
  826. // pending HTTP request will be aborted if the provided context is
  827. // canceled.
  828. func (c *UsersEnvironmentsStartCall) Context(ctx context.Context) *UsersEnvironmentsStartCall {
  829. c.ctx_ = ctx
  830. return c
  831. }
  832. // Header returns an http.Header that can be modified by the caller to
  833. // add HTTP headers to the request.
  834. func (c *UsersEnvironmentsStartCall) Header() http.Header {
  835. if c.header_ == nil {
  836. c.header_ = make(http.Header)
  837. }
  838. return c.header_
  839. }
  840. func (c *UsersEnvironmentsStartCall) doRequest(alt string) (*http.Response, error) {
  841. reqHeaders := make(http.Header)
  842. for k, v := range c.header_ {
  843. reqHeaders[k] = v
  844. }
  845. reqHeaders.Set("User-Agent", c.s.userAgent())
  846. var body io.Reader = nil
  847. body, err := googleapi.WithoutDataWrapper.JSONReader(c.startenvironmentrequest)
  848. if err != nil {
  849. return nil, err
  850. }
  851. reqHeaders.Set("Content-Type", "application/json")
  852. c.urlParams_.Set("alt", alt)
  853. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:start")
  854. urls += "?" + c.urlParams_.Encode()
  855. req, _ := http.NewRequest("POST", urls, body)
  856. req.Header = reqHeaders
  857. googleapi.Expand(req.URL, map[string]string{
  858. "name": c.name,
  859. })
  860. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  861. }
  862. // Do executes the "cloudshell.users.environments.start" call.
  863. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  864. // status code is an error. Response headers are in either
  865. // *Operation.ServerResponse.Header or (if a response was returned at
  866. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  867. // to check whether the returned error was because
  868. // http.StatusNotModified was returned.
  869. func (c *UsersEnvironmentsStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  870. gensupport.SetOptions(c.urlParams_, opts...)
  871. res, err := c.doRequest("json")
  872. if res != nil && res.StatusCode == http.StatusNotModified {
  873. if res.Body != nil {
  874. res.Body.Close()
  875. }
  876. return nil, &googleapi.Error{
  877. Code: res.StatusCode,
  878. Header: res.Header,
  879. }
  880. }
  881. if err != nil {
  882. return nil, err
  883. }
  884. defer googleapi.CloseBody(res)
  885. if err := googleapi.CheckResponse(res); err != nil {
  886. return nil, err
  887. }
  888. ret := &Operation{
  889. ServerResponse: googleapi.ServerResponse{
  890. Header: res.Header,
  891. HTTPStatusCode: res.StatusCode,
  892. },
  893. }
  894. target := &ret
  895. if err := gensupport.DecodeResponse(target, res); err != nil {
  896. return nil, err
  897. }
  898. return ret, nil
  899. // {
  900. // "description": "Starts an existing environment, allowing clients to connect to it. The\nreturned operation will contain an instance of StartEnvironmentMetadata in\nits metadata field. Users can wait for the environment to start by polling\nthis operation via GetOperation. Once the environment has finished starting\nand is ready to accept connections, the operation will contain a\nStartEnvironmentResponse in its response field.",
  901. // "flatPath": "v1alpha1/users/{usersId}/environments/{environmentsId}:start",
  902. // "httpMethod": "POST",
  903. // "id": "cloudshell.users.environments.start",
  904. // "parameterOrder": [
  905. // "name"
  906. // ],
  907. // "parameters": {
  908. // "name": {
  909. // "description": "Name of the resource that should be started, for example\n`users/me/environments/default` or\n`users/someone@example.com/environments/default`.",
  910. // "location": "path",
  911. // "pattern": "^users/[^/]+/environments/[^/]+$",
  912. // "required": true,
  913. // "type": "string"
  914. // }
  915. // },
  916. // "path": "v1alpha1/{+name}:start",
  917. // "request": {
  918. // "$ref": "StartEnvironmentRequest"
  919. // },
  920. // "response": {
  921. // "$ref": "Operation"
  922. // },
  923. // "scopes": [
  924. // "https://www.googleapis.com/auth/cloud-platform"
  925. // ]
  926. // }
  927. }
  928. // method id "cloudshell.users.environments.publicKeys.create":
  929. type UsersEnvironmentsPublicKeysCreateCall struct {
  930. s *Service
  931. parent string
  932. createpublickeyrequest *CreatePublicKeyRequest
  933. urlParams_ gensupport.URLParams
  934. ctx_ context.Context
  935. header_ http.Header
  936. }
  937. // Create: Adds a public SSH key to an environment, allowing clients
  938. // with the
  939. // corresponding private key to connect to that environment via SSH. If
  940. // a key
  941. // with the same format and content already exists, this will return
  942. // the
  943. // existing key.
  944. func (r *UsersEnvironmentsPublicKeysService) Create(parent string, createpublickeyrequest *CreatePublicKeyRequest) *UsersEnvironmentsPublicKeysCreateCall {
  945. c := &UsersEnvironmentsPublicKeysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  946. c.parent = parent
  947. c.createpublickeyrequest = createpublickeyrequest
  948. return c
  949. }
  950. // Fields allows partial responses to be retrieved. See
  951. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  952. // for more information.
  953. func (c *UsersEnvironmentsPublicKeysCreateCall) Fields(s ...googleapi.Field) *UsersEnvironmentsPublicKeysCreateCall {
  954. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  955. return c
  956. }
  957. // Context sets the context to be used in this call's Do method. Any
  958. // pending HTTP request will be aborted if the provided context is
  959. // canceled.
  960. func (c *UsersEnvironmentsPublicKeysCreateCall) Context(ctx context.Context) *UsersEnvironmentsPublicKeysCreateCall {
  961. c.ctx_ = ctx
  962. return c
  963. }
  964. // Header returns an http.Header that can be modified by the caller to
  965. // add HTTP headers to the request.
  966. func (c *UsersEnvironmentsPublicKeysCreateCall) Header() http.Header {
  967. if c.header_ == nil {
  968. c.header_ = make(http.Header)
  969. }
  970. return c.header_
  971. }
  972. func (c *UsersEnvironmentsPublicKeysCreateCall) doRequest(alt string) (*http.Response, error) {
  973. reqHeaders := make(http.Header)
  974. for k, v := range c.header_ {
  975. reqHeaders[k] = v
  976. }
  977. reqHeaders.Set("User-Agent", c.s.userAgent())
  978. var body io.Reader = nil
  979. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createpublickeyrequest)
  980. if err != nil {
  981. return nil, err
  982. }
  983. reqHeaders.Set("Content-Type", "application/json")
  984. c.urlParams_.Set("alt", alt)
  985. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/publicKeys")
  986. urls += "?" + c.urlParams_.Encode()
  987. req, _ := http.NewRequest("POST", urls, body)
  988. req.Header = reqHeaders
  989. googleapi.Expand(req.URL, map[string]string{
  990. "parent": c.parent,
  991. })
  992. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  993. }
  994. // Do executes the "cloudshell.users.environments.publicKeys.create" call.
  995. // Exactly one of *PublicKey or error will be non-nil. Any non-2xx
  996. // status code is an error. Response headers are in either
  997. // *PublicKey.ServerResponse.Header or (if a response was returned at
  998. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  999. // to check whether the returned error was because
  1000. // http.StatusNotModified was returned.
  1001. func (c *UsersEnvironmentsPublicKeysCreateCall) Do(opts ...googleapi.CallOption) (*PublicKey, error) {
  1002. gensupport.SetOptions(c.urlParams_, opts...)
  1003. res, err := c.doRequest("json")
  1004. if res != nil && res.StatusCode == http.StatusNotModified {
  1005. if res.Body != nil {
  1006. res.Body.Close()
  1007. }
  1008. return nil, &googleapi.Error{
  1009. Code: res.StatusCode,
  1010. Header: res.Header,
  1011. }
  1012. }
  1013. if err != nil {
  1014. return nil, err
  1015. }
  1016. defer googleapi.CloseBody(res)
  1017. if err := googleapi.CheckResponse(res); err != nil {
  1018. return nil, err
  1019. }
  1020. ret := &PublicKey{
  1021. ServerResponse: googleapi.ServerResponse{
  1022. Header: res.Header,
  1023. HTTPStatusCode: res.StatusCode,
  1024. },
  1025. }
  1026. target := &ret
  1027. if err := gensupport.DecodeResponse(target, res); err != nil {
  1028. return nil, err
  1029. }
  1030. return ret, nil
  1031. // {
  1032. // "description": "Adds a public SSH key to an environment, allowing clients with the\ncorresponding private key to connect to that environment via SSH. If a key\nwith the same format and content already exists, this will return the\nexisting key.",
  1033. // "flatPath": "v1alpha1/users/{usersId}/environments/{environmentsId}/publicKeys",
  1034. // "httpMethod": "POST",
  1035. // "id": "cloudshell.users.environments.publicKeys.create",
  1036. // "parameterOrder": [
  1037. // "parent"
  1038. // ],
  1039. // "parameters": {
  1040. // "parent": {
  1041. // "description": "Parent resource name, e.g. `users/me/environments/default`.",
  1042. // "location": "path",
  1043. // "pattern": "^users/[^/]+/environments/[^/]+$",
  1044. // "required": true,
  1045. // "type": "string"
  1046. // }
  1047. // },
  1048. // "path": "v1alpha1/{+parent}/publicKeys",
  1049. // "request": {
  1050. // "$ref": "CreatePublicKeyRequest"
  1051. // },
  1052. // "response": {
  1053. // "$ref": "PublicKey"
  1054. // },
  1055. // "scopes": [
  1056. // "https://www.googleapis.com/auth/cloud-platform"
  1057. // ]
  1058. // }
  1059. }
  1060. // method id "cloudshell.users.environments.publicKeys.delete":
  1061. type UsersEnvironmentsPublicKeysDeleteCall struct {
  1062. s *Service
  1063. name string
  1064. urlParams_ gensupport.URLParams
  1065. ctx_ context.Context
  1066. header_ http.Header
  1067. }
  1068. // Delete: Removes a public SSH key from an environment. Clients will no
  1069. // longer be
  1070. // able to connect to the environment using the corresponding private
  1071. // key.
  1072. func (r *UsersEnvironmentsPublicKeysService) Delete(name string) *UsersEnvironmentsPublicKeysDeleteCall {
  1073. c := &UsersEnvironmentsPublicKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1074. c.name = name
  1075. return c
  1076. }
  1077. // Fields allows partial responses to be retrieved. See
  1078. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1079. // for more information.
  1080. func (c *UsersEnvironmentsPublicKeysDeleteCall) Fields(s ...googleapi.Field) *UsersEnvironmentsPublicKeysDeleteCall {
  1081. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1082. return c
  1083. }
  1084. // Context sets the context to be used in this call's Do method. Any
  1085. // pending HTTP request will be aborted if the provided context is
  1086. // canceled.
  1087. func (c *UsersEnvironmentsPublicKeysDeleteCall) Context(ctx context.Context) *UsersEnvironmentsPublicKeysDeleteCall {
  1088. c.ctx_ = ctx
  1089. return c
  1090. }
  1091. // Header returns an http.Header that can be modified by the caller to
  1092. // add HTTP headers to the request.
  1093. func (c *UsersEnvironmentsPublicKeysDeleteCall) Header() http.Header {
  1094. if c.header_ == nil {
  1095. c.header_ = make(http.Header)
  1096. }
  1097. return c.header_
  1098. }
  1099. func (c *UsersEnvironmentsPublicKeysDeleteCall) doRequest(alt string) (*http.Response, error) {
  1100. reqHeaders := make(http.Header)
  1101. for k, v := range c.header_ {
  1102. reqHeaders[k] = v
  1103. }
  1104. reqHeaders.Set("User-Agent", c.s.userAgent())
  1105. var body io.Reader = nil
  1106. c.urlParams_.Set("alt", alt)
  1107. urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}")
  1108. urls += "?" + c.urlParams_.Encode()
  1109. req, _ := http.NewRequest("DELETE", urls, body)
  1110. req.Header = reqHeaders
  1111. googleapi.Expand(req.URL, map[string]string{
  1112. "name": c.name,
  1113. })
  1114. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1115. }
  1116. // Do executes the "cloudshell.users.environments.publicKeys.delete" call.
  1117. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  1118. // code is an error. Response headers are in either
  1119. // *Empty.ServerResponse.Header or (if a response was returned at all)
  1120. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1121. // check whether the returned error was because http.StatusNotModified
  1122. // was returned.
  1123. func (c *UsersEnvironmentsPublicKeysDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1124. gensupport.SetOptions(c.urlParams_, opts...)
  1125. res, err := c.doRequest("json")
  1126. if res != nil && res.StatusCode == http.StatusNotModified {
  1127. if res.Body != nil {
  1128. res.Body.Close()
  1129. }
  1130. return nil, &googleapi.Error{
  1131. Code: res.StatusCode,
  1132. Header: res.Header,
  1133. }
  1134. }
  1135. if err != nil {
  1136. return nil, err
  1137. }
  1138. defer googleapi.CloseBody(res)
  1139. if err := googleapi.CheckResponse(res); err != nil {
  1140. return nil, err
  1141. }
  1142. ret := &Empty{
  1143. ServerResponse: googleapi.ServerResponse{
  1144. Header: res.Header,
  1145. HTTPStatusCode: res.StatusCode,
  1146. },
  1147. }
  1148. target := &ret
  1149. if err := gensupport.DecodeResponse(target, res); err != nil {
  1150. return nil, err
  1151. }
  1152. return ret, nil
  1153. // {
  1154. // "description": "Removes a public SSH key from an environment. Clients will no longer be\nable to connect to the environment using the corresponding private key.",
  1155. // "flatPath": "v1alpha1/users/{usersId}/environments/{environmentsId}/publicKeys/{publicKeysId}",
  1156. // "httpMethod": "DELETE",
  1157. // "id": "cloudshell.users.environments.publicKeys.delete",
  1158. // "parameterOrder": [
  1159. // "name"
  1160. // ],
  1161. // "parameters": {
  1162. // "name": {
  1163. // "description": "Name of the resource to be deleted, e.g.\n`users/me/environments/default/publicKeys/my-key`.",
  1164. // "location": "path",
  1165. // "pattern": "^users/[^/]+/environments/[^/]+/publicKeys/[^/]+$",
  1166. // "required": true,
  1167. // "type": "string"
  1168. // }
  1169. // },
  1170. // "path": "v1alpha1/{+name}",
  1171. // "response": {
  1172. // "$ref": "Empty"
  1173. // },
  1174. // "scopes": [
  1175. // "https://www.googleapis.com/auth/cloud-platform"
  1176. // ]
  1177. // }
  1178. }