@maxim_mazurok/gapi.client.vpcaccess-v1 0.0.20230330
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 +466 -0
- package/package.json +20 -0
- package/readme.md +68 -0
- package/tests.ts +109 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Serverless VPC Access API v1 0.0 */
|
|
2
|
+
// Project: https://cloud.google.com/vpc/docs/configure-serverless-vpc-access
|
|
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
|
+
|
|
8
|
+
// IMPORTANT
|
|
9
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
10
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
11
|
+
// Generated from: https://vpcaccess.googleapis.com/$discovery/rest?version=v1
|
|
12
|
+
// Revision: 20230330
|
|
13
|
+
|
|
14
|
+
/// <reference types="gapi.client" />
|
|
15
|
+
|
|
16
|
+
declare namespace gapi.client {
|
|
17
|
+
/** Load Serverless VPC Access API v1 */
|
|
18
|
+
function load(urlOrObject: "https://vpcaccess.googleapis.com/$discovery/rest?version=v1"): Promise<void>;
|
|
19
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
20
|
+
function load(name: "vpcaccess", version: "v1"): Promise<void>;
|
|
21
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
22
|
+
function load(name: "vpcaccess", version: "v1", callback: () => any): void;
|
|
23
|
+
|
|
24
|
+
namespace vpcaccess {
|
|
25
|
+
interface Connector {
|
|
26
|
+
/** Output only. List of projects using the connector. */
|
|
27
|
+
connectedProjects?: string[];
|
|
28
|
+
/** The range of internal addresses that follows RFC 4632 notation. Example: `10.132.0.0/28`. */
|
|
29
|
+
ipCidrRange?: string;
|
|
30
|
+
/** Machine type of VM Instance underlying connector. Default is e2-micro */
|
|
31
|
+
machineType?: string;
|
|
32
|
+
/** Maximum value of instances in autoscaling group underlying the connector. */
|
|
33
|
+
maxInstances?: number;
|
|
34
|
+
/** Maximum throughput of the connector in Mbps. Default is 300, max is 1000. */
|
|
35
|
+
maxThroughput?: number;
|
|
36
|
+
/** Minimum value of instances in autoscaling group underlying the connector. */
|
|
37
|
+
minInstances?: number;
|
|
38
|
+
/** Minimum throughput of the connector in Mbps. Default and min is 200. */
|
|
39
|
+
minThroughput?: number;
|
|
40
|
+
/** The resource name in the format `projects/*/locations/*/connectors/*`. */
|
|
41
|
+
name?: string;
|
|
42
|
+
/** Name of a VPC network. */
|
|
43
|
+
network?: string;
|
|
44
|
+
/** Output only. State of the VPC access connector. */
|
|
45
|
+
state?: string;
|
|
46
|
+
/** The subnet in which to house the VPC Access Connector. */
|
|
47
|
+
subnet?: Subnet;
|
|
48
|
+
}
|
|
49
|
+
interface ListConnectorsResponse {
|
|
50
|
+
/** List of Serverless VPC Access connectors. */
|
|
51
|
+
connectors?: Connector[];
|
|
52
|
+
/** Continuation token. */
|
|
53
|
+
nextPageToken?: string;
|
|
54
|
+
}
|
|
55
|
+
interface ListLocationsResponse {
|
|
56
|
+
/** A list of locations that matches the specified filter in the request. */
|
|
57
|
+
locations?: Location[];
|
|
58
|
+
/** The standard List next-page token. */
|
|
59
|
+
nextPageToken?: string;
|
|
60
|
+
}
|
|
61
|
+
interface ListOperationsResponse {
|
|
62
|
+
/** The standard List next-page token. */
|
|
63
|
+
nextPageToken?: string;
|
|
64
|
+
/** A list of operations that matches the specified filter in the request. */
|
|
65
|
+
operations?: Operation[];
|
|
66
|
+
}
|
|
67
|
+
interface Location {
|
|
68
|
+
/** The friendly name for this location, typically a nearby city name. For example, "Tokyo". */
|
|
69
|
+
displayName?: string;
|
|
70
|
+
/** Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"} */
|
|
71
|
+
labels?: { [P in string]: string };
|
|
72
|
+
/** The canonical id for this location. For example: `"us-east1"`. */
|
|
73
|
+
locationId?: string;
|
|
74
|
+
/** Service-specific metadata. For example the available capacity at the given location. */
|
|
75
|
+
metadata?: { [P in string]: any };
|
|
76
|
+
/** Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"` */
|
|
77
|
+
name?: string;
|
|
78
|
+
}
|
|
79
|
+
interface Operation {
|
|
80
|
+
/** 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. */
|
|
81
|
+
done?: boolean;
|
|
82
|
+
/** The error result of the operation in case of failure or cancellation. */
|
|
83
|
+
error?: Status;
|
|
84
|
+
/**
|
|
85
|
+
* 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
|
|
86
|
+
* metadata. Any method that returns a long-running operation should document the metadata type, if any.
|
|
87
|
+
*/
|
|
88
|
+
metadata?: { [P in string]: any };
|
|
89
|
+
/**
|
|
90
|
+
* 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
|
|
91
|
+
* with `operations/{unique_id}`.
|
|
92
|
+
*/
|
|
93
|
+
name?: string;
|
|
94
|
+
/**
|
|
95
|
+
* 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
|
|
96
|
+
* 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
|
|
97
|
+
* original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
|
|
98
|
+
*/
|
|
99
|
+
response?: { [P in string]: any };
|
|
100
|
+
}
|
|
101
|
+
interface OperationMetadata {
|
|
102
|
+
/** Output only. Time when the operation was created. */
|
|
103
|
+
createTime?: string;
|
|
104
|
+
/** Output only. Time when the operation completed. */
|
|
105
|
+
endTime?: string;
|
|
106
|
+
/** Output only. Method that initiated the operation e.g. google.cloud.vpcaccess.v1.Connectors.CreateConnector. */
|
|
107
|
+
method?: string;
|
|
108
|
+
/** Output only. Name of the resource that this operation is acting on e.g. projects/my-project/locations/us-central1/connectors/v1. */
|
|
109
|
+
target?: string;
|
|
110
|
+
}
|
|
111
|
+
interface OperationMetadataV1Alpha1 {
|
|
112
|
+
/** Output only. Time when the operation completed. */
|
|
113
|
+
endTime?: string;
|
|
114
|
+
/** Output only. Time when the operation was created. */
|
|
115
|
+
insertTime?: string;
|
|
116
|
+
/** Output only. Method that initiated the operation e.g. google.cloud.vpcaccess.v1alpha1.Connectors.CreateConnector. */
|
|
117
|
+
method?: string;
|
|
118
|
+
/** Output only. Name of the resource that this operation is acting on e.g. projects/my-project/locations/us-central1/connectors/v1. */
|
|
119
|
+
target?: string;
|
|
120
|
+
}
|
|
121
|
+
interface OperationMetadataV1Beta1 {
|
|
122
|
+
/** Output only. Time when the operation was created. */
|
|
123
|
+
createTime?: string;
|
|
124
|
+
/** Output only. Time when the operation completed. */
|
|
125
|
+
endTime?: string;
|
|
126
|
+
/** Output only. Method that initiated the operation e.g. google.cloud.vpcaccess.v1beta1.Connectors.CreateConnector. */
|
|
127
|
+
method?: string;
|
|
128
|
+
/** Output only. Name of the resource that this operation is acting on e.g. projects/my-project/locations/us-central1/connectors/v1. */
|
|
129
|
+
target?: string;
|
|
130
|
+
}
|
|
131
|
+
interface Status {
|
|
132
|
+
/** The status code, which should be an enum value of google.rpc.Code. */
|
|
133
|
+
code?: number;
|
|
134
|
+
/** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
|
|
135
|
+
details?: Array<{ [P in string]: any }>;
|
|
136
|
+
/**
|
|
137
|
+
* 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
|
|
138
|
+
* client.
|
|
139
|
+
*/
|
|
140
|
+
message?: string;
|
|
141
|
+
}
|
|
142
|
+
interface Subnet {
|
|
143
|
+
/**
|
|
144
|
+
* Subnet name (relative, not fully qualified). E.g. if the full subnet selfLink is
|
|
145
|
+
* https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetName} the correct input for this field would be {subnetName}
|
|
146
|
+
*/
|
|
147
|
+
name?: string;
|
|
148
|
+
/** Project in which the subnet exists. If not set, this project is assumed to be the project for which the connector create request was issued. */
|
|
149
|
+
projectId?: string;
|
|
150
|
+
}
|
|
151
|
+
interface ConnectorsResource {
|
|
152
|
+
/** Creates a Serverless VPC Access connector, returns an operation. */
|
|
153
|
+
create(request: {
|
|
154
|
+
/** V1 error format. */
|
|
155
|
+
"$.xgafv"?: string;
|
|
156
|
+
/** OAuth access token. */
|
|
157
|
+
access_token?: string;
|
|
158
|
+
/** Data format for response. */
|
|
159
|
+
alt?: string;
|
|
160
|
+
/** JSONP */
|
|
161
|
+
callback?: string;
|
|
162
|
+
/** Required. The ID to use for this connector. */
|
|
163
|
+
connectorId?: string;
|
|
164
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
165
|
+
fields?: string;
|
|
166
|
+
/** 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. */
|
|
167
|
+
key?: string;
|
|
168
|
+
/** OAuth 2.0 token for the current user. */
|
|
169
|
+
oauth_token?: string;
|
|
170
|
+
/** Required. The project and location in which the configuration should be created, specified in the format `projects/*/locations/*`. */
|
|
171
|
+
parent: string;
|
|
172
|
+
/** Returns response with indentations and line breaks. */
|
|
173
|
+
prettyPrint?: boolean;
|
|
174
|
+
/** 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. */
|
|
175
|
+
quotaUser?: string;
|
|
176
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
177
|
+
upload_protocol?: string;
|
|
178
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
179
|
+
uploadType?: string;
|
|
180
|
+
/** Request body */
|
|
181
|
+
resource: Connector;
|
|
182
|
+
}): Request<Operation>;
|
|
183
|
+
create(request: {
|
|
184
|
+
/** V1 error format. */
|
|
185
|
+
"$.xgafv"?: string;
|
|
186
|
+
/** OAuth access token. */
|
|
187
|
+
access_token?: string;
|
|
188
|
+
/** Data format for response. */
|
|
189
|
+
alt?: string;
|
|
190
|
+
/** JSONP */
|
|
191
|
+
callback?: string;
|
|
192
|
+
/** Required. The ID to use for this connector. */
|
|
193
|
+
connectorId?: string;
|
|
194
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
195
|
+
fields?: string;
|
|
196
|
+
/** 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. */
|
|
197
|
+
key?: string;
|
|
198
|
+
/** OAuth 2.0 token for the current user. */
|
|
199
|
+
oauth_token?: string;
|
|
200
|
+
/** Required. The project and location in which the configuration should be created, specified in the format `projects/*/locations/*`. */
|
|
201
|
+
parent: string;
|
|
202
|
+
/** Returns response with indentations and line breaks. */
|
|
203
|
+
prettyPrint?: boolean;
|
|
204
|
+
/** 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. */
|
|
205
|
+
quotaUser?: string;
|
|
206
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
207
|
+
upload_protocol?: string;
|
|
208
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
209
|
+
uploadType?: string;
|
|
210
|
+
},
|
|
211
|
+
body: Connector): Request<Operation>;
|
|
212
|
+
/** Deletes a Serverless VPC Access connector. Returns NOT_FOUND if the resource does not exist. */
|
|
213
|
+
delete(request?: {
|
|
214
|
+
/** V1 error format. */
|
|
215
|
+
"$.xgafv"?: string;
|
|
216
|
+
/** OAuth access token. */
|
|
217
|
+
access_token?: string;
|
|
218
|
+
/** Data format for response. */
|
|
219
|
+
alt?: string;
|
|
220
|
+
/** JSONP */
|
|
221
|
+
callback?: string;
|
|
222
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
223
|
+
fields?: string;
|
|
224
|
+
/** 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. */
|
|
225
|
+
key?: string;
|
|
226
|
+
/** Required. Name of a Serverless VPC Access connector to delete. */
|
|
227
|
+
name: string;
|
|
228
|
+
/** OAuth 2.0 token for the current user. */
|
|
229
|
+
oauth_token?: string;
|
|
230
|
+
/** Returns response with indentations and line breaks. */
|
|
231
|
+
prettyPrint?: boolean;
|
|
232
|
+
/** 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. */
|
|
233
|
+
quotaUser?: string;
|
|
234
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
235
|
+
upload_protocol?: string;
|
|
236
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
237
|
+
uploadType?: string;
|
|
238
|
+
}): Request<Operation>;
|
|
239
|
+
/** Gets a Serverless VPC Access connector. Returns NOT_FOUND if the resource does not exist. */
|
|
240
|
+
get(request?: {
|
|
241
|
+
/** V1 error format. */
|
|
242
|
+
"$.xgafv"?: string;
|
|
243
|
+
/** OAuth access token. */
|
|
244
|
+
access_token?: string;
|
|
245
|
+
/** Data format for response. */
|
|
246
|
+
alt?: string;
|
|
247
|
+
/** JSONP */
|
|
248
|
+
callback?: string;
|
|
249
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
250
|
+
fields?: string;
|
|
251
|
+
/** 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. */
|
|
252
|
+
key?: string;
|
|
253
|
+
/** Required. Name of a Serverless VPC Access connector to get. */
|
|
254
|
+
name: string;
|
|
255
|
+
/** OAuth 2.0 token for the current user. */
|
|
256
|
+
oauth_token?: string;
|
|
257
|
+
/** Returns response with indentations and line breaks. */
|
|
258
|
+
prettyPrint?: boolean;
|
|
259
|
+
/** 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. */
|
|
260
|
+
quotaUser?: string;
|
|
261
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
262
|
+
upload_protocol?: string;
|
|
263
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
264
|
+
uploadType?: string;
|
|
265
|
+
}): Request<Connector>;
|
|
266
|
+
/** Lists Serverless VPC Access connectors. */
|
|
267
|
+
list(request?: {
|
|
268
|
+
/** V1 error format. */
|
|
269
|
+
"$.xgafv"?: string;
|
|
270
|
+
/** OAuth access token. */
|
|
271
|
+
access_token?: string;
|
|
272
|
+
/** Data format for response. */
|
|
273
|
+
alt?: string;
|
|
274
|
+
/** JSONP */
|
|
275
|
+
callback?: string;
|
|
276
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
277
|
+
fields?: string;
|
|
278
|
+
/** 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. */
|
|
279
|
+
key?: string;
|
|
280
|
+
/** OAuth 2.0 token for the current user. */
|
|
281
|
+
oauth_token?: string;
|
|
282
|
+
/** Maximum number of functions to return per call. */
|
|
283
|
+
pageSize?: number;
|
|
284
|
+
/** Continuation token. */
|
|
285
|
+
pageToken?: string;
|
|
286
|
+
/** Required. The project and location from which the routes should be listed. */
|
|
287
|
+
parent: string;
|
|
288
|
+
/** Returns response with indentations and line breaks. */
|
|
289
|
+
prettyPrint?: boolean;
|
|
290
|
+
/** 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. */
|
|
291
|
+
quotaUser?: string;
|
|
292
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
293
|
+
upload_protocol?: string;
|
|
294
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
295
|
+
uploadType?: string;
|
|
296
|
+
}): Request<ListConnectorsResponse>;
|
|
297
|
+
/** Updates a Serverless VPC Access connector, returns an operation. */
|
|
298
|
+
patch(request: {
|
|
299
|
+
/** V1 error format. */
|
|
300
|
+
"$.xgafv"?: string;
|
|
301
|
+
/** OAuth access token. */
|
|
302
|
+
access_token?: string;
|
|
303
|
+
/** Data format for response. */
|
|
304
|
+
alt?: string;
|
|
305
|
+
/** JSONP */
|
|
306
|
+
callback?: string;
|
|
307
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
308
|
+
fields?: string;
|
|
309
|
+
/** 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. */
|
|
310
|
+
key?: string;
|
|
311
|
+
/** The resource name in the format `projects/*/locations/*/connectors/*`. */
|
|
312
|
+
name: string;
|
|
313
|
+
/** OAuth 2.0 token for the current user. */
|
|
314
|
+
oauth_token?: string;
|
|
315
|
+
/** Returns response with indentations and line breaks. */
|
|
316
|
+
prettyPrint?: boolean;
|
|
317
|
+
/** 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. */
|
|
318
|
+
quotaUser?: string;
|
|
319
|
+
/** The fields to update on the entry group. If absent or empty, all modifiable fields are updated. */
|
|
320
|
+
updateMask?: string;
|
|
321
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
322
|
+
upload_protocol?: string;
|
|
323
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
324
|
+
uploadType?: string;
|
|
325
|
+
/** Request body */
|
|
326
|
+
resource: Connector;
|
|
327
|
+
}): Request<Operation>;
|
|
328
|
+
patch(request: {
|
|
329
|
+
/** V1 error format. */
|
|
330
|
+
"$.xgafv"?: string;
|
|
331
|
+
/** OAuth access token. */
|
|
332
|
+
access_token?: string;
|
|
333
|
+
/** Data format for response. */
|
|
334
|
+
alt?: string;
|
|
335
|
+
/** JSONP */
|
|
336
|
+
callback?: string;
|
|
337
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
338
|
+
fields?: string;
|
|
339
|
+
/** 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. */
|
|
340
|
+
key?: string;
|
|
341
|
+
/** The resource name in the format `projects/*/locations/*/connectors/*`. */
|
|
342
|
+
name: string;
|
|
343
|
+
/** OAuth 2.0 token for the current user. */
|
|
344
|
+
oauth_token?: string;
|
|
345
|
+
/** Returns response with indentations and line breaks. */
|
|
346
|
+
prettyPrint?: boolean;
|
|
347
|
+
/** 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. */
|
|
348
|
+
quotaUser?: string;
|
|
349
|
+
/** The fields to update on the entry group. If absent or empty, all modifiable fields are updated. */
|
|
350
|
+
updateMask?: string;
|
|
351
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
352
|
+
upload_protocol?: string;
|
|
353
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
354
|
+
uploadType?: string;
|
|
355
|
+
},
|
|
356
|
+
body: Connector): Request<Operation>;
|
|
357
|
+
}
|
|
358
|
+
interface OperationsResource {
|
|
359
|
+
/** 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. */
|
|
360
|
+
get(request?: {
|
|
361
|
+
/** V1 error format. */
|
|
362
|
+
"$.xgafv"?: string;
|
|
363
|
+
/** OAuth access token. */
|
|
364
|
+
access_token?: string;
|
|
365
|
+
/** Data format for response. */
|
|
366
|
+
alt?: string;
|
|
367
|
+
/** JSONP */
|
|
368
|
+
callback?: string;
|
|
369
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
370
|
+
fields?: string;
|
|
371
|
+
/** 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. */
|
|
372
|
+
key?: string;
|
|
373
|
+
/** The name of the operation resource. */
|
|
374
|
+
name: string;
|
|
375
|
+
/** OAuth 2.0 token for the current user. */
|
|
376
|
+
oauth_token?: string;
|
|
377
|
+
/** Returns response with indentations and line breaks. */
|
|
378
|
+
prettyPrint?: boolean;
|
|
379
|
+
/** 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. */
|
|
380
|
+
quotaUser?: string;
|
|
381
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
382
|
+
upload_protocol?: string;
|
|
383
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
384
|
+
uploadType?: string;
|
|
385
|
+
}): Request<Operation>;
|
|
386
|
+
/** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
|
|
387
|
+
list(request?: {
|
|
388
|
+
/** V1 error format. */
|
|
389
|
+
"$.xgafv"?: string;
|
|
390
|
+
/** OAuth access token. */
|
|
391
|
+
access_token?: string;
|
|
392
|
+
/** Data format for response. */
|
|
393
|
+
alt?: string;
|
|
394
|
+
/** JSONP */
|
|
395
|
+
callback?: string;
|
|
396
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
397
|
+
fields?: string;
|
|
398
|
+
/** The standard list filter. */
|
|
399
|
+
filter?: string;
|
|
400
|
+
/** 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. */
|
|
401
|
+
key?: string;
|
|
402
|
+
/** The name of the operation's parent resource. */
|
|
403
|
+
name: string;
|
|
404
|
+
/** OAuth 2.0 token for the current user. */
|
|
405
|
+
oauth_token?: string;
|
|
406
|
+
/** The standard list page size. */
|
|
407
|
+
pageSize?: number;
|
|
408
|
+
/** The standard list page token. */
|
|
409
|
+
pageToken?: string;
|
|
410
|
+
/** Returns response with indentations and line breaks. */
|
|
411
|
+
prettyPrint?: boolean;
|
|
412
|
+
/** 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. */
|
|
413
|
+
quotaUser?: string;
|
|
414
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
415
|
+
upload_protocol?: string;
|
|
416
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
417
|
+
uploadType?: string;
|
|
418
|
+
}): Request<ListOperationsResponse>;
|
|
419
|
+
}
|
|
420
|
+
interface LocationsResource {
|
|
421
|
+
/** Lists information about the supported locations for this service. */
|
|
422
|
+
list(request?: {
|
|
423
|
+
/** V1 error format. */
|
|
424
|
+
"$.xgafv"?: string;
|
|
425
|
+
/** OAuth access token. */
|
|
426
|
+
access_token?: string;
|
|
427
|
+
/** Data format for response. */
|
|
428
|
+
alt?: string;
|
|
429
|
+
/** JSONP */
|
|
430
|
+
callback?: string;
|
|
431
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
432
|
+
fields?: string;
|
|
433
|
+
/**
|
|
434
|
+
* A filter to narrow down results to a preferred subset. The filtering language accepts strings like `"displayName=tokyo"`, and is documented in more detail in
|
|
435
|
+
* [AIP-160](https://google.aip.dev/160).
|
|
436
|
+
*/
|
|
437
|
+
filter?: string;
|
|
438
|
+
/** 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. */
|
|
439
|
+
key?: string;
|
|
440
|
+
/** The resource that owns the locations collection, if applicable. */
|
|
441
|
+
name: string;
|
|
442
|
+
/** OAuth 2.0 token for the current user. */
|
|
443
|
+
oauth_token?: string;
|
|
444
|
+
/** The maximum number of results to return. If not set, the service selects a default. */
|
|
445
|
+
pageSize?: number;
|
|
446
|
+
/** A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page. */
|
|
447
|
+
pageToken?: string;
|
|
448
|
+
/** Returns response with indentations and line breaks. */
|
|
449
|
+
prettyPrint?: boolean;
|
|
450
|
+
/** 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. */
|
|
451
|
+
quotaUser?: string;
|
|
452
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
453
|
+
upload_protocol?: string;
|
|
454
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
455
|
+
uploadType?: string;
|
|
456
|
+
}): Request<ListLocationsResponse>;
|
|
457
|
+
connectors: ConnectorsResource;
|
|
458
|
+
operations: OperationsResource;
|
|
459
|
+
}
|
|
460
|
+
interface ProjectsResource {
|
|
461
|
+
locations: LocationsResource;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
const projects: ProjectsResource;
|
|
465
|
+
}
|
|
466
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.vpcaccess-v1",
|
|
3
|
+
"version": "0.0.20230330",
|
|
4
|
+
"description": "TypeScript typings for Serverless VPC Access 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,68 @@
|
|
|
1
|
+
# TypeScript typings for Serverless VPC Access API v1
|
|
2
|
+
|
|
3
|
+
API for managing VPC access connectors.
|
|
4
|
+
For detailed description please check [documentation](https://cloud.google.com/vpc/docs/configure-serverless-vpc-access).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Serverless VPC Access API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.vpcaccess-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://vpcaccess.googleapis.com/$discovery/rest?version=v1', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.vpcaccess
|
|
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('vpcaccess', 'v1', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.vpcaccess
|
|
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 Serverless VPC Access API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.vpcaccess-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: 20230330
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://vpcaccess.googleapis.com/$discovery/rest?version=v1');
|
|
12
|
+
/** now we can use gapi.client.vpcaccess */
|
|
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
|
+
/** Lists information about the supported locations for this service. */
|
|
33
|
+
await gapi.client.vpcaccess.projects.locations.list({
|
|
34
|
+
filter: "Test string",
|
|
35
|
+
name: "Test string",
|
|
36
|
+
pageSize: 42,
|
|
37
|
+
pageToken: "Test string",
|
|
38
|
+
});
|
|
39
|
+
/** Creates a Serverless VPC Access connector, returns an operation. */
|
|
40
|
+
await gapi.client.vpcaccess.projects.locations.connectors.create({
|
|
41
|
+
connectorId: "Test string",
|
|
42
|
+
parent: "Test string",
|
|
43
|
+
}, {
|
|
44
|
+
connectedProjects: [
|
|
45
|
+
"Test string"
|
|
46
|
+
],
|
|
47
|
+
ipCidrRange: "Test string",
|
|
48
|
+
machineType: "Test string",
|
|
49
|
+
maxInstances: 42,
|
|
50
|
+
maxThroughput: 42,
|
|
51
|
+
minInstances: 42,
|
|
52
|
+
minThroughput: 42,
|
|
53
|
+
name: "Test string",
|
|
54
|
+
network: "Test string",
|
|
55
|
+
state: "Test string",
|
|
56
|
+
subnet: {
|
|
57
|
+
name: "Test string",
|
|
58
|
+
projectId: "Test string",
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
/** Deletes a Serverless VPC Access connector. Returns NOT_FOUND if the resource does not exist. */
|
|
62
|
+
await gapi.client.vpcaccess.projects.locations.connectors.delete({
|
|
63
|
+
name: "Test string",
|
|
64
|
+
});
|
|
65
|
+
/** Gets a Serverless VPC Access connector. Returns NOT_FOUND if the resource does not exist. */
|
|
66
|
+
await gapi.client.vpcaccess.projects.locations.connectors.get({
|
|
67
|
+
name: "Test string",
|
|
68
|
+
});
|
|
69
|
+
/** Lists Serverless VPC Access connectors. */
|
|
70
|
+
await gapi.client.vpcaccess.projects.locations.connectors.list({
|
|
71
|
+
pageSize: 42,
|
|
72
|
+
pageToken: "Test string",
|
|
73
|
+
parent: "Test string",
|
|
74
|
+
});
|
|
75
|
+
/** Updates a Serverless VPC Access connector, returns an operation. */
|
|
76
|
+
await gapi.client.vpcaccess.projects.locations.connectors.patch({
|
|
77
|
+
name: "Test string",
|
|
78
|
+
updateMask: "Test string",
|
|
79
|
+
}, {
|
|
80
|
+
connectedProjects: [
|
|
81
|
+
"Test string"
|
|
82
|
+
],
|
|
83
|
+
ipCidrRange: "Test string",
|
|
84
|
+
machineType: "Test string",
|
|
85
|
+
maxInstances: 42,
|
|
86
|
+
maxThroughput: 42,
|
|
87
|
+
minInstances: 42,
|
|
88
|
+
minThroughput: 42,
|
|
89
|
+
name: "Test string",
|
|
90
|
+
network: "Test string",
|
|
91
|
+
state: "Test string",
|
|
92
|
+
subnet: {
|
|
93
|
+
name: "Test string",
|
|
94
|
+
projectId: "Test string",
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
/** 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. */
|
|
98
|
+
await gapi.client.vpcaccess.projects.locations.operations.get({
|
|
99
|
+
name: "Test string",
|
|
100
|
+
});
|
|
101
|
+
/** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
|
|
102
|
+
await gapi.client.vpcaccess.projects.locations.operations.list({
|
|
103
|
+
filter: "Test string",
|
|
104
|
+
name: "Test string",
|
|
105
|
+
pageSize: 42,
|
|
106
|
+
pageToken: "Test string",
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
});
|
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
|
+
}
|