@maxim_mazurok/gapi.client.cloudtasks-v2beta3 0.0.20221129 → 0.0.20230105

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 +141 -1
  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: 20221129
12
+ // Revision: 20230105
13
13
 
14
14
  /// <reference types="gapi.client" />
15
15
 
@@ -130,6 +130,14 @@ declare namespace gapi.client {
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,6 +185,24 @@ 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;
@@ -208,6 +234,25 @@ declare namespace gapi.client {
208
234
  */
209
235
  url?: string;
210
236
  }
237
+ interface HttpTarget {
238
+ /**
239
+ * 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
240
+ * 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: *
241
+ * Several predefined headers, prefixed with "X-Google-Cloud-Tasks-", can be used to define properties of the task. * Host: This will be computed by Cloud Tasks and derived from
242
+ * 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
243
+ * 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
244
+ * 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
245
+ * less than 80KB. Queue-level headers to override headers of all the tasks in the queue.
246
+ */
247
+ headerOverrides?: HeaderOverride[];
248
+ /**
249
+ * 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
250
+ * ignored at execution time.
251
+ */
252
+ httpMethod?: string;
253
+ /** URI override. When specified, modifies the execution URI for all the tasks in the queue. */
254
+ uriOverride?: UriOverride;
255
+ }
211
256
  interface ListLocationsResponse {
212
257
  /** A list of locations that matches the specified filter in the request. */
213
258
  locations?: Location[];
@@ -262,6 +307,10 @@ declare namespace gapi.client {
262
307
  */
263
308
  serviceAccountEmail?: string;
264
309
  }
310
+ interface PathOverride {
311
+ /** The URI path (e.g., a/b/c). Default is Empty string. */
312
+ path?: string;
313
+ }
265
314
  // tslint:disable-next-line:no-empty-interface
266
315
  interface PauseQueueRequest {
267
316
  }
@@ -304,9 +353,15 @@ declare namespace gapi.client {
304
353
  // tslint:disable-next-line:no-empty-interface
305
354
  interface PurgeQueueRequest {
306
355
  }
356
+ interface QueryOverride {
357
+ /** The query parameters (e.g., qparam1=123&qparam2=456). Default is Empty string. */
358
+ queryParams?: string;
359
+ }
307
360
  interface Queue {
308
361
  /** AppEngineHttpQueue settings apply only to App Engine tasks in this queue. Http tasks are not affected by this proto. */
309
362
  appEngineHttpQueue?: AppEngineHttpQueue;
363
+ /** Modifies HTTP target for HTTP tasks. */
364
+ httpTarget?: HttpTarget;
310
365
  /**
311
366
  * Caller-specified and required in CreateQueue, after which it becomes output only. The queue name. The queue name must have the following format:
312
367
  * `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 +593,92 @@ declare namespace gapi.client {
538
593
  /** A subset of `TestPermissionsRequest.permissions` that the caller is allowed. */
539
594
  permissions?: string[];
540
595
  }
596
+ interface UriOverride {
597
+ /**
598
+ * 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
599
+ * overridden URI will be changed to "https://example.net". Host value cannot be an empty string.
600
+ */
601
+ host?: string;
602
+ /** 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. */
603
+ pathOverride?: PathOverride;
604
+ /**
605
+ * 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
606
+ * 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.
607
+ */
608
+ port?: string;
609
+ /** 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. */
610
+ queryOverride?: QueryOverride;
611
+ /** Scheme override. When specified, the task URI scheme is replaced by the provided value (HTTP or HTTPS). */
612
+ scheme?: string;
613
+ /** URI Override Enforce Mode When specified, determines the Target UriOverride mode. If not specified, it defaults to ALWAYS. */
614
+ uriOverrideEnforceMode?: string;
615
+ }
541
616
  interface TasksResource {
617
+ /**
618
+ * 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
619
+ * 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
620
+ * 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
621
+ * the [Cloud Tasks BufferTask Experiment Signup form](https://forms.gle/X8Zr5hiXH5tTGFqh8).
622
+ */
623
+ buffer(request: {
624
+ /** V1 error format. */
625
+ "$.xgafv"?: string;
626
+ /** OAuth access token. */
627
+ access_token?: string;
628
+ /** Data format for response. */
629
+ alt?: string;
630
+ /** JSONP */
631
+ callback?: string;
632
+ /** Selector specifying which fields to include in a partial response. */
633
+ fields?: string;
634
+ /** 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. */
635
+ key?: string;
636
+ /** OAuth 2.0 token for the current user. */
637
+ oauth_token?: string;
638
+ /** Returns response with indentations and line breaks. */
639
+ prettyPrint?: boolean;
640
+ /** Required. The parent queue name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist. */
641
+ queue: string;
642
+ /** 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. */
643
+ quotaUser?: string;
644
+ /** Optional. Task ID for the task being created. If not provided, a random task ID is assigned to the task. */
645
+ taskId: string;
646
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
647
+ upload_protocol?: string;
648
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
649
+ uploadType?: string;
650
+ /** Request body */
651
+ resource: BufferTaskRequest;
652
+ }): Request<BufferTaskResponse>;
653
+ buffer(request: {
654
+ /** V1 error format. */
655
+ "$.xgafv"?: string;
656
+ /** OAuth access token. */
657
+ access_token?: string;
658
+ /** Data format for response. */
659
+ alt?: string;
660
+ /** JSONP */
661
+ callback?: string;
662
+ /** Selector specifying which fields to include in a partial response. */
663
+ fields?: string;
664
+ /** 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. */
665
+ key?: string;
666
+ /** OAuth 2.0 token for the current user. */
667
+ oauth_token?: string;
668
+ /** Returns response with indentations and line breaks. */
669
+ prettyPrint?: boolean;
670
+ /** Required. The parent queue name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist. */
671
+ queue: string;
672
+ /** 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. */
673
+ quotaUser?: string;
674
+ /** Optional. Task ID for the task being created. If not provided, a random task ID is assigned to the task. */
675
+ taskId: string;
676
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
677
+ upload_protocol?: string;
678
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
679
+ uploadType?: string;
680
+ },
681
+ body: BufferTaskRequest): Request<BufferTaskResponse>;
542
682
  /** 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
683
  create(request: {
544
684
  /** 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.20221129",
3
+ "version": "0.0.20230105",
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: 20221129
6
+ // Revision: 20230105
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",