Skip to content

Commit a80c1d1

Browse files
feat: enable "rest" transport in Python for services supporting numeric enums (#863)
1 parent 0b51b1b commit a80c1d1

File tree

15 files changed

+16681
-424
lines changed

15 files changed

+16681
-424
lines changed

google/pubsub_v1/gapic_metadata.json

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,56 @@
106106
]
107107
}
108108
}
109+
},
110+
"rest": {
111+
"libraryClient": "PublisherClient",
112+
"rpcs": {
113+
"CreateTopic": {
114+
"methods": [
115+
"create_topic"
116+
]
117+
},
118+
"DeleteTopic": {
119+
"methods": [
120+
"delete_topic"
121+
]
122+
},
123+
"DetachSubscription": {
124+
"methods": [
125+
"detach_subscription"
126+
]
127+
},
128+
"GetTopic": {
129+
"methods": [
130+
"get_topic"
131+
]
132+
},
133+
"ListTopicSnapshots": {
134+
"methods": [
135+
"list_topic_snapshots"
136+
]
137+
},
138+
"ListTopicSubscriptions": {
139+
"methods": [
140+
"list_topic_subscriptions"
141+
]
142+
},
143+
"ListTopics": {
144+
"methods": [
145+
"list_topics"
146+
]
147+
},
148+
"Publish": {
149+
"methods": [
150+
"publish"
151+
]
152+
},
153+
"UpdateTopic": {
154+
"methods": [
155+
"update_topic"
156+
]
157+
}
158+
}
109159
}
110160
}
111161
},
@@ -220,6 +270,61 @@
220270
]
221271
}
222272
}
273+
},
274+
"rest": {
275+
"libraryClient": "SchemaServiceClient",
276+
"rpcs": {
277+
"CommitSchema": {
278+
"methods": [
279+
"commit_schema"
280+
]
281+
},
282+
"CreateSchema": {
283+
"methods": [
284+
"create_schema"
285+
]
286+
},
287+
"DeleteSchema": {
288+
"methods": [
289+
"delete_schema"
290+
]
291+
},
292+
"DeleteSchemaRevision": {
293+
"methods": [
294+
"delete_schema_revision"
295+
]
296+
},
297+
"GetSchema": {
298+
"methods": [
299+
"get_schema"
300+
]
301+
},
302+
"ListSchemaRevisions": {
303+
"methods": [
304+
"list_schema_revisions"
305+
]
306+
},
307+
"ListSchemas": {
308+
"methods": [
309+
"list_schemas"
310+
]
311+
},
312+
"RollbackSchema": {
313+
"methods": [
314+
"rollback_schema"
315+
]
316+
},
317+
"ValidateMessage": {
318+
"methods": [
319+
"validate_message"
320+
]
321+
},
322+
"ValidateSchema": {
323+
"methods": [
324+
"validate_schema"
325+
]
326+
}
327+
}
223328
}
224329
}
225330
},
@@ -394,6 +499,91 @@
394499
]
395500
}
396501
}
502+
},
503+
"rest": {
504+
"libraryClient": "SubscriberClient",
505+
"rpcs": {
506+
"Acknowledge": {
507+
"methods": [
508+
"acknowledge"
509+
]
510+
},
511+
"CreateSnapshot": {
512+
"methods": [
513+
"create_snapshot"
514+
]
515+
},
516+
"CreateSubscription": {
517+
"methods": [
518+
"create_subscription"
519+
]
520+
},
521+
"DeleteSnapshot": {
522+
"methods": [
523+
"delete_snapshot"
524+
]
525+
},
526+
"DeleteSubscription": {
527+
"methods": [
528+
"delete_subscription"
529+
]
530+
},
531+
"GetSnapshot": {
532+
"methods": [
533+
"get_snapshot"
534+
]
535+
},
536+
"GetSubscription": {
537+
"methods": [
538+
"get_subscription"
539+
]
540+
},
541+
"ListSnapshots": {
542+
"methods": [
543+
"list_snapshots"
544+
]
545+
},
546+
"ListSubscriptions": {
547+
"methods": [
548+
"list_subscriptions"
549+
]
550+
},
551+
"ModifyAckDeadline": {
552+
"methods": [
553+
"modify_ack_deadline"
554+
]
555+
},
556+
"ModifyPushConfig": {
557+
"methods": [
558+
"modify_push_config"
559+
]
560+
},
561+
"Pull": {
562+
"methods": [
563+
"pull"
564+
]
565+
},
566+
"Seek": {
567+
"methods": [
568+
"seek"
569+
]
570+
},
571+
"StreamingPull": {
572+
"methods": [
573+
"streaming_pull"
574+
]
575+
},
576+
"UpdateSnapshot": {
577+
"methods": [
578+
"update_snapshot"
579+
]
580+
},
581+
"UpdateSubscription": {
582+
"methods": [
583+
"update_subscription"
584+
]
585+
}
586+
}
397587
}
398588
}
399589
}

google/pubsub_v1/services/publisher/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
from .transports.base import PublisherTransport, DEFAULT_CLIENT_INFO
6161
from .transports.grpc import PublisherGrpcTransport
6262
from .transports.grpc_asyncio import PublisherGrpcAsyncIOTransport
63+
from .transports.rest import PublisherRestTransport
6364

6465

6566
class PublisherClientMeta(type):
@@ -73,6 +74,7 @@ class PublisherClientMeta(type):
7374
_transport_registry = OrderedDict() # type: Dict[str, Type[PublisherTransport]]
7475
_transport_registry["grpc"] = PublisherGrpcTransport
7576
_transport_registry["grpc_asyncio"] = PublisherGrpcAsyncIOTransport
77+
_transport_registry["rest"] = PublisherRestTransport
7678

7779
def get_transport_class(
7880
cls,

google/pubsub_v1/services/publisher/transports/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,20 @@
1919
from .base import PublisherTransport
2020
from .grpc import PublisherGrpcTransport
2121
from .grpc_asyncio import PublisherGrpcAsyncIOTransport
22+
from .rest import PublisherRestTransport
23+
from .rest import PublisherRestInterceptor
2224

2325

2426
# Compile a registry of transports.
2527
_transport_registry = OrderedDict() # type: Dict[str, Type[PublisherTransport]]
2628
_transport_registry["grpc"] = PublisherGrpcTransport
2729
_transport_registry["grpc_asyncio"] = PublisherGrpcAsyncIOTransport
30+
_transport_registry["rest"] = PublisherRestTransport
2831

2932
__all__ = (
3033
"PublisherTransport",
3134
"PublisherGrpcTransport",
3235
"PublisherGrpcAsyncIOTransport",
36+
"PublisherRestTransport",
37+
"PublisherRestInterceptor",
3338
)

0 commit comments

Comments
 (0)