Skip to content

Commit 2aa0e2e

Browse files
feat!: [tasks] publish in ESM and CJS, and remove bufferTask (#4952)
* fix!: remove BufferTask method which cannot be called from client libraries PiperOrigin-RevId: 599211253 Source-Link: googleapis/googleapis@1654062 Source-Link: googleapis/googleapis-gen@2055a53 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRhc2tzLy5Pd2xCb3QueWFtbCIsImgiOiIyMDU1YTUzM2FmMTU0ZGNjMjYzZDVjMGJjZDc4YWY4NGI0NGVmMzMyIn0= * fix: improve retry logic for streaming API calls build: update typescript generator version to 4.3.0 The streaming API call retry logic has changed, which in some rare cases may require code changes. Please feel free to reach out to us in the issues if you experience new problems with retrying streaming calls after this update. PiperOrigin-RevId: 599622271 Source-Link: googleapis/googleapis@6239c21 Source-Link: googleapis/googleapis-gen@da13d82 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRhc2tzLy5Pd2xCb3QueWFtbCIsImgiOiJkYTEzZDgyMjJkM2JhMzM3MzQ1MDE5OTk4NjQ0NTg2NDBmMTQwNWFlIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update package.json --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: sofisl <[email protected]>
1 parent a022e98 commit 2aa0e2e

89 files changed

Lines changed: 8253 additions & 68077 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/google-cloud-tasks/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ system-test/*key.json
1212
.DS_Store
1313
package-lock.json
1414
__pycache__
15-
esm/**/*.d.ts
15+
esm/**/*.d.ts

packages/google-cloud-tasks/.jsdoc.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 Google LLC
1+
// Copyright 2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ module.exports = {
3939
includePattern: '\\.js$'
4040
},
4141
templates: {
42-
copyright: 'Copyright 2023 Google LLC',
42+
copyright: 'Copyright 2024 Google LLC',
4343
includeDate: false,
4444
sourceFiles: false,
4545
systemName: '@google-cloud/tasks',

packages/google-cloud-tasks/.mocharc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 Google LLC
1+
// Copyright 2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

packages/google-cloud-tasks/.prettierrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 Google LLC
1+
// Copyright 2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

packages/google-cloud-tasks/esm/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 Google LLC
1+
// Copyright 2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

packages/google-cloud-tasks/esm/src/v2/cloud_tasks_client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 Google LLC
1+
// Copyright 2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

packages/google-cloud-tasks/esm/src/v2/cloud_tasks_client_config.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
"initial_retry_delay_millis": 100,
1414
"retry_delay_multiplier": 1.3,
1515
"max_retry_delay_millis": 60000,
16-
"initial_rpc_timeout_millis": 20000,
16+
"initial_rpc_timeout_millis": 60000,
1717
"rpc_timeout_multiplier": 1,
18-
"max_rpc_timeout_millis": 20000,
18+
"max_rpc_timeout_millis": 60000,
1919
"total_timeout_millis": 600000
2020
},
2121
"2607cc7256ff9acb2ee9b232c5722dbbaab18846": {
2222
"initial_retry_delay_millis": 100,
2323
"retry_delay_multiplier": 1.3,
2424
"max_retry_delay_millis": 10000,
25-
"initial_rpc_timeout_millis": 20000,
25+
"initial_rpc_timeout_millis": 60000,
2626
"rpc_timeout_multiplier": 1,
27-
"max_rpc_timeout_millis": 20000,
27+
"max_rpc_timeout_millis": 60000,
2828
"total_timeout_millis": 600000
2929
}
3030
},

packages/google-cloud-tasks/esm/src/v2/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 Google LLC
1+
// Copyright 2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

packages/google-cloud-tasks/esm/src/v2beta2/cloud_tasks_client.ts

