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 (#472)

* feat: enable "rest" transport in Python for services supporting numeric enums

PiperOrigin-RevId: 508143576

Source-Link: googleapis/googleapis@7a702a9

Source-Link: googleapis/googleapis-gen@6ad1279
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmFkMTI3OWMwZTdhYTc4N2FjNmI2NmM5ZmQ0YTIxMDY5MmVkZmZjZCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* add rest to tests

* 🦉 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>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people authored Feb 9, 2023
1 parent eb69fc9 commit 67670bf
Show file tree
Hide file tree
Showing 19 changed files with 21,895 additions and 290 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,101 @@
]
}
}
},
"rest": {
"libraryClient": "AutoMlClient",
"rpcs": {
"CreateDataset": {
"methods": [
"create_dataset"
]
},
"CreateModel": {
"methods": [
"create_model"
]
},
"DeleteDataset": {
"methods": [
"delete_dataset"
]
},
"DeleteModel": {
"methods": [
"delete_model"
]
},
"DeployModel": {
"methods": [
"deploy_model"
]
},
"ExportData": {
"methods": [
"export_data"
]
},
"ExportModel": {
"methods": [
"export_model"
]
},
"GetAnnotationSpec": {
"methods": [
"get_annotation_spec"
]
},
"GetDataset": {
"methods": [
"get_dataset"
]
},
"GetModel": {
"methods": [
"get_model"
]
},
"GetModelEvaluation": {
"methods": [
"get_model_evaluation"
]
},
"ImportData": {
"methods": [
"import_data"
]
},
"ListDatasets": {
"methods": [
"list_datasets"
]
},
"ListModelEvaluations": {
"methods": [
"list_model_evaluations"
]
},
"ListModels": {
"methods": [
"list_models"
]
},
"UndeployModel": {
"methods": [
"undeploy_model"
]
},
"UpdateDataset": {
"methods": [
"update_dataset"
]
},
"UpdateModel": {
"methods": [
"update_model"
]
}
}
}
}
},
Expand Down Expand Up @@ -230,6 +325,21 @@
]
}
}
},
"rest": {
"libraryClient": "PredictionServiceClient",
"rpcs": {
"BatchPredict": {
"methods": [
"batch_predict"
]
},
"Predict": {
"methods": [
"predict"
]
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
from .transports.base import AutoMlTransport, DEFAULT_CLIENT_INFO
from .transports.grpc import AutoMlGrpcTransport
from .transports.grpc_asyncio import AutoMlGrpcAsyncIOTransport
from .transports.rest import AutoMlRestTransport


class AutoMlClientMeta(type):
Expand All @@ -84,6 +85,7 @@ class AutoMlClientMeta(type):
_transport_registry = OrderedDict() # type: Dict[str, Type[AutoMlTransport]]
_transport_registry["grpc"] = AutoMlGrpcTransport
_transport_registry["grpc_asyncio"] = AutoMlGrpcAsyncIOTransport
_transport_registry["rest"] = AutoMlRestTransport

def get_transport_class(
cls,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@
from .base import AutoMlTransport
from .grpc import AutoMlGrpcTransport
from .grpc_asyncio import AutoMlGrpcAsyncIOTransport
from .rest import AutoMlRestTransport
from .rest import AutoMlRestInterceptor


# Compile a registry of transports.
_transport_registry = OrderedDict() # type: Dict[str, Type[AutoMlTransport]]
_transport_registry["grpc"] = AutoMlGrpcTransport
_transport_registry["grpc_asyncio"] = AutoMlGrpcAsyncIOTransport
_transport_registry["rest"] = AutoMlRestTransport

__all__ = (
"AutoMlTransport",
"AutoMlGrpcTransport",
"AutoMlGrpcAsyncIOTransport",
"AutoMlRestTransport",
"AutoMlRestInterceptor",
)
Loading

0 comments on commit 67670bf

Please sign in to comment.