@maxim_mazurok/gapi.client.cloudshell-v1 0.0.20220803
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +590 -0
- package/package.json +20 -0
- package/readme.md +88 -0
- package/tests.ts +112 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Cloud Shell API v1 0.0 */
|
|
2
|
+
// Project: https://cloud.google.com/shell/docs/
|
|
3
|
+
// Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
|
|
4
|
+
// Nick Amoscato <https://github.com/namoscato>
|
|
5
|
+
// Declan Vong <https://github.com/declanvong>
|
|
6
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
7
|
+
// TypeScript Version: 2.8
|
|
8
|
+
|
|
9
|
+
// IMPORTANT
|
|
10
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
11
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
12
|
+
// Generated from: https://cloudshell.googleapis.com/$discovery/rest?version=v1
|
|
13
|
+
// Revision: 20220803
|
|
14
|
+
|
|
15
|
+
/// <reference types="gapi.client" />
|
|
16
|
+
|
|
17
|
+
declare namespace gapi.client {
|
|
18
|
+
/** Load Cloud Shell API v1 */
|
|
19
|
+
function load(urlOrObject: "https://cloudshell.googleapis.com/$discovery/rest?version=v1"): Promise<void>;
|
|
20
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
21
|
+
function load(name: "cloudshell", version: "v1"): Promise<void>;
|
|
22
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
23
|
+
function load(name: "cloudshell", version: "v1", callback: () => any): void;
|
|
24
|
+
|
|
25
|
+
namespace cloudshell {
|
|
26
|
+
// tslint:disable-next-line:no-empty-interface
|
|
27
|
+
interface AddPublicKeyMetadata {
|
|
28
|
+
}
|
|
29
|
+
interface AddPublicKeyRequest {
|
|
30
|
+
/**
|
|
31
|
+
* Key that should be added to the environment. Supported formats are `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256` (see RFC5656), `ecdsa-sha2-nistp384` (see
|
|
32
|
+
* RFC5656) and `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as <format> <content>, where <content> part is encoded with Base64.
|
|
33
|
+
*/
|
|
34
|
+
key?: string;
|
|
35
|
+
}
|
|
36
|
+
interface AddPublicKeyResponse {
|
|
37
|
+
/** Key that was added to the environment. */
|
|
38
|
+
key?: string;
|
|
39
|
+
}
|
|
40
|
+
// tslint:disable-next-line:no-empty-interface
|
|
41
|
+
interface AuthorizeEnvironmentMetadata {
|
|
42
|
+
}
|
|
43
|
+
interface AuthorizeEnvironmentRequest {
|
|
44
|
+
/** The OAuth access token that should be sent to the environment. */
|
|
45
|
+
accessToken?: string;
|
|
46
|
+
/** The time when the credentials expire. If not set, defaults to one hour from when the server received the request. */
|
|
47
|
+
expireTime?: string;
|
|
48
|
+
/** The OAuth ID token that should be sent to the environment. */
|
|
49
|
+
idToken?: string;
|
|
50
|
+
}
|
|
51
|
+
// tslint:disable-next-line:no-empty-interface
|
|
52
|
+
interface AuthorizeEnvironmentResponse {
|
|
53
|
+
}
|
|
54
|
+
// tslint:disable-next-line:no-empty-interface
|
|
55
|
+
interface CancelOperationRequest {
|
|
56
|
+
}
|
|
57
|
+
// tslint:disable-next-line:no-empty-interface
|
|
58
|
+
interface CreateEnvironmentMetadata {
|
|
59
|
+
}
|
|
60
|
+
// tslint:disable-next-line:no-empty-interface
|
|
61
|
+
interface DeleteEnvironmentMetadata {
|
|
62
|
+
}
|
|
63
|
+
// tslint:disable-next-line:no-empty-interface
|
|
64
|
+
interface Empty {
|
|
65
|
+
}
|
|
66
|
+
interface Environment {
|
|
67
|
+
/** Required. Immutable. Full path to the Docker image used to run this environment, e.g. "gcr.io/dev-con/cloud-devshell:latest". */
|
|
68
|
+
dockerImage?: string;
|
|
69
|
+
/** Output only. The environment's identifier, unique among the user's environments. */
|
|
70
|
+
id?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Immutable. Full name of this resource, in the format `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the email address of the user to whom this environment
|
|
73
|
+
* belongs, and `{environment_id}` is the identifier of this environment. For example, `users/someone@example.com/environments/default`.
|
|
74
|
+
*/
|
|
75
|
+
name?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Output only. Public keys associated with the environment. Clients can connect to this environment via SSH only if they possess a private key corresponding to at least one of these
|
|
78
|
+
* public keys. Keys can be added to or removed from the environment using the AddPublicKey and RemovePublicKey methods.
|
|
79
|
+
*/
|
|
80
|
+
publicKeys?: string[];
|
|
81
|
+
/** Output only. Host to which clients can connect to initiate SSH sessions with the environment. */
|
|
82
|
+
sshHost?: string;
|
|
83
|
+
/** Output only. Port to which clients can connect to initiate SSH sessions with the environment. */
|
|
84
|
+
sshPort?: number;
|
|
85
|
+
/** Output only. Username that clients should use when initiating SSH sessions with the environment. */
|
|
86
|
+
sshUsername?: string;
|
|
87
|
+
/** Output only. Current execution state of this environment. */
|
|
88
|
+
state?: string;
|
|
89
|
+
/** Output only. Host to which clients can connect to initiate HTTPS or WSS connections with the environment. */
|
|
90
|
+
webHost?: string;
|
|
91
|
+
}
|
|
92
|
+
interface ListOperationsResponse {
|
|
93
|
+
/** The standard List next-page token. */
|
|
94
|
+
nextPageToken?: string;
|
|
95
|
+
/** A list of operations that matches the specified filter in the request. */
|
|
96
|
+
operations?: Operation[];
|
|
97
|
+
}
|
|
98
|
+
interface Operation {
|
|
99
|
+
/** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */
|
|
100
|
+
done?: boolean;
|
|
101
|
+
/** The error result of the operation in case of failure or cancellation. */
|
|
102
|
+
error?: Status;
|
|
103
|
+
/**
|
|
104
|
+
* Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such
|
|
105
|
+
* metadata. Any method that returns a long-running operation should document the metadata type, if any.
|
|
106
|
+
*/
|
|
107
|
+
metadata?: { [P in string]: any };
|
|
108
|
+
/**
|
|
109
|
+
* The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending
|
|
110
|
+
* with `operations/{unique_id}`.
|
|
111
|
+
*/
|
|
112
|
+
name?: string;
|
|
113
|
+
/**
|
|
114
|
+
* The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the
|
|
115
|
+
* original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the
|
|
116
|
+
* original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
|
|
117
|
+
*/
|
|
118
|
+
response?: { [P in string]: any };
|
|
119
|
+
}
|
|
120
|
+
// tslint:disable-next-line:no-empty-interface
|
|
121
|
+
interface RemovePublicKeyMetadata {
|
|
122
|
+
}
|
|
123
|
+
interface RemovePublicKeyRequest {
|
|
124
|
+
/** Key that should be removed from the environment. */
|
|
125
|
+
key?: string;
|
|
126
|
+
}
|
|
127
|
+
// tslint:disable-next-line:no-empty-interface
|
|
128
|
+
interface RemovePublicKeyResponse {
|
|
129
|
+
}
|
|
130
|
+
interface StartEnvironmentMetadata {
|
|
131
|
+
/** Current state of the environment being started. */
|
|
132
|
+
state?: string;
|
|
133
|
+
}
|
|
134
|
+
interface StartEnvironmentRequest {
|
|
135
|
+
/**
|
|
136
|
+
* The initial access token passed to the environment. If this is present and valid, the environment will be pre-authenticated with gcloud so that the user can run gcloud commands in
|
|
137
|
+
* Cloud Shell without having to log in. This code can be updated later by calling AuthorizeEnvironment.
|
|
138
|
+
*/
|
|
139
|
+
accessToken?: string;
|
|
140
|
+
/** Public keys that should be added to the environment before it is started. */
|
|
141
|
+
publicKeys?: string[];
|
|
142
|
+
}
|
|
143
|
+
interface StartEnvironmentResponse {
|
|
144
|
+
/** Environment that was started. */
|
|
145
|
+
environment?: Environment;
|
|
146
|
+
}
|
|
147
|
+
interface Status {
|
|
148
|
+
/** The status code, which should be an enum value of google.rpc.Code. */
|
|
149
|
+
code?: number;
|
|
150
|
+
/** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
|
|
151
|
+
details?: Array<{ [P in string]: any }>;
|
|
152
|
+
/**
|
|
153
|
+
* A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the
|
|
154
|
+
* client.
|
|
155
|
+
*/
|
|
156
|
+
message?: string;
|
|
157
|
+
}
|
|
158
|
+
interface OperationsResource {
|
|
159
|
+
/**
|
|
160
|
+
* Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support
|
|
161
|
+
* this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the
|
|
162
|
+
* operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a
|
|
163
|
+
* google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.
|
|
164
|
+
*/
|
|
165
|
+
cancel(request: {
|
|
166
|
+
/** V1 error format. */
|
|
167
|
+
"$.xgafv"?: string;
|
|
168
|
+
/** OAuth access token. */
|
|
169
|
+
access_token?: string;
|
|
170
|
+
/** Data format for response. */
|
|
171
|
+
alt?: string;
|
|
172
|
+
/** JSONP */
|
|
173
|
+
callback?: string;
|
|
174
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
175
|
+
fields?: string;
|
|
176
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
177
|
+
key?: string;
|
|
178
|
+
/** The name of the operation resource to be cancelled. */
|
|
179
|
+
name: string;
|
|
180
|
+
/** OAuth 2.0 token for the current user. */
|
|
181
|
+
oauth_token?: string;
|
|
182
|
+
/** Returns response with indentations and line breaks. */
|
|
183
|
+
prettyPrint?: boolean;
|
|
184
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
185
|
+
quotaUser?: string;
|
|
186
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
187
|
+
upload_protocol?: string;
|
|
188
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
189
|
+
uploadType?: string;
|
|
190
|
+
/** Request body */
|
|
191
|
+
resource: CancelOperationRequest;
|
|
192
|
+
}): Request<{}>;
|
|
193
|
+
cancel(request: {
|
|
194
|
+
/** V1 error format. */
|
|
195
|
+
"$.xgafv"?: string;
|
|
196
|
+
/** OAuth access token. */
|
|
197
|
+
access_token?: string;
|
|
198
|
+
/** Data format for response. */
|
|
199
|
+
alt?: string;
|
|
200
|
+
/** JSONP */
|
|
201
|
+
callback?: string;
|
|
202
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
203
|
+
fields?: string;
|
|
204
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
205
|
+
key?: string;
|
|
206
|
+
/** The name of the operation resource to be cancelled. */
|
|
207
|
+
name: string;
|
|
208
|
+
/** OAuth 2.0 token for the current user. */
|
|
209
|
+
oauth_token?: string;
|
|
210
|
+
/** Returns response with indentations and line breaks. */
|
|
211
|
+
prettyPrint?: boolean;
|
|
212
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
213
|
+
quotaUser?: string;
|
|
214
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
215
|
+
upload_protocol?: string;
|
|
216
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
217
|
+
uploadType?: string;
|
|
218
|
+
},
|
|
219
|
+
body: CancelOperationRequest): Request<{}>;
|
|
220
|
+
/**
|
|
221
|
+
* Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't
|
|
222
|
+
* support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
|
|
223
|
+
*/
|
|
224
|
+
delete(request?: {
|
|
225
|
+
/** V1 error format. */
|
|
226
|
+
"$.xgafv"?: string;
|
|
227
|
+
/** OAuth access token. */
|
|
228
|
+
access_token?: string;
|
|
229
|
+
/** Data format for response. */
|
|
230
|
+
alt?: string;
|
|
231
|
+
/** JSONP */
|
|
232
|
+
callback?: string;
|
|
233
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
234
|
+
fields?: string;
|
|
235
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
236
|
+
key?: string;
|
|
237
|
+
/** The name of the operation resource to be deleted. */
|
|
238
|
+
name: string;
|
|
239
|
+
/** OAuth 2.0 token for the current user. */
|
|
240
|
+
oauth_token?: string;
|
|
241
|
+
/** Returns response with indentations and line breaks. */
|
|
242
|
+
prettyPrint?: boolean;
|
|
243
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
244
|
+
quotaUser?: string;
|
|
245
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
246
|
+
upload_protocol?: string;
|
|
247
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
248
|
+
uploadType?: string;
|
|
249
|
+
}): Request<{}>;
|
|
250
|
+
/** Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. */
|
|
251
|
+
get(request?: {
|
|
252
|
+
/** V1 error format. */
|
|
253
|
+
"$.xgafv"?: string;
|
|
254
|
+
/** OAuth access token. */
|
|
255
|
+
access_token?: string;
|
|
256
|
+
/** Data format for response. */
|
|
257
|
+
alt?: string;
|
|
258
|
+
/** JSONP */
|
|
259
|
+
callback?: string;
|
|
260
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
261
|
+
fields?: string;
|
|
262
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
263
|
+
key?: string;
|
|
264
|
+
/** The name of the operation resource. */
|
|
265
|
+
name: string;
|
|
266
|
+
/** OAuth 2.0 token for the current user. */
|
|
267
|
+
oauth_token?: string;
|
|
268
|
+
/** Returns response with indentations and line breaks. */
|
|
269
|
+
prettyPrint?: boolean;
|
|
270
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
271
|
+
quotaUser?: string;
|
|
272
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
273
|
+
upload_protocol?: string;
|
|
274
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
275
|
+
uploadType?: string;
|
|
276
|
+
}): Request<Operation>;
|
|
277
|
+
/**
|
|
278
|
+
* Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services
|
|
279
|
+
* to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as
|
|
280
|
+
* `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must
|
|
281
|
+
* ensure the name binding is the parent resource, without the operations collection id.
|
|
282
|
+
*/
|
|
283
|
+
list(request?: {
|
|
284
|
+
/** V1 error format. */
|
|
285
|
+
"$.xgafv"?: string;
|
|
286
|
+
/** OAuth access token. */
|
|
287
|
+
access_token?: string;
|
|
288
|
+
/** Data format for response. */
|
|
289
|
+
alt?: string;
|
|
290
|
+
/** JSONP */
|
|
291
|
+
callback?: string;
|
|
292
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
293
|
+
fields?: string;
|
|
294
|
+
/** The standard list filter. */
|
|
295
|
+
filter?: string;
|
|
296
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
297
|
+
key?: string;
|
|
298
|
+
/** The name of the operation's parent resource. */
|
|
299
|
+
name: string;
|
|
300
|
+
/** OAuth 2.0 token for the current user. */
|
|
301
|
+
oauth_token?: string;
|
|
302
|
+
/** The standard list page size. */
|
|
303
|
+
pageSize?: number;
|
|
304
|
+
/** The standard list page token. */
|
|
305
|
+
pageToken?: string;
|
|
306
|
+
/** Returns response with indentations and line breaks. */
|
|
307
|
+
prettyPrint?: boolean;
|
|
308
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
309
|
+
quotaUser?: string;
|
|
310
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
311
|
+
upload_protocol?: string;
|
|
312
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
313
|
+
uploadType?: string;
|
|
314
|
+
}): Request<ListOperationsResponse>;
|
|
315
|
+
}
|
|
316
|
+
interface EnvironmentsResource {
|
|
317
|
+
/**
|
|
318
|
+
* Adds a public SSH key to an environment, allowing clients with the corresponding private key to connect to that environment via SSH. If a key with the same content already exists,
|
|
319
|
+
* this will error with ALREADY_EXISTS.
|
|
320
|
+
*/
|
|
321
|
+
addPublicKey(request: {
|
|
322
|
+
/** V1 error format. */
|
|
323
|
+
"$.xgafv"?: string;
|
|
324
|
+
/** OAuth access token. */
|
|
325
|
+
access_token?: string;
|
|
326
|
+
/** Data format for response. */
|
|
327
|
+
alt?: string;
|
|
328
|
+
/** JSONP */
|
|
329
|
+
callback?: string;
|
|
330
|
+
/** Environment this key should be added to, e.g. `users/me/environments/default`. */
|
|
331
|
+
environment: string;
|
|
332
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
333
|
+
fields?: string;
|
|
334
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
335
|
+
key?: string;
|
|
336
|
+
/** OAuth 2.0 token for the current user. */
|
|
337
|
+
oauth_token?: string;
|
|
338
|
+
/** Returns response with indentations and line breaks. */
|
|
339
|
+
prettyPrint?: boolean;
|
|
340
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
341
|
+
quotaUser?: string;
|
|
342
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
343
|
+
upload_protocol?: string;
|
|
344
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
345
|
+
uploadType?: string;
|
|
346
|
+
/** Request body */
|
|
347
|
+
resource: AddPublicKeyRequest;
|
|
348
|
+
}): Request<Operation>;
|
|
349
|
+
addPublicKey(request: {
|
|
350
|
+
/** V1 error format. */
|
|
351
|
+
"$.xgafv"?: string;
|
|
352
|
+
/** OAuth access token. */
|
|
353
|
+
access_token?: string;
|
|
354
|
+
/** Data format for response. */
|
|
355
|
+
alt?: string;
|
|
356
|
+
/** JSONP */
|
|
357
|
+
callback?: string;
|
|
358
|
+
/** Environment this key should be added to, e.g. `users/me/environments/default`. */
|
|
359
|
+
environment: string;
|
|
360
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
361
|
+
fields?: string;
|
|
362
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
363
|
+
key?: string;
|
|
364
|
+
/** OAuth 2.0 token for the current user. */
|
|
365
|
+
oauth_token?: string;
|
|
366
|
+
/** Returns response with indentations and line breaks. */
|
|
367
|
+
prettyPrint?: boolean;
|
|
368
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
369
|
+
quotaUser?: string;
|
|
370
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
371
|
+
upload_protocol?: string;
|
|
372
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
373
|
+
uploadType?: string;
|
|
374
|
+
},
|
|
375
|
+
body: AddPublicKeyRequest): Request<Operation>;
|
|
376
|
+
/**
|
|
377
|
+
* Sends OAuth credentials to a running environment on behalf of a user. When this completes, the environment will be authorized to run various Google Cloud command line tools without
|
|
378
|
+
* requiring the user to manually authenticate.
|
|
379
|
+
*/
|
|
380
|
+
authorize(request: {
|
|
381
|
+
/** V1 error format. */
|
|
382
|
+
"$.xgafv"?: string;
|
|
383
|
+
/** OAuth access token. */
|
|
384
|
+
access_token?: string;
|
|
385
|
+
/** Data format for response. */
|
|
386
|
+
alt?: string;
|
|
387
|
+
/** JSONP */
|
|
388
|
+
callback?: string;
|
|
389
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
390
|
+
fields?: string;
|
|
391
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
392
|
+
key?: string;
|
|
393
|
+
/** Name of the resource that should receive the credentials, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. */
|
|
394
|
+
name: string;
|
|
395
|
+
/** OAuth 2.0 token for the current user. */
|
|
396
|
+
oauth_token?: string;
|
|
397
|
+
/** Returns response with indentations and line breaks. */
|
|
398
|
+
prettyPrint?: boolean;
|
|
399
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
400
|
+
quotaUser?: string;
|
|
401
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
402
|
+
upload_protocol?: string;
|
|
403
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
404
|
+
uploadType?: string;
|
|
405
|
+
/** Request body */
|
|
406
|
+
resource: AuthorizeEnvironmentRequest;
|
|
407
|
+
}): Request<Operation>;
|
|
408
|
+
authorize(request: {
|
|
409
|
+
/** V1 error format. */
|
|
410
|
+
"$.xgafv"?: string;
|
|
411
|
+
/** OAuth access token. */
|
|
412
|
+
access_token?: string;
|
|
413
|
+
/** Data format for response. */
|
|
414
|
+
alt?: string;
|
|
415
|
+
/** JSONP */
|
|
416
|
+
callback?: string;
|
|
417
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
418
|
+
fields?: string;
|
|
419
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
420
|
+
key?: string;
|
|
421
|
+
/** Name of the resource that should receive the credentials, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. */
|
|
422
|
+
name: string;
|
|
423
|
+
/** OAuth 2.0 token for the current user. */
|
|
424
|
+
oauth_token?: string;
|
|
425
|
+
/** Returns response with indentations and line breaks. */
|
|
426
|
+
prettyPrint?: boolean;
|
|
427
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
428
|
+
quotaUser?: string;
|
|
429
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
430
|
+
upload_protocol?: string;
|
|
431
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
432
|
+
uploadType?: string;
|
|
433
|
+
},
|
|
434
|
+
body: AuthorizeEnvironmentRequest): Request<Operation>;
|
|
435
|
+
/** Gets an environment. Returns NOT_FOUND if the environment does not exist. */
|
|
436
|
+
get(request?: {
|
|
437
|
+
/** V1 error format. */
|
|
438
|
+
"$.xgafv"?: string;
|
|
439
|
+
/** OAuth access token. */
|
|
440
|
+
access_token?: string;
|
|
441
|
+
/** Data format for response. */
|
|
442
|
+
alt?: string;
|
|
443
|
+
/** JSONP */
|
|
444
|
+
callback?: string;
|
|
445
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
446
|
+
fields?: string;
|
|
447
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
448
|
+
key?: string;
|
|
449
|
+
/** Required. Name of the requested resource, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. */
|
|
450
|
+
name: string;
|
|
451
|
+
/** OAuth 2.0 token for the current user. */
|
|
452
|
+
oauth_token?: string;
|
|
453
|
+
/** Returns response with indentations and line breaks. */
|
|
454
|
+
prettyPrint?: boolean;
|
|
455
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
456
|
+
quotaUser?: string;
|
|
457
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
458
|
+
upload_protocol?: string;
|
|
459
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
460
|
+
uploadType?: string;
|
|
461
|
+
}): Request<Environment>;
|
|
462
|
+
/**
|
|
463
|
+
* Removes a public SSH key from an environment. Clients will no longer be able to connect to the environment using the corresponding private key. If a key with the same content is not
|
|
464
|
+
* present, this will error with NOT_FOUND.
|
|
465
|
+
*/
|
|
466
|
+
removePublicKey(request: {
|
|
467
|
+
/** V1 error format. */
|
|
468
|
+
"$.xgafv"?: string;
|
|
469
|
+
/** OAuth access token. */
|
|
470
|
+
access_token?: string;
|
|
471
|
+
/** Data format for response. */
|
|
472
|
+
alt?: string;
|
|
473
|
+
/** JSONP */
|
|
474
|
+
callback?: string;
|
|
475
|
+
/** Environment this key should be removed from, e.g. `users/me/environments/default`. */
|
|
476
|
+
environment: string;
|
|
477
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
478
|
+
fields?: string;
|
|
479
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
480
|
+
key?: string;
|
|
481
|
+
/** OAuth 2.0 token for the current user. */
|
|
482
|
+
oauth_token?: string;
|
|
483
|
+
/** Returns response with indentations and line breaks. */
|
|
484
|
+
prettyPrint?: boolean;
|
|
485
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
486
|
+
quotaUser?: string;
|
|
487
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
488
|
+
upload_protocol?: string;
|
|
489
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
490
|
+
uploadType?: string;
|
|
491
|
+
/** Request body */
|
|
492
|
+
resource: RemovePublicKeyRequest;
|
|
493
|
+
}): Request<Operation>;
|
|
494
|
+
removePublicKey(request: {
|
|
495
|
+
/** V1 error format. */
|
|
496
|
+
"$.xgafv"?: string;
|
|
497
|
+
/** OAuth access token. */
|
|
498
|
+
access_token?: string;
|
|
499
|
+
/** Data format for response. */
|
|
500
|
+
alt?: string;
|
|
501
|
+
/** JSONP */
|
|
502
|
+
callback?: string;
|
|
503
|
+
/** Environment this key should be removed from, e.g. `users/me/environments/default`. */
|
|
504
|
+
environment: string;
|
|
505
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
506
|
+
fields?: string;
|
|
507
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
508
|
+
key?: string;
|
|
509
|
+
/** OAuth 2.0 token for the current user. */
|
|
510
|
+
oauth_token?: string;
|
|
511
|
+
/** Returns response with indentations and line breaks. */
|
|
512
|
+
prettyPrint?: boolean;
|
|
513
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
514
|
+
quotaUser?: string;
|
|
515
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
516
|
+
upload_protocol?: string;
|
|
517
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
518
|
+
uploadType?: string;
|
|
519
|
+
},
|
|
520
|
+
body: RemovePublicKeyRequest): Request<Operation>;
|
|
521
|
+
/**
|
|
522
|
+
* Starts an existing environment, allowing clients to connect to it. The returned operation will contain an instance of StartEnvironmentMetadata in its metadata field. Users can wait
|
|
523
|
+
* for the environment to start by polling this operation via GetOperation. Once the environment has finished starting and is ready to accept connections, the operation will contain a
|
|
524
|
+
* StartEnvironmentResponse in its response field.
|
|
525
|
+
*/
|
|
526
|
+
start(request: {
|
|
527
|
+
/** V1 error format. */
|
|
528
|
+
"$.xgafv"?: string;
|
|
529
|
+
/** OAuth access token. */
|
|
530
|
+
access_token?: string;
|
|
531
|
+
/** Data format for response. */
|
|
532
|
+
alt?: string;
|
|
533
|
+
/** JSONP */
|
|
534
|
+
callback?: string;
|
|
535
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
536
|
+
fields?: string;
|
|
537
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
538
|
+
key?: string;
|
|
539
|
+
/** Name of the resource that should be started, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. */
|
|
540
|
+
name: string;
|
|
541
|
+
/** OAuth 2.0 token for the current user. */
|
|
542
|
+
oauth_token?: string;
|
|
543
|
+
/** Returns response with indentations and line breaks. */
|
|
544
|
+
prettyPrint?: boolean;
|
|
545
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
546
|
+
quotaUser?: string;
|
|
547
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
548
|
+
upload_protocol?: string;
|
|
549
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
550
|
+
uploadType?: string;
|
|
551
|
+
/** Request body */
|
|
552
|
+
resource: StartEnvironmentRequest;
|
|
553
|
+
}): Request<Operation>;
|
|
554
|
+
start(request: {
|
|
555
|
+
/** V1 error format. */
|
|
556
|
+
"$.xgafv"?: string;
|
|
557
|
+
/** OAuth access token. */
|
|
558
|
+
access_token?: string;
|
|
559
|
+
/** Data format for response. */
|
|
560
|
+
alt?: string;
|
|
561
|
+
/** JSONP */
|
|
562
|
+
callback?: string;
|
|
563
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
564
|
+
fields?: string;
|
|
565
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
566
|
+
key?: string;
|
|
567
|
+
/** Name of the resource that should be started, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. */
|
|
568
|
+
name: string;
|
|
569
|
+
/** OAuth 2.0 token for the current user. */
|
|
570
|
+
oauth_token?: string;
|
|
571
|
+
/** Returns response with indentations and line breaks. */
|
|
572
|
+
prettyPrint?: boolean;
|
|
573
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
574
|
+
quotaUser?: string;
|
|
575
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
576
|
+
upload_protocol?: string;
|
|
577
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
578
|
+
uploadType?: string;
|
|
579
|
+
},
|
|
580
|
+
body: StartEnvironmentRequest): Request<Operation>;
|
|
581
|
+
}
|
|
582
|
+
interface UsersResource {
|
|
583
|
+
environments: EnvironmentsResource;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
const operations: OperationsResource;
|
|
587
|
+
|
|
588
|
+
const users: UsersResource;
|
|
589
|
+
}
|
|
590
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.cloudshell-v1",
|
|
3
|
+
"version": "0.0.20220803",
|
|
4
|
+
"description": "TypeScript typings for Cloud Shell API v1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"email": "maxim@mazurok.com",
|
|
8
|
+
"name": "Maxim Mazurok",
|
|
9
|
+
"url": "https://maxim.mazurok.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
14
|
+
},
|
|
15
|
+
"types": "index.d.ts",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/gapi.client": "*",
|
|
18
|
+
"@types/gapi.client.discovery": "*"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# TypeScript typings for Cloud Shell API v1
|
|
2
|
+
|
|
3
|
+
Allows users to start, configure, and connect to interactive shell sessions running in the cloud.
|
|
4
|
+
For detailed description please check [documentation](https://cloud.google.com/shell/docs/).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Cloud Shell API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.cloudshell-v1 --save-dev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
You need to initialize Google API client in your code:
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
gapi.load('client', () => {
|
|
20
|
+
// now we can use gapi.client
|
|
21
|
+
// ...
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then load api client wrapper:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
gapi.client.load('https://cloudshell.googleapis.com/$discovery/rest?version=v1', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.cloudshell
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
|
|
36
|
+
gapi.client.load('cloudshell', 'v1', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.cloudshell
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Don't forget to authenticate your client before sending any request to resources:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
// declare client_id registered in Google Developers Console
|
|
46
|
+
var client_id = '',
|
|
47
|
+
scope = [
|
|
48
|
+
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
|
49
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
50
|
+
],
|
|
51
|
+
immediate = true;
|
|
52
|
+
// ...
|
|
53
|
+
|
|
54
|
+
gapi.auth.authorize(
|
|
55
|
+
{ client_id: client_id, scope: scope, immediate: immediate },
|
|
56
|
+
authResult => {
|
|
57
|
+
if (authResult && !authResult.error) {
|
|
58
|
+
/* handle successful authorization */
|
|
59
|
+
} else {
|
|
60
|
+
/* handle authorization error */
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
After that you can use Cloud Shell API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
|
|
69
|
+
/*
|
|
70
|
+
Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.
|
|
71
|
+
*/
|
|
72
|
+
await gapi.client.cloudshell.operations.cancel({ name: "name", });
|
|
73
|
+
|
|
74
|
+
/*
|
|
75
|
+
Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
|
|
76
|
+
*/
|
|
77
|
+
await gapi.client.cloudshell.operations.delete({ name: "name", });
|
|
78
|
+
|
|
79
|
+
/*
|
|
80
|
+
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
|
|
81
|
+
*/
|
|
82
|
+
await gapi.client.cloudshell.operations.get({ name: "name", });
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
|
|
86
|
+
*/
|
|
87
|
+
await gapi.client.cloudshell.operations.list({ name: "name", });
|
|
88
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.cloudshell-v1 definition tests */
|
|
2
|
+
// IMPORTANT
|
|
3
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
4
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
5
|
+
|
|
6
|
+
// Revision: 20220803
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://cloudshell.googleapis.com/$discovery/rest?version=v1');
|
|
12
|
+
/** now we can use gapi.client.cloudshell */
|
|
13
|
+
|
|
14
|
+
/** don't forget to authenticate your client before sending any request to resources: */
|
|
15
|
+
/** declare client_id registered in Google Developers Console */
|
|
16
|
+
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
|
17
|
+
const scope = [
|
|
18
|
+
/** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */
|
|
19
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
20
|
+
];
|
|
21
|
+
const immediate = false;
|
|
22
|
+
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
|
23
|
+
if (authResult && !authResult.error) {
|
|
24
|
+
/** handle successful authorization */
|
|
25
|
+
run();
|
|
26
|
+
} else {
|
|
27
|
+
/** handle authorization error */
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
async function run() {
|
|
32
|
+
/**
|
|
33
|
+
* Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this
|
|
34
|
+
* method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation
|
|
35
|
+
* completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of
|
|
36
|
+
* 1, corresponding to `Code.CANCELLED`.
|
|
37
|
+
*/
|
|
38
|
+
await gapi.client.cloudshell.operations.cancel({
|
|
39
|
+
name: "Test string",
|
|
40
|
+
}, {
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support
|
|
44
|
+
* this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
|
|
45
|
+
*/
|
|
46
|
+
await gapi.client.cloudshell.operations.delete({
|
|
47
|
+
name: "Test string",
|
|
48
|
+
});
|
|
49
|
+
/** Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service. */
|
|
50
|
+
await gapi.client.cloudshell.operations.get({
|
|
51
|
+
name: "Test string",
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to
|
|
55
|
+
* override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as
|
|
56
|
+
* `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must
|
|
57
|
+
* ensure the name binding is the parent resource, without the operations collection id.
|
|
58
|
+
*/
|
|
59
|
+
await gapi.client.cloudshell.operations.list({
|
|
60
|
+
filter: "Test string",
|
|
61
|
+
name: "Test string",
|
|
62
|
+
pageSize: 42,
|
|
63
|
+
pageToken: "Test string",
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* Adds a public SSH key to an environment, allowing clients with the corresponding private key to connect to that environment via SSH. If a key with the same content already exists, this
|
|
67
|
+
* will error with ALREADY_EXISTS.
|
|
68
|
+
*/
|
|
69
|
+
await gapi.client.cloudshell.users.environments.addPublicKey({
|
|
70
|
+
environment: "Test string",
|
|
71
|
+
}, {
|
|
72
|
+
key: "Test string",
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* Sends OAuth credentials to a running environment on behalf of a user. When this completes, the environment will be authorized to run various Google Cloud command line tools without
|
|
76
|
+
* requiring the user to manually authenticate.
|
|
77
|
+
*/
|
|
78
|
+
await gapi.client.cloudshell.users.environments.authorize({
|
|
79
|
+
name: "Test string",
|
|
80
|
+
}, {
|
|
81
|
+
accessToken: "Test string",
|
|
82
|
+
expireTime: "Test string",
|
|
83
|
+
idToken: "Test string",
|
|
84
|
+
});
|
|
85
|
+
/** Gets an environment. Returns NOT_FOUND if the environment does not exist. */
|
|
86
|
+
await gapi.client.cloudshell.users.environments.get({
|
|
87
|
+
name: "Test string",
|
|
88
|
+
});
|
|
89
|
+
/**
|
|
90
|
+
* Removes a public SSH key from an environment. Clients will no longer be able to connect to the environment using the corresponding private key. If a key with the same content is not
|
|
91
|
+
* present, this will error with NOT_FOUND.
|
|
92
|
+
*/
|
|
93
|
+
await gapi.client.cloudshell.users.environments.removePublicKey({
|
|
94
|
+
environment: "Test string",
|
|
95
|
+
}, {
|
|
96
|
+
key: "Test string",
|
|
97
|
+
});
|
|
98
|
+
/**
|
|
99
|
+
* Starts an existing environment, allowing clients to connect to it. The returned operation will contain an instance of StartEnvironmentMetadata in its metadata field. Users can wait for
|
|
100
|
+
* the environment to start by polling this operation via GetOperation. Once the environment has finished starting and is ready to accept connections, the operation will contain a
|
|
101
|
+
* StartEnvironmentResponse in its response field.
|
|
102
|
+
*/
|
|
103
|
+
await gapi.client.cloudshell.users.environments.start({
|
|
104
|
+
name: "Test string",
|
|
105
|
+
}, {
|
|
106
|
+
accessToken: "Test string",
|
|
107
|
+
publicKeys: [
|
|
108
|
+
"Test string"
|
|
109
|
+
],
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
});
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"lib": ["es6", "dom"],
|
|
5
|
+
"noImplicitAny": true,
|
|
6
|
+
"noImplicitThis": true,
|
|
7
|
+
"strictNullChecks": true,
|
|
8
|
+
"baseUrl": "../",
|
|
9
|
+
"typeRoots": [
|
|
10
|
+
"../"
|
|
11
|
+
],
|
|
12
|
+
"types": [],
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"strictFunctionTypes": true
|
|
16
|
+
},
|
|
17
|
+
"files": ["index.d.ts", "tests.ts"]
|
|
18
|
+
}
|