@maxim_mazurok/gapi.client.cloudtrace-v2 0.0.20231102 → 0.0.20231130

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 CHANGED
@@ -9,443 +9,291 @@
9
9
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
10
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
11
  // Generated from: https://cloudtrace.googleapis.com/$discovery/rest?version=v2
12
- // Revision: 20231102
12
+ // Revision: 20231130
13
13
 
14
14
  /// <reference types="gapi.client" />
15
15
 
16
16
  declare namespace gapi.client {
17
- /** Load Cloud Trace API v2 */
18
- function load(urlOrObject: "https://cloudtrace.googleapis.com/$discovery/rest?version=v2"): Promise<void>;
19
- /** @deprecated Please load APIs with discovery documents. */
20
- function load(name: "cloudtrace", version: "v2"): Promise<void>;
21
- /** @deprecated Please load APIs with discovery documents. */
22
- function load(name: "cloudtrace", version: "v2", callback: () => any): void;
17
+ /** Load Cloud Trace API v2 */
18
+ function load(
19
+ urlOrObject: 'https://cloudtrace.googleapis.com/$discovery/rest?version=v2'
20
+ ): Promise<void>;
21
+ /** @deprecated Please load APIs with discovery documents. */
22
+ function load(name: 'cloudtrace', version: 'v2'): Promise<void>;
23
+ /** @deprecated Please load APIs with discovery documents. */
24
+ function load(name: 'cloudtrace', version: 'v2', callback: () => any): void;
23
25
 
24
- namespace cloudtrace {
25
- interface Annotation {
26
- /** A set of attributes on the annotation. You can have up to 4 attributes per Annotation. */
27
- attributes?:
28
- Attributes;
29
- /** A user-supplied message describing the event. The maximum length for the description is 256 bytes. */
30
- description?:
31
- TruncatableString;
32
- }
33
- interface Attributes {
34
- /**
35
- * A set of attributes. Each attribute's key can be up to 128 bytes long. The value can be a string up to 256 bytes, a signed 64-bit integer, or the boolean values `true` or `false`.
36
- * For example: "/instance_id": { "string_value": { "value": "my-instance" } } "/http/request_bytes": { "int_value": 300 } "example.com/myattribute": { "bool_value": false }
37
- */
38
- attributeMap?:
39
- { [P in string]: AttributeValue };
40
- /**
41
- * The number of attributes that were discarded. Attributes can be discarded because their keys are too long or because there are too many attributes. If this value is 0 then all
42
- * attributes are valid.
43
- */
44
- droppedAttributesCount?:
45
- number;
46
- }
47
- interface AttributeValue {
48
- /** A Boolean value represented by `true` or `false`. */
49
- boolValue?:
50
- boolean;
51
- /** A 64-bit signed integer. */
52
- intValue?:
53
- string;
54
- /** A string up to 256 bytes long. */
55
- stringValue?:
56
- TruncatableString;
57
- }
58
- interface BatchWriteSpansRequest {
59
- /** Required. A list of new spans. The span names must not match existing spans, otherwise the results are undefined. */
60
- spans?:
61
- Span[];
62
- }
63
- // tslint:disable-next-line:no-empty-interface
64
- interface Empty {
65
- }
66
- interface Link {
67
- /** A set of attributes on the link. Up to 32 attributes can be specified per link. */
68
- attributes?:
69
- Attributes;
70
- /** The `[SPAN_ID]` for a span within a trace. */
71
- spanId?:
72
- string;
73
- /** The `[TRACE_ID]` for a trace within a project. */
74
- traceId?:
75
- string;
76
- /** The relationship of the current span relative to the linked span. */
77
- type?:
78
- string;
79
- }
80
- interface Links {
81
- /** The number of dropped links after the maximum size was enforced. If this value is 0, then no links were dropped. */
82
- droppedLinksCount?:
83
- number;
84
- /** A collection of links. */
85
- link?:
86
- Link[];
87
- }
88
- interface MessageEvent {
89
- /** The number of compressed bytes sent or received. If missing, the compressed size is assumed to be the same size as the uncompressed size. */
90
- compressedSizeBytes?:
91
- string;
92
- /** An identifier for the MessageEvent's message that can be used to match `SENT` and `RECEIVED` MessageEvents. */
93
- id?:
94
- string;
95
- /** Type of MessageEvent. Indicates whether the message was sent or received. */
96
- type?:
97
- string;
98
- /** The number of uncompressed bytes sent or received. */
99
- uncompressedSizeBytes?:
100
- string;
101
- }
102
- interface Module {
103
- /** A unique identifier for the module, usually a hash of its contents (up to 128 bytes). */
104
- buildId?:
105
- TruncatableString;
106
- /** For example: main binary, kernel modules, and dynamic libraries such as libc.so, sharedlib.so (up to 256 bytes). */
107
- module?:
108
- TruncatableString;
109
- }
110
- interface Span {
111
- /** A set of attributes on the span. You can have up to 32 attributes per span. */
112
- attributes?:
113
- Attributes;
114
- /** Optional. The number of child spans that were generated while this span was active. If set, allows implementation to detect missing child spans. */
115
- childSpanCount?:
116
- number;
117
- /**
118
- * Required. A description of the span's operation (up to 128 bytes). Cloud Trace displays the description in the Cloud console. For example, the display name can be a qualified method
119
- * name or a file name and a line number where the operation is called. A best practice is to use the same display name within an application and at the same call point. This makes it
120
- * easier to correlate spans in different traces.
121
- */
122
- displayName?:
123
- TruncatableString;
124
- /**
125
- * Required. The end time of the span. On the client side, this is the time kept by the local machine where the span execution ends. On the server side, this is the time when the
126
- * server application handler stops running.
127
- */
128
- endTime?:
129
- string;
130
- /** Links associated with the span. You can have up to 128 links per Span. */
131
- links?:
132
- Links;
133
- /**
134
- * Required. The resource name of the span in the following format: * `projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]` `[TRACE_ID]` is a unique identifier for a trace within a
135
- * project; it is a 32-character hexadecimal encoding of a 16-byte array. It should not be zero. `[SPAN_ID]` is a unique identifier for a span within a trace; it is a 16-character
136
- * hexadecimal encoding of an 8-byte array. It should not be zero. .
137
- */
138
- name?:
139
- string;
140
- /** The `[SPAN_ID]` of this span's parent span. If this is a root span, then this field must be empty. */
141
- parentSpanId?:
142
- string;
143
- /**
144
- * Optional. Set this parameter to indicate whether this span is in the same process as its parent. If you do not set this parameter, Trace is unable to take advantage of this helpful
145
- * information.
146
- */
147
- sameProcessAsParentSpan?:
148
- boolean;
149
- /** Required. The `[SPAN_ID]` portion of the span's resource name. */
150
- spanId?:
151
- string;
152
- /**
153
- * Optional. Distinguishes between spans generated in a particular context. For example, two spans with the same name may be distinguished using `CLIENT` (caller) and `SERVER` (callee)
154
- * to identify an RPC call.
155
- */
156
- spanKind?:
157
- string;
158
- /** Stack trace captured at the start of the span. */
159
- stackTrace?:
160
- StackTrace;
161
- /**
162
- * Required. The start time of the span. On the client side, this is the time kept by the local machine where the span execution starts. On the server side, this is the time when the
163
- * server's application handler starts running.
164
- */
165
- startTime?:
166
- string;
167
- /** Optional. The final status for this span. */
168
- status?:
169
- Status;
170
- /** A set of time events. You can have up to 32 annotations and 128 message events per span. */
171
- timeEvents?:
172
- TimeEvents;
173
- }
174
- interface StackFrame {
175
- /** The column number where the function call appears, if available. This is important in JavaScript because of its anonymous functions. */
176
- columnNumber?:
177
- string;
178
- /** The name of the source file where the function call appears (up to 256 bytes). */
179
- fileName?:
180
- TruncatableString;
181
- /** The fully-qualified name that uniquely identifies the function or method that is active in this frame (up to 1024 bytes). */
182
- functionName?:
183
- TruncatableString;
184
- /** The line number in `file_name` where the function call appears. */
185
- lineNumber?:
186
- string;
187
- /** The binary module from where the code was loaded. */
188
- loadModule?:
189
- Module;
190
- /**
191
- * An un-mangled function name, if `function_name` is mangled. To get information about name mangling, run [this search](https://www.google.com/search?q=cxx+name+mangling). The name
192
- * can be fully-qualified (up to 1024 bytes).
193
- */
194
- originalFunctionName?:
195
- TruncatableString;
196
- /** The version of the deployed source code (up to 128 bytes). */
197
- sourceVersion?:
198
- TruncatableString;
199
- }
200
- interface StackFrames {
201
- /** The number of stack frames that were dropped because there were too many stack frames. If this value is 0, then no stack frames were dropped. */
202
- droppedFramesCount?:
203
- number;
204
- /** Stack frames in this call stack. */
205
- frame?:
206
- StackFrame[];
207
- }
208
- interface StackTrace {
209
- /** Stack frames in this stack trace. A maximum of 128 frames are allowed. */
210
- stackFrames?:
211
- StackFrames;
212
- /**
213
- * The hash ID is used to conserve network bandwidth for duplicate stack traces within a single trace. Often multiple spans will have identical stack traces. The first occurrence of a
214
- * stack trace should contain both the `stackFrame` content and a value in `stackTraceHashId`. Subsequent spans within the same request can refer to that stack trace by only setting
215
- * `stackTraceHashId`.
216
- */
217
- stackTraceHashId?:
218
- string;
219
- }
220
- interface Status {
221
- /** The status code, which should be an enum value of google.rpc.Code. */
222
- code?:
223
- number;
224
- /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
225
- details?:
226
- Array<{ [P in string]: any }>;
227
- /**
228
- * 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
229
- * client.
230
- */
231
- message?:
232
- string;
233
- }
234
- interface TimeEvent {
235
- /** Text annotation with a set of attributes. */
236
- annotation?:
237
- Annotation;
238
- /** An event describing a message sent/received between Spans. */
239
- messageEvent?:
240
- MessageEvent;
241
- /** The timestamp indicating the time the event occurred. */
242
- time?:
243
- string;
244
- }
245
- interface TimeEvents {
246
- /** The number of dropped annotations in all the included time events. If the value is 0, then no annotations were dropped. */
247
- droppedAnnotationsCount?:
248
- number;
249
- /** The number of dropped message events in all the included time events. If the value is 0, then no message events were dropped. */
250
- droppedMessageEventsCount?:
251
- number;
252
- /** A collection of `TimeEvent`s. */
253
- timeEvent?:
254
- TimeEvent[];
255
- }
256
- interface TruncatableString {
257
- /** The number of bytes removed from the original string. If this value is 0, then the string was not shortened. */
258
- truncatedByteCount?:
259
- number;
260
- /**
261
- * The shortened string. For example, if the original string is 500 bytes long and the limit of the string is 128 bytes, then `value` contains the first 128 bytes of the 500-byte
262
- * string. Truncation always happens on a UTF8 character boundary. If there are multi-byte characters in the string, then the length of the shortened string might be less than the size
263
- * limit.
264
- */
265
- value?:
266
- string;
267
- }
268
- interface SpansResource {
269
- /** Creates a new span. */
270
- createSpan(request: {
271
- /** V1 error format. */
272
- "$.xgafv"?:
273
- string;
274
- /** OAuth access token. */
275
- access_token?:
276
- string;
277
- /** Data format for response. */
278
- alt?:
279
- string;
280
- /** JSONP */
281
- callback?:
282
- string;
283
- /** Selector specifying which fields to include in a partial response. */
284
- fields?:
285
- string;
286
- /** 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. */
287
- key?:
288
- string;
289
- /**
290
- * Required. The resource name of the span in the following format: * `projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]` `[TRACE_ID]` is a unique identifier for a trace
291
- * within a project; it is a 32-character hexadecimal encoding of a 16-byte array. It should not be zero. `[SPAN_ID]` is a unique identifier for a span within a trace; it is a
292
- * 16-character hexadecimal encoding of an 8-byte array. It should not be zero. .
293
- */
294
- name:
295
- string;
296
- /** OAuth 2.0 token for the current user. */
297
- oauth_token?:
298
- string;
299
- /** Returns response with indentations and line breaks. */
300
- prettyPrint?:
301
- boolean;
302
- /** 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. */
303
- quotaUser?:
304
- string;
305
- /** Upload protocol for media (e.g. "raw", "multipart"). */
306
- upload_protocol?:
307
- string;
308
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
309
- uploadType?:
310
- string;
311
- /** Request body */
312
- resource:
313
- Span;
314
- }): Request<Span>;
315
- createSpan(request: {
316
- /** V1 error format. */
317
- "$.xgafv"?:
318
- string;
319
- /** OAuth access token. */
320
- access_token?:
321
- string;
322
- /** Data format for response. */
323
- alt?:
324
- string;
325
- /** JSONP */
326
- callback?:
327
- string;
328
- /** Selector specifying which fields to include in a partial response. */
329
- fields?:
330
- string;
331
- /** 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. */
332
- key?:
333
- string;
334
- /**
335
- * Required. The resource name of the span in the following format: * `projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]` `[TRACE_ID]` is a unique identifier for a trace
336
- * within a project; it is a 32-character hexadecimal encoding of a 16-byte array. It should not be zero. `[SPAN_ID]` is a unique identifier for a span within a trace; it is a
337
- * 16-character hexadecimal encoding of an 8-byte array. It should not be zero. .
338
- */
339
- name:
340
- string;
341
- /** OAuth 2.0 token for the current user. */
342
- oauth_token?:
343
- string;
344
- /** Returns response with indentations and line breaks. */
345
- prettyPrint?:
346
- 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?:
349
- string;
350
- /** Upload protocol for media (e.g. "raw", "multipart"). */
351
- upload_protocol?:
352
- string;
353
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
354
- uploadType?:
355
- string;
356
- },
357
- body: Span): Request<Span>;
358
- }
359
- interface TracesResource {
360
- /** Batch writes new spans to new or existing traces. You cannot update existing spans. */
361
- batchWrite(request: {
362
- /** V1 error format. */
363
- "$.xgafv"?:
364
- string;
365
- /** OAuth access token. */
366
- access_token?:
367
- string;
368
- /** Data format for response. */
369
- alt?:
370
- string;
371
- /** JSONP */
372
- callback?:
373
- string;
374
- /** Selector specifying which fields to include in a partial response. */
375
- fields?:
376
- string;
377
- /** 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. */
378
- key?:
379
- string;
380
- /** Required. The name of the project where the spans belong. The format is `projects/[PROJECT_ID]`. */
381
- name:
382
- string;
383
- /** OAuth 2.0 token for the current user. */
384
- oauth_token?:
385
- string;
386
- /** Returns response with indentations and line breaks. */
387
- prettyPrint?:
388
- boolean;
389
- /** 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. */
390
- quotaUser?:
391
- string;
392
- /** Upload protocol for media (e.g. "raw", "multipart"). */
393
- upload_protocol?:
394
- string;
395
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
396
- uploadType?:
397
- string;
398
- /** Request body */
399
- resource:
400
- BatchWriteSpansRequest;
401
- }): Request<{}>;
402
- batchWrite(request: {
403
- /** V1 error format. */
404
- "$.xgafv"?:
405
- string;
406
- /** OAuth access token. */
407
- access_token?:
408
- string;
409
- /** Data format for response. */
410
- alt?:
411
- string;
412
- /** JSONP */
413
- callback?:
414
- string;
415
- /** Selector specifying which fields to include in a partial response. */
416
- fields?:
417
- string;
418
- /** 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. */
419
- key?:
420
- string;
421
- /** Required. The name of the project where the spans belong. The format is `projects/[PROJECT_ID]`. */
422
- name:
423
- string;
424
- /** OAuth 2.0 token for the current user. */
425
- oauth_token?:
426
- string;
427
- /** Returns response with indentations and line breaks. */
428
- prettyPrint?:
429
- boolean;
430
- /** 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. */
431
- quotaUser?:
432
- string;
433
- /** Upload protocol for media (e.g. "raw", "multipart"). */
434
- upload_protocol?:
435
- string;
436
- /** Legacy upload protocol for media (e.g. "media", "multipart"). */
437
- uploadType?:
438
- string;
439
- },
440
- body: BatchWriteSpansRequest): Request<{}>;
441
- spans:
442
- SpansResource;
443
- }
444
- interface ProjectsResource {
445
- traces:
446
- TracesResource;
447
- }
448
-
449
- const projects: ProjectsResource;
26
+ namespace cloudtrace {
27
+ interface Annotation {
28
+ /** A set of attributes on the annotation. You can have up to 4 attributes per Annotation. */
29
+ attributes?: Attributes;
30
+ /** A user-supplied message describing the event. The maximum length for the description is 256 bytes. */
31
+ description?: TruncatableString;
32
+ }
33
+ interface Attributes {
34
+ /** A set of attributes. Each attribute's key can be up to 128 bytes long. The value can be a string up to 256 bytes, a signed 64-bit integer, or the boolean values `true` or `false`. For example: "/instance_id": { "string_value": { "value": "my-instance" } } "/http/request_bytes": { "int_value": 300 } "example.com/myattribute": { "bool_value": false } */
35
+ attributeMap?: {[P in string]: AttributeValue};
36
+ /** The number of attributes that were discarded. Attributes can be discarded because their keys are too long or because there are too many attributes. If this value is 0 then all attributes are valid. */
37
+ droppedAttributesCount?: number;
38
+ }
39
+ interface AttributeValue {
40
+ /** A Boolean value represented by `true` or `false`. */
41
+ boolValue?: boolean;
42
+ /** A 64-bit signed integer. */
43
+ intValue?: string;
44
+ /** A string up to 256 bytes long. */
45
+ stringValue?: TruncatableString;
46
+ }
47
+ interface BatchWriteSpansRequest {
48
+ /** Required. A list of new spans. The span names must not match existing spans, otherwise the results are undefined. */
49
+ spans?: Span[];
50
+ }
51
+ interface Empty {}
52
+ interface Link {
53
+ /** A set of attributes on the link. Up to 32 attributes can be specified per link. */
54
+ attributes?: Attributes;
55
+ /** The `[SPAN_ID]` for a span within a trace. */
56
+ spanId?: string;
57
+ /** The `[TRACE_ID]` for a trace within a project. */
58
+ traceId?: string;
59
+ /** The relationship of the current span relative to the linked span. */
60
+ type?: string;
61
+ }
62
+ interface Links {
63
+ /** The number of dropped links after the maximum size was enforced. If this value is 0, then no links were dropped. */
64
+ droppedLinksCount?: number;
65
+ /** A collection of links. */
66
+ link?: Link[];
67
+ }
68
+ interface MessageEvent {
69
+ /** The number of compressed bytes sent or received. If missing, the compressed size is assumed to be the same size as the uncompressed size. */
70
+ compressedSizeBytes?: string;
71
+ /** An identifier for the MessageEvent's message that can be used to match `SENT` and `RECEIVED` MessageEvents. */
72
+ id?: string;
73
+ /** Type of MessageEvent. Indicates whether the message was sent or received. */
74
+ type?: string;
75
+ /** The number of uncompressed bytes sent or received. */
76
+ uncompressedSizeBytes?: string;
77
+ }
78
+ interface Module {
79
+ /** A unique identifier for the module, usually a hash of its contents (up to 128 bytes). */
80
+ buildId?: TruncatableString;
81
+ /** For example: main binary, kernel modules, and dynamic libraries such as libc.so, sharedlib.so (up to 256 bytes). */
82
+ module?: TruncatableString;
83
+ }
84
+ interface Span {
85
+ /** A set of attributes on the span. You can have up to 32 attributes per span. */
86
+ attributes?: Attributes;
87
+ /** Optional. The number of child spans that were generated while this span was active. If set, allows implementation to detect missing child spans. */
88
+ childSpanCount?: number;
89
+ /** Required. A description of the span's operation (up to 128 bytes). Cloud Trace displays the description in the Cloud console. For example, the display name can be a qualified method name or a file name and a line number where the operation is called. A best practice is to use the same display name within an application and at the same call point. This makes it easier to correlate spans in different traces. */
90
+ displayName?: TruncatableString;
91
+ /** Required. The end time of the span. On the client side, this is the time kept by the local machine where the span execution ends. On the server side, this is the time when the server application handler stops running. */
92
+ endTime?: string;
93
+ /** Links associated with the span. You can have up to 128 links per Span. */
94
+ links?: Links;
95
+ /** Required. The resource name of the span in the following format: * `projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]` `[TRACE_ID]` is a unique identifier for a trace within a project; it is a 32-character hexadecimal encoding of a 16-byte array. It should not be zero. `[SPAN_ID]` is a unique identifier for a span within a trace; it is a 16-character hexadecimal encoding of an 8-byte array. It should not be zero. . */
96
+ name?: string;
97
+ /** The `[SPAN_ID]` of this span's parent span. If this is a root span, then this field must be empty. */
98
+ parentSpanId?: string;
99
+ /** Optional. Set this parameter to indicate whether this span is in the same process as its parent. If you do not set this parameter, Trace is unable to take advantage of this helpful information. */
100
+ sameProcessAsParentSpan?: boolean;
101
+ /** Required. The `[SPAN_ID]` portion of the span's resource name. */
102
+ spanId?: string;
103
+ /** Optional. Distinguishes between spans generated in a particular context. For example, two spans with the same name may be distinguished using `CLIENT` (caller) and `SERVER` (callee) to identify an RPC call. */
104
+ spanKind?: string;
105
+ /** Stack trace captured at the start of the span. */
106
+ stackTrace?: StackTrace;
107
+ /** Required. The start time of the span. On the client side, this is the time kept by the local machine where the span execution starts. On the server side, this is the time when the server's application handler starts running. */
108
+ startTime?: string;
109
+ /** Optional. The final status for this span. */
110
+ status?: Status;
111
+ /** A set of time events. You can have up to 32 annotations and 128 message events per span. */
112
+ timeEvents?: TimeEvents;
113
+ }
114
+ interface StackFrame {
115
+ /** The column number where the function call appears, if available. This is important in JavaScript because of its anonymous functions. */
116
+ columnNumber?: string;
117
+ /** The name of the source file where the function call appears (up to 256 bytes). */
118
+ fileName?: TruncatableString;
119
+ /** The fully-qualified name that uniquely identifies the function or method that is active in this frame (up to 1024 bytes). */
120
+ functionName?: TruncatableString;
121
+ /** The line number in `file_name` where the function call appears. */
122
+ lineNumber?: string;
123
+ /** The binary module from where the code was loaded. */
124
+ loadModule?: Module;
125
+ /** An un-mangled function name, if `function_name` is mangled. To get information about name mangling, run [this search](https://www.google.com/search?q=cxx+name+mangling). The name can be fully-qualified (up to 1024 bytes). */
126
+ originalFunctionName?: TruncatableString;
127
+ /** The version of the deployed source code (up to 128 bytes). */
128
+ sourceVersion?: TruncatableString;
450
129
  }
130
+ interface StackFrames {
131
+ /** The number of stack frames that were dropped because there were too many stack frames. If this value is 0, then no stack frames were dropped. */
132
+ droppedFramesCount?: number;
133
+ /** Stack frames in this call stack. */
134
+ frame?: StackFrame[];
135
+ }
136
+ interface StackTrace {
137
+ /** Stack frames in this stack trace. A maximum of 128 frames are allowed. */
138
+ stackFrames?: StackFrames;
139
+ /** The hash ID is used to conserve network bandwidth for duplicate stack traces within a single trace. Often multiple spans will have identical stack traces. The first occurrence of a stack trace should contain both the `stackFrame` content and a value in `stackTraceHashId`. Subsequent spans within the same request can refer to that stack trace by only setting `stackTraceHashId`. */
140
+ stackTraceHashId?: string;
141
+ }
142
+ interface Status {
143
+ /** The status code, which should be an enum value of google.rpc.Code. */
144
+ code?: number;
145
+ /** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
146
+ details?: Array<{[P in string]: any}>;
147
+ /** 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. */
148
+ message?: string;
149
+ }
150
+ interface TimeEvent {
151
+ /** Text annotation with a set of attributes. */
152
+ annotation?: Annotation;
153
+ /** An event describing a message sent/received between Spans. */
154
+ messageEvent?: MessageEvent;
155
+ /** The timestamp indicating the time the event occurred. */
156
+ time?: string;
157
+ }
158
+ interface TimeEvents {
159
+ /** The number of dropped annotations in all the included time events. If the value is 0, then no annotations were dropped. */
160
+ droppedAnnotationsCount?: number;
161
+ /** The number of dropped message events in all the included time events. If the value is 0, then no message events were dropped. */
162
+ droppedMessageEventsCount?: number;
163
+ /** A collection of `TimeEvent`s. */
164
+ timeEvent?: TimeEvent[];
165
+ }
166
+ interface TruncatableString {
167
+ /** The number of bytes removed from the original string. If this value is 0, then the string was not shortened. */
168
+ truncatedByteCount?: number;
169
+ /** The shortened string. For example, if the original string is 500 bytes long and the limit of the string is 128 bytes, then `value` contains the first 128 bytes of the 500-byte string. Truncation always happens on a UTF8 character boundary. If there are multi-byte characters in the string, then the length of the shortened string might be less than the size limit. */
170
+ value?: string;
171
+ }
172
+ interface SpansResource {
173
+ /** Creates a new span. */
174
+ createSpan(request: {
175
+ /** V1 error format. */
176
+ '$.xgafv'?: string;
177
+ /** OAuth access token. */
178
+ access_token?: string;
179
+ /** Data format for response. */
180
+ alt?: string;
181
+ /** JSONP */
182
+ callback?: string;
183
+ /** Selector specifying which fields to include in a partial response. */
184
+ fields?: string;
185
+ /** 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. */
186
+ key?: string;
187
+ /** Required. The resource name of the span in the following format: * `projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]` `[TRACE_ID]` is a unique identifier for a trace within a project; it is a 32-character hexadecimal encoding of a 16-byte array. It should not be zero. `[SPAN_ID]` is a unique identifier for a span within a trace; it is a 16-character hexadecimal encoding of an 8-byte array. It should not be zero. . */
188
+ name: string;
189
+ /** OAuth 2.0 token for the current user. */
190
+ oauth_token?: string;
191
+ /** Returns response with indentations and line breaks. */
192
+ prettyPrint?: boolean;
193
+ /** 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. */
194
+ quotaUser?: string;
195
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
196
+ upload_protocol?: string;
197
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
198
+ uploadType?: string;
199
+ /** Request body */
200
+ resource: Span;
201
+ }): Request<Span>;
202
+ createSpan(
203
+ 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
+ /** Required. The resource name of the span in the following format: * `projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]` `[TRACE_ID]` is a unique identifier for a trace within a project; it is a 32-character hexadecimal encoding of a 16-byte array. It should not be zero. `[SPAN_ID]` is a unique identifier for a span within a trace; it is a 16-character hexadecimal encoding of an 8-byte array. It should not be zero. . */
217
+ name: string;
218
+ /** OAuth 2.0 token for the current user. */
219
+ oauth_token?: string;
220
+ /** Returns response with indentations and line breaks. */
221
+ prettyPrint?: boolean;
222
+ /** 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. */
223
+ quotaUser?: string;
224
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
225
+ upload_protocol?: string;
226
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
227
+ uploadType?: string;
228
+ },
229
+ body: Span
230
+ ): Request<Span>;
231
+ }
232
+ interface TracesResource {
233
+ /** Batch writes new spans to new or existing traces. You cannot update existing spans. */
234
+ batchWrite(request: {
235
+ /** V1 error format. */
236
+ '$.xgafv'?: string;
237
+ /** OAuth access token. */
238
+ access_token?: string;
239
+ /** Data format for response. */
240
+ alt?: string;
241
+ /** JSONP */
242
+ callback?: string;
243
+ /** Selector specifying which fields to include in a partial response. */
244
+ fields?: string;
245
+ /** 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. */
246
+ key?: string;
247
+ /** Required. The name of the project where the spans belong. The format is `projects/[PROJECT_ID]`. */
248
+ name: string;
249
+ /** OAuth 2.0 token for the current user. */
250
+ oauth_token?: string;
251
+ /** Returns response with indentations and line breaks. */
252
+ prettyPrint?: boolean;
253
+ /** 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. */
254
+ quotaUser?: string;
255
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
256
+ upload_protocol?: string;
257
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
258
+ uploadType?: string;
259
+ /** Request body */
260
+ resource: BatchWriteSpansRequest;
261
+ }): Request<{}>;
262
+ batchWrite(
263
+ request: {
264
+ /** V1 error format. */
265
+ '$.xgafv'?: string;
266
+ /** OAuth access token. */
267
+ access_token?: string;
268
+ /** Data format for response. */
269
+ alt?: string;
270
+ /** JSONP */
271
+ callback?: string;
272
+ /** Selector specifying which fields to include in a partial response. */
273
+ fields?: string;
274
+ /** 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. */
275
+ key?: string;
276
+ /** Required. The name of the project where the spans belong. The format is `projects/[PROJECT_ID]`. */
277
+ name: string;
278
+ /** OAuth 2.0 token for the current user. */
279
+ oauth_token?: string;
280
+ /** Returns response with indentations and line breaks. */
281
+ prettyPrint?: boolean;
282
+ /** 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. */
283
+ quotaUser?: string;
284
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
285
+ upload_protocol?: string;
286
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
287
+ uploadType?: string;
288
+ },
289
+ body: BatchWriteSpansRequest
290
+ ): Request<{}>;
291
+ spans: SpansResource;
292
+ }
293
+ interface ProjectsResource {
294
+ traces: TracesResource;
295
+ }
296
+
297
+ const projects: ProjectsResource;
298
+ }
451
299
  }
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.cloudtrace-v2",
3
- "version": "0.0.20231102",
3
+ "version": "0.0.20231130",
4
4
  "description": "TypeScript typings for Cloud Trace API v2",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
