Skip to content

Commit b70281e

Browse files
authored
Restore expanded example from PR #7025 after synth. (#7062)
Also, remove now-spurious replacements. Supersedes #7057.
1 parent bc3a8f3 commit b70281e

File tree

3 files changed

+48
-31
lines changed

3 files changed

+48
-31
lines changed

tasks/google/cloud/tasks_v2beta3/gapic/cloud_tasks_client.py

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -434,15 +434,15 @@ def create_queue(
434434
>>>
435435
>>> # Initialize `queue`:
436436
>>> queue = {
437-
>>> # The fully qualified path to the queue
438-
>>> 'name': client.queue_path('[PROJECT]', '[LOCATION]', '[NAME]'),
439-
>>> 'app_engine_http_queue': {
440-
>>> 'app_engine_routing_override': {
441-
>>> # The App Engine service that will receive the tasks.
442-
>>> 'service': 'default',
443-
>>> },
444-
>>> },
445-
>>> }
437+
... # The fully qualified path to the queue
438+
... 'name': client.queue_path('[PROJECT]', '[LOCATION]', '[NAME]'),
439+
... 'app_engine_http_queue': {
440+
... 'app_engine_routing_override': {
441+
... # The App Engine service that will receive the tasks.
442+
... 'service': 'default',
443+
... },
444+
... },
445+
... }
446446
>>>
447447
>>> response = client.create_queue(parent, queue)
448448
@@ -539,8 +539,17 @@ def update_queue(
539539
>>>
540540
>>> client = tasks_v2beta3.CloudTasksClient()
541541
>>>
542-
>>> # TODO: Initialize `queue`:
543-
>>> queue = {}
542+
>>> # Initialize `queue`:
543+
>>> queue = {
544+
... # The fully qualified path to the queue
545+
... 'name': client.queue_path('[PROJECT]', '[LOCATION]', '[NAME]'),
546+
... 'app_engine_http_queue': {
547+
... 'app_engine_routing_override': {
548+
... # The App Engine service that will receive the tasks.
549+
... 'service': 'default',
550+
... },
551+
... },
552+
... }
544553
>>>
545554
>>> response = client.update_queue(queue)
546555

tasks/synth.metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2018-12-18T13:27:29.496588Z",
2+
"updateTime": "2019-01-05T18:32:56.245650Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.16.3",
8-
"dockerImage": "googleapis/artman@sha256:bfb92654b4a77368471f70e2808eaf4e60f263b9559f27bb3284097322787bf1"
7+
"version": "0.16.4",
8+
"dockerImage": "googleapis/artman@sha256:8b45fae963557c3299921037ecbb86f0689f41b1b4aea73408ebc50562cb2857"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "c04bc0dc0a9164d924a9ab923fd6845b4ae6a7ab",
16-
"internalRef": "225851467"
15+
"sha": "a111a53c0c6722afcd793b64724ceef7862db5b9",
16+
"internalRef": "227896184"
1717
}
1818
},
1919
{

tasks/synth.py

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@
3434

3535
s.copy(library, excludes=excludes)
3636

37-
# Fix unindentation of bullet list second line
38-
s.replace(
39-
f"google/cloud/tasks_{version}/gapic/cloud_tasks_client.py",
40-
"( \* .*\n )([^\s*])",
41-
"\g<1> \g<2>",
42-
)
43-
4437
s.replace(
4538
f"google/cloud/tasks_{version}/gapic/cloud_tasks_client.py",
4639
"(Google IAM .*?_) ",
@@ -50,20 +43,35 @@
5043
# Issues with Anonymous ('__') links. Change to named.
5144
s.replace(f"google/cloud/tasks_{version}/proto/*.py", ">`__", ">`_")
5245

53-
# Issue in v2beta2
54-
s.replace(
55-
f"google/cloud/tasks_v2beta2/gapic/cloud_tasks_client.py",
56-
r'(Sample filter \\"app_engine_http_target: )\*\\".',
57-
'\g<1>\\*\\".',
58-
)
59-
6046
# Wrapped link fails due to space in link (v2beta2)
6147
s.replace(
62-
f"google/cloud/tasks_v2beta2/proto/queue_pb2.py",
48+
"google/cloud/tasks_v2beta2/proto/queue_pb2.py",
6349
"(uests in queue.yaml/xml) <\n\s+",
6450
"\g<1>\n <",
6551
)
6652

53+
# Restore updated example from PR #7025.
54+
s.replace(
55+
"google/cloud/tasks_v2beta3/gapic/cloud_tasks_client.py",
56+
">>> # TODO: Initialize `queue`:",
57+
">>> # Initialize `queue`:",
58+
)
59+
s.replace(
60+
"google/cloud/tasks_v2beta3/gapic/cloud_tasks_client.py",
61+
"^(\s+)>>> queue = {}\n",
62+
"\g<1>>>> queue = {\n"
63+
"\g<1>... # The fully qualified path to the queue\n"
64+
"\g<1>... 'name': client.queue_path('[PROJECT]', '[LOCATION]', '[NAME]'),\n"
65+
"\g<1>... 'app_engine_http_queue': {\n"
66+
"\g<1>... 'app_engine_routing_override': {\n"
67+
"\g<1>... # The App Engine service that will receive the tasks.\n"
68+
"\g<1>... 'service': 'default',\n"
69+
"\g<1>... },\n"
70+
"\g<1>... },\n"
71+
"\g<1>... }\n"
72+
)
73+
74+
6775
# ----------------------------------------------------------------------------
6876
# Add templated files
6977
# ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)