@maxim_mazurok/gapi.client.networkmanagement-v1 0.0.20220707

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.networkmanagement-v1",
3
+ "version": "0.0.20220707",
4
+ "description": "TypeScript typings for Network Management 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 Network Management API v1
2
+
3
+ The Network Management API provides a collection of network performance monitoring and diagnostic capabilities.
4
+ For detailed description please check [documentation](https://cloud.google.com/).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Network Management API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.networkmanagement-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://networkmanagement.googleapis.com/$discovery/rest?version=v1', () => {
29
+ // now we can use:
30
+ // gapi.client.networkmanagement
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('networkmanagement', 'v1', () => {
37
+ // now we can use:
38
+ // gapi.client.networkmanagement
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 Management API resources: <!-- TODO: make this work for multiple namespaces -->
66
+
67
+ ```typescript
68
+ ```
package/tests.ts ADDED
@@ -0,0 +1,575 @@
1
+ /* This is stub file for gapi.client.networkmanagement-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: 20220707
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://networkmanagement.googleapis.com/$discovery/rest?version=v1');
12
+ /** now we can use gapi.client.networkmanagement */
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.networkmanagement.projects.locations.get({
34
+ name: "Test string",
35
+ });
36
+ /** Lists information about the supported locations for this service. */
37
+ await gapi.client.networkmanagement.projects.locations.list({
38
+ filter: "Test string",
39
+ name: "Test string",
40
+ pageSize: 42,
41
+ pageToken: "Test string",
42
+ });
43
+ /**
44
+ * Creates a new Connectivity Test. After you create a test, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes. If
45
+ * the endpoint specifications in `ConnectivityTest` are invalid (for example, containing non-existent resources in the network, or you don't have read permissions to the network
46
+ * configurations of listed projects), then the reachability result returns a value of `UNKNOWN`. If the endpoint specifications in `ConnectivityTest` are incomplete, the reachability
47
+ * result returns a value of AMBIGUOUS. For more information, see the Connectivity Test documentation.
48
+ */
49
+ await gapi.client.networkmanagement.projects.locations.global.connectivityTests.create({
50
+ parent: "Test string",
51
+ testId: "Test string",
52
+ }, {
53
+ createTime: "Test string",
54
+ description: "Test string",
55
+ destination: {
56
+ cloudSqlInstance: "Test string",
57
+ gkeMasterCluster: "Test string",
58
+ instance: "Test string",
59
+ ipAddress: "Test string",
60
+ network: "Test string",
61
+ networkType: "Test string",
62
+ port: 42,
63
+ projectId: "Test string",
64
+ },
65
+ displayName: "Test string",
66
+ labels: {
67
+ A: "Test string"
68
+ },
69
+ name: "Test string",
70
+ protocol: "Test string",
71
+ reachabilityDetails: {
72
+ error: {
73
+ code: 42,
74
+ details: [
75
+ {
76
+ A: 42
77
+ }
78
+ ],
79
+ message: "Test string",
80
+ },
81
+ result: "Test string",
82
+ traces: [
83
+ {
84
+ endpointInfo: {
85
+ destinationIp: "Test string",
86
+ destinationNetworkUri: "Test string",
87
+ destinationPort: 42,
88
+ protocol: "Test string",
89
+ sourceIp: "Test string",
90
+ sourceNetworkUri: "Test string",
91
+ sourcePort: 42,
92
+ },
93
+ steps: [
94
+ {
95
+ abort: {
96
+ cause: "Test string",
97
+ resourceUri: "Test string",
98
+ },
99
+ causesDrop: true,
100
+ cloudSqlInstance: {
101
+ displayName: "Test string",
102
+ externalIp: "Test string",
103
+ internalIp: "Test string",
104
+ networkUri: "Test string",
105
+ region: "Test string",
106
+ uri: "Test string",
107
+ },
108
+ deliver: {
109
+ resourceUri: "Test string",
110
+ target: "Test string",
111
+ },
112
+ description: "Test string",
113
+ drop: {
114
+ cause: "Test string",
115
+ resourceUri: "Test string",
116
+ },
117
+ endpoint: {
118
+ destinationIp: "Test string",
119
+ destinationNetworkUri: "Test string",
120
+ destinationPort: 42,
121
+ protocol: "Test string",
122
+ sourceIp: "Test string",
123
+ sourceNetworkUri: "Test string",
124
+ sourcePort: 42,
125
+ },
126
+ firewall: {
127
+ action: "Test string",
128
+ direction: "Test string",
129
+ displayName: "Test string",
130
+ firewallRuleType: "Test string",
131
+ networkUri: "Test string",
132
+ policy: "Test string",
133
+ priority: 42,
134
+ targetServiceAccounts: [
135
+ "Test string"
136
+ ],
137
+ targetTags: [
138
+ "Test string"
139
+ ],
140
+ uri: "Test string",
141
+ },
142
+ forward: {
143
+ resourceUri: "Test string",
144
+ target: "Test string",
145
+ },
146
+ forwardingRule: {
147
+ displayName: "Test string",
148
+ matchedPortRange: "Test string",
149
+ matchedProtocol: "Test string",
150
+ networkUri: "Test string",
151
+ target: "Test string",
152
+ uri: "Test string",
153
+ vip: "Test string",
154
+ },
155
+ gkeMaster: {
156
+ clusterNetworkUri: "Test string",
157
+ clusterUri: "Test string",
158
+ externalIp: "Test string",
159
+ internalIp: "Test string",
160
+ },
161
+ instance: {
162
+ displayName: "Test string",
163
+ externalIp: "Test string",
164
+ interface: "Test string",
165
+ internalIp: "Test string",
166
+ networkTags: [
167
+ "Test string"
168
+ ],
169
+ networkUri: "Test string",
170
+ serviceAccount: "Test string",
171
+ uri: "Test string",
172
+ },
173
+ loadBalancer: {
174
+ backends: [
175
+ {
176
+ displayName: "Test string",
177
+ healthCheckAllowingFirewallRules: [
178
+ "Test string"
179
+ ],
180
+ healthCheckBlockingFirewallRules: [
181
+ "Test string"
182
+ ],
183
+ healthCheckFirewallState: "Test string",
184
+ uri: "Test string",
185
+ }
186
+ ],
187
+ backendType: "Test string",
188
+ backendUri: "Test string",
189
+ healthCheckUri: "Test string",
190
+ loadBalancerType: "Test string",
191
+ },
192
+ network: {
193
+ displayName: "Test string",
194
+ matchedIpRange: "Test string",
195
+ uri: "Test string",
196
+ },
197
+ projectId: "Test string",
198
+ route: {
199
+ destIpRange: "Test string",
200
+ displayName: "Test string",
201
+ instanceTags: [
202
+ "Test string"
203
+ ],
204
+ networkUri: "Test string",
205
+ nextHop: "Test string",
206
+ nextHopType: "Test string",
207
+ priority: 42,
208
+ routeType: "Test string",
209
+ uri: "Test string",
210
+ },
211
+ state: "Test string",
212
+ vpnGateway: {
213
+ displayName: "Test string",
214
+ ipAddress: "Test string",
215
+ networkUri: "Test string",
216
+ region: "Test string",
217
+ uri: "Test string",
218
+ vpnTunnelUri: "Test string",
219
+ },
220
+ vpnTunnel: {
221
+ displayName: "Test string",
222
+ networkUri: "Test string",
223
+ region: "Test string",
224
+ remoteGateway: "Test string",
225
+ remoteGatewayIp: "Test string",
226
+ routingType: "Test string",
227
+ sourceGateway: "Test string",
228
+ sourceGatewayIp: "Test string",
229
+ uri: "Test string",
230
+ },
231
+ }
232
+ ],
233
+ }
234
+ ],
235
+ verifyTime: "Test string",
236
+ },
237
+ relatedProjects: [
238
+ "Test string"
239
+ ],
240
+ source: {
241
+ cloudSqlInstance: "Test string",
242
+ gkeMasterCluster: "Test string",
243
+ instance: "Test string",
244
+ ipAddress: "Test string",
245
+ network: "Test string",
246
+ networkType: "Test string",
247
+ port: 42,
248
+ projectId: "Test string",
249
+ },
250
+ updateTime: "Test string",
251
+ });
252
+ /** Deletes a specific `ConnectivityTest`. */
253
+ await gapi.client.networkmanagement.projects.locations.global.connectivityTests.delete({
254
+ name: "Test string",
255
+ });
256
+ /** Gets the details of a specific Connectivity Test. */
257
+ await gapi.client.networkmanagement.projects.locations.global.connectivityTests.get({
258
+ name: "Test string",
259
+ });
260
+ /** Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. */
261
+ await gapi.client.networkmanagement.projects.locations.global.connectivityTests.getIamPolicy({
262
+ "options.requestedPolicyVersion": 42,
263
+ resource: "Test string",
264
+ });
265
+ /** Lists all Connectivity Tests owned by a project. */
266
+ await gapi.client.networkmanagement.projects.locations.global.connectivityTests.list({
267
+ filter: "Test string",
268
+ orderBy: "Test string",
269
+ pageSize: 42,
270
+ pageToken: "Test string",
271
+ parent: "Test string",
272
+ });
273
+ /**
274
+ * Updates the configuration of an existing `ConnectivityTest`. After you update a test, the reachability analysis is performed as part of the long running operation, which completes when
275
+ * the analysis completes. The Reachability state in the test resource is updated with the new result. If the endpoint specifications in `ConnectivityTest` are invalid (for example, they
276
+ * contain non-existent resources in the network, or the user does not have read permissions to the network configurations of listed projects), then the reachability result returns a value
277
+ * of UNKNOWN. If the endpoint specifications in `ConnectivityTest` are incomplete, the reachability result returns a value of `AMBIGUOUS`. See the documentation in `ConnectivityTest` for
278
+ * for more details.
279
+ */
280
+ await gapi.client.networkmanagement.projects.locations.global.connectivityTests.patch({
281
+ name: "Test string",
282
+ updateMask: "Test string",
283
+ }, {
284
+ createTime: "Test string",
285
+ description: "Test string",
286
+ destination: {
287
+ cloudSqlInstance: "Test string",
288
+ gkeMasterCluster: "Test string",
289
+ instance: "Test string",
290
+ ipAddress: "Test string",
291
+ network: "Test string",
292
+ networkType: "Test string",
293
+ port: 42,
294
+ projectId: "Test string",
295
+ },
296
+ displayName: "Test string",
297
+ labels: {
298
+ A: "Test string"
299
+ },
300
+ name: "Test string",
301
+ protocol: "Test string",
302
+ reachabilityDetails: {
303
+ error: {
304
+ code: 42,
305
+ details: [
306
+ {
307
+ A: 42
308
+ }
309
+ ],
310
+ message: "Test string",
311
+ },
312
+ result: "Test string",
313
+ traces: [
314
+ {
315
+ endpointInfo: {
316
+ destinationIp: "Test string",
317
+ destinationNetworkUri: "Test string",
318
+ destinationPort: 42,
319
+ protocol: "Test string",
320
+ sourceIp: "Test string",
321
+ sourceNetworkUri: "Test string",
322
+ sourcePort: 42,
323
+ },
324
+ steps: [
325
+ {
326
+ abort: {
327
+ cause: "Test string",
328
+ resourceUri: "Test string",
329
+ },
330
+ causesDrop: true,
331
+ cloudSqlInstance: {
332
+ displayName: "Test string",
333
+ externalIp: "Test string",
334
+ internalIp: "Test string",
335
+ networkUri: "Test string",
336
+ region: "Test string",
337
+ uri: "Test string",
338
+ },
339
+ deliver: {
340
+ resourceUri: "Test string",
341
+ target: "Test string",
342
+ },
343
+ description: "Test string",
344
+ drop: {
345
+ cause: "Test string",
346
+ resourceUri: "Test string",
347
+ },
348
+ endpoint: {
349
+ destinationIp: "Test string",
350
+ destinationNetworkUri: "Test string",
351
+ destinationPort: 42,
352
+ protocol: "Test string",
353
+ sourceIp: "Test string",
354
+ sourceNetworkUri: "Test string",
355
+ sourcePort: 42,
356
+ },
357
+ firewall: {
358
+ action: "Test string",
359
+ direction: "Test string",
360
+ displayName: "Test string",
361
+ firewallRuleType: "Test string",
362
+ networkUri: "Test string",
363
+ policy: "Test string",
364
+ priority: 42,
365
+ targetServiceAccounts: [
366
+ "Test string"
367
+ ],
368
+ targetTags: [
369
+ "Test string"
370
+ ],
371
+ uri: "Test string",
372
+ },
373
+ forward: {
374
+ resourceUri: "Test string",
375
+ target: "Test string",
376
+ },
377
+ forwardingRule: {
378
+ displayName: "Test string",
379
+ matchedPortRange: "Test string",
380
+ matchedProtocol: "Test string",
381
+ networkUri: "Test string",
382
+ target: "Test string",
383
+ uri: "Test string",
384
+ vip: "Test string",
385
+ },
386
+ gkeMaster: {
387
+ clusterNetworkUri: "Test string",
388
+ clusterUri: "Test string",
389
+ externalIp: "Test string",
390
+ internalIp: "Test string",
391
+ },
392
+ instance: {
393
+ displayName: "Test string",
394
+ externalIp: "Test string",
395
+ interface: "Test string",
396
+ internalIp: "Test string",
397
+ networkTags: [
398
+ "Test string"
399
+ ],
400
+ networkUri: "Test string",
401
+ serviceAccount: "Test string",
402
+ uri: "Test string",
403
+ },
404
+ loadBalancer: {
405
+ backends: [
406
+ {
407
+ displayName: "Test string",
408
+ healthCheckAllowingFirewallRules: [
409
+ "Test string"
410
+ ],
411
+ healthCheckBlockingFirewallRules: [
412
+ "Test string"
413
+ ],
414
+ healthCheckFirewallState: "Test string",
415
+ uri: "Test string",
416
+ }
417
+ ],
418
+ backendType: "Test string",
419
+ backendUri: "Test string",
420
+ healthCheckUri: "Test string",
421
+ loadBalancerType: "Test string",
422
+ },
423
+ network: {
424
+ displayName: "Test string",
425
+ matchedIpRange: "Test string",
426
+ uri: "Test string",
427
+ },
428
+ projectId: "Test string",
429
+ route: {
430
+ destIpRange: "Test string",
431
+ displayName: "Test string",
432
+ instanceTags: [
433
+ "Test string"
434
+ ],
435
+ networkUri: "Test string",
436
+ nextHop: "Test string",
437
+ nextHopType: "Test string",
438
+ priority: 42,
439
+ routeType: "Test string",
440
+ uri: "Test string",
441
+ },
442
+ state: "Test string",
443
+ vpnGateway: {
444
+ displayName: "Test string",
445
+ ipAddress: "Test string",
446
+ networkUri: "Test string",
447
+ region: "Test string",
448
+ uri: "Test string",
449
+ vpnTunnelUri: "Test string",
450
+ },
451
+ vpnTunnel: {
452
+ displayName: "Test string",
453
+ networkUri: "Test string",
454
+ region: "Test string",
455
+ remoteGateway: "Test string",
456
+ remoteGatewayIp: "Test string",
457
+ routingType: "Test string",
458
+ sourceGateway: "Test string",
459
+ sourceGatewayIp: "Test string",
460
+ uri: "Test string",
461
+ },
462
+ }
463
+ ],
464
+ }
465
+ ],
466
+ verifyTime: "Test string",
467
+ },
468
+ relatedProjects: [
469
+ "Test string"
470
+ ],
471
+ source: {
472
+ cloudSqlInstance: "Test string",
473
+ gkeMasterCluster: "Test string",
474
+ instance: "Test string",
475
+ ipAddress: "Test string",
476
+ network: "Test string",
477
+ networkType: "Test string",
478
+ port: 42,
479
+ projectId: "Test string",
480
+ },
481
+ updateTime: "Test string",
482
+ });
483
+ /**
484
+ * Rerun an existing `ConnectivityTest`. After the user triggers the rerun, the reachability analysis is performed as part of the long running operation, which completes when the analysis
485
+ * completes. Even though the test configuration remains the same, the reachability result may change due to underlying network configuration changes. If the endpoint specifications in
486
+ * `ConnectivityTest` become invalid (for example, specified resources are deleted in the network, or you lost read permissions to the network configurations of listed projects), then the
487
+ * reachability result returns a value of `UNKNOWN`.
488
+ */
489
+ await gapi.client.networkmanagement.projects.locations.global.connectivityTests.rerun({
490
+ name: "Test string",
491
+ }, {
492
+ });
493
+ /** Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. */
494
+ await gapi.client.networkmanagement.projects.locations.global.connectivityTests.setIamPolicy({
495
+ resource: "Test string",
496
+ }, {
497
+ policy: {
498
+ auditConfigs: [
499
+ {
500
+ auditLogConfigs: [
501
+ {
502
+ exemptedMembers: [
503
+ "Test string"
504
+ ],
505
+ logType: "Test string",
506
+ }
507
+ ],
508
+ service: "Test string",
509
+ }
510
+ ],
511
+ bindings: [
512
+ {
513
+ condition: {
514
+ description: "Test string",
515
+ expression: "Test string",
516
+ location: "Test string",
517
+ title: "Test string",
518
+ },
519
+ members: [
520
+ "Test string"
521
+ ],
522
+ role: "Test string",
523
+ }
524
+ ],
525
+ etag: "Test string",
526
+ version: 42,
527
+ },
528
+ updateMask: "Test string",
529
+ });
530
+ /**
531
+ * 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
532
+ * 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.
533
+ */
534
+ await gapi.client.networkmanagement.projects.locations.global.connectivityTests.testIamPermissions({
535
+ resource: "Test string",
536
+ }, {
537
+ permissions: [
538
+ "Test string"
539
+ ],
540
+ });
541
+ /**
542
+ * 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
543
+ * 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
544
+ * 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
545
+ * 1, corresponding to `Code.CANCELLED`.
546
+ */
547
+ await gapi.client.networkmanagement.projects.locations.global.operations.cancel({
548
+ name: "Test string",
549
+ }, {
550
+ });
551
+ /**
552
+ * 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
553
+ * this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
554
+ */
555
+ await gapi.client.networkmanagement.projects.locations.global.operations.delete({
556
+ name: "Test string",
557
+ });
558
+ /** 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. */
559
+ await gapi.client.networkmanagement.projects.locations.global.operations.get({
560
+ name: "Test string",
561
+ });
562
+ /**
563
+ * 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
564
+ * 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
565
+ * `"/v1/{name=users/*}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must
566
+ * ensure the name binding is the parent resource, without the operations collection id.
567
+ */
568
+ await gapi.client.networkmanagement.projects.locations.global.operations.list({
569
+ filter: "Test string",
570
+ name: "Test string",
571
+ pageSize: 42,
572
+ pageToken: "Test string",
573
+ });
574
+ }
575
+ });