From 248ab5b10b40c4fc1dbe846dd5788bce696b4dc5 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 16:13:10 -0500 Subject: [PATCH 1/2] docs: Add documentation for enums (#328) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: Add documentation for enums fix: Add context manager return types chore: Update gapic-generator-python to v1.8.1 PiperOrigin-RevId: 503210727 Source-Link: https://github.com/googleapis/googleapis/commit/a391fd1dac18dfdfa00c18c8404f2c3a6ff8e98e Source-Link: https://github.com/googleapis/googleapis-gen/commit/0080f830dec37c3384157082bce279e37079ea58 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../tasks_v2/services/cloud_tasks/client.py | 2 +- google/cloud/tasks_v2/types/queue.py | 37 +++++++++++++- google/cloud/tasks_v2/types/target.py | 21 +++++++- google/cloud/tasks_v2/types/task.py | 21 ++++++++ .../services/cloud_tasks/client.py | 2 +- google/cloud/tasks_v2beta2/types/queue.py | 42 +++++++++++++++- google/cloud/tasks_v2beta2/types/target.py | 17 ++++++- google/cloud/tasks_v2beta2/types/task.py | 23 +++++++++ .../services/cloud_tasks/client.py | 2 +- google/cloud/tasks_v2beta3/types/queue.py | 48 ++++++++++++++++++- google/cloud/tasks_v2beta3/types/target.py | 21 +++++++- google/cloud/tasks_v2beta3/types/task.py | 21 ++++++++ ...nippet_metadata_google.cloud.tasks.v2.json | 2 +- ...t_metadata_google.cloud.tasks.v2beta2.json | 2 +- ...t_metadata_google.cloud.tasks.v2beta3.json | 2 +- 15 files changed, 250 insertions(+), 13 deletions(-) diff --git a/google/cloud/tasks_v2/services/cloud_tasks/client.py b/google/cloud/tasks_v2/services/cloud_tasks/client.py index 4f4a0b46..33ade240 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/client.py @@ -2488,7 +2488,7 @@ def sample_run_task(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "CloudTasksClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/tasks_v2/types/queue.py b/google/cloud/tasks_v2/types/queue.py index 9d93a391..1164c585 100644 --- a/google/cloud/tasks_v2/types/queue.py +++ b/google/cloud/tasks_v2/types/queue.py @@ -149,7 +149,42 @@ class Queue(proto.Message): """ class State(proto.Enum): - r"""State of the queue.""" + r"""State of the queue. + + Values: + STATE_UNSPECIFIED (0): + Unspecified state. + RUNNING (1): + The queue is running. Tasks can be dispatched. + + If the queue was created using Cloud Tasks and the queue has + had no activity (method calls or task dispatches) for 30 + days, the queue may take a few minutes to re-activate. Some + method calls may return + [NOT_FOUND][google.rpc.Code.NOT_FOUND] and tasks may not be + dispatched for a few minutes until the queue has been + re-activated. + PAUSED (2): + Tasks are paused by the user. If the queue is + paused then Cloud Tasks will stop delivering + tasks from it, but more tasks can still be added + to it by the user. + DISABLED (3): + The queue is disabled. + + A queue becomes ``DISABLED`` when + `queue.yaml `__ + or + `queue.xml `__ + is uploaded which does not contain the queue. You cannot + directly disable a queue. + + When a queue is disabled, tasks can still be added to a + queue but the tasks are not dispatched. + + To permanently delete this queue and all of its tasks, call + [DeleteQueue][google.cloud.tasks.v2.CloudTasks.DeleteQueue]. + """ STATE_UNSPECIFIED = 0 RUNNING = 1 PAUSED = 2 diff --git a/google/cloud/tasks_v2/types/target.py b/google/cloud/tasks_v2/types/target.py index 7fd7450c..10bbb506 100644 --- a/google/cloud/tasks_v2/types/target.py +++ b/google/cloud/tasks_v2/types/target.py @@ -31,7 +31,26 @@ class HttpMethod(proto.Enum): - r"""The HTTP method used to deliver the task.""" + r"""The HTTP method used to deliver the task. + + Values: + HTTP_METHOD_UNSPECIFIED (0): + HTTP method unspecified + POST (1): + HTTP POST + GET (2): + HTTP GET + HEAD (3): + HTTP HEAD + PUT (4): + HTTP PUT + DELETE (5): + HTTP DELETE + PATCH (6): + HTTP PATCH + OPTIONS (7): + HTTP OPTIONS + """ HTTP_METHOD_UNSPECIFIED = 0 POST = 1 GET = 2 diff --git a/google/cloud/tasks_v2/types/task.py b/google/cloud/tasks_v2/types/task.py index 1ebf3179..14b7495f 100644 --- a/google/cloud/tasks_v2/types/task.py +++ b/google/cloud/tasks_v2/types/task.py @@ -163,6 +163,27 @@ class View(proto.Enum): retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains. + + Values: + VIEW_UNSPECIFIED (0): + Unspecified. Defaults to BASIC. + BASIC (1): + The basic view omits fields which can be large or can + contain sensitive data. + + This view does not include the [body in + AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest.body]. + Bodies are desirable to return only when needed, because + they can be large and because of the sensitivity of the data + that you choose to store in it. + FULL (2): + All information is returned. + + Authorization for + [FULL][google.cloud.tasks.v2.Task.View.FULL] requires + ``cloudtasks.tasks.fullView`` `Google + IAM `__ permission on the + [Queue][google.cloud.tasks.v2.Queue] resource. """ VIEW_UNSPECIFIED = 0 BASIC = 1 diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py index 351b1c35..881c5cf8 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py @@ -3041,7 +3041,7 @@ def sample_run_task(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "CloudTasksClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/tasks_v2beta2/types/queue.py b/google/cloud/tasks_v2beta2/types/queue.py index 84543844..d6167d6f 100644 --- a/google/cloud/tasks_v2beta2/types/queue.py +++ b/google/cloud/tasks_v2beta2/types/queue.py @@ -175,7 +175,47 @@ class Queue(proto.Message): """ class State(proto.Enum): - r"""State of the queue.""" + r"""State of the queue. + + Values: + STATE_UNSPECIFIED (0): + Unspecified state. + RUNNING (1): + The queue is running. Tasks can be dispatched. + + If the queue was created using Cloud Tasks and the queue has + had no activity (method calls or task dispatches) for 30 + days, the queue may take a few minutes to re-activate. Some + method calls may return + [NOT_FOUND][google.rpc.Code.NOT_FOUND] and tasks may not be + dispatched for a few minutes until the queue has been + re-activated. + PAUSED (2): + Tasks are paused by the user. If the queue is paused then + Cloud Tasks will stop delivering tasks from it, but more + tasks can still be added to it by the user. When a pull + queue is paused, all + [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] + calls will return a + [FAILED_PRECONDITION][google.rpc.Code.FAILED_PRECONDITION]. + DISABLED (3): + The queue is disabled. + + A queue becomes ``DISABLED`` when + `queue.yaml `__ + or + `queue.xml `__ + is uploaded which does not contain the queue. You cannot + directly disable a queue. + + When a queue is disabled, tasks can still be added to a + queue but the tasks are not dispatched and + [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] + calls return a ``FAILED_PRECONDITION`` error. + + To permanently delete this queue and all of its tasks, call + [DeleteQueue][google.cloud.tasks.v2beta2.CloudTasks.DeleteQueue]. + """ STATE_UNSPECIFIED = 0 RUNNING = 1 PAUSED = 2 diff --git a/google/cloud/tasks_v2beta2/types/target.py b/google/cloud/tasks_v2beta2/types/target.py index 720bd367..a666ba78 100644 --- a/google/cloud/tasks_v2beta2/types/target.py +++ b/google/cloud/tasks_v2beta2/types/target.py @@ -31,7 +31,22 @@ class HttpMethod(proto.Enum): - r"""The HTTP method used to execute the task.""" + r"""The HTTP method used to execute the task. + + Values: + HTTP_METHOD_UNSPECIFIED (0): + HTTP method unspecified + POST (1): + HTTP POST + GET (2): + HTTP GET + HEAD (3): + HTTP HEAD + PUT (4): + HTTP PUT + DELETE (5): + HTTP DELETE + """ HTTP_METHOD_UNSPECIFIED = 0 POST = 1 GET = 2 diff --git a/google/cloud/tasks_v2beta2/types/task.py b/google/cloud/tasks_v2beta2/types/task.py index c1947db7..87d5014c 100644 --- a/google/cloud/tasks_v2beta2/types/task.py +++ b/google/cloud/tasks_v2beta2/types/task.py @@ -121,6 +121,29 @@ class View(proto.Enum): retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains. + + Values: + VIEW_UNSPECIFIED (0): + Unspecified. Defaults to BASIC. + BASIC (1): + The basic view omits fields which can be large or can + contain sensitive data. + + This view does not include the ([payload in + AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest] + and [payload in + PullMessage][google.cloud.tasks.v2beta2.PullMessage.payload]). + These payloads are desirable to return only when needed, + because they can be large and because of the sensitivity of + the data that you choose to store in it. + FULL (2): + All information is returned. + + Authorization for + [FULL][google.cloud.tasks.v2beta2.Task.View.FULL] requires + ``cloudtasks.tasks.fullView`` `Google + IAM `__ permission on the + [Queue][google.cloud.tasks.v2beta2.Queue] resource. """ VIEW_UNSPECIFIED = 0 BASIC = 1 diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py index fac1adfe..d00ac895 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py @@ -2490,7 +2490,7 @@ def sample_run_task(): # Done; return the response. return response - def __enter__(self): + def __enter__(self) -> "CloudTasksClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/tasks_v2beta3/types/queue.py b/google/cloud/tasks_v2beta3/types/queue.py index ca11bab6..b139a7a0 100644 --- a/google/cloud/tasks_v2beta3/types/queue.py +++ b/google/cloud/tasks_v2beta3/types/queue.py @@ -190,14 +190,58 @@ class Queue(proto.Message): """ class State(proto.Enum): - r"""State of the queue.""" + r"""State of the queue. + + Values: + STATE_UNSPECIFIED (0): + Unspecified state. + RUNNING (1): + The queue is running. Tasks can be dispatched. + + If the queue was created using Cloud Tasks and the queue has + had no activity (method calls or task dispatches) for 30 + days, the queue may take a few minutes to re-activate. Some + method calls may return + [NOT_FOUND][google.rpc.Code.NOT_FOUND] and tasks may not be + dispatched for a few minutes until the queue has been + re-activated. + PAUSED (2): + Tasks are paused by the user. If the queue is + paused then Cloud Tasks will stop delivering + tasks from it, but more tasks can still be added + to it by the user. + DISABLED (3): + The queue is disabled. + + A queue becomes ``DISABLED`` when + `queue.yaml `__ + or + `queue.xml `__ + is uploaded which does not contain the queue. You cannot + directly disable a queue. + + When a queue is disabled, tasks can still be added to a + queue but the tasks are not dispatched. + + To permanently delete this queue and all of its tasks, call + [DeleteQueue][google.cloud.tasks.v2beta3.CloudTasks.DeleteQueue]. + """ STATE_UNSPECIFIED = 0 RUNNING = 1 PAUSED = 2 DISABLED = 3 class Type(proto.Enum): - r"""The type of the queue.""" + r"""The type of the queue. + + Values: + TYPE_UNSPECIFIED (0): + Default value. + PULL (1): + A pull queue. + PUSH (2): + A push queue. + """ TYPE_UNSPECIFIED = 0 PULL = 1 PUSH = 2 diff --git a/google/cloud/tasks_v2beta3/types/target.py b/google/cloud/tasks_v2beta3/types/target.py index 6d2e871e..01a99dad 100644 --- a/google/cloud/tasks_v2beta3/types/target.py +++ b/google/cloud/tasks_v2beta3/types/target.py @@ -33,7 +33,26 @@ class HttpMethod(proto.Enum): - r"""The HTTP method used to execute the task.""" + r"""The HTTP method used to execute the task. + + Values: + HTTP_METHOD_UNSPECIFIED (0): + HTTP method unspecified + POST (1): + HTTP POST + GET (2): + HTTP GET + HEAD (3): + HTTP HEAD + PUT (4): + HTTP PUT + DELETE (5): + HTTP DELETE + PATCH (6): + HTTP PATCH + OPTIONS (7): + HTTP OPTIONS + """ HTTP_METHOD_UNSPECIFIED = 0 POST = 1 GET = 2 diff --git a/google/cloud/tasks_v2beta3/types/task.py b/google/cloud/tasks_v2beta3/types/task.py index 7b3a2cff..2180bb34 100644 --- a/google/cloud/tasks_v2beta3/types/task.py +++ b/google/cloud/tasks_v2beta3/types/task.py @@ -177,6 +177,27 @@ class View(proto.Enum): retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains. + + Values: + VIEW_UNSPECIFIED (0): + Unspecified. Defaults to BASIC. + BASIC (1): + The basic view omits fields which can be large or can + contain sensitive data. + + This view does not include the [body in + AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body]. + Bodies are desirable to return only when needed, because + they can be large and because of the sensitivity of the data + that you choose to store in it. + FULL (2): + All information is returned. + + Authorization for + [FULL][google.cloud.tasks.v2beta3.Task.View.FULL] requires + ``cloudtasks.tasks.fullView`` `Google + IAM `__ permission on the + [Queue][google.cloud.tasks.v2beta3.Queue] resource. """ VIEW_UNSPECIFIED = 0 BASIC = 1 diff --git a/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2.json b/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2.json index f0fe19e4..164c51d1 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-tasks", - "version": "2.12.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2beta2.json b/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2beta2.json index ed09b991..006a84eb 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2beta2.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2beta2.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-tasks", - "version": "2.12.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2beta3.json b/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2beta3.json index bbabe023..788516ef 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2beta3.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2beta3.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-tasks", - "version": "2.12.0" + "version": "0.1.0" }, "snippets": [ { From 0d541ab9b9bc01d4a833937d51845648e8c4059b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 10:33:38 -0500 Subject: [PATCH 2/2] chore(main): release 2.12.1 (#329) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 12 ++++++++++++ google/cloud/tasks/gapic_version.py | 2 +- google/cloud/tasks_v2/gapic_version.py | 2 +- google/cloud/tasks_v2beta2/gapic_version.py | 2 +- google/cloud/tasks_v2beta3/gapic_version.py | 2 +- .../snippet_metadata_google.cloud.tasks.v2.json | 2 +- .../snippet_metadata_google.cloud.tasks.v2beta2.json | 2 +- .../snippet_metadata_google.cloud.tasks.v2beta3.json | 2 +- 9 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7a48e52a..ed320221 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.12.0" + ".": "2.12.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 9642c886..470fce27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://pypi.org/project/google-cloud-tasks/#history +## [2.12.1](https://github.com/googleapis/python-tasks/compare/v2.12.0...v2.12.1) (2023-01-20) + + +### Bug Fixes + +* Add context manager return types ([248ab5b](https://github.com/googleapis/python-tasks/commit/248ab5b10b40c4fc1dbe846dd5788bce696b4dc5)) + + +### Documentation + +* Add documentation for enums ([248ab5b](https://github.com/googleapis/python-tasks/commit/248ab5b10b40c4fc1dbe846dd5788bce696b4dc5)) + ## [2.12.0](https://github.com/googleapis/python-tasks/compare/v2.11.0...v2.12.0) (2023-01-10) diff --git a/google/cloud/tasks/gapic_version.py b/google/cloud/tasks/gapic_version.py index 16ae0e95..aa9b96fc 100644 --- a/google/cloud/tasks/gapic_version.py +++ b/google/cloud/tasks/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.12.0" # {x-release-please-version} +__version__ = "2.12.1" # {x-release-please-version} diff --git a/google/cloud/tasks_v2/gapic_version.py b/google/cloud/tasks_v2/gapic_version.py index 16ae0e95..aa9b96fc 100644 --- a/google/cloud/tasks_v2/gapic_version.py +++ b/google/cloud/tasks_v2/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.12.0" # {x-release-please-version} +__version__ = "2.12.1" # {x-release-please-version} diff --git a/google/cloud/tasks_v2beta2/gapic_version.py b/google/cloud/tasks_v2beta2/gapic_version.py index 16ae0e95..aa9b96fc 100644 --- a/google/cloud/tasks_v2beta2/gapic_version.py +++ b/google/cloud/tasks_v2beta2/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.12.0" # {x-release-please-version} +__version__ = "2.12.1" # {x-release-please-version} diff --git a/google/cloud/tasks_v2beta3/gapic_version.py b/google/cloud/tasks_v2beta3/gapic_version.py index 16ae0e95..aa9b96fc 100644 --- a/google/cloud/tasks_v2beta3/gapic_version.py +++ b/google/cloud/tasks_v2beta3/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "2.12.0" # {x-release-please-version} +__version__ = "2.12.1" # {x-release-please-version} diff --git a/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2.json b/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2.json index 164c51d1..51cba6b7 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-tasks", - "version": "0.1.0" + "version": "2.12.1" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2beta2.json b/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2beta2.json index 006a84eb..f08fa980 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2beta2.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2beta2.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-tasks", - "version": "0.1.0" + "version": "2.12.1" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2beta3.json b/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2beta3.json index 788516ef..7e6b597c 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2beta3.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.tasks.v2beta3.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-tasks", - "version": "0.1.0" + "version": "2.12.1" }, "snippets": [ {