8
+ },
5
9
  "license": "MIT",
6
10
  "author": {
7
- "email": "maxim@mazurok.com",
8
11
  "name": "Maxim Mazurok",
12
+ "email": "maxim@mazurok.com",
9
13
  "url": "https://maxim.mazurok.com"
10
14
  },
11
- "repository": {
12
- "type": "git",
13
- "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
14
- },
15
15
  "types": "index.d.ts",
16
16
  "dependencies": {
17
17
  "@types/gapi.client": "*",
package/readme.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # TypeScript typings for Cloud Trace API v2
2
2
 
3
- Sends application trace data to Cloud Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Cloud Trace API directly. If you are looking to instrument your application for Cloud Trace, we recommend using OpenTelemetry.
3
+ Sends application trace data to Cloud Trace for viewing. Trace data is collected for all App Engine applications by default. Trace data from other applications can be provided using this API. This library is used to interact with the Cloud Trace API directly. If you are looking to instrument your application for Cloud Trace, we recommend using OpenTelemetry.
4
4
  For detailed description please check [documentation](https://cloud.google.com/trace).
5
5
 
6
6
  ## Installing
@@ -25,10 +25,13 @@ gapi.load('client', () => {
25
25
  Then load api client wrapper:
26
26
 
27
27
  ```typescript
28
- gapi.client.load('https://cloudtrace.googleapis.com/$discovery/rest?version=v2', () => {
29
- // now we can use:
30
- // gapi.client.cloudtrace
31
- });
28
+ gapi.client.load(
29
+ 'https://cloudtrace.googleapis.com/$discovery/rest?version=v2',
30
+ () => {
31
+ // now we can use:
32
+ // gapi.client.cloudtrace
33
+ }
34
+ );
32
35
  ```
33
36
 
34
37
  ```typescript
@@ -45,27 +48,29 @@ Don't forget to authenticate your client before sending any request to resources
45
48
  // declare client_id registered in Google Developers Console
46
49
  var client_id = '',
47
50
  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',
51
+ // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
52
+ 'https://www.googleapis.com/auth/cloud-platform',
50
53
 
51
- // Write Trace data for a project or application
52
- 'https://www.googleapis.com/auth/trace.append',
53
- ],
54
- immediate = true;
54
+ // Write Trace data for a project or application
55
+ 'https://www.googleapis.com/auth/trace.append',
56
+ ],
57
+ immediate = true;
55
58
  // ...
56
59
 
57
60
  gapi.auth.authorize(
58
- { client_id: client_id, scope: scope, immediate: immediate },
61
+ {client_id: client_id, scope: scope, immediate: immediate},
59
62
  authResult => {
60
63
  if (authResult && !authResult.error) {
61
- /* handle successful authorization */
64
+ /* handle successful authorization */
62
65
  } else {
63
- /* handle authorization error */
66
+ /* handle authorization error */
64
67
  }
65
- });
68
+ }
69
+ );
66
70
  ```
67
71
 
68
72
  After that you can use Cloud Trace API resources: <!-- TODO: make this work for multiple namespaces -->
69
73
 
70
74
  ```typescript
75
+
71
76
  ```
package/tests.ts DELETED
@@ -1,307 +0,0 @@
1
- /* This is stub file for gapi.client.cloudtrace-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: 20231102
7
-
8
- gapi.load('client', async () => {
9
- /** now we can use gapi.client */
10
-
11
- await gapi.client.load('https://cloudtrace.googleapis.com/$discovery/rest?version=v2');
12
- /** now we can use gapi.client.cloudtrace */
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
- /** Write Trace data for a project or application */
21
- 'https://www.googleapis.com/auth/trace.append',
22
- ];
23
- const immediate = false;
24
- gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
25
- if (authResult && !authResult.error) {
26
- /** handle successful authorization */
27
- run();
28
- } else {
29
- /** handle authorization error */
30
- }
31
- });
32
-
33
- async function run() {
34
- /** Batch writes new spans to new or existing traces. You cannot update existing spans. */
35
- await gapi.client.cloudtrace.projects.traces.batchWrite({
36
- name: "Test string",
37
- }, {
38
- spans: [
39
- {
40
- attributes: {
41
- attributeMap: {
42
- A: {
43
- boolValue: true,
44
- intValue: "Test string",
45
- stringValue: {
46
- truncatedByteCount: 42,
47
- value: "Test string",
48
- },
49
- }
50
- },
51
- droppedAttributesCount: 42,
52
- },
53
- childSpanCount: 42,
54
- displayName: {
55
- truncatedByteCount: 42,
56
- value: "Test string",
57
- },
58
- endTime: "Test string",
59
- links: {
60
- droppedLinksCount: 42,
61
- link: [
62
- {
63
- attributes: {
64
- attributeMap: {
65
- A: {
66
- boolValue: true,
67
- intValue: "Test string",
68
- stringValue: {
69
- truncatedByteCount: 42,
70
- value: "Test string",
71
- },
72
- }
73
- },
74
- droppedAttributesCount: 42,
75
- },
76
- spanId: "Test string",
77
- traceId: "Test string",
78
- type: "Test string",
79
- }
80
- ],
81
- },
82
- name: "Test string",
83
- parentSpanId: "Test string",
84
- sameProcessAsParentSpan: true,
85
- spanId: "Test string",
86
- spanKind: "Test string",
87
- stackTrace: {
88
- stackFrames: {
89
- droppedFramesCount: 42,
90
- frame: [
91
- {
92
- columnNumber: "Test string",
93
- fileName: {
94
- truncatedByteCount: 42,
95
- value: "Test string",
96
- },
97
- functionName: {
98
- truncatedByteCount: 42,
99
- value: "Test string",
100
- },
101
- lineNumber: "Test string",
102
- loadModule: {
103
- buildId: {
104
- truncatedByteCount: 42,
105
- value: "Test string",
106
- },
107
- module: {
108
- truncatedByteCount: 42,
109
- value: "Test string",
110
- },
111
- },
112
- originalFunctionName: {
113
- truncatedByteCount: 42,
114
- value: "Test string",
115
- },
116
- sourceVersion: {
117
- truncatedByteCount: 42,
118
- value: "Test string",
119
- },
120
- }
121
- ],
122
- },
123
- stackTraceHashId: "Test string",
124
- },
125
- startTime: "Test string",
126
- status: {
127
- code: 42,
128
- details: [
129
- {
130
- A: 42
131
- }
132
- ],
133
- message: "Test string",
134
- },
135
- timeEvents: {
136
- droppedAnnotationsCount: 42,
137
- droppedMessageEventsCount: 42,
138
- timeEvent: [
139
- {
140
- annotation: {
141
- attributes: {
142
- attributeMap: {
143
- A: {
144
- boolValue: true,
145
- intValue: "Test string",
146
- stringValue: {
147
- truncatedByteCount: 42,
148
- value: "Test string",
149
- },
150
- }
151
- },
152
- droppedAttributesCount: 42,
153
- },
154
- description: {
155
- truncatedByteCount: 42,
156
- value: "Test string",
157
- },
158
- },
159
- messageEvent: {
160
- compressedSizeBytes: "Test string",
161
- id: "Test string",
162
- type: "Test string",
163
- uncompressedSizeBytes: "Test string",
164
- },
165
- time: "Test string",
166
- }
167
- ],
168
- },
169
- }
170
- ],
171
- });
172
- /** Creates a new span. */
173
- await gapi.client.cloudtrace.projects.traces.spans.createSpan({
174
- name: "Test string",
175
- }, {
176
- attributes: {
177
- attributeMap: {
178
- A: {
179
- boolValue: true,
180
- intValue: "Test string",
181
- stringValue: {
182
- truncatedByteCount: 42,
183
- value: "Test string",
184
- },
185
- }
186
- },
187
- droppedAttributesCount: 42,
188
- },
189
- childSpanCount: 42,
190
- displayName: {
191
- truncatedByteCount: 42,
192
- value: "Test string",
193
- },
194
- endTime: "Test string",
195
- links: {
196
- droppedLinksCount: 42,
197
- link: [
198
- {
199
- attributes: {
200
- attributeMap: {
201
- A: {
202
- boolValue: true,
203
- intValue: "Test string",
204
- stringValue: {
205
- truncatedByteCount: 42,
206
- value: "Test string",
207
- },
208
- }
209
- },
210
- droppedAttributesCount: 42,
211
- },
212
- spanId: "Test string",
213
- traceId: "Test string",
214
- type: "Test string",
215
- }
216
- ],
217
- },
218
- name: "Test string",
219
- parentSpanId: "Test string",
220
- sameProcessAsParentSpan: true,
221
- spanId: "Test string",
222
- spanKind: "Test string",
223
- stackTrace: {
224
- stackFrames: {
225
- droppedFramesCount: 42,
226
- frame: [
227
- {
228
- columnNumber: "Test string",
229
- fileName: {
230
- truncatedByteCount: 42,
231
- value: "Test string",
232
- },
233
- functionName: {
234
- truncatedByteCount: 42,
235
- value: "Test string",
236
- },
237
- lineNumber: "Test string",
238
- loadModule: {
239
- buildId: {
240
- truncatedByteCount: 42,
241
- value: "Test string",
242
- },
243
- module: {
244
- truncatedByteCount: 42,
245
- value: "Test string",
246
- },
247
- },
248
- originalFunctionName: {
249
- truncatedByteCount: 42,
250
- value: "Test string",
251
- },
252
- sourceVersion: {
253
- truncatedByteCount: 42,
254
- value: "Test string",
255
- },
256
- }
257
- ],
258
- },
259
- stackTraceHashId: "Test string",
260
- },
261
- startTime: "Test string",
262
- status: {
263
- code: 42,
264
- details: [
265
- {
266
- A: 42
267
- }
268
- ],
269
- message: "Test string",
270
- },
271
- timeEvents: {
272
- droppedAnnotationsCount: 42,
273
- droppedMessageEventsCount: 42,
274
- timeEvent: [
275
- {
276
- annotation: {
277
- attributes: {
278
- attributeMap: {
279
- A: {
280
- boolValue: true,
281
- intValue: "Test string",
282
- stringValue: {
283
- truncatedByteCount: 42,
284
- value: "Test string",
285
- },
286
- }
287
- },
288
- droppedAttributesCount: 42,
289
- },
290
- description: {
291
- truncatedByteCount: 42,
292
- value: "Test string",
293
- },
294
- },
295
- messageEvent: {
296
- compressedSizeBytes: "Test string",
297
- id: "Test string",
298
- type: "Test string",
299
- uncompressedSizeBytes: "Test string",
300
- },
301
- time: "Test string",
302
- }
303
- ],
304
- },
305
- });
306
- }
307
- });
package/tsconfig.json DELETED
@@ -1,18 +0,0 @@
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 DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "extends": "dtslint/dtslint.json",
3
- "rules": {
4
- "no-redundant-jsdoc": false
5
- }
6
- }