@maxim_mazurok/gapi.client.cloudtasks-v2 0.0.20230929 → 0.0.20231027

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 +204 -3
  2. package/package.json +1 -1
  3. package/tests.ts +87 -3
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=v2
12
- // Revision: 20230929
12
+ // Revision: 20231027
13
13
 
14
14
  /// <reference types="gapi.client" />
15
15
 
@@ -139,6 +139,16 @@ declare namespace gapi.client {
139
139
  role?:
140
140
  string;
141
141
  }
142
+ interface BufferTaskRequest {
143
+ /** Optional. Body of the HTTP request. The body can take any generic value. The value is written to the HttpRequest of the [Task]. */
144
+ body?:
145
+ HttpBody;
146
+ }
147
+ interface BufferTaskResponse {
148
+ /** The created task. */
149
+ task?:
150
+ Task;
151
+ }
142
152
  interface CmekConfig {
143
153
  /**
144
154
  * Resource name of the Cloud KMS key, of the form `projects/PROJECT_ID/locations/LOCATION_ID/keyRings/KEY_RING_ID/cryptoKeys/KEY_ID`, that will be used to encrypt the Queues & Tasks
@@ -205,6 +215,30 @@ declare namespace gapi.client {
205
215
  requestedPolicyVersion?:
206
216
  number;
207
217
  }
218
+ interface Header {
219
+ /** The Key of the header. */
220
+ key?:
221
+ string;
222
+ /** The Value of the header. */
223
+ value?:
224
+ string;
225
+ }
226
+ interface HeaderOverride {
227
+ /** header embodying a key and a value. */
228
+ header?:
229
+ Header;
230
+ }
231
+ interface HttpBody {
232
+ /** The HTTP Content-Type header value specifying the content type of the body. */
233
+ contentType?:
234
+ string;
235
+ /** The HTTP request/response body as raw binary. */
236
+ data?:
237
+ string;
238
+ /** Application specific response metadata. Must be set in the first response for streaming APIs. */
239
+ extensions?:
240
+ Array<{ [P in string]: any }>;
241
+ }
208
242
  interface HttpRequest {
209
243
  /** 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. */
210
244
  body?:
@@ -242,6 +276,40 @@ declare namespace gapi.client {
242
276
  url?:
243
277
  string;
244
278
  }
279
+ interface HttpTarget {
280
+ /**
281
+ * 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
282
+ * 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: *
283
+ * 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
284
+ * 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
285
+ * 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
286
+ * 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
287
+ * less than 80KB. Queue-level headers to override headers of all the tasks in the queue.
288
+ */
289
+ headerOverrides?:
290
+ HeaderOverride[];
291
+ /**
292
+ * The HTTP method to use for the request. When specified, it overrides HttpRequest for the task. Note that if the value is set to HttpMethod the HttpRequest of the task will be
293
+ * ignored at execution time.
294
+ */
295
+ httpMethod?:
296
+ string;
297
+ /**
298
+ * If specified, an [OAuth token](https://developers.google.com/identity/protocols/OAuth2) will be generated and attached as the `Authorization` header in the HTTP request. This type
299
+ * of authorization should generally only be used when calling Google APIs hosted on *.googleapis.com.
300
+ */
301
+ oauthToken?:
302
+ OAuthToken;
303
+ /**
304
+ * 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
305
+ * type of authorization can be used for many scenarios, including calling Cloud Run, or endpoints where you intend to validate the token yourself.
306
+ */
307
+ oidcToken?:
308
+ OidcToken;
309
+ /** URI override. When specified, overrides the execution URI for all the tasks in the queue. */
310
+ uriOverride?:
311
+ UriOverride;
312
+ }
245
313
  interface ListLocationsResponse {
246
314
  /** A list of locations that matches the specified filter in the request. */
247
315
  locations?:
@@ -311,6 +379,11 @@ declare namespace gapi.client {
311
379
  serviceAccountEmail?:
312
380
  string;
313
381
  }
382
+ interface PathOverride {
383
+ /** The URI path (e.g., /users/1234). Default is an empty string. */
384
+ path?:
385
+ string;
386
+ }
314
387
  // tslint:disable-next-line:no-empty-interface
315
388
  interface PauseQueueRequest {
316
389
  }
@@ -346,6 +419,11 @@ declare namespace gapi.client {
346
419
  // tslint:disable-next-line:no-empty-interface
347
420
  interface PurgeQueueRequest {
348
421
  }
422
+ interface QueryOverride {
423
+ /** The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty string. */
424
+ queryParams?:
425
+ string;
426
+ }
349
427
  interface Queue {
350
428
  /**
351
429
  * Overrides for task-level app_engine_routing. These settings apply only to App Engine tasks in this queue. Http tasks are not affected. If set, `app_engine_routing_override` is used
@@ -353,6 +431,9 @@ declare namespace gapi.client {
353
431
  */
354
432
  appEngineRoutingOverride?:
355
433
  AppEngineRouting;
434
+ /** Modifies HTTP target for HTTP tasks. */
435
+ httpTarget?:
436
+ HttpTarget;
356
437
  /**
357
438
  * Caller-specified and required in CreateQueue, after which it becomes output only. The queue name. The queue name must have the following format:
358
439
  * `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
@@ -576,7 +657,124 @@ declare namespace gapi.client {
576
657
  permissions?:
577
658
  string[];
578
659
  }
660
+ interface UriOverride {
661
+ /**
662
+ * Host override. When specified, replaces 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
663
+ * overridden URI will be changed to "https://example.net." Host value cannot be an empty string (INVALID_ARGUMENT).
664
+ */
665
+ host?:
666
+ string;
667
+ /** URI path. When specified, replaces the existing path of the task URL. Setting the path value to an empty string clears the URI path segment. */
668
+ pathOverride?:
669
+ PathOverride;
670
+ /**
671
+ * Port override. When specified, replaces the port part of the task URI. For instance, for a URI http://www.google.com/foo and port=123, the overridden URI becomes
672
+ * 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.
673
+ */
674
+ port?:
675
+ string;
676
+ /** URI query. When specified, replaces the query part of the task URI. Setting the query value to an empty string clears the URI query segment. */
677
+ queryOverride?:
678
+ QueryOverride;
679
+ /** Scheme override. When specified, the task URI scheme is replaced by the provided value (HTTP or HTTPS). */
680
+ scheme?:
681
+ string;
682
+ /** URI Override Enforce Mode When specified, determines the Target UriOverride mode. If not specified, it defaults to ALWAYS. */
683
+ uriOverrideEnforceMode?:
684
+ string;
685
+ }
579
686
  interface TasksResource {
687
+ /**
688
+ * 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
689
+ * 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
690
+ * following format: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer.
691
+ */
692
+ buffer(request: {
693
+ /** V1 error format. */
694
+ "$.xgafv"?:
695
+ string;
696
+ /** OAuth access token. */
697
+ access_token?:
698
+ string;
699
+ /** Data format for response. */
700
+ alt?:
701
+ string;
702
+ /** JSONP */
703
+ callback?:
704
+ string;
705
+ /** Selector specifying which fields to include in a partial response. */
706
+ fields?:
707
+ string;
708
+ /** 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. */
709
+ key?:
710
+ string;
711
+ /** OAuth 2.0 token for the current user. */
712
+ oauth_token?:
713
+ string;
714
+ /** Returns response with indentations and line breaks. */
715
+ prettyPrint?:
716
+ boolean;
717
+ /** Required. The parent queue name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist. */
718
+ queue:
719
+ string;
720
+ /** 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. */
721
+ quotaUser?:
722
+ string;
723
+ /** Optional. Task ID for the task being created. If not provided, Cloud Tasks generates an ID for the task. */
724
+ taskId:
725
+ string;
726
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
727
+ upload_protocol?:
728
+ string;
729
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
730
+ uploadType?:
731
+ string;
732
+ /** Request body */
733
+ resource:
734
+ BufferTaskRequest;
735
+ }): Request<BufferTaskResponse>;
736
+ buffer(request: {
737
+ /** V1 error format. */
738
+ "$.xgafv"?:
739
+ string;
740
+ /** OAuth access token. */
741
+ access_token?:
742
+ string;
743
+ /** Data format for response. */
744
+ alt?:
745
+ string;
746
+ /** JSONP */
747
+ callback?:
748
+ string;
749
+ /** Selector specifying which fields to include in a partial response. */
750
+ fields?:
751
+ string;
752
+ /** 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. */
753
+ key?:
754
+ string;
755
+ /** OAuth 2.0 token for the current user. */
756
+ oauth_token?:
757
+ string;
758
+ /** Returns response with indentations and line breaks. */
759
+ prettyPrint?:
760
+ boolean;
761
+ /** Required. The parent queue name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist. */
762
+ queue:
763
+ string;
764
+ /** 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. */
765
+ quotaUser?:
766
+ string;
767
+ /** Optional. Task ID for the task being created. If not provided, Cloud Tasks generates an ID for the task. */
768
+ taskId:
769
+ string;
770
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
771
+ upload_protocol?:
772
+ string;
773
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
774
+ uploadType?:
775
+ string;
776
+ },
777
+ body: BufferTaskRequest): Request<BufferTaskResponse>;
580
778
  /** 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. */
581
779
  create(request: {
582
780
  /** V1 error format. */
@@ -985,8 +1183,11 @@ declare namespace gapi.client {
985
1183
  },
986
1184
  body: Queue): Request<Queue>;
987
1185
  /**
988
- * Deletes a queue. This command will delete the queue even if it has tasks in it. Note: If you delete a queue, a queue with the same name can't be created for 7 days. WARNING: Using
989
- * this method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and
1186
+ * Deletes a queue. This command will delete the queue even if it has tasks in it. Note: If you delete a queue, you may be prevented from creating a new queue with the same name as the
1187
+ * deleted queue for a tombstone window of up to 3 days. During this window, the CreateQueue operation may appear to recreate the queue, but this can be misleading. If you attempt to
1188
+ * create a queue with the same name as one that is in the tombstone window, run GetQueue to confirm that the queue creation was successful. If GetQueue returns 200 response code, your
1189
+ * queue was successfully created with the name of the previously deleted queue. Otherwise, your queue did not successfully recreate. WARNING: Using this method may have unintended
1190
+ * side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and
990
1191
  * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.
991
1192
  */
992
1193
  delete(request?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxim_mazurok/gapi.client.cloudtasks-v2",
3
- "version": "0.0.20230929",
3
+ "version": "0.0.20231027",
4
4
  "description": "TypeScript typings for Cloud Tasks API v2",
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: 20230929
6
+ // Revision: 20231027
7
7
 
8
8
  gapi.load('client', async () => {
9
9
  /** now we can use gapi.client */
@@ -69,6 +69,37 @@ gapi.load('client', async () => {
69
69
  service: "Test string",
70
70
  version: "Test string",
71
71
  },
72
+ httpTarget: {
73
+ headerOverrides: [
74
+ {
75
+ header: {
76
+ key: "Test string",
77
+ value: "Test string",
78
+ },
79
+ }
80
+ ],
81
+ httpMethod: "Test string",
82
+ oauthToken: {
83
+ scope: "Test string",
84
+ serviceAccountEmail: "Test string",
85
+ },
86
+ oidcToken: {
87
+ audience: "Test string",
88
+ serviceAccountEmail: "Test string",
89
+ },
90
+ uriOverride: {
91
+ host: "Test string",
92
+ pathOverride: {
93
+ path: "Test string",
94
+ },
95
+ port: "Test string",
96
+ queryOverride: {
97
+ queryParams: "Test string",
98
+ },
99
+ scheme: "Test string",
100
+ uriOverrideEnforceMode: "Test string",
101
+ },
102
+ },
72
103
  name: "Test string",
73
104
  purgeTime: "Test string",
74
105
  rateLimits: {
@@ -89,8 +120,11 @@ gapi.load('client', async () => {
89
120
  state: "Test string",
90
121
  });
91
122
  /**
92
- * Deletes a queue. This command will delete the queue even if it has tasks in it. Note: If you delete a queue, a queue with the same name can't be created for 7 days. WARNING: Using this
93
- * method may have unintended side effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and
123
+ * Deletes a queue. This command will delete the queue even if it has tasks in it. Note: If you delete a queue, you may be prevented from creating a new queue with the same name as the
124
+ * deleted queue for a tombstone window of up to 3 days. During this window, the CreateQueue operation may appear to recreate the queue, but this can be misleading. If you attempt to
125
+ * create a queue with the same name as one that is in the tombstone window, run GetQueue to confirm that the queue creation was successful. If GetQueue returns 200 response code, your
126
+ * queue was successfully created with the name of the previously deleted queue. Otherwise, your queue did not successfully recreate. WARNING: Using this method may have unintended side
127
+ * effects if you are using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of Queue Management and
94
128
  * queue.yaml](https://cloud.google.com/tasks/docs/queue-yaml) before using this method.
95
129
  */
96
130
  await gapi.client.cloudtasks.projects.locations.queues.delete({
@@ -134,6 +168,37 @@ gapi.load('client', async () => {
134
168
  service: "Test string",
135
169
  version: "Test string",
136
170
  },
171
+ httpTarget: {
172
+ headerOverrides: [
173
+ {
174
+ header: {
175
+ key: "Test string",
176
+ value: "Test string",
177
+ },
178
+ }
179
+ ],
180
+ httpMethod: "Test string",
181
+ oauthToken: {
182
+ scope: "Test string",
183
+ serviceAccountEmail: "Test string",
184
+ },
185
+ oidcToken: {
186
+ audience: "Test string",
187
+ serviceAccountEmail: "Test string",
188
+ },
189
+ uriOverride: {
190
+ host: "Test string",
191
+ pathOverride: {
192
+ path: "Test string",
193
+ },
194
+ port: "Test string",
195
+ queryOverride: {
196
+ queryParams: "Test string",
197
+ },
198
+ scheme: "Test string",
199
+ uriOverrideEnforceMode: "Test string",
200
+ },
201
+ },
137
202
  name: "Test string",
138
203
  purgeTime: "Test string",
139
204
  rateLimits: {
@@ -215,6 +280,25 @@ gapi.load('client', async () => {
215
280
  "Test string"
216
281
  ],
217
282
  });
283
+ /**
284
+ * 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
285
+ * 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
286
+ * format: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer.
287
+ */
288
+ await gapi.client.cloudtasks.projects.locations.queues.tasks.buffer({
289
+ queue: "Test string",
290
+ taskId: "Test string",
291
+ }, {
292
+ body: {
293
+ contentType: "Test string",
294
+ data: "Test string",
295
+ extensions: [
296
+ {
297
+ A: 42
298
+ }
299
+ ],
300
+ },
301
+ });
218
302
  /** 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. */
219
303
  await gapi.client.cloudtasks.projects.locations.queues.tasks.create({
220
304
  parent: "Test string",