Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e407280

Browse files
docs: Add documentation for enums (#328)
* 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: googleapis/googleapis@a391fd1 Source-Link: googleapis/googleapis-gen@0080f83 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 <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent cb09f39 commit e407280

File tree

15 files changed

+250
-13
lines changed

15 files changed

+250
-13
lines changed

packages/google-cloud-tasks/google/cloud/tasks_v2/services/cloud_tasks/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2488,7 +2488,7 @@ def sample_run_task():
24882488
# Done; return the response.
24892489
return response
24902490

2491-
def __enter__(self):
2491+
def __enter__(self) -> "CloudTasksClient":
24922492
return self
24932493

24942494
def __exit__(self, type, value, traceback):

packages/google-cloud-tasks/google/cloud/tasks_v2/types/queue.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,42 @@ class Queue(proto.Message):
149149
"""
150150

151151
class State(proto.Enum):
152-
r"""State of the queue."""
152+
r"""State of the queue.
153+
154+
Values:
155+
STATE_UNSPECIFIED (0):
156+
Unspecified state.
157+
RUNNING (1):
158+
The queue is running. Tasks can be dispatched.
159+
160+
If the queue was created using Cloud Tasks and the queue has
161+
had no activity (method calls or task dispatches) for 30
162+
days, the queue may take a few minutes to re-activate. Some
163+
method calls may return
164+
[NOT_FOUND][google.rpc.Code.NOT_FOUND] and tasks may not be
165+
dispatched for a few minutes until the queue has been
166+
re-activated.
167+
PAUSED (2):
168+
Tasks are paused by the user. If the queue is
169+
paused then Cloud Tasks will stop delivering
170+
tasks from it, but more tasks can still be added
171+
to it by the user.
172+
DISABLED (3):
173+
The queue is disabled.
174+
175+
A queue becomes ``DISABLED`` when
176+
`queue.yaml <https://cloud.google.com/appengine/docs/python/config/queueref>`__
177+
or
178+
`queue.xml <https://cloud.google.com/appengine/docs/standard/java/config/queueref>`__
179+
is uploaded which does not contain the queue. You cannot
180+
directly disable a queue.
181+
182+
When a queue is disabled, tasks can still be added to a
183+
queue but the tasks are not dispatched.
184+
185+
To permanently delete this queue and all of its tasks, call
186+
[DeleteQueue][google.cloud.tasks.v2.CloudTasks.DeleteQueue].
187+
"""
153188
STATE_UNSPECIFIED = 0
154189
RUNNING = 1
155190
PAUSED = 2

packages/google-cloud-tasks/google/cloud/tasks_v2/types/target.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,26 @@
3131

3232

3333
class HttpMethod(proto.Enum):
34-
r"""The HTTP method used to deliver the task."""
34+
r"""The HTTP method used to deliver the task.
35+
36+
Values:
37+
HTTP_METHOD_UNSPECIFIED (0):
38+
HTTP method unspecified
39+
POST (1):
40+
HTTP POST
41+
GET (2):
42+
HTTP GET
43+
HEAD (3):
44+
HTTP HEAD
45+
PUT (4):
46+
HTTP PUT
47+
DELETE (5):
48+
HTTP DELETE
49+
PATCH (6):
50+
HTTP PATCH
51+
OPTIONS (7):
52+
HTTP OPTIONS
53+
"""
3554
HTTP_METHOD_UNSPECIFIED = 0
3655
POST = 1
3756
GET = 2

packages/google-cloud-tasks/google/cloud/tasks_v2/types/task.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,27 @@ class View(proto.Enum):
163163
retrieved by default because some data, such as payloads, might be
164164
desirable to return only when needed because of its large size or
165165
because of the sensitivity of data that it contains.
166+
167+
Values:
168+
VIEW_UNSPECIFIED (0):
169+
Unspecified. Defaults to BASIC.
170+
BASIC (1):
171+
The basic view omits fields which can be large or can
172+
contain sensitive data.
173+
174+
This view does not include the [body in
175+
AppEngineHttpRequest][google.cloud.tasks.v2.AppEngineHttpRequest.body].
176+
Bodies are desirable to return only when needed, because
177+
they can be large and because of the sensitivity of the data
178+
that you choose to store in it.
179+
FULL (2):
180+
All information is returned.
181+
182+
Authorization for
183+
[FULL][google.cloud.tasks.v2.Task.View.FULL] requires
184+
``cloudtasks.tasks.fullView`` `Google
185+
IAM <https://cloud.google.com/iam/>`__ permission on the
186+
[Queue][google.cloud.tasks.v2.Queue] resource.
166187
"""
167188
VIEW_UNSPECIFIED = 0
168189
BASIC = 1

packages/google-cloud-tasks/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3041,7 +3041,7 @@ def sample_run_task():
30413041
# Done; return the response.
30423042
return response
30433043

3044-
def __enter__(self):
3044+
def __enter__(self) -> "CloudTasksClient":
30453045
return self
30463046

30473047
def __exit__(self, type, value, traceback):

packages/google-cloud-tasks/google/cloud/tasks_v2beta2/types/queue.py

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,47 @@ class Queue(proto.Message):
175175
"""
176176

177177
class State(proto.Enum):
178-
r"""State of the queue."""
178+
r"""State of the queue.
179+
180+
Values:
181+
STATE_UNSPECIFIED (0):
182+
Unspecified state.
183+
RUNNING (1):
184+
The queue is running. Tasks can be dispatched.
185+
186+
If the queue was created using Cloud Tasks and the queue has
187+
had no activity (method calls or task dispatches) for 30
188+
days, the queue may take a few minutes to re-activate. Some
189+
method calls may return
190+
[NOT_FOUND][google.rpc.Code.NOT_FOUND] and tasks may not be
191+
dispatched for a few minutes until the queue has been
192+
re-activated.
193+
PAUSED (2):
194+
Tasks are paused by the user. If the queue is paused then
195+
Cloud Tasks will stop delivering tasks from it, but more
196+
tasks can still be added to it by the user. When a pull
197+
queue is paused, all
198+
[LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks]
199+
calls will return a
200+
[FAILED_PRECONDITION][google.rpc.Code.FAILED_PRECONDITION].
201+
DISABLED (3):
202+
The queue is disabled.
203+
204+
A queue becomes ``DISABLED`` when
205+
`queue.yaml <https://cloud.google.com/appengine/docs/python/config/queueref>`__
206+
or
207+
`queue.xml <https://cloud.google.com/appengine/docs/standard/java/config/queueref>`__
208+
is uploaded which does not contain the queue. You cannot
209+
directly disable a queue.
210+
211+
When a queue is disabled, tasks can still be added to a
212+
queue but the tasks are not dispatched and
213+
[LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks]
214+
calls return a ``FAILED_PRECONDITION`` error.
215+
216+
To permanently delete this queue and all of its tasks, call
217+
[DeleteQueue][google.cloud.tasks.v2beta2.CloudTasks.DeleteQueue].
218+
"""
179219
STATE_UNSPECIFIED = 0
180220
RUNNING = 1
181221
PAUSED = 2

packages/google-cloud-tasks/google/cloud/tasks_v2beta2/types/target.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,22 @@
3131

3232

3333
class HttpMethod(proto.Enum):
34-
r"""The HTTP method used to execute the task."""
34+
r"""The HTTP method used to execute the task.
35+
36+
Values:
37+
HTTP_METHOD_UNSPECIFIED (0):
38+
HTTP method unspecified
39+
POST (1):
40+
HTTP POST
41+
GET (2):
42+
HTTP GET
43+
HEAD (3):
44+
HTTP HEAD
45+
PUT (4):
46+
HTTP PUT
47+
DELETE (5):
48+
HTTP DELETE
49+
"""
3550
HTTP_METHOD_UNSPECIFIED = 0
3651
POST = 1
3752
GET = 2

packages/google-cloud-tasks/google/cloud/tasks_v2beta2/types/task.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,29 @@ class View(proto.Enum):
121121
retrieved by default because some data, such as payloads, might be
122122
desirable to return only when needed because of its large size or
123123
because of the sensitivity of data that it contains.
124+
125+
Values:
126+
VIEW_UNSPECIFIED (0):
127+
Unspecified. Defaults to BASIC.
128+
BASIC (1):
129+
The basic view omits fields which can be large or can
130+
contain sensitive data.
131+
132+
This view does not include the ([payload in
133+
AppEngineHttpRequest][google.cloud.tasks.v2beta2.AppEngineHttpRequest]
134+
and [payload in
135+
PullMessage][google.cloud.tasks.v2beta2.PullMessage.payload]).
136+
These payloads are desirable to return only when needed,
137+
because they can be large and because of the sensitivity of
138+
the data that you choose to store in it.
139+
FULL (2):
140+
All information is returned.
141+
142+
Authorization for
143+
[FULL][google.cloud.tasks.v2beta2.Task.View.FULL] requires
144+
``cloudtasks.tasks.fullView`` `Google
145+
IAM <https://cloud.google.com/iam/>`__ permission on the
146+
[Queue][google.cloud.tasks.v2beta2.Queue] resource.
124147
"""
125148
VIEW_UNSPECIFIED = 0
126149
BASIC = 1

packages/google-cloud-tasks/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2490,7 +2490,7 @@ def sample_run_task():
24902490
# Done; return the response.
24912491
return response
24922492

2493-
def __enter__(self):
2493+
def __enter__(self) -> "CloudTasksClient":
24942494
return self
24952495

24962496
def __exit__(self, type, value, traceback):

packages/google-cloud-tasks/google/cloud/tasks_v2beta3/types/queue.py

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,58 @@ class Queue(proto.Message):
190190
"""
191191

192192
class State(proto.Enum):
193-
r"""State of the queue."""
193+
r"""State of the queue.
194+
195+
Values:
196+
STATE_UNSPECIFIED (0):
197+
Unspecified state.
198+
RUNNING (1):
199+
The queue is running. Tasks can be dispatched.
200+
201+
If the queue was created using Cloud Tasks and the queue has
202+
had no activity (method calls or task dispatches) for 30
203+
days, the queue may take a few minutes to re-activate. Some
204+
method calls may return
205+
[NOT_FOUND][google.rpc.Code.NOT_FOUND] and tasks may not be
206+
dispatched for a few minutes until the queue has been
207+
re-activated.
208+
PAUSED (2):
209+
Tasks are paused by the user. If the queue is
210+
paused then Cloud Tasks will stop delivering
211+
tasks from it, but more tasks can still be added
212+
to it by the user.
213+
DISABLED (3):
214+
The queue is disabled.
215+
216+
A queue becomes ``DISABLED`` when
217+
`queue.yaml <https://cloud.google.com/appengine/docs/python/config/queueref>`__
218+
or
219+
`queue.xml <https://cloud.google.com/appengine/docs/standard/java/config/queueref>`__
220+
is uploaded which does not contain the queue. You cannot
221+
directly disable a queue.
222+
223+
When a queue is disabled, tasks can still be added to a
224+
queue but the tasks are not dispatched.
225+
226+
To permanently delete this queue and all of its tasks, call
227+
[DeleteQueue][google.cloud.tasks.v2beta3.CloudTasks.DeleteQueue].
228+
"""
194229
STATE_UNSPECIFIED = 0
195230
RUNNING = 1
196231
PAUSED = 2
197232
DISABLED = 3
198233

199234
class Type(proto.Enum):
200-
r"""The type of the queue."""
235+
r"""The type of the queue.
236+
237+
Values:
238+
TYPE_UNSPECIFIED (0):
239+
Default value.
240+
PULL (1):
241+
A pull queue.
242+
PUSH (2):
243+
A push queue.
244+
"""
201245
TYPE_UNSPECIFIED = 0
202246
PULL = 1
203247
PUSH = 2

0 commit comments

Comments
 (0)