@maxim_mazurok/gapi.client.networkconnectivity-v1alpha1 0.0.20220809

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/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.networkconnectivity-v1alpha1",
3
+ "version": "0.0.20220809",
4
+ "description": "TypeScript typings for Network Connectivity API v1alpha1",
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 Network Connectivity API v1alpha1
2
+
3
+ This API enables connectivity with and between Google Cloud resources.
4
+ For detailed description please check [documentation](https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Network Connectivity API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.networkconnectivity-v1alpha1 --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://networkconnectivity.googleapis.com/$discovery/rest?version=v1alpha1', () => {
29
+ // now we can use:
30
+ // gapi.client.networkconnectivity
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('networkconnectivity', 'v1alpha1', () => {
37
+ // now we can use:
38
+ // gapi.client.networkconnectivity
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 Network Connectivity API resources: <!-- TODO: make this work for multiple namespaces -->
66
+
67
+ ```typescript
68
+ ```
package/tests.ts ADDED
@@ -0,0 +1,527 @@
1
+ /* This is stub file for gapi.client.networkconnectivity-v1alpha1 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: 20220809
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://networkconnectivity.googleapis.com/$discovery/rest?version=v1alpha1');
12
+ /** now we can use gapi.client.networkconnectivity */
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
+ /** Gets information about a location. */
33
+ await gapi.client.networkconnectivity.projects.locations.get({
34
+ name: "Test string",
35
+ });
36
+ /** Lists information about the supported locations for this service. */
37
+ await gapi.client.networkconnectivity.projects.locations.list({
38
+ filter: "Test string",
39
+ name: "Test string",
40
+ pageSize: 42,
41
+ pageToken: "Test string",
42
+ });
43
+ /** Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. */
44
+ await gapi.client.networkconnectivity.projects.locations.connectionPolicies.getIamPolicy({
45
+ "options.requestedPolicyVersion": 42,
46
+ resource: "Test string",
47
+ });
48
+ /** Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. */
49
+ await gapi.client.networkconnectivity.projects.locations.connectionPolicies.setIamPolicy({
50
+ resource: "Test string",
51
+ }, {
52
+ policy: {
53
+ auditConfigs: [
54
+ {
55
+ auditLogConfigs: [
56
+ {
57
+ exemptedMembers: [
58
+ "Test string"
59
+ ],
60
+ logType: "Test string",
61
+ }
62
+ ],
63
+ service: "Test string",
64
+ }
65
+ ],
66
+ bindings: [
67
+ {
68
+ condition: {
69
+ description: "Test string",
70
+ expression: "Test string",
71
+ location: "Test string",
72
+ title: "Test string",
73
+ },
74
+ members: [
75
+ "Test string"
76
+ ],
77
+ role: "Test string",
78
+ }
79
+ ],
80
+ etag: "Test string",
81
+ version: 42,
82
+ },
83
+ updateMask: "Test string",
84
+ });
85
+ /**
86
+ * Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This
87
+ * operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
88
+ */
89
+ await gapi.client.networkconnectivity.projects.locations.connectionPolicies.testIamPermissions({
90
+ resource: "Test string",
91
+ }, {
92
+ permissions: [
93
+ "Test string"
94
+ ],
95
+ });
96
+ /** Creates a new Network Connectivity Center hub in the specified project. */
97
+ await gapi.client.networkconnectivity.projects.locations.global.hubs.create({
98
+ hubId: "Test string",
99
+ parent: "Test string",
100
+ requestId: "Test string",
101
+ }, {
102
+ createTime: "Test string",
103
+ description: "Test string",
104
+ labels: {
105
+ A: "Test string"
106
+ },
107
+ name: "Test string",
108
+ spokes: [
109
+ "Test string"
110
+ ],
111
+ state: "Test string",
112
+ uniqueId: "Test string",
113
+ updateTime: "Test string",
114
+ });
115
+ /** Deletes a Network Connectivity Center hub. */
116
+ await gapi.client.networkconnectivity.projects.locations.global.hubs.delete({
117
+ name: "Test string",
118
+ requestId: "Test string",
119
+ });
120
+ /** Gets details about a Network Connectivity Center hub. */
121
+ await gapi.client.networkconnectivity.projects.locations.global.hubs.get({
122
+ name: "Test string",
123
+ });
124
+ /** Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. */
125
+ await gapi.client.networkconnectivity.projects.locations.global.hubs.getIamPolicy({
126
+ "options.requestedPolicyVersion": 42,
127
+ resource: "Test string",
128
+ });
129
+ /** Lists the Network Connectivity Center hubs associated with a given project. */
130
+ await gapi.client.networkconnectivity.projects.locations.global.hubs.list({
131
+ filter: "Test string",
132
+ orderBy: "Test string",
133
+ pageSize: 42,
134
+ pageToken: "Test string",
135
+ parent: "Test string",
136
+ });
137
+ /** Updates the description and/or labels of a Network Connectivity Center hub. */
138
+ await gapi.client.networkconnectivity.projects.locations.global.hubs.patch({
139
+ name: "Test string",
140
+ requestId: "Test string",
141
+ updateMask: "Test string",
142
+ }, {
143
+ createTime: "Test string",
144
+ description: "Test string",
145
+ labels: {
146
+ A: "Test string"
147
+ },
148
+ name: "Test string",
149
+ spokes: [
150
+ "Test string"
151
+ ],
152
+ state: "Test string",
153
+ uniqueId: "Test string",
154
+ updateTime: "Test string",
155
+ });
156
+ /** Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. */
157
+ await gapi.client.networkconnectivity.projects.locations.global.hubs.setIamPolicy({
158
+ resource: "Test string",
159
+ }, {
160
+ policy: {
161
+ auditConfigs: [
162
+ {
163
+ auditLogConfigs: [
164
+ {
165
+ exemptedMembers: [
166
+ "Test string"
167
+ ],
168
+ logType: "Test string",
169
+ }
170
+ ],
171
+ service: "Test string",
172
+ }
173
+ ],
174
+ bindings: [
175
+ {
176
+ condition: {
177
+ description: "Test string",
178
+ expression: "Test string",
179
+ location: "Test string",
180
+ title: "Test string",
181
+ },
182
+ members: [
183
+ "Test string"
184
+ ],
185
+ role: "Test string",
186
+ }
187
+ ],
188
+ etag: "Test string",
189
+ version: 42,
190
+ },
191
+ updateMask: "Test string",
192
+ });
193
+ /**
194
+ * Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This
195
+ * operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
196
+ */
197
+ await gapi.client.networkconnectivity.projects.locations.global.hubs.testIamPermissions({
198
+ resource: "Test string",
199
+ }, {
200
+ permissions: [
201
+ "Test string"
202
+ ],
203
+ });
204
+ /** Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. */
205
+ await gapi.client.networkconnectivity.projects.locations.internalRanges.getIamPolicy({
206
+ "options.requestedPolicyVersion": 42,
207
+ resource: "Test string",
208
+ });
209
+ /** Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. */
210
+ await gapi.client.networkconnectivity.projects.locations.internalRanges.setIamPolicy({
211
+ resource: "Test string",
212
+ }, {
213
+ policy: {
214
+ auditConfigs: [
215
+ {
216
+ auditLogConfigs: [
217
+ {
218
+ exemptedMembers: [
219
+ "Test string"
220
+ ],
221
+ logType: "Test string",
222
+ }
223
+ ],
224
+ service: "Test string",
225
+ }
226
+ ],
227
+ bindings: [
228
+ {
229
+ condition: {
230
+ description: "Test string",
231
+ expression: "Test string",
232
+ location: "Test string",
233
+ title: "Test string",
234
+ },
235
+ members: [
236
+ "Test string"
237
+ ],
238
+ role: "Test string",
239
+ }
240
+ ],
241
+ etag: "Test string",
242
+ version: 42,
243
+ },
244
+ updateMask: "Test string",
245
+ });
246
+ /**
247
+ * Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This
248
+ * operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
249
+ */
250
+ await gapi.client.networkconnectivity.projects.locations.internalRanges.testIamPermissions({
251
+ resource: "Test string",
252
+ }, {
253
+ permissions: [
254
+ "Test string"
255
+ ],
256
+ });
257
+ /**
258
+ * 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
259
+ * 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
260
+ * 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
261
+ * 1, corresponding to `Code.CANCELLED`.
262
+ */
263
+ await gapi.client.networkconnectivity.projects.locations.operations.cancel({
264
+ name: "Test string",
265
+ }, {
266
+ });
267
+ /**
268
+ * 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
269
+ * this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
270
+ */
271
+ await gapi.client.networkconnectivity.projects.locations.operations.delete({
272
+ name: "Test string",
273
+ });
274
+ /** 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. */
275
+ await gapi.client.networkconnectivity.projects.locations.operations.get({
276
+ name: "Test string",
277
+ });
278
+ /**
279
+ * 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
280
+ * 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
281
+ * `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must
282
+ * ensure the name binding is the parent resource, without the operations collection id.
283
+ */
284
+ await gapi.client.networkconnectivity.projects.locations.operations.list({
285
+ filter: "Test string",
286
+ name: "Test string",
287
+ pageSize: 42,
288
+ pageToken: "Test string",
289
+ });
290
+ /** Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. */
291
+ await gapi.client.networkconnectivity.projects.locations.serviceIdentifiers.getIamPolicy({
292
+ "options.requestedPolicyVersion": 42,
293
+ resource: "Test string",
294
+ });
295
+ /** Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. */
296
+ await gapi.client.networkconnectivity.projects.locations.serviceIdentifiers.setIamPolicy({
297
+ resource: "Test string",
298
+ }, {
299
+ policy: {
300
+ auditConfigs: [
301
+ {
302
+ auditLogConfigs: [
303
+ {
304
+ exemptedMembers: [
305
+ "Test string"
306
+ ],
307
+ logType: "Test string",
308
+ }
309
+ ],
310
+ service: "Test string",
311
+ }
312
+ ],
313
+ bindings: [
314
+ {
315
+ condition: {
316
+ description: "Test string",
317
+ expression: "Test string",
318
+ location: "Test string",
319
+ title: "Test string",
320
+ },
321
+ members: [
322
+ "Test string"
323
+ ],
324
+ role: "Test string",
325
+ }
326
+ ],
327
+ etag: "Test string",
328
+ version: 42,
329
+ },
330
+ updateMask: "Test string",
331
+ });
332
+ /**
333
+ * Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This
334
+ * operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
335
+ */
336
+ await gapi.client.networkconnectivity.projects.locations.serviceIdentifiers.testIamPermissions({
337
+ resource: "Test string",
338
+ }, {
339
+ permissions: [
340
+ "Test string"
341
+ ],
342
+ });
343
+ /** Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. */
344
+ await gapi.client.networkconnectivity.projects.locations.serviceInstances.getIamPolicy({
345
+ "options.requestedPolicyVersion": 42,
346
+ resource: "Test string",
347
+ });
348
+ /** Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. */
349
+ await gapi.client.networkconnectivity.projects.locations.serviceInstances.setIamPolicy({
350
+ resource: "Test string",
351
+ }, {
352
+ policy: {
353
+ auditConfigs: [
354
+ {
355
+ auditLogConfigs: [
356
+ {
357
+ exemptedMembers: [
358
+ "Test string"
359
+ ],
360
+ logType: "Test string",
361
+ }
362
+ ],
363
+ service: "Test string",
364
+ }
365
+ ],
366
+ bindings: [
367
+ {
368
+ condition: {
369
+ description: "Test string",
370
+ expression: "Test string",
371
+ location: "Test string",
372
+ title: "Test string",
373
+ },
374
+ members: [
375
+ "Test string"
376
+ ],
377
+ role: "Test string",
378
+ }
379
+ ],
380
+ etag: "Test string",
381
+ version: 42,
382
+ },
383
+ updateMask: "Test string",
384
+ });
385
+ /**
386
+ * Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This
387
+ * operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
388
+ */
389
+ await gapi.client.networkconnectivity.projects.locations.serviceInstances.testIamPermissions({
390
+ resource: "Test string",
391
+ }, {
392
+ permissions: [
393
+ "Test string"
394
+ ],
395
+ });
396
+ /** Creates a Network Connectivity Center spoke. */
397
+ await gapi.client.networkconnectivity.projects.locations.spokes.create({
398
+ parent: "Test string",
399
+ requestId: "Test string",
400
+ spokeId: "Test string",
401
+ }, {
402
+ createTime: "Test string",
403
+ description: "Test string",
404
+ hub: "Test string",
405
+ labels: {
406
+ A: "Test string"
407
+ },
408
+ linkedInterconnectAttachments: [
409
+ "Test string"
410
+ ],
411
+ linkedRouterApplianceInstances: [
412
+ {
413
+ ipAddress: "Test string",
414
+ networkInterface: "Test string",
415
+ virtualMachine: "Test string",
416
+ }
417
+ ],
418
+ linkedVpnTunnels: [
419
+ "Test string"
420
+ ],
421
+ name: "Test string",
422
+ state: "Test string",
423
+ uniqueId: "Test string",
424
+ updateTime: "Test string",
425
+ });
426
+ /** Deletes a Network Connectivity Center spoke. */
427
+ await gapi.client.networkconnectivity.projects.locations.spokes.delete({
428
+ name: "Test string",
429
+ requestId: "Test string",
430
+ });
431
+ /** Gets details about a Network Connectivity Center spoke. */
432
+ await gapi.client.networkconnectivity.projects.locations.spokes.get({
433
+ name: "Test string",
434
+ });
435
+ /** Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. */
436
+ await gapi.client.networkconnectivity.projects.locations.spokes.getIamPolicy({
437
+ "options.requestedPolicyVersion": 42,
438
+ resource: "Test string",
439
+ });
440
+ /** Lists the Network Connectivity Center spokes in a specified project and location. */
441
+ await gapi.client.networkconnectivity.projects.locations.spokes.list({
442
+ filter: "Test string",
443
+ orderBy: "Test string",
444
+ pageSize: 42,
445
+ pageToken: "Test string",
446
+ parent: "Test string",
447
+ });
448
+ /** Updates the parameters of a Network Connectivity Center spoke. */
449
+ await gapi.client.networkconnectivity.projects.locations.spokes.patch({
450
+ name: "Test string",
451
+ requestId: "Test string",
452
+ updateMask: "Test string",
453
+ }, {
454
+ createTime: "Test string",
455
+ description: "Test string",
456
+ hub: "Test string",
457
+ labels: {
458
+ A: "Test string"
459
+ },
460
+ linkedInterconnectAttachments: [
461
+ "Test string"
462
+ ],
463
+ linkedRouterApplianceInstances: [
464
+ {
465
+ ipAddress: "Test string",
466
+ networkInterface: "Test string",
467
+ virtualMachine: "Test string",
468
+ }
469
+ ],
470
+ linkedVpnTunnels: [
471
+ "Test string"
472
+ ],
473
+ name: "Test string",
474
+ state: "Test string",
475
+ uniqueId: "Test string",
476
+ updateTime: "Test string",
477
+ });
478
+ /** Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. */
479
+ await gapi.client.networkconnectivity.projects.locations.spokes.setIamPolicy({
480
+ resource: "Test string",
481
+ }, {
482
+ policy: {
483
+ auditConfigs: [
484
+ {
485
+ auditLogConfigs: [
486
+ {
487
+ exemptedMembers: [
488
+ "Test string"
489
+ ],
490
+ logType: "Test string",
491
+ }
492
+ ],
493
+ service: "Test string",
494
+ }
495
+ ],
496
+ bindings: [
497
+ {
498
+ condition: {
499
+ description: "Test string",
500
+ expression: "Test string",
501
+ location: "Test string",
502
+ title: "Test string",
503
+ },
504
+ members: [
505
+ "Test string"
506
+ ],
507
+ role: "Test string",
508
+ }
509
+ ],
510
+ etag: "Test string",
511
+ version: 42,
512
+ },
513
+ updateMask: "Test string",
514
+ });
515
+ /**
516
+ * Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This
517
+ * operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
518
+ */
519
+ await gapi.client.networkconnectivity.projects.locations.spokes.testIamPermissions({
520
+ resource: "Test string",
521
+ }, {
522
+ permissions: [
523
+ "Test string"
524
+ ],
525
+ });
526
+ }
527
+ });
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
+ }
package/tslint.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "dtslint/dtslint.json",
3
+ "rules": {
4
+ "no-redundant-jsdoc": false
5
+ }
6
+ }