Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added Generator API #2993

Closed
wants to merge 12 commits into from
Closed
12 changes: 12 additions & 0 deletions google/cloud/aiplatform_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,13 +531,19 @@
from .types.pipeline_state import PipelineState
from .types.prediction_service import CountTokensRequest
from .types.prediction_service import CountTokensResponse
from .types.prediction_service import DirectPredictRequest
from .types.prediction_service import DirectPredictResponse
from .types.prediction_service import DirectRawPredictRequest
from .types.prediction_service import DirectRawPredictResponse
from .types.prediction_service import ExplainRequest
from .types.prediction_service import ExplainResponse
from .types.prediction_service import PredictRequest
from .types.prediction_service import PredictResponse
from .types.prediction_service import RawPredictRequest
from .types.prediction_service import StreamingPredictRequest
from .types.prediction_service import StreamingPredictResponse
from .types.prediction_service import StreamingRawPredictRequest
from .types.prediction_service import StreamingRawPredictResponse
from .types.publisher_model import PublisherModel
from .types.saved_query import SavedQuery
from .types.schedule import Schedule
Expand Down Expand Up @@ -854,6 +860,10 @@
"DeployedModel",
"DeployedModelRef",
"DestinationFeatureSetting",
"DirectPredictRequest",
"DirectPredictResponse",
"DirectRawPredictRequest",
"DirectRawPredictResponse",
"DiskSpec",
"DoubleArray",
"EncryptionSpec",
Expand Down Expand Up @@ -1193,6 +1203,8 @@
"StratifiedSplit",
"StreamingPredictRequest",
"StreamingPredictResponse",
"StreamingRawPredictRequest",
"StreamingRawPredictResponse",
"StreamingReadFeatureValuesRequest",
"StringArray",
"Study",
Expand Down
40 changes: 40 additions & 0 deletions google/cloud/aiplatform_v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2158,6 +2158,16 @@
"grpc": {
"libraryClient": "PredictionServiceClient",
"rpcs": {
"DirectPredict": {
"methods": [
"direct_predict"
]
},
"DirectRawPredict": {
"methods": [
"direct_raw_predict"
]
},
"Explain": {
"methods": [
"explain"
Expand All @@ -2177,12 +2187,32 @@
"methods": [
"server_streaming_predict"
]
},
"StreamingPredict": {
"methods": [
"streaming_predict"
]
},
"StreamingRawPredict": {
"methods": [
"streaming_raw_predict"
]
}
}
},
"grpc-async": {
"libraryClient": "PredictionServiceAsyncClient",
"rpcs": {
"DirectPredict": {
"methods": [
"direct_predict"
]
},
"DirectRawPredict": {
"methods": [
"direct_raw_predict"
]
},
"Explain": {
"methods": [
"explain"
Expand All @@ -2202,6 +2232,16 @@
"methods": [
"server_streaming_predict"
]
},
"StreamingPredict": {
"methods": [
"streaming_predict"
]
},
"StreamingRawPredict": {
"methods": [
"streaming_raw_predict"
]
}
}
}
Expand Down
82 changes: 41 additions & 41 deletions google/cloud/aiplatform_v1/services/dataset_service/async_client.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
from google.api_core.client_options import ClientOptions
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.api_core import retry_async as retries
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore
OptionalRetry = Union[retries.AsyncRetry, object] # type: ignore

from google.api_core import operation as gac_operation # type: ignore
from google.api_core import operation_async # type: ignore
Expand Down Expand Up @@ -323,7 +323,7 @@ async def sample_create_endpoint():
This corresponds to the ``endpoint_id`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand Down Expand Up @@ -439,7 +439,7 @@ async def sample_get_endpoint():
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand Down Expand Up @@ -544,7 +544,7 @@ async def sample_list_endpoints():
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand Down Expand Up @@ -669,7 +669,7 @@ async def sample_update_endpoint():
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand Down Expand Up @@ -781,7 +781,7 @@ async def sample_delete_endpoint():
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand Down Expand Up @@ -945,7 +945,7 @@ async def sample_deploy_model():
This corresponds to the ``traffic_split`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand Down Expand Up @@ -1093,7 +1093,7 @@ async def sample_undeploy_model():
This corresponds to the ``traffic_split`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand Down Expand Up @@ -1253,7 +1253,7 @@ async def sample_mutate_deployed_model():
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand Down Expand Up @@ -1335,7 +1335,7 @@ async def list_operations(
request (:class:`~.operations_pb2.ListOperationsRequest`):
The request object. Request message for
`ListOperations` method.
retry (google.api_core.retry.Retry): Designation of what errors,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand All @@ -1352,7 +1352,7 @@ async def list_operations(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.list_operations,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
Expand Down Expand Up @@ -1389,7 +1389,7 @@ async def get_operation(
request (:class:`~.operations_pb2.GetOperationRequest`):
The request object. Request message for
`GetOperation` method.
retry (google.api_core.retry.Retry): Designation of what errors,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand All @@ -1406,7 +1406,7 @@ async def get_operation(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.get_operation,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
Expand Down Expand Up @@ -1448,7 +1448,7 @@ async def delete_operation(
request (:class:`~.operations_pb2.DeleteOperationRequest`):
The request object. Request message for
`DeleteOperation` method.
retry (google.api_core.retry.Retry): Designation of what errors,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand All @@ -1464,7 +1464,7 @@ async def delete_operation(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.delete_operation,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
Expand Down Expand Up @@ -1502,7 +1502,7 @@ async def cancel_operation(
request (:class:`~.operations_pb2.CancelOperationRequest`):
The request object. Request message for
`CancelOperation` method.
retry (google.api_core.retry.Retry): Designation of what errors,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand All @@ -1518,7 +1518,7 @@ async def cancel_operation(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.cancel_operation,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
Expand Down Expand Up @@ -1558,7 +1558,7 @@ async def wait_operation(
request (:class:`~.operations_pb2.WaitOperationRequest`):
The request object. Request message for
`WaitOperation` method.
retry (google.api_core.retry.Retry): Designation of what errors,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand All @@ -1575,7 +1575,7 @@ async def wait_operation(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.wait_operation,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
Expand Down Expand Up @@ -1614,7 +1614,7 @@ async def set_iam_policy(
request (:class:`~.iam_policy_pb2.SetIamPolicyRequest`):
The request object. Request message for `SetIamPolicy`
method.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand Down Expand Up @@ -1695,7 +1695,7 @@ async def set_iam_policy(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.set_iam_policy,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
Expand Down Expand Up @@ -1735,7 +1735,7 @@ async def get_iam_policy(
request (:class:`~.iam_policy_pb2.GetIamPolicyRequest`):
The request object. Request message for `GetIamPolicy`
method.
retry (google.api_core.retry.Retry): Designation of what errors, if
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if
any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand Down Expand Up @@ -1816,7 +1816,7 @@ async def get_iam_policy(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.get_iam_policy,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
Expand Down Expand Up @@ -1857,7 +1857,7 @@ async def test_iam_permissions(
request (:class:`~.iam_policy_pb2.TestIamPermissionsRequest`):
The request object. Request message for
`TestIamPermissions` method.
retry (google.api_core.retry.Retry): Designation of what errors,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand All @@ -1875,7 +1875,7 @@ async def test_iam_permissions(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.test_iam_permissions,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
Expand Down Expand Up @@ -1912,7 +1912,7 @@ async def get_location(
request (:class:`~.location_pb2.GetLocationRequest`):
The request object. Request message for
`GetLocation` method.
retry (google.api_core.retry.Retry): Designation of what errors,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand All @@ -1929,7 +1929,7 @@ async def get_location(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.get_location,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
Expand Down Expand Up @@ -1966,7 +1966,7 @@ async def list_locations(
request (:class:`~.location_pb2.ListLocationsRequest`):
The request object. Request message for
`ListLocations` method.
retry (google.api_core.retry.Retry): Designation of what errors,
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors,
if any, should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
Expand All @@ -1983,7 +1983,7 @@ async def list_locations(

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method.wrap_method(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.list_locations,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
Expand Down
Loading