Skip to content

Commit

Permalink
feat: enable "rest" transport in Python for services supporting numer…
Browse files Browse the repository at this point in the history
…ic enums (#863)
  • Loading branch information
gcf-owl-bot[bot] authored Apr 6, 2023
1 parent 0b51b1b commit a80c1d1
Show file tree
Hide file tree
Showing 15 changed files with 16,681 additions and 424 deletions.
190 changes: 190 additions & 0 deletions google/pubsub_v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,56 @@
]
}
}
},
"rest": {
"libraryClient": "PublisherClient",
"rpcs": {
"CreateTopic": {
"methods": [
"create_topic"
]
},
"DeleteTopic": {
"methods": [
"delete_topic"
]
},
"DetachSubscription": {
"methods": [
"detach_subscription"
]
},
"GetTopic": {
"methods": [
"get_topic"
]
},
"ListTopicSnapshots": {
"methods": [
"list_topic_snapshots"
]
},
"ListTopicSubscriptions": {
"methods": [
"list_topic_subscriptions"
]
},
"ListTopics": {
"methods": [
"list_topics"
]
},
"Publish": {
"methods": [
"publish"
]
},
"UpdateTopic": {
"methods": [
"update_topic"
]
}
}
}
}
},
Expand Down Expand Up @@ -220,6 +270,61 @@
]
}
}
},
"rest": {
"libraryClient": "SchemaServiceClient",
"rpcs": {
"CommitSchema": {
"methods": [
"commit_schema"
]
},
"CreateSchema": {
"methods": [
"create_schema"
]
},
"DeleteSchema": {
"methods": [
"delete_schema"
]
},
"DeleteSchemaRevision": {
"methods": [
"delete_schema_revision"
]
},
"GetSchema": {
"methods": [
"get_schema"
]
},
"ListSchemaRevisions": {
"methods": [
"list_schema_revisions"
]
},
"ListSchemas": {
"methods": [
"list_schemas"
]
},
"RollbackSchema": {
"methods": [
"rollback_schema"
]
},
"ValidateMessage": {
"methods": [
"validate_message"
]
},
"ValidateSchema": {
"methods": [
"validate_schema"
]
}
}
}
}
},
Expand Down Expand Up @@ -394,6 +499,91 @@
]
}
}
},
"rest": {
"libraryClient": "SubscriberClient",
"rpcs": {
"Acknowledge": {
"methods": [
"acknowledge"
]
},
"CreateSnapshot": {
"methods": [
"create_snapshot"
]
},
"CreateSubscription": {
"methods": [
"create_subscription"
]
},
"DeleteSnapshot": {
"methods": [
"delete_snapshot"
]
},
"DeleteSubscription": {
"methods": [
"delete_subscription"
]
},
"GetSnapshot": {
"methods": [
"get_snapshot"
]
},
"GetSubscription": {
"methods": [
"get_subscription"
]
},
"ListSnapshots": {
"methods": [
"list_snapshots"
]
},
"ListSubscriptions": {
"methods": [
"list_subscriptions"
]
},
"ModifyAckDeadline": {
"methods": [
"modify_ack_deadline"
]
},
"ModifyPushConfig": {
"methods": [
"modify_push_config"
]
},
"Pull": {
"methods": [
"pull"
]
},
"Seek": {
"methods": [
"seek"
]
},
"StreamingPull": {
"methods": [
"streaming_pull"
]
},
"UpdateSnapshot": {
"methods": [
"update_snapshot"
]
},
"UpdateSubscription": {
"methods": [
"update_subscription"
]
}
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions google/pubsub_v1/services/publisher/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
from .transports.base import PublisherTransport, DEFAULT_CLIENT_INFO
from .transports.grpc import PublisherGrpcTransport
from .transports.grpc_asyncio import PublisherGrpcAsyncIOTransport
from .transports.rest import PublisherRestTransport


class PublisherClientMeta(type):
Expand All @@ -73,6 +74,7 @@ class PublisherClientMeta(type):
_transport_registry = OrderedDict() # type: Dict[str, Type[PublisherTransport]]
_transport_registry["grpc"] = PublisherGrpcTransport
_transport_registry["grpc_asyncio"] = PublisherGrpcAsyncIOTransport
_transport_registry["rest"] = PublisherRestTransport

def get_transport_class(
cls,
Expand Down
5 changes: 5 additions & 0 deletions google/pubsub_v1/services/publisher/transports/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@
from .base import PublisherTransport
from .grpc import PublisherGrpcTransport
from .grpc_asyncio import PublisherGrpcAsyncIOTransport
from .rest import PublisherRestTransport
from .rest import PublisherRestInterceptor


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

__all__ = (
"PublisherTransport",
"PublisherGrpcTransport",
"PublisherGrpcAsyncIOTransport",
"PublisherRestTransport",
"PublisherRestInterceptor",
)
Loading

0 comments on commit a80c1d1

Please sign in to comment.