Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
feat: Add support for REST transport (#184)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 474644226

Source-Link: googleapis/googleapis@f90b329

Source-Link: googleapis/googleapis-gen@4ad8763
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGFkODc2M2JkZTY3NmY5MmEzZWI3MDc1M2FlMWNmZWQwZTgxMzg3ZSJ9


PiperOrigin-RevId: 474571730

Source-Link: googleapis/googleapis@5a9ee4d

Source-Link: googleapis/googleapis-gen@ceafe52
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2VhZmU1MjFmMTM3NjgwZmRlZTJmOWNhOWUxOTQ3Y2RkODI1MDcwZCJ9

fix(deps): require google-api-core>=1.33.1,>=2.8.0
fix(deps): require protobuf >= 3.20.1
  • Loading branch information
gcf-owl-bot[bot] committed Sep 16, 2022
1 parent 318a9a2 commit db5cec0
Show file tree
Hide file tree
Showing 50 changed files with 11,772 additions and 656 deletions.
95 changes: 95 additions & 0 deletions google/cloud/recommendationengine_v1beta1/gapic_metadata.json
Expand Up @@ -76,6 +76,41 @@
]
}
}
},
"rest": {
"libraryClient": "CatalogServiceClient",
"rpcs": {
"CreateCatalogItem": {
"methods": [
"create_catalog_item"
]
},
"DeleteCatalogItem": {
"methods": [
"delete_catalog_item"
]
},
"GetCatalogItem": {
"methods": [
"get_catalog_item"
]
},
"ImportCatalogItems": {
"methods": [
"import_catalog_items"
]
},
"ListCatalogItems": {
"methods": [
"list_catalog_items"
]
},
"UpdateCatalogItem": {
"methods": [
"update_catalog_item"
]
}
}
}
}
},
Expand Down Expand Up @@ -120,6 +155,26 @@
]
}
}
},
"rest": {
"libraryClient": "PredictionApiKeyRegistryClient",
"rpcs": {
"CreatePredictionApiKeyRegistration": {
"methods": [
"create_prediction_api_key_registration"
]
},
"DeletePredictionApiKeyRegistration": {
"methods": [
"delete_prediction_api_key_registration"
]
},
"ListPredictionApiKeyRegistrations": {
"methods": [
"list_prediction_api_key_registrations"
]
}
}
}
}
},
Expand All @@ -144,6 +199,16 @@
]
}
}
},
"rest": {
"libraryClient": "PredictionServiceClient",
"rpcs": {
"Predict": {
"methods": [
"predict"
]
}
}
}
}
},
Expand Down Expand Up @@ -208,6 +273,36 @@
]
}
}
},
"rest": {
"libraryClient": "UserEventServiceClient",
"rpcs": {
"CollectUserEvent": {
"methods": [
"collect_user_event"
]
},
"ImportUserEvents": {
"methods": [
"import_user_events"
]
},
"ListUserEvents": {
"methods": [
"list_user_events"
]
},
"PurgeUserEvents": {
"methods": [
"purge_user_events"
]
},
"WriteUserEvent": {
"methods": [
"write_user_event"
]
}
}
}
}
}
Expand Down
Expand Up @@ -45,6 +45,7 @@
from .transports.base import CatalogServiceTransport, DEFAULT_CLIENT_INFO
from .transports.grpc import CatalogServiceGrpcTransport
from .transports.grpc_asyncio import CatalogServiceGrpcAsyncIOTransport
from .transports.rest import CatalogServiceRestTransport


class CatalogServiceClientMeta(type):
Expand All @@ -60,6 +61,7 @@ class CatalogServiceClientMeta(type):
) # type: Dict[str, Type[CatalogServiceTransport]]
_transport_registry["grpc"] = CatalogServiceGrpcTransport
_transport_registry["grpc_asyncio"] = CatalogServiceGrpcAsyncIOTransport
_transport_registry["rest"] = CatalogServiceRestTransport

def get_transport_class(
cls,
Expand Down Expand Up @@ -355,6 +357,9 @@ def __init__(
transport (Union[str, CatalogServiceTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
NOTE: "rest" transport functionality is currently in a
beta state (preview). We welcome your feedback via an
issue in this library's source repository.
client_options (google.api_core.client_options.ClientOptions): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
Expand Down
Expand Up @@ -19,15 +19,20 @@
from .base import CatalogServiceTransport
from .grpc import CatalogServiceGrpcTransport
from .grpc_asyncio import CatalogServiceGrpcAsyncIOTransport
from .rest import CatalogServiceRestTransport
from .rest import CatalogServiceRestInterceptor


# Compile a registry of transports.
_transport_registry = OrderedDict() # type: Dict[str, Type[CatalogServiceTransport]]
_transport_registry["grpc"] = CatalogServiceGrpcTransport
_transport_registry["grpc_asyncio"] = CatalogServiceGrpcAsyncIOTransport
_transport_registry["rest"] = CatalogServiceRestTransport

__all__ = (
"CatalogServiceTransport",
"CatalogServiceGrpcTransport",
"CatalogServiceGrpcAsyncIOTransport",
"CatalogServiceRestTransport",
"CatalogServiceRestInterceptor",
)

0 comments on commit db5cec0

Please sign in to comment.