@maxim_mazurok/gapi.client.cloudtasks-v2beta3 0.0.20221208 → 0.0.20230201

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.d.ts +155 -14
  2. package/package.json +1 -1
  3. package/tests.ts +67 -1
package/index.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
10
10
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
11
11
  // Generated from: https://cloudtasks.googleapis.com/$discovery/rest?version=v2beta3
12
- // Revision: 20221208
12
+ // Revision: 20230201
13
13
 
14
14
  /// <reference types="gapi.client" />
15
15
 
@@ -117,19 +117,27 @@ declare namespace gapi.client {
117
117
  * Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example,
118
118
  * `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service
119
119
  * account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
120
- * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
121
- * identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to
122
- * `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing
123
- * a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value
124
- * reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
125
- * identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to
126
- * `group:{emailid}` and the recovered group retains the role in the binding. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For
127
- * example, `google.com` or `example.com`.
120
+ * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the
121
+ * users of that domain. For example, `google.com` or `example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has
122
+ * been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains
123
+ * the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently
124
+ * deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and
125
+ * the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that
126
+ * has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group
127
+ * retains the role in the binding.
128
128
  */
129
129
  members?: string[];
130
130
  /** Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. */
131
131
  role?: string;
132
132
  }
133
+ interface BufferTaskRequest {
134
+ /** Optional. Body of the HTTP request. The body can take any generic value. The value is written to the HttpRequest of the [Task]. */
135
+ body?: HttpBody;
136
+ }
137
+ interface BufferTaskResponse {
138
+ /** The created task. */
139
+ task?: Task;
140
+ }
133
141
  interface CreateTaskRequest {
134
142
  /**
135
143
  * The response_view specifies which subset of the Task will be returned. By default response_view is BASIC; not all information is retrieved by default because some data, such as
@@ -177,16 +185,35 @@ declare namespace gapi.client {
177
185
  */
178
186
  requestedPolicyVersion?: number;
179
187
  }
188
+ interface Header {
189
+ /** The Key of the header. */
190
+ key?: string;
191
+ /** The Value of the header. */
192
+ value?: string;
193
+ }
194
+ interface HeaderOverride {
195
+ /** header embodying a key and a value. */
196
+ header?: Header;
197
+ }
198
+ interface HttpBody {
199
+ /** The HTTP Content-Type header value specifying the content type of the body. */
200
+ contentType?: string;
201
+ /** The HTTP request/response body as raw binary. */
202
+ data?: string;
203
+ /** Application specific response metadata. Must be set in the first response for streaming APIs. */
204
+ extensions?: Array<{ [P in string]: any }>;
205
+ }
180
206
  interface HttpRequest {
181
207
  /** 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 task with an incompatible HttpMethod. */
182
208
  body?: string;
183
209
  /**
184
210
  * HTTP request headers. This map contains the header field names and values. Headers can be set when the task is created. These headers represent a subset of the headers that will
185
- * accompany the task's HTTP request. Some HTTP request headers will be ignored or replaced. A partial list of headers that will be ignored or replaced is: * Host: This will be
186
- * computed by Cloud Tasks and derived from HttpRequest.url. * Content-Length: This will be computed by Cloud Tasks. * User-Agent: This will be set to `"Google-Cloud-Tasks"`. *
187
- * `X-Google-*`: Google use only. * `X-AppEngine-*`: Google use only. `Content-Type` won't be set by Cloud Tasks. You can explicitly set `Content-Type` to a media type when the task is
188
- * created. For example, `Content-Type` can be set to `"application/octet-stream"` or `"application/json"`. Headers which can have multiple values (according to RFC2616) can be
189
- * specified using comma-separated values. The size of the headers must be less than 80KB.
211
+ * accompany the task's HTTP request. Some HTTP request headers will be ignored or replaced. A partial list of headers that will be ignored or replaced is: * Any header that is
212
+ * prefixed with "X-CloudTasks-" will be treated as service header. Service headers define properties of the task and are predefined in CloudTask. * Host: This will be computed by
213
+ * Cloud Tasks and derived from HttpRequest.url. * Content-Length: This will be computed by Cloud Tasks. * User-Agent: This will be set to `"Google-Cloud-Tasks"`. * `X-Google-*`:
214
+ * Google use only. * `X-AppEngine-*`: Google use only. `Content-Type` won't be set by Cloud Tasks. You can explicitly set `Content-Type` to a media type when the task is created. For
215
+ * example, `Content-Type` can be set to `"application/octet-stream"` or `"application/json"`. Headers which can have multiple values (according to RFC2616) can be specified using
216
+ * comma-separated values. The size of the headers must be less than 80KB.
190
217
  */
191
218
  headers?: { [P in string]: string };
192
219
  /** The HTTP method to use for the request. The default is POST. */
@@ -208,6 +235,25 @@ declare namespace gapi.client {
208
235
  */
209
236
  url?: string;
210
237
  }
238
+ interface HttpTarget {
239
+ /**
240
+ * HTTP target headers. This map contains the header field names and values. Headers will be set when running the CreateTask and/or BufferTask. These headers represent a subset of the
241
+ * headers that will be configured for the task's HTTP request. Some HTTP request headers will be ignored or replaced. A partial list of headers that will be ignored or replaced is: *
242
+ * Several predefined headers, prefixed with "X-CloudTasks-", can be used to define properties of the task. * Host: This will be computed by Cloud Tasks and derived from
243
+ * HttpRequest.url. * Content-Length: This will be computed by Cloud Tasks. `Content-Type` won't be set by Cloud Tasks. You can explicitly set `Content-Type` to a media type when the
244
+ * task is created. For example,`Content-Type` can be set to `"application/octet-stream"` or `"application/json"`. The default value is set to "application/json"`. * User-Agent: This
245
+ * will be set to `"Google-Cloud-Tasks"`. Headers which can have multiple values (according to RFC2616) can be specified using comma-separated values. The size of the headers must be
246
+ * less than 80KB. Queue-level headers to override headers of all the tasks in the queue.
247
+ */
248
+ headerOverrides?: HeaderOverride[];
249
+ /**
250
+ * The HTTP method to use for the request. When specified, it will override HttpRequest for the task. Note that if the value is set to HttpMethod the HttpRequest of the task will be
251
+ * ignored at execution time.
252
+ */
253
+ httpMethod?: string;
254
+ /** URI override. When specified, modifies the execution URI for all the tasks in the queue. */
255
+ uriOverride?: UriOverride;
256
+ }
211
257
  interface ListLocationsResponse {
212
258
  /** A list of locations that matches the specified filter in the request. */
213
259
  locations?: Location[];
@@ -262,6 +308,10 @@ declare namespace gapi.client {
262
308
  */
263
309
  serviceAccountEmail?: string;
264
310
  }
311
+ interface PathOverride {
312
+ /** The URI path (e.g., a/b/c). Default is Empty string. */
313
+ path?: string;
314
+ }
265
315
  // tslint:disable-next-line:no-empty-interface
266
316
  interface PauseQueueRequest {
267
317
  }
@@ -304,9 +354,15 @@ declare namespace gapi.client {
304
354
  // tslint:disable-next-line:no-empty-interface
305
355
  interface PurgeQueueRequest {
306
356
  }
357
+ interface QueryOverride {
358
+ /** The query parameters (e.g., qparam1=123&qparam2=456). Default is Empty string. */
359
+ queryParams?: string;
360
+ }
307
361
  interface Queue {
308
362
  /** AppEngineHttpQueue settings apply only to App Engine tasks in this queue. Http tasks are not affected by this proto. */
309
363
  appEngineHttpQueue?: AppEngineHttpQueue;
364
+ /** Modifies HTTP target for HTTP tasks. */
365
+ httpTarget?: HttpTarget;
310
366
  /**
311
367
  * Caller-specified and required in CreateQueue, after which it becomes output only. The queue name. The queue name must have the following format:
312
368
  * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more
@@ -538,7 +594,92 @@ declare namespace gapi.client {
538
594
  /** A subset of `TestPermissionsRequest.permissions` that the caller is allowed. */
539
595
  permissions?: string[];
540
596
  }
597
+ interface UriOverride {
598
+ /**
599
+ * Host override. When specified, will replace the host part of the task URL. For example, if the task URL is "https://www.google.com", and host value is set to "example.net", the
600
+ * overridden URI will be changed to "https://example.net". Host value cannot be an empty string.
601
+ */
602
+ host?: string;
603
+ /** URI path. When specified, will replace the existing path of the task URL. Setting the path value to an empty string clears the URI path segment. */
604
+ pathOverride?: PathOverride;
605
+ /**
606
+ * Port override. When specified, will replace the port part of the task URI. For instance, for a URI http://www.google.com/foo and port=123, the overridden URI becomes
607
+ * http://www.google.com:123/foo. Note that the port value must be a positive integer. Setting the port to 0 (Zero) clears the URI port.
608
+ */
609
+ port?: string;
610
+ /** URI Query. When specified, will replace the query part of the task URI. Setting the query value to an empty string clears the URI query segment. */
611
+ queryOverride?: QueryOverride;
612
+ /** Scheme override. When specified, the task URI scheme is replaced by the provided value (HTTP or HTTPS). */
613
+ scheme?: string;
614
+ /** URI Override Enforce Mode When specified, determines the Target UriOverride mode. If not specified, it defaults to ALWAYS. */
615
+ uriOverrideEnforceMode?: string;
616
+ }
541
617
  interface TasksResource {
618
+ /**
619
+ * Creates and buffers a new task without the need to explicitly define a Task message. The queue must have HTTP target. To create the task with a custom ID, use the following format
620
+ * and set TASK_ID to your desired ID: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer To create the task with an automatically generated ID, use the
621
+ * following format: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. Note: This feature is in its experimental stage. You must request access to the API through
622
+ * the [Cloud Tasks BufferTask Experiment Signup form](https://forms.gle/X8Zr5hiXH5tTGFqh8).
623
+ */
624
+ buffer(request: {
625
+ /** V1 error format. */
626
+ "$.xgafv"?: string;
627
+ /** OAuth access token. */
628
+ access_token?: string;
629
+ /** Data format for response. */
630
+ alt?: string;
631
+ /** JSONP */
632
+ callback?: string;
633
+ /** Selector specifying which fields to include in a partial response. */
634
+ fields?: string;
635
+ /** 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. */
636
+ key?: string;
637
+ /** OAuth 2.0 token for the current user. */
638
+ oauth_token?: string;
639
+ /** Returns response with indentations and line breaks. */
640
+ prettyPrint?: boolean;
641
+ /** Required. The parent queue name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist. */
642
+ queue: string;
643
+ /** 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. */
644
+ quotaUser?: string;
645
+ /** Optional. Task ID for the task being created. If not provided, a random task ID is assigned to the task. */
646
+ taskId: string;
647
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
648
+ upload_protocol?: string;
649
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
650
+ uploadType?: string;
651
+ /** Request body */
652
+ resource: BufferTaskRequest;
653
+ }): Request<BufferTaskResponse>;
654
+ buffer(request: {
655
+ /** V1 error format. */
656
+ "$.xgafv"?: string;
657
+ /** OAuth access token. */
658
+ access_token?: string;
659
+ /** Data format for response. */
660
+ alt?: string;
661
+ /** JSONP */
662
+ callback?: string;
663
+ /** Selector specifying which fields to include in a partial response. */
664
+ fields?: string;
665
+ /** 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. */
666
+ key?: string;
667
+ /** OAuth 2.0 token for the current user. */
668
+ oauth_token?: string;
669
+ /** Returns response with indentations and line breaks. */
670
+ prettyPrint?: boolean;
671
+ /** Required. The parent queue name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist. */
672
+ queue: string;
673
+ /** 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. */
674
+ quotaUser?: string;
675
+ /** Optional. Task ID for the task being created. If not provided, a random task ID is assigned to the task. */
676
+ taskId: string;
677
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
678
+ upload_protocol?: string;
679
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
680
+ uploadType?: string;
681
+ },
682
+ body: BufferTaskRequest): Request<BufferTaskResponse>;
542
683
  /** Creates a task and adds it to a queue. Tasks cannot be updated after creation; there is no UpdateTask command. * The maximum task size is 100KB. */
543
684
  create(request: {
544
685
  /** V1 error format. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.cloudtasks-v2beta3",
3
- "version": "0.0.20221208",
3
+ "version": "0.0.20230201",
4
4
  "description": "TypeScript typings for Cloud Tasks API v2beta3",
5
5
  "license": "MIT",
6
6
  "author": {
package/tests.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
4
  // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
5
 
6
- // Revision: 20221208
6
+ // Revision: 20230201
7
7
 
8
8
  gapi.load('client', async () => {
9
9
  /** now we can use gapi.client */
@@ -56,6 +56,29 @@ gapi.load('client', async () => {
56
56
  version: "Test string",
57
57
  },
58
58
  },
59
+ httpTarget: {
60
+ headerOverrides: [
61
+ {
62
+ header: {
63
+ key: "Test string",
64
+ value: "Test string",
65
+ },
66
+ }
67
+ ],
68
+ httpMethod: "Test string",
69
+ uriOverride: {
70
+ host: "Test string",
71
+ pathOverride: {
72
+ path: "Test string",
73
+ },
74
+ port: "Test string",
75
+ queryOverride: {
76
+ queryParams: "Test string",
77
+ },
78
+ scheme: "Test string",
79
+ uriOverrideEnforceMode: "Test string",
80
+ },
81
+ },
59
82
  name: "Test string",
60
83
  purgeTime: "Test string",
61
84
  rateLimits: {
@@ -135,6 +158,29 @@ gapi.load('client', async () => {
135
158
  version: "Test string",
136
159
  },
137
160
  },
161
+ httpTarget: {
162
+ headerOverrides: [
163
+ {
164
+ header: {
165
+ key: "Test string",
166
+ value: "Test string",
167
+ },
168
+ }
169
+ ],
170
+ httpMethod: "Test string",
171
+ uriOverride: {
172
+ host: "Test string",
173
+ pathOverride: {
174
+ path: "Test string",
175
+ },
176
+ port: "Test string",
177
+ queryOverride: {
178
+ queryParams: "Test string",
179
+ },
180
+ scheme: "Test string",
181
+ uriOverrideEnforceMode: "Test string",
182
+ },
183
+ },
138
184
  name: "Test string",
139
185
  purgeTime: "Test string",
140
186
  rateLimits: {
@@ -226,6 +272,26 @@ gapi.load('client', async () => {
226
272
  "Test string"
227
273
  ],
228
274
  });
275
+ /**
276
+ * Creates and buffers a new task without the need to explicitly define a Task message. The queue must have HTTP target. To create the task with a custom ID, use the following format and
277
+ * set TASK_ID to your desired ID: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer To create the task with an automatically generated ID, use the following
278
+ * format: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer. Note: This feature is in its experimental stage. You must request access to the API through the [Cloud
279
+ * Tasks BufferTask Experiment Signup form](https://forms.gle/X8Zr5hiXH5tTGFqh8).
280
+ */
281
+ await gapi.client.cloudtasks.projects.locations.queues.tasks.buffer({
282
+ queue: "Test string",
283
+ taskId: "Test string",
284
+ }, {
285
+ body: {
286
+ contentType: "Test string",
287
+ data: "Test string",
288
+ extensions: [
289
+ {
290
+ A: 42
291
+ }
292
+ ],
293
+ },
294
+ });
229
295
  /** Creates a task and adds it to a queue. Tasks cannot be updated after creation; there is no UpdateTask command. * The maximum task size is 100KB. */
230
296
  await gapi.client.cloudtasks.projects.locations.queues.tasks.create({
231
297
  parent: "Test string",