@maxim_mazurok/gapi.client.clouderrorreporting-v1beta1 0.0.20220804
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 +501 -0
- package/package.json +20 -0
- package/readme.md +73 -0
- package/tests.ts +120 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Error Reporting API v1beta1 0.0 */
|
|
2
|
+
// Project: https://cloud.google.com/error-reporting/
|
|
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
|
+
// TypeScript Version: 2.8
|
|
8
|
+
|
|
9
|
+
// IMPORTANT
|
|
10
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
11
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
12
|
+
// Generated from: https://clouderrorreporting.googleapis.com/$discovery/rest?version=v1beta1
|
|
13
|
+
// Revision: 20220804
|
|
14
|
+
|
|
15
|
+
/// <reference types="gapi.client" />
|
|
16
|
+
|
|
17
|
+
declare namespace gapi.client {
|
|
18
|
+
/** Load Error Reporting API v1beta1 */
|
|
19
|
+
function load(urlOrObject: "https://clouderrorreporting.googleapis.com/$discovery/rest?version=v1beta1"): Promise<void>;
|
|
20
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
21
|
+
function load(name: "clouderrorreporting", version: "v1beta1"): Promise<void>;
|
|
22
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
23
|
+
function load(name: "clouderrorreporting", version: "v1beta1", callback: () => any): void;
|
|
24
|
+
|
|
25
|
+
namespace clouderrorreporting {
|
|
26
|
+
// tslint:disable-next-line:no-empty-interface
|
|
27
|
+
interface DeleteEventsResponse {
|
|
28
|
+
}
|
|
29
|
+
interface ErrorContext {
|
|
30
|
+
/** The HTTP request which was processed when the error was triggered. */
|
|
31
|
+
httpRequest?: HttpRequestContext;
|
|
32
|
+
/**
|
|
33
|
+
* The location in the source code where the decision was made to report the error, usually the place where it was logged. For a logged exception this would be the source line where
|
|
34
|
+
* the exception is logged, usually close to the place where it was caught.
|
|
35
|
+
*/
|
|
36
|
+
reportLocation?: SourceLocation;
|
|
37
|
+
/** Source code that was used to build the executable which has caused the given error message. */
|
|
38
|
+
sourceReferences?: SourceReference[];
|
|
39
|
+
/**
|
|
40
|
+
* The user who caused or was affected by the crash. This can be a user ID, an email address, or an arbitrary token that uniquely identifies the user. When sending an error report,
|
|
41
|
+
* leave this field empty if the user was not logged in. In this case the Error Reporting system will use other data, such as remote IP address, to distinguish affected users. See
|
|
42
|
+
* `affected_users_count` in `ErrorGroupStats`.
|
|
43
|
+
*/
|
|
44
|
+
user?: string;
|
|
45
|
+
}
|
|
46
|
+
interface ErrorEvent {
|
|
47
|
+
/** Data about the context in which the error occurred. */
|
|
48
|
+
context?: ErrorContext;
|
|
49
|
+
/** Time when the event occurred as provided in the error report. If the report did not contain a timestamp, the time the error was received by the Error Reporting system is used. */
|
|
50
|
+
eventTime?: string;
|
|
51
|
+
/** The stack trace that was reported or logged by the service. */
|
|
52
|
+
message?: string;
|
|
53
|
+
/** The `ServiceContext` for which this error was reported. */
|
|
54
|
+
serviceContext?: ServiceContext;
|
|
55
|
+
}
|
|
56
|
+
interface ErrorGroup {
|
|
57
|
+
/** Group IDs are unique for a given project. If the same kind of error occurs in different service contexts, it will receive the same group ID. */
|
|
58
|
+
groupId?: string;
|
|
59
|
+
/** The group resource name. Example: projects/my-project-123/groups/CNSgkpnppqKCUw */
|
|
60
|
+
name?: string;
|
|
61
|
+
/** Error group's resolution status. An unspecified resolution status will be interpreted as OPEN */
|
|
62
|
+
resolutionStatus?: string;
|
|
63
|
+
/** Associated tracking issues. */
|
|
64
|
+
trackingIssues?: TrackingIssue[];
|
|
65
|
+
}
|
|
66
|
+
interface ErrorGroupStats {
|
|
67
|
+
/**
|
|
68
|
+
* Service contexts with a non-zero error count for the given filter criteria. This list can be truncated if multiple services are affected. Refer to `num_affected_services` for the
|
|
69
|
+
* total count.
|
|
70
|
+
*/
|
|
71
|
+
affectedServices?: ServiceContext[];
|
|
72
|
+
/**
|
|
73
|
+
* Approximate number of affected users in the given group that match the filter criteria. Users are distinguished by data in the ErrorContext of the individual error events, such as
|
|
74
|
+
* their login name or their remote IP address in case of HTTP requests. The number of affected users can be zero even if the number of errors is non-zero if no data was provided from
|
|
75
|
+
* which the affected user could be deduced. Users are counted based on data in the request context that was provided in the error report. If more users are implicitly affected, such
|
|
76
|
+
* as due to a crash of the whole service, this is not reflected here.
|
|
77
|
+
*/
|
|
78
|
+
affectedUsersCount?: string;
|
|
79
|
+
/** Approximate total number of events in the given group that match the filter criteria. */
|
|
80
|
+
count?: string;
|
|
81
|
+
/** Approximate first occurrence that was ever seen for this group and which matches the given filter criteria, ignoring the time_range that was specified in the request. */
|
|
82
|
+
firstSeenTime?: string;
|
|
83
|
+
/** Group data that is independent of the filter criteria. */
|
|
84
|
+
group?: ErrorGroup;
|
|
85
|
+
/** Approximate last occurrence that was ever seen for this group and which matches the given filter criteria, ignoring the time_range that was specified in the request. */
|
|
86
|
+
lastSeenTime?: string;
|
|
87
|
+
/** The total number of services with a non-zero error count for the given filter criteria. */
|
|
88
|
+
numAffectedServices?: number;
|
|
89
|
+
/**
|
|
90
|
+
* An arbitrary event that is chosen as representative for the whole group. The representative event is intended to be used as a quick preview for the whole group. Events in the group
|
|
91
|
+
* are usually sufficiently similar to each other such that showing an arbitrary representative provides insight into the characteristics of the group as a whole.
|
|
92
|
+
*/
|
|
93
|
+
representative?: ErrorEvent;
|
|
94
|
+
/**
|
|
95
|
+
* Approximate number of occurrences over time. Timed counts returned by ListGroups are guaranteed to be: - Inside the requested time interval - Non-overlapping, and - Ordered by
|
|
96
|
+
* ascending time.
|
|
97
|
+
*/
|
|
98
|
+
timedCounts?: TimedCount[];
|
|
99
|
+
}
|
|
100
|
+
interface HttpRequestContext {
|
|
101
|
+
/** The type of HTTP request, such as `GET`, `POST`, etc. */
|
|
102
|
+
method?: string;
|
|
103
|
+
/** The referrer information that is provided with the request. */
|
|
104
|
+
referrer?: string;
|
|
105
|
+
/**
|
|
106
|
+
* The IP address from which the request originated. This can be IPv4, IPv6, or a token which is derived from the IP address, depending on the data that has been provided in the error
|
|
107
|
+
* report.
|
|
108
|
+
*/
|
|
109
|
+
remoteIp?: string;
|
|
110
|
+
/** The HTTP response status code for the request. */
|
|
111
|
+
responseStatusCode?: number;
|
|
112
|
+
/** The URL of the request. */
|
|
113
|
+
url?: string;
|
|
114
|
+
/** The user agent information that is provided with the request. */
|
|
115
|
+
userAgent?: string;
|
|
116
|
+
}
|
|
117
|
+
interface ListEventsResponse {
|
|
118
|
+
/** The error events which match the given request. */
|
|
119
|
+
errorEvents?: ErrorEvent[];
|
|
120
|
+
/** If non-empty, more results are available. Pass this token, along with the same query parameters as the first request, to view the next page of results. */
|
|
121
|
+
nextPageToken?: string;
|
|
122
|
+
/** The timestamp specifies the start time to which the request was restricted. */
|
|
123
|
+
timeRangeBegin?: string;
|
|
124
|
+
}
|
|
125
|
+
interface ListGroupStatsResponse {
|
|
126
|
+
/** The error group stats which match the given request. */
|
|
127
|
+
errorGroupStats?: ErrorGroupStats[];
|
|
128
|
+
/** If non-empty, more results are available. Pass this token, along with the same query parameters as the first request, to view the next page of results. */
|
|
129
|
+
nextPageToken?: string;
|
|
130
|
+
/**
|
|
131
|
+
* The timestamp specifies the start time to which the request was restricted. The start time is set based on the requested time range. It may be adjusted to a later time if a project
|
|
132
|
+
* has exceeded the storage quota and older data has been deleted.
|
|
133
|
+
*/
|
|
134
|
+
timeRangeBegin?: string;
|
|
135
|
+
}
|
|
136
|
+
interface ReportedErrorEvent {
|
|
137
|
+
/** Optional. A description of the context in which the error occurred. */
|
|
138
|
+
context?: ErrorContext;
|
|
139
|
+
/**
|
|
140
|
+
* Optional. Time when the event occurred. If not provided, the time when the event was received by the Error Reporting system is used. If provided, the time must not exceed the [logs
|
|
141
|
+
* retention period](https://cloud.google.com/logging/quotas#logs_retention_periods) in the past, or be more than 24 hours in the future. If an invalid time is provided, then an error
|
|
142
|
+
* is returned.
|
|
143
|
+
*/
|
|
144
|
+
eventTime?: string;
|
|
145
|
+
/**
|
|
146
|
+
* Required. The error message. If no `context.reportLocation` is provided, the message must contain a header (typically consisting of the exception type name and an error message) and
|
|
147
|
+
* an exception stack trace in one of the supported programming languages and formats. Supported languages are Java, Python, JavaScript, Ruby, C#, PHP, and Go. Supported stack trace
|
|
148
|
+
* formats are: * **Java**: Must be the return value of [`Throwable.printStackTrace()`](https://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#printStackTrace%28%29). *
|
|
149
|
+
* **Python**: Must be the return value of [`traceback.format_exc()`](https://docs.python.org/2/library/traceback.html#traceback.format_exc). * **JavaScript**: Must be the value of
|
|
150
|
+
* [`error.stack`](https://github.com/v8/v8/wiki/Stack-Trace-API) as returned by V8. * **Ruby**: Must contain frames returned by
|
|
151
|
+
* [`Exception.backtrace`](https://ruby-doc.org/core-2.2.0/Exception.html#method-i-backtrace). * **C#**: Must be the return value of
|
|
152
|
+
* [`Exception.ToString()`](https://msdn.microsoft.com/en-us/library/system.exception.tostring.aspx). * **PHP**: Must be prefixed with `"PHP (Notice|Parse error|Fatal error|Warning):
|
|
153
|
+
* "` and contain the result of [`(string)$exception`](https://php.net/manual/en/exception.tostring.php). * **Go**: Must be the return value of
|
|
154
|
+
* [`runtime.Stack()`](https://golang.org/pkg/runtime/debug/#Stack).
|
|
155
|
+
*/
|
|
156
|
+
message?: string;
|
|
157
|
+
/** Required. The service context in which this error has occurred. */
|
|
158
|
+
serviceContext?: ServiceContext;
|
|
159
|
+
}
|
|
160
|
+
// tslint:disable-next-line:no-empty-interface
|
|
161
|
+
interface ReportErrorEventResponse {
|
|
162
|
+
}
|
|
163
|
+
interface ServiceContext {
|
|
164
|
+
/**
|
|
165
|
+
* Type of the MonitoredResource. List of possible values: https://cloud.google.com/monitoring/api/resources Value is set automatically for incoming errors and must not be set when
|
|
166
|
+
* reporting errors.
|
|
167
|
+
*/
|
|
168
|
+
resourceType?: string;
|
|
169
|
+
/**
|
|
170
|
+
* An identifier of the service, such as the name of the executable, job, or Google App Engine service name. This field is expected to have a low number of values that are relatively
|
|
171
|
+
* stable over time, as opposed to `version`, which can be changed whenever new code is deployed. Contains the service name for error reports extracted from Google App Engine logs or
|
|
172
|
+
* `default` if the App Engine default service is used.
|
|
173
|
+
*/
|
|
174
|
+
service?: string;
|
|
175
|
+
/**
|
|
176
|
+
* Represents the source code version that the developer provided, which could represent a version label or a Git SHA-1 hash, for example. For App Engine standard environment, the
|
|
177
|
+
* version is set to the version of the app.
|
|
178
|
+
*/
|
|
179
|
+
version?: string;
|
|
180
|
+
}
|
|
181
|
+
interface SourceLocation {
|
|
182
|
+
/** The source code filename, which can include a truncated relative path, or a full path from a production machine. */
|
|
183
|
+
filePath?: string;
|
|
184
|
+
/** Human-readable name of a function or method. The value can include optional context like the class or package name. For example, `my.package.MyClass.method` in case of Java. */
|
|
185
|
+
functionName?: string;
|
|
186
|
+
/** 1-based. 0 indicates that the line number is unknown. */
|
|
187
|
+
lineNumber?: number;
|
|
188
|
+
}
|
|
189
|
+
interface SourceReference {
|
|
190
|
+
/** Optional. A URI string identifying the repository. Example: "https://github.com/GoogleCloudPlatform/kubernetes.git" */
|
|
191
|
+
repository?: string;
|
|
192
|
+
/** The canonical and persistent identifier of the deployed revision. Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b" */
|
|
193
|
+
revisionId?: string;
|
|
194
|
+
}
|
|
195
|
+
interface TimedCount {
|
|
196
|
+
/** Approximate number of occurrences in the given time period. */
|
|
197
|
+
count?: string;
|
|
198
|
+
/** End of the time period to which `count` refers (excluded). */
|
|
199
|
+
endTime?: string;
|
|
200
|
+
/** Start of the time period to which `count` refers (included). */
|
|
201
|
+
startTime?: string;
|
|
202
|
+
}
|
|
203
|
+
interface TrackingIssue {
|
|
204
|
+
/** A URL pointing to a related entry in an issue tracking system. Example: `https://github.com/user/project/issues/4` */
|
|
205
|
+
url?: string;
|
|
206
|
+
}
|
|
207
|
+
interface EventsResource {
|
|
208
|
+
/** Lists the specified events. */
|
|
209
|
+
list(request?: {
|
|
210
|
+
/** V1 error format. */
|
|
211
|
+
"$.xgafv"?: string;
|
|
212
|
+
/** OAuth access token. */
|
|
213
|
+
access_token?: string;
|
|
214
|
+
/** Data format for response. */
|
|
215
|
+
alt?: string;
|
|
216
|
+
/** JSONP */
|
|
217
|
+
callback?: string;
|
|
218
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
219
|
+
fields?: string;
|
|
220
|
+
/** Required. The group for which events shall be returned. */
|
|
221
|
+
groupId?: string;
|
|
222
|
+
/** 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. */
|
|
223
|
+
key?: string;
|
|
224
|
+
/** OAuth 2.0 token for the current user. */
|
|
225
|
+
oauth_token?: string;
|
|
226
|
+
/** Optional. The maximum number of results to return per response. */
|
|
227
|
+
pageSize?: number;
|
|
228
|
+
/** Optional. A `next_page_token` provided by a previous response. */
|
|
229
|
+
pageToken?: string;
|
|
230
|
+
/** Returns response with indentations and line breaks. */
|
|
231
|
+
prettyPrint?: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Required. The resource name of the Google Cloud Platform project. Written as `projects/{projectID}`, where `{projectID}` is the [Google Cloud Platform project
|
|
234
|
+
* ID](https://support.google.com/cloud/answer/6158840). Example: `projects/my-project-123`.
|
|
235
|
+
*/
|
|
236
|
+
projectName: string;
|
|
237
|
+
/** 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. */
|
|
238
|
+
quotaUser?: string;
|
|
239
|
+
/** Optional. The exact value to match against [`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type). */
|
|
240
|
+
"serviceFilter.resourceType"?: string;
|
|
241
|
+
/** Optional. The exact value to match against [`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service). */
|
|
242
|
+
"serviceFilter.service"?: string;
|
|
243
|
+
/** Optional. The exact value to match against [`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version). */
|
|
244
|
+
"serviceFilter.version"?: string;
|
|
245
|
+
/** Restricts the query to the specified time range. */
|
|
246
|
+
"timeRange.period"?: string;
|
|
247
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
248
|
+
upload_protocol?: string;
|
|
249
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
250
|
+
uploadType?: string;
|
|
251
|
+
}): Request<ListEventsResponse>;
|
|
252
|
+
/**
|
|
253
|
+
* Report an individual error event and record the event to a log. This endpoint accepts **either** an OAuth token, **or** an [API key](https://support.google.com/cloud/answer/6158862)
|
|
254
|
+
* for authentication. To use an API key, append it to the URL as the value of a `key` parameter. For example: `POST
|
|
255
|
+
* https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456` **Note:** [Error Reporting] (https://cloud.google.com/error-reporting) is a global
|
|
256
|
+
* service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects. For more information, see [Using Error
|
|
257
|
+
* Reporting with regionalized logs] (https://cloud.google.com/error-reporting/docs/regionalization).
|
|
258
|
+
*/
|
|
259
|
+
report(request: {
|
|
260
|
+
/** V1 error format. */
|
|
261
|
+
"$.xgafv"?: string;
|
|
262
|
+
/** OAuth access token. */
|
|
263
|
+
access_token?: string;
|
|
264
|
+
/** Data format for response. */
|
|
265
|
+
alt?: string;
|
|
266
|
+
/** JSONP */
|
|
267
|
+
callback?: string;
|
|
268
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
269
|
+
fields?: string;
|
|
270
|
+
/** 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. */
|
|
271
|
+
key?: string;
|
|
272
|
+
/** OAuth 2.0 token for the current user. */
|
|
273
|
+
oauth_token?: string;
|
|
274
|
+
/** Returns response with indentations and line breaks. */
|
|
275
|
+
prettyPrint?: boolean;
|
|
276
|
+
/**
|
|
277
|
+
* Required. The resource name of the Google Cloud Platform project. Written as `projects/{projectId}`, where `{projectId}` is the [Google Cloud Platform project
|
|
278
|
+
* ID](https://support.google.com/cloud/answer/6158840). Example: // `projects/my-project-123`.
|
|
279
|
+
*/
|
|
280
|
+
projectName: string;
|
|
281
|
+
/** 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. */
|
|
282
|
+
quotaUser?: string;
|
|
283
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
284
|
+
upload_protocol?: string;
|
|
285
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
286
|
+
uploadType?: string;
|
|
287
|
+
/** Request body */
|
|
288
|
+
resource: ReportedErrorEvent;
|
|
289
|
+
}): Request<{}>;
|
|
290
|
+
report(request: {
|
|
291
|
+
/** V1 error format. */
|
|
292
|
+
"$.xgafv"?: string;
|
|
293
|
+
/** OAuth access token. */
|
|
294
|
+
access_token?: string;
|
|
295
|
+
/** Data format for response. */
|
|
296
|
+
alt?: string;
|
|
297
|
+
/** JSONP */
|
|
298
|
+
callback?: string;
|
|
299
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
300
|
+
fields?: string;
|
|
301
|
+
/** 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. */
|
|
302
|
+
key?: string;
|
|
303
|
+
/** OAuth 2.0 token for the current user. */
|
|
304
|
+
oauth_token?: string;
|
|
305
|
+
/** Returns response with indentations and line breaks. */
|
|
306
|
+
prettyPrint?: boolean;
|
|
307
|
+
/**
|
|
308
|
+
* Required. The resource name of the Google Cloud Platform project. Written as `projects/{projectId}`, where `{projectId}` is the [Google Cloud Platform project
|
|
309
|
+
* ID](https://support.google.com/cloud/answer/6158840). Example: // `projects/my-project-123`.
|
|
310
|
+
*/
|
|
311
|
+
projectName: string;
|
|
312
|
+
/** 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. */
|
|
313
|
+
quotaUser?: string;
|
|
314
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
315
|
+
upload_protocol?: string;
|
|
316
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
317
|
+
uploadType?: string;
|
|
318
|
+
},
|
|
319
|
+
body: ReportedErrorEvent): Request<{}>;
|
|
320
|
+
}
|
|
321
|
+
interface GroupsResource {
|
|
322
|
+
/** Get the specified group. */
|
|
323
|
+
get(request?: {
|
|
324
|
+
/** V1 error format. */
|
|
325
|
+
"$.xgafv"?: string;
|
|
326
|
+
/** OAuth access token. */
|
|
327
|
+
access_token?: string;
|
|
328
|
+
/** Data format for response. */
|
|
329
|
+
alt?: string;
|
|
330
|
+
/** JSONP */
|
|
331
|
+
callback?: string;
|
|
332
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
333
|
+
fields?: string;
|
|
334
|
+
/**
|
|
335
|
+
* Required. The group resource name. Written as `projects/{projectID}/groups/{group_name}`. Call groupStats.list to return a list of groups belonging to this project. Example:
|
|
336
|
+
* `projects/my-project-123/groups/my-group`
|
|
337
|
+
*/
|
|
338
|
+
groupName: string;
|
|
339
|
+
/** 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. */
|
|
340
|
+
key?: string;
|
|
341
|
+
/** OAuth 2.0 token for the current user. */
|
|
342
|
+
oauth_token?: string;
|
|
343
|
+
/** Returns response with indentations and line breaks. */
|
|
344
|
+
prettyPrint?: boolean;
|
|
345
|
+
/** 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. */
|
|
346
|
+
quotaUser?: string;
|
|
347
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
348
|
+
upload_protocol?: string;
|
|
349
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
350
|
+
uploadType?: string;
|
|
351
|
+
}): Request<ErrorGroup>;
|
|
352
|
+
/** Replace the data for the specified group. Fails if the group does not exist. */
|
|
353
|
+
update(request: {
|
|
354
|
+
/** V1 error format. */
|
|
355
|
+
"$.xgafv"?: string;
|
|
356
|
+
/** OAuth access token. */
|
|
357
|
+
access_token?: string;
|
|
358
|
+
/** Data format for response. */
|
|
359
|
+
alt?: string;
|
|
360
|
+
/** JSONP */
|
|
361
|
+
callback?: string;
|
|
362
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
363
|
+
fields?: string;
|
|
364
|
+
/** 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. */
|
|
365
|
+
key?: string;
|
|
366
|
+
/** The group resource name. Example: projects/my-project-123/groups/CNSgkpnppqKCUw */
|
|
367
|
+
name: string;
|
|
368
|
+
/** OAuth 2.0 token for the current user. */
|
|
369
|
+
oauth_token?: string;
|
|
370
|
+
/** Returns response with indentations and line breaks. */
|
|
371
|
+
prettyPrint?: boolean;
|
|
372
|
+
/** 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. */
|
|
373
|
+
quotaUser?: string;
|
|
374
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
375
|
+
upload_protocol?: string;
|
|
376
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
377
|
+
uploadType?: string;
|
|
378
|
+
/** Request body */
|
|
379
|
+
resource: ErrorGroup;
|
|
380
|
+
}): Request<ErrorGroup>;
|
|
381
|
+
update(request: {
|
|
382
|
+
/** V1 error format. */
|
|
383
|
+
"$.xgafv"?: string;
|
|
384
|
+
/** OAuth access token. */
|
|
385
|
+
access_token?: string;
|
|
386
|
+
/** Data format for response. */
|
|
387
|
+
alt?: string;
|
|
388
|
+
/** JSONP */
|
|
389
|
+
callback?: string;
|
|
390
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
391
|
+
fields?: string;
|
|
392
|
+
/** 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. */
|
|
393
|
+
key?: string;
|
|
394
|
+
/** The group resource name. Example: projects/my-project-123/groups/CNSgkpnppqKCUw */
|
|
395
|
+
name: string;
|
|
396
|
+
/** OAuth 2.0 token for the current user. */
|
|
397
|
+
oauth_token?: string;
|
|
398
|
+
/** Returns response with indentations and line breaks. */
|
|
399
|
+
prettyPrint?: boolean;
|
|
400
|
+
/** 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. */
|
|
401
|
+
quotaUser?: string;
|
|
402
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
403
|
+
upload_protocol?: string;
|
|
404
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
405
|
+
uploadType?: string;
|
|
406
|
+
},
|
|
407
|
+
body: ErrorGroup): Request<ErrorGroup>;
|
|
408
|
+
}
|
|
409
|
+
interface GroupStatsResource {
|
|
410
|
+
/** Lists the specified groups. */
|
|
411
|
+
list(request?: {
|
|
412
|
+
/** V1 error format. */
|
|
413
|
+
"$.xgafv"?: string;
|
|
414
|
+
/** OAuth access token. */
|
|
415
|
+
access_token?: string;
|
|
416
|
+
/** Optional. The alignment of the timed counts to be returned. Default is `ALIGNMENT_EQUAL_AT_END`. */
|
|
417
|
+
alignment?: string;
|
|
418
|
+
/** Optional. Time where the timed counts shall be aligned if rounded alignment is chosen. Default is 00:00 UTC. */
|
|
419
|
+
alignmentTime?: string;
|
|
420
|
+
/** Data format for response. */
|
|
421
|
+
alt?: string;
|
|
422
|
+
/** JSONP */
|
|
423
|
+
callback?: string;
|
|
424
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
425
|
+
fields?: string;
|
|
426
|
+
/** Optional. List all ErrorGroupStats with these IDs. */
|
|
427
|
+
groupId?: string | string[];
|
|
428
|
+
/** 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. */
|
|
429
|
+
key?: string;
|
|
430
|
+
/** OAuth 2.0 token for the current user. */
|
|
431
|
+
oauth_token?: string;
|
|
432
|
+
/** Optional. The sort order in which the results are returned. Default is `COUNT_DESC`. */
|
|
433
|
+
order?: string;
|
|
434
|
+
/** Optional. The maximum number of results to return per response. Default is 20. */
|
|
435
|
+
pageSize?: number;
|
|
436
|
+
/** Optional. A next_page_token provided by a previous response. To view additional results, pass this token along with the identical query parameters as the first request. */
|
|
437
|
+
pageToken?: string;
|
|
438
|
+
/** Returns response with indentations and line breaks. */
|
|
439
|
+
prettyPrint?: boolean;
|
|
440
|
+
/**
|
|
441
|
+
* Required. The resource name of the Google Cloud Platform project. Written as `projects/{projectID}` or `projects/{projectNumber}`, where `{projectID}` and `{projectNumber}` can
|
|
442
|
+
* be found in the [Google Cloud console](https://support.google.com/cloud/answer/6158840). Examples: `projects/my-project-123`, `projects/5551234`.
|
|
443
|
+
*/
|
|
444
|
+
projectName: string;
|
|
445
|
+
/** 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. */
|
|
446
|
+
quotaUser?: string;
|
|
447
|
+
/** Optional. The exact value to match against [`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type). */
|
|
448
|
+
"serviceFilter.resourceType"?: string;
|
|
449
|
+
/** Optional. The exact value to match against [`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service). */
|
|
450
|
+
"serviceFilter.service"?: string;
|
|
451
|
+
/** Optional. The exact value to match against [`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version). */
|
|
452
|
+
"serviceFilter.version"?: string;
|
|
453
|
+
/** Optional. The preferred duration for a single returned TimedCount. If not set, no timed counts are returned. */
|
|
454
|
+
timedCountDuration?: string;
|
|
455
|
+
/** Restricts the query to the specified time range. */
|
|
456
|
+
"timeRange.period"?: string;
|
|
457
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
458
|
+
upload_protocol?: string;
|
|
459
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
460
|
+
uploadType?: string;
|
|
461
|
+
}): Request<ListGroupStatsResponse>;
|
|
462
|
+
}
|
|
463
|
+
interface ProjectsResource {
|
|
464
|
+
/** Deletes all error events of a given project. */
|
|
465
|
+
deleteEvents(request?: {
|
|
466
|
+
/** V1 error format. */
|
|
467
|
+
"$.xgafv"?: string;
|
|
468
|
+
/** OAuth access token. */
|
|
469
|
+
access_token?: string;
|
|
470
|
+
/** Data format for response. */
|
|
471
|
+
alt?: string;
|
|
472
|
+
/** JSONP */
|
|
473
|
+
callback?: string;
|
|
474
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
475
|
+
fields?: string;
|
|
476
|
+
/** 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. */
|
|
477
|
+
key?: string;
|
|
478
|
+
/** OAuth 2.0 token for the current user. */
|
|
479
|
+
oauth_token?: string;
|
|
480
|
+
/** Returns response with indentations and line breaks. */
|
|
481
|
+
prettyPrint?: boolean;
|
|
482
|
+
/**
|
|
483
|
+
* Required. The resource name of the Google Cloud Platform project. Written as `projects/{projectID}`, where `{projectID}` is the [Google Cloud Platform project
|
|
484
|
+
* ID](https://support.google.com/cloud/answer/6158840). Example: `projects/my-project-123`.
|
|
485
|
+
*/
|
|
486
|
+
projectName: string;
|
|
487
|
+
/** 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. */
|
|
488
|
+
quotaUser?: string;
|
|
489
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
490
|
+
upload_protocol?: string;
|
|
491
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
492
|
+
uploadType?: string;
|
|
493
|
+
}): Request<{}>;
|
|
494
|
+
events: EventsResource;
|
|
495
|
+
groups: GroupsResource;
|
|
496
|
+
groupStats: GroupStatsResource;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
const projects: ProjectsResource;
|
|
500
|
+
}
|
|
501
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.clouderrorreporting-v1beta1",
|
|
3
|
+
"version": "0.0.20220804",
|
|
4
|
+
"description": "TypeScript typings for Error Reporting API v1beta1",
|
|
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,73 @@
|
|
|
1
|
+
# TypeScript typings for Error Reporting API v1beta1
|
|
2
|
+
|
|
3
|
+
Groups and counts similar errors from cloud services and applications, reports new errors, and provides access to error groups and their associated errors.
|
|
4
|
+
For detailed description please check [documentation](https://cloud.google.com/error-reporting/).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Error Reporting API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.clouderrorreporting-v1beta1 --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://clouderrorreporting.googleapis.com/$discovery/rest?version=v1beta1', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.clouderrorreporting
|
|
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('clouderrorreporting', 'v1beta1', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.clouderrorreporting
|
|
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 Error Reporting API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
|
|
69
|
+
/*
|
|
70
|
+
Deletes all error events of a given project.
|
|
71
|
+
*/
|
|
72
|
+
await gapi.client.clouderrorreporting.projects.deleteEvents({ projectName: "projectName", });
|
|
73
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.clouderrorreporting-v1beta1 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: 20220804
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://clouderrorreporting.googleapis.com/$discovery/rest?version=v1beta1');
|
|
12
|
+
/** now we can use gapi.client.clouderrorreporting */
|
|
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
|
+
/** Deletes all error events of a given project. */
|
|
33
|
+
await gapi.client.clouderrorreporting.projects.deleteEvents({
|
|
34
|
+
projectName: "Test string",
|
|
35
|
+
});
|
|
36
|
+
/** Lists the specified events. */
|
|
37
|
+
await gapi.client.clouderrorreporting.projects.events.list({
|
|
38
|
+
groupId: "Test string",
|
|
39
|
+
pageSize: 42,
|
|
40
|
+
pageToken: "Test string",
|
|
41
|
+
projectName: "Test string",
|
|
42
|
+
"serviceFilter.resourceType": "Test string",
|
|
43
|
+
"serviceFilter.service": "Test string",
|
|
44
|
+
"serviceFilter.version": "Test string",
|
|
45
|
+
"timeRange.period": "Test string",
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Report an individual error event and record the event to a log. This endpoint accepts **either** an OAuth token, **or** an [API key](https://support.google.com/cloud/answer/6158862) for
|
|
49
|
+
* authentication. To use an API key, append it to the URL as the value of a `key` parameter. For example: `POST
|
|
50
|
+
* https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456` **Note:** [Error Reporting] (https://cloud.google.com/error-reporting) is a global service
|
|
51
|
+
* built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects. For more information, see [Using Error Reporting with
|
|
52
|
+
* regionalized logs] (https://cloud.google.com/error-reporting/docs/regionalization).
|
|
53
|
+
*/
|
|
54
|
+
await gapi.client.clouderrorreporting.projects.events.report({
|
|
55
|
+
projectName: "Test string",
|
|
56
|
+
}, {
|
|
57
|
+
context: {
|
|
58
|
+
httpRequest: {
|
|
59
|
+
method: "Test string",
|
|
60
|
+
referrer: "Test string",
|
|
61
|
+
remoteIp: "Test string",
|
|
62
|
+
responseStatusCode: 42,
|
|
63
|
+
url: "Test string",
|
|
64
|
+
userAgent: "Test string",
|
|
65
|
+
},
|
|
66
|
+
reportLocation: {
|
|
67
|
+
filePath: "Test string",
|
|
68
|
+
functionName: "Test string",
|
|
69
|
+
lineNumber: 42,
|
|
70
|
+
},
|
|
71
|
+
sourceReferences: [
|
|
72
|
+
{
|
|
73
|
+
repository: "Test string",
|
|
74
|
+
revisionId: "Test string",
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
user: "Test string",
|
|
78
|
+
},
|
|
79
|
+
eventTime: "Test string",
|
|
80
|
+
message: "Test string",
|
|
81
|
+
serviceContext: {
|
|
82
|
+
resourceType: "Test string",
|
|
83
|
+
service: "Test string",
|
|
84
|
+
version: "Test string",
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
/** Get the specified group. */
|
|
88
|
+
await gapi.client.clouderrorreporting.projects.groups.get({
|
|
89
|
+
groupName: "Test string",
|
|
90
|
+
});
|
|
91
|
+
/** Replace the data for the specified group. Fails if the group does not exist. */
|
|
92
|
+
await gapi.client.clouderrorreporting.projects.groups.update({
|
|
93
|
+
name: "Test string",
|
|
94
|
+
}, {
|
|
95
|
+
groupId: "Test string",
|
|
96
|
+
name: "Test string",
|
|
97
|
+
resolutionStatus: "Test string",
|
|
98
|
+
trackingIssues: [
|
|
99
|
+
{
|
|
100
|
+
url: "Test string",
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
});
|
|
104
|
+
/** Lists the specified groups. */
|
|
105
|
+
await gapi.client.clouderrorreporting.projects.groupStats.list({
|
|
106
|
+
alignment: "Test string",
|
|
107
|
+
alignmentTime: "Test string",
|
|
108
|
+
groupId: "Test string",
|
|
109
|
+
order: "Test string",
|
|
110
|
+
pageSize: 42,
|
|
111
|
+
pageToken: "Test string",
|
|
112
|
+
projectName: "Test string",
|
|
113
|
+
"serviceFilter.resourceType": "Test string",
|
|
114
|
+
"serviceFilter.service": "Test string",
|
|
115
|
+
"serviceFilter.version": "Test string",
|
|
116
|
+
timedCountDuration: "Test string",
|
|
117
|
+
"timeRange.period": "Test string",
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
});
|
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
|
+
}
|