@maxim_mazurok/gapi.client.connectors-v2 0.0.20220912

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 ADDED
@@ -0,0 +1,658 @@
1
+ /* Type definitions for non-npm package Connectors API v2 0.0 */
2
+ // Project: https://cloud.google.com/apigee/docs/api-platform/connectors/about-connectors
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://connectors.googleapis.com/$discovery/rest?version=v2
12
+ // Revision: 20220912
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load Connectors API v2 */
18
+ function load(urlOrObject: "https://connectors.googleapis.com/$discovery/rest?version=v2"): Promise<void>;
19
+ /** @deprecated Please load APIs with discovery documents. */
20
+ function load(name: "connectors", version: "v2"): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: "connectors", version: "v2", callback: () => any): void;
23
+
24
+ namespace connectors {
25
+ interface Action {
26
+ /** List containing input parameter metadata. */
27
+ inputParameters?: InputParameter[];
28
+ /** Name of the action. */
29
+ name?: string;
30
+ /** List containing the metadata of result fields. */
31
+ resultMetadata?: ResultMetadata[];
32
+ }
33
+ // tslint:disable-next-line:no-empty-interface
34
+ interface Empty {
35
+ }
36
+ interface Entity {
37
+ /** Fields of the entity. The key is name of the field and the value contains the applicable `google.protobuf.Value` entry for this field. */
38
+ fields?: { [P in string]: any };
39
+ /** Output only. Resource name of the Entity. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type}/entities/{id} */
40
+ name?: string;
41
+ }
42
+ interface EntityType {
43
+ /** List containing metadata information about each field of the entity type. */
44
+ fields?: Field[];
45
+ /** The name of the entity type. */
46
+ name?: string;
47
+ }
48
+ interface ExecuteActionRequest {
49
+ /** Parameters for executing the action. The parameters can be key/value pairs or nested structs. */
50
+ parameters?: { [P in string]: any };
51
+ }
52
+ interface ExecuteActionResponse {
53
+ /**
54
+ * In the case of successful invocation of the specified action, the results Struct contains values based on the response of the action invoked. 1. If the action execution produces any
55
+ * entities as a result, they are returned as an array of Structs with the 'key' being the field name and the 'value' being the value of that field in each result row. { 'results':
56
+ * [{'key': 'value'}, ...] }
57
+ */
58
+ results?: Array<{ [P in string]: any }>;
59
+ }
60
+ interface ExecuteSqlQueryRequest {
61
+ /** Required. SQL statement passed by clients like Integration Platform, the query is passed as-is to the driver used for interfacing with external systems. */
62
+ query?: Query;
63
+ }
64
+ interface ExecuteSqlQueryResponse {
65
+ /**
66
+ * In the case of successful execution of the query the response contains results returned by the external system. For example, the result rows of the query are contained in the
67
+ * 'results' Struct list - "results": [ { "field1": "val1", "field2": "val2",.. },.. ] Each Struct row can contain fields any type of like nested Structs or lists.
68
+ */
69
+ results?: Array<{ [P in string]: any }>;
70
+ }
71
+ interface Field {
72
+ /** The following map contains fields that are not explicitly mentioned above,this give connectors the flexibility to add new metadata fields. */
73
+ additionalDetails?: { [P in string]: any };
74
+ /** The data type of the Field. */
75
+ dataType?: string;
76
+ /** The following field specifies the default value of the Field provided by the external system if a value is not provided. */
77
+ defaultValue?: any;
78
+ /** A brief description of the Field. */
79
+ description?: string;
80
+ /** The following boolean field specifies if the current Field acts as a primary key or id if the parent is of type entity. */
81
+ key?: boolean;
82
+ /** Name of the Field. */
83
+ name?: string;
84
+ /** Specifies whether a null value is allowed. */
85
+ nullable?: boolean;
86
+ /** Reference captures the association between two different entity types. Value links to the reference of another entity type. */
87
+ reference?: Reference;
88
+ }
89
+ interface InputParameter {
90
+ /** The data type of the Parameter */
91
+ dataType?: string;
92
+ /** The following field specifies the default value of the Parameter provided by the external system if a value is not provided. */
93
+ defaultValue?: any;
94
+ /** A brief description of the Parameter. */
95
+ description?: string;
96
+ /** Name of the Parameter. */
97
+ name?: string;
98
+ /** Specifies whether a null value is allowed. */
99
+ nullable?: boolean;
100
+ }
101
+ interface ListActionsResponse {
102
+ /** List of action metadata. */
103
+ actions?: Action[];
104
+ /** Next page token if more actions available. */
105
+ nextPageToken?: string;
106
+ /** List of actions which contain unsupported Datatypes. Check datatype.proto for more information. */
107
+ unsupportedActionNames?: string[];
108
+ }
109
+ interface ListEntitiesResponse {
110
+ /** List containing entity rows. */
111
+ entities?: Entity[];
112
+ /** Next page token if more records are available. */
113
+ nextPageToken?: string;
114
+ }
115
+ interface ListEntityTypesResponse {
116
+ /** Next page token if more entity types available. */
117
+ nextPageToken?: string;
118
+ /** List of metadata related to all entity types. */
119
+ types?: EntityType[];
120
+ /** List of entity type names which contain unsupported Datatypes. Check datatype.proto for more information. */
121
+ unsupportedTypeNames?: string[];
122
+ }
123
+ interface Query {
124
+ /** Required. Sql query to execute. */
125
+ query?: string;
126
+ }
127
+ interface Reference {
128
+ /** Name of the reference field. */
129
+ name?: string;
130
+ /** Name of reference entity type. */
131
+ type?: string;
132
+ }
133
+ interface ResultMetadata {
134
+ /** The data type of the metadata field */
135
+ dataType?: string;
136
+ /** A brief description of the metadata field. */
137
+ description?: string;
138
+ /** Name of the metadata field. */
139
+ name?: string;
140
+ }
141
+ interface UpdateEntitiesWithConditionsResponse {
142
+ /** Response returned by the external system. */
143
+ response?: { [P in string]: any };
144
+ }
145
+ interface ActionsResource {
146
+ /** Executes an action with the name specified in the request. The input parameters for executing the action are passed through the body of the ExecuteAction request. */
147
+ execute(request: {
148
+ /** V1 error format. */
149
+ "$.xgafv"?: string;
150
+ /** OAuth access token. */
151
+ access_token?: string;
152
+ /** Data format for response. */
153
+ alt?: string;
154
+ /** JSONP */
155
+ callback?: string;
156
+ /** Selector specifying which fields to include in a partial response. */
157
+ fields?: string;
158
+ /** 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. */
159
+ key?: string;
160
+ /** Required. Resource name of the Action. Format: projects/{project}/locations/{location}/connections/{connection}/actions/{action} */
161
+ name: string;
162
+ /** OAuth 2.0 token for the current user. */
163
+ oauth_token?: string;
164
+ /** Returns response with indentations and line breaks. */
165
+ prettyPrint?: boolean;
166
+ /** 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. */
167
+ quotaUser?: string;
168
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
169
+ upload_protocol?: string;
170
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
171
+ uploadType?: string;
172
+ /** Request body */
173
+ resource: ExecuteActionRequest;
174
+ }): Request<ExecuteActionResponse>;
175
+ execute(request: {
176
+ /** V1 error format. */
177
+ "$.xgafv"?: string;
178
+ /** OAuth access token. */
179
+ access_token?: string;
180
+ /** Data format for response. */
181
+ alt?: string;
182
+ /** JSONP */
183
+ callback?: string;
184
+ /** Selector specifying which fields to include in a partial response. */
185
+ fields?: string;
186
+ /** 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. */
187
+ key?: string;
188
+ /** Required. Resource name of the Action. Format: projects/{project}/locations/{location}/connections/{connection}/actions/{action} */
189
+ name: string;
190
+ /** OAuth 2.0 token for the current user. */
191
+ oauth_token?: string;
192
+ /** Returns response with indentations and line breaks. */
193
+ prettyPrint?: boolean;
194
+ /** 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. */
195
+ quotaUser?: string;
196
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
197
+ upload_protocol?: string;
198
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
199
+ uploadType?: string;
200
+ },
201
+ body: ExecuteActionRequest): Request<ExecuteActionResponse>;
202
+ /** Gets the schema of all the actions supported by the connector. */
203
+ list(request?: {
204
+ /** V1 error format. */
205
+ "$.xgafv"?: string;
206
+ /** OAuth access token. */
207
+ access_token?: string;
208
+ /** Data format for response. */
209
+ alt?: string;
210
+ /** JSONP */
211
+ callback?: string;
212
+ /** Selector specifying which fields to include in a partial response. */
213
+ fields?: string;
214
+ /** 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. */
215
+ key?: string;
216
+ /** OAuth 2.0 token for the current user. */
217
+ oauth_token?: string;
218
+ /** Number of Actions to return. Defaults to 25. */
219
+ pageSize?: number;
220
+ /** Page token, return from a previous ListActions call, that can be used retrieve the next page of content. If unspecified, the request returns the first page of actions. */
221
+ pageToken?: string;
222
+ /** Required. Parent resource name of the Action. Format: projects/{project}/locations/{location}/connections/{connection} */
223
+ parent: string;
224
+ /** Returns response with indentations and line breaks. */
225
+ prettyPrint?: boolean;
226
+ /** 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. */
227
+ quotaUser?: string;
228
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
229
+ upload_protocol?: string;
230
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
231
+ uploadType?: string;
232
+ }): Request<ListActionsResponse>;
233
+ }
234
+ interface EntitiesResource {
235
+ /**
236
+ * Creates a new entity row of the specified entity type in the external system. The field values for creating the row are contained in the body of the request. The response message
237
+ * contains a `Entity` message object returned as a response by the external system.
238
+ */
239
+ create(request: {
240
+ /** V1 error format. */
241
+ "$.xgafv"?: string;
242
+ /** OAuth access token. */
243
+ access_token?: string;
244
+ /** Data format for response. */
245
+ alt?: string;
246
+ /** JSONP */
247
+ callback?: string;
248
+ /** Selector specifying which fields to include in a partial response. */
249
+ fields?: string;
250
+ /** 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. */
251
+ key?: string;
252
+ /** OAuth 2.0 token for the current user. */
253
+ oauth_token?: string;
254
+ /** Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type} */
255
+ parent: string;
256
+ /** Returns response with indentations and line breaks. */
257
+ prettyPrint?: boolean;
258
+ /** 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. */
259
+ quotaUser?: string;
260
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
261
+ upload_protocol?: string;
262
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
263
+ uploadType?: string;
264
+ /** Request body */
265
+ resource: Entity;
266
+ }): Request<Entity>;
267
+ create(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
+ /** Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type} */
283
+ parent: string;
284
+ /** Returns response with indentations and line breaks. */
285
+ prettyPrint?: boolean;
286
+ /** 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. */
287
+ quotaUser?: string;
288
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
289
+ upload_protocol?: string;
290
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
291
+ uploadType?: string;
292
+ },
293
+ body: Entity): Request<Entity>;
294
+ /** Deletes an existing entity row matching the entity type and entity id specified in the request. */
295
+ delete(request?: {
296
+ /** V1 error format. */
297
+ "$.xgafv"?: string;
298
+ /** OAuth access token. */
299
+ access_token?: string;
300
+ /** Data format for response. */
301
+ alt?: string;
302
+ /** JSONP */
303
+ callback?: string;
304
+ /** Selector specifying which fields to include in a partial response. */
305
+ fields?: string;
306
+ /** 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. */
307
+ key?: string;
308
+ /** Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type}/entities/{id} */
309
+ name: string;
310
+ /** OAuth 2.0 token for the current user. */
311
+ oauth_token?: string;
312
+ /** Returns response with indentations and line breaks. */
313
+ prettyPrint?: boolean;
314
+ /** 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. */
315
+ quotaUser?: string;
316
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
317
+ upload_protocol?: string;
318
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
319
+ uploadType?: string;
320
+ }): Request<{}>;
321
+ /** Deletes entities based on conditions specified in the request and not on entity id. */
322
+ deleteEntitiesWithConditions(request?: {
323
+ /** V1 error format. */
324
+ "$.xgafv"?: string;
325
+ /** OAuth access token. */
326
+ access_token?: string;
327
+ /** Data format for response. */
328
+ alt?: string;
329
+ /** JSONP */
330
+ callback?: string;
331
+ /**
332
+ * Required. Conditions to be used when deleting entities. From a proto standpoint, There are no restrictions on what can be passed using this field. The connector documentation
333
+ * should have information about what format of filters/conditions are supported. Note: If this conditions field is left empty, an exception is thrown. We don't want to consider
334
+ * 'empty conditions' to be a match-all case. Connector developers can determine and document what a match-all case constraint would be.
335
+ */
336
+ conditions?: string;
337
+ /** Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type} */
338
+ entityType: string;
339
+ /** Selector specifying which fields to include in a partial response. */
340
+ fields?: string;
341
+ /** 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. */
342
+ key?: 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
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
350
+ upload_protocol?: string;
351
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
352
+ uploadType?: string;
353
+ }): Request<{}>;
354
+ /** Gets a single entity row matching the entity type and entity id specified in the request. */
355
+ get(request?: {
356
+ /** V1 error format. */
357
+ "$.xgafv"?: string;
358
+ /** OAuth access token. */
359
+ access_token?: string;
360
+ /** Data format for response. */
361
+ alt?: string;
362
+ /** JSONP */
363
+ callback?: string;
364
+ /** Selector specifying which fields to include in a partial response. */
365
+ fields?: string;
366
+ /** 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. */
367
+ key?: string;
368
+ /** Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type}/entities/{id} */
369
+ name: string;
370
+ /** OAuth 2.0 token for the current user. */
371
+ oauth_token?: string;
372
+ /** Returns response with indentations and line breaks. */
373
+ prettyPrint?: boolean;
374
+ /** 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. */
375
+ quotaUser?: string;
376
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
377
+ upload_protocol?: string;
378
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
379
+ uploadType?: string;
380
+ }): Request<Entity>;
381
+ /**
382
+ * Lists entity rows of a particular entity type contained in the request. Note: 1. Currently, only max of one 'sort_by' column is supported. 2. If no 'sort_by' column is provided, the
383
+ * primary key of the table is used. If zero or more than one primary key is available, we default to the unpaginated list entities logic which only returns the first page. 3. The
384
+ * values of the 'sort_by' columns must uniquely identify an entity row, otherwise undefined behaviors may be observed during pagination. 4. Since transactions are not supported, any
385
+ * updates, inserts or deletes during pagination can lead to stale data being returned or other unexpected behaviors.
386
+ */
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
+ /**
397
+ * Conditions to be used when listing entities. From a proto standpoint, There are no restrictions on what can be passed using this field. The connector documentation should have
398
+ * information about what format of filters/conditions are supported.
399
+ */
400
+ conditions?: string;
401
+ /** Selector specifying which fields to include in a partial response. */
402
+ fields?: string;
403
+ /** 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. */
404
+ key?: string;
405
+ /** OAuth 2.0 token for the current user. */
406
+ oauth_token?: string;
407
+ /** Number of entity rows to return. Defaults page size = 25. Max page size = 200. */
408
+ pageSize?: number;
409
+ /** Page token value if available from a previous request. */
410
+ pageToken?: string;
411
+ /** Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type} */
412
+ parent: string;
413
+ /** Returns response with indentations and line breaks. */
414
+ prettyPrint?: boolean;
415
+ /** 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. */
416
+ quotaUser?: string;
417
+ /** List of 'sort_by' columns to use when returning the results. */
418
+ sortBy?: string | string[];
419
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
420
+ upload_protocol?: string;
421
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
422
+ uploadType?: string;
423
+ }): Request<ListEntitiesResponse>;
424
+ /**
425
+ * Updates an existing entity row matching the entity type and entity id specified in the request. The fields in the entity row that need to be modified are contained in the body of
426
+ * the request. All unspecified fields are left unchanged. The response message contains a `Entity` message object returned as a response by the external system.
427
+ */
428
+ patch(request: {
429
+ /** V1 error format. */
430
+ "$.xgafv"?: string;
431
+ /** OAuth access token. */
432
+ access_token?: string;
433
+ /** Data format for response. */
434
+ alt?: string;
435
+ /** JSONP */
436
+ callback?: string;
437
+ /** Selector specifying which fields to include in a partial response. */
438
+ fields?: string;
439
+ /** 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. */
440
+ key?: string;
441
+ /** Output only. Resource name of the Entity. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type}/entities/{id} */
442
+ name: string;
443
+ /** OAuth 2.0 token for the current user. */
444
+ oauth_token?: string;
445
+ /** Returns response with indentations and line breaks. */
446
+ prettyPrint?: boolean;
447
+ /** 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. */
448
+ quotaUser?: string;
449
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
450
+ upload_protocol?: string;
451
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
452
+ uploadType?: string;
453
+ /** Request body */
454
+ resource: Entity;
455
+ }): Request<Entity>;
456
+ patch(request: {
457
+ /** V1 error format. */
458
+ "$.xgafv"?: string;
459
+ /** OAuth access token. */
460
+ access_token?: string;
461
+ /** Data format for response. */
462
+ alt?: string;
463
+ /** JSONP */
464
+ callback?: string;
465
+ /** Selector specifying which fields to include in a partial response. */
466
+ fields?: string;
467
+ /** 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. */
468
+ key?: string;
469
+ /** Output only. Resource name of the Entity. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type}/entities/{id} */
470
+ name: string;
471
+ /** OAuth 2.0 token for the current user. */
472
+ oauth_token?: string;
473
+ /** Returns response with indentations and line breaks. */
474
+ prettyPrint?: boolean;
475
+ /** 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. */
476
+ quotaUser?: string;
477
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
478
+ upload_protocol?: string;
479
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
480
+ uploadType?: string;
481
+ },
482
+ body: Entity): Request<Entity>;
483
+ /** Updates entities based on conditions specified in the request and not on entity id. */
484
+ updateEntitiesWithConditions(request: {
485
+ /** V1 error format. */
486
+ "$.xgafv"?: string;
487
+ /** OAuth access token. */
488
+ access_token?: string;
489
+ /** Data format for response. */
490
+ alt?: string;
491
+ /** JSONP */
492
+ callback?: string;
493
+ /**
494
+ * Required. Conditions to be used when updating entities. From a proto standpoint, There are no restrictions on what can be passed using this field. The connector documentation
495
+ * should have information about what format of filters/conditions are supported. Note: If this conditions field is left empty, an exception is thrown. We don't want to consider
496
+ * 'empty conditions' to be a match-all case. Connector developers can determine and document what a match-all case constraint would be.
497
+ */
498
+ conditions?: string;
499
+ /** Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type} */
500
+ entityType: string;
501
+ /** Selector specifying which fields to include in a partial response. */
502
+ fields?: string;
503
+ /** 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. */
504
+ key?: string;
505
+ /** OAuth 2.0 token for the current user. */
506
+ oauth_token?: string;
507
+ /** Returns response with indentations and line breaks. */
508
+ prettyPrint?: boolean;
509
+ /** 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. */
510
+ quotaUser?: string;
511
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
512
+ upload_protocol?: string;
513
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
514
+ uploadType?: string;
515
+ /** Request body */
516
+ resource: Entity;
517
+ }): Request<UpdateEntitiesWithConditionsResponse>;
518
+ updateEntitiesWithConditions(request: {
519
+ /** V1 error format. */
520
+ "$.xgafv"?: string;
521
+ /** OAuth access token. */
522
+ access_token?: string;
523
+ /** Data format for response. */
524
+ alt?: string;
525
+ /** JSONP */
526
+ callback?: string;
527
+ /**
528
+ * Required. Conditions to be used when updating entities. From a proto standpoint, There are no restrictions on what can be passed using this field. The connector documentation
529
+ * should have information about what format of filters/conditions are supported. Note: If this conditions field is left empty, an exception is thrown. We don't want to consider
530
+ * 'empty conditions' to be a match-all case. Connector developers can determine and document what a match-all case constraint would be.
531
+ */
532
+ conditions?: string;
533
+ /** Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type} */
534
+ entityType: 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
+ /** OAuth 2.0 token for the current user. */
540
+ oauth_token?: string;
541
+ /** Returns response with indentations and line breaks. */
542
+ prettyPrint?: boolean;
543
+ /** 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. */
544
+ quotaUser?: string;
545
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
546
+ upload_protocol?: string;
547
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
548
+ uploadType?: string;
549
+ },
550
+ body: Entity): Request<UpdateEntitiesWithConditionsResponse>;
551
+ }
552
+ interface EntityTypesResource {
553
+ /** Lists metadata related to all entity types present in the external system. */
554
+ list(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
+ /** OAuth 2.0 token for the current user. */
568
+ oauth_token?: string;
569
+ /** Number of entity types to return. Defaults to 25. */
570
+ pageSize?: number;
571
+ /** Page token, return from a previous ListEntityTypes call, that can be used retrieve the next page of content. If unspecified, the request returns the first page of entity types. */
572
+ pageToken?: string;
573
+ /** Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection} */
574
+ parent: string;
575
+ /** Returns response with indentations and line breaks. */
576
+ prettyPrint?: boolean;
577
+ /** 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. */
578
+ quotaUser?: string;
579
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
580
+ upload_protocol?: string;
581
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
582
+ uploadType?: string;
583
+ }): Request<ListEntityTypesResponse>;
584
+ entities: EntitiesResource;
585
+ }
586
+ interface ConnectionsResource {
587
+ /**
588
+ * Executes a SQL statement specified in the body of the request. An example of this SQL statement in the case of Salesforce connector would be 'select * from Account a, Order o where
589
+ * a.Id = o.AccountId'.
590
+ */
591
+ executeSqlQuery(request: {
592
+ /** V1 error format. */
593
+ "$.xgafv"?: string;
594
+ /** OAuth access token. */
595
+ access_token?: string;
596
+ /** Data format for response. */
597
+ alt?: string;
598
+ /** JSONP */
599
+ callback?: string;
600
+ /** Required. Resource name of the Connection. Format: projects/{project}/locations/{location}/connections/{connection} */
601
+ connection: string;
602
+ /** Selector specifying which fields to include in a partial response. */
603
+ fields?: string;
604
+ /** 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. */
605
+ key?: string;
606
+ /** OAuth 2.0 token for the current user. */
607
+ oauth_token?: string;
608
+ /** Returns response with indentations and line breaks. */
609
+ prettyPrint?: boolean;
610
+ /** 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. */
611
+ quotaUser?: string;
612
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
613
+ upload_protocol?: string;
614
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
615
+ uploadType?: string;
616
+ /** Request body */
617
+ resource: ExecuteSqlQueryRequest;
618
+ }): Request<ExecuteSqlQueryResponse>;
619
+ executeSqlQuery(request: {
620
+ /** V1 error format. */
621
+ "$.xgafv"?: string;
622
+ /** OAuth access token. */
623
+ access_token?: string;
624
+ /** Data format for response. */
625
+ alt?: string;
626
+ /** JSONP */
627
+ callback?: string;
628
+ /** Required. Resource name of the Connection. Format: projects/{project}/locations/{location}/connections/{connection} */
629
+ connection: string;
630
+ /** Selector specifying which fields to include in a partial response. */
631
+ fields?: string;
632
+ /** 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. */
633
+ key?: string;
634
+ /** OAuth 2.0 token for the current user. */
635
+ oauth_token?: string;
636
+ /** Returns response with indentations and line breaks. */
637
+ prettyPrint?: boolean;
638
+ /** 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. */
639
+ quotaUser?: string;
640
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
641
+ upload_protocol?: string;
642
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
643
+ uploadType?: string;
644
+ },
645
+ body: ExecuteSqlQueryRequest): Request<ExecuteSqlQueryResponse>;
646
+ actions: ActionsResource;
647
+ entityTypes: EntityTypesResource;
648
+ }
649
+ interface LocationsResource {
650
+ connections: ConnectionsResource;
651
+ }
652
+ interface ProjectsResource {
653
+ locations: LocationsResource;
654
+ }
655
+
656
+ const projects: ProjectsResource;
657
+ }
658
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.connectors-v2",
3
+ "version": "0.0.20220912",
4
+ "description": "TypeScript typings for Connectors API v2",
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 Connectors API v2
2
+
3
+ Enables users to create and manage connections to Google Cloud services and third-party business applications using the Connectors interface.
4
+ For detailed description please check [documentation](https://cloud.google.com/apigee/docs/api-platform/connectors/about-connectors).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Connectors API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.connectors-v2 --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://connectors.googleapis.com/$discovery/rest?version=v2', () => {
29
+ // now we can use:
30
+ // gapi.client.connectors
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('connectors', 'v2', () => {
37
+ // now we can use:
38
+ // gapi.client.connectors
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 Connectors API resources: <!-- TODO: make this work for multiple namespaces -->
66
+
67
+ ```typescript
68
+ ```
package/tests.ts ADDED
@@ -0,0 +1,124 @@
1
+ /* This is stub file for gapi.client.connectors-v2 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: 20220912
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://connectors.googleapis.com/$discovery/rest?version=v2');
12
+ /** now we can use gapi.client.connectors */
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
+ * Executes a SQL statement specified in the body of the request. An example of this SQL statement in the case of Salesforce connector would be 'select * from Account a, Order o where a.Id
34
+ * = o.AccountId'.
35
+ */
36
+ await gapi.client.connectors.projects.locations.connections.executeSqlQuery({
37
+ connection: "Test string",
38
+ }, {
39
+ query: {
40
+ query: "Test string",
41
+ },
42
+ });
43
+ /** Executes an action with the name specified in the request. The input parameters for executing the action are passed through the body of the ExecuteAction request. */
44
+ await gapi.client.connectors.projects.locations.connections.actions.execute({
45
+ name: "Test string",
46
+ }, {
47
+ parameters: {
48
+ A: 42
49
+ },
50
+ });
51
+ /** Gets the schema of all the actions supported by the connector. */
52
+ await gapi.client.connectors.projects.locations.connections.actions.list({
53
+ pageSize: 42,
54
+ pageToken: "Test string",
55
+ parent: "Test string",
56
+ });
57
+ /** Lists metadata related to all entity types present in the external system. */
58
+ await gapi.client.connectors.projects.locations.connections.entityTypes.list({
59
+ pageSize: 42,
60
+ pageToken: "Test string",
61
+ parent: "Test string",
62
+ });
63
+ /**
64
+ * Creates a new entity row of the specified entity type in the external system. The field values for creating the row are contained in the body of the request. The response message
65
+ * contains a `Entity` message object returned as a response by the external system.
66
+ */
67
+ await gapi.client.connectors.projects.locations.connections.entityTypes.entities.create({
68
+ parent: "Test string",
69
+ }, {
70
+ fields: {
71
+ A: 42
72
+ },
73
+ name: "Test string",
74
+ });
75
+ /** Deletes an existing entity row matching the entity type and entity id specified in the request. */
76
+ await gapi.client.connectors.projects.locations.connections.entityTypes.entities.delete({
77
+ name: "Test string",
78
+ });
79
+ /** Deletes entities based on conditions specified in the request and not on entity id. */
80
+ await gapi.client.connectors.projects.locations.connections.entityTypes.entities.deleteEntitiesWithConditions({
81
+ conditions: "Test string",
82
+ entityType: "Test string",
83
+ });
84
+ /** Gets a single entity row matching the entity type and entity id specified in the request. */
85
+ await gapi.client.connectors.projects.locations.connections.entityTypes.entities.get({
86
+ name: "Test string",
87
+ });
88
+ /**
89
+ * Lists entity rows of a particular entity type contained in the request. Note: 1. Currently, only max of one 'sort_by' column is supported. 2. If no 'sort_by' column is provided, the
90
+ * primary key of the table is used. If zero or more than one primary key is available, we default to the unpaginated list entities logic which only returns the first page. 3. The values
91
+ * of the 'sort_by' columns must uniquely identify an entity row, otherwise undefined behaviors may be observed during pagination. 4. Since transactions are not supported, any updates,
92
+ * inserts or deletes during pagination can lead to stale data being returned or other unexpected behaviors.
93
+ */
94
+ await gapi.client.connectors.projects.locations.connections.entityTypes.entities.list({
95
+ conditions: "Test string",
96
+ pageSize: 42,
97
+ pageToken: "Test string",
98
+ parent: "Test string",
99
+ sortBy: "Test string",
100
+ });
101
+ /**
102
+ * Updates an existing entity row matching the entity type and entity id specified in the request. The fields in the entity row that need to be modified are contained in the body of the
103
+ * request. All unspecified fields are left unchanged. The response message contains a `Entity` message object returned as a response by the external system.
104
+ */
105
+ await gapi.client.connectors.projects.locations.connections.entityTypes.entities.patch({
106
+ name: "Test string",
107
+ }, {
108
+ fields: {
109
+ A: 42
110
+ },
111
+ name: "Test string",
112
+ });
113
+ /** Updates entities based on conditions specified in the request and not on entity id. */
114
+ await gapi.client.connectors.projects.locations.connections.entityTypes.entities.updateEntitiesWithConditions({
115
+ conditions: "Test string",
116
+ entityType: "Test string",
117
+ }, {
118
+ fields: {
119
+ A: 42
120
+ },
121
+ name: "Test string",
122
+ });
123
+ }
124
+ });
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
+ }