Lines changed: 1 addition & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2023 Google LLC
1+
// Copyright 2024 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -317,7 +317,6 @@ export class CloudTasksClient {
317317
'renewLease',
318318
'cancelLease',
319319
'runTask',
320-
'bufferTask',
321320
];
322321
for (const methodName of cloudTasksStubMethods) {
323322
const callPromise = this.cloudTasksStub.then(
@@ -2448,112 +2447,6 @@ export class CloudTasksClient {
24482447
this.initialize();
24492448
return this.innerApiCalls.runTask(request, options, callback);
24502449
}
2451-
/**
2452-
* Creates and buffers a new task without the need to explicitly define a Task
2453-
* message. The queue must have [HTTP
2454-
* target][google.cloud.tasks.v2beta2.HttpTarget]. To create the task with a
2455-
* custom ID, use the following format and set TASK_ID to your desired ID:
2456-
* projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer
2457-
* To create the task with an automatically generated ID, use the following
2458-
* format:
2459-
* projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer.
2460-
* Note: This feature is in its experimental stage. You must request access to
2461-
* the API through the [Cloud Tasks BufferTask Experiment Signup
2462-
* form](https://forms.gle/X8Zr5hiXH5tTGFqh8).
2463-
*
2464-
* @param {Object} request
2465-
* The request object that will be sent.
2466-
* @param {string} request.queue
2467-
* Required. The parent queue name. For example:
2468-
* projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
2469-
*
2470-
* The queue must already exist.
2471-
* @param {string} [request.taskId]
2472-
* Optional. Task ID for the task being created. If not provided, a random
2473-
* task ID is assigned to the task.
2474-
* @param {google.api.HttpBody} [request.body]
2475-
* Optional. Body of the HTTP request.
2476-
*
2477-
* The body can take any generic value. The value is written to the
2478-
* {@link protos.payload|HttpRequest} of the [Task].
2479-
* @param {object} [options]
2480-
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
2481-
* @returns {Promise} - The promise which resolves to an array.
2482-
* The first element of the array is an object representing {@link protos.google.cloud.tasks.v2beta2.BufferTaskResponse|BufferTaskResponse}.
2483-
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
2484-
* for more details and examples.
2485-
* @example <caption>include:samples/generated/v2beta2/cloud_tasks.buffer_task.js</caption>
2486-
* region_tag:cloudtasks_v2beta2_generated_CloudTasks_BufferTask_async
2487-
*/
2488-
bufferTask(
2489-
request?: protos.google.cloud.tasks.v2beta2.IBufferTaskRequest,
2490-
options?: CallOptions
2491-
): Promise<
2492-
[
2493-
protos.google.cloud.tasks.v2beta2.IBufferTaskResponse,
2494-
protos.google.cloud.tasks.v2beta2.IBufferTaskRequest | undefined,
2495-
{} | undefined,
2496-
]
2497-
>;
2498-
bufferTask(
2499-
request: protos.google.cloud.tasks.v2beta2.IBufferTaskRequest,
2500-
options: CallOptions,
2501-
callback: Callback<
2502-
protos.google.cloud.tasks.v2beta2.IBufferTaskResponse,
2503-
protos.google.cloud.tasks.v2beta2.IBufferTaskRequest | null | undefined,
2504-
{} | null | undefined
2505-
>
2506-
): void;
2507-
bufferTask(
2508-
request: protos.google.cloud.tasks.v2beta2.IBufferTaskRequest,
2509-
callback: Callback<
2510-
protos.google.cloud.tasks.v2beta2.IBufferTaskResponse,
2511-
protos.google.cloud.tasks.v2beta2.IBufferTaskRequest | null | undefined,
2512-
{} | null | undefined
2513-
>
2514-
): void;
2515-
bufferTask(
2516-
request?: protos.google.cloud.tasks.v2beta2.IBufferTaskRequest,
2517-
optionsOrCallback?:
2518-
| CallOptions
2519-
| Callback<
2520-
protos.google.cloud.tasks.v2beta2.IBufferTaskResponse,
2521-
| protos.google.cloud.tasks.v2beta2.IBufferTaskRequest
2522-
| null
2523-
| undefined,
2524-
{} | null | undefined
2525-
>,
2526-
callback?: Callback<
2527-
protos.google.cloud.tasks.v2beta2.IBufferTaskResponse,
2528-
protos.google.cloud.tasks.v2beta2.IBufferTaskRequest | null | undefined,
2529-
{} | null | undefined
2530-
>
2531-
): Promise<
2532-
[
2533-
protos.google.cloud.tasks.v2beta2.IBufferTaskResponse,
2534-
protos.google.cloud.tasks.v2beta2.IBufferTaskRequest | undefined,
2535-
{} | undefined,
2536-
]
2537-
> | void {
2538-
request = request || {};
2539-
let options: CallOptions;
2540-
if (typeof optionsOrCallback === 'function' && callback === undefined) {
2541-
callback = optionsOrCallback;
2542-
options = {};
2543-
} else {
2544-
options = optionsOrCallback as CallOptions;
2545-
}
2546-
options = options || {};
2547-
options.otherArgs = options.otherArgs || {};
2548-
options.otherArgs.headers = options.otherArgs.headers || {};
2549-
options.otherArgs.headers['x-goog-request-params'] =
2550-
this._gaxModule.routingHeader.fromParams({
2551-
queue: request.queue ?? '',
2552-
task_id: request.taskId ?? '',
2553-
});
2554-
this.initialize();
2555-
return this.innerApiCalls.bufferTask(request, options, callback);
2556-
}
25572450

25582451
/**
25592452
* Lists queues.

packages/google-cloud-tasks/esm/src/v2beta2/cloud_tasks_client_config.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313
"initial_retry_delay_millis": 100,
1414
"retry_delay_multiplier": 1.3,
1515
"max_retry_delay_millis": 60000,
16-
"initial_rpc_timeout_millis": 20000,
16+
"initial_rpc_timeout_millis": 60000,
1717
"rpc_timeout_multiplier": 1,
18-
"max_rpc_timeout_millis": 20000,
18+
"max_rpc_timeout_millis": 60000,
1919
"total_timeout_millis": 600000
2020
},
2121
"2607cc7256ff9acb2ee9b232c5722dbbaab18846": {
2222
"initial_retry_delay_millis": 100,
2323
"retry_delay_multiplier": 1.3,
2424
"max_retry_delay_millis": 10000,
25-
"initial_rpc_timeout_millis": 20000,
25+
"initial_rpc_timeout_millis": 60000,
2626
"rpc_timeout_multiplier": 1,
27-
"max_rpc_timeout_millis": 20000,
27+
"max_rpc_timeout_millis": 60000,
2828
"total_timeout_millis": 600000
2929
}
3030
},
@@ -133,11 +133,6 @@
133133
"timeout_millis": 20000,
134134
"retry_codes_name": "non_idempotent",
135135
"retry_params_name": "default"
136-
},
137-
"BufferTask": {
138-
"timeout_millis": 20000,
139-
"retry_codes_name": "non_idempotent",
140-
"retry_params_name": "default"
141136
}
142137
}
143138
}

0 commit comments

Comments
 (0)