@maxim_mazurok/gapi.client.cloudscheduler-v1 0.0.20220802
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 +760 -0
- package/package.json +20 -0
- package/readme.md +68 -0
- package/tests.ts +217 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,760 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Cloud Scheduler API v1 0.0 */
|
|
2
|
+
// Project: https://cloud.google.com/scheduler/
|
|
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://cloudscheduler.googleapis.com/$discovery/rest?version=v1
|
|
13
|
+
// Revision: 20220802
|
|
14
|
+
|
|
15
|
+
/// <reference types="gapi.client" />
|
|
16
|
+
|
|
17
|
+
declare namespace gapi.client {
|
|
18
|
+
/** Load Cloud Scheduler API v1 */
|
|
19
|
+
function load(urlOrObject: "https://cloudscheduler.googleapis.com/$discovery/rest?version=v1"): Promise<void>;
|
|
20
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
21
|
+
function load(name: "cloudscheduler", version: "v1"): Promise<void>;
|
|
22
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
23
|
+
function load(name: "cloudscheduler", version: "v1", callback: () => any): void;
|
|
24
|
+
|
|
25
|
+
namespace cloudscheduler {
|
|
26
|
+
interface AppEngineHttpTarget {
|
|
27
|
+
/** App Engine Routing setting for the job. */
|
|
28
|
+
appEngineRouting?: AppEngineRouting;
|
|
29
|
+
/**
|
|
30
|
+
* Body. HTTP request body. A request body is allowed only if the HTTP method is POST or PUT. It will result in invalid argument error to set a body on a job with an incompatible
|
|
31
|
+
* HttpMethod.
|
|
32
|
+
*/
|
|
33
|
+
body?: string;
|
|
34
|
+
/**
|
|
35
|
+
* HTTP request headers. This map contains the header field names and values. Headers can be set when the job is created. Cloud Scheduler sets some headers to default values: *
|
|
36
|
+
* `User-Agent`: By default, this header is `"AppEngine-Google; (+http://code.google.com/appengine)"`. This header can be modified, but Cloud Scheduler will append `"AppEngine-Google;
|
|
37
|
+
* (+http://code.google.com/appengine)"` to the modified `User-Agent`. * `X-CloudScheduler`: This header will be set to true. * `X-CloudScheduler-JobName`: This header will contain the
|
|
38
|
+
* job name. * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in the unix-cron format, this header will contain the job schedule time in RFC3339 UTC "Zulu" format.
|
|
39
|
+
* If the job has an body, Cloud Scheduler sets the following headers: * `Content-Type`: By default, the `Content-Type` header is set to `"application/octet-stream"`. The default can
|
|
40
|
+
* be overridden by explictly setting `Content-Type` to a particular media type when the job is created. For example, `Content-Type` can be set to `"application/json"`. *
|
|
41
|
+
* `Content-Length`: This is computed by Cloud Scheduler. This value is output only. It cannot be changed. The headers below are output only. They cannot be set or overridden: *
|
|
42
|
+
* `X-Google-*`: For Google internal use only. * `X-AppEngine-*`: For Google internal use only. In addition, some App Engine headers, which contain job-specific information, are also
|
|
43
|
+
* be sent to the job handler.
|
|
44
|
+
*/
|
|
45
|
+
headers?: { [P in string]: string };
|
|
46
|
+
/** The HTTP method to use for the request. PATCH and OPTIONS are not permitted. */
|
|
47
|
+
httpMethod?: string;
|
|
48
|
+
/**
|
|
49
|
+
* The relative URI. The relative URL must begin with "/" and must be a valid HTTP relative URL. It can contain a path, query string arguments, and `#` fragments. If the relative URL
|
|
50
|
+
* is empty, then the root path "/" will be used. No spaces are allowed, and the maximum length allowed is 2083 characters.
|
|
51
|
+
*/
|
|
52
|
+
relativeUri?: string;
|
|
53
|
+
}
|
|
54
|
+
interface AppEngineRouting {
|
|
55
|
+
/**
|
|
56
|
+
* Output only. The host that the job is sent to. For more information about how App Engine requests are routed, see
|
|
57
|
+
* [here](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). The host is constructed as: * `host = [application_domain_name]` `| [service] + '.' +
|
|
58
|
+
* [application_domain_name]` `| [version] + '.' + [application_domain_name]` `| [version_dot_service]+ '.' + [application_domain_name]` `| [instance] + '.' +
|
|
59
|
+
* [application_domain_name]` `| [instance_dot_service] + '.' + [application_domain_name]` `| [instance_dot_version] + '.' + [application_domain_name]` `|
|
|
60
|
+
* [instance_dot_version_dot_service] + '.' + [application_domain_name]` * `application_domain_name` = The domain name of the app, for example .appspot.com, which is associated with
|
|
61
|
+
* the job's project ID. * `service =` service * `version =` version * `version_dot_service =` version `+ '.' +` service * `instance =` instance * `instance_dot_service =` instance `+
|
|
62
|
+
* '.' +` service * `instance_dot_version =` instance `+ '.' +` version * `instance_dot_version_dot_service =` instance `+ '.' +` version `+ '.' +` service If service is empty, then
|
|
63
|
+
* the job will be sent to the service which is the default service when the job is attempted. If version is empty, then the job will be sent to the version which is the default
|
|
64
|
+
* version when the job is attempted. If instance is empty, then the job will be sent to an instance which is available when the job is attempted. If service, version, or instance is
|
|
65
|
+
* invalid, then the job will be sent to the default version of the default service when the job is attempted.
|
|
66
|
+
*/
|
|
67
|
+
host?: string;
|
|
68
|
+
/**
|
|
69
|
+
* App instance. By default, the job is sent to an instance which is available when the job is attempted. Requests can only be sent to a specific instance if [manual scaling is used in
|
|
70
|
+
* App Engine Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?#scaling_types_and_instance_classes). App Engine Flex does not support instances. For
|
|
71
|
+
* more information, see [App Engine Standard request routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) and [App Engine Flex request
|
|
72
|
+
* routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
|
|
73
|
+
*/
|
|
74
|
+
instance?: string;
|
|
75
|
+
/** App service. By default, the job is sent to the service which is the default service when the job is attempted. */
|
|
76
|
+
service?: string;
|
|
77
|
+
/** App version. By default, the job is sent to the version which is the default version when the job is attempted. */
|
|
78
|
+
version?: string;
|
|
79
|
+
}
|
|
80
|
+
// tslint:disable-next-line:no-empty-interface
|
|
81
|
+
interface Empty {
|
|
82
|
+
}
|
|
83
|
+
interface HttpTarget {
|
|
84
|
+
/** HTTP request body. A request body is allowed only if the HTTP method is POST, PUT, or PATCH. It is an error to set body on a job with an incompatible HttpMethod. */
|
|
85
|
+
body?: string;
|
|
86
|
+
/**
|
|
87
|
+
* The user can specify HTTP request headers to send with the job's HTTP request. This map contains the header field names and values. Repeated headers are not supported, but a header
|
|
88
|
+
* value can contain commas. These headers represent a subset of the headers that will accompany the job's HTTP request. Some HTTP request headers will be ignored or replaced. A
|
|
89
|
+
* partial list of headers that will be ignored or replaced is below: - Host: This will be computed by Cloud Scheduler and derived from uri. * `Content-Length`: This will be computed
|
|
90
|
+
* by Cloud Scheduler. * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. * `X-Google-*`: Google internal use only. * `X-AppEngine-*`: Google internal use only. *
|
|
91
|
+
* `X-CloudScheduler`: This header will be set to true. * `X-CloudScheduler-JobName`: This header will contain the job name. * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs
|
|
92
|
+
* specified in the unix-cron format, this header will contain the job schedule time in RFC3339 UTC "Zulu" format. The total size of headers must be less than 80KB.
|
|
93
|
+
*/
|
|
94
|
+
headers?: { [P in string]: string };
|
|
95
|
+
/** Which HTTP method to use for the request. */
|
|
96
|
+
httpMethod?: string;
|
|
97
|
+
/**
|
|
98
|
+
* If specified, an [OAuth token](https://developers.google.com/identity/protocols/OAuth2) will be generated and attached as an `Authorization` header in the HTTP request. This type of
|
|
99
|
+
* authorization should generally only be used when calling Google APIs hosted on *.googleapis.com.
|
|
100
|
+
*/
|
|
101
|
+
oauthToken?: OAuthToken;
|
|
102
|
+
/**
|
|
103
|
+
* If specified, an [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) token will be generated and attached as an `Authorization` header in the HTTP request. This
|
|
104
|
+
* type of authorization can be used for many scenarios, including calling Cloud Run, or endpoints where you intend to validate the token yourself.
|
|
105
|
+
*/
|
|
106
|
+
oidcToken?: OidcToken;
|
|
107
|
+
/**
|
|
108
|
+
* Required. The full URI path that the request will be sent to. This string must begin with either "http://" or "https://". Some examples of valid values for uri are:
|
|
109
|
+
* `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will encode some characters for safety and compatibility. The maximum allowed URL length is 2083 characters
|
|
110
|
+
* after encoding.
|
|
111
|
+
*/
|
|
112
|
+
uri?: string;
|
|
113
|
+
}
|
|
114
|
+
interface Job {
|
|
115
|
+
/** App Engine HTTP target. */
|
|
116
|
+
appEngineHttpTarget?: AppEngineHttpTarget;
|
|
117
|
+
/**
|
|
118
|
+
* The deadline for job attempts. If the request handler does not respond by this deadline then the request is cancelled and the attempt is marked as a `DEADLINE_EXCEEDED` failure. The
|
|
119
|
+
* failed attempt can be viewed in execution logs. Cloud Scheduler will retry the job according to the RetryConfig. The default and the allowed values depend on the type of target: *
|
|
120
|
+
* For HTTP targets, the default is 3 minutes. The deadline must be in the interval [15 seconds, 30 minutes]. * For App Engine HTTP targets, 0 indicates that the request has the
|
|
121
|
+
* default deadline. The default deadline depends on the scaling type of the service: 10 minutes for standard apps with automatic scaling, 24 hours for standard apps with manual and
|
|
122
|
+
* basic scaling, and 60 minutes for flex apps. If the request deadline is set, it must be in the interval [15 seconds, 24 hours 15 seconds]. * For Pub/Sub targets, this field is
|
|
123
|
+
* ignored.
|
|
124
|
+
*/
|
|
125
|
+
attemptDeadline?: string;
|
|
126
|
+
/** Optionally caller-specified in CreateJob or UpdateJob. A human-readable description for the job. This string must not contain more than 500 characters. */
|
|
127
|
+
description?: string;
|
|
128
|
+
/** HTTP target. */
|
|
129
|
+
httpTarget?: HttpTarget;
|
|
130
|
+
/** Output only. The time the last job attempt started. */
|
|
131
|
+
lastAttemptTime?: string;
|
|
132
|
+
/**
|
|
133
|
+
* Optionally caller-specified in CreateJob, after which it becomes output only. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. * `PROJECT_ID` can
|
|
134
|
+
* contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more information, see [Identifying
|
|
135
|
+
* projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) * `LOCATION_ID` is the canonical ID for the job's location. The list of
|
|
136
|
+
* available locations can be obtained by calling ListLocations. For more information, see https://cloud.google.com/about/locations/. * `JOB_ID` can contain only letters ([A-Za-z]),
|
|
137
|
+
* numbers ([0-9]), hyphens (-), or underscores (_). The maximum length is 500 characters.
|
|
138
|
+
*/
|
|
139
|
+
name?: string;
|
|
140
|
+
/** Pub/Sub target. */
|
|
141
|
+
pubsubTarget?: PubsubTarget;
|
|
142
|
+
/** Settings that determine the retry behavior. */
|
|
143
|
+
retryConfig?: RetryConfig;
|
|
144
|
+
/**
|
|
145
|
+
* Required, except when used with UpdateJob. Describes the schedule on which the job will be executed. The schedule can be either of the following types: *
|
|
146
|
+
* [Crontab](https://en.wikipedia.org/wiki/Cron#Overview) * English-like [schedule](https://cloud.google.com/scheduler/docs/configuring/cron-job-schedules) As a general rule, execution
|
|
147
|
+
* `n + 1` of a job will not begin until execution `n` has finished. Cloud Scheduler will never allow two simultaneously outstanding executions. For example, this implies that if the
|
|
148
|
+
* `n+1`th execution is scheduled to run at 16:00 but the `n`th execution takes until 16:15, the `n+1`th execution will not start until `16:15`. A scheduled start time will be delayed
|
|
149
|
+
* if the previous execution has not ended when its scheduled time occurs. If retry_count > 0 and a job attempt fails, the job will be tried a total of retry_count times, with
|
|
150
|
+
* exponential backoff, until the next scheduled start time.
|
|
151
|
+
*/
|
|
152
|
+
schedule?: string;
|
|
153
|
+
/** Output only. The next time the job is scheduled. Note that this may be a retry of a previously failed attempt or the next execution time according to the schedule. */
|
|
154
|
+
scheduleTime?: string;
|
|
155
|
+
/** Output only. State of the job. */
|
|
156
|
+
state?: string;
|
|
157
|
+
/** Output only. The response from the target for the last attempted execution. */
|
|
158
|
+
status?: Status;
|
|
159
|
+
/**
|
|
160
|
+
* Specifies the time zone to be used in interpreting schedule. The value of this field must be a time zone name from the [tz database](http://en.wikipedia.org/wiki/Tz_database). Note
|
|
161
|
+
* that some time zones include a provision for daylight savings time. The rules for daylight saving time are determined by the chosen tz. For UTC use the string "utc". If a time zone
|
|
162
|
+
* is not specified, the default will be in UTC (also known as GMT).
|
|
163
|
+
*/
|
|
164
|
+
timeZone?: string;
|
|
165
|
+
/** Output only. The creation time of the job. */
|
|
166
|
+
userUpdateTime?: string;
|
|
167
|
+
}
|
|
168
|
+
interface ListJobsResponse {
|
|
169
|
+
/** The list of jobs. */
|
|
170
|
+
jobs?: Job[];
|
|
171
|
+
/**
|
|
172
|
+
* A token to retrieve next page of results. Pass this value in the page_token field in the subsequent call to ListJobs to retrieve the next page of results. If this is empty it
|
|
173
|
+
* indicates that there are no more results through which to paginate. The page token is valid for only 2 hours.
|
|
174
|
+
*/
|
|
175
|
+
nextPageToken?: string;
|
|
176
|
+
}
|
|
177
|
+
interface ListLocationsResponse {
|
|
178
|
+
/** A list of locations that matches the specified filter in the request. */
|
|
179
|
+
locations?: Location[];
|
|
180
|
+
/** The standard List next-page token. */
|
|
181
|
+
nextPageToken?: string;
|
|
182
|
+
}
|
|
183
|
+
interface Location {
|
|
184
|
+
/** The friendly name for this location, typically a nearby city name. For example, "Tokyo". */
|
|
185
|
+
displayName?: string;
|
|
186
|
+
/** Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"} */
|
|
187
|
+
labels?: { [P in string]: string };
|
|
188
|
+
/** The canonical id for this location. For example: `"us-east1"`. */
|
|
189
|
+
locationId?: string;
|
|
190
|
+
/** Service-specific metadata. For example the available capacity at the given location. */
|
|
191
|
+
metadata?: { [P in string]: any };
|
|
192
|
+
/** Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"` */
|
|
193
|
+
name?: string;
|
|
194
|
+
}
|
|
195
|
+
interface OAuthToken {
|
|
196
|
+
/** OAuth scope to be used for generating OAuth access token. If not specified, "https://www.googleapis.com/auth/cloud-platform" will be used. */
|
|
197
|
+
scope?: string;
|
|
198
|
+
/**
|
|
199
|
+
* [Service account email](https://cloud.google.com/iam/docs/service-accounts) to be used for generating OAuth token. The service account must be within the same project as the job.
|
|
200
|
+
* The caller must have iam.serviceAccounts.actAs permission for the service account.
|
|
201
|
+
*/
|
|
202
|
+
serviceAccountEmail?: string;
|
|
203
|
+
}
|
|
204
|
+
interface OidcToken {
|
|
205
|
+
/** Audience to be used when generating OIDC token. If not specified, the URI specified in target will be used. */
|
|
206
|
+
audience?: string;
|
|
207
|
+
/**
|
|
208
|
+
* [Service account email](https://cloud.google.com/iam/docs/service-accounts) to be used for generating OIDC token. The service account must be within the same project as the job. The
|
|
209
|
+
* caller must have iam.serviceAccounts.actAs permission for the service account.
|
|
210
|
+
*/
|
|
211
|
+
serviceAccountEmail?: string;
|
|
212
|
+
}
|
|
213
|
+
// tslint:disable-next-line:no-empty-interface
|
|
214
|
+
interface PauseJobRequest {
|
|
215
|
+
}
|
|
216
|
+
interface PubsubMessage {
|
|
217
|
+
/** Attributes for this message. If this field is empty, the message must contain non-empty data. This can be used to filter messages on the subscription. */
|
|
218
|
+
attributes?: { [P in string]: string };
|
|
219
|
+
/** The message data field. If this field is empty, the message must contain at least one attribute. */
|
|
220
|
+
data?: string;
|
|
221
|
+
/**
|
|
222
|
+
* ID of this message, assigned by the server when the message is published. Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a
|
|
223
|
+
* `PubsubMessage` via a `Pull` call or a push delivery. It must not be populated by the publisher in a `Publish` call.
|
|
224
|
+
*/
|
|
225
|
+
messageId?: string;
|
|
226
|
+
/**
|
|
227
|
+
* If non-empty, identifies related messages for which publish order should be respected. If a `Subscription` has `enable_message_ordering` set to `true`, messages published with the
|
|
228
|
+
* same non-empty `ordering_key` value will be delivered to subscribers in the order in which they are received by the Pub/Sub system. All `PubsubMessage`s published in a given
|
|
229
|
+
* `PublishRequest` must specify the same `ordering_key` value. For more information, see [ordering messages](https://cloud.google.com/pubsub/docs/ordering).
|
|
230
|
+
*/
|
|
231
|
+
orderingKey?: string;
|
|
232
|
+
/** The time at which the message was published, populated by the server when it receives the `Publish` call. It must not be populated by the publisher in a `Publish` call. */
|
|
233
|
+
publishTime?: string;
|
|
234
|
+
}
|
|
235
|
+
interface PubsubTarget {
|
|
236
|
+
/** Attributes for PubsubMessage. Pubsub message must contain either non-empty data, or at least one attribute. */
|
|
237
|
+
attributes?: { [P in string]: string };
|
|
238
|
+
/** The message payload for PubsubMessage. Pubsub message must contain either non-empty data, or at least one attribute. */
|
|
239
|
+
data?: string;
|
|
240
|
+
/**
|
|
241
|
+
* Required. The name of the Cloud Pub/Sub topic to which messages will be published when a job is delivered. The topic name must be in the same format as required by Pub/Sub's
|
|
242
|
+
* [PublishRequest.name](https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#publishrequest), for example `projects/PROJECT_ID/topics/TOPIC_ID`. The topic must be in
|
|
243
|
+
* the same project as the Cloud Scheduler job.
|
|
244
|
+
*/
|
|
245
|
+
topicName?: string;
|
|
246
|
+
}
|
|
247
|
+
// tslint:disable-next-line:no-empty-interface
|
|
248
|
+
interface ResumeJobRequest {
|
|
249
|
+
}
|
|
250
|
+
interface RetryConfig {
|
|
251
|
+
/** The maximum amount of time to wait before retrying a job after it fails. The default value of this field is 1 hour. */
|
|
252
|
+
maxBackoffDuration?: string;
|
|
253
|
+
/**
|
|
254
|
+
* The time between retries will double `max_doublings` times. A job's retry interval starts at min_backoff_duration, then doubles `max_doublings` times, then increases linearly, and
|
|
255
|
+
* finally retries at intervals of max_backoff_duration up to retry_count times. For example, if min_backoff_duration is 10s, max_backoff_duration is 300s, and `max_doublings` is 3,
|
|
256
|
+
* then the a job will first be retried in 10s. The retry interval will double three times, and then increase linearly by 2^3 * 10s. Finally, the job will retry at intervals of
|
|
257
|
+
* max_backoff_duration until the job has been attempted retry_count times. Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, .... The default value of this
|
|
258
|
+
* field is 5.
|
|
259
|
+
*/
|
|
260
|
+
maxDoublings?: number;
|
|
261
|
+
/**
|
|
262
|
+
* The time limit for retrying a failed job, measured from time when an execution was first attempted. If specified with retry_count, the job will be retried until both limits are
|
|
263
|
+
* reached. The default value for max_retry_duration is zero, which means retry duration is unlimited.
|
|
264
|
+
*/
|
|
265
|
+
maxRetryDuration?: string;
|
|
266
|
+
/** The minimum amount of time to wait before retrying a job after it fails. The default value of this field is 5 seconds. */
|
|
267
|
+
minBackoffDuration?: string;
|
|
268
|
+
/**
|
|
269
|
+
* The number of attempts that the system will make to run a job using the exponential backoff procedure described by max_doublings. The default value of retry_count is zero. If
|
|
270
|
+
* retry_count is zero, a job attempt will *not* be retried if it fails. Instead the Cloud Scheduler system will wait for the next scheduled execution time. If retry_count is set to a
|
|
271
|
+
* non-zero number then Cloud Scheduler will retry failed attempts, using exponential backoff, retry_count times, or until the next scheduled execution time, whichever comes first.
|
|
272
|
+
* Values greater than 5 and negative values are not allowed.
|
|
273
|
+
*/
|
|
274
|
+
retryCount?: number;
|
|
275
|
+
}
|
|
276
|
+
// tslint:disable-next-line:no-empty-interface
|
|
277
|
+
interface RunJobRequest {
|
|
278
|
+
}
|
|
279
|
+
interface Status {
|
|
280
|
+
/** The status code, which should be an enum value of google.rpc.Code. */
|
|
281
|
+
code?: number;
|
|
282
|
+
/** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
|
|
283
|
+
details?: Array<{ [P in string]: any }>;
|
|
284
|
+
/**
|
|
285
|
+
* 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
|
|
286
|
+
* client.
|
|
287
|
+
*/
|
|
288
|
+
message?: string;
|
|
289
|
+
}
|
|
290
|
+
interface JobsResource {
|
|
291
|
+
/** Creates a job. */
|
|
292
|
+
create(request: {
|
|
293
|
+
/** V1 error format. */
|
|
294
|
+
"$.xgafv"?: string;
|
|
295
|
+
/** OAuth access token. */
|
|
296
|
+
access_token?: string;
|
|
297
|
+
/** Data format for response. */
|
|
298
|
+
alt?: string;
|
|
299
|
+
/** JSONP */
|
|
300
|
+
callback?: string;
|
|
301
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
302
|
+
fields?: string;
|
|
303
|
+
/** 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. */
|
|
304
|
+
key?: string;
|
|
305
|
+
/** OAuth 2.0 token for the current user. */
|
|
306
|
+
oauth_token?: string;
|
|
307
|
+
/** Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`. */
|
|
308
|
+
parent: string;
|
|
309
|
+
/** Returns response with indentations and line breaks. */
|
|
310
|
+
prettyPrint?: boolean;
|
|
311
|
+
/** 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. */
|
|
312
|
+
quotaUser?: string;
|
|
313
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
314
|
+
upload_protocol?: string;
|
|
315
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
316
|
+
uploadType?: string;
|
|
317
|
+
/** Request body */
|
|
318
|
+
resource: Job;
|
|
319
|
+
}): Request<Job>;
|
|
320
|
+
create(request: {
|
|
321
|
+
/** V1 error format. */
|
|
322
|
+
"$.xgafv"?: string;
|
|
323
|
+
/** OAuth access token. */
|
|
324
|
+
access_token?: string;
|
|
325
|
+
/** Data format for response. */
|
|
326
|
+
alt?: string;
|
|
327
|
+
/** JSONP */
|
|
328
|
+
callback?: string;
|
|
329
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
330
|
+
fields?: 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?: string;
|
|
333
|
+
/** OAuth 2.0 token for the current user. */
|
|
334
|
+
oauth_token?: string;
|
|
335
|
+
/** Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`. */
|
|
336
|
+
parent: string;
|
|
337
|
+
/** Returns response with indentations and line breaks. */
|
|
338
|
+
prettyPrint?: boolean;
|
|
339
|
+
/** 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. */
|
|
340
|
+
quotaUser?: string;
|
|
341
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
342
|
+
upload_protocol?: string;
|
|
343
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
344
|
+
uploadType?: string;
|
|
345
|
+
},
|
|
346
|
+
body: Job): Request<Job>;
|
|
347
|
+
/** Deletes a job. */
|
|
348
|
+
delete(request?: {
|
|
349
|
+
/** V1 error format. */
|
|
350
|
+
"$.xgafv"?: string;
|
|
351
|
+
/** OAuth access token. */
|
|
352
|
+
access_token?: string;
|
|
353
|
+
/** Data format for response. */
|
|
354
|
+
alt?: string;
|
|
355
|
+
/** JSONP */
|
|
356
|
+
callback?: string;
|
|
357
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
358
|
+
fields?: string;
|
|
359
|
+
/** 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. */
|
|
360
|
+
key?: string;
|
|
361
|
+
/** Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. */
|
|
362
|
+
name: string;
|
|
363
|
+
/** OAuth 2.0 token for the current user. */
|
|
364
|
+
oauth_token?: string;
|
|
365
|
+
/** Returns response with indentations and line breaks. */
|
|
366
|
+
prettyPrint?: boolean;
|
|
367
|
+
/** 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. */
|
|
368
|
+
quotaUser?: string;
|
|
369
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
370
|
+
upload_protocol?: string;
|
|
371
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
372
|
+
uploadType?: string;
|
|
373
|
+
}): Request<{}>;
|
|
374
|
+
/** Gets a job. */
|
|
375
|
+
get(request?: {
|
|
376
|
+
/** V1 error format. */
|
|
377
|
+
"$.xgafv"?: string;
|
|
378
|
+
/** OAuth access token. */
|
|
379
|
+
access_token?: string;
|
|
380
|
+
/** Data format for response. */
|
|
381
|
+
alt?: string;
|
|
382
|
+
/** JSONP */
|
|
383
|
+
callback?: string;
|
|
384
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
385
|
+
fields?: string;
|
|
386
|
+
/** 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. */
|
|
387
|
+
key?: string;
|
|
388
|
+
/** Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. */
|
|
389
|
+
name: string;
|
|
390
|
+
/** OAuth 2.0 token for the current user. */
|
|
391
|
+
oauth_token?: string;
|
|
392
|
+
/** Returns response with indentations and line breaks. */
|
|
393
|
+
prettyPrint?: boolean;
|
|
394
|
+
/** 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. */
|
|
395
|
+
quotaUser?: string;
|
|
396
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
397
|
+
upload_protocol?: string;
|
|
398
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
399
|
+
uploadType?: string;
|
|
400
|
+
}): Request<Job>;
|
|
401
|
+
/** Lists jobs. */
|
|
402
|
+
list(request?: {
|
|
403
|
+
/** V1 error format. */
|
|
404
|
+
"$.xgafv"?: string;
|
|
405
|
+
/** OAuth access token. */
|
|
406
|
+
access_token?: string;
|
|
407
|
+
/** Data format for response. */
|
|
408
|
+
alt?: string;
|
|
409
|
+
/** JSONP */
|
|
410
|
+
callback?: string;
|
|
411
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
412
|
+
fields?: string;
|
|
413
|
+
/** 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. */
|
|
414
|
+
key?: string;
|
|
415
|
+
/** OAuth 2.0 token for the current user. */
|
|
416
|
+
oauth_token?: string;
|
|
417
|
+
/**
|
|
418
|
+
* Requested page size. The maximum page size is 500. If unspecified, the page size will be the maximum. Fewer jobs than requested might be returned, even if more jobs exist; use
|
|
419
|
+
* next_page_token to determine if more jobs exist.
|
|
420
|
+
*/
|
|
421
|
+
pageSize?: number;
|
|
422
|
+
/**
|
|
423
|
+
* A token identifying a page of results the server will return. To request the first page results, page_token must be empty. To request the next page of results, page_token must
|
|
424
|
+
* be the value of next_page_token returned from the previous call to ListJobs. It is an error to switch the value of filter or order_by while iterating through pages.
|
|
425
|
+
*/
|
|
426
|
+
pageToken?: string;
|
|
427
|
+
/** Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID`. */
|
|
428
|
+
parent: string;
|
|
429
|
+
/** Returns response with indentations and line breaks. */
|
|
430
|
+
prettyPrint?: boolean;
|
|
431
|
+
/** 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. */
|
|
432
|
+
quotaUser?: string;
|
|
433
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
434
|
+
upload_protocol?: string;
|
|
435
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
436
|
+
uploadType?: string;
|
|
437
|
+
}): Request<ListJobsResponse>;
|
|
438
|
+
/**
|
|
439
|
+
* Updates a job. If successful, the updated Job is returned. If the job does not exist, `NOT_FOUND` is returned. If UpdateJob does not successfully return, it is possible for the job
|
|
440
|
+
* to be in an Job.State.UPDATE_FAILED state. A job in this state may not be executed. If this happens, retry the UpdateJob request until a successful response is received.
|
|
441
|
+
*/
|
|
442
|
+
patch(request: {
|
|
443
|
+
/** V1 error format. */
|
|
444
|
+
"$.xgafv"?: string;
|
|
445
|
+
/** OAuth access token. */
|
|
446
|
+
access_token?: string;
|
|
447
|
+
/** Data format for response. */
|
|
448
|
+
alt?: string;
|
|
449
|
+
/** JSONP */
|
|
450
|
+
callback?: string;
|
|
451
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
452
|
+
fields?: string;
|
|
453
|
+
/** 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. */
|
|
454
|
+
key?: string;
|
|
455
|
+
/**
|
|
456
|
+
* Optionally caller-specified in CreateJob, after which it becomes output only. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. * `PROJECT_ID`
|
|
457
|
+
* can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more information, see [Identifying
|
|
458
|
+
* projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) * `LOCATION_ID` is the canonical ID for the job's location. The list of
|
|
459
|
+
* available locations can be obtained by calling ListLocations. For more information, see https://cloud.google.com/about/locations/. * `JOB_ID` can contain only letters
|
|
460
|
+
* ([A-Za-z]), numbers ([0-9]), hyphens (-), or underscores (_). The maximum length is 500 characters.
|
|
461
|
+
*/
|
|
462
|
+
name: string;
|
|
463
|
+
/** OAuth 2.0 token for the current user. */
|
|
464
|
+
oauth_token?: string;
|
|
465
|
+
/** Returns response with indentations and line breaks. */
|
|
466
|
+
prettyPrint?: boolean;
|
|
467
|
+
/** 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. */
|
|
468
|
+
quotaUser?: string;
|
|
469
|
+
/** A mask used to specify which fields of the job are being updated. */
|
|
470
|
+
updateMask?: string;
|
|
471
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
472
|
+
upload_protocol?: string;
|
|
473
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
474
|
+
uploadType?: string;
|
|
475
|
+
/** Request body */
|
|
476
|
+
resource: Job;
|
|
477
|
+
}): Request<Job>;
|
|
478
|
+
patch(request: {
|
|
479
|
+
/** V1 error format. */
|
|
480
|
+
"$.xgafv"?: string;
|
|
481
|
+
/** OAuth access token. */
|
|
482
|
+
access_token?: string;
|
|
483
|
+
/** Data format for response. */
|
|
484
|
+
alt?: string;
|
|
485
|
+
/** JSONP */
|
|
486
|
+
callback?: string;
|
|
487
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
488
|
+
fields?: string;
|
|
489
|
+
/** 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. */
|
|
490
|
+
key?: string;
|
|
491
|
+
/**
|
|
492
|
+
* Optionally caller-specified in CreateJob, after which it becomes output only. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. * `PROJECT_ID`
|
|
493
|
+
* can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more information, see [Identifying
|
|
494
|
+
* projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) * `LOCATION_ID` is the canonical ID for the job's location. The list of
|
|
495
|
+
* available locations can be obtained by calling ListLocations. For more information, see https://cloud.google.com/about/locations/. * `JOB_ID` can contain only letters
|
|
496
|
+
* ([A-Za-z]), numbers ([0-9]), hyphens (-), or underscores (_). The maximum length is 500 characters.
|
|
497
|
+
*/
|
|
498
|
+
name: string;
|
|
499
|
+
/** OAuth 2.0 token for the current user. */
|
|
500
|
+
oauth_token?: string;
|
|
501
|
+
/** Returns response with indentations and line breaks. */
|
|
502
|
+
prettyPrint?: boolean;
|
|
503
|
+
/** 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. */
|
|
504
|
+
quotaUser?: string;
|
|
505
|
+
/** A mask used to specify which fields of the job are being updated. */
|
|
506
|
+
updateMask?: string;
|
|
507
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
508
|
+
upload_protocol?: string;
|
|
509
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
510
|
+
uploadType?: string;
|
|
511
|
+
},
|
|
512
|
+
body: Job): Request<Job>;
|
|
513
|
+
/**
|
|
514
|
+
* Pauses a job. If a job is paused then the system will stop executing the job until it is re-enabled via ResumeJob. The state of the job is stored in state; if paused it will be set
|
|
515
|
+
* to Job.State.PAUSED. A job must be in Job.State.ENABLED to be paused.
|
|
516
|
+
*/
|
|
517
|
+
pause(request: {
|
|
518
|
+
/** V1 error format. */
|
|
519
|
+
"$.xgafv"?: string;
|
|
520
|
+
/** OAuth access token. */
|
|
521
|
+
access_token?: string;
|
|
522
|
+
/** Data format for response. */
|
|
523
|
+
alt?: string;
|
|
524
|
+
/** JSONP */
|
|
525
|
+
callback?: string;
|
|
526
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
527
|
+
fields?: string;
|
|
528
|
+
/** 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. */
|
|
529
|
+
key?: string;
|
|
530
|
+
/** Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. */
|
|
531
|
+
name: string;
|
|
532
|
+
/** OAuth 2.0 token for the current user. */
|
|
533
|
+
oauth_token?: string;
|
|
534
|
+
/** Returns response with indentations and line breaks. */
|
|
535
|
+
prettyPrint?: boolean;
|
|
536
|
+
/** 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. */
|
|
537
|
+
quotaUser?: string;
|
|
538
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
539
|
+
upload_protocol?: string;
|
|
540
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
541
|
+
uploadType?: string;
|
|
542
|
+
/** Request body */
|
|
543
|
+
resource: PauseJobRequest;
|
|
544
|
+
}): Request<Job>;
|
|
545
|
+
pause(request: {
|
|
546
|
+
/** V1 error format. */
|
|
547
|
+
"$.xgafv"?: string;
|
|
548
|
+
/** OAuth access token. */
|
|
549
|
+
access_token?: string;
|
|
550
|
+
/** Data format for response. */
|
|
551
|
+
alt?: string;
|
|
552
|
+
/** JSONP */
|
|
553
|
+
callback?: string;
|
|
554
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
555
|
+
fields?: string;
|
|
556
|
+
/** 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. */
|
|
557
|
+
key?: string;
|
|
558
|
+
/** Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. */
|
|
559
|
+
name: string;
|
|
560
|
+
/** OAuth 2.0 token for the current user. */
|
|
561
|
+
oauth_token?: string;
|
|
562
|
+
/** Returns response with indentations and line breaks. */
|
|
563
|
+
prettyPrint?: boolean;
|
|
564
|
+
/** 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. */
|
|
565
|
+
quotaUser?: string;
|
|
566
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
567
|
+
upload_protocol?: string;
|
|
568
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
569
|
+
uploadType?: string;
|
|
570
|
+
},
|
|
571
|
+
body: PauseJobRequest): Request<Job>;
|
|
572
|
+
/**
|
|
573
|
+
* Resume a job. This method reenables a job after it has been Job.State.PAUSED. The state of a job is stored in Job.state; after calling this method it will be set to
|
|
574
|
+
* Job.State.ENABLED. A job must be in Job.State.PAUSED to be resumed.
|
|
575
|
+
*/
|
|
576
|
+
resume(request: {
|
|
577
|
+
/** V1 error format. */
|
|
578
|
+
"$.xgafv"?: string;
|
|
579
|
+
/** OAuth access token. */
|
|
580
|
+
access_token?: string;
|
|
581
|
+
/** Data format for response. */
|
|
582
|
+
alt?: string;
|
|
583
|
+
/** JSONP */
|
|
584
|
+
callback?: string;
|
|
585
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
586
|
+
fields?: string;
|
|
587
|
+
/** 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. */
|
|
588
|
+
key?: string;
|
|
589
|
+
/** Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. */
|
|
590
|
+
name: string;
|
|
591
|
+
/** OAuth 2.0 token for the current user. */
|
|
592
|
+
oauth_token?: string;
|
|
593
|
+
/** Returns response with indentations and line breaks. */
|
|
594
|
+
prettyPrint?: boolean;
|
|
595
|
+
/** 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. */
|
|
596
|
+
quotaUser?: string;
|
|
597
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
598
|
+
upload_protocol?: string;
|
|
599
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
600
|
+
uploadType?: string;
|
|
601
|
+
/** Request body */
|
|
602
|
+
resource: ResumeJobRequest;
|
|
603
|
+
}): Request<Job>;
|
|
604
|
+
resume(request: {
|
|
605
|
+
/** V1 error format. */
|
|
606
|
+
"$.xgafv"?: string;
|
|
607
|
+
/** OAuth access token. */
|
|
608
|
+
access_token?: string;
|
|
609
|
+
/** Data format for response. */
|
|
610
|
+
alt?: string;
|
|
611
|
+
/** JSONP */
|
|
612
|
+
callback?: string;
|
|
613
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
614
|
+
fields?: string;
|
|
615
|
+
/** 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. */
|
|
616
|
+
key?: string;
|
|
617
|
+
/** Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. */
|
|
618
|
+
name: string;
|
|
619
|
+
/** OAuth 2.0 token for the current user. */
|
|
620
|
+
oauth_token?: string;
|
|
621
|
+
/** Returns response with indentations and line breaks. */
|
|
622
|
+
prettyPrint?: boolean;
|
|
623
|
+
/** 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. */
|
|
624
|
+
quotaUser?: string;
|
|
625
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
626
|
+
upload_protocol?: string;
|
|
627
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
628
|
+
uploadType?: string;
|
|
629
|
+
},
|
|
630
|
+
body: ResumeJobRequest): Request<Job>;
|
|
631
|
+
/** Forces a job to run now. When this method is called, Cloud Scheduler will dispatch the job, even if the job is already running. */
|
|
632
|
+
run(request: {
|
|
633
|
+
/** V1 error format. */
|
|
634
|
+
"$.xgafv"?: string;
|
|
635
|
+
/** OAuth access token. */
|
|
636
|
+
access_token?: string;
|
|
637
|
+
/** Data format for response. */
|
|
638
|
+
alt?: string;
|
|
639
|
+
/** JSONP */
|
|
640
|
+
callback?: string;
|
|
641
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
642
|
+
fields?: string;
|
|
643
|
+
/** 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. */
|
|
644
|
+
key?: string;
|
|
645
|
+
/** Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. */
|
|
646
|
+
name: string;
|
|
647
|
+
/** OAuth 2.0 token for the current user. */
|
|
648
|
+
oauth_token?: string;
|
|
649
|
+
/** Returns response with indentations and line breaks. */
|
|
650
|
+
prettyPrint?: boolean;
|
|
651
|
+
/** 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. */
|
|
652
|
+
quotaUser?: string;
|
|
653
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
654
|
+
upload_protocol?: string;
|
|
655
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
656
|
+
uploadType?: string;
|
|
657
|
+
/** Request body */
|
|
658
|
+
resource: RunJobRequest;
|
|
659
|
+
}): Request<Job>;
|
|
660
|
+
run(request: {
|
|
661
|
+
/** V1 error format. */
|
|
662
|
+
"$.xgafv"?: string;
|
|
663
|
+
/** OAuth access token. */
|
|
664
|
+
access_token?: string;
|
|
665
|
+
/** Data format for response. */
|
|
666
|
+
alt?: string;
|
|
667
|
+
/** JSONP */
|
|
668
|
+
callback?: string;
|
|
669
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
670
|
+
fields?: string;
|
|
671
|
+
/** 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. */
|
|
672
|
+
key?: string;
|
|
673
|
+
/** Required. The job name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`. */
|
|
674
|
+
name: string;
|
|
675
|
+
/** OAuth 2.0 token for the current user. */
|
|
676
|
+
oauth_token?: string;
|
|
677
|
+
/** Returns response with indentations and line breaks. */
|
|
678
|
+
prettyPrint?: boolean;
|
|
679
|
+
/** 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. */
|
|
680
|
+
quotaUser?: string;
|
|
681
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
682
|
+
upload_protocol?: string;
|
|
683
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
684
|
+
uploadType?: string;
|
|
685
|
+
},
|
|
686
|
+
body: RunJobRequest): Request<Job>;
|
|
687
|
+
}
|
|
688
|
+
interface LocationsResource {
|
|
689
|
+
/** Gets information about a location. */
|
|
690
|
+
get(request?: {
|
|
691
|
+
/** V1 error format. */
|
|
692
|
+
"$.xgafv"?: string;
|
|
693
|
+
/** OAuth access token. */
|
|
694
|
+
access_token?: string;
|
|
695
|
+
/** Data format for response. */
|
|
696
|
+
alt?: string;
|
|
697
|
+
/** JSONP */
|
|
698
|
+
callback?: string;
|
|
699
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
700
|
+
fields?: string;
|
|
701
|
+
/** 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. */
|
|
702
|
+
key?: string;
|
|
703
|
+
/** Resource name for the location. */
|
|
704
|
+
name: string;
|
|
705
|
+
/** OAuth 2.0 token for the current user. */
|
|
706
|
+
oauth_token?: string;
|
|
707
|
+
/** Returns response with indentations and line breaks. */
|
|
708
|
+
prettyPrint?: boolean;
|
|
709
|
+
/** 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. */
|
|
710
|
+
quotaUser?: string;
|
|
711
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
712
|
+
upload_protocol?: string;
|
|
713
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
714
|
+
uploadType?: string;
|
|
715
|
+
}): Request<Location>;
|
|
716
|
+
/** Lists information about the supported locations for this service. */
|
|
717
|
+
list(request?: {
|
|
718
|
+
/** V1 error format. */
|
|
719
|
+
"$.xgafv"?: string;
|
|
720
|
+
/** OAuth access token. */
|
|
721
|
+
access_token?: string;
|
|
722
|
+
/** Data format for response. */
|
|
723
|
+
alt?: string;
|
|
724
|
+
/** JSONP */
|
|
725
|
+
callback?: string;
|
|
726
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
727
|
+
fields?: string;
|
|
728
|
+
/**
|
|
729
|
+
* 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
|
|
730
|
+
* [AIP-160](https://google.aip.dev/160).
|
|
731
|
+
*/
|
|
732
|
+
filter?: string;
|
|
733
|
+
/** 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. */
|
|
734
|
+
key?: string;
|
|
735
|
+
/** The resource that owns the locations collection, if applicable. */
|
|
736
|
+
name: string;
|
|
737
|
+
/** OAuth 2.0 token for the current user. */
|
|
738
|
+
oauth_token?: string;
|
|
739
|
+
/** The maximum number of results to return. If not set, the service selects a default. */
|
|
740
|
+
pageSize?: number;
|
|
741
|
+
/** A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page. */
|
|
742
|
+
pageToken?: string;
|
|
743
|
+
/** Returns response with indentations and line breaks. */
|
|
744
|
+
prettyPrint?: boolean;
|
|
745
|
+
/** 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. */
|
|
746
|
+
quotaUser?: string;
|
|
747
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
748
|
+
upload_protocol?: string;
|
|
749
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
750
|
+
uploadType?: string;
|
|
751
|
+
}): Request<ListLocationsResponse>;
|
|
752
|
+
jobs: JobsResource;
|
|
753
|
+
}
|
|
754
|
+
interface ProjectsResource {
|
|
755
|
+
locations: LocationsResource;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
const projects: ProjectsResource;
|
|
759
|
+
}
|
|
760
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.cloudscheduler-v1",
|
|
3
|
+
"version": "0.0.20220802",
|
|
4
|
+
"description": "TypeScript typings for Cloud Scheduler API v1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"email": "maxim@mazurok.com",
|
|
8
|
+
"name": "Maxim Mazurok",
|
|
9
|
+
"url": "https://maxim.mazurok.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
14
|
+
},
|
|
15
|
+
"types": "index.d.ts",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/gapi.client": "*",
|
|
18
|
+
"@types/gapi.client.discovery": "*"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# TypeScript typings for Cloud Scheduler API v1
|
|
2
|
+
|
|
3
|
+
Creates and manages jobs run on a regular recurring schedule.
|
|
4
|
+
For detailed description please check [documentation](https://cloud.google.com/scheduler/).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Cloud Scheduler API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.cloudscheduler-v1 --save-dev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
You need to initialize Google API client in your code:
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
gapi.load('client', () => {
|
|
20
|
+
// now we can use gapi.client
|
|
21
|
+
// ...
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then load api client wrapper:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
gapi.client.load('https://cloudscheduler.googleapis.com/$discovery/rest?version=v1', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.cloudscheduler
|
|
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('cloudscheduler', 'v1', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.cloudscheduler
|
|
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 Cloud Scheduler API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.cloudscheduler-v1 definition tests */
|
|
2
|
+
// IMPORTANT
|
|
3
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
4
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
5
|
+
|
|
6
|
+
// Revision: 20220802
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://cloudscheduler.googleapis.com/$discovery/rest?version=v1');
|
|
12
|
+
/** now we can use gapi.client.cloudscheduler */
|
|
13
|
+
|
|
14
|
+
/** don't forget to authenticate your client before sending any request to resources: */
|
|
15
|
+
/** declare client_id registered in Google Developers Console */
|
|
16
|
+
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
|
17
|
+
const scope = [
|
|
18
|
+
/** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */
|
|
19
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
20
|
+
];
|
|
21
|
+
const immediate = false;
|
|
22
|
+
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
|
23
|
+
if (authResult && !authResult.error) {
|
|
24
|
+
/** handle successful authorization */
|
|
25
|
+
run();
|
|
26
|
+
} else {
|
|
27
|
+
/** handle authorization error */
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
async function run() {
|
|
32
|
+
/** Gets information about a location. */
|
|
33
|
+
await gapi.client.cloudscheduler.projects.locations.get({
|
|
34
|
+
name: "Test string",
|
|
35
|
+
});
|
|
36
|
+
/** Lists information about the supported locations for this service. */
|
|
37
|
+
await gapi.client.cloudscheduler.projects.locations.list({
|
|
38
|
+
filter: "Test string",
|
|
39
|
+
name: "Test string",
|
|
40
|
+
pageSize: 42,
|
|
41
|
+
pageToken: "Test string",
|
|
42
|
+
});
|
|
43
|
+
/** Creates a job. */
|
|
44
|
+
await gapi.client.cloudscheduler.projects.locations.jobs.create({
|
|
45
|
+
parent: "Test string",
|
|
46
|
+
}, {
|
|
47
|
+
appEngineHttpTarget: {
|
|
48
|
+
appEngineRouting: {
|
|
49
|
+
host: "Test string",
|
|
50
|
+
instance: "Test string",
|
|
51
|
+
service: "Test string",
|
|
52
|
+
version: "Test string",
|
|
53
|
+
},
|
|
54
|
+
body: "Test string",
|
|
55
|
+
headers: {
|
|
56
|
+
A: "Test string"
|
|
57
|
+
},
|
|
58
|
+
httpMethod: "Test string",
|
|
59
|
+
relativeUri: "Test string",
|
|
60
|
+
},
|
|
61
|
+
attemptDeadline: "Test string",
|
|
62
|
+
description: "Test string",
|
|
63
|
+
httpTarget: {
|
|
64
|
+
body: "Test string",
|
|
65
|
+
headers: {
|
|
66
|
+
A: "Test string"
|
|
67
|
+
},
|
|
68
|
+
httpMethod: "Test string",
|
|
69
|
+
oauthToken: {
|
|
70
|
+
scope: "Test string",
|
|
71
|
+
serviceAccountEmail: "Test string",
|
|
72
|
+
},
|
|
73
|
+
oidcToken: {
|
|
74
|
+
audience: "Test string",
|
|
75
|
+
serviceAccountEmail: "Test string",
|
|
76
|
+
},
|
|
77
|
+
uri: "Test string",
|
|
78
|
+
},
|
|
79
|
+
lastAttemptTime: "Test string",
|
|
80
|
+
name: "Test string",
|
|
81
|
+
pubsubTarget: {
|
|
82
|
+
attributes: {
|
|
83
|
+
A: "Test string"
|
|
84
|
+
},
|
|
85
|
+
data: "Test string",
|
|
86
|
+
topicName: "Test string",
|
|
87
|
+
},
|
|
88
|
+
retryConfig: {
|
|
89
|
+
maxBackoffDuration: "Test string",
|
|
90
|
+
maxDoublings: 42,
|
|
91
|
+
maxRetryDuration: "Test string",
|
|
92
|
+
minBackoffDuration: "Test string",
|
|
93
|
+
retryCount: 42,
|
|
94
|
+
},
|
|
95
|
+
schedule: "Test string",
|
|
96
|
+
scheduleTime: "Test string",
|
|
97
|
+
state: "Test string",
|
|
98
|
+
status: {
|
|
99
|
+
code: 42,
|
|
100
|
+
details: [
|
|
101
|
+
{
|
|
102
|
+
A: 42
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
message: "Test string",
|
|
106
|
+
},
|
|
107
|
+
timeZone: "Test string",
|
|
108
|
+
userUpdateTime: "Test string",
|
|
109
|
+
});
|
|
110
|
+
/** Deletes a job. */
|
|
111
|
+
await gapi.client.cloudscheduler.projects.locations.jobs.delete({
|
|
112
|
+
name: "Test string",
|
|
113
|
+
});
|
|
114
|
+
/** Gets a job. */
|
|
115
|
+
await gapi.client.cloudscheduler.projects.locations.jobs.get({
|
|
116
|
+
name: "Test string",
|
|
117
|
+
});
|
|
118
|
+
/** Lists jobs. */
|
|
119
|
+
await gapi.client.cloudscheduler.projects.locations.jobs.list({
|
|
120
|
+
pageSize: 42,
|
|
121
|
+
pageToken: "Test string",
|
|
122
|
+
parent: "Test string",
|
|
123
|
+
});
|
|
124
|
+
/**
|
|
125
|
+
* Updates a job. If successful, the updated Job is returned. If the job does not exist, `NOT_FOUND` is returned. If UpdateJob does not successfully return, it is possible for the job to
|
|
126
|
+
* be in an Job.State.UPDATE_FAILED state. A job in this state may not be executed. If this happens, retry the UpdateJob request until a successful response is received.
|
|
127
|
+
*/
|
|
128
|
+
await gapi.client.cloudscheduler.projects.locations.jobs.patch({
|
|
129
|
+
name: "Test string",
|
|
130
|
+
updateMask: "Test string",
|
|
131
|
+
}, {
|
|
132
|
+
appEngineHttpTarget: {
|
|
133
|
+
appEngineRouting: {
|
|
134
|
+
host: "Test string",
|
|
135
|
+
instance: "Test string",
|
|
136
|
+
service: "Test string",
|
|
137
|
+
version: "Test string",
|
|
138
|
+
},
|
|
139
|
+
body: "Test string",
|
|
140
|
+
headers: {
|
|
141
|
+
A: "Test string"
|
|
142
|
+
},
|
|
143
|
+
httpMethod: "Test string",
|
|
144
|
+
relativeUri: "Test string",
|
|
145
|
+
},
|
|
146
|
+
attemptDeadline: "Test string",
|
|
147
|
+
description: "Test string",
|
|
148
|
+
httpTarget: {
|
|
149
|
+
body: "Test string",
|
|
150
|
+
headers: {
|
|
151
|
+
A: "Test string"
|
|
152
|
+
},
|
|
153
|
+
httpMethod: "Test string",
|
|
154
|
+
oauthToken: {
|
|
155
|
+
scope: "Test string",
|
|
156
|
+
serviceAccountEmail: "Test string",
|
|
157
|
+
},
|
|
158
|
+
oidcToken: {
|
|
159
|
+
audience: "Test string",
|
|
160
|
+
serviceAccountEmail: "Test string",
|
|
161
|
+
},
|
|
162
|
+
uri: "Test string",
|
|
163
|
+
},
|
|
164
|
+
lastAttemptTime: "Test string",
|
|
165
|
+
name: "Test string",
|
|
166
|
+
pubsubTarget: {
|
|
167
|
+
attributes: {
|
|
168
|
+
A: "Test string"
|
|
169
|
+
},
|
|
170
|
+
data: "Test string",
|
|
171
|
+
topicName: "Test string",
|
|
172
|
+
},
|
|
173
|
+
retryConfig: {
|
|
174
|
+
maxBackoffDuration: "Test string",
|
|
175
|
+
maxDoublings: 42,
|
|
176
|
+
maxRetryDuration: "Test string",
|
|
177
|
+
minBackoffDuration: "Test string",
|
|
178
|
+
retryCount: 42,
|
|
179
|
+
},
|
|
180
|
+
schedule: "Test string",
|
|
181
|
+
scheduleTime: "Test string",
|
|
182
|
+
state: "Test string",
|
|
183
|
+
status: {
|
|
184
|
+
code: 42,
|
|
185
|
+
details: [
|
|
186
|
+
{
|
|
187
|
+
A: 42
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
message: "Test string",
|
|
191
|
+
},
|
|
192
|
+
timeZone: "Test string",
|
|
193
|
+
userUpdateTime: "Test string",
|
|
194
|
+
});
|
|
195
|
+
/**
|
|
196
|
+
* Pauses a job. If a job is paused then the system will stop executing the job until it is re-enabled via ResumeJob. The state of the job is stored in state; if paused it will be set to
|
|
197
|
+
* Job.State.PAUSED. A job must be in Job.State.ENABLED to be paused.
|
|
198
|
+
*/
|
|
199
|
+
await gapi.client.cloudscheduler.projects.locations.jobs.pause({
|
|
200
|
+
name: "Test string",
|
|
201
|
+
}, {
|
|
202
|
+
});
|
|
203
|
+
/**
|
|
204
|
+
* Resume a job. This method reenables a job after it has been Job.State.PAUSED. The state of a job is stored in Job.state; after calling this method it will be set to Job.State.ENABLED. A
|
|
205
|
+
* job must be in Job.State.PAUSED to be resumed.
|
|
206
|
+
*/
|
|
207
|
+
await gapi.client.cloudscheduler.projects.locations.jobs.resume({
|
|
208
|
+
name: "Test string",
|
|
209
|
+
}, {
|
|
210
|
+
});
|
|
211
|
+
/** Forces a job to run now. When this method is called, Cloud Scheduler will dispatch the job, even if the job is already running. */
|
|
212
|
+
await gapi.client.cloudscheduler.projects.locations.jobs.run({
|
|
213
|
+
name: "Test string",
|
|
214
|
+
}, {
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
});
|
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
|
+
}
|