@maxim_mazurok/gapi.client.observability-v1 0.0.20250313

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.
Files changed (3) hide show
  1. package/index.d.ts +409 -0
  2. package/package.json +20 -0
  3. package/readme.md +72 -0
package/index.d.ts ADDED
@@ -0,0 +1,409 @@
1
+ /* Type definitions for non-npm package Observability API v1 0.0 */
2
+ // Project: https://cloud.google.com/distributed-cloud/hosted/docs/latest/gdch/apis/service/observability/observability-api-overview
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://observability.googleapis.com/$discovery/rest?version=v1
12
+ // Revision: 20250313
13
+
14
+ /// <reference types="gapi.client" />
15
+
16
+ declare namespace gapi.client {
17
+ /** Load Observability API v1 */
18
+ function load(
19
+ urlOrObject: 'https://observability.googleapis.com/$discovery/rest?version=v1',
20
+ ): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: 'observability', version: 'v1'): Promise<void>;
23
+ /** @deprecated Please load APIs with discovery documents. */
24
+ function load(
25
+ name: 'observability',
26
+ version: 'v1',
27
+ callback: () => any,
28
+ ): void;
29
+
30
+ namespace observability {
31
+ interface CancelOperationRequest {}
32
+ interface Empty {}
33
+ interface ListLocationsResponse {
34
+ /** A list of locations that matches the specified filter in the request. */
35
+ locations?: Location[];
36
+ /** The standard List next-page token. */
37
+ nextPageToken?: string;
38
+ }
39
+ interface ListOperationsResponse {
40
+ /** The standard List next-page token. */
41
+ nextPageToken?: string;
42
+ /** A list of operations that matches the specified filter in the request. */
43
+ operations?: Operation[];
44
+ }
45
+ interface Location {
46
+ /** The friendly name for this location, typically a nearby city name. For example, "Tokyo". */
47
+ displayName?: string;
48
+ /** Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"} */
49
+ labels?: {[P in string]: string};
50
+ /** The canonical id for this location. For example: `"us-east1"`. */
51
+ locationId?: string;
52
+ /** Service-specific metadata. For example the available capacity at the given location. */
53
+ metadata?: {[P in string]: any};
54
+ /** Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"` */
55
+ name?: string;
56
+ }
57
+ interface Operation {
58
+ /** 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. */
59
+ done?: boolean;
60
+ /** The error result of the operation in case of failure or cancellation. */
61
+ error?: Status;
62
+ /** 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 metadata. Any method that returns a long-running operation should document the metadata type, if any. */
63
+ metadata?: {[P in string]: any};
64
+ /** 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 with `operations/{unique_id}`. */
65
+ name?: string;
66
+ /** The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the 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 original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. */
67
+ response?: {[P in string]: any};
68
+ }
69
+ interface OperationMetadata {
70
+ /** Output only. API version used to start the operation. */
71
+ apiVersion?: string;
72
+ /** Output only. The time the operation was created. */
73
+ createTime?: string;
74
+ /** Output only. The time the operation finished running. */
75
+ endTime?: string;
76
+ /** Output only. Identifies whether the user has requested cancellation of the operation. Operations that have been cancelled successfully have Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. */
77
+ requestedCancellation?: boolean;
78
+ /** Output only. Human-readable status of the operation, if any. */
79
+ statusMessage?: string;
80
+ /** Output only. Server-defined resource path for the target of the operation. */
81
+ target?: string;
82
+ /** Output only. Name of the verb executed by the operation. */
83
+ verb?: string;
84
+ }
85
+ interface Scope {
86
+ /** Required. The full resource name of the `LogScope`. For example: //logging.googleapis.com/projects/myproject/locations/global/logScopes/my-log-scope */
87
+ logScope?: string;
88
+ /** Identifier. Name of the resource. The format is: projects/{project}/locations/{location}/scopes/{scope} The `{location}` field must be set to `global`. The `{scope}` field must be set to `_Default`. */
89
+ name?: string;
90
+ /** Output only. Update timestamp. Note: The Update timestamp for the default scope is initially unset. */
91
+ updateTime?: string;
92
+ }
93
+ interface Status {
94
+ /** The status code, which should be an enum value of google.rpc.Code. */
95
+ code?: number;
96
+ /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
97
+ details?: Array<{[P in string]: any}>;
98
+ /** 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 client. */
99
+ message?: string;
100
+ }
101
+ interface OperationsResource {
102
+ /** Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of `1`, corresponding to `Code.CANCELLED`. */
103
+ cancel(request: {
104
+ /** V1 error format. */
105
+ '$.xgafv'?: string;
106
+ /** OAuth access token. */
107
+ access_token?: string;
108
+ /** Data format for response. */
109
+ alt?: string;
110
+ /** JSONP */
111
+ callback?: string;
112
+ /** Selector specifying which fields to include in a partial response. */
113
+ fields?: string;
114
+ /** 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. */
115
+ key?: string;
116
+ /** The name of the operation resource to be cancelled. */
117
+ name: string;
118
+ /** OAuth 2.0 token for the current user. */
119
+ oauth_token?: string;
120
+ /** Returns response with indentations and line breaks. */
121
+ prettyPrint?: boolean;
122
+ /** 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. */
123
+ quotaUser?: string;
124
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
125
+ upload_protocol?: string;
126
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
127
+ uploadType?: string;
128
+ /** Request body */
129
+ resource: CancelOperationRequest;
130
+ }): Request<{}>;
131
+ cancel(
132
+ request: {
133
+ /** V1 error format. */
134
+ '$.xgafv'?: string;
135
+ /** OAuth access token. */
136
+ access_token?: string;
137
+ /** Data format for response. */
138
+ alt?: string;
139
+ /** JSONP */
140
+ callback?: string;
141
+ /** Selector specifying which fields to include in a partial response. */
142
+ fields?: string;
143
+ /** 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. */
144
+ key?: string;
145
+ /** The name of the operation resource to be cancelled. */
146
+ name: string;
147
+ /** OAuth 2.0 token for the current user. */
148
+ oauth_token?: string;
149
+ /** Returns response with indentations and line breaks. */
150
+ prettyPrint?: boolean;
151
+ /** 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. */
152
+ quotaUser?: string;
153
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
154
+ upload_protocol?: string;
155
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
156
+ uploadType?: string;
157
+ },
158
+ body: CancelOperationRequest,
159
+ ): Request<{}>;
160
+ /** Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. */
161
+ delete(request?: {
162
+ /** V1 error format. */
163
+ '$.xgafv'?: string;
164
+ /** OAuth access token. */
165
+ access_token?: string;
166
+ /** Data format for response. */
167
+ alt?: string;
168
+ /** JSONP */
169
+ callback?: string;
170
+ /** Selector specifying which fields to include in a partial response. */
171
+ fields?: string;
172
+ /** 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. */
173
+ key?: string;
174
+ /** The name of the operation resource to be deleted. */
175
+ name: string;
176
+ /** OAuth 2.0 token for the current user. */
177
+ oauth_token?: string;
178
+ /** Returns response with indentations and line breaks. */
179
+ prettyPrint?: boolean;
180
+ /** 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. */
181
+ quotaUser?: string;
182
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
183
+ upload_protocol?: string;
184
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
185
+ uploadType?: string;
186
+ }): Request<{}>;
187
+ /** 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. */
188
+ get(request?: {
189
+ /** V1 error format. */
190
+ '$.xgafv'?: string;
191
+ /** OAuth access token. */
192
+ access_token?: string;
193
+ /** Data format for response. */
194
+ alt?: string;
195
+ /** JSONP */
196
+ callback?: string;
197
+ /** Selector specifying which fields to include in a partial response. */
198
+ fields?: string;
199
+ /** 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. */
200
+ key?: string;
201
+ /** The name of the operation resource. */
202
+ name: string;
203
+ /** OAuth 2.0 token for the current user. */
204
+ oauth_token?: string;
205
+ /** Returns response with indentations and line breaks. */
206
+ prettyPrint?: boolean;
207
+ /** 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. */
208
+ quotaUser?: string;
209
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
210
+ upload_protocol?: string;
211
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
212
+ uploadType?: string;
213
+ }): Request<Operation>;
214
+ /** Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. */
215
+ list(request?: {
216
+ /** V1 error format. */
217
+ '$.xgafv'?: string;
218
+ /** OAuth access token. */
219
+ access_token?: string;
220
+ /** Data format for response. */
221
+ alt?: string;
222
+ /** JSONP */
223
+ callback?: string;
224
+ /** Selector specifying which fields to include in a partial response. */
225
+ fields?: string;
226
+ /** The standard list filter. */
227
+ filter?: string;
228
+ /** 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. */
229
+ key?: string;
230
+ /** The name of the operation's parent resource. */
231
+ name: string;
232
+ /** OAuth 2.0 token for the current user. */
233
+ oauth_token?: string;
234
+ /** The standard list page size. */
235
+ pageSize?: number;
236
+ /** The standard list page token. */
237
+ pageToken?: string;
238
+ /** Returns response with indentations and line breaks. */
239
+ prettyPrint?: boolean;
240
+ /** 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. */
241
+ quotaUser?: string;
242
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
243
+ upload_protocol?: string;
244
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
245
+ uploadType?: string;
246
+ }): Request<ListOperationsResponse>;
247
+ }
248
+ interface ScopesResource {
249
+ /** Gets details of a single Scope. */
250
+ get(request?: {
251
+ /** V1 error format. */
252
+ '$.xgafv'?: string;
253
+ /** OAuth access token. */
254
+ access_token?: string;
255
+ /** Data format for response. */
256
+ alt?: string;
257
+ /** JSONP */
258
+ callback?: string;
259
+ /** Selector specifying which fields to include in a partial response. */
260
+ fields?: string;
261
+ /** 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. */
262
+ key?: string;
263
+ /** Required. Name of the resource. The format is: projects/{project}/locations/{location}/scopes/{scope} The `{location}` field must be set to `global`. The `{scope}` field must be set to `_Default`. */
264
+ name: string;
265
+ /** OAuth 2.0 token for the current user. */
266
+ oauth_token?: string;
267
+ /** Returns response with indentations and line breaks. */
268
+ prettyPrint?: boolean;
269
+ /** 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. */
270
+ quotaUser?: string;
271
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
272
+ upload_protocol?: string;
273
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
274
+ uploadType?: string;
275
+ }): Request<Scope>;
276
+ /** Updates the parameters of a single Scope. */
277
+ patch(request: {
278
+ /** V1 error format. */
279
+ '$.xgafv'?: string;
280
+ /** OAuth access token. */
281
+ access_token?: string;
282
+ /** Data format for response. */
283
+ alt?: string;
284
+ /** JSONP */
285
+ callback?: string;
286
+ /** Selector specifying which fields to include in a partial response. */
287
+ fields?: string;
288
+ /** 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. */
289
+ key?: string;
290
+ /** Identifier. Name of the resource. The format is: projects/{project}/locations/{location}/scopes/{scope} The `{location}` field must be set to `global`. The `{scope}` field must be set to `_Default`. */
291
+ name: string;
292
+ /** OAuth 2.0 token for the current user. */
293
+ oauth_token?: string;
294
+ /** Returns response with indentations and line breaks. */
295
+ prettyPrint?: boolean;
296
+ /** 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. */
297
+ quotaUser?: string;
298
+ /** Optional. Field mask is used to specify the fields to be overwritten in the Scope resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields present in the request will be overwritten. */
299
+ updateMask?: string;
300
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
301
+ upload_protocol?: string;
302
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
303
+ uploadType?: string;
304
+ /** Request body */
305
+ resource: Scope;
306
+ }): Request<Scope>;
307
+ patch(
308
+ request: {
309
+ /** V1 error format. */
310
+ '$.xgafv'?: string;
311
+ /** OAuth access token. */
312
+ access_token?: string;
313
+ /** Data format for response. */
314
+ alt?: string;
315
+ /** JSONP */
316
+ callback?: string;
317
+ /** Selector specifying which fields to include in a partial response. */
318
+ fields?: string;
319
+ /** 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. */
320
+ key?: string;
321
+ /** Identifier. Name of the resource. The format is: projects/{project}/locations/{location}/scopes/{scope} The `{location}` field must be set to `global`. The `{scope}` field must be set to `_Default`. */
322
+ name: string;
323
+ /** OAuth 2.0 token for the current user. */
324
+ oauth_token?: string;
325
+ /** Returns response with indentations and line breaks. */
326
+ prettyPrint?: boolean;
327
+ /** 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. */
328
+ quotaUser?: string;
329
+ /** Optional. Field mask is used to specify the fields to be overwritten in the Scope resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields present in the request will be overwritten. */
330
+ updateMask?: string;
331
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
332
+ upload_protocol?: string;
333
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
334
+ uploadType?: string;
335
+ },
336
+ body: Scope,
337
+ ): Request<Scope>;
338
+ }
339
+ interface LocationsResource {
340
+ /** Gets information about a location. */
341
+ get(request?: {
342
+ /** V1 error format. */
343
+ '$.xgafv'?: string;
344
+ /** OAuth access token. */
345
+ access_token?: string;
346
+ /** Data format for response. */
347
+ alt?: string;
348
+ /** JSONP */
349
+ callback?: string;
350
+ /** Selector specifying which fields to include in a partial response. */
351
+ fields?: string;
352
+ /** 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. */
353
+ key?: string;
354
+ /** Resource name for the location. */
355
+ name: string;
356
+ /** OAuth 2.0 token for the current user. */
357
+ oauth_token?: string;
358
+ /** Returns response with indentations and line breaks. */
359
+ prettyPrint?: boolean;
360
+ /** 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. */
361
+ quotaUser?: string;
362
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
363
+ upload_protocol?: string;
364
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
365
+ uploadType?: string;
366
+ }): Request<Location>;
367
+ /** Lists information about the supported locations for this service. */
368
+ list(request?: {
369
+ /** V1 error format. */
370
+ '$.xgafv'?: string;
371
+ /** OAuth access token. */
372
+ access_token?: string;
373
+ /** Data format for response. */
374
+ alt?: string;
375
+ /** JSONP */
376
+ callback?: string;
377
+ /** Selector specifying which fields to include in a partial response. */
378
+ fields?: string;
379
+ /** 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 [AIP-160](https://google.aip.dev/160). */
380
+ filter?: string;
381
+ /** 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. */
382
+ key?: string;
383
+ /** The resource that owns the locations collection, if applicable. */
384
+ name: string;
385
+ /** OAuth 2.0 token for the current user. */
386
+ oauth_token?: string;
387
+ /** The maximum number of results to return. If not set, the service selects a default. */
388
+ pageSize?: number;
389
+ /** A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page. */
390
+ pageToken?: string;
391
+ /** Returns response with indentations and line breaks. */
392
+ prettyPrint?: boolean;
393
+ /** 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. */
394
+ quotaUser?: string;
395
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
396
+ upload_protocol?: string;
397
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
398
+ uploadType?: string;
399
+ }): Request<ListLocationsResponse>;
400
+ operations: OperationsResource;
401
+ scopes: ScopesResource;
402
+ }
403
+ interface ProjectsResource {
404
+ locations: LocationsResource;
405
+ }
406
+
407
+ const projects: ProjectsResource;
408
+ }
409
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.observability-v1",
3
+ "version": "0.0.20250313",
4
+ "description": "TypeScript typings for Observability API v1",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
8
+ },
9
+ "license": "MIT",
10
+ "author": {
11
+ "name": "Maxim Mazurok",
12
+ "email": "maxim@mazurok.com",
13
+ "url": "https://maxim.mazurok.com"
14
+ },
15
+ "types": "index.d.ts",
16
+ "dependencies": {
17
+ "@types/gapi.client": "*",
18
+ "@types/gapi.client.discovery-v1": "*"
19
+ }
20
+ }
package/readme.md ADDED
@@ -0,0 +1,72 @@
1
+ # TypeScript typings for Observability API v1
2
+
3
+ For detailed description please check [documentation](https://cloud.google.com/distributed-cloud/hosted/docs/latest/gdch/apis/service/observability/observability-api-overview).
4
+
5
+ ## Installing
6
+
7
+ Install typings for Observability API:
8
+
9
+ ```
10
+ npm install @types/gapi.client.observability-v1 --save-dev
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ You need to initialize Google API client in your code:
16
+
17
+ ```typescript
18
+ gapi.load('client', () => {
19
+ // now we can use gapi.client
20
+ // ...
21
+ });
22
+ ```
23
+
24
+ Then load api client wrapper:
25
+
26
+ ```typescript
27
+ gapi.client.load(
28
+ 'https://observability.googleapis.com/$discovery/rest?version=v1',
29
+ () => {
30
+ // now we can use:
31
+ // gapi.client.observability
32
+ },
33
+ );
34
+ ```
35
+
36
+ ```typescript
37
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
38
+ gapi.client.load('observability', 'v1', () => {
39
+ // now we can use:
40
+ // gapi.client.observability
41
+ });
42
+ ```
43
+
44
+ Don't forget to authenticate your client before sending any request to resources:
45
+
46
+ ```typescript
47
+ // declare client_id registered in Google Developers Console
48
+ var client_id = '',
49
+ scope = [
50
+ // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
51
+ 'https://www.googleapis.com/auth/cloud-platform',
52
+ ],
53
+ immediate = true;
54
+ // ...
55
+
56
+ gapi.auth.authorize(
57
+ {client_id: client_id, scope: scope, immediate: immediate},
58
+ authResult => {
59
+ if (authResult && !authResult.error) {
60
+ /* handle successful authorization */
61
+ } else {
62
+ /* handle authorization error */
63
+ }
64
+ },
65
+ );
66
+ ```
67
+
68
+ After that you can use Observability API resources: <!-- TODO: make this work for multiple namespaces -->
69
+
70
+ ```typescript
71
+
72
+ ```