diff --git a/docs/aiplatform_v1beta1/online_evaluator_service.rst b/docs/aiplatform_v1beta1/online_evaluator_service.rst new file mode 100644 index 0000000000..8c5bf8dbd4 --- /dev/null +++ b/docs/aiplatform_v1beta1/online_evaluator_service.rst @@ -0,0 +1,10 @@ +OnlineEvaluatorService +---------------------------------------- + +.. automodule:: google.cloud.aiplatform_v1beta1.services.online_evaluator_service + :members: + :inherited-members: + +.. automodule:: google.cloud.aiplatform_v1beta1.services.online_evaluator_service.pagers + :members: + :inherited-members: diff --git a/docs/aiplatform_v1beta1/services_.rst b/docs/aiplatform_v1beta1/services_.rst index 3763c6043b..0d906736bc 100644 --- a/docs/aiplatform_v1beta1/services_.rst +++ b/docs/aiplatform_v1beta1/services_.rst @@ -29,6 +29,7 @@ Services for Google Cloud Aiplatform v1beta1 API model_monitoring_service model_service notebook_service + online_evaluator_service persistent_resource_service pipeline_service prediction_service diff --git a/google/cloud/aiplatform_v1/__init__.py b/google/cloud/aiplatform_v1/__init__.py index 776de81007..b28c7f0dd6 100644 --- a/google/cloud/aiplatform_v1/__init__.py +++ b/google/cloud/aiplatform_v1/__init__.py @@ -261,6 +261,9 @@ from .types.evaluated_annotation import ErrorAnalysisAnnotation from .types.evaluated_annotation import EvaluatedAnnotation from .types.evaluated_annotation import EvaluatedAnnotationExplanation +from .types.evaluation_service import AggregationOutput +from .types.evaluation_service import AggregationResult +from .types.evaluation_service import AutoraterConfig from .types.evaluation_service import BleuInput from .types.evaluation_service import BleuInstance from .types.evaluation_service import BleuMetricValue @@ -274,8 +277,14 @@ from .types.evaluation_service import CometInstance from .types.evaluation_service import CometResult from .types.evaluation_service import CometSpec +from .types.evaluation_service import ComputationBasedMetricSpec +from .types.evaluation_service import ContentMap +from .types.evaluation_service import CustomOutput +from .types.evaluation_service import CustomOutputFormatConfig +from .types.evaluation_service import EvaluateDatasetResponse from .types.evaluation_service import EvaluateInstancesRequest from .types.evaluation_service import EvaluateInstancesResponse +from .types.evaluation_service import EvaluationDataset from .types.evaluation_service import ExactMatchInput from .types.evaluation_service import ExactMatchInstance from .types.evaluation_service import ExactMatchMetricValue @@ -293,10 +302,15 @@ from .types.evaluation_service import GroundednessInstance from .types.evaluation_service import GroundednessResult from .types.evaluation_service import GroundednessSpec +from .types.evaluation_service import LLMBasedMetricSpec +from .types.evaluation_service import Metric +from .types.evaluation_service import MetricResult from .types.evaluation_service import MetricxInput from .types.evaluation_service import MetricxInstance from .types.evaluation_service import MetricxResult from .types.evaluation_service import MetricxSpec +from .types.evaluation_service import OutputConfig +from .types.evaluation_service import OutputInfo from .types.evaluation_service import PairwiseMetricInput from .types.evaluation_service import PairwiseMetricInstance from .types.evaluation_service import PairwiseMetricResult @@ -313,6 +327,7 @@ from .types.evaluation_service import PointwiseMetricInstance from .types.evaluation_service import PointwiseMetricResult from .types.evaluation_service import PointwiseMetricSpec +from .types.evaluation_service import PredefinedMetricSpec from .types.evaluation_service import QuestionAnsweringCorrectnessInput from .types.evaluation_service import QuestionAnsweringCorrectnessInstance from .types.evaluation_service import QuestionAnsweringCorrectnessResult @@ -329,6 +344,7 @@ from .types.evaluation_service import QuestionAnsweringRelevanceInstance from .types.evaluation_service import QuestionAnsweringRelevanceResult from .types.evaluation_service import QuestionAnsweringRelevanceSpec +from .types.evaluation_service import RawOutput from .types.evaluation_service import RougeInput from .types.evaluation_service import RougeInstance from .types.evaluation_service import RougeMetricValue @@ -879,6 +895,11 @@ from .types.publisher_model import PublisherModel from .types.reasoning_engine import ReasoningEngine from .types.reasoning_engine import ReasoningEngineSpec +from .types.reasoning_engine_execution_service import ( + AsyncQueryReasoningEngineOperationMetadata, +) +from .types.reasoning_engine_execution_service import AsyncQueryReasoningEngineRequest +from .types.reasoning_engine_execution_service import AsyncQueryReasoningEngineResponse from .types.reasoning_engine_execution_service import QueryReasoningEngineRequest from .types.reasoning_engine_execution_service import QueryReasoningEngineResponse from .types.reasoning_engine_execution_service import StreamQueryReasoningEngineRequest @@ -1023,6 +1044,8 @@ from .types.training_pipeline import StratifiedSplit from .types.training_pipeline import TimestampSplit from .types.training_pipeline import TrainingPipeline +from .types.tuning_job import EvaluateDatasetRun +from .types.tuning_job import EvaluationConfig from .types.tuning_job import PreTunedModel from .types.tuning_job import SupervisedHyperParameters from .types.tuning_job import SupervisedTuningDatasetDistribution @@ -1253,6 +1276,8 @@ def _get_version(dependency_name): "AddExecutionEventsRequest", "AddExecutionEventsResponse", "AddTrialMeasurementRequest", + "AggregationOutput", + "AggregationResult", "Annotation", "AnnotationSpec", "ApiAuth", @@ -1263,6 +1288,9 @@ def _get_version(dependency_name): "AskContextsResponse", "AssignNotebookRuntimeOperationMetadata", "AssignNotebookRuntimeRequest", + "AsyncQueryReasoningEngineOperationMetadata", + "AsyncQueryReasoningEngineRequest", + "AsyncQueryReasoningEngineResponse", "AsyncRetrieveContextsOperationMetadata", "AsyncRetrieveContextsRequest", "AsyncRetrieveContextsResponse", @@ -1270,6 +1298,7 @@ def _get_version(dependency_name): "AugmentPromptRequest", "AugmentPromptResponse", "AutomaticResources", + "AutoraterConfig", "AutoscalingMetricSpec", "AvroSource", "BatchCancelPipelineJobsOperationMetadata", @@ -1338,11 +1367,13 @@ def _get_version(dependency_name): "CometSpec", "CompleteTrialRequest", "CompletionStats", + "ComputationBasedMetricSpec", "ComputeTokensRequest", "ComputeTokensResponse", "ContainerRegistryDestination", "ContainerSpec", "Content", + "ContentMap", "Context", "CopyModelOperationMetadata", "CopyModelRequest", @@ -1419,6 +1450,8 @@ def _get_version(dependency_name): "CsvSource", "CustomJob", "CustomJobSpec", + "CustomOutput", + "CustomOutputFormatConfig", "DataFoundryServiceClient", "DataItem", "DataItemView", @@ -1513,10 +1546,14 @@ def _get_version(dependency_name): "EntityType", "EnvVar", "ErrorAnalysisAnnotation", + "EvaluateDatasetResponse", + "EvaluateDatasetRun", "EvaluateInstancesRequest", "EvaluateInstancesResponse", "EvaluatedAnnotation", "EvaluatedAnnotationExplanation", + "EvaluationConfig", + "EvaluationDataset", "EvaluationServiceClient", "Event", "EventActions", @@ -1704,6 +1741,7 @@ def _get_version(dependency_name): "JiraSource", "JobServiceClient", "JobState", + "LLMBasedMetricSpec", "LargeModelReference", "LineageSubgraph", "ListAnnotationsRequest", @@ -1828,6 +1866,8 @@ def _get_version(dependency_name): "MetadataSchema", "MetadataServiceClient", "MetadataStore", + "Metric", + "MetricResult", "MetricxInput", "MetricxInstance", "MetricxResult", @@ -1885,7 +1925,9 @@ def _get_version(dependency_name): "NotebookRuntimeType", "NotebookServiceClient", "NotebookSoftwareConfig", + "OutputConfig", "OutputFieldSpec", + "OutputInfo", "PSCAutomationConfig", "PSCAutomationState", "PairwiseChoice", @@ -1924,6 +1966,7 @@ def _get_version(dependency_name): "PostStartupScriptConfig", "PreTunedModel", "PrebuiltVoiceConfig", + "PredefinedMetricSpec", "PredefinedSplit", "PredictRequest", "PredictRequestResponseLoggingConfig", @@ -1984,6 +2027,7 @@ def _get_version(dependency_name): "RagQuery", "RagRetrievalConfig", "RagVectorDbConfig", + "RawOutput", "RawPredictRequest", "RayLogsSpec", "RayMetricSpec", diff --git a/google/cloud/aiplatform_v1/gapic_metadata.json b/google/cloud/aiplatform_v1/gapic_metadata.json index 9d3651758a..7aeb9b5405 100644 --- a/google/cloud/aiplatform_v1/gapic_metadata.json +++ b/google/cloud/aiplatform_v1/gapic_metadata.json @@ -4310,6 +4310,11 @@ "grpc": { "libraryClient": "ReasoningEngineExecutionServiceClient", "rpcs": { + "AsyncQueryReasoningEngine": { + "methods": [ + "async_query_reasoning_engine" + ] + }, "QueryReasoningEngine": { "methods": [ "query_reasoning_engine" @@ -4325,6 +4330,11 @@ "grpc-async": { "libraryClient": "ReasoningEngineExecutionServiceAsyncClient", "rpcs": { + "AsyncQueryReasoningEngine": { + "methods": [ + "async_query_reasoning_engine" + ] + }, "QueryReasoningEngine": { "methods": [ "query_reasoning_engine" @@ -4340,6 +4350,11 @@ "rest": { "libraryClient": "ReasoningEngineExecutionServiceClient", "rpcs": { + "AsyncQueryReasoningEngine": { + "methods": [ + "async_query_reasoning_engine" + ] + }, "QueryReasoningEngine": { "methods": [ "query_reasoning_engine" diff --git a/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/async_client.py b/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/async_client.py index 8323e920f9..1657bda42f 100644 --- a/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/async_client.py @@ -53,6 +53,8 @@ from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore +import google.api_core.operation as operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore import google.protobuf.any_pb2 as any_pb2 # type: ignore import google.protobuf.struct_pb2 as struct_pb2 # type: ignore from .transports.base import ( @@ -561,6 +563,117 @@ async def sample_stream_query_reasoning_engine(): # Done; return the response. return response + async def async_query_reasoning_engine( + self, + request: Optional[ + Union[ + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + dict, + ] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation_async.AsyncOperation: + r"""Async query using a reasoning engine. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1 + + async def sample_async_query_reasoning_engine(): + # Create a client + client = aiplatform_v1.ReasoningEngineExecutionServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1.AsyncQueryReasoningEngineRequest( + name="name_value", + ) + + # Make the request + operation = client.async_query_reasoning_engine(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.cloud.aiplatform_v1.types.AsyncQueryReasoningEngineRequest, dict]]): + The request object. Request message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.aiplatform_v1.types.AsyncQueryReasoningEngineResponse` Response message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + + """ + # Create or coerce a protobuf request object. + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest + ): + request = ( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest( + request + ) + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._client._transport._wrapped_methods[ + self._client._transport.async_query_reasoning_engine + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + reasoning_engine_execution_service.AsyncQueryReasoningEngineResponse, + metadata_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineOperationMetadata, + ) + + # Done; return the response. + return response + async def list_operations( self, request: Optional[operations_pb2.ListOperationsRequest] = None, diff --git a/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/client.py b/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/client.py index cb3e3883b5..dafb51beb3 100644 --- a/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/client.py +++ b/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/client.py @@ -68,6 +68,8 @@ from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore +import google.api_core.operation as operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore import google.protobuf.any_pb2 as any_pb2 # type: ignore import google.protobuf.struct_pb2 as struct_pb2 # type: ignore from .transports.base import ( @@ -1038,6 +1040,117 @@ def sample_stream_query_reasoning_engine(): # Done; return the response. return response + def async_query_reasoning_engine( + self, + request: Optional[ + Union[ + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + dict, + ] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation.Operation: + r"""Async query using a reasoning engine. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1 + + def sample_async_query_reasoning_engine(): + # Create a client + client = aiplatform_v1.ReasoningEngineExecutionServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1.AsyncQueryReasoningEngineRequest( + name="name_value", + ) + + # Make the request + operation = client.async_query_reasoning_engine(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1.types.AsyncQueryReasoningEngineRequest, dict]): + The request object. Request message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.aiplatform_v1.types.AsyncQueryReasoningEngineResponse` Response message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + + """ + # Create or coerce a protobuf request object. + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest + ): + request = ( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest( + request + ) + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.async_query_reasoning_engine + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + reasoning_engine_execution_service.AsyncQueryReasoningEngineResponse, + metadata_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineOperationMetadata, + ) + + # Done; return the response. + return response + def __enter__(self) -> "ReasoningEngineExecutionServiceClient": return self diff --git a/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/base.py b/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/base.py index a428817640..ef64a8b119 100644 --- a/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/base.py @@ -23,6 +23,7 @@ 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 operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore import google.protobuf @@ -152,6 +153,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.async_query_reasoning_engine: gapic_v1.method.wrap_method( + self.async_query_reasoning_engine, + default_timeout=None, + client_info=client_info, + ), self.get_location: gapic_v1.method.wrap_method( self.get_location, default_timeout=None, @@ -213,6 +219,11 @@ def close(self): """ raise NotImplementedError() + @property + def operations_client(self): + """Return the client designed to process long-running operations.""" + raise NotImplementedError() + @property def query_reasoning_engine( self, @@ -234,6 +245,15 @@ def stream_query_reasoning_engine( ]: raise NotImplementedError() + @property + def async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + @property def list_operations( self, diff --git a/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/grpc.py b/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/grpc.py index 2f584f47d4..092271fa04 100644 --- a/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/grpc.py +++ b/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/grpc.py @@ -20,6 +20,7 @@ from typing import Callable, Dict, Optional, Sequence, Tuple, Union from google.api_core import grpc_helpers +from google.api_core import operations_v1 from google.api_core import gapic_v1 import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore @@ -202,6 +203,7 @@ def __init__( self._grpc_channel = None self._ssl_channel_credentials = ssl_channel_credentials self._stubs: Dict[str, Callable] = {} + self._operations_client: Optional[operations_v1.OperationsClient] = None if api_mtls_endpoint: warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) @@ -329,6 +331,22 @@ def grpc_channel(self) -> grpc.Channel: """Return the channel designed to connect to this service.""" return self._grpc_channel + @property + def operations_client(self) -> operations_v1.OperationsClient: + """Create the client designed to process long-running operations. + + This property caches on the instance; repeated calls return the same + client. + """ + # Quick check: Only create a new client if we do not already have one. + if self._operations_client is None: + self._operations_client = operations_v1.OperationsClient( + self._logged_channel + ) + + # Return the client from cache. + return self._operations_client + @property def query_reasoning_engine( self, @@ -389,6 +407,37 @@ def stream_query_reasoning_engine( ) return self._stubs["stream_query_reasoning_engine"] + @property + def async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest], + operations_pb2.Operation, + ]: + r"""Return a callable for the async query reasoning engine method over gRPC. + + Async query using a reasoning engine. + + Returns: + Callable[[~.AsyncQueryReasoningEngineRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "async_query_reasoning_engine" not in self._stubs: + self._stubs["async_query_reasoning_engine"] = ( + self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1.ReasoningEngineExecutionService/AsyncQueryReasoningEngine", + request_serializer=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + ) + return self._stubs["async_query_reasoning_engine"] + def close(self): self._logged_channel.close() diff --git a/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/grpc_asyncio.py index 9368b9a7ac..c8f1da0170 100644 --- a/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/grpc_asyncio.py +++ b/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/grpc_asyncio.py @@ -24,6 +24,7 @@ from google.api_core import grpc_helpers_async from google.api_core import exceptions as core_exceptions from google.api_core import retry_async as retries +from google.api_core import operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.protobuf.json_format import MessageToJson @@ -253,6 +254,7 @@ def __init__( self._grpc_channel = None self._ssl_channel_credentials = ssl_channel_credentials self._stubs: Dict[str, Callable] = {} + self._operations_client: Optional[operations_v1.OperationsAsyncClient] = None if api_mtls_endpoint: warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) @@ -337,6 +339,22 @@ def grpc_channel(self) -> aio.Channel: # Return the channel from cache. return self._grpc_channel + @property + def operations_client(self) -> operations_v1.OperationsAsyncClient: + """Create the client designed to process long-running operations. + + This property caches on the instance; repeated calls return the same + client. + """ + # Quick check: Only create a new client if we do not already have one. + if self._operations_client is None: + self._operations_client = operations_v1.OperationsAsyncClient( + self._logged_channel + ) + + # Return the client from cache. + return self._operations_client + @property def query_reasoning_engine( self, @@ -397,6 +415,37 @@ def stream_query_reasoning_engine( ) return self._stubs["stream_query_reasoning_engine"] + @property + def async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the async query reasoning engine method over gRPC. + + Async query using a reasoning engine. + + Returns: + Callable[[~.AsyncQueryReasoningEngineRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "async_query_reasoning_engine" not in self._stubs: + self._stubs["async_query_reasoning_engine"] = ( + self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1.ReasoningEngineExecutionService/AsyncQueryReasoningEngine", + request_serializer=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + ) + return self._stubs["async_query_reasoning_engine"] + def _prep_wrapped_messages(self, client_info): """Precompute the wrapped methods, overriding the base class method to use async wrappers.""" self._wrapped_methods = { @@ -410,6 +459,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.async_query_reasoning_engine: self._wrap_method( + self.async_query_reasoning_engine, + default_timeout=None, + client_info=client_info, + ), self.get_location: self._wrap_method( self.get_location, default_timeout=None, diff --git a/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/rest.py b/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/rest.py index f5277110eb..4934a84cc1 100644 --- a/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/rest.py @@ -26,6 +26,7 @@ import google.protobuf from google.protobuf import json_format +from google.api_core import operations_v1 from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.cloud.location import locations_pb2 # type: ignore @@ -83,6 +84,14 @@ class ReasoningEngineExecutionServiceRestInterceptor: .. code-block:: python class MyCustomReasoningEngineExecutionServiceInterceptor(ReasoningEngineExecutionServiceRestInterceptor): + def pre_async_query_reasoning_engine(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_async_query_reasoning_engine(self, response): + logging.log(f"Received response: {response}") + return response + def pre_query_reasoning_engine(self, request, metadata): logging.log(f"Received request: {request}") return request, metadata @@ -105,6 +114,55 @@ def post_stream_query_reasoning_engine(self, response): """ + def pre_async_query_reasoning_engine( + self, + request: reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for async_query_reasoning_engine + + Override in a subclass to manipulate the request or metadata + before they are sent to the ReasoningEngineExecutionService server. + """ + return request, metadata + + def post_async_query_reasoning_engine( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for async_query_reasoning_engine + + DEPRECATED. Please use the `post_async_query_reasoning_engine_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the ReasoningEngineExecutionService server but before + it is returned to user code. This `post_async_query_reasoning_engine` interceptor runs + before the `post_async_query_reasoning_engine_with_metadata` interceptor. + """ + return response + + def post_async_query_reasoning_engine_with_metadata( + self, + response: operations_pb2.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for async_query_reasoning_engine + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the ReasoningEngineExecutionService server but before it is returned to user code. + + We recommend only using this `post_async_query_reasoning_engine_with_metadata` + interceptor in new development instead of the `post_async_query_reasoning_engine` interceptor. + When both interceptors are used, this `post_async_query_reasoning_engine_with_metadata` interceptor runs after the + `post_async_query_reasoning_engine` interceptor. The (possibly modified) response returned by + `post_async_query_reasoning_engine` will be passed to + `post_async_query_reasoning_engine_with_metadata`. + """ + return response, metadata + def pre_query_reasoning_engine( self, request: reasoning_engine_execution_service.QueryReasoningEngineRequest, @@ -536,6 +594,7 @@ def __init__( self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST ) + self._operations_client: Optional[operations_v1.AbstractOperationsClient] = None if client_cert_source_for_mtls: self._session.configure_mtls_channel(client_cert_source_for_mtls) self._interceptor = ( @@ -543,227 +602,2380 @@ def __init__( ) self._prep_wrapped_messages(client_info) - class _QueryReasoningEngine( - _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine, - ReasoningEngineExecutionServiceRestStub, - ): - def __hash__(self): - return hash( - "ReasoningEngineExecutionServiceRestTransport.QueryReasoningEngine" - ) - - @staticmethod - def _get_response( - host, - metadata, - query_params, - session, - timeout, - transcoded_request, - body=None, - ): - - uri = transcoded_request["uri"] - method = transcoded_request["method"] - headers = dict(metadata) - headers["Content-Type"] = "application/json" - response = getattr(session, method)( - "{host}{uri}".format(host=host, uri=uri), - timeout=timeout, - headers=headers, - params=rest_helpers.flatten_query_params(query_params, strict=True), - data=body, - ) - return response - - def __call__( - self, - request: reasoning_engine_execution_service.QueryReasoningEngineRequest, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, - metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), - ) -> reasoning_engine_execution_service.QueryReasoningEngineResponse: - r"""Call the query reasoning engine method over HTTP. - - Args: - request (~.reasoning_engine_execution_service.QueryReasoningEngineRequest): - The request object. Request message for - [ReasoningEngineExecutionService.Query][]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be - sent along with the request as metadata. Normally, each value must be of type `str`, - but for metadata keys ending with the suffix `-bin`, the corresponding values must - be of type `bytes`. - - Returns: - ~.reasoning_engine_execution_service.QueryReasoningEngineResponse: - Response message for - [ReasoningEngineExecutionService.Query][] - - """ - - http_options = ( - _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine._get_http_options() - ) - - request, metadata = self._interceptor.pre_query_reasoning_engine( - request, metadata - ) - transcoded_request = _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine._get_transcoded_request( - http_options, request - ) - - body = _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine._get_request_body_json( - transcoded_request - ) - - # Jsonify the query params - query_params = _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine._get_query_params_json( - transcoded_request - ) + @property + def operations_client(self) -> operations_v1.AbstractOperationsClient: + """Create the client designed to process long-running operations. - if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( - logging.DEBUG - ): # pragma: NO COVER - request_url = "{host}{uri}".format( - host=self._host, uri=transcoded_request["uri"] - ) - method = transcoded_request["method"] - try: - request_payload = type(request).to_json(request) - except: - request_payload = None - http_request = { - "payload": request_payload, - "requestMethod": method, - "requestUrl": request_url, - "headers": dict(metadata), - } - _LOGGER.debug( - f"Sending request for google.cloud.aiplatform_v1.ReasoningEngineExecutionServiceClient.QueryReasoningEngine", - extra={ - "serviceName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService", - "rpcName": "QueryReasoningEngine", - "httpRequest": http_request, - "metadata": http_request["headers"], + This property caches on the instance; repeated calls return the same + client. + """ + # Only create a new client if we do not already have one. + if self._operations_client is None: + http_options: Dict[str, List[Dict[str, str]]] = { + "google.longrunning.Operations.CancelOperation": [ + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/operations/*}:cancel", }, - ) - - # Send the request - response = ReasoningEngineExecutionServiceRestTransport._QueryReasoningEngine._get_response( - self._host, - metadata, - query_params, - self._session, - timeout, - transcoded_request, - body, - ) - - # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception - # subclass. - if response.status_code >= 400: - raise core_exceptions.from_http_response(response) - - # Return the response - resp = reasoning_engine_execution_service.QueryReasoningEngineResponse() - pb_resp = ( - reasoning_engine_execution_service.QueryReasoningEngineResponse.pb(resp) - ) - - json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) - - resp = self._interceptor.post_query_reasoning_engine(resp) - response_metadata = [(k, str(v)) for k, v in response.headers.items()] - resp, _ = self._interceptor.post_query_reasoning_engine_with_metadata( - resp, response_metadata - ) - if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( - logging.DEBUG - ): # pragma: NO COVER - try: - response_payload = reasoning_engine_execution_service.QueryReasoningEngineResponse.to_json( - response - ) - except: - response_payload = None - http_response = { - "payload": response_payload, - "headers": dict(response.headers), - "status": response.status_code, - } - _LOGGER.debug( - "Received response for google.cloud.aiplatform_v1.ReasoningEngineExecutionServiceClient.query_reasoning_engine", - extra={ - "serviceName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService", - "rpcName": "QueryReasoningEngine", - "metadata": http_response["headers"], - "httpResponse": http_response, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel", }, - ) - return resp - - class _StreamQueryReasoningEngine( - _BaseReasoningEngineExecutionServiceRestTransport._BaseStreamQueryReasoningEngine, - ReasoningEngineExecutionServiceRestStub, - ): - def __hash__(self): - return hash( - "ReasoningEngineExecutionServiceRestTransport.StreamQueryReasoningEngine" - ) - - @staticmethod - def _get_response( - host, - metadata, - query_params, - session, - timeout, - transcoded_request, - body=None, - ): - - uri = transcoded_request["uri"] - method = transcoded_request["method"] - headers = dict(metadata) - headers["Content-Type"] = "application/json" - response = getattr(session, method)( - "{host}{uri}".format(host=host, uri=uri), - timeout=timeout, - headers=headers, - params=rest_helpers.flatten_query_params(query_params, strict=True), - data=body, - stream=True, - ) - return response - - def __call__( - self, - request: reasoning_engine_execution_service.StreamQueryReasoningEngineRequest, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, - metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), - ) -> rest_streaming.ResponseIterator: - r"""Call the stream query reasoning - engine method over HTTP. - - Args: - request (~.reasoning_engine_execution_service.StreamQueryReasoningEngineRequest): - The request object. Request message for - [ReasoningEngineExecutionService.StreamQuery][]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be - sent along with the request as metadata. Normally, each value must be of type `str`, - but for metadata keys ending with the suffix `-bin`, the corresponding values must - be of type `bytes`. - - Returns: + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/ragEngineConfig/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=reasoningEngines/*/sessions/*/operations/*}:cancel", + }, + ], + "google.longrunning.Operations.DeleteOperation": [ + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=reasoningEngines/*/sessions/*/operations/*}", + }, + ], + "google.longrunning.Operations.GetOperation": [ + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=reasoningEngines/*/sessions/*/operations/*}", + }, + ], + "google.longrunning.Operations.ListOperations": [ + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/agents/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/apps/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/schedules/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/endpoints/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/customJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/indexes/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/migratableResources/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/models/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/studies/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/persistentResources/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/ragEngineConfig}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/schedules/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/specialistPools/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/v1/{name=reasoningEngines/*/sessions/*}/operations", + }, + ], + "google.longrunning.Operations.WaitOperation": [ + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/models/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/ragEngineConfig/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/schedules/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=reasoningEngines/*/sessions/*/operations/*}:wait", + }, + ], + } + + rest_transport = operations_v1.OperationsRestTransport( + host=self._host, + # use the credentials which are saved + credentials=self._credentials, + scopes=self._scopes, + http_options=http_options, + path_prefix="v1", + ) + + self._operations_client = operations_v1.AbstractOperationsClient( + transport=rest_transport + ) + + # Return the client from cache. + return self._operations_client + + class _AsyncQueryReasoningEngine( + _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine, + ReasoningEngineExecutionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineExecutionServiceRestTransport.AsyncQueryReasoningEngine" + ) + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the async query reasoning + engine method over HTTP. + + Args: + request (~.reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest): + The request object. Request message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.operations_pb2.Operation: + This resource represents a + long-running operation that is the + result of a network API call. + + """ + + http_options = ( + _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_http_options() + ) + + request, metadata = self._interceptor.pre_async_query_reasoning_engine( + request, metadata + ) + transcoded_request = _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_transcoded_request( + http_options, request + ) + + body = _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1.ReasoningEngineExecutionServiceClient.AsyncQueryReasoningEngine", + extra={ + "serviceName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService", + "rpcName": "AsyncQueryReasoningEngine", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineExecutionServiceRestTransport._AsyncQueryReasoningEngine._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = operations_pb2.Operation() + json_format.Parse(response.content, resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_async_query_reasoning_engine(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_async_query_reasoning_engine_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1.ReasoningEngineExecutionServiceClient.async_query_reasoning_engine", + extra={ + "serviceName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService", + "rpcName": "AsyncQueryReasoningEngine", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _QueryReasoningEngine( + _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine, + ReasoningEngineExecutionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineExecutionServiceRestTransport.QueryReasoningEngine" + ) + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: reasoning_engine_execution_service.QueryReasoningEngineRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> reasoning_engine_execution_service.QueryReasoningEngineResponse: + r"""Call the query reasoning engine method over HTTP. + + Args: + request (~.reasoning_engine_execution_service.QueryReasoningEngineRequest): + The request object. Request message for + [ReasoningEngineExecutionService.Query][]. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.reasoning_engine_execution_service.QueryReasoningEngineResponse: + Response message for + [ReasoningEngineExecutionService.Query][] + + """ + + http_options = ( + _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine._get_http_options() + ) + + request, metadata = self._interceptor.pre_query_reasoning_engine( + request, metadata + ) + transcoded_request = _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine._get_transcoded_request( + http_options, request + ) + + body = _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1.ReasoningEngineExecutionServiceClient.QueryReasoningEngine", + extra={ + "serviceName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService", + "rpcName": "QueryReasoningEngine", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineExecutionServiceRestTransport._QueryReasoningEngine._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = reasoning_engine_execution_service.QueryReasoningEngineResponse() + pb_resp = ( + reasoning_engine_execution_service.QueryReasoningEngineResponse.pb(resp) + ) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_query_reasoning_engine(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_query_reasoning_engine_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = reasoning_engine_execution_service.QueryReasoningEngineResponse.to_json( + response + ) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1.ReasoningEngineExecutionServiceClient.query_reasoning_engine", + extra={ + "serviceName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService", + "rpcName": "QueryReasoningEngine", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _StreamQueryReasoningEngine( + _BaseReasoningEngineExecutionServiceRestTransport._BaseStreamQueryReasoningEngine, + ReasoningEngineExecutionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineExecutionServiceRestTransport.StreamQueryReasoningEngine" + ) + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + stream=True, + ) + return response + + def __call__( + self, + request: reasoning_engine_execution_service.StreamQueryReasoningEngineRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> rest_streaming.ResponseIterator: + r"""Call the stream query reasoning + engine method over HTTP. + + Args: + request (~.reasoning_engine_execution_service.StreamQueryReasoningEngineRequest): + The request object. Request message for + [ReasoningEngineExecutionService.StreamQuery][]. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: ~.httpbody_pb2.HttpBody: Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be @@ -908,6 +3120,17 @@ def __call__( ) return resp + @property + def async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest], + operations_pb2.Operation, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._AsyncQueryReasoningEngine(self._session, self._host, self._interceptor) # type: ignore + @property def query_reasoning_engine( self, diff --git a/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/rest_asyncio.py index b5494db031..0876c4d1b9 100644 --- a/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/rest_asyncio.py @@ -30,6 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 +from google.api_core import operations_v1 from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.cloud.location import locations_pb2 # type: ignore @@ -39,6 +40,7 @@ import google.protobuf from google.protobuf import json_format +from google.api_core import operations_v1 from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.cloud.location import locations_pb2 # type: ignore @@ -99,6 +101,14 @@ class AsyncReasoningEngineExecutionServiceRestInterceptor: .. code-block:: python class MyCustomReasoningEngineExecutionServiceInterceptor(ReasoningEngineExecutionServiceRestInterceptor): + async def pre_async_query_reasoning_engine(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + async def post_async_query_reasoning_engine(self, response): + logging.log(f"Received response: {response}") + return response + async def pre_query_reasoning_engine(self, request, metadata): logging.log(f"Received request: {request}") return request, metadata @@ -121,6 +131,55 @@ async def post_stream_query_reasoning_engine(self, response): """ + async def pre_async_query_reasoning_engine( + self, + request: reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for async_query_reasoning_engine + + Override in a subclass to manipulate the request or metadata + before they are sent to the ReasoningEngineExecutionService server. + """ + return request, metadata + + async def post_async_query_reasoning_engine( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for async_query_reasoning_engine + + DEPRECATED. Please use the `post_async_query_reasoning_engine_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the ReasoningEngineExecutionService server but before + it is returned to user code. This `post_async_query_reasoning_engine` interceptor runs + before the `post_async_query_reasoning_engine_with_metadata` interceptor. + """ + return response + + async def post_async_query_reasoning_engine_with_metadata( + self, + response: operations_pb2.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for async_query_reasoning_engine + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the ReasoningEngineExecutionService server but before it is returned to user code. + + We recommend only using this `post_async_query_reasoning_engine_with_metadata` + interceptor in new development instead of the `post_async_query_reasoning_engine` interceptor. + When both interceptors are used, this `post_async_query_reasoning_engine_with_metadata` interceptor runs after the + `post_async_query_reasoning_engine` interceptor. The (possibly modified) response returned by + `post_async_query_reasoning_engine` will be passed to + `post_async_query_reasoning_engine_with_metadata`. + """ + return response, metadata + async def pre_query_reasoning_engine( self, request: reasoning_engine_execution_service.QueryReasoningEngineRequest, @@ -539,6 +598,9 @@ def __init__( ) self._wrap_with_kind = True self._prep_wrapped_messages(client_info) + self._operations_client: Optional[operations_v1.AsyncOperationsRestClient] = ( + None + ) def _prep_wrapped_messages(self, client_info): """Precompute the wrapped methods, overriding the base class method to use async wrappers.""" @@ -553,6 +615,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.async_query_reasoning_engine: self._wrap_method( + self.async_query_reasoning_engine, + default_timeout=None, + client_info=client_info, + ), self.get_location: self._wrap_method( self.get_location, default_timeout=None, @@ -610,6 +677,177 @@ def _wrap_method(self, func, *args, **kwargs): kwargs["kind"] = self.kind return gapic_v1.method_async.wrap_method(func, *args, **kwargs) + class _AsyncQueryReasoningEngine( + _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine, + AsyncReasoningEngineExecutionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineExecutionServiceRestTransport.AsyncQueryReasoningEngine" + ) + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + async def __call__( + self, + request: reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the async query reasoning + engine method over HTTP. + + Args: + request (~.reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest): + The request object. Request message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.operations_pb2.Operation: + This resource represents a + long-running operation that is the + result of a network API call. + + """ + + http_options = ( + _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_http_options() + ) + + request, metadata = ( + await self._interceptor.pre_async_query_reasoning_engine( + request, metadata + ) + ) + transcoded_request = _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_transcoded_request( + http_options, request + ) + + body = _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1.ReasoningEngineExecutionServiceClient.AsyncQueryReasoningEngine", + extra={ + "serviceName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService", + "rpcName": "AsyncQueryReasoningEngine", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineExecutionServiceRestTransport._AsyncQueryReasoningEngine._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + # Return the response + resp = operations_pb2.Operation() + pb_resp = resp + content = await response.read() + json_format.Parse(content, pb_resp, ignore_unknown_fields=True) + resp = await self._interceptor.post_async_query_reasoning_engine(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + await self._interceptor.post_async_query_reasoning_engine_with_metadata( + resp, response_metadata + ) + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": "OK", # need to obtain this properly + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1.ReasoningEngineExecutionServiceAsyncClient.async_query_reasoning_engine", + extra={ + "serviceName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService", + "rpcName": "AsyncQueryReasoningEngine", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + + return resp + class _QueryReasoningEngine( _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine, AsyncReasoningEngineExecutionServiceRestStub, @@ -990,6 +1228,2008 @@ async def __call__( return resp + @property + def operations_client(self) -> AsyncOperationsRestClient: + """Create the async client designed to process long-running operations. + + This property caches on the instance; repeated calls return the same + client. + """ + # Only create a new client if we do not already have one. + if self._operations_client is None: + http_options: Dict[str, List[Dict[str, str]]] = { + "google.longrunning.Operations.CancelOperation": [ + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/ragEngineConfig/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1/{name=reasoningEngines/*/sessions/*/operations/*}:cancel", + }, + ], + "google.longrunning.Operations.DeleteOperation": [ + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1/{name=reasoningEngines/*/sessions/*/operations/*}", + }, + ], + "google.longrunning.Operations.GetOperation": [ + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1/{name=reasoningEngines/*/sessions/*/operations/*}", + }, + ], + "google.longrunning.Operations.ListOperations": [ + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/agents/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/apps/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/schedules/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/endpoints/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/customJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/indexes/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/migratableResources/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/models/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/models/*/evaluations/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimes/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/studies/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/persistentResources/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/ragEngineConfig}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/schedules/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/specialistPools/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/v1/{name=reasoningEngines/*/sessions/*}/operations", + }, + ], + "google.longrunning.Operations.WaitOperation": [ + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/models/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/ragEngineConfig/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/schedules/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1/{name=reasoningEngines/*/sessions/*/operations/*}:wait", + }, + ], + } + + rest_transport = operations_v1.AsyncOperationsRestTransport( # type: ignore + host=self._host, + # use the credentials which are saved + credentials=self._credentials, # type: ignore + http_options=http_options, + path_prefix="v1", + ) + + self._operations_client = AsyncOperationsRestClient( + transport=rest_transport + ) + + # Return the client from cache. + return self._operations_client + + @property + def async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest], + operations_pb2.Operation, + ]: + return self._AsyncQueryReasoningEngine(self._session, self._host, self._interceptor) # type: ignore + @property def query_reasoning_engine( self, diff --git a/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/rest_base.py b/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/rest_base.py index 0942df0627..68ab560759 100644 --- a/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1/services/reasoning_engine_execution_service/transports/rest_base.py @@ -96,6 +96,72 @@ def __init__( api_audience=api_audience, ) + class _BaseAsyncQueryReasoningEngine: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/v1/{name=projects/*/locations/*/reasoningEngines/*}:asyncQuery", + "body": "*", + }, + { + "method": "post", + "uri": "/v1/{name=reasoningEngines/*}:asyncQuery", + "body": "*", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = ( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest.pb( + request + ) + ) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=True + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=True, + ) + ) + query_params.update( + _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_unset_required_fields( + query_params + ) + ) + + query_params["$alt"] = "json;enum-encoding=int" + return query_params + class _BaseQueryReasoningEngine: def __hash__(self): # pragma: NO COVER return NotImplementedError("__hash__ must be implemented.") diff --git a/google/cloud/aiplatform_v1/types/__init__.py b/google/cloud/aiplatform_v1/types/__init__.py index a71bd56311..4edbfef98b 100644 --- a/google/cloud/aiplatform_v1/types/__init__.py +++ b/google/cloud/aiplatform_v1/types/__init__.py @@ -214,6 +214,9 @@ EvaluatedAnnotationExplanation, ) from .evaluation_service import ( + AggregationOutput, + AggregationResult, + AutoraterConfig, BleuInput, BleuInstance, BleuMetricValue, @@ -227,8 +230,14 @@ CometInstance, CometResult, CometSpec, + ComputationBasedMetricSpec, + ContentMap, + CustomOutput, + CustomOutputFormatConfig, + EvaluateDatasetResponse, EvaluateInstancesRequest, EvaluateInstancesResponse, + EvaluationDataset, ExactMatchInput, ExactMatchInstance, ExactMatchMetricValue, @@ -246,10 +255,15 @@ GroundednessInstance, GroundednessResult, GroundednessSpec, + LLMBasedMetricSpec, + Metric, + MetricResult, MetricxInput, MetricxInstance, MetricxResult, MetricxSpec, + OutputConfig, + OutputInfo, PairwiseMetricInput, PairwiseMetricInstance, PairwiseMetricResult, @@ -266,6 +280,7 @@ PointwiseMetricInstance, PointwiseMetricResult, PointwiseMetricSpec, + PredefinedMetricSpec, QuestionAnsweringCorrectnessInput, QuestionAnsweringCorrectnessInstance, QuestionAnsweringCorrectnessResult, @@ -282,6 +297,7 @@ QuestionAnsweringRelevanceInstance, QuestionAnsweringRelevanceResult, QuestionAnsweringRelevanceSpec, + RawOutput, RougeInput, RougeInstance, RougeMetricValue, @@ -952,6 +968,9 @@ ReasoningEngineSpec, ) from .reasoning_engine_execution_service import ( + AsyncQueryReasoningEngineOperationMetadata, + AsyncQueryReasoningEngineRequest, + AsyncQueryReasoningEngineResponse, QueryReasoningEngineRequest, QueryReasoningEngineResponse, StreamQueryReasoningEngineRequest, @@ -1136,6 +1155,8 @@ TrainingPipeline, ) from .tuning_job import ( + EvaluateDatasetRun, + EvaluationConfig, PreTunedModel, SupervisedHyperParameters, SupervisedTuningDatasetDistribution, @@ -1392,6 +1413,9 @@ "ErrorAnalysisAnnotation", "EvaluatedAnnotation", "EvaluatedAnnotationExplanation", + "AggregationOutput", + "AggregationResult", + "AutoraterConfig", "BleuInput", "BleuInstance", "BleuMetricValue", @@ -1405,8 +1429,14 @@ "CometInstance", "CometResult", "CometSpec", + "ComputationBasedMetricSpec", + "ContentMap", + "CustomOutput", + "CustomOutputFormatConfig", + "EvaluateDatasetResponse", "EvaluateInstancesRequest", "EvaluateInstancesResponse", + "EvaluationDataset", "ExactMatchInput", "ExactMatchInstance", "ExactMatchMetricValue", @@ -1424,10 +1454,15 @@ "GroundednessInstance", "GroundednessResult", "GroundednessSpec", + "LLMBasedMetricSpec", + "Metric", + "MetricResult", "MetricxInput", "MetricxInstance", "MetricxResult", "MetricxSpec", + "OutputConfig", + "OutputInfo", "PairwiseMetricInput", "PairwiseMetricInstance", "PairwiseMetricResult", @@ -1444,6 +1479,7 @@ "PointwiseMetricInstance", "PointwiseMetricResult", "PointwiseMetricSpec", + "PredefinedMetricSpec", "QuestionAnsweringCorrectnessInput", "QuestionAnsweringCorrectnessInstance", "QuestionAnsweringCorrectnessResult", @@ -1460,6 +1496,7 @@ "QuestionAnsweringRelevanceInstance", "QuestionAnsweringRelevanceResult", "QuestionAnsweringRelevanceSpec", + "RawOutput", "RougeInput", "RougeInstance", "RougeMetricValue", @@ -1998,6 +2035,9 @@ "PublisherModel", "ReasoningEngine", "ReasoningEngineSpec", + "AsyncQueryReasoningEngineOperationMetadata", + "AsyncQueryReasoningEngineRequest", + "AsyncQueryReasoningEngineResponse", "QueryReasoningEngineRequest", "QueryReasoningEngineResponse", "StreamQueryReasoningEngineRequest", @@ -2142,6 +2182,8 @@ "StratifiedSplit", "TimestampSplit", "TrainingPipeline", + "EvaluateDatasetRun", + "EvaluationConfig", "PreTunedModel", "SupervisedHyperParameters", "SupervisedTuningDatasetDistribution", diff --git a/google/cloud/aiplatform_v1/types/evaluation_service.py b/google/cloud/aiplatform_v1/types/evaluation_service.py index 4518f716e4..9ba05390ac 100644 --- a/google/cloud/aiplatform_v1/types/evaluation_service.py +++ b/google/cloud/aiplatform_v1/types/evaluation_service.py @@ -19,13 +19,30 @@ import proto # type: ignore +from google.cloud.aiplatform_v1.types import content +from google.cloud.aiplatform_v1.types import io +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore + __protobuf__ = proto.module( package="google.cloud.aiplatform.v1", manifest={ "PairwiseChoice", "EvaluateInstancesRequest", + "Metric", + "AutoraterConfig", "EvaluateInstancesResponse", + "MetricResult", + "OutputConfig", + "EvaluationDataset", + "EvaluateDatasetResponse", + "OutputInfo", + "AggregationOutput", + "AggregationResult", + "PredefinedMetricSpec", + "ComputationBasedMetricSpec", + "LLMBasedMetricSpec", "ExactMatchInput", "ExactMatchInstance", "ExactMatchSpec", @@ -100,7 +117,10 @@ "PointwiseMetricInput", "PointwiseMetricInstance", "PointwiseMetricSpec", + "CustomOutputFormatConfig", "PointwiseMetricResult", + "CustomOutput", + "RawOutput", "PairwiseMetricInput", "PairwiseMetricInstance", "PairwiseMetricSpec", @@ -133,6 +153,7 @@ "MetricxSpec", "MetricxInstance", "MetricxResult", + "ContentMap", }, ) @@ -450,6 +471,218 @@ class EvaluateInstancesRequest(proto.Message): ) +class Metric(proto.Message): + r"""The metric used for running evaluations. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + predefined_metric_spec (google.cloud.aiplatform_v1.types.PredefinedMetricSpec): + The spec for a pre-defined metric. + + This field is a member of `oneof`_ ``metric_spec``. + computation_based_metric_spec (google.cloud.aiplatform_v1.types.ComputationBasedMetricSpec): + Spec for a computation based metric. + + This field is a member of `oneof`_ ``metric_spec``. + llm_based_metric_spec (google.cloud.aiplatform_v1.types.LLMBasedMetricSpec): + Spec for an LLM based metric. + + This field is a member of `oneof`_ ``metric_spec``. + pointwise_metric_spec (google.cloud.aiplatform_v1.types.PointwiseMetricSpec): + Spec for pointwise metric. + + This field is a member of `oneof`_ ``metric_spec``. + pairwise_metric_spec (google.cloud.aiplatform_v1.types.PairwiseMetricSpec): + Spec for pairwise metric. + + This field is a member of `oneof`_ ``metric_spec``. + exact_match_spec (google.cloud.aiplatform_v1.types.ExactMatchSpec): + Spec for exact match metric. + + This field is a member of `oneof`_ ``metric_spec``. + bleu_spec (google.cloud.aiplatform_v1.types.BleuSpec): + Spec for bleu metric. + + This field is a member of `oneof`_ ``metric_spec``. + rouge_spec (google.cloud.aiplatform_v1.types.RougeSpec): + Spec for rouge metric. + + This field is a member of `oneof`_ ``metric_spec``. + aggregation_metrics (MutableSequence[google.cloud.aiplatform_v1.types.Metric.AggregationMetric]): + Optional. The aggregation metrics to use. + """ + + class AggregationMetric(proto.Enum): + r"""The per-metric statistics on evaluation results supported by + ``EvaluationService.EvaluateDataset``. + + Values: + AGGREGATION_METRIC_UNSPECIFIED (0): + Unspecified aggregation metric. + AVERAGE (1): + Average aggregation metric. Not supported for + Pairwise metric. + MODE (2): + Mode aggregation metric. + STANDARD_DEVIATION (3): + Standard deviation aggregation metric. Not + supported for pairwise metric. + VARIANCE (4): + Variance aggregation metric. Not supported + for pairwise metric. + MINIMUM (5): + Minimum aggregation metric. Not supported for + pairwise metric. + MAXIMUM (6): + Maximum aggregation metric. Not supported for + pairwise metric. + MEDIAN (7): + Median aggregation metric. Not supported for + pairwise metric. + PERCENTILE_P90 (8): + 90th percentile aggregation metric. Not + supported for pairwise metric. + PERCENTILE_P95 (9): + 95th percentile aggregation metric. Not + supported for pairwise metric. + PERCENTILE_P99 (10): + 99th percentile aggregation metric. Not + supported for pairwise metric. + """ + + AGGREGATION_METRIC_UNSPECIFIED = 0 + AVERAGE = 1 + MODE = 2 + STANDARD_DEVIATION = 3 + VARIANCE = 4 + MINIMUM = 5 + MAXIMUM = 6 + MEDIAN = 7 + PERCENTILE_P90 = 8 + PERCENTILE_P95 = 9 + PERCENTILE_P99 = 10 + + predefined_metric_spec: "PredefinedMetricSpec" = proto.Field( + proto.MESSAGE, + number=8, + oneof="metric_spec", + message="PredefinedMetricSpec", + ) + computation_based_metric_spec: "ComputationBasedMetricSpec" = proto.Field( + proto.MESSAGE, + number=9, + oneof="metric_spec", + message="ComputationBasedMetricSpec", + ) + llm_based_metric_spec: "LLMBasedMetricSpec" = proto.Field( + proto.MESSAGE, + number=10, + oneof="metric_spec", + message="LLMBasedMetricSpec", + ) + pointwise_metric_spec: "PointwiseMetricSpec" = proto.Field( + proto.MESSAGE, + number=2, + oneof="metric_spec", + message="PointwiseMetricSpec", + ) + pairwise_metric_spec: "PairwiseMetricSpec" = proto.Field( + proto.MESSAGE, + number=3, + oneof="metric_spec", + message="PairwiseMetricSpec", + ) + exact_match_spec: "ExactMatchSpec" = proto.Field( + proto.MESSAGE, + number=4, + oneof="metric_spec", + message="ExactMatchSpec", + ) + bleu_spec: "BleuSpec" = proto.Field( + proto.MESSAGE, + number=5, + oneof="metric_spec", + message="BleuSpec", + ) + rouge_spec: "RougeSpec" = proto.Field( + proto.MESSAGE, + number=6, + oneof="metric_spec", + message="RougeSpec", + ) + aggregation_metrics: MutableSequence[AggregationMetric] = proto.RepeatedField( + proto.ENUM, + number=1, + enum=AggregationMetric, + ) + + +class AutoraterConfig(proto.Message): + r"""The configs for autorater. This is applicable to both + EvaluateInstances and EvaluateDataset. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + sampling_count (int): + Optional. Number of samples for each instance + in the dataset. If not specified, the default is + 4. Minimum value is 1, maximum value is 32. + + This field is a member of `oneof`_ ``_sampling_count``. + flip_enabled (bool): + Optional. Default is true. Whether to flip the candidate and + baseline responses. This is only applicable to the pairwise + metric. If enabled, also provide + PairwiseMetricSpec.candidate_response_field_name and + PairwiseMetricSpec.baseline_response_field_name. When + rendering PairwiseMetricSpec.metric_prompt_template, the + candidate and baseline fields will be flipped for half of + the samples to reduce bias. + + This field is a member of `oneof`_ ``_flip_enabled``. + autorater_model (str): + Optional. The fully qualified name of the publisher model or + tuned autorater endpoint to use. + + Publisher model format: + ``projects/{project}/locations/{location}/publishers/*/models/*`` + + Tuned model endpoint format: + ``projects/{project}/locations/{location}/endpoints/{endpoint}`` + generation_config (google.cloud.aiplatform_v1.types.GenerationConfig): + Optional. Configuration options for model + generation and outputs. + """ + + sampling_count: int = proto.Field( + proto.INT32, + number=1, + optional=True, + ) + flip_enabled: bool = proto.Field( + proto.BOOL, + number=2, + optional=True, + ) + autorater_model: str = proto.Field( + proto.STRING, + number=3, + ) + generation_config: content.GenerationConfig = proto.Field( + proto.MESSAGE, + number=4, + message=content.GenerationConfig, + ) + + class EvaluateInstancesResponse(proto.Message): r"""Response message for EvaluationService.EvaluateInstances. @@ -575,6 +808,11 @@ class EvaluateInstancesResponse(proto.Message): Result for Metricx metric. This field is a member of `oneof`_ ``evaluation_results``. + metric_results (MutableSequence[google.cloud.aiplatform_v1.types.MetricResult]): + Metric results for each instance. + The order of the metric results is guaranteed to + be the same as the order of the instances in the + request. """ exact_match_results: "ExactMatchResults" = proto.Field( @@ -737,6 +975,407 @@ class EvaluateInstancesResponse(proto.Message): oneof="evaluation_results", message="MetricxResult", ) + metric_results: MutableSequence["MetricResult"] = proto.RepeatedField( + proto.MESSAGE, + number=43, + message="MetricResult", + ) + + +class MetricResult(proto.Message): + r"""Result for a single metric on a single instance. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + score (float): + Output only. The score for the metric. + Please refer to each metric's documentation for + the meaning of the score. + + This field is a member of `oneof`_ ``_score``. + explanation (str): + Output only. The explanation for the metric + result. + + This field is a member of `oneof`_ ``_explanation``. + error (google.rpc.status_pb2.Status): + Output only. The error status for the metric + result. + + This field is a member of `oneof`_ ``_error``. + """ + + score: float = proto.Field( + proto.FLOAT, + number=1, + optional=True, + ) + explanation: str = proto.Field( + proto.STRING, + number=3, + optional=True, + ) + error: status_pb2.Status = proto.Field( + proto.MESSAGE, + number=4, + optional=True, + message=status_pb2.Status, + ) + + +class OutputConfig(proto.Message): + r"""Config for evaluation output. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + gcs_destination (google.cloud.aiplatform_v1.types.GcsDestination): + Cloud storage destination for evaluation + output. + + This field is a member of `oneof`_ ``destination``. + """ + + gcs_destination: io.GcsDestination = proto.Field( + proto.MESSAGE, + number=1, + oneof="destination", + message=io.GcsDestination, + ) + + +class EvaluationDataset(proto.Message): + r"""The dataset used for evaluation. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + gcs_source (google.cloud.aiplatform_v1.types.GcsSource): + Cloud storage source holds the dataset. + Currently only one Cloud Storage file path is + supported. + + This field is a member of `oneof`_ ``source``. + bigquery_source (google.cloud.aiplatform_v1.types.BigQuerySource): + BigQuery source holds the dataset. + + This field is a member of `oneof`_ ``source``. + """ + + gcs_source: io.GcsSource = proto.Field( + proto.MESSAGE, + number=1, + oneof="source", + message=io.GcsSource, + ) + bigquery_source: io.BigQuerySource = proto.Field( + proto.MESSAGE, + number=2, + oneof="source", + message=io.BigQuerySource, + ) + + +class EvaluateDatasetResponse(proto.Message): + r"""The results from an evaluation run performed by the + EvaluationService. + + Attributes: + aggregation_output (google.cloud.aiplatform_v1.types.AggregationOutput): + Output only. Aggregation statistics derived + from results of EvaluationService. + output_info (google.cloud.aiplatform_v1.types.OutputInfo): + Output only. Output info for + EvaluationService. + """ + + aggregation_output: "AggregationOutput" = proto.Field( + proto.MESSAGE, + number=1, + message="AggregationOutput", + ) + output_info: "OutputInfo" = proto.Field( + proto.MESSAGE, + number=3, + message="OutputInfo", + ) + + +class OutputInfo(proto.Message): + r"""Describes the info for output of EvaluationService. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + gcs_output_directory (str): + Output only. The full path of the Cloud + Storage directory created, into which the + evaluation results and aggregation results are + written. + + This field is a member of `oneof`_ ``output_location``. + """ + + gcs_output_directory: str = proto.Field( + proto.STRING, + number=1, + oneof="output_location", + ) + + +class AggregationOutput(proto.Message): + r"""The aggregation result for the entire dataset and all + metrics. + + Attributes: + dataset (google.cloud.aiplatform_v1.types.EvaluationDataset): + The dataset used for evaluation & + aggregation. + aggregation_results (MutableSequence[google.cloud.aiplatform_v1.types.AggregationResult]): + One AggregationResult per metric. + """ + + dataset: "EvaluationDataset" = proto.Field( + proto.MESSAGE, + number=1, + message="EvaluationDataset", + ) + aggregation_results: MutableSequence["AggregationResult"] = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="AggregationResult", + ) + + +class AggregationResult(proto.Message): + r"""The aggregation result for a single metric. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + pointwise_metric_result (google.cloud.aiplatform_v1.types.PointwiseMetricResult): + Result for pointwise metric. + + This field is a member of `oneof`_ ``aggregation_result``. + pairwise_metric_result (google.cloud.aiplatform_v1.types.PairwiseMetricResult): + Result for pairwise metric. + + This field is a member of `oneof`_ ``aggregation_result``. + exact_match_metric_value (google.cloud.aiplatform_v1.types.ExactMatchMetricValue): + Results for exact match metric. + + This field is a member of `oneof`_ ``aggregation_result``. + bleu_metric_value (google.cloud.aiplatform_v1.types.BleuMetricValue): + Results for bleu metric. + + This field is a member of `oneof`_ ``aggregation_result``. + rouge_metric_value (google.cloud.aiplatform_v1.types.RougeMetricValue): + Results for rouge metric. + + This field is a member of `oneof`_ ``aggregation_result``. + aggregation_metric (google.cloud.aiplatform_v1.types.Metric.AggregationMetric): + Aggregation metric. + """ + + pointwise_metric_result: "PointwiseMetricResult" = proto.Field( + proto.MESSAGE, + number=5, + oneof="aggregation_result", + message="PointwiseMetricResult", + ) + pairwise_metric_result: "PairwiseMetricResult" = proto.Field( + proto.MESSAGE, + number=6, + oneof="aggregation_result", + message="PairwiseMetricResult", + ) + exact_match_metric_value: "ExactMatchMetricValue" = proto.Field( + proto.MESSAGE, + number=7, + oneof="aggregation_result", + message="ExactMatchMetricValue", + ) + bleu_metric_value: "BleuMetricValue" = proto.Field( + proto.MESSAGE, + number=8, + oneof="aggregation_result", + message="BleuMetricValue", + ) + rouge_metric_value: "RougeMetricValue" = proto.Field( + proto.MESSAGE, + number=9, + oneof="aggregation_result", + message="RougeMetricValue", + ) + aggregation_metric: "Metric.AggregationMetric" = proto.Field( + proto.ENUM, + number=4, + enum="Metric.AggregationMetric", + ) + + +class PredefinedMetricSpec(proto.Message): + r"""The spec for a pre-defined metric. + + Attributes: + metric_spec_name (str): + Required. The name of a pre-defined metric, such as + "instruction_following_v1" or "text_quality_v1". + metric_spec_parameters (google.protobuf.struct_pb2.Struct): + Optional. The parameters needed to run the + pre-defined metric. + """ + + metric_spec_name: str = proto.Field( + proto.STRING, + number=1, + ) + metric_spec_parameters: struct_pb2.Struct = proto.Field( + proto.MESSAGE, + number=2, + message=struct_pb2.Struct, + ) + + +class ComputationBasedMetricSpec(proto.Message): + r"""Specification for a computation based metric. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + type_ (google.cloud.aiplatform_v1.types.ComputationBasedMetricSpec.ComputationBasedMetricType): + Required. The type of the computation based + metric. + + This field is a member of `oneof`_ ``_type``. + parameters (google.protobuf.struct_pb2.Struct): + Optional. A map of parameters for the metric, e.g. + {"rouge_type": "rougeL"}. + + This field is a member of `oneof`_ ``_parameters``. + """ + + class ComputationBasedMetricType(proto.Enum): + r"""Types of computation based metrics. + + Values: + COMPUTATION_BASED_METRIC_TYPE_UNSPECIFIED (0): + Unspecified computation based metric type. + EXACT_MATCH (1): + Exact match metric. + BLEU (2): + BLEU metric. + ROUGE (3): + ROUGE metric. + """ + + COMPUTATION_BASED_METRIC_TYPE_UNSPECIFIED = 0 + EXACT_MATCH = 1 + BLEU = 2 + ROUGE = 3 + + type_: ComputationBasedMetricType = proto.Field( + proto.ENUM, + number=1, + optional=True, + enum=ComputationBasedMetricType, + ) + parameters: struct_pb2.Struct = proto.Field( + proto.MESSAGE, + number=2, + optional=True, + message=struct_pb2.Struct, + ) + + +class LLMBasedMetricSpec(proto.Message): + r"""Specification for an LLM based metric. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + rubric_group_key (str): + Use a pre-defined group of rubrics associated with the + input. Refers to a key in the rubric_groups map of + EvaluationInstance. + + This field is a member of `oneof`_ ``rubrics_source``. + predefined_rubric_generation_spec (google.cloud.aiplatform_v1.types.PredefinedMetricSpec): + Dynamically generate rubrics using a + predefined spec. + + This field is a member of `oneof`_ ``rubrics_source``. + metric_prompt_template (str): + Required. Template for the prompt sent to the + judge model. + + This field is a member of `oneof`_ ``_metric_prompt_template``. + system_instruction (str): + Optional. System instructions for the judge + model. + + This field is a member of `oneof`_ ``_system_instruction``. + judge_autorater_config (google.cloud.aiplatform_v1.types.AutoraterConfig): + Optional. Optional configuration for the + judge LLM (Autorater). + + This field is a member of `oneof`_ ``_judge_autorater_config``. + additional_config (google.protobuf.struct_pb2.Struct): + Optional. Optional additional configuration + for the metric. + + This field is a member of `oneof`_ ``_additional_config``. + """ + + rubric_group_key: str = proto.Field( + proto.STRING, + number=4, + oneof="rubrics_source", + ) + predefined_rubric_generation_spec: "PredefinedMetricSpec" = proto.Field( + proto.MESSAGE, + number=6, + oneof="rubrics_source", + message="PredefinedMetricSpec", + ) + metric_prompt_template: str = proto.Field( + proto.STRING, + number=1, + optional=True, + ) + system_instruction: str = proto.Field( + proto.STRING, + number=2, + optional=True, + ) + judge_autorater_config: "AutoraterConfig" = proto.Field( + proto.MESSAGE, + number=3, + optional=True, + message="AutoraterConfig", + ) + additional_config: struct_pb2.Struct = proto.Field( + proto.MESSAGE, + number=7, + optional=True, + message=struct_pb2.Struct, + ) class ExactMatchInput(proto.Message): @@ -2735,6 +3374,10 @@ class PointwiseMetricInstance(proto.Message): r"""Pointwise metric instance. Usually one instance corresponds to one row in an evaluation dataset. + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -2744,6 +3387,14 @@ class PointwiseMetricInstance(proto.Message): are expected in the json_instance to render PointwiseMetricSpec.instance_prompt_template. + This field is a member of `oneof`_ ``instance``. + content_map_instance (google.cloud.aiplatform_v1.types.ContentMap): + Key-value contents for the mutlimodality + input, including text, image, video, audio, and + pdf, etc. The key is placeholder in metric + prompt template, and the value is the multimodal + content. + This field is a member of `oneof`_ ``instance``. """ @@ -2752,6 +3403,12 @@ class PointwiseMetricInstance(proto.Message): number=1, oneof="instance", ) + content_map_instance: "ContentMap" = proto.Field( + proto.MESSAGE, + number=2, + oneof="instance", + message="ContentMap", + ) class PointwiseMetricSpec(proto.Message): @@ -2765,6 +3422,21 @@ class PointwiseMetricSpec(proto.Message): pointwise metric. This field is a member of `oneof`_ ``_metric_prompt_template``. + system_instruction (str): + Optional. System instructions for pointwise + metric. + + This field is a member of `oneof`_ ``_system_instruction``. + custom_output_format_config (google.cloud.aiplatform_v1.types.CustomOutputFormatConfig): + Optional. CustomOutputFormatConfig allows customization of + metric output. By default, metrics return a score and + explanation. When this config is set, the default output is + replaced with either: + + - The raw output string. + - A parsed output based on a user-defined schema. If a + custom format is chosen, the ``score`` and ``explanation`` + fields in the corresponding metric result will be empty. """ metric_prompt_template: str = proto.Field( @@ -2772,6 +3444,35 @@ class PointwiseMetricSpec(proto.Message): number=1, optional=True, ) + system_instruction: str = proto.Field( + proto.STRING, + number=2, + optional=True, + ) + custom_output_format_config: "CustomOutputFormatConfig" = proto.Field( + proto.MESSAGE, + number=3, + message="CustomOutputFormatConfig", + ) + + +class CustomOutputFormatConfig(proto.Message): + r"""Spec for custom output format configuration. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + return_raw_output (bool): + Optional. Whether to return raw output. + + This field is a member of `oneof`_ ``custom_output_format_config``. + """ + + return_raw_output: bool = proto.Field( + proto.BOOL, + number=1, + oneof="custom_output_format_config", + ) class PointwiseMetricResult(proto.Message): @@ -2787,6 +3488,8 @@ class PointwiseMetricResult(proto.Message): explanation (str): Output only. Explanation for pointwise metric score. + custom_output (google.cloud.aiplatform_v1.types.CustomOutput): + Output only. Spec for custom output. """ score: float = proto.Field( @@ -2798,6 +3501,45 @@ class PointwiseMetricResult(proto.Message): proto.STRING, number=2, ) + custom_output: "CustomOutput" = proto.Field( + proto.MESSAGE, + number=3, + message="CustomOutput", + ) + + +class CustomOutput(proto.Message): + r"""Spec for custom output. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + raw_outputs (google.cloud.aiplatform_v1.types.RawOutput): + Output only. List of raw output strings. + + This field is a member of `oneof`_ ``custom_output``. + """ + + raw_outputs: "RawOutput" = proto.Field( + proto.MESSAGE, + number=1, + oneof="custom_output", + message="RawOutput", + ) + + +class RawOutput(proto.Message): + r"""Raw output. + + Attributes: + raw_output (MutableSequence[str]): + Output only. Raw output string. + """ + + raw_output: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=1, + ) class PairwiseMetricInput(proto.Message): @@ -2826,6 +3568,10 @@ class PairwiseMetricInstance(proto.Message): r"""Pairwise metric instance. Usually one instance corresponds to one row in an evaluation dataset. + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -2835,6 +3581,14 @@ class PairwiseMetricInstance(proto.Message): are expected in the json_instance to render PairwiseMetricSpec.instance_prompt_template. + This field is a member of `oneof`_ ``instance``. + content_map_instance (google.cloud.aiplatform_v1.types.ContentMap): + Key-value contents for the mutlimodality + input, including text, image, video, audio, and + pdf, etc. The key is placeholder in metric + prompt template, and the value is the multimodal + content. + This field is a member of `oneof`_ ``instance``. """ @@ -2843,6 +3597,12 @@ class PairwiseMetricInstance(proto.Message): number=1, oneof="instance", ) + content_map_instance: "ContentMap" = proto.Field( + proto.MESSAGE, + number=2, + oneof="instance", + message="ContentMap", + ) class PairwiseMetricSpec(proto.Message): @@ -2856,6 +3616,23 @@ class PairwiseMetricSpec(proto.Message): metric. This field is a member of `oneof`_ ``_metric_prompt_template``. + candidate_response_field_name (str): + Optional. The field name of the candidate + response. + baseline_response_field_name (str): + Optional. The field name of the baseline + response. + system_instruction (str): + Optional. System instructions for pairwise + metric. + + This field is a member of `oneof`_ ``_system_instruction``. + custom_output_format_config (google.cloud.aiplatform_v1.types.CustomOutputFormatConfig): + Optional. CustomOutputFormatConfig allows customization of + metric output. When this config is set, the default output + is replaced with the raw output string. If a custom format + is chosen, the ``pairwise_choice`` and ``explanation`` + fields in the corresponding metric result will be empty. """ metric_prompt_template: str = proto.Field( @@ -2863,6 +3640,24 @@ class PairwiseMetricSpec(proto.Message): number=1, optional=True, ) + candidate_response_field_name: str = proto.Field( + proto.STRING, + number=2, + ) + baseline_response_field_name: str = proto.Field( + proto.STRING, + number=3, + ) + system_instruction: str = proto.Field( + proto.STRING, + number=4, + optional=True, + ) + custom_output_format_config: "CustomOutputFormatConfig" = proto.Field( + proto.MESSAGE, + number=5, + message="CustomOutputFormatConfig", + ) class PairwiseMetricResult(proto.Message): @@ -2874,6 +3669,8 @@ class PairwiseMetricResult(proto.Message): explanation (str): Output only. Explanation for pairwise metric score. + custom_output (google.cloud.aiplatform_v1.types.CustomOutput): + Output only. Spec for custom output. """ pairwise_choice: "PairwiseChoice" = proto.Field( @@ -2885,6 +3682,11 @@ class PairwiseMetricResult(proto.Message): proto.STRING, number=2, ) + custom_output: "CustomOutput" = proto.Field( + proto.MESSAGE, + number=3, + message="CustomOutput", + ) class ToolCallValidInput(proto.Message): @@ -3541,4 +4343,35 @@ class MetricxResult(proto.Message): ) +class ContentMap(proto.Message): + r"""Map of placeholder in metric prompt template to contents of + model input. + + Attributes: + values (MutableMapping[str, google.cloud.aiplatform_v1.types.ContentMap.Contents]): + Optional. Map of placeholder to contents. + """ + + class Contents(proto.Message): + r"""Repeated Content type. + + Attributes: + contents (MutableSequence[google.cloud.aiplatform_v1.types.Content]): + Optional. Repeated contents. + """ + + contents: MutableSequence[content.Content] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=content.Content, + ) + + values: MutableMapping[str, Contents] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=1, + message=Contents, + ) + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1/types/model_service.py b/google/cloud/aiplatform_v1/types/model_service.py index 75f76d80f7..3ecc76c8b5 100644 --- a/google/cloud/aiplatform_v1/types/model_service.py +++ b/google/cloud/aiplatform_v1/types/model_service.py @@ -840,6 +840,19 @@ class CopyModelRequest(proto.Message): Customer-managed encryption key options. If this is set, then the Model copy will be encrypted with the provided encryption key. + custom_service_account (str): + Optional. The user-provided custom service account to use to + do the copy model. If empty, `Vertex AI Service + Agent `__ + will be used to access resources needed to upload the model. + This account must belong to the destination project where + the model is copied to, i.e., the project specified in the + ``parent`` field of this request and have the Vertex AI + Service Agent role in the source project. + + Requires the user copying the Model to have the + ``iam.serviceAccounts.actAs`` permission on this service + account. """ model_id: str = proto.Field( @@ -865,6 +878,10 @@ class CopyModelRequest(proto.Message): number=3, message=gca_encryption_spec.EncryptionSpec, ) + custom_service_account: str = proto.Field( + proto.STRING, + number=7, + ) class CopyModelOperationMetadata(proto.Message): diff --git a/google/cloud/aiplatform_v1/types/reasoning_engine_execution_service.py b/google/cloud/aiplatform_v1/types/reasoning_engine_execution_service.py index fa0427ba45..fe8fe31e20 100644 --- a/google/cloud/aiplatform_v1/types/reasoning_engine_execution_service.py +++ b/google/cloud/aiplatform_v1/types/reasoning_engine_execution_service.py @@ -19,6 +19,7 @@ import proto # type: ignore +from google.cloud.aiplatform_v1.types import operation import google.protobuf.struct_pb2 as struct_pb2 # type: ignore @@ -28,6 +29,9 @@ "QueryReasoningEngineRequest", "QueryReasoningEngineResponse", "StreamQueryReasoningEngineRequest", + "AsyncQueryReasoningEngineRequest", + "AsyncQueryReasoningEngineOperationMetadata", + "AsyncQueryReasoningEngineResponse", }, ) @@ -113,4 +117,66 @@ class StreamQueryReasoningEngineRequest(proto.Message): ) +class AsyncQueryReasoningEngineRequest(proto.Message): + r"""Request message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + + Attributes: + name (str): + Required. The name of the ReasoningEngine resource to use. + Format: + ``projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`` + input_gcs_uri (str): + Optional. Input Cloud Storage URI for the + Async query. + output_gcs_uri (str): + Optional. Output Cloud Storage URI for the + Async query. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + input_gcs_uri: str = proto.Field( + proto.STRING, + number=2, + ) + output_gcs_uri: str = proto.Field( + proto.STRING, + number=3, + ) + + +class AsyncQueryReasoningEngineOperationMetadata(proto.Message): + r"""Operation metadata message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + + Attributes: + generic_metadata (google.cloud.aiplatform_v1.types.GenericOperationMetadata): + The common part of the operation metadata. + """ + + generic_metadata: operation.GenericOperationMetadata = proto.Field( + proto.MESSAGE, + number=1, + message=operation.GenericOperationMetadata, + ) + + +class AsyncQueryReasoningEngineResponse(proto.Message): + r"""Response message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + + Attributes: + output_gcs_uri (str): + Output Cloud Storage URI for the Async query. + """ + + output_gcs_uri: str = proto.Field( + proto.STRING, + number=1, + ) + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1/types/tuning_job.py b/google/cloud/aiplatform_v1/types/tuning_job.py index 49d71ba0de..278063f2f1 100644 --- a/google/cloud/aiplatform_v1/types/tuning_job.py +++ b/google/cloud/aiplatform_v1/types/tuning_job.py @@ -21,6 +21,7 @@ from google.cloud.aiplatform_v1.types import content from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec +from google.cloud.aiplatform_v1.types import evaluation_service from google.cloud.aiplatform_v1.types import job_state import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore import google.rpc.status_pb2 as status_pb2 # type: ignore @@ -37,6 +38,8 @@ "SupervisedHyperParameters", "SupervisedTuningSpec", "TunedModelRef", + "EvaluationConfig", + "EvaluateDatasetRun", "TunedModelCheckpoint", "PreTunedModel", }, @@ -141,6 +144,9 @@ class TuningJob(proto.Message): Users starting the pipeline must have the ``iam.serviceAccounts.actAs`` permission on this service account. + evaluate_dataset_runs (MutableSequence[google.cloud.aiplatform_v1.types.EvaluateDatasetRun]): + Output only. Evaluation runs for the Tuning + Job. """ base_model: str = proto.Field( @@ -230,6 +236,11 @@ class TuningJob(proto.Message): proto.STRING, number=22, ) + evaluate_dataset_runs: MutableSequence["EvaluateDatasetRun"] = proto.RepeatedField( + proto.MESSAGE, + number=32, + message="EvaluateDatasetRun", + ) class TunedModel(proto.Message): @@ -576,6 +587,8 @@ class SupervisedTuningSpec(proto.Message): last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT. Default is false. + evaluation_config (google.cloud.aiplatform_v1.types.EvaluationConfig): + Optional. Evaluation Config for Tuning Job. """ training_dataset_uri: str = proto.Field( @@ -595,6 +608,11 @@ class SupervisedTuningSpec(proto.Message): proto.BOOL, number=6, ) + evaluation_config: "EvaluationConfig" = proto.Field( + proto.MESSAGE, + number=5, + message="EvaluationConfig", + ) class TunedModelRef(proto.Message): @@ -641,6 +659,90 @@ class TunedModelRef(proto.Message): ) +class EvaluationConfig(proto.Message): + r"""Evaluation Config for Tuning Job. + + Attributes: + metrics (MutableSequence[google.cloud.aiplatform_v1.types.Metric]): + Required. The metrics used for evaluation. + output_config (google.cloud.aiplatform_v1.types.OutputConfig): + Required. Config for evaluation output. + autorater_config (google.cloud.aiplatform_v1.types.AutoraterConfig): + Optional. Autorater config for evaluation. + inference_generation_config (google.cloud.aiplatform_v1.types.GenerationConfig): + Optional. Configuration options for inference + generation and outputs. If not set, default + generation parameters are used. + """ + + metrics: MutableSequence[evaluation_service.Metric] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=evaluation_service.Metric, + ) + output_config: evaluation_service.OutputConfig = proto.Field( + proto.MESSAGE, + number=2, + message=evaluation_service.OutputConfig, + ) + autorater_config: evaluation_service.AutoraterConfig = proto.Field( + proto.MESSAGE, + number=3, + message=evaluation_service.AutoraterConfig, + ) + inference_generation_config: content.GenerationConfig = proto.Field( + proto.MESSAGE, + number=5, + message=content.GenerationConfig, + ) + + +class EvaluateDatasetRun(proto.Message): + r"""Evaluate Dataset Run Result for Tuning Job. + + Attributes: + operation_name (str): + Output only. Deprecated: The updated architecture uses + evaluation_run instead. + evaluation_run (str): + Output only. The resource name of the evaluation run. + Format: + ``projects/{project}/locations/{location}/evaluationRuns/{evaluation_run_id}``. + checkpoint_id (str): + Output only. The checkpoint id used in the + evaluation run. Only populated when evaluating + checkpoints. + evaluate_dataset_response (google.cloud.aiplatform_v1.types.EvaluateDatasetResponse): + Output only. Results for EvaluationService. + error (google.rpc.status_pb2.Status): + Output only. The error of the evaluation run + if any. + """ + + operation_name: str = proto.Field( + proto.STRING, + number=1, + ) + evaluation_run: str = proto.Field( + proto.STRING, + number=5, + ) + checkpoint_id: str = proto.Field( + proto.STRING, + number=2, + ) + evaluate_dataset_response: evaluation_service.EvaluateDatasetResponse = proto.Field( + proto.MESSAGE, + number=3, + message=evaluation_service.EvaluateDatasetResponse, + ) + error: status_pb2.Status = proto.Field( + proto.MESSAGE, + number=4, + message=status_pb2.Status, + ) + + class TunedModelCheckpoint(proto.Message): r"""TunedModelCheckpoint for the Tuned Model of a Tuning Job. diff --git a/google/cloud/aiplatform_v1beta1/__init__.py b/google/cloud/aiplatform_v1beta1/__init__.py index b4c8cf0e34..5d2e8430b9 100644 --- a/google/cloud/aiplatform_v1beta1/__init__.py +++ b/google/cloud/aiplatform_v1beta1/__init__.py @@ -92,6 +92,8 @@ from .services.model_service import ModelServiceAsyncClient from .services.notebook_service import NotebookServiceClient from .services.notebook_service import NotebookServiceAsyncClient +from .services.online_evaluator_service import OnlineEvaluatorServiceClient +from .services.online_evaluator_service import OnlineEvaluatorServiceAsyncClient from .services.persistent_resource_service import PersistentResourceServiceClient from .services.persistent_resource_service import PersistentResourceServiceAsyncClient from .services.pipeline_service import PipelineServiceClient @@ -276,6 +278,13 @@ from .types.evaluated_annotation import ErrorAnalysisAnnotation from .types.evaluated_annotation import EvaluatedAnnotation from .types.evaluated_annotation import EvaluatedAnnotationExplanation +from .types.evaluation_agent_data import AgentConfig +from .types.evaluation_agent_data import AgentData +from .types.evaluation_agent_data import AgentEvent +from .types.evaluation_agent_data import ConversationTurn +from .types.evaluation_rubric import Rubric +from .types.evaluation_rubric import RubricGroup +from .types.evaluation_rubric import RubricVerdict from .types.evaluation_service import AggregationOutput from .types.evaluation_service import AggregationResult from .types.evaluation_service import AutoraterConfig @@ -294,6 +303,8 @@ from .types.evaluation_service import CometSpec from .types.evaluation_service import ComputationBasedMetricSpec from .types.evaluation_service import ContentMap +from .types.evaluation_service import CustomCodeExecutionResult +from .types.evaluation_service import CustomCodeExecutionSpec from .types.evaluation_service import CustomOutput from .types.evaluation_service import CustomOutputFormatConfig from .types.evaluation_service import EvaluateDatasetOperationMetadata @@ -302,6 +313,8 @@ from .types.evaluation_service import EvaluateInstancesRequest from .types.evaluation_service import EvaluateInstancesResponse from .types.evaluation_service import EvaluationDataset +from .types.evaluation_service import EvaluationInstance +from .types.evaluation_service import EvaluationParserConfig from .types.evaluation_service import ExactMatchInput from .types.evaluation_service import ExactMatchInstance from .types.evaluation_service import ExactMatchMetricValue @@ -315,13 +328,17 @@ from .types.evaluation_service import FulfillmentInstance from .types.evaluation_service import FulfillmentResult from .types.evaluation_service import FulfillmentSpec +from .types.evaluation_service import GenerateInstanceRubricsRequest +from .types.evaluation_service import GenerateInstanceRubricsResponse from .types.evaluation_service import GroundednessInput from .types.evaluation_service import GroundednessInstance from .types.evaluation_service import GroundednessResult from .types.evaluation_service import GroundednessSpec from .types.evaluation_service import LLMBasedMetricSpec from .types.evaluation_service import Metric +from .types.evaluation_service import MetricMetadata from .types.evaluation_service import MetricResult +from .types.evaluation_service import MetricSource from .types.evaluation_service import MetricxInput from .types.evaluation_service import MetricxInstance from .types.evaluation_service import MetricxResult @@ -372,6 +389,7 @@ from .types.evaluation_service import RubricBasedInstructionFollowingResult from .types.evaluation_service import RubricBasedInstructionFollowingSpec from .types.evaluation_service import RubricCritiqueResult +from .types.evaluation_service import RubricGenerationSpec from .types.evaluation_service import SafetyInput from .types.evaluation_service import SafetyInstance from .types.evaluation_service import SafetyResult @@ -1006,6 +1024,20 @@ from .types.notebook_software_config import ColabImage from .types.notebook_software_config import NotebookSoftwareConfig from .types.notebook_software_config import PostStartupScriptConfig +from .types.online_evaluator import OnlineEvaluator +from .types.online_evaluator_service import ActivateOnlineEvaluatorOperationMetadata +from .types.online_evaluator_service import ActivateOnlineEvaluatorRequest +from .types.online_evaluator_service import CreateOnlineEvaluatorOperationMetadata +from .types.online_evaluator_service import CreateOnlineEvaluatorRequest +from .types.online_evaluator_service import DeleteOnlineEvaluatorOperationMetadata +from .types.online_evaluator_service import DeleteOnlineEvaluatorRequest +from .types.online_evaluator_service import GetOnlineEvaluatorRequest +from .types.online_evaluator_service import ListOnlineEvaluatorsRequest +from .types.online_evaluator_service import ListOnlineEvaluatorsResponse +from .types.online_evaluator_service import SuspendOnlineEvaluatorOperationMetadata +from .types.online_evaluator_service import SuspendOnlineEvaluatorRequest +from .types.online_evaluator_service import UpdateOnlineEvaluatorOperationMetadata +from .types.online_evaluator_service import UpdateOnlineEvaluatorRequest from .types.openapi import Schema from .types.openapi import Type from .types.operation import DeleteOperationMetadata @@ -1085,6 +1117,11 @@ from .types.reasoning_engine import ReasoningEngine from .types.reasoning_engine import ReasoningEngineContextSpec from .types.reasoning_engine import ReasoningEngineSpec +from .types.reasoning_engine_execution_service import ( + AsyncQueryReasoningEngineOperationMetadata, +) +from .types.reasoning_engine_execution_service import AsyncQueryReasoningEngineRequest +from .types.reasoning_engine_execution_service import AsyncQueryReasoningEngineResponse from .types.reasoning_engine_execution_service import QueryReasoningEngineRequest from .types.reasoning_engine_execution_service import QueryReasoningEngineResponse from .types.reasoning_engine_execution_service import StreamQueryReasoningEngineRequest @@ -1249,6 +1286,7 @@ from .types.tuning_job import TuningDataStats from .types.tuning_job import TuningJob from .types.tuning_job import VeoHyperParameters +from .types.tuning_job import VeoLoraTuningSpec from .types.tuning_job import VeoTuningSpec from .types.types import BoolArray from .types.types import DoubleArray @@ -1481,6 +1519,7 @@ def _get_version(dependency_name): "ModelMonitoringServiceAsyncClient", "ModelServiceAsyncClient", "NotebookServiceAsyncClient", + "OnlineEvaluatorServiceAsyncClient", "PersistentResourceServiceAsyncClient", "PipelineServiceAsyncClient", "PredictionServiceAsyncClient", @@ -1495,6 +1534,8 @@ def _get_version(dependency_name): "VizierServiceAsyncClient", "AcceleratorType", "AcceptPublisherModelEulaRequest", + "ActivateOnlineEvaluatorOperationMetadata", + "ActivateOnlineEvaluatorRequest", "ActiveLearningConfig", "AddContextArtifactsAndExecutionsRequest", "AddContextArtifactsAndExecutionsResponse", @@ -1503,6 +1544,9 @@ def _get_version(dependency_name): "AddExecutionEventsRequest", "AddExecutionEventsResponse", "AddTrialMeasurementRequest", + "AgentConfig", + "AgentData", + "AgentEvent", "AggregationOutput", "AggregationResult", "Annotation", @@ -1522,6 +1566,9 @@ def _get_version(dependency_name): "AssessDataResponse", "AssignNotebookRuntimeOperationMetadata", "AssignNotebookRuntimeRequest", + "AsyncQueryReasoningEngineOperationMetadata", + "AsyncQueryReasoningEngineRequest", + "AsyncQueryReasoningEngineResponse", "AsyncRetrieveContextsOperationMetadata", "AsyncRetrieveContextsRequest", "AsyncRetrieveContextsResponse", @@ -1619,6 +1666,7 @@ def _get_version(dependency_name): "ContentMap", "ContentsExample", "Context", + "ConversationTurn", "CopyModelOperationMetadata", "CopyModelRequest", "CopyModelResponse", @@ -1678,6 +1726,8 @@ def _get_version(dependency_name): "CreateNotebookExecutionJobRequest", "CreateNotebookRuntimeTemplateOperationMetadata", "CreateNotebookRuntimeTemplateRequest", + "CreateOnlineEvaluatorOperationMetadata", + "CreateOnlineEvaluatorRequest", "CreatePersistentResourceOperationMetadata", "CreatePersistentResourceRequest", "CreatePipelineJobRequest", @@ -1704,6 +1754,8 @@ def _get_version(dependency_name): "CreateTuningJobRequest", "CsvDestination", "CsvSource", + "CustomCodeExecutionResult", + "CustomCodeExecutionSpec", "CustomJob", "CustomJobSpec", "CustomOutput", @@ -1757,6 +1809,8 @@ def _get_version(dependency_name): "DeleteNotebookExecutionJobRequest", "DeleteNotebookRuntimeRequest", "DeleteNotebookRuntimeTemplateRequest", + "DeleteOnlineEvaluatorOperationMetadata", + "DeleteOnlineEvaluatorRequest", "DeleteOperationMetadata", "DeletePersistentResourceRequest", "DeletePipelineJobRequest", @@ -1829,6 +1883,8 @@ def _get_version(dependency_name): "EvaluatedAnnotationExplanation", "EvaluationConfig", "EvaluationDataset", + "EvaluationInstance", + "EvaluationParserConfig", "EvaluationServiceClient", "Event", "EventActions", @@ -1949,6 +2005,8 @@ def _get_version(dependency_name): "GenerateContentResponse", "GenerateFetchAccessTokenRequest", "GenerateFetchAccessTokenResponse", + "GenerateInstanceRubricsRequest", + "GenerateInstanceRubricsResponse", "GenerateMemoriesOperationMetadata", "GenerateMemoriesRequest", "GenerateMemoriesResponse", @@ -1996,6 +2054,7 @@ def _get_version(dependency_name): "GetNotebookExecutionJobRequest", "GetNotebookRuntimeRequest", "GetNotebookRuntimeTemplateRequest", + "GetOnlineEvaluatorRequest", "GetPersistentResourceRequest", "GetPipelineJobRequest", "GetPublisherModelRequest", @@ -2151,6 +2210,8 @@ def _get_version(dependency_name): "ListNotebookRuntimeTemplatesResponse", "ListNotebookRuntimesRequest", "ListNotebookRuntimesResponse", + "ListOnlineEvaluatorsRequest", + "ListOnlineEvaluatorsResponse", "ListOptimalTrialsRequest", "ListOptimalTrialsResponse", "ListPersistentResourcesRequest", @@ -2210,7 +2271,9 @@ def _get_version(dependency_name): "MetadataStore", "MetadataValue", "Metric", + "MetricMetadata", "MetricResult", + "MetricSource", "MetricxInput", "MetricxInstance", "MetricxResult", @@ -2285,6 +2348,8 @@ def _get_version(dependency_name): "NotebookRuntimeType", "NotebookServiceClient", "NotebookSoftwareConfig", + "OnlineEvaluator", + "OnlineEvaluatorServiceClient", "OutputConfig", "OutputInfo", "PSCAutomationConfig", @@ -2455,11 +2520,15 @@ def _get_version(dependency_name): "RougeMetricValue", "RougeResults", "RougeSpec", + "Rubric", "RubricBasedInstructionFollowingInput", "RubricBasedInstructionFollowingInstance", "RubricBasedInstructionFollowingResult", "RubricBasedInstructionFollowingSpec", "RubricCritiqueResult", + "RubricGenerationSpec", + "RubricGroup", + "RubricVerdict", "RuntimeArtifact", "RuntimeConfig", "SafetyInput", @@ -2563,6 +2632,8 @@ def _get_version(dependency_name): "SupervisedTuningDataStats", "SupervisedTuningDatasetDistribution", "SupervisedTuningSpec", + "SuspendOnlineEvaluatorOperationMetadata", + "SuspendOnlineEvaluatorRequest", "SyncFeatureViewRequest", "SyncFeatureViewResponse", "TFRecordDestination", @@ -2694,6 +2765,8 @@ def _get_version(dependency_name): "UpdateModelMonitorRequest", "UpdateModelRequest", "UpdateNotebookRuntimeTemplateRequest", + "UpdateOnlineEvaluatorOperationMetadata", + "UpdateOnlineEvaluatorRequest", "UpdatePersistentResourceOperationMetadata", "UpdatePersistentResourceRequest", "UpdateRagCorpusOperationMetadata", @@ -2733,6 +2806,7 @@ def _get_version(dependency_name): "UserSpecifiedMetadata", "Value", "VeoHyperParameters", + "VeoLoraTuningSpec", "VeoTuningSpec", "VertexAISearch", "VertexAiSearchConfig", diff --git a/google/cloud/aiplatform_v1beta1/gapic_metadata.json b/google/cloud/aiplatform_v1beta1/gapic_metadata.json index 081f680bc1..0903836a72 100644 --- a/google/cloud/aiplatform_v1beta1/gapic_metadata.json +++ b/google/cloud/aiplatform_v1beta1/gapic_metadata.json @@ -646,6 +646,11 @@ "methods": [ "evaluate_instances" ] + }, + "GenerateInstanceRubrics": { + "methods": [ + "generate_instance_rubrics" + ] } } }, @@ -661,6 +666,11 @@ "methods": [ "evaluate_instances" ] + }, + "GenerateInstanceRubrics": { + "methods": [ + "generate_instance_rubrics" + ] } } }, @@ -676,6 +686,11 @@ "methods": [ "evaluate_instances" ] + }, + "GenerateInstanceRubrics": { + "methods": [ + "generate_instance_rubrics" + ] } } } @@ -4639,6 +4654,130 @@ } } }, + "OnlineEvaluatorService": { + "clients": { + "grpc": { + "libraryClient": "OnlineEvaluatorServiceClient", + "rpcs": { + "ActivateOnlineEvaluator": { + "methods": [ + "activate_online_evaluator" + ] + }, + "CreateOnlineEvaluator": { + "methods": [ + "create_online_evaluator" + ] + }, + "DeleteOnlineEvaluator": { + "methods": [ + "delete_online_evaluator" + ] + }, + "GetOnlineEvaluator": { + "methods": [ + "get_online_evaluator" + ] + }, + "ListOnlineEvaluators": { + "methods": [ + "list_online_evaluators" + ] + }, + "SuspendOnlineEvaluator": { + "methods": [ + "suspend_online_evaluator" + ] + }, + "UpdateOnlineEvaluator": { + "methods": [ + "update_online_evaluator" + ] + } + } + }, + "grpc-async": { + "libraryClient": "OnlineEvaluatorServiceAsyncClient", + "rpcs": { + "ActivateOnlineEvaluator": { + "methods": [ + "activate_online_evaluator" + ] + }, + "CreateOnlineEvaluator": { + "methods": [ + "create_online_evaluator" + ] + }, + "DeleteOnlineEvaluator": { + "methods": [ + "delete_online_evaluator" + ] + }, + "GetOnlineEvaluator": { + "methods": [ + "get_online_evaluator" + ] + }, + "ListOnlineEvaluators": { + "methods": [ + "list_online_evaluators" + ] + }, + "SuspendOnlineEvaluator": { + "methods": [ + "suspend_online_evaluator" + ] + }, + "UpdateOnlineEvaluator": { + "methods": [ + "update_online_evaluator" + ] + } + } + }, + "rest": { + "libraryClient": "OnlineEvaluatorServiceClient", + "rpcs": { + "ActivateOnlineEvaluator": { + "methods": [ + "activate_online_evaluator" + ] + }, + "CreateOnlineEvaluator": { + "methods": [ + "create_online_evaluator" + ] + }, + "DeleteOnlineEvaluator": { + "methods": [ + "delete_online_evaluator" + ] + }, + "GetOnlineEvaluator": { + "methods": [ + "get_online_evaluator" + ] + }, + "ListOnlineEvaluators": { + "methods": [ + "list_online_evaluators" + ] + }, + "SuspendOnlineEvaluator": { + "methods": [ + "suspend_online_evaluator" + ] + }, + "UpdateOnlineEvaluator": { + "methods": [ + "update_online_evaluator" + ] + } + } + } + } + }, "PersistentResourceService": { "clients": { "grpc": { @@ -5211,6 +5350,11 @@ "grpc": { "libraryClient": "ReasoningEngineExecutionServiceClient", "rpcs": { + "AsyncQueryReasoningEngine": { + "methods": [ + "async_query_reasoning_engine" + ] + }, "QueryReasoningEngine": { "methods": [ "query_reasoning_engine" @@ -5226,6 +5370,11 @@ "grpc-async": { "libraryClient": "ReasoningEngineExecutionServiceAsyncClient", "rpcs": { + "AsyncQueryReasoningEngine": { + "methods": [ + "async_query_reasoning_engine" + ] + }, "QueryReasoningEngine": { "methods": [ "query_reasoning_engine" @@ -5241,6 +5390,11 @@ "rest": { "libraryClient": "ReasoningEngineExecutionServiceClient", "rpcs": { + "AsyncQueryReasoningEngine": { + "methods": [ + "async_query_reasoning_engine" + ] + }, "QueryReasoningEngine": { "methods": [ "query_reasoning_engine" diff --git a/google/cloud/aiplatform_v1beta1/services/dataset_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/dataset_service/transports/rest.py index e03f666095..5586c52f9b 100644 --- a/google/cloud/aiplatform_v1beta1/services/dataset_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/dataset_service/transports/rest.py @@ -1953,6 +1953,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2021,6 +2025,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2363,6 +2371,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2455,6 +2467,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2805,6 +2821,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2897,6 +2917,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3243,6 +3267,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3335,6 +3363,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3681,6 +3713,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3769,6 +3805,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/dataset_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/dataset_service/transports/rest_asyncio.py index 3c91214a58..d69b2f56b0 100644 --- a/google/cloud/aiplatform_v1beta1/services/dataset_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/dataset_service/transports/rest_asyncio.py @@ -5514,6 +5514,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -5582,6 +5586,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -5924,6 +5932,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -6016,6 +6028,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -6366,6 +6382,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -6458,6 +6478,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -6804,6 +6828,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -6896,6 +6924,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -7242,6 +7274,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -7330,6 +7366,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/dataset_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/dataset_service/transports/rest_base.py index 023b496b99..29505e10a5 100644 --- a/google/cloud/aiplatform_v1beta1/services/dataset_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/dataset_service/transports/rest_base.py @@ -1898,6 +1898,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1966,6 +1970,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -2327,6 +2335,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2419,6 +2431,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2788,6 +2804,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2880,6 +2900,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -3245,6 +3269,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3337,6 +3365,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -3702,6 +3734,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3790,6 +3826,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/transports/rest.py index 4c26161d66..fb95b86af1 100644 --- a/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/transports/rest.py @@ -1109,6 +1109,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1177,6 +1181,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1519,6 +1527,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1611,6 +1623,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -1961,6 +1977,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2053,6 +2073,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2399,6 +2423,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2491,6 +2519,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -2837,6 +2869,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2925,6 +2961,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/transports/rest_asyncio.py index 4a2f49acd8..f9e784e498 100644 --- a/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/transports/rest_asyncio.py @@ -2208,6 +2208,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2276,6 +2280,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2618,6 +2626,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2710,6 +2722,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -3060,6 +3076,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3152,6 +3172,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3498,6 +3522,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3590,6 +3618,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3936,6 +3968,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -4024,6 +4060,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/transports/rest_base.py index edaa8bc9f9..5c082506f1 100644 --- a/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/transports/rest_base.py @@ -1103,6 +1103,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1171,6 +1175,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1532,6 +1540,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1624,6 +1636,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -1993,6 +2009,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2085,6 +2105,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2450,6 +2474,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2542,6 +2570,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2907,6 +2939,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2995,6 +3031,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/endpoint_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/endpoint_service/transports/rest.py index bab5364e72..06d0b5914f 100644 --- a/google/cloud/aiplatform_v1beta1/services/endpoint_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/endpoint_service/transports/rest.py @@ -1374,6 +1374,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1442,6 +1446,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1784,6 +1792,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1876,6 +1888,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2226,6 +2242,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2318,6 +2338,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2664,6 +2688,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2756,6 +2784,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3102,6 +3134,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3190,6 +3226,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/endpoint_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/endpoint_service/transports/rest_asyncio.py index 73e99387f4..7ef61e7240 100644 --- a/google/cloud/aiplatform_v1beta1/services/endpoint_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/endpoint_service/transports/rest_asyncio.py @@ -3291,6 +3291,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -3359,6 +3363,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -3701,6 +3709,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3793,6 +3805,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -4143,6 +4159,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -4235,6 +4255,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -4581,6 +4605,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -4673,6 +4701,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -5019,6 +5051,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -5107,6 +5143,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/endpoint_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/endpoint_service/transports/rest_base.py index 4fad925ba4..79267fad6d 100644 --- a/google/cloud/aiplatform_v1beta1/services/endpoint_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/endpoint_service/transports/rest_base.py @@ -1365,6 +1365,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1433,6 +1437,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1794,6 +1802,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1886,6 +1898,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2255,6 +2271,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2347,6 +2367,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2712,6 +2736,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2804,6 +2832,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -3169,6 +3201,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3257,6 +3293,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/evaluation_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/evaluation_service/async_client.py index 36f591ab45..5745b33132 100644 --- a/google/cloud/aiplatform_v1beta1/services/evaluation_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/evaluation_service/async_client.py @@ -45,6 +45,7 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore +from google.cloud.aiplatform_v1beta1.types import evaluation_rubric from google.cloud.aiplatform_v1beta1.types import evaluation_service from google.cloud.location import locations_pb2 # type: ignore from google.iam.v1 import iam_policy_pb2 # type: ignore @@ -78,6 +79,8 @@ class EvaluationServiceAsyncClient: _DEFAULT_ENDPOINT_TEMPLATE = EvaluationServiceClient._DEFAULT_ENDPOINT_TEMPLATE _DEFAULT_UNIVERSE = EvaluationServiceClient._DEFAULT_UNIVERSE + rag_corpus_path = staticmethod(EvaluationServiceClient.rag_corpus_path) + parse_rag_corpus_path = staticmethod(EvaluationServiceClient.parse_rag_corpus_path) common_billing_account_path = staticmethod( EvaluationServiceClient.common_billing_account_path ) @@ -506,6 +509,103 @@ async def sample_evaluate_dataset(): # Done; return the response. return response + async def generate_instance_rubrics( + self, + request: Optional[ + Union[evaluation_service.GenerateInstanceRubricsRequest, dict] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> evaluation_service.GenerateInstanceRubricsResponse: + r"""Generates rubrics for a given prompt. + A rubric represents a single testable criterion for + evaluation. One input prompt could have multiple rubrics + This RPC allows users to get suggested rubrics based on + provided prompt, which can then be reviewed and used for + subsequent evaluations. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + async def sample_generate_instance_rubrics(): + # Create a client + client = aiplatform_v1beta1.EvaluationServiceAsyncClient() + + # Initialize request argument(s) + contents = aiplatform_v1beta1.Content() + contents.parts.text = "text_value" + + request = aiplatform_v1beta1.GenerateInstanceRubricsRequest( + location="location_value", + contents=contents, + ) + + # Make the request + response = await client.generate_instance_rubrics(request=request) + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.cloud.aiplatform_v1beta1.types.GenerateInstanceRubricsRequest, dict]]): + The request object. Request message for + EvaluationService.GenerateInstanceRubrics. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.aiplatform_v1beta1.types.GenerateInstanceRubricsResponse: + Response message for + EvaluationService.GenerateInstanceRubrics. + + """ + # Create or coerce a protobuf request object. + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, evaluation_service.GenerateInstanceRubricsRequest): + request = evaluation_service.GenerateInstanceRubricsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._client._transport._wrapped_methods[ + self._client._transport.generate_instance_rubrics + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("location", request.location),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + async def list_operations( self, request: Optional[operations_pb2.ListOperationsRequest] = None, diff --git a/google/cloud/aiplatform_v1beta1/services/evaluation_service/client.py b/google/cloud/aiplatform_v1beta1/services/evaluation_service/client.py index bfa773f6c5..a26708a1c5 100644 --- a/google/cloud/aiplatform_v1beta1/services/evaluation_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/evaluation_service/client.py @@ -61,6 +61,7 @@ _LOGGER = std_logging.getLogger(__name__) +from google.cloud.aiplatform_v1beta1.types import evaluation_rubric from google.cloud.aiplatform_v1beta1.types import evaluation_service from google.cloud.location import locations_pb2 # type: ignore from google.iam.v1 import iam_policy_pb2 # type: ignore @@ -242,6 +243,28 @@ def transport(self) -> EvaluationServiceTransport: """ return self._transport + @staticmethod + def rag_corpus_path( + project: str, + location: str, + rag_corpus: str, + ) -> str: + """Returns a fully-qualified rag_corpus string.""" + return "projects/{project}/locations/{location}/ragCorpora/{rag_corpus}".format( + project=project, + location=location, + rag_corpus=rag_corpus, + ) + + @staticmethod + def parse_rag_corpus_path(path: str) -> Dict[str, str]: + """Parses a rag_corpus path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/ragCorpora/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def common_billing_account_path( billing_account: str, @@ -956,6 +979,103 @@ def sample_evaluate_dataset(): # Done; return the response. return response + def generate_instance_rubrics( + self, + request: Optional[ + Union[evaluation_service.GenerateInstanceRubricsRequest, dict] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> evaluation_service.GenerateInstanceRubricsResponse: + r"""Generates rubrics for a given prompt. + A rubric represents a single testable criterion for + evaluation. One input prompt could have multiple rubrics + This RPC allows users to get suggested rubrics based on + provided prompt, which can then be reviewed and used for + subsequent evaluations. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + def sample_generate_instance_rubrics(): + # Create a client + client = aiplatform_v1beta1.EvaluationServiceClient() + + # Initialize request argument(s) + contents = aiplatform_v1beta1.Content() + contents.parts.text = "text_value" + + request = aiplatform_v1beta1.GenerateInstanceRubricsRequest( + location="location_value", + contents=contents, + ) + + # Make the request + response = client.generate_instance_rubrics(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.GenerateInstanceRubricsRequest, dict]): + The request object. Request message for + EvaluationService.GenerateInstanceRubrics. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.aiplatform_v1beta1.types.GenerateInstanceRubricsResponse: + Response message for + EvaluationService.GenerateInstanceRubrics. + + """ + # Create or coerce a protobuf request object. + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, evaluation_service.GenerateInstanceRubricsRequest): + request = evaluation_service.GenerateInstanceRubricsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.generate_instance_rubrics + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("location", request.location),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + def __enter__(self) -> "EvaluationServiceClient": return self diff --git a/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/base.py b/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/base.py index a33d96ab5a..bfd00ac736 100644 --- a/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/base.py +++ b/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/base.py @@ -152,6 +152,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.generate_instance_rubrics: gapic_v1.method.wrap_method( + self.generate_instance_rubrics, + default_timeout=None, + client_info=client_info, + ), self.get_location: gapic_v1.method.wrap_method( self.get_location, default_timeout=None, @@ -239,6 +244,18 @@ def evaluate_dataset( ]: raise NotImplementedError() + @property + def generate_instance_rubrics( + self, + ) -> Callable[ + [evaluation_service.GenerateInstanceRubricsRequest], + Union[ + evaluation_service.GenerateInstanceRubricsResponse, + Awaitable[evaluation_service.GenerateInstanceRubricsResponse], + ], + ]: + raise NotImplementedError() + @property def list_operations( self, diff --git a/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/grpc.py b/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/grpc.py index 7c3839f87a..2340ce9cbe 100644 --- a/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/grpc.py +++ b/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/grpc.py @@ -401,6 +401,40 @@ def evaluate_dataset( ) return self._stubs["evaluate_dataset"] + @property + def generate_instance_rubrics( + self, + ) -> Callable[ + [evaluation_service.GenerateInstanceRubricsRequest], + evaluation_service.GenerateInstanceRubricsResponse, + ]: + r"""Return a callable for the generate instance rubrics method over gRPC. + + Generates rubrics for a given prompt. + A rubric represents a single testable criterion for + evaluation. One input prompt could have multiple rubrics + This RPC allows users to get suggested rubrics based on + provided prompt, which can then be reviewed and used for + subsequent evaluations. + + Returns: + Callable[[~.GenerateInstanceRubricsRequest], + ~.GenerateInstanceRubricsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "generate_instance_rubrics" not in self._stubs: + self._stubs["generate_instance_rubrics"] = self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.EvaluationService/GenerateInstanceRubrics", + request_serializer=evaluation_service.GenerateInstanceRubricsRequest.serialize, + response_deserializer=evaluation_service.GenerateInstanceRubricsResponse.deserialize, + ) + return self._stubs["generate_instance_rubrics"] + def close(self): self._logged_channel.close() diff --git a/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/grpc_asyncio.py index ea6d76fa53..7df6a8036d 100644 --- a/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/grpc_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/grpc_asyncio.py @@ -409,6 +409,40 @@ def evaluate_dataset( ) return self._stubs["evaluate_dataset"] + @property + def generate_instance_rubrics( + self, + ) -> Callable[ + [evaluation_service.GenerateInstanceRubricsRequest], + Awaitable[evaluation_service.GenerateInstanceRubricsResponse], + ]: + r"""Return a callable for the generate instance rubrics method over gRPC. + + Generates rubrics for a given prompt. + A rubric represents a single testable criterion for + evaluation. One input prompt could have multiple rubrics + This RPC allows users to get suggested rubrics based on + provided prompt, which can then be reviewed and used for + subsequent evaluations. + + Returns: + Callable[[~.GenerateInstanceRubricsRequest], + Awaitable[~.GenerateInstanceRubricsResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "generate_instance_rubrics" not in self._stubs: + self._stubs["generate_instance_rubrics"] = self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.EvaluationService/GenerateInstanceRubrics", + request_serializer=evaluation_service.GenerateInstanceRubricsRequest.serialize, + response_deserializer=evaluation_service.GenerateInstanceRubricsResponse.deserialize, + ) + return self._stubs["generate_instance_rubrics"] + def _prep_wrapped_messages(self, client_info): """Precompute the wrapped methods, overriding the base class method to use async wrappers.""" self._wrapped_methods = { @@ -422,6 +456,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.generate_instance_rubrics: self._wrap_method( + self.generate_instance_rubrics, + default_timeout=None, + client_info=client_info, + ), self.get_location: self._wrap_method( self.get_location, default_timeout=None, diff --git a/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/rest.py index 6360461068..b6d5452984 100644 --- a/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/rest.py @@ -99,6 +99,14 @@ def post_evaluate_instances(self, response): logging.log(f"Received response: {response}") return response + def pre_generate_instance_rubrics(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_generate_instance_rubrics(self, response): + logging.log(f"Received response: {response}") + return response + transport = EvaluationServiceRestTransport(interceptor=MyCustomEvaluationServiceInterceptor()) client = EvaluationServiceClient(transport=transport) @@ -206,6 +214,58 @@ def post_evaluate_instances_with_metadata( """ return response, metadata + def pre_generate_instance_rubrics( + self, + request: evaluation_service.GenerateInstanceRubricsRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + evaluation_service.GenerateInstanceRubricsRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for generate_instance_rubrics + + Override in a subclass to manipulate the request or metadata + before they are sent to the EvaluationService server. + """ + return request, metadata + + def post_generate_instance_rubrics( + self, response: evaluation_service.GenerateInstanceRubricsResponse + ) -> evaluation_service.GenerateInstanceRubricsResponse: + """Post-rpc interceptor for generate_instance_rubrics + + DEPRECATED. Please use the `post_generate_instance_rubrics_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the EvaluationService server but before + it is returned to user code. This `post_generate_instance_rubrics` interceptor runs + before the `post_generate_instance_rubrics_with_metadata` interceptor. + """ + return response + + def post_generate_instance_rubrics_with_metadata( + self, + response: evaluation_service.GenerateInstanceRubricsResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + evaluation_service.GenerateInstanceRubricsResponse, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Post-rpc interceptor for generate_instance_rubrics + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the EvaluationService server but before it is returned to user code. + + We recommend only using this `post_generate_instance_rubrics_with_metadata` + interceptor in new development instead of the `post_generate_instance_rubrics` interceptor. + When both interceptors are used, this `post_generate_instance_rubrics_with_metadata` interceptor runs after the + `post_generate_instance_rubrics` interceptor. The (possibly modified) response returned by + `post_generate_instance_rubrics` will be passed to + `post_generate_instance_rubrics_with_metadata`. + """ + return response, metadata + def pre_get_location( self, request: locations_pb2.GetLocationRequest, @@ -869,6 +929,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -937,6 +1001,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1279,6 +1347,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1371,6 +1443,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -1721,6 +1797,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1813,6 +1893,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2159,6 +2243,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2251,6 +2339,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -2597,6 +2689,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2685,6 +2781,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } @@ -3019,6 +3119,169 @@ def __call__( ) return resp + class _GenerateInstanceRubrics( + _BaseEvaluationServiceRestTransport._BaseGenerateInstanceRubrics, + EvaluationServiceRestStub, + ): + def __hash__(self): + return hash("EvaluationServiceRestTransport.GenerateInstanceRubrics") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: evaluation_service.GenerateInstanceRubricsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> evaluation_service.GenerateInstanceRubricsResponse: + r"""Call the generate instance rubrics method over HTTP. + + Args: + request (~.evaluation_service.GenerateInstanceRubricsRequest): + The request object. Request message for + EvaluationService.GenerateInstanceRubrics. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.evaluation_service.GenerateInstanceRubricsResponse: + Response message for + EvaluationService.GenerateInstanceRubrics. + + """ + + http_options = ( + _BaseEvaluationServiceRestTransport._BaseGenerateInstanceRubrics._get_http_options() + ) + + request, metadata = self._interceptor.pre_generate_instance_rubrics( + request, metadata + ) + transcoded_request = _BaseEvaluationServiceRestTransport._BaseGenerateInstanceRubrics._get_transcoded_request( + http_options, request + ) + + body = _BaseEvaluationServiceRestTransport._BaseGenerateInstanceRubrics._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseEvaluationServiceRestTransport._BaseGenerateInstanceRubrics._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.EvaluationServiceClient.GenerateInstanceRubrics", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.EvaluationService", + "rpcName": "GenerateInstanceRubrics", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ( + EvaluationServiceRestTransport._GenerateInstanceRubrics._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = evaluation_service.GenerateInstanceRubricsResponse() + pb_resp = evaluation_service.GenerateInstanceRubricsResponse.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_generate_instance_rubrics(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_generate_instance_rubrics_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = ( + evaluation_service.GenerateInstanceRubricsResponse.to_json( + response + ) + ) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.EvaluationServiceClient.generate_instance_rubrics", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.EvaluationService", + "rpcName": "GenerateInstanceRubrics", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + @property def evaluate_dataset( self, @@ -3040,6 +3303,17 @@ def evaluate_instances( # In C++ this would require a dynamic_cast return self._EvaluateInstances(self._session, self._host, self._interceptor) # type: ignore + @property + def generate_instance_rubrics( + self, + ) -> Callable[ + [evaluation_service.GenerateInstanceRubricsRequest], + evaluation_service.GenerateInstanceRubricsResponse, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._GenerateInstanceRubrics(self._session, self._host, self._interceptor) # type: ignore + @property def get_location(self): return self._GetLocation(self._session, self._host, self._interceptor) # type: ignore diff --git a/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/rest_asyncio.py index 7d5003381e..2b873c58a2 100644 --- a/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/rest_asyncio.py @@ -116,6 +116,14 @@ async def post_evaluate_instances(self, response): logging.log(f"Received response: {response}") return response + async def pre_generate_instance_rubrics(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + async def post_generate_instance_rubrics(self, response): + logging.log(f"Received response: {response}") + return response + transport = AsyncEvaluationServiceRestTransport(interceptor=MyCustomEvaluationServiceInterceptor()) client = async EvaluationServiceClient(transport=transport) @@ -223,6 +231,58 @@ async def post_evaluate_instances_with_metadata( """ return response, metadata + async def pre_generate_instance_rubrics( + self, + request: evaluation_service.GenerateInstanceRubricsRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + evaluation_service.GenerateInstanceRubricsRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for generate_instance_rubrics + + Override in a subclass to manipulate the request or metadata + before they are sent to the EvaluationService server. + """ + return request, metadata + + async def post_generate_instance_rubrics( + self, response: evaluation_service.GenerateInstanceRubricsResponse + ) -> evaluation_service.GenerateInstanceRubricsResponse: + """Post-rpc interceptor for generate_instance_rubrics + + DEPRECATED. Please use the `post_generate_instance_rubrics_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the EvaluationService server but before + it is returned to user code. This `post_generate_instance_rubrics` interceptor runs + before the `post_generate_instance_rubrics_with_metadata` interceptor. + """ + return response + + async def post_generate_instance_rubrics_with_metadata( + self, + response: evaluation_service.GenerateInstanceRubricsResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + evaluation_service.GenerateInstanceRubricsResponse, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Post-rpc interceptor for generate_instance_rubrics + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the EvaluationService server but before it is returned to user code. + + We recommend only using this `post_generate_instance_rubrics_with_metadata` + interceptor in new development instead of the `post_generate_instance_rubrics` interceptor. + When both interceptors are used, this `post_generate_instance_rubrics_with_metadata` interceptor runs after the + `post_generate_instance_rubrics` interceptor. The (possibly modified) response returned by + `post_generate_instance_rubrics` will be passed to + `post_generate_instance_rubrics_with_metadata`. + """ + return response, metadata + async def pre_get_location( self, request: locations_pb2.GetLocationRequest, @@ -548,6 +608,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.generate_instance_rubrics: self._wrap_method( + self.generate_instance_rubrics, + default_timeout=None, + client_info=client_info, + ), self.get_location: self._wrap_method( self.get_location, default_timeout=None, @@ -934,6 +999,175 @@ async def __call__( return resp + class _GenerateInstanceRubrics( + _BaseEvaluationServiceRestTransport._BaseGenerateInstanceRubrics, + AsyncEvaluationServiceRestStub, + ): + def __hash__(self): + return hash("AsyncEvaluationServiceRestTransport.GenerateInstanceRubrics") + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + async def __call__( + self, + request: evaluation_service.GenerateInstanceRubricsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> evaluation_service.GenerateInstanceRubricsResponse: + r"""Call the generate instance rubrics method over HTTP. + + Args: + request (~.evaluation_service.GenerateInstanceRubricsRequest): + The request object. Request message for + EvaluationService.GenerateInstanceRubrics. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.evaluation_service.GenerateInstanceRubricsResponse: + Response message for + EvaluationService.GenerateInstanceRubrics. + + """ + + http_options = ( + _BaseEvaluationServiceRestTransport._BaseGenerateInstanceRubrics._get_http_options() + ) + + request, metadata = await self._interceptor.pre_generate_instance_rubrics( + request, metadata + ) + transcoded_request = _BaseEvaluationServiceRestTransport._BaseGenerateInstanceRubrics._get_transcoded_request( + http_options, request + ) + + body = _BaseEvaluationServiceRestTransport._BaseGenerateInstanceRubrics._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseEvaluationServiceRestTransport._BaseGenerateInstanceRubrics._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.EvaluationServiceClient.GenerateInstanceRubrics", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.EvaluationService", + "rpcName": "GenerateInstanceRubrics", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncEvaluationServiceRestTransport._GenerateInstanceRubrics._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + # Return the response + resp = evaluation_service.GenerateInstanceRubricsResponse() + pb_resp = evaluation_service.GenerateInstanceRubricsResponse.pb(resp) + content = await response.read() + json_format.Parse(content, pb_resp, ignore_unknown_fields=True) + resp = await self._interceptor.post_generate_instance_rubrics(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + await self._interceptor.post_generate_instance_rubrics_with_metadata( + resp, response_metadata + ) + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = ( + evaluation_service.GenerateInstanceRubricsResponse.to_json( + response + ) + ) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": "OK", # need to obtain this properly + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.EvaluationServiceAsyncClient.generate_instance_rubrics", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.EvaluationService", + "rpcName": "GenerateInstanceRubrics", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + + return resp + @property def operations_client(self) -> AsyncOperationsRestClient: """Create the async client designed to process long-running operations. @@ -1265,6 +1499,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1333,6 +1571,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1675,6 +1917,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1767,6 +2013,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2117,6 +2367,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2209,6 +2463,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2555,6 +2813,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2647,6 +2909,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -2993,6 +3259,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3081,6 +3351,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } @@ -3116,6 +3390,15 @@ def evaluate_instances( ]: return self._EvaluateInstances(self._session, self._host, self._interceptor) # type: ignore + @property + def generate_instance_rubrics( + self, + ) -> Callable[ + [evaluation_service.GenerateInstanceRubricsRequest], + evaluation_service.GenerateInstanceRubricsResponse, + ]: + return self._GenerateInstanceRubrics(self._session, self._host, self._interceptor) # type: ignore + @property def get_location(self): return self._GetLocation(self._session, self._host, self._interceptor) # type: ignore diff --git a/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/rest_base.py index 7dab524673..3bc5eb9b4d 100644 --- a/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/rest_base.py @@ -217,6 +217,68 @@ def _get_query_params_json(transcoded_request): query_params["$alt"] = "json;enum-encoding=int" return query_params + class _BaseGenerateInstanceRubrics: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/v1beta1/{location=projects/*/locations/*}:generateInstanceRubrics", + "body": "*", + }, + { + "method": "post", + "uri": "/v1beta1:generateInstanceRubrics", + "body": "*", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = evaluation_service.GenerateInstanceRubricsRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=True + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=True, + ) + ) + query_params.update( + _BaseEvaluationServiceRestTransport._BaseGenerateInstanceRubrics._get_unset_required_fields( + query_params + ) + ) + + query_params["$alt"] = "json;enum-encoding=int" + return query_params + class _BaseGetLocation: def __hash__(self): # pragma: NO COVER return NotImplementedError("__hash__ must be implemented.") @@ -898,6 +960,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -966,6 +1032,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1327,6 +1397,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1419,6 +1493,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -1788,6 +1866,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1880,6 +1962,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2245,6 +2331,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2337,6 +2427,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2702,6 +2796,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2790,6 +2888,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/example_store_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/example_store_service/transports/rest.py index acc1b439eb..0850280fc0 100644 --- a/google/cloud/aiplatform_v1beta1/services/example_store_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/example_store_service/transports/rest.py @@ -1281,6 +1281,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1349,6 +1353,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1691,6 +1699,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1783,6 +1795,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2133,6 +2149,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2225,6 +2245,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2571,6 +2595,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2663,6 +2691,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3009,6 +3041,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3097,6 +3133,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/example_store_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/example_store_service/transports/rest_asyncio.py index 8f5edbc998..7ad9713367 100644 --- a/google/cloud/aiplatform_v1beta1/services/example_store_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/example_store_service/transports/rest_asyncio.py @@ -2847,6 +2847,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2915,6 +2919,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -3257,6 +3265,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3349,6 +3361,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -3699,6 +3715,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3791,6 +3811,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -4137,6 +4161,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -4229,6 +4257,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -4575,6 +4607,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -4663,6 +4699,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/example_store_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/example_store_service/transports/rest_base.py index 3262327fb1..c1c050cf2a 100644 --- a/google/cloud/aiplatform_v1beta1/services/example_store_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/example_store_service/transports/rest_base.py @@ -1262,6 +1262,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1330,6 +1334,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1691,6 +1699,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1783,6 +1795,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2152,6 +2168,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2244,6 +2264,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2609,6 +2633,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2701,6 +2729,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -3066,6 +3098,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3154,6 +3190,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/extension_execution_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/extension_execution_service/transports/rest_base.py index a0674a289e..dc51ff66b2 100644 --- a/google/cloud/aiplatform_v1beta1/services/extension_execution_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/extension_execution_service/transports/rest_base.py @@ -888,6 +888,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -956,6 +960,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1317,6 +1325,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1409,6 +1421,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -1778,6 +1794,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1870,6 +1890,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2235,6 +2259,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2327,6 +2355,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2692,6 +2724,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2780,6 +2816,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/extension_registry_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/extension_registry_service/transports/rest.py index d4589d953d..fc2d71bb6c 100644 --- a/google/cloud/aiplatform_v1beta1/services/extension_registry_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/extension_registry_service/transports/rest.py @@ -1040,6 +1040,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1108,6 +1112,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1450,6 +1458,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1542,6 +1554,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -1892,6 +1908,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1984,6 +2004,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2330,6 +2354,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2422,6 +2450,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -2768,6 +2800,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2856,6 +2892,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/extension_registry_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/extension_registry_service/transports/rest_asyncio.py index 3b31719d59..0814c913e7 100644 --- a/google/cloud/aiplatform_v1beta1/services/extension_registry_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/extension_registry_service/transports/rest_asyncio.py @@ -1933,6 +1933,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2001,6 +2005,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2343,6 +2351,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2435,6 +2447,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2785,6 +2801,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2877,6 +2897,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3223,6 +3247,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3315,6 +3343,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3661,6 +3693,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3749,6 +3785,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/extension_registry_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/extension_registry_service/transports/rest_base.py index b006cf2604..59db4ab89e 100644 --- a/google/cloud/aiplatform_v1beta1/services/extension_registry_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/extension_registry_service/transports/rest_base.py @@ -1033,6 +1033,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1101,6 +1105,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1462,6 +1470,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1554,6 +1566,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -1923,6 +1939,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2015,6 +2035,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2380,6 +2404,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2472,6 +2500,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2837,6 +2869,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2925,6 +2961,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/feature_online_store_admin_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/feature_online_store_admin_service/transports/rest.py index 8d69e589a0..d34017ff41 100644 --- a/google/cloud/aiplatform_v1beta1/services/feature_online_store_admin_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/feature_online_store_admin_service/transports/rest.py @@ -1518,6 +1518,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1586,6 +1590,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1928,6 +1936,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2020,6 +2032,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2370,6 +2386,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2462,6 +2482,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2808,6 +2832,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2900,6 +2928,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3246,6 +3278,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3334,6 +3370,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/feature_online_store_admin_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/feature_online_store_admin_service/transports/rest_asyncio.py index 531354de60..dd20bd0e66 100644 --- a/google/cloud/aiplatform_v1beta1/services/feature_online_store_admin_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/feature_online_store_admin_service/transports/rest_asyncio.py @@ -3789,6 +3789,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -3857,6 +3861,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -4199,6 +4207,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -4291,6 +4303,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -4641,6 +4657,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -4733,6 +4753,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -5079,6 +5103,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -5171,6 +5199,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -5517,6 +5549,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -5605,6 +5641,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/feature_online_store_admin_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/feature_online_store_admin_service/transports/rest_base.py index ad910acced..27d2b36be8 100644 --- a/google/cloud/aiplatform_v1beta1/services/feature_online_store_admin_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/feature_online_store_admin_service/transports/rest_base.py @@ -1482,6 +1482,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1550,6 +1554,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1911,6 +1919,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2003,6 +2015,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2372,6 +2388,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2464,6 +2484,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2829,6 +2853,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2921,6 +2949,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -3286,6 +3318,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3374,6 +3410,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/feature_online_store_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/feature_online_store_service/transports/rest_base.py index 9f9ff23a77..d693f36e19 100644 --- a/google/cloud/aiplatform_v1beta1/services/feature_online_store_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/feature_online_store_service/transports/rest_base.py @@ -944,6 +944,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1012,6 +1016,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1373,6 +1381,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1465,6 +1477,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -1834,6 +1850,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1926,6 +1946,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2291,6 +2315,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2383,6 +2411,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2748,6 +2780,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2836,6 +2872,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/feature_registry_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/feature_registry_service/transports/rest.py index 2f0e362fa0..04f5d5de82 100644 --- a/google/cloud/aiplatform_v1beta1/services/feature_registry_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/feature_registry_service/transports/rest.py @@ -1858,6 +1858,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1926,6 +1930,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2268,6 +2276,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2360,6 +2372,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2710,6 +2726,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2802,6 +2822,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3148,6 +3172,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3240,6 +3268,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3586,6 +3618,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3674,6 +3710,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/feature_registry_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/feature_registry_service/transports/rest_asyncio.py index 0ad87dee93..527c8fc1f2 100644 --- a/google/cloud/aiplatform_v1beta1/services/feature_registry_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/feature_registry_service/transports/rest_asyncio.py @@ -5089,6 +5089,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -5157,6 +5161,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -5499,6 +5507,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -5591,6 +5603,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -5941,6 +5957,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -6033,6 +6053,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -6379,6 +6403,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -6471,6 +6499,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -6817,6 +6849,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -6905,6 +6941,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/feature_registry_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/feature_registry_service/transports/rest_base.py index 2c11af205a..5f3d839916 100644 --- a/google/cloud/aiplatform_v1beta1/services/feature_registry_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/feature_registry_service/transports/rest_base.py @@ -1773,6 +1773,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1841,6 +1845,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -2202,6 +2210,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2294,6 +2306,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2663,6 +2679,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2755,6 +2775,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -3120,6 +3144,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3212,6 +3240,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -3577,6 +3609,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3665,6 +3701,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/rest_base.py index 9d03808376..80135a4aae 100644 --- a/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/rest_base.py @@ -955,6 +955,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1023,6 +1027,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1384,6 +1392,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1476,6 +1488,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -1845,6 +1861,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1937,6 +1957,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2302,6 +2326,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2394,6 +2422,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2759,6 +2791,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2847,6 +2883,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/featurestore_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/featurestore_service/transports/rest.py index 62fb1800b1..e04f16c32b 100644 --- a/google/cloud/aiplatform_v1beta1/services/featurestore_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/featurestore_service/transports/rest.py @@ -1962,6 +1962,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2030,6 +2034,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2372,6 +2380,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2464,6 +2476,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2814,6 +2830,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2906,6 +2926,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3252,6 +3276,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3344,6 +3372,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3690,6 +3722,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3778,6 +3814,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/featurestore_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/featurestore_service/transports/rest_asyncio.py index 6f55847eb9..171ae9193d 100644 --- a/google/cloud/aiplatform_v1beta1/services/featurestore_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/featurestore_service/transports/rest_asyncio.py @@ -5542,6 +5542,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -5610,6 +5614,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -5952,6 +5960,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -6044,6 +6056,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -6394,6 +6410,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -6486,6 +6506,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -6832,6 +6856,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -6924,6 +6952,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -7270,6 +7302,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -7358,6 +7394,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/featurestore_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/featurestore_service/transports/rest_base.py index 397b67ac0c..e03521838f 100644 --- a/google/cloud/aiplatform_v1beta1/services/featurestore_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/featurestore_service/transports/rest_base.py @@ -1882,6 +1882,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1950,6 +1954,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -2311,6 +2319,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2403,6 +2415,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2772,6 +2788,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2864,6 +2884,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -3229,6 +3253,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3321,6 +3349,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -3686,6 +3718,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3774,6 +3810,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/gen_ai_cache_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/gen_ai_cache_service/transports/rest_base.py index f7222156e0..d6e976462e 100644 --- a/google/cloud/aiplatform_v1beta1/services/gen_ai_cache_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/gen_ai_cache_service/transports/rest_base.py @@ -1034,6 +1034,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1102,6 +1106,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1463,6 +1471,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1555,6 +1567,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -1924,6 +1940,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2016,6 +2036,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2381,6 +2405,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2473,6 +2501,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2838,6 +2870,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2926,6 +2962,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/gen_ai_tuning_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/gen_ai_tuning_service/transports/rest.py index 506a293ab3..da7ffaa119 100644 --- a/google/cloud/aiplatform_v1beta1/services/gen_ai_tuning_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/gen_ai_tuning_service/transports/rest.py @@ -1005,6 +1005,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1073,6 +1077,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1415,6 +1423,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1507,6 +1519,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -1857,6 +1873,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1949,6 +1969,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2295,6 +2319,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2387,6 +2415,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -2733,6 +2765,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2821,6 +2857,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/gen_ai_tuning_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/gen_ai_tuning_service/transports/rest_asyncio.py index 53ceb8570c..ba28b1c88f 100644 --- a/google/cloud/aiplatform_v1beta1/services/gen_ai_tuning_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/gen_ai_tuning_service/transports/rest_asyncio.py @@ -1855,6 +1855,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1923,6 +1927,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2265,6 +2273,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2357,6 +2369,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2707,6 +2723,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2799,6 +2819,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3145,6 +3169,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3237,6 +3265,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3583,6 +3615,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3671,6 +3707,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/gen_ai_tuning_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/gen_ai_tuning_service/transports/rest_base.py index 07e35dc5ab..d9638b3461 100644 --- a/google/cloud/aiplatform_v1beta1/services/gen_ai_tuning_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/gen_ai_tuning_service/transports/rest_base.py @@ -1042,6 +1042,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1110,6 +1114,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1471,6 +1479,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1563,6 +1575,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -1932,6 +1948,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2024,6 +2044,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2389,6 +2413,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2481,6 +2509,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2846,6 +2878,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2934,6 +2970,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/transports/rest.py index bf658ef101..11616084ef 100644 --- a/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/transports/rest.py @@ -1215,6 +1215,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1283,6 +1287,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1625,6 +1633,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1717,6 +1729,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2067,6 +2083,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2159,6 +2179,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2505,6 +2529,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2597,6 +2625,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -2943,6 +2975,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3031,6 +3067,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/transports/rest_asyncio.py index 7248429d61..0c17171219 100644 --- a/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/transports/rest_asyncio.py @@ -2613,6 +2613,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2681,6 +2685,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -3023,6 +3031,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3115,6 +3127,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -3465,6 +3481,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3557,6 +3577,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3903,6 +3927,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3995,6 +4023,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -4341,6 +4373,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -4429,6 +4465,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/transports/rest_base.py index 2adcef0b21..9f575e43fa 100644 --- a/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/transports/rest_base.py @@ -1204,6 +1204,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1272,6 +1276,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1633,6 +1641,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1725,6 +1737,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2094,6 +2110,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2186,6 +2206,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2551,6 +2575,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2643,6 +2671,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -3008,6 +3040,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3096,6 +3132,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/index_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/index_service/transports/rest.py index 9b8d427891..2b49d38a65 100644 --- a/google/cloud/aiplatform_v1beta1/services/index_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/index_service/transports/rest.py @@ -1202,6 +1202,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1270,6 +1274,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1612,6 +1620,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1704,6 +1716,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2054,6 +2070,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2146,6 +2166,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2492,6 +2516,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2584,6 +2612,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -2930,6 +2962,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3018,6 +3054,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/index_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/index_service/transports/rest_asyncio.py index d69c4ca751..cfa424a3cd 100644 --- a/google/cloud/aiplatform_v1beta1/services/index_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/index_service/transports/rest_asyncio.py @@ -2621,6 +2621,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2689,6 +2693,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -3031,6 +3039,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3123,6 +3135,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -3473,6 +3489,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3565,6 +3585,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3911,6 +3935,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -4003,6 +4031,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -4349,6 +4381,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -4437,6 +4473,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/index_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/index_service/transports/rest_base.py index 2875157d1c..f015c84c3a 100644 --- a/google/cloud/aiplatform_v1beta1/services/index_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/index_service/transports/rest_base.py @@ -1201,6 +1201,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1269,6 +1273,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1630,6 +1638,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1722,6 +1734,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2091,6 +2107,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2183,6 +2203,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2548,6 +2572,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2640,6 +2668,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -3005,6 +3037,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3093,6 +3129,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/job_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/job_service/transports/rest.py index 8aa0c6dccb..e19f73c98a 100644 --- a/google/cloud/aiplatform_v1beta1/services/job_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/job_service/transports/rest.py @@ -2523,6 +2523,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2591,6 +2595,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2933,6 +2941,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3025,6 +3037,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -3375,6 +3391,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3467,6 +3487,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3813,6 +3837,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3905,6 +3933,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -4251,6 +4283,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -4339,6 +4375,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/job_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/job_service/transports/rest_asyncio.py index 69ae4fc84b..07a46236ef 100644 --- a/google/cloud/aiplatform_v1beta1/services/job_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/job_service/transports/rest_asyncio.py @@ -8290,6 +8290,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -8358,6 +8362,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -8700,6 +8708,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -8792,6 +8804,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -9142,6 +9158,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -9234,6 +9254,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -9580,6 +9604,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -9672,6 +9700,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -10018,6 +10050,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -10106,6 +10142,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/job_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/job_service/transports/rest_base.py index 9f37f56c89..e74d28d8f5 100644 --- a/google/cloud/aiplatform_v1beta1/services/job_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/job_service/transports/rest_base.py @@ -2608,6 +2608,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2676,6 +2680,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -3037,6 +3045,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3129,6 +3141,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -3498,6 +3514,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3590,6 +3610,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -3955,6 +3979,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -4047,6 +4075,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -4412,6 +4444,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -4500,6 +4536,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/llm_utility_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/llm_utility_service/transports/rest_base.py index b9806972fd..7656cd093b 100644 --- a/google/cloud/aiplatform_v1beta1/services/llm_utility_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/llm_utility_service/transports/rest_base.py @@ -846,6 +846,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -914,6 +918,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1275,6 +1283,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1367,6 +1379,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -1736,6 +1752,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1828,6 +1848,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2193,6 +2217,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2285,6 +2313,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2650,6 +2682,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2738,6 +2774,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/match_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/match_service/transports/rest_base.py index 631edf2ff0..c677db6ce6 100644 --- a/google/cloud/aiplatform_v1beta1/services/match_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/match_service/transports/rest_base.py @@ -888,6 +888,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -956,6 +960,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1317,6 +1325,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1409,6 +1421,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -1778,6 +1794,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1870,6 +1890,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2235,6 +2259,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2327,6 +2355,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2692,6 +2724,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2780,6 +2816,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/memory_bank_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/memory_bank_service/transports/rest.py index 6a415ee002..11ec09165f 100644 --- a/google/cloud/aiplatform_v1beta1/services/memory_bank_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/memory_bank_service/transports/rest.py @@ -1151,6 +1151,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1219,6 +1223,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1561,6 +1569,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1653,6 +1665,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2003,6 +2019,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2095,6 +2115,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2441,6 +2465,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2533,6 +2561,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -2879,6 +2911,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2967,6 +3003,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/memory_bank_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/memory_bank_service/transports/rest_asyncio.py index 3df50b8c24..5cdbbcee62 100644 --- a/google/cloud/aiplatform_v1beta1/services/memory_bank_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/memory_bank_service/transports/rest_asyncio.py @@ -2382,6 +2382,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2450,6 +2454,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2792,6 +2800,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2884,6 +2896,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -3234,6 +3250,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3326,6 +3346,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3672,6 +3696,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3764,6 +3792,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -4110,6 +4142,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -4198,6 +4234,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/memory_bank_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/memory_bank_service/transports/rest_base.py index 15afe6191a..f36581afd4 100644 --- a/google/cloud/aiplatform_v1beta1/services/memory_bank_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/memory_bank_service/transports/rest_base.py @@ -1176,6 +1176,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1244,6 +1248,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1605,6 +1613,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1697,6 +1709,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2066,6 +2082,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2158,6 +2178,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2523,6 +2547,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2615,6 +2643,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2980,6 +3012,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3068,6 +3104,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/metadata_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/metadata_service/transports/rest.py index 1969f38005..4434970a3b 100644 --- a/google/cloud/aiplatform_v1beta1/services/metadata_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/metadata_service/transports/rest.py @@ -2590,6 +2590,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2658,6 +2662,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -3000,6 +3008,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3092,6 +3104,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -3442,6 +3458,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3534,6 +3554,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3880,6 +3904,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3972,6 +4000,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -4318,6 +4350,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -4406,6 +4442,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/metadata_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/metadata_service/transports/rest_asyncio.py index e45dacd5fd..be0aa4bc7f 100644 --- a/google/cloud/aiplatform_v1beta1/services/metadata_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/metadata_service/transports/rest_asyncio.py @@ -8009,6 +8009,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -8077,6 +8081,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -8419,6 +8427,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -8511,6 +8523,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -8861,6 +8877,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -8953,6 +8973,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -9299,6 +9323,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -9391,6 +9419,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -9737,6 +9769,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -9825,6 +9861,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/metadata_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/metadata_service/transports/rest_base.py index b7c22332e1..ba1ba221a7 100644 --- a/google/cloud/aiplatform_v1beta1/services/metadata_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/metadata_service/transports/rest_base.py @@ -2444,6 +2444,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2512,6 +2516,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -2873,6 +2881,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2965,6 +2977,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -3334,6 +3350,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3426,6 +3446,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -3791,6 +3815,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3883,6 +3911,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -4248,6 +4280,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -4336,6 +4372,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/migration_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/migration_service/transports/rest.py index fe7c926354..550880c042 100644 --- a/google/cloud/aiplatform_v1beta1/services/migration_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/migration_service/transports/rest.py @@ -870,6 +870,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -938,6 +942,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1280,6 +1288,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1372,6 +1384,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -1722,6 +1738,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1814,6 +1834,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2160,6 +2184,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2252,6 +2280,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -2598,6 +2630,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2686,6 +2722,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/migration_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/migration_service/transports/rest_asyncio.py index 16803f6d77..76aaab2196 100644 --- a/google/cloud/aiplatform_v1beta1/services/migration_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/migration_service/transports/rest_asyncio.py @@ -1273,6 +1273,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1341,6 +1345,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1683,6 +1691,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1775,6 +1787,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2125,6 +2141,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2217,6 +2237,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2563,6 +2587,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2655,6 +2683,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3001,6 +3033,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3089,6 +3125,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/migration_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/migration_service/transports/rest_base.py index 3d0b0cb4e6..d702be4f42 100644 --- a/google/cloud/aiplatform_v1beta1/services/migration_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/migration_service/transports/rest_base.py @@ -888,6 +888,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -956,6 +960,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1317,6 +1325,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1409,6 +1421,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -1778,6 +1794,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1870,6 +1890,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2235,6 +2259,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2327,6 +2355,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2692,6 +2724,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2780,6 +2816,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/model_garden_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/model_garden_service/transports/rest.py index c40fd25ca5..3b942b1f7b 100644 --- a/google/cloud/aiplatform_v1beta1/services/model_garden_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/model_garden_service/transports/rest.py @@ -1160,6 +1160,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1228,6 +1232,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1570,6 +1578,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1662,6 +1674,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2012,6 +2028,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2104,6 +2124,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2450,6 +2474,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2542,6 +2570,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -2888,6 +2920,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2976,6 +3012,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/model_garden_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/model_garden_service/transports/rest_asyncio.py index 325df704f3..705aac85c1 100644 --- a/google/cloud/aiplatform_v1beta1/services/model_garden_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/model_garden_service/transports/rest_asyncio.py @@ -2408,6 +2408,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2476,6 +2480,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2818,6 +2826,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2910,6 +2922,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -3260,6 +3276,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3352,6 +3372,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3698,6 +3722,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3790,6 +3818,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -4136,6 +4168,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -4224,6 +4260,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/model_garden_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/model_garden_service/transports/rest_base.py index c18186908f..c300162c44 100644 --- a/google/cloud/aiplatform_v1beta1/services/model_garden_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/model_garden_service/transports/rest_base.py @@ -1160,6 +1160,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1228,6 +1232,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1589,6 +1597,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1681,6 +1693,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2050,6 +2066,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2142,6 +2162,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2507,6 +2531,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2599,6 +2627,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2964,6 +2996,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3052,6 +3088,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/model_monitoring_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/model_monitoring_service/transports/rest.py index 54edb5e16c..4ba43d089d 100644 --- a/google/cloud/aiplatform_v1beta1/services/model_monitoring_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/model_monitoring_service/transports/rest.py @@ -1403,6 +1403,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1471,6 +1475,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1813,6 +1821,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1905,6 +1917,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2255,6 +2271,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2347,6 +2367,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2693,6 +2717,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2785,6 +2813,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3131,6 +3163,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3219,6 +3255,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/model_monitoring_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/model_monitoring_service/transports/rest_asyncio.py index 83e9e358cb..85af3b9077 100644 --- a/google/cloud/aiplatform_v1beta1/services/model_monitoring_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/model_monitoring_service/transports/rest_asyncio.py @@ -3336,6 +3336,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -3404,6 +3408,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -3746,6 +3754,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3838,6 +3850,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -4188,6 +4204,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -4280,6 +4300,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -4626,6 +4650,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -4718,6 +4746,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -5064,6 +5096,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -5152,6 +5188,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/model_monitoring_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/model_monitoring_service/transports/rest_base.py index 3bc949bcca..ee83e64216 100644 --- a/google/cloud/aiplatform_v1beta1/services/model_monitoring_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/model_monitoring_service/transports/rest_base.py @@ -1360,6 +1360,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1428,6 +1432,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1789,6 +1797,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1881,6 +1893,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2250,6 +2266,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2342,6 +2362,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2707,6 +2731,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2799,6 +2827,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -3164,6 +3196,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3252,6 +3288,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/model_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/model_service/transports/rest.py index 9359555aaf..cc4320dc04 100644 --- a/google/cloud/aiplatform_v1beta1/services/model_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/model_service/transports/rest.py @@ -1902,6 +1902,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1970,6 +1974,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2312,6 +2320,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2404,6 +2416,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2754,6 +2770,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2846,6 +2866,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3192,6 +3216,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3284,6 +3312,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3630,6 +3662,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3718,6 +3754,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/model_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/model_service/transports/rest_asyncio.py index 78dae119c1..141b5ce8c0 100644 --- a/google/cloud/aiplatform_v1beta1/services/model_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/model_service/transports/rest_asyncio.py @@ -5362,6 +5362,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -5430,6 +5434,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -5772,6 +5780,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -5864,6 +5876,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -6214,6 +6230,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -6306,6 +6326,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -6652,6 +6676,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -6744,6 +6772,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -7090,6 +7122,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -7178,6 +7214,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/model_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/model_service/transports/rest_base.py index 9b891126f5..7b60e3ad8b 100644 --- a/google/cloud/aiplatform_v1beta1/services/model_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/model_service/transports/rest_base.py @@ -1827,6 +1827,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1895,6 +1899,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -2256,6 +2264,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2348,6 +2360,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2717,6 +2733,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2809,6 +2829,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -3174,6 +3198,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3266,6 +3294,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -3631,6 +3663,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3719,6 +3755,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/notebook_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/notebook_service/transports/rest.py index 721076567e..415b290198 100644 --- a/google/cloud/aiplatform_v1beta1/services/notebook_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/notebook_service/transports/rest.py @@ -1687,6 +1687,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1755,6 +1759,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2097,6 +2105,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2189,6 +2201,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2539,6 +2555,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2631,6 +2651,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2977,6 +3001,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3069,6 +3097,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3415,6 +3447,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3503,6 +3539,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/notebook_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/notebook_service/transports/rest_asyncio.py index 404ce148f0..65f4998efe 100644 --- a/google/cloud/aiplatform_v1beta1/services/notebook_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/notebook_service/transports/rest_asyncio.py @@ -4473,6 +4473,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -4541,6 +4545,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -4883,6 +4891,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -4975,6 +4987,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -5325,6 +5341,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -5417,6 +5437,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -5763,6 +5787,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -5855,6 +5883,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -6201,6 +6233,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -6289,6 +6325,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/notebook_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/notebook_service/transports/rest_base.py index fe4a1e9014..24080e63b1 100644 --- a/google/cloud/aiplatform_v1beta1/services/notebook_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/notebook_service/transports/rest_base.py @@ -1608,6 +1608,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1676,6 +1680,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -2037,6 +2045,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2129,6 +2141,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2498,6 +2514,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2590,6 +2610,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2955,6 +2979,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3047,6 +3075,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -3412,6 +3444,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3500,6 +3536,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/__init__.py b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/__init__.py new file mode 100644 index 0000000000..fe1d097a81 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from .client import OnlineEvaluatorServiceClient +from .async_client import OnlineEvaluatorServiceAsyncClient + +__all__ = ( + "OnlineEvaluatorServiceClient", + "OnlineEvaluatorServiceAsyncClient", +) diff --git a/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/async_client.py new file mode 100644 index 0000000000..a944717277 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/async_client.py @@ -0,0 +1,1991 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import logging as std_logging +from collections import OrderedDict +import re +from typing import ( + Dict, + Callable, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.aiplatform_v1beta1 import gapic_version as package_version + +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_async as retries +from google.auth import credentials as ga_credentials # type: ignore +from google.oauth2 import service_account # type: ignore +import google.protobuf + + +try: + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault, None] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore + +from google.cloud.aiplatform_v1beta1.services.online_evaluator_service import pagers +from google.cloud.aiplatform_v1beta1.types import evaluation_service +from google.cloud.aiplatform_v1beta1.types import online_evaluator +from google.cloud.aiplatform_v1beta1.types import ( + online_evaluator as gca_online_evaluator, +) +from google.cloud.aiplatform_v1beta1.types import online_evaluator_service +from google.cloud.location import locations_pb2 # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.longrunning import operations_pb2 # type: ignore +import google.api_core.operation as operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +from .transports.base import OnlineEvaluatorServiceTransport, DEFAULT_CLIENT_INFO +from .transports.grpc_asyncio import OnlineEvaluatorServiceGrpcAsyncIOTransport +from .client import OnlineEvaluatorServiceClient + +try: + from google.api_core import client_logging # type: ignore + + CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER +except ImportError: # pragma: NO COVER + CLIENT_LOGGING_SUPPORTED = False + +_LOGGER = std_logging.getLogger(__name__) + + +class OnlineEvaluatorServiceAsyncClient: + """This service is used to create and manage Vertex AI + OnlineEvaluators. + """ + + _client: OnlineEvaluatorServiceClient + + # Copy defaults from the synchronous client for use here. + # Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead. + DEFAULT_ENDPOINT = OnlineEvaluatorServiceClient.DEFAULT_ENDPOINT + DEFAULT_MTLS_ENDPOINT = OnlineEvaluatorServiceClient.DEFAULT_MTLS_ENDPOINT + _DEFAULT_ENDPOINT_TEMPLATE = OnlineEvaluatorServiceClient._DEFAULT_ENDPOINT_TEMPLATE + _DEFAULT_UNIVERSE = OnlineEvaluatorServiceClient._DEFAULT_UNIVERSE + + online_evaluator_path = staticmethod( + OnlineEvaluatorServiceClient.online_evaluator_path + ) + parse_online_evaluator_path = staticmethod( + OnlineEvaluatorServiceClient.parse_online_evaluator_path + ) + common_billing_account_path = staticmethod( + OnlineEvaluatorServiceClient.common_billing_account_path + ) + parse_common_billing_account_path = staticmethod( + OnlineEvaluatorServiceClient.parse_common_billing_account_path + ) + common_folder_path = staticmethod(OnlineEvaluatorServiceClient.common_folder_path) + parse_common_folder_path = staticmethod( + OnlineEvaluatorServiceClient.parse_common_folder_path + ) + common_organization_path = staticmethod( + OnlineEvaluatorServiceClient.common_organization_path + ) + parse_common_organization_path = staticmethod( + OnlineEvaluatorServiceClient.parse_common_organization_path + ) + common_project_path = staticmethod(OnlineEvaluatorServiceClient.common_project_path) + parse_common_project_path = staticmethod( + OnlineEvaluatorServiceClient.parse_common_project_path + ) + common_location_path = staticmethod( + OnlineEvaluatorServiceClient.common_location_path + ) + parse_common_location_path = staticmethod( + OnlineEvaluatorServiceClient.parse_common_location_path + ) + + @classmethod + def from_service_account_info(cls, info: dict, *args, **kwargs): + """Creates an instance of this client using the provided credentials + info. + + Args: + info (dict): The service account private key info. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + OnlineEvaluatorServiceAsyncClient: The constructed client. + """ + sa_info_func = ( + OnlineEvaluatorServiceClient.from_service_account_info.__func__ # type: ignore + ) + return sa_info_func(OnlineEvaluatorServiceAsyncClient, info, *args, **kwargs) + + @classmethod + def from_service_account_file(cls, filename: str, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + OnlineEvaluatorServiceAsyncClient: The constructed client. + """ + sa_file_func = ( + OnlineEvaluatorServiceClient.from_service_account_file.__func__ # type: ignore + ) + return sa_file_func( + OnlineEvaluatorServiceAsyncClient, filename, *args, **kwargs + ) + + from_service_account_json = from_service_account_file + + @classmethod + def get_mtls_endpoint_and_cert_source( + cls, client_options: Optional[ClientOptions] = None + ): + """Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variable is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + return OnlineEvaluatorServiceClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore + + @property + def transport(self) -> OnlineEvaluatorServiceTransport: + """Returns the transport used by the client instance. + + Returns: + OnlineEvaluatorServiceTransport: The transport used by the client instance. + """ + return self._client.transport + + @property + def api_endpoint(self): + """Return the API endpoint used by the client instance. + + Returns: + str: The API endpoint used by the client instance. + """ + return self._client._api_endpoint + + @property + def universe_domain(self) -> str: + """Return the universe domain used by the client instance. + + Returns: + str: The universe domain used + by the client instance. + """ + return self._client._universe_domain + + get_transport_class = OnlineEvaluatorServiceClient.get_transport_class + + def __init__( + self, + *, + credentials: Optional[ga_credentials.Credentials] = None, + transport: Optional[ + Union[ + str, + OnlineEvaluatorServiceTransport, + Callable[..., OnlineEvaluatorServiceTransport], + ] + ] = "grpc_asyncio", + client_options: Optional[ClientOptions] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + ) -> None: + """Instantiates the online evaluator service async client. + + Args: + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + transport (Optional[Union[str,OnlineEvaluatorServiceTransport,Callable[..., OnlineEvaluatorServiceTransport]]]): + The transport to use, or a Callable that constructs and returns a new transport to use. + If a Callable is given, it will be called with the same set of initialization + arguments as used in the OnlineEvaluatorServiceTransport constructor. + If set to None, a transport is chosen automatically. + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): + Custom options for the client. + + 1. The ``api_endpoint`` property can be used to override the + default endpoint provided by the client when ``transport`` is + not explicitly provided. Only if this property is not set and + ``transport`` was not explicitly provided, the endpoint is + determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment + variable, which have one of the following values: + "always" (always use the default mTLS endpoint), "never" (always + use the default regular endpoint) and "auto" (auto-switch to the + default mTLS endpoint if client certificate is present; this is + the default value). + + 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable + is "true", then the ``client_cert_source`` property can be used + to provide a client certificate for mTLS transport. If + not provided, the default SSL client certificate will be used if + present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not + set, no client certificate will be used. + + 3. The ``universe_domain`` property can be used to override the + default "googleapis.com" universe. Note that ``api_endpoint`` + property still takes precedence; and ``universe_domain`` is + currently not supported for mTLS. + + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + + Raises: + google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport + creation failed for any reason. + """ + self._client = OnlineEvaluatorServiceClient( + credentials=credentials, + transport=transport, + client_options=client_options, + client_info=client_info, + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + std_logging.DEBUG + ): # pragma: NO COVER + _LOGGER.debug( + "Created client `google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient`.", + extra=( + { + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "universeDomain": getattr( + self._client._transport._credentials, "universe_domain", "" + ), + "credentialsType": f"{type(self._client._transport._credentials).__module__}.{type(self._client._transport._credentials).__qualname__}", + "credentialsInfo": getattr( + self.transport._credentials, "get_cred_info", lambda: None + )(), + } + if hasattr(self._client._transport, "_credentials") + else { + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "credentialsType": None, + } + ), + ) + + async def create_online_evaluator( + self, + request: Optional[ + Union[online_evaluator_service.CreateOnlineEvaluatorRequest, dict] + ] = None, + *, + parent: Optional[str] = None, + online_evaluator: Optional[gca_online_evaluator.OnlineEvaluator] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation_async.AsyncOperation: + r"""Creates an OnlineEvaluator in the given project and + location. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + async def sample_create_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient() + + # Initialize request argument(s) + online_evaluator = aiplatform_v1beta1.OnlineEvaluator() + online_evaluator.cloud_observability.open_telemetry.semconv_version = "semconv_version_value" + online_evaluator.agent_resource = "agent_resource_value" + online_evaluator.metric_sources.metric.predefined_metric_spec.metric_spec_name = "metric_spec_name_value" + online_evaluator.config.random_sampling.percentage = 1054 + + request = aiplatform_v1beta1.CreateOnlineEvaluatorRequest( + parent="parent_value", + online_evaluator=online_evaluator, + ) + + # Make the request + operation = client.create_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.cloud.aiplatform_v1beta1.types.CreateOnlineEvaluatorRequest, dict]]): + The request object. Request message for + CreateOnlineEvaluator. + parent (:class:`str`): + Required. The parent resource where + the OnlineEvaluator will be created. + Format: + projects/{project}/locations/{location}. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + online_evaluator (:class:`google.cloud.aiplatform_v1beta1.types.OnlineEvaluator`): + Required. The OnlineEvaluator to + create. + + This corresponds to the ``online_evaluator`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.cloud.aiplatform_v1beta1.types.OnlineEvaluator` + An OnlineEvaluator contains the configuration for an + Online Evaluation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [parent, online_evaluator] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, online_evaluator_service.CreateOnlineEvaluatorRequest + ): + request = online_evaluator_service.CreateOnlineEvaluatorRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + if online_evaluator is not None: + request.online_evaluator = online_evaluator + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._client._transport._wrapped_methods[ + self._client._transport.create_online_evaluator + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + gca_online_evaluator.OnlineEvaluator, + metadata_type=online_evaluator_service.CreateOnlineEvaluatorOperationMetadata, + ) + + # Done; return the response. + return response + + async def get_online_evaluator( + self, + request: Optional[ + Union[online_evaluator_service.GetOnlineEvaluatorRequest, dict] + ] = None, + *, + name: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> online_evaluator.OnlineEvaluator: + r"""Gets details of an OnlineEvaluator. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + async def sample_get_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.GetOnlineEvaluatorRequest( + name="name_value", + ) + + # Make the request + response = await client.get_online_evaluator(request=request) + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.cloud.aiplatform_v1beta1.types.GetOnlineEvaluatorRequest, dict]]): + The request object. Request message for + GetOnlineEvaluator. + name (:class:`str`): + Required. The name of the + OnlineEvaluator to retrieve. Format: + projects/{project}/locations/{location}/onlineEvaluators/{id}. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.aiplatform_v1beta1.types.OnlineEvaluator: + An OnlineEvaluator contains the + configuration for an Online Evaluation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [name] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, online_evaluator_service.GetOnlineEvaluatorRequest): + request = online_evaluator_service.GetOnlineEvaluatorRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._client._transport._wrapped_methods[ + self._client._transport.get_online_evaluator + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def update_online_evaluator( + self, + request: Optional[ + Union[online_evaluator_service.UpdateOnlineEvaluatorRequest, dict] + ] = None, + *, + online_evaluator: Optional[gca_online_evaluator.OnlineEvaluator] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation_async.AsyncOperation: + r"""Updates the fields of an OnlineEvaluator. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + async def sample_update_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient() + + # Initialize request argument(s) + online_evaluator = aiplatform_v1beta1.OnlineEvaluator() + online_evaluator.cloud_observability.open_telemetry.semconv_version = "semconv_version_value" + online_evaluator.agent_resource = "agent_resource_value" + online_evaluator.metric_sources.metric.predefined_metric_spec.metric_spec_name = "metric_spec_name_value" + online_evaluator.config.random_sampling.percentage = 1054 + + request = aiplatform_v1beta1.UpdateOnlineEvaluatorRequest( + online_evaluator=online_evaluator, + ) + + # Make the request + operation = client.update_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.cloud.aiplatform_v1beta1.types.UpdateOnlineEvaluatorRequest, dict]]): + The request object. Request message for + UpdateOnlineEvaluator. + online_evaluator (:class:`google.cloud.aiplatform_v1beta1.types.OnlineEvaluator`): + Required. The OnlineEvaluator to + update. Format: + projects/{project}/locations/{location}/onlineEvaluators/{id}. + + This corresponds to the ``online_evaluator`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`): + Optional. Field mask is used to + control which fields get updated. If the + mask is not present, all fields will be + updated. + + 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_async.AsyncRetry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.cloud.aiplatform_v1beta1.types.OnlineEvaluator` + An OnlineEvaluator contains the configuration for an + Online Evaluation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [online_evaluator, update_mask] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, online_evaluator_service.UpdateOnlineEvaluatorRequest + ): + request = online_evaluator_service.UpdateOnlineEvaluatorRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if online_evaluator is not None: + request.online_evaluator = online_evaluator + if update_mask is not None: + request.update_mask = update_mask + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._client._transport._wrapped_methods[ + self._client._transport.update_online_evaluator + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + (("online_evaluator.name", request.online_evaluator.name),) + ), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + gca_online_evaluator.OnlineEvaluator, + metadata_type=online_evaluator_service.UpdateOnlineEvaluatorOperationMetadata, + ) + + # Done; return the response. + return response + + async def delete_online_evaluator( + self, + request: Optional[ + Union[online_evaluator_service.DeleteOnlineEvaluatorRequest, dict] + ] = None, + *, + name: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation_async.AsyncOperation: + r"""Deletes an OnlineEvaluator. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + async def sample_delete_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.DeleteOnlineEvaluatorRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.cloud.aiplatform_v1beta1.types.DeleteOnlineEvaluatorRequest, dict]]): + The request object. Request message for + DeleteOnlineEvaluator. + name (:class:`str`): + Required. The name of the + OnlineEvaluator to delete. Format: + projects/{project}/locations/{location}/onlineEvaluators/{id}. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to + use it as the request or the response type of an API + method. For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); + + } + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [name] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, online_evaluator_service.DeleteOnlineEvaluatorRequest + ): + request = online_evaluator_service.DeleteOnlineEvaluatorRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._client._transport._wrapped_methods[ + self._client._transport.delete_online_evaluator + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + empty_pb2.Empty, + metadata_type=online_evaluator_service.DeleteOnlineEvaluatorOperationMetadata, + ) + + # Done; return the response. + return response + + async def list_online_evaluators( + self, + request: Optional[ + Union[online_evaluator_service.ListOnlineEvaluatorsRequest, dict] + ] = None, + *, + parent: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> pagers.ListOnlineEvaluatorsAsyncPager: + r"""Lists the OnlineEvaluators for the given project and + location. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + async def sample_list_online_evaluators(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.ListOnlineEvaluatorsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_online_evaluators(request=request) + + # Handle the response + async for response in page_result: + print(response) + + Args: + request (Optional[Union[google.cloud.aiplatform_v1beta1.types.ListOnlineEvaluatorsRequest, dict]]): + The request object. Request message for + ListOnlineEvaluators. + parent (:class:`str`): + Required. The parent resource of the + OnlineEvaluators to list. Format: + projects/{project}/locations/{location}. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.aiplatform_v1beta1.services.online_evaluator_service.pagers.ListOnlineEvaluatorsAsyncPager: + Response message for + ListOnlineEvaluators. + Iterating over this object will yield + results and resolve additional pages + automatically. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [parent] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, online_evaluator_service.ListOnlineEvaluatorsRequest + ): + request = online_evaluator_service.ListOnlineEvaluatorsRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._client._transport._wrapped_methods[ + self._client._transport.list_online_evaluators + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__aiter__` convenience method. + response = pagers.ListOnlineEvaluatorsAsyncPager( + method=rpc, + request=request, + response=response, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def activate_online_evaluator( + self, + request: Optional[ + Union[online_evaluator_service.ActivateOnlineEvaluatorRequest, dict] + ] = None, + *, + name: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation_async.AsyncOperation: + r"""Activates an OnlineEvaluator. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + async def sample_activate_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.ActivateOnlineEvaluatorRequest( + name="name_value", + ) + + # Make the request + operation = client.activate_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.cloud.aiplatform_v1beta1.types.ActivateOnlineEvaluatorRequest, dict]]): + The request object. Request message for + ActivateOnlineEvaluator. + name (:class:`str`): + Required. The name of the + OnlineEvaluator to activate. Format: + projects/{project}/locations/{location}/onlineEvaluators/{id}. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.cloud.aiplatform_v1beta1.types.OnlineEvaluator` + An OnlineEvaluator contains the configuration for an + Online Evaluation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [name] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, online_evaluator_service.ActivateOnlineEvaluatorRequest + ): + request = online_evaluator_service.ActivateOnlineEvaluatorRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._client._transport._wrapped_methods[ + self._client._transport.activate_online_evaluator + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + online_evaluator.OnlineEvaluator, + metadata_type=online_evaluator_service.ActivateOnlineEvaluatorOperationMetadata, + ) + + # Done; return the response. + return response + + async def suspend_online_evaluator( + self, + request: Optional[ + Union[online_evaluator_service.SuspendOnlineEvaluatorRequest, dict] + ] = None, + *, + name: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation_async.AsyncOperation: + r"""Suspends an OnlineEvaluator. When an OnlineEvaluator + is suspended, it won't run any evaluations until it is + activated again. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + async def sample_suspend_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.SuspendOnlineEvaluatorRequest( + name="name_value", + ) + + # Make the request + operation = client.suspend_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.cloud.aiplatform_v1beta1.types.SuspendOnlineEvaluatorRequest, dict]]): + The request object. Request message for + SuspendOnlineEvaluator. + name (:class:`str`): + Required. The name of the + OnlineEvaluator to suspend. Format: + projects/{project}/locations/{location}/onlineEvaluators/{id}. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.cloud.aiplatform_v1beta1.types.OnlineEvaluator` + An OnlineEvaluator contains the configuration for an + Online Evaluation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [name] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, online_evaluator_service.SuspendOnlineEvaluatorRequest + ): + request = online_evaluator_service.SuspendOnlineEvaluatorRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._client._transport._wrapped_methods[ + self._client._transport.suspend_online_evaluator + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + online_evaluator.OnlineEvaluator, + metadata_type=online_evaluator_service.SuspendOnlineEvaluatorOperationMetadata, + ) + + # Done; return the response. + return response + + async def list_operations( + self, + request: Optional[operations_pb2.ListOperationsRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.ListOperationsResponse: + r"""Lists operations that match the specified filter in the request. + + Args: + request (:class:`~.operations_pb2.ListOperationsRequest`): + The request object. Request message for + `ListOperations` method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + ~.operations_pb2.ListOperationsResponse: + Response message for ``ListOperations`` method. + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = operations_pb2.ListOperationsRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self.transport._wrapped_methods[self._client._transport.list_operations] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def get_operation( + self, + request: Optional[operations_pb2.GetOperationRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Gets the latest state of a long-running operation. + + Args: + request (:class:`~.operations_pb2.GetOperationRequest`): + The request object. Request message for + `GetOperation` method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + ~.operations_pb2.Operation: + An ``Operation`` object. + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = operations_pb2.GetOperationRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self.transport._wrapped_methods[self._client._transport.get_operation] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def delete_operation( + self, + request: Optional[operations_pb2.DeleteOperationRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> None: + r"""Deletes a long-running operation. + + This method indicates that the client is no longer interested + in the operation result. It does not cancel the operation. + If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. + + Args: + request (:class:`~.operations_pb2.DeleteOperationRequest`): + The request object. Request message for + `DeleteOperation` method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + None + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = operations_pb2.DeleteOperationRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self.transport._wrapped_methods[self._client._transport.delete_operation] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + async def cancel_operation( + self, + request: Optional[operations_pb2.CancelOperationRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> None: + r"""Starts asynchronous cancellation on a long-running operation. + + The server makes a best effort to cancel the operation, but success + is not guaranteed. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. + + Args: + request (:class:`~.operations_pb2.CancelOperationRequest`): + The request object. Request message for + `CancelOperation` method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + None + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = operations_pb2.CancelOperationRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self.transport._wrapped_methods[self._client._transport.cancel_operation] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + async def wait_operation( + self, + request: Optional[operations_pb2.WaitOperationRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Waits until the specified long-running operation is done or reaches at most + a specified timeout, returning the latest state. + + If the operation is already done, the latest state is immediately returned. + If the timeout specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + timeout is used. If the server does not support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. + + Args: + request (:class:`~.operations_pb2.WaitOperationRequest`): + The request object. Request message for + `WaitOperation` method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + ~.operations_pb2.Operation: + An ``Operation`` object. + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = operations_pb2.WaitOperationRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self.transport._wrapped_methods[self._client._transport.wait_operation] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def set_iam_policy( + self, + request: Optional[iam_policy_pb2.SetIamPolicyRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> policy_pb2.Policy: + r"""Sets the IAM access control policy on the specified function. + + Replaces any existing policy. + + Args: + request (:class:`~.iam_policy_pb2.SetIamPolicyRequest`): + The request object. Request message for `SetIamPolicy` + method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + ~.policy_pb2.Policy: + Defines an Identity and Access Management (IAM) policy. + It is used to specify access control policies for Cloud + Platform resources. + A ``Policy`` is a collection of ``bindings``. A + ``binding`` binds one or more ``members`` to a single + ``role``. Members can be user accounts, service + accounts, Google groups, and domains (such as G Suite). + A ``role`` is a named list of permissions (defined by + IAM or configured by users). A ``binding`` can + optionally specify a ``condition``, which is a logic + expression that further constrains the role binding + based on attributes about the request and/or target + resource. + + **JSON Example** + + :: + + { + "bindings": [ + { + "role": "roles/resourcemanager.organizationAdmin", + "members": [ + "user:mike@example.com", + "group:admins@example.com", + "domain:google.com", + "serviceAccount:my-project-id@appspot.gserviceaccount.com" + ] + }, + { + "role": "roles/resourcemanager.organizationViewer", + "members": ["user:eve@example.com"], + "condition": { + "title": "expirable access", + "description": "Does not grant access after Sep 2020", + "expression": "request.time < + timestamp('2020-10-01T00:00:00.000Z')", + } + } + ] + } + + **YAML Example** + + :: + + bindings: + - members: + - user:mike@example.com + - group:admins@example.com + - domain:google.com + - serviceAccount:my-project-id@appspot.gserviceaccount.com + role: roles/resourcemanager.organizationAdmin + - members: + - user:eve@example.com + role: roles/resourcemanager.organizationViewer + condition: + title: expirable access + description: Does not grant access after Sep 2020 + expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + + For a description of IAM and its features, see the `IAM + developer's + guide `__. + """ + # Create or coerce a protobuf request object. + + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = iam_policy_pb2.SetIamPolicyRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self.transport._wrapped_methods[self._client._transport.set_iam_policy] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def get_iam_policy( + self, + request: Optional[iam_policy_pb2.GetIamPolicyRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> policy_pb2.Policy: + r"""Gets the IAM access control policy for a function. + + Returns an empty policy if the function exists and does not have a + policy set. + + Args: + request (:class:`~.iam_policy_pb2.GetIamPolicyRequest`): + The request object. Request message for `GetIamPolicy` + method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + ~.policy_pb2.Policy: + Defines an Identity and Access Management (IAM) policy. + It is used to specify access control policies for Cloud + Platform resources. + A ``Policy`` is a collection of ``bindings``. A + ``binding`` binds one or more ``members`` to a single + ``role``. Members can be user accounts, service + accounts, Google groups, and domains (such as G Suite). + A ``role`` is a named list of permissions (defined by + IAM or configured by users). A ``binding`` can + optionally specify a ``condition``, which is a logic + expression that further constrains the role binding + based on attributes about the request and/or target + resource. + + **JSON Example** + + :: + + { + "bindings": [ + { + "role": "roles/resourcemanager.organizationAdmin", + "members": [ + "user:mike@example.com", + "group:admins@example.com", + "domain:google.com", + "serviceAccount:my-project-id@appspot.gserviceaccount.com" + ] + }, + { + "role": "roles/resourcemanager.organizationViewer", + "members": ["user:eve@example.com"], + "condition": { + "title": "expirable access", + "description": "Does not grant access after Sep 2020", + "expression": "request.time < + timestamp('2020-10-01T00:00:00.000Z')", + } + } + ] + } + + **YAML Example** + + :: + + bindings: + - members: + - user:mike@example.com + - group:admins@example.com + - domain:google.com + - serviceAccount:my-project-id@appspot.gserviceaccount.com + role: roles/resourcemanager.organizationAdmin + - members: + - user:eve@example.com + role: roles/resourcemanager.organizationViewer + condition: + title: expirable access + description: Does not grant access after Sep 2020 + expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + + For a description of IAM and its features, see the `IAM + developer's + guide `__. + """ + # Create or coerce a protobuf request object. + + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = iam_policy_pb2.GetIamPolicyRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self.transport._wrapped_methods[self._client._transport.get_iam_policy] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def test_iam_permissions( + self, + request: Optional[iam_policy_pb2.TestIamPermissionsRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> iam_policy_pb2.TestIamPermissionsResponse: + r"""Tests the specified IAM permissions against the IAM access control + policy for a function. + + If the function does not exist, this will return an empty set + of permissions, not a NOT_FOUND error. + + Args: + request (:class:`~.iam_policy_pb2.TestIamPermissionsRequest`): + The request object. Request message for + `TestIamPermissions` method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + ~.iam_policy_pb2.TestIamPermissionsResponse: + Response message for ``TestIamPermissions`` method. + """ + # Create or coerce a protobuf request object. + + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = iam_policy_pb2.TestIamPermissionsRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self.transport._wrapped_methods[ + self._client._transport.test_iam_permissions + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def get_location( + self, + request: Optional[locations_pb2.GetLocationRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> locations_pb2.Location: + r"""Gets information about a location. + + Args: + request (:class:`~.location_pb2.GetLocationRequest`): + The request object. Request message for + `GetLocation` method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + ~.location_pb2.Location: + Location object. + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = locations_pb2.GetLocationRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self.transport._wrapped_methods[self._client._transport.get_location] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def list_locations( + self, + request: Optional[locations_pb2.ListLocationsRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> locations_pb2.ListLocationsResponse: + r"""Lists information about the supported locations for this service. + + Args: + request (:class:`~.location_pb2.ListLocationsRequest`): + The request object. Request message for + `ListLocations` method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + ~.location_pb2.ListLocationsResponse: + Response message for ``ListLocations`` method. + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = locations_pb2.ListLocationsRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self.transport._wrapped_methods[self._client._transport.list_locations] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def __aenter__(self) -> "OnlineEvaluatorServiceAsyncClient": + return self + + async def __aexit__(self, exc_type, exc, tb): + await self.transport.close() + + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) + +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + + +__all__ = ("OnlineEvaluatorServiceAsyncClient",) diff --git a/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/client.py b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/client.py new file mode 100644 index 0000000000..2bbe3ff57a --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/client.py @@ -0,0 +1,2476 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from collections import OrderedDict +from http import HTTPStatus +import json +import logging as std_logging +import os +import re +from typing import ( + Dict, + Callable, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) +import warnings + +from google.cloud.aiplatform_v1beta1 import gapic_version as package_version + +from google.api_core import client_options as client_options_lib +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.auth import credentials as ga_credentials # type: ignore +from google.auth.transport import mtls # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore +from google.oauth2 import service_account # type: ignore +import google.protobuf + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object, None] # type: ignore + +try: + from google.api_core import client_logging # type: ignore + + CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER +except ImportError: # pragma: NO COVER + CLIENT_LOGGING_SUPPORTED = False + +_LOGGER = std_logging.getLogger(__name__) + +from google.cloud.aiplatform_v1beta1.services.online_evaluator_service import pagers +from google.cloud.aiplatform_v1beta1.types import evaluation_service +from google.cloud.aiplatform_v1beta1.types import online_evaluator +from google.cloud.aiplatform_v1beta1.types import ( + online_evaluator as gca_online_evaluator, +) +from google.cloud.aiplatform_v1beta1.types import online_evaluator_service +from google.cloud.location import locations_pb2 # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.longrunning import operations_pb2 # type: ignore +import google.api_core.operation as operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +from .transports.base import OnlineEvaluatorServiceTransport, DEFAULT_CLIENT_INFO +from .transports.grpc import OnlineEvaluatorServiceGrpcTransport +from .transports.grpc_asyncio import OnlineEvaluatorServiceGrpcAsyncIOTransport +from .transports.rest import OnlineEvaluatorServiceRestTransport + +try: + from .transports.rest_asyncio import AsyncOnlineEvaluatorServiceRestTransport + + HAS_ASYNC_REST_DEPENDENCIES = True +except ImportError as e: # pragma: NO COVER + HAS_ASYNC_REST_DEPENDENCIES = False + ASYNC_REST_EXCEPTION = e + + +class OnlineEvaluatorServiceClientMeta(type): + """Metaclass for the OnlineEvaluatorService client. + + This provides class-level methods for building and retrieving + support objects (e.g. transport) without polluting the client instance + objects. + """ + + _transport_registry = ( + OrderedDict() + ) # type: Dict[str, Type[OnlineEvaluatorServiceTransport]] + _transport_registry["grpc"] = OnlineEvaluatorServiceGrpcTransport + _transport_registry["grpc_asyncio"] = OnlineEvaluatorServiceGrpcAsyncIOTransport + _transport_registry["rest"] = OnlineEvaluatorServiceRestTransport + if HAS_ASYNC_REST_DEPENDENCIES: # pragma: NO COVER + _transport_registry["rest_asyncio"] = AsyncOnlineEvaluatorServiceRestTransport + + def get_transport_class( + cls, + label: Optional[str] = None, + ) -> Type[OnlineEvaluatorServiceTransport]: + """Returns an appropriate transport class. + + Args: + label: The name of the desired transport. If none is + provided, then the first transport in the registry is used. + + Returns: + The transport class to use. + """ + # If a specific transport is requested, return that one. + if ( + label == "rest_asyncio" and not HAS_ASYNC_REST_DEPENDENCIES + ): # pragma: NO COVER + raise ASYNC_REST_EXCEPTION + if label: + return cls._transport_registry[label] + + # No transport is requested; return the default (that is, the first one + # in the dictionary). + return next(iter(cls._transport_registry.values())) + + +class OnlineEvaluatorServiceClient(metaclass=OnlineEvaluatorServiceClientMeta): + """This service is used to create and manage Vertex AI + OnlineEvaluators. + """ + + @staticmethod + def _get_default_mtls_endpoint(api_endpoint): + """Converts api endpoint to mTLS endpoint. + + Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to + "*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively. + Args: + api_endpoint (Optional[str]): the api endpoint to convert. + Returns: + str: converted mTLS api endpoint. + """ + if not api_endpoint: + return api_endpoint + + mtls_endpoint_re = re.compile( + r"(?P[^.]+)(?P\.mtls)?(?P\.sandbox)?(?P\.googleapis\.com)?" + ) + + m = mtls_endpoint_re.match(api_endpoint) + name, mtls, sandbox, googledomain = m.groups() + if mtls or not googledomain: + return api_endpoint + + if sandbox: + return api_endpoint.replace( + "sandbox.googleapis.com", "mtls.sandbox.googleapis.com" + ) + + return api_endpoint.replace(".googleapis.com", ".mtls.googleapis.com") + + # Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead. + DEFAULT_ENDPOINT = "aiplatform.googleapis.com" + DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore + DEFAULT_ENDPOINT + ) + + _DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.{UNIVERSE_DOMAIN}" + _DEFAULT_UNIVERSE = "googleapis.com" + + @staticmethod + def _use_client_cert_effective(): + """Returns whether client certificate should be used for mTLS if the + google-auth version supports should_use_client_cert automatic mTLS enablement. + + Alternatively, read from the GOOGLE_API_USE_CLIENT_CERTIFICATE env var. + + Returns: + bool: whether client certificate should be used for mTLS + Raises: + ValueError: (If using a version of google-auth without should_use_client_cert and + GOOGLE_API_USE_CLIENT_CERTIFICATE is set to an unexpected value.) + """ + # check if google-auth version supports should_use_client_cert for automatic mTLS enablement + if hasattr(mtls, "should_use_client_cert"): # pragma: NO COVER + return mtls.should_use_client_cert() + else: # pragma: NO COVER + # if unsupported, fallback to reading from env var + use_client_cert_str = os.getenv( + "GOOGLE_API_USE_CLIENT_CERTIFICATE", "false" + ).lower() + if use_client_cert_str not in ("true", "false"): + raise ValueError( + "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be" + " either `true` or `false`" + ) + return use_client_cert_str == "true" + + @classmethod + def from_service_account_info(cls, info: dict, *args, **kwargs): + """Creates an instance of this client using the provided credentials + info. + + Args: + info (dict): The service account private key info. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + OnlineEvaluatorServiceClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_info(info) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + @classmethod + def from_service_account_file(cls, filename: str, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + OnlineEvaluatorServiceClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_file(filename) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + from_service_account_json = from_service_account_file + + @property + def transport(self) -> OnlineEvaluatorServiceTransport: + """Returns the transport used by the client instance. + + Returns: + OnlineEvaluatorServiceTransport: The transport used by the client + instance. + """ + return self._transport + + @staticmethod + def online_evaluator_path( + project: str, + location: str, + online_evaluator: str, + ) -> str: + """Returns a fully-qualified online_evaluator string.""" + return "projects/{project}/locations/{location}/onlineEvaluators/{online_evaluator}".format( + project=project, + location=location, + online_evaluator=online_evaluator, + ) + + @staticmethod + def parse_online_evaluator_path(path: str) -> Dict[str, str]: + """Parses a online_evaluator path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/onlineEvaluators/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def common_billing_account_path( + billing_account: str, + ) -> str: + """Returns a fully-qualified billing_account string.""" + return "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + + @staticmethod + def parse_common_billing_account_path(path: str) -> Dict[str, str]: + """Parse a billing_account path into its component segments.""" + m = re.match(r"^billingAccounts/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_folder_path( + folder: str, + ) -> str: + """Returns a fully-qualified folder string.""" + return "folders/{folder}".format( + folder=folder, + ) + + @staticmethod + def parse_common_folder_path(path: str) -> Dict[str, str]: + """Parse a folder path into its component segments.""" + m = re.match(r"^folders/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_organization_path( + organization: str, + ) -> str: + """Returns a fully-qualified organization string.""" + return "organizations/{organization}".format( + organization=organization, + ) + + @staticmethod + def parse_common_organization_path(path: str) -> Dict[str, str]: + """Parse a organization path into its component segments.""" + m = re.match(r"^organizations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_project_path( + project: str, + ) -> str: + """Returns a fully-qualified project string.""" + return "projects/{project}".format( + project=project, + ) + + @staticmethod + def parse_common_project_path(path: str) -> Dict[str, str]: + """Parse a project path into its component segments.""" + m = re.match(r"^projects/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_location_path( + project: str, + location: str, + ) -> str: + """Returns a fully-qualified location string.""" + return "projects/{project}/locations/{location}".format( + project=project, + location=location, + ) + + @staticmethod + def parse_common_location_path(path: str) -> Dict[str, str]: + """Parse a location path into its component segments.""" + m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @classmethod + def get_mtls_endpoint_and_cert_source( + cls, client_options: Optional[client_options_lib.ClientOptions] = None + ): + """Deprecated. Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variable is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + + warnings.warn( + "get_mtls_endpoint_and_cert_source is deprecated. Use the api_endpoint property instead.", + DeprecationWarning, + ) + if client_options is None: + client_options = client_options_lib.ClientOptions() + use_client_cert = OnlineEvaluatorServiceClient._use_client_cert_effective() + use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") + if use_mtls_endpoint not in ("auto", "never", "always"): + raise MutualTLSChannelError( + "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + # Figure out the client cert source to use. + client_cert_source = None + if use_client_cert: + if client_options.client_cert_source: + client_cert_source = client_options.client_cert_source + elif mtls.has_default_client_cert_source(): + client_cert_source = mtls.default_client_cert_source() + + # Figure out which api endpoint to use. + if client_options.api_endpoint is not None: + api_endpoint = client_options.api_endpoint + elif use_mtls_endpoint == "always" or ( + use_mtls_endpoint == "auto" and client_cert_source + ): + api_endpoint = cls.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = cls.DEFAULT_ENDPOINT + + return api_endpoint, client_cert_source + + @staticmethod + def _read_environment_variables(): + """Returns the environment variables used by the client. + + Returns: + Tuple[bool, str, str]: returns the GOOGLE_API_USE_CLIENT_CERTIFICATE, + GOOGLE_API_USE_MTLS_ENDPOINT, and GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variables. + + Raises: + ValueError: If GOOGLE_API_USE_CLIENT_CERTIFICATE is not + any of ["true", "false"]. + google.auth.exceptions.MutualTLSChannelError: If GOOGLE_API_USE_MTLS_ENDPOINT + is not any of ["auto", "never", "always"]. + """ + use_client_cert = OnlineEvaluatorServiceClient._use_client_cert_effective() + use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto").lower() + universe_domain_env = os.getenv("GOOGLE_CLOUD_UNIVERSE_DOMAIN") + if use_mtls_endpoint not in ("auto", "never", "always"): + raise MutualTLSChannelError( + "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + return use_client_cert, use_mtls_endpoint, universe_domain_env + + @staticmethod + def _get_client_cert_source(provided_cert_source, use_cert_flag): + """Return the client cert source to be used by the client. + + Args: + provided_cert_source (bytes): The client certificate source provided. + use_cert_flag (bool): A flag indicating whether to use the client certificate. + + Returns: + bytes or None: The client cert source to be used by the client. + """ + client_cert_source = None + if use_cert_flag: + if provided_cert_source: + client_cert_source = provided_cert_source + elif mtls.has_default_client_cert_source(): + client_cert_source = mtls.default_client_cert_source() + return client_cert_source + + @staticmethod + def _get_api_endpoint( + api_override, client_cert_source, universe_domain, use_mtls_endpoint + ): + """Return the API endpoint used by the client. + + Args: + api_override (str): The API endpoint override. If specified, this is always + the return value of this function and the other arguments are not used. + client_cert_source (bytes): The client certificate source used by the client. + universe_domain (str): The universe domain used by the client. + use_mtls_endpoint (str): How to use the mTLS endpoint, which depends also on the other parameters. + Possible values are "always", "auto", or "never". + + Returns: + str: The API endpoint to be used by the client. + """ + if api_override is not None: + api_endpoint = api_override + elif use_mtls_endpoint == "always" or ( + use_mtls_endpoint == "auto" and client_cert_source + ): + _default_universe = OnlineEvaluatorServiceClient._DEFAULT_UNIVERSE + if universe_domain != _default_universe: + raise MutualTLSChannelError( + f"mTLS is not supported in any universe other than {_default_universe}." + ) + api_endpoint = OnlineEvaluatorServiceClient.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = ( + OnlineEvaluatorServiceClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=universe_domain + ) + ) + return api_endpoint + + @staticmethod + def _get_universe_domain( + client_universe_domain: Optional[str], universe_domain_env: Optional[str] + ) -> str: + """Return the universe domain used by the client. + + Args: + client_universe_domain (Optional[str]): The universe domain configured via the client options. + universe_domain_env (Optional[str]): The universe domain configured via the "GOOGLE_CLOUD_UNIVERSE_DOMAIN" environment variable. + + Returns: + str: The universe domain to be used by the client. + + Raises: + ValueError: If the universe domain is an empty string. + """ + universe_domain = OnlineEvaluatorServiceClient._DEFAULT_UNIVERSE + if client_universe_domain is not None: + universe_domain = client_universe_domain + elif universe_domain_env is not None: + universe_domain = universe_domain_env + if len(universe_domain.strip()) == 0: + raise ValueError("Universe Domain cannot be an empty string.") + return universe_domain + + def _validate_universe_domain(self): + """Validates client's and credentials' universe domains are consistent. + + Returns: + bool: True iff the configured universe domain is valid. + + Raises: + ValueError: If the configured universe domain is not valid. + """ + + # NOTE (b/349488459): universe validation is disabled until further notice. + return True + + def _add_cred_info_for_auth_errors( + self, error: core_exceptions.GoogleAPICallError + ) -> None: + """Adds credential info string to error details for 401/403/404 errors. + + Args: + error (google.api_core.exceptions.GoogleAPICallError): The error to add the cred info. + """ + if error.code not in [ + HTTPStatus.UNAUTHORIZED, + HTTPStatus.FORBIDDEN, + HTTPStatus.NOT_FOUND, + ]: + return + + cred = self._transport._credentials + + # get_cred_info is only available in google-auth>=2.35.0 + if not hasattr(cred, "get_cred_info"): + return + + # ignore the type check since pypy test fails when get_cred_info + # is not available + cred_info = cred.get_cred_info() # type: ignore + if cred_info and hasattr(error._details, "append"): + error._details.append(json.dumps(cred_info)) + + @property + def api_endpoint(self): + """Return the API endpoint used by the client instance. + + Returns: + str: The API endpoint used by the client instance. + """ + return self._api_endpoint + + @property + def universe_domain(self) -> str: + """Return the universe domain used by the client instance. + + Returns: + str: The universe domain used by the client instance. + """ + return self._universe_domain + + def __init__( + self, + *, + credentials: Optional[ga_credentials.Credentials] = None, + transport: Optional[ + Union[ + str, + OnlineEvaluatorServiceTransport, + Callable[..., OnlineEvaluatorServiceTransport], + ] + ] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + ) -> None: + """Instantiates the online evaluator service client. + + Args: + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + transport (Optional[Union[str,OnlineEvaluatorServiceTransport,Callable[..., OnlineEvaluatorServiceTransport]]]): + The transport to use, or a Callable that constructs and returns a new transport. + If a Callable is given, it will be called with the same set of initialization + arguments as used in the OnlineEvaluatorServiceTransport constructor. + If set to None, a transport is chosen automatically. + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): + Custom options for the client. + + 1. The ``api_endpoint`` property can be used to override the + default endpoint provided by the client when ``transport`` is + not explicitly provided. Only if this property is not set and + ``transport`` was not explicitly provided, the endpoint is + determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment + variable, which have one of the following values: + "always" (always use the default mTLS endpoint), "never" (always + use the default regular endpoint) and "auto" (auto-switch to the + default mTLS endpoint if client certificate is present; this is + the default value). + + 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable + is "true", then the ``client_cert_source`` property can be used + to provide a client certificate for mTLS transport. If + not provided, the default SSL client certificate will be used if + present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not + set, no client certificate will be used. + + 3. The ``universe_domain`` property can be used to override the + default "googleapis.com" universe. Note that the ``api_endpoint`` + property still takes precedence; and ``universe_domain`` is + currently not supported for mTLS. + + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport + creation failed for any reason. + """ + self._client_options = client_options + if isinstance(self._client_options, dict): + self._client_options = client_options_lib.from_dict(self._client_options) + if self._client_options is None: + self._client_options = client_options_lib.ClientOptions() + self._client_options = cast( + client_options_lib.ClientOptions, self._client_options + ) + + universe_domain_opt = getattr(self._client_options, "universe_domain", None) + + self._use_client_cert, self._use_mtls_endpoint, self._universe_domain_env = ( + OnlineEvaluatorServiceClient._read_environment_variables() + ) + self._client_cert_source = OnlineEvaluatorServiceClient._get_client_cert_source( + self._client_options.client_cert_source, self._use_client_cert + ) + self._universe_domain = OnlineEvaluatorServiceClient._get_universe_domain( + universe_domain_opt, self._universe_domain_env + ) + self._api_endpoint = None # updated below, depending on `transport` + + # Initialize the universe domain validation. + self._is_universe_domain_valid = False + + if CLIENT_LOGGING_SUPPORTED: # pragma: NO COVER + # Setup logging. + client_logging.initialize_logging() + + api_key_value = getattr(self._client_options, "api_key", None) + if api_key_value and credentials: + raise ValueError( + "client_options.api_key and credentials are mutually exclusive" + ) + + # Save or instantiate the transport. + # Ordinarily, we provide the transport, but allowing a custom transport + # instance provides an extensibility point for unusual situations. + transport_provided = isinstance(transport, OnlineEvaluatorServiceTransport) + if transport_provided: + # transport is a OnlineEvaluatorServiceTransport instance. + if credentials or self._client_options.credentials_file or api_key_value: + raise ValueError( + "When providing a transport instance, " + "provide its credentials directly." + ) + if self._client_options.scopes: + raise ValueError( + "When providing a transport instance, provide its scopes " + "directly." + ) + self._transport = cast(OnlineEvaluatorServiceTransport, transport) + self._api_endpoint = self._transport.host + + self._api_endpoint = ( + self._api_endpoint + or OnlineEvaluatorServiceClient._get_api_endpoint( + self._client_options.api_endpoint, + self._client_cert_source, + self._universe_domain, + self._use_mtls_endpoint, + ) + ) + + if not transport_provided: + transport_init: Union[ + Type[OnlineEvaluatorServiceTransport], + Callable[..., OnlineEvaluatorServiceTransport], + ] = ( + OnlineEvaluatorServiceClient.get_transport_class(transport) + if isinstance(transport, str) or transport is None + else cast(Callable[..., OnlineEvaluatorServiceTransport], transport) + ) + + if "rest_asyncio" in str(transport_init): + unsupported_params = { + "google.api_core.client_options.ClientOptions.credentials_file": self._client_options.credentials_file, + "google.api_core.client_options.ClientOptions.scopes": self._client_options.scopes, + "google.api_core.client_options.ClientOptions.quota_project_id": self._client_options.quota_project_id, + "google.api_core.client_options.ClientOptions.client_cert_source": self._client_options.client_cert_source, + "google.api_core.client_options.ClientOptions.api_audience": self._client_options.api_audience, + } + provided_unsupported_params = [ + name + for name, value in unsupported_params.items() + if value is not None + ] + if provided_unsupported_params: + raise core_exceptions.AsyncRestUnsupportedParameterError( # type: ignore + f"The following provided parameters are not supported for `transport=rest_asyncio`: {', '.join(provided_unsupported_params)}" + ) + self._transport = transport_init( + credentials=credentials, + host=self._api_endpoint, + client_info=client_info, + ) + return + + import google.auth._default # type: ignore + + if api_key_value and hasattr( + google.auth._default, "get_api_key_credentials" + ): + credentials = google.auth._default.get_api_key_credentials( + api_key_value + ) + + # initialize with the provided callable or the passed in class + self._transport = transport_init( + credentials=credentials, + credentials_file=self._client_options.credentials_file, + host=self._api_endpoint, + scopes=self._client_options.scopes, + client_cert_source_for_mtls=self._client_cert_source, + quota_project_id=self._client_options.quota_project_id, + client_info=client_info, + always_use_jwt_access=True, + api_audience=self._client_options.api_audience, + ) + + if "async" not in str(self._transport): + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + std_logging.DEBUG + ): # pragma: NO COVER + _LOGGER.debug( + "Created client `google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient`.", + extra=( + { + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "universeDomain": getattr( + self._transport._credentials, "universe_domain", "" + ), + "credentialsType": f"{type(self._transport._credentials).__module__}.{type(self._transport._credentials).__qualname__}", + "credentialsInfo": getattr( + self.transport._credentials, + "get_cred_info", + lambda: None, + )(), + } + if hasattr(self._transport, "_credentials") + else { + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "credentialsType": None, + } + ), + ) + + def create_online_evaluator( + self, + request: Optional[ + Union[online_evaluator_service.CreateOnlineEvaluatorRequest, dict] + ] = None, + *, + parent: Optional[str] = None, + online_evaluator: Optional[gca_online_evaluator.OnlineEvaluator] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation.Operation: + r"""Creates an OnlineEvaluator in the given project and + location. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + def sample_create_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceClient() + + # Initialize request argument(s) + online_evaluator = aiplatform_v1beta1.OnlineEvaluator() + online_evaluator.cloud_observability.open_telemetry.semconv_version = "semconv_version_value" + online_evaluator.agent_resource = "agent_resource_value" + online_evaluator.metric_sources.metric.predefined_metric_spec.metric_spec_name = "metric_spec_name_value" + online_evaluator.config.random_sampling.percentage = 1054 + + request = aiplatform_v1beta1.CreateOnlineEvaluatorRequest( + parent="parent_value", + online_evaluator=online_evaluator, + ) + + # Make the request + operation = client.create_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.CreateOnlineEvaluatorRequest, dict]): + The request object. Request message for + CreateOnlineEvaluator. + parent (str): + Required. The parent resource where + the OnlineEvaluator will be created. + Format: + projects/{project}/locations/{location}. + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + online_evaluator (google.cloud.aiplatform_v1beta1.types.OnlineEvaluator): + Required. The OnlineEvaluator to + create. + + This corresponds to the ``online_evaluator`` 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, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.cloud.aiplatform_v1beta1.types.OnlineEvaluator` + An OnlineEvaluator contains the configuration for an + Online Evaluation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [parent, online_evaluator] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, online_evaluator_service.CreateOnlineEvaluatorRequest + ): + request = online_evaluator_service.CreateOnlineEvaluatorRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + if online_evaluator is not None: + request.online_evaluator = online_evaluator + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.create_online_evaluator] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + gca_online_evaluator.OnlineEvaluator, + metadata_type=online_evaluator_service.CreateOnlineEvaluatorOperationMetadata, + ) + + # Done; return the response. + return response + + def get_online_evaluator( + self, + request: Optional[ + Union[online_evaluator_service.GetOnlineEvaluatorRequest, dict] + ] = None, + *, + name: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> online_evaluator.OnlineEvaluator: + r"""Gets details of an OnlineEvaluator. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + def sample_get_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.GetOnlineEvaluatorRequest( + name="name_value", + ) + + # Make the request + response = client.get_online_evaluator(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.GetOnlineEvaluatorRequest, dict]): + The request object. Request message for + GetOnlineEvaluator. + name (str): + Required. The name of the + OnlineEvaluator to retrieve. Format: + projects/{project}/locations/{location}/onlineEvaluators/{id}. + + 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, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.aiplatform_v1beta1.types.OnlineEvaluator: + An OnlineEvaluator contains the + configuration for an Online Evaluation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [name] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, online_evaluator_service.GetOnlineEvaluatorRequest): + request = online_evaluator_service.GetOnlineEvaluatorRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get_online_evaluator] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def update_online_evaluator( + self, + request: Optional[ + Union[online_evaluator_service.UpdateOnlineEvaluatorRequest, dict] + ] = None, + *, + online_evaluator: Optional[gca_online_evaluator.OnlineEvaluator] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation.Operation: + r"""Updates the fields of an OnlineEvaluator. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + def sample_update_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceClient() + + # Initialize request argument(s) + online_evaluator = aiplatform_v1beta1.OnlineEvaluator() + online_evaluator.cloud_observability.open_telemetry.semconv_version = "semconv_version_value" + online_evaluator.agent_resource = "agent_resource_value" + online_evaluator.metric_sources.metric.predefined_metric_spec.metric_spec_name = "metric_spec_name_value" + online_evaluator.config.random_sampling.percentage = 1054 + + request = aiplatform_v1beta1.UpdateOnlineEvaluatorRequest( + online_evaluator=online_evaluator, + ) + + # Make the request + operation = client.update_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.UpdateOnlineEvaluatorRequest, dict]): + The request object. Request message for + UpdateOnlineEvaluator. + online_evaluator (google.cloud.aiplatform_v1beta1.types.OnlineEvaluator): + Required. The OnlineEvaluator to + update. Format: + projects/{project}/locations/{location}/onlineEvaluators/{id}. + + This corresponds to the ``online_evaluator`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + update_mask (google.protobuf.field_mask_pb2.FieldMask): + Optional. Field mask is used to + control which fields get updated. If the + mask is not present, all fields will be + updated. + + 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, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.cloud.aiplatform_v1beta1.types.OnlineEvaluator` + An OnlineEvaluator contains the configuration for an + Online Evaluation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [online_evaluator, update_mask] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, online_evaluator_service.UpdateOnlineEvaluatorRequest + ): + request = online_evaluator_service.UpdateOnlineEvaluatorRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if online_evaluator is not None: + request.online_evaluator = online_evaluator + if update_mask is not None: + request.update_mask = update_mask + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.update_online_evaluator] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + (("online_evaluator.name", request.online_evaluator.name),) + ), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + gca_online_evaluator.OnlineEvaluator, + metadata_type=online_evaluator_service.UpdateOnlineEvaluatorOperationMetadata, + ) + + # Done; return the response. + return response + + def delete_online_evaluator( + self, + request: Optional[ + Union[online_evaluator_service.DeleteOnlineEvaluatorRequest, dict] + ] = None, + *, + name: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation.Operation: + r"""Deletes an OnlineEvaluator. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + def sample_delete_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.DeleteOnlineEvaluatorRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.DeleteOnlineEvaluatorRequest, dict]): + The request object. Request message for + DeleteOnlineEvaluator. + name (str): + Required. The name of the + OnlineEvaluator to delete. Format: + projects/{project}/locations/{location}/onlineEvaluators/{id}. + + 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, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to + use it as the request or the response type of an API + method. For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); + + } + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [name] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, online_evaluator_service.DeleteOnlineEvaluatorRequest + ): + request = online_evaluator_service.DeleteOnlineEvaluatorRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.delete_online_evaluator] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + empty_pb2.Empty, + metadata_type=online_evaluator_service.DeleteOnlineEvaluatorOperationMetadata, + ) + + # Done; return the response. + return response + + def list_online_evaluators( + self, + request: Optional[ + Union[online_evaluator_service.ListOnlineEvaluatorsRequest, dict] + ] = None, + *, + parent: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> pagers.ListOnlineEvaluatorsPager: + r"""Lists the OnlineEvaluators for the given project and + location. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + def sample_list_online_evaluators(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.ListOnlineEvaluatorsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_online_evaluators(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.ListOnlineEvaluatorsRequest, dict]): + The request object. Request message for + ListOnlineEvaluators. + parent (str): + Required. The parent resource of the + OnlineEvaluators to list. Format: + projects/{project}/locations/{location}. + + 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, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.aiplatform_v1beta1.services.online_evaluator_service.pagers.ListOnlineEvaluatorsPager: + Response message for + ListOnlineEvaluators. + Iterating over this object will yield + results and resolve additional pages + automatically. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [parent] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, online_evaluator_service.ListOnlineEvaluatorsRequest + ): + request = online_evaluator_service.ListOnlineEvaluatorsRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.list_online_evaluators] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # This method is paged; wrap the response in a pager, which provides + # an `__iter__` convenience method. + response = pagers.ListOnlineEvaluatorsPager( + method=rpc, + request=request, + response=response, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def activate_online_evaluator( + self, + request: Optional[ + Union[online_evaluator_service.ActivateOnlineEvaluatorRequest, dict] + ] = None, + *, + name: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation.Operation: + r"""Activates an OnlineEvaluator. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + def sample_activate_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.ActivateOnlineEvaluatorRequest( + name="name_value", + ) + + # Make the request + operation = client.activate_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.ActivateOnlineEvaluatorRequest, dict]): + The request object. Request message for + ActivateOnlineEvaluator. + name (str): + Required. The name of the + OnlineEvaluator to activate. Format: + projects/{project}/locations/{location}/onlineEvaluators/{id}. + + 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, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.cloud.aiplatform_v1beta1.types.OnlineEvaluator` + An OnlineEvaluator contains the configuration for an + Online Evaluation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [name] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, online_evaluator_service.ActivateOnlineEvaluatorRequest + ): + request = online_evaluator_service.ActivateOnlineEvaluatorRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.activate_online_evaluator + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + online_evaluator.OnlineEvaluator, + metadata_type=online_evaluator_service.ActivateOnlineEvaluatorOperationMetadata, + ) + + # Done; return the response. + return response + + def suspend_online_evaluator( + self, + request: Optional[ + Union[online_evaluator_service.SuspendOnlineEvaluatorRequest, dict] + ] = None, + *, + name: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation.Operation: + r"""Suspends an OnlineEvaluator. When an OnlineEvaluator + is suspended, it won't run any evaluations until it is + activated again. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + def sample_suspend_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.SuspendOnlineEvaluatorRequest( + name="name_value", + ) + + # Make the request + operation = client.suspend_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.SuspendOnlineEvaluatorRequest, dict]): + The request object. Request message for + SuspendOnlineEvaluator. + name (str): + Required. The name of the + OnlineEvaluator to suspend. Format: + projects/{project}/locations/{location}/onlineEvaluators/{id}. + + 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, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.cloud.aiplatform_v1beta1.types.OnlineEvaluator` + An OnlineEvaluator contains the configuration for an + Online Evaluation. + + """ + # Create or coerce a protobuf request object. + # - Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + flattened_params = [name] + has_flattened_params = ( + len([param for param in flattened_params if param is not None]) > 0 + ) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, online_evaluator_service.SuspendOnlineEvaluatorRequest + ): + request = online_evaluator_service.SuspendOnlineEvaluatorRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.suspend_online_evaluator] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + online_evaluator.OnlineEvaluator, + metadata_type=online_evaluator_service.SuspendOnlineEvaluatorOperationMetadata, + ) + + # Done; return the response. + return response + + def __enter__(self) -> "OnlineEvaluatorServiceClient": + return self + + def __exit__(self, type, value, traceback): + """Releases underlying transport's resources. + + .. warning:: + ONLY use as a context manager if the transport is NOT shared + with other clients! Exiting the with block will CLOSE the transport + and may cause errors in other clients! + """ + self.transport.close() + + def list_operations( + self, + request: Optional[operations_pb2.ListOperationsRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.ListOperationsResponse: + r"""Lists operations that match the specified filter in the request. + + Args: + request (:class:`~.operations_pb2.ListOperationsRequest`): + The request object. Request message for + `ListOperations` method. + retry (google.api_core.retry.Retry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + ~.operations_pb2.ListOperationsResponse: + Response message for ``ListOperations`` method. + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = operations_pb2.ListOperationsRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.list_operations] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + try: + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + except core_exceptions.GoogleAPICallError as e: + self._add_cred_info_for_auth_errors(e) + raise e + + def get_operation( + self, + request: Optional[operations_pb2.GetOperationRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Gets the latest state of a long-running operation. + + Args: + request (:class:`~.operations_pb2.GetOperationRequest`): + The request object. Request message for + `GetOperation` method. + retry (google.api_core.retry.Retry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + ~.operations_pb2.Operation: + An ``Operation`` object. + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = operations_pb2.GetOperationRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get_operation] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + try: + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + except core_exceptions.GoogleAPICallError as e: + self._add_cred_info_for_auth_errors(e) + raise e + + def delete_operation( + self, + request: Optional[operations_pb2.DeleteOperationRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> None: + r"""Deletes a long-running operation. + + This method indicates that the client is no longer interested + in the operation result. It does not cancel the operation. + If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. + + Args: + request (:class:`~.operations_pb2.DeleteOperationRequest`): + The request object. Request message for + `DeleteOperation` method. + retry (google.api_core.retry.Retry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + None + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = operations_pb2.DeleteOperationRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.delete_operation] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + def cancel_operation( + self, + request: Optional[operations_pb2.CancelOperationRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> None: + r"""Starts asynchronous cancellation on a long-running operation. + + The server makes a best effort to cancel the operation, but success + is not guaranteed. If the server doesn't support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. + + Args: + request (:class:`~.operations_pb2.CancelOperationRequest`): + The request object. Request message for + `CancelOperation` method. + retry (google.api_core.retry.Retry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + None + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = operations_pb2.CancelOperationRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.cancel_operation] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + def wait_operation( + self, + request: Optional[operations_pb2.WaitOperationRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Waits until the specified long-running operation is done or reaches at most + a specified timeout, returning the latest state. + + If the operation is already done, the latest state is immediately returned. + If the timeout specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + timeout is used. If the server does not support this method, it returns + `google.rpc.Code.UNIMPLEMENTED`. + + Args: + request (:class:`~.operations_pb2.WaitOperationRequest`): + The request object. Request message for + `WaitOperation` method. + retry (google.api_core.retry.Retry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + ~.operations_pb2.Operation: + An ``Operation`` object. + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = operations_pb2.WaitOperationRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.wait_operation] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + try: + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + except core_exceptions.GoogleAPICallError as e: + self._add_cred_info_for_auth_errors(e) + raise e + + def set_iam_policy( + self, + request: Optional[iam_policy_pb2.SetIamPolicyRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> policy_pb2.Policy: + r"""Sets the IAM access control policy on the specified function. + + Replaces any existing policy. + + Args: + 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, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + ~.policy_pb2.Policy: + Defines an Identity and Access Management (IAM) policy. + It is used to specify access control policies for Cloud + Platform resources. + A ``Policy`` is a collection of ``bindings``. A + ``binding`` binds one or more ``members`` to a single + ``role``. Members can be user accounts, service + accounts, Google groups, and domains (such as G Suite). + A ``role`` is a named list of permissions (defined by + IAM or configured by users). A ``binding`` can + optionally specify a ``condition``, which is a logic + expression that further constrains the role binding + based on attributes about the request and/or target + resource. + + **JSON Example** + + :: + + { + "bindings": [ + { + "role": "roles/resourcemanager.organizationAdmin", + "members": [ + "user:mike@example.com", + "group:admins@example.com", + "domain:google.com", + "serviceAccount:my-project-id@appspot.gserviceaccount.com" + ] + }, + { + "role": "roles/resourcemanager.organizationViewer", + "members": ["user:eve@example.com"], + "condition": { + "title": "expirable access", + "description": "Does not grant access after Sep 2020", + "expression": "request.time < + timestamp('2020-10-01T00:00:00.000Z')", + } + } + ] + } + + **YAML Example** + + :: + + bindings: + - members: + - user:mike@example.com + - group:admins@example.com + - domain:google.com + - serviceAccount:my-project-id@appspot.gserviceaccount.com + role: roles/resourcemanager.organizationAdmin + - members: + - user:eve@example.com + role: roles/resourcemanager.organizationViewer + condition: + title: expirable access + description: Does not grant access after Sep 2020 + expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + + For a description of IAM and its features, see the `IAM + developer's + guide `__. + """ + # Create or coerce a protobuf request object. + + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = iam_policy_pb2.SetIamPolicyRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.set_iam_policy] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + try: + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + except core_exceptions.GoogleAPICallError as e: + self._add_cred_info_for_auth_errors(e) + raise e + + def get_iam_policy( + self, + request: Optional[iam_policy_pb2.GetIamPolicyRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> policy_pb2.Policy: + r"""Gets the IAM access control policy for a function. + + Returns an empty policy if the function exists and does not have a + policy set. + + Args: + 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 + any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + ~.policy_pb2.Policy: + Defines an Identity and Access Management (IAM) policy. + It is used to specify access control policies for Cloud + Platform resources. + A ``Policy`` is a collection of ``bindings``. A + ``binding`` binds one or more ``members`` to a single + ``role``. Members can be user accounts, service + accounts, Google groups, and domains (such as G Suite). + A ``role`` is a named list of permissions (defined by + IAM or configured by users). A ``binding`` can + optionally specify a ``condition``, which is a logic + expression that further constrains the role binding + based on attributes about the request and/or target + resource. + + **JSON Example** + + :: + + { + "bindings": [ + { + "role": "roles/resourcemanager.organizationAdmin", + "members": [ + "user:mike@example.com", + "group:admins@example.com", + "domain:google.com", + "serviceAccount:my-project-id@appspot.gserviceaccount.com" + ] + }, + { + "role": "roles/resourcemanager.organizationViewer", + "members": ["user:eve@example.com"], + "condition": { + "title": "expirable access", + "description": "Does not grant access after Sep 2020", + "expression": "request.time < + timestamp('2020-10-01T00:00:00.000Z')", + } + } + ] + } + + **YAML Example** + + :: + + bindings: + - members: + - user:mike@example.com + - group:admins@example.com + - domain:google.com + - serviceAccount:my-project-id@appspot.gserviceaccount.com + role: roles/resourcemanager.organizationAdmin + - members: + - user:eve@example.com + role: roles/resourcemanager.organizationViewer + condition: + title: expirable access + description: Does not grant access after Sep 2020 + expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + + For a description of IAM and its features, see the `IAM + developer's + guide `__. + """ + # Create or coerce a protobuf request object. + + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = iam_policy_pb2.GetIamPolicyRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get_iam_policy] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + try: + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + except core_exceptions.GoogleAPICallError as e: + self._add_cred_info_for_auth_errors(e) + raise e + + def test_iam_permissions( + self, + request: Optional[iam_policy_pb2.TestIamPermissionsRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> iam_policy_pb2.TestIamPermissionsResponse: + r"""Tests the specified IAM permissions against the IAM access control + policy for a function. + + If the function does not exist, this will return an empty set + of permissions, not a NOT_FOUND error. + + Args: + request (:class:`~.iam_policy_pb2.TestIamPermissionsRequest`): + The request object. Request message for + `TestIamPermissions` method. + retry (google.api_core.retry.Retry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + ~.iam_policy_pb2.TestIamPermissionsResponse: + Response message for ``TestIamPermissions`` method. + """ + # Create or coerce a protobuf request object. + + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = iam_policy_pb2.TestIamPermissionsRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.test_iam_permissions] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + try: + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + except core_exceptions.GoogleAPICallError as e: + self._add_cred_info_for_auth_errors(e) + raise e + + def get_location( + self, + request: Optional[locations_pb2.GetLocationRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> locations_pb2.Location: + r"""Gets information about a location. + + Args: + request (:class:`~.location_pb2.GetLocationRequest`): + The request object. Request message for + `GetLocation` method. + retry (google.api_core.retry.Retry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + ~.location_pb2.Location: + Location object. + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = locations_pb2.GetLocationRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get_location] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + try: + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + except core_exceptions.GoogleAPICallError as e: + self._add_cred_info_for_auth_errors(e) + raise e + + def list_locations( + self, + request: Optional[locations_pb2.ListLocationsRequest] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> locations_pb2.ListLocationsResponse: + r"""Lists information about the supported locations for this service. + + Args: + request (:class:`~.location_pb2.ListLocationsRequest`): + The request object. Request message for + `ListLocations` method. + retry (google.api_core.retry.Retry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + Returns: + ~.location_pb2.ListLocationsResponse: + Response message for ``ListLocations`` method. + """ + # Create or coerce a protobuf request object. + # The request isn't a proto-plus wrapped type, + # so it must be constructed via keyword expansion. + if isinstance(request, dict): + request = locations_pb2.ListLocationsRequest(**request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.list_locations] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + try: + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + except core_exceptions.GoogleAPICallError as e: + self._add_cred_info_for_auth_errors(e) + raise e + + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) + +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + +__all__ = ("OnlineEvaluatorServiceClient",) diff --git a/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/pagers.py b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/pagers.py new file mode 100644 index 0000000000..5bd1e89575 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/pagers.py @@ -0,0 +1,201 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.api_core import retry_async as retries_async +from typing import ( + Any, + AsyncIterator, + Awaitable, + Callable, + Sequence, + Tuple, + Optional, + Iterator, + Union, +) + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] + OptionalAsyncRetry = Union[ + retries_async.AsyncRetry, gapic_v1.method._MethodDefault, None + ] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object, None] # type: ignore + OptionalAsyncRetry = Union[retries_async.AsyncRetry, object, None] # type: ignore + +from google.cloud.aiplatform_v1beta1.types import online_evaluator +from google.cloud.aiplatform_v1beta1.types import online_evaluator_service + + +class ListOnlineEvaluatorsPager: + """A pager for iterating through ``list_online_evaluators`` requests. + + This class thinly wraps an initial + :class:`google.cloud.aiplatform_v1beta1.types.ListOnlineEvaluatorsResponse` object, and + provides an ``__iter__`` method to iterate through its + ``online_evaluators`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``ListOnlineEvaluators`` requests and continue to iterate + through the ``online_evaluators`` field on the + corresponding responses. + + All the usual :class:`google.cloud.aiplatform_v1beta1.types.ListOnlineEvaluatorsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + + def __init__( + self, + method: Callable[..., online_evaluator_service.ListOnlineEvaluatorsResponse], + request: online_evaluator_service.ListOnlineEvaluatorsRequest, + response: online_evaluator_service.ListOnlineEvaluatorsResponse, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = () + ): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.aiplatform_v1beta1.types.ListOnlineEvaluatorsRequest): + The initial request object. + response (google.cloud.aiplatform_v1beta1.types.ListOnlineEvaluatorsResponse): + The initial response object. + retry (google.api_core.retry.Retry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + """ + self._method = method + self._request = online_evaluator_service.ListOnlineEvaluatorsRequest(request) + self._response = response + self._retry = retry + self._timeout = timeout + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages(self) -> Iterator[online_evaluator_service.ListOnlineEvaluatorsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method( + self._request, + retry=self._retry, + timeout=self._timeout, + metadata=self._metadata, + ) + yield self._response + + def __iter__(self) -> Iterator[online_evaluator.OnlineEvaluator]: + for page in self.pages: + yield from page.online_evaluators + + def __repr__(self) -> str: + return "{0}<{1!r}>".format(self.__class__.__name__, self._response) + + +class ListOnlineEvaluatorsAsyncPager: + """A pager for iterating through ``list_online_evaluators`` requests. + + This class thinly wraps an initial + :class:`google.cloud.aiplatform_v1beta1.types.ListOnlineEvaluatorsResponse` object, and + provides an ``__aiter__`` method to iterate through its + ``online_evaluators`` field. + + If there are more pages, the ``__aiter__`` method will make additional + ``ListOnlineEvaluators`` requests and continue to iterate + through the ``online_evaluators`` field on the + corresponding responses. + + All the usual :class:`google.cloud.aiplatform_v1beta1.types.ListOnlineEvaluatorsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + + def __init__( + self, + method: Callable[ + ..., Awaitable[online_evaluator_service.ListOnlineEvaluatorsResponse] + ], + request: online_evaluator_service.ListOnlineEvaluatorsRequest, + response: online_evaluator_service.ListOnlineEvaluatorsResponse, + *, + retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = () + ): + """Instantiates the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.aiplatform_v1beta1.types.ListOnlineEvaluatorsRequest): + The initial request object. + response (google.cloud.aiplatform_v1beta1.types.ListOnlineEvaluatorsResponse): + The initial response object. + retry (google.api_core.retry.AsyncRetry): Designation of what errors, + if any, should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + """ + self._method = method + self._request = online_evaluator_service.ListOnlineEvaluatorsRequest(request) + self._response = response + self._retry = retry + self._timeout = timeout + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + async def pages( + self, + ) -> AsyncIterator[online_evaluator_service.ListOnlineEvaluatorsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = await self._method( + self._request, + retry=self._retry, + timeout=self._timeout, + metadata=self._metadata, + ) + yield self._response + + def __aiter__(self) -> AsyncIterator[online_evaluator.OnlineEvaluator]: + async def async_generator(): + async for page in self.pages: + for response in page.online_evaluators: + yield response + + return async_generator() + + def __repr__(self) -> str: + return "{0}<{1!r}>".format(self.__class__.__name__, self._response) diff --git a/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/README.rst b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/README.rst new file mode 100644 index 0000000000..79bc29b005 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/README.rst @@ -0,0 +1,9 @@ + +transport inheritance structure +_______________________________ + +`OnlineEvaluatorServiceTransport` is the ABC for all transports. +- public child `OnlineEvaluatorServiceGrpcTransport` for sync gRPC transport (defined in `grpc.py`). +- public child `OnlineEvaluatorServiceGrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). +- private child `_BaseOnlineEvaluatorServiceRestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). +- public child `OnlineEvaluatorServiceRestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`). diff --git a/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/__init__.py b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/__init__.py new file mode 100644 index 0000000000..0be78bcedc --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/__init__.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from collections import OrderedDict +from typing import Dict, Type, Tuple + +from .base import OnlineEvaluatorServiceTransport +from .grpc import OnlineEvaluatorServiceGrpcTransport +from .grpc_asyncio import OnlineEvaluatorServiceGrpcAsyncIOTransport +from .rest import OnlineEvaluatorServiceRestTransport +from .rest import OnlineEvaluatorServiceRestInterceptor + +ASYNC_REST_CLASSES: Tuple[str, ...] +try: + from .rest_asyncio import AsyncOnlineEvaluatorServiceRestTransport + from .rest_asyncio import AsyncOnlineEvaluatorServiceRestInterceptor + + ASYNC_REST_CLASSES = ( + "AsyncOnlineEvaluatorServiceRestTransport", + "AsyncOnlineEvaluatorServiceRestInterceptor", + ) + HAS_REST_ASYNC = True +except ImportError: # pragma: NO COVER + ASYNC_REST_CLASSES = () + HAS_REST_ASYNC = False + + +# Compile a registry of transports. +_transport_registry = ( + OrderedDict() +) # type: Dict[str, Type[OnlineEvaluatorServiceTransport]] +_transport_registry["grpc"] = OnlineEvaluatorServiceGrpcTransport +_transport_registry["grpc_asyncio"] = OnlineEvaluatorServiceGrpcAsyncIOTransport +_transport_registry["rest"] = OnlineEvaluatorServiceRestTransport +if HAS_REST_ASYNC: # pragma: NO COVER + _transport_registry["rest_asyncio"] = AsyncOnlineEvaluatorServiceRestTransport + +__all__ = ( + "OnlineEvaluatorServiceTransport", + "OnlineEvaluatorServiceGrpcTransport", + "OnlineEvaluatorServiceGrpcAsyncIOTransport", + "OnlineEvaluatorServiceRestTransport", + "OnlineEvaluatorServiceRestInterceptor", +) + ASYNC_REST_CLASSES diff --git a/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/base.py b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/base.py new file mode 100644 index 0000000000..95f53b9043 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/base.py @@ -0,0 +1,420 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import abc +from typing import Awaitable, Callable, Dict, Optional, Sequence, Union + +from google.cloud.aiplatform_v1beta1 import gapic_version as package_version + +import google.auth # type: ignore +import google.api_core +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 operations_v1 +from google.auth import credentials as ga_credentials # type: ignore +from google.oauth2 import service_account # type: ignore +import google.protobuf + +from google.cloud.aiplatform_v1beta1.types import online_evaluator +from google.cloud.aiplatform_v1beta1.types import online_evaluator_service +from google.cloud.location import locations_pb2 # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.longrunning import operations_pb2 # type: ignore + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) + +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + + +class OnlineEvaluatorServiceTransport(abc.ABC): + """Abstract transport class for OnlineEvaluatorService.""" + + AUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) + + DEFAULT_HOST: str = "aiplatform.googleapis.com" + + def __init__( + self, + *, + host: str = DEFAULT_HOST, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + quota_project_id: Optional[str] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, + **kwargs, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to (default: 'aiplatform.googleapis.com'). + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + credentials_file (Optional[str]): Deprecated. A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is mutually exclusive with credentials. This argument will be + removed in the next major version of this library. + scopes (Optional[Sequence[str]]): A list of scopes. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + """ + + # Save the scopes. + self._scopes = scopes + if not hasattr(self, "_ignore_credentials"): + self._ignore_credentials: bool = False + + # If no credentials are provided, then determine the appropriate + # defaults. + if credentials and credentials_file: + raise core_exceptions.DuplicateCredentialArgs( + "'credentials_file' and 'credentials' are mutually exclusive" + ) + + if credentials_file is not None: + credentials, _ = google.auth.load_credentials_from_file( + credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, + ) + elif credentials is None and not self._ignore_credentials: + credentials, _ = google.auth.default( + scopes=scopes, + quota_project_id=quota_project_id, + default_scopes=self.AUTH_SCOPES, + ) + # Don't apply audience if the credentials file passed from user. + if hasattr(credentials, "with_gdch_audience"): + credentials = credentials.with_gdch_audience( + api_audience if api_audience else host + ) + + # If the credentials are service account credentials, then always try to use self signed JWT. + if ( + always_use_jwt_access + and isinstance(credentials, service_account.Credentials) + and hasattr(service_account.Credentials, "with_always_use_jwt_access") + ): + credentials = credentials.with_always_use_jwt_access(True) + + # Save the credentials. + self._credentials = credentials + + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + + @property + def host(self): + return self._host + + def _prep_wrapped_messages(self, client_info): + # Precompute the wrapped methods. + self._wrapped_methods = { + self.create_online_evaluator: gapic_v1.method.wrap_method( + self.create_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.get_online_evaluator: gapic_v1.method.wrap_method( + self.get_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.update_online_evaluator: gapic_v1.method.wrap_method( + self.update_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.delete_online_evaluator: gapic_v1.method.wrap_method( + self.delete_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.list_online_evaluators: gapic_v1.method.wrap_method( + self.list_online_evaluators, + default_timeout=None, + client_info=client_info, + ), + self.activate_online_evaluator: gapic_v1.method.wrap_method( + self.activate_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.suspend_online_evaluator: gapic_v1.method.wrap_method( + self.suspend_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.get_location: gapic_v1.method.wrap_method( + self.get_location, + default_timeout=None, + client_info=client_info, + ), + self.list_locations: gapic_v1.method.wrap_method( + self.list_locations, + default_timeout=None, + client_info=client_info, + ), + self.get_iam_policy: gapic_v1.method.wrap_method( + self.get_iam_policy, + default_timeout=None, + client_info=client_info, + ), + self.set_iam_policy: gapic_v1.method.wrap_method( + self.set_iam_policy, + default_timeout=None, + client_info=client_info, + ), + self.test_iam_permissions: gapic_v1.method.wrap_method( + self.test_iam_permissions, + default_timeout=None, + client_info=client_info, + ), + self.cancel_operation: gapic_v1.method.wrap_method( + self.cancel_operation, + default_timeout=None, + client_info=client_info, + ), + self.delete_operation: gapic_v1.method.wrap_method( + self.delete_operation, + default_timeout=None, + client_info=client_info, + ), + self.get_operation: gapic_v1.method.wrap_method( + self.get_operation, + default_timeout=None, + client_info=client_info, + ), + self.list_operations: gapic_v1.method.wrap_method( + self.list_operations, + default_timeout=None, + client_info=client_info, + ), + self.wait_operation: gapic_v1.method.wrap_method( + self.wait_operation, + default_timeout=None, + client_info=client_info, + ), + } + + def close(self): + """Closes resources associated with the transport. + + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! + """ + raise NotImplementedError() + + @property + def operations_client(self): + """Return the client designed to process long-running operations.""" + raise NotImplementedError() + + @property + def create_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.CreateOnlineEvaluatorRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + @property + def get_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.GetOnlineEvaluatorRequest], + Union[ + online_evaluator.OnlineEvaluator, + Awaitable[online_evaluator.OnlineEvaluator], + ], + ]: + raise NotImplementedError() + + @property + def update_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.UpdateOnlineEvaluatorRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + @property + def delete_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.DeleteOnlineEvaluatorRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + @property + def list_online_evaluators( + self, + ) -> Callable[ + [online_evaluator_service.ListOnlineEvaluatorsRequest], + Union[ + online_evaluator_service.ListOnlineEvaluatorsResponse, + Awaitable[online_evaluator_service.ListOnlineEvaluatorsResponse], + ], + ]: + raise NotImplementedError() + + @property + def activate_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.ActivateOnlineEvaluatorRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + @property + def suspend_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.SuspendOnlineEvaluatorRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + @property + def list_operations( + self, + ) -> Callable[ + [operations_pb2.ListOperationsRequest], + Union[ + operations_pb2.ListOperationsResponse, + Awaitable[operations_pb2.ListOperationsResponse], + ], + ]: + raise NotImplementedError() + + @property + def get_operation( + self, + ) -> Callable[ + [operations_pb2.GetOperationRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + @property + def cancel_operation( + self, + ) -> Callable[ + [operations_pb2.CancelOperationRequest], + None, + ]: + raise NotImplementedError() + + @property + def delete_operation( + self, + ) -> Callable[ + [operations_pb2.DeleteOperationRequest], + None, + ]: + raise NotImplementedError() + + @property + def wait_operation( + self, + ) -> Callable[ + [operations_pb2.WaitOperationRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + @property + def set_iam_policy( + self, + ) -> Callable[ + [iam_policy_pb2.SetIamPolicyRequest], + Union[policy_pb2.Policy, Awaitable[policy_pb2.Policy]], + ]: + raise NotImplementedError() + + @property + def get_iam_policy( + self, + ) -> Callable[ + [iam_policy_pb2.GetIamPolicyRequest], + Union[policy_pb2.Policy, Awaitable[policy_pb2.Policy]], + ]: + raise NotImplementedError() + + @property + def test_iam_permissions( + self, + ) -> Callable[ + [iam_policy_pb2.TestIamPermissionsRequest], + Union[ + iam_policy_pb2.TestIamPermissionsResponse, + Awaitable[iam_policy_pb2.TestIamPermissionsResponse], + ], + ]: + raise NotImplementedError() + + @property + def get_location( + self, + ) -> Callable[ + [locations_pb2.GetLocationRequest], + Union[locations_pb2.Location, Awaitable[locations_pb2.Location]], + ]: + raise NotImplementedError() + + @property + def list_locations( + self, + ) -> Callable[ + [locations_pb2.ListLocationsRequest], + Union[ + locations_pb2.ListLocationsResponse, + Awaitable[locations_pb2.ListLocationsResponse], + ], + ]: + raise NotImplementedError() + + @property + def kind(self) -> str: + raise NotImplementedError() + + +__all__ = ("OnlineEvaluatorServiceTransport",) diff --git a/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/grpc.py b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/grpc.py new file mode 100644 index 0000000000..39a49772a0 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/grpc.py @@ -0,0 +1,767 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import json +import logging as std_logging +import pickle +import warnings +from typing import Callable, Dict, Optional, Sequence, Tuple, Union + +from google.api_core import grpc_helpers +from google.api_core import operations_v1 +from google.api_core import gapic_v1 +import google.auth # type: ignore +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore +from google.protobuf.json_format import MessageToJson +import google.protobuf.message + +import grpc # type: ignore +import proto # type: ignore + +from google.cloud.aiplatform_v1beta1.types import online_evaluator +from google.cloud.aiplatform_v1beta1.types import online_evaluator_service +from google.cloud.location import locations_pb2 # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.longrunning import operations_pb2 # type: ignore +from .base import OnlineEvaluatorServiceTransport, DEFAULT_CLIENT_INFO + +try: + from google.api_core import client_logging # type: ignore + + CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER +except ImportError: # pragma: NO COVER + CLIENT_LOGGING_SUPPORTED = False + +_LOGGER = std_logging.getLogger(__name__) + + +class _LoggingClientInterceptor(grpc.UnaryUnaryClientInterceptor): # pragma: NO COVER + def intercept_unary_unary(self, continuation, client_call_details, request): + logging_enabled = CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + std_logging.DEBUG + ) + if logging_enabled: # pragma: NO COVER + request_metadata = client_call_details.metadata + if isinstance(request, proto.Message): + request_payload = type(request).to_json(request) + elif isinstance(request, google.protobuf.message.Message): + request_payload = MessageToJson(request) + else: + request_payload = f"{type(request).__name__}: {pickle.dumps(request)}" + + request_metadata = { + key: value.decode("utf-8") if isinstance(value, bytes) else value + for key, value in request_metadata + } + grpc_request = { + "payload": request_payload, + "requestMethod": "grpc", + "metadata": dict(request_metadata), + } + _LOGGER.debug( + f"Sending request for {client_call_details.method}", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": str(client_call_details.method), + "request": grpc_request, + "metadata": grpc_request["metadata"], + }, + ) + response = continuation(client_call_details, request) + if logging_enabled: # pragma: NO COVER + response_metadata = response.trailing_metadata() + # Convert gRPC metadata `` to list of tuples + metadata = ( + dict([(k, str(v)) for k, v in response_metadata]) + if response_metadata + else None + ) + result = response.result() + if isinstance(result, proto.Message): + response_payload = type(result).to_json(result) + elif isinstance(result, google.protobuf.message.Message): + response_payload = MessageToJson(result) + else: + response_payload = f"{type(result).__name__}: {pickle.dumps(result)}" + grpc_response = { + "payload": response_payload, + "metadata": metadata, + "status": "OK", + } + _LOGGER.debug( + f"Received response for {client_call_details.method}.", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": client_call_details.method, + "response": grpc_response, + "metadata": grpc_response["metadata"], + }, + ) + return response + + +class OnlineEvaluatorServiceGrpcTransport(OnlineEvaluatorServiceTransport): + """gRPC backend transport for OnlineEvaluatorService. + + This service is used to create and manage Vertex AI + OnlineEvaluators. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends protocol buffers over the wire using gRPC (which is built on + top of HTTP/2); the ``grpcio`` package must be installed. + """ + + _stubs: Dict[str, Callable] + + def __init__( + self, + *, + host: str = "aiplatform.googleapis.com", + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to (default: 'aiplatform.googleapis.com'). + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + This argument is ignored if a ``channel`` instance is provided. + credentials_file (Optional[str]): Deprecated. A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is ignored if a ``channel`` instance is provided. + This argument will be removed in the next major version of this library. + scopes (Optional(Sequence[str])): A list of scopes. This argument is + ignored if a ``channel`` instance is provided. + channel (Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]]): + A ``Channel`` instance through which to make calls, or a Callable + that constructs and returns one. If set to None, ``self.create_channel`` + is used to create the channel. If a Callable is given, it will be called + with the same arguments as used in ``self.create_channel``. + api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. + If provided, it overrides the ``host`` argument and tries to create + a mutual TLS channel with client SSL credentials from + ``client_cert_source`` or application default SSL credentials. + client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): + Deprecated. A callback to provide client SSL certificate bytes and + private key bytes, both in PEM format. It is ignored if + ``api_mtls_endpoint`` is None. + ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials + for the grpc channel. It is ignored if a ``channel`` instance is provided. + client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): + A callback to provide client certificate bytes and private key bytes, + both in PEM format. It is used to configure a mutual TLS channel. It is + ignored if a ``channel`` instance or ``ssl_channel_credentials`` is provided. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport + creation failed for any reason. + google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` + and ``credentials_file`` are passed. + """ + self._grpc_channel = None + self._ssl_channel_credentials = ssl_channel_credentials + self._stubs: Dict[str, Callable] = {} + self._operations_client: Optional[operations_v1.OperationsClient] = None + + if api_mtls_endpoint: + warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) + if client_cert_source: + warnings.warn("client_cert_source is deprecated", DeprecationWarning) + + if isinstance(channel, grpc.Channel): + # Ignore credentials if a channel was passed. + credentials = None + self._ignore_credentials = True + # If a channel was explicitly provided, set it. + self._grpc_channel = channel + self._ssl_channel_credentials = None + + else: + if api_mtls_endpoint: + host = api_mtls_endpoint + + # Create SSL credentials with client_cert_source or application + # default SSL credentials. + if client_cert_source: + cert, key = client_cert_source() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + else: + self._ssl_channel_credentials = SslCredentials().ssl_credentials + + else: + if client_cert_source_for_mtls and not ssl_channel_credentials: + cert, key = client_cert_source_for_mtls() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + + # The base transport sets the host, credentials and scopes + super().__init__( + host=host, + credentials=credentials, + credentials_file=credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + client_info=client_info, + always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, + ) + + if not self._grpc_channel: + # initialize with the provided callable or the default channel + channel_init = channel or type(self).create_channel + self._grpc_channel = channel_init( + self._host, + # use the credentials which are saved + credentials=self._credentials, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, + scopes=self._scopes, + ssl_credentials=self._ssl_channel_credentials, + quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + self._interceptor = _LoggingClientInterceptor() + self._logged_channel = grpc.intercept_channel( + self._grpc_channel, self._interceptor + ) + + # Wrap messages. This must be done after self._logged_channel exists + self._prep_wrapped_messages(client_info) + + @classmethod + def create_channel( + cls, + host: str = "aiplatform.googleapis.com", + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + quota_project_id: Optional[str] = None, + **kwargs, + ) -> grpc.Channel: + """Create and return a gRPC channel object. + Args: + host (Optional[str]): The host for the channel to use. + credentials (Optional[~.Credentials]): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If + none are specified, the client will attempt to ascertain + the credentials from the environment. + credentials_file (Optional[str]): Deprecated. A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is mutually exclusive with credentials. This argument will be + removed in the next major version of this library. + scopes (Optional[Sequence[str]]): A optional list of scopes needed for this + service. These are only used when credentials are not specified and + are passed to :func:`google.auth.default`. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + kwargs (Optional[dict]): Keyword arguments, which are passed to the + channel creation. + Returns: + grpc.Channel: A gRPC channel object. + + Raises: + google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` + and ``credentials_file`` are passed. + """ + + return grpc_helpers.create_channel( + host, + credentials=credentials, + credentials_file=credentials_file, + quota_project_id=quota_project_id, + default_scopes=cls.AUTH_SCOPES, + scopes=scopes, + default_host=cls.DEFAULT_HOST, + **kwargs, + ) + + @property + def grpc_channel(self) -> grpc.Channel: + """Return the channel designed to connect to this service.""" + return self._grpc_channel + + @property + def operations_client(self) -> operations_v1.OperationsClient: + """Create the client designed to process long-running operations. + + This property caches on the instance; repeated calls return the same + client. + """ + # Quick check: Only create a new client if we do not already have one. + if self._operations_client is None: + self._operations_client = operations_v1.OperationsClient( + self._logged_channel + ) + + # Return the client from cache. + return self._operations_client + + @property + def create_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.CreateOnlineEvaluatorRequest], + operations_pb2.Operation, + ]: + r"""Return a callable for the create online evaluator method over gRPC. + + Creates an OnlineEvaluator in the given project and + location. + + Returns: + Callable[[~.CreateOnlineEvaluatorRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "create_online_evaluator" not in self._stubs: + self._stubs["create_online_evaluator"] = self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.OnlineEvaluatorService/CreateOnlineEvaluator", + request_serializer=online_evaluator_service.CreateOnlineEvaluatorRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["create_online_evaluator"] + + @property + def get_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.GetOnlineEvaluatorRequest], + online_evaluator.OnlineEvaluator, + ]: + r"""Return a callable for the get online evaluator method over gRPC. + + Gets details of an OnlineEvaluator. + + Returns: + Callable[[~.GetOnlineEvaluatorRequest], + ~.OnlineEvaluator]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_online_evaluator" not in self._stubs: + self._stubs["get_online_evaluator"] = self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.OnlineEvaluatorService/GetOnlineEvaluator", + request_serializer=online_evaluator_service.GetOnlineEvaluatorRequest.serialize, + response_deserializer=online_evaluator.OnlineEvaluator.deserialize, + ) + return self._stubs["get_online_evaluator"] + + @property + def update_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.UpdateOnlineEvaluatorRequest], + operations_pb2.Operation, + ]: + r"""Return a callable for the update online evaluator method over gRPC. + + Updates the fields of an OnlineEvaluator. + + Returns: + Callable[[~.UpdateOnlineEvaluatorRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "update_online_evaluator" not in self._stubs: + self._stubs["update_online_evaluator"] = self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.OnlineEvaluatorService/UpdateOnlineEvaluator", + request_serializer=online_evaluator_service.UpdateOnlineEvaluatorRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["update_online_evaluator"] + + @property + def delete_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.DeleteOnlineEvaluatorRequest], + operations_pb2.Operation, + ]: + r"""Return a callable for the delete online evaluator method over gRPC. + + Deletes an OnlineEvaluator. + + Returns: + Callable[[~.DeleteOnlineEvaluatorRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "delete_online_evaluator" not in self._stubs: + self._stubs["delete_online_evaluator"] = self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.OnlineEvaluatorService/DeleteOnlineEvaluator", + request_serializer=online_evaluator_service.DeleteOnlineEvaluatorRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["delete_online_evaluator"] + + @property + def list_online_evaluators( + self, + ) -> Callable[ + [online_evaluator_service.ListOnlineEvaluatorsRequest], + online_evaluator_service.ListOnlineEvaluatorsResponse, + ]: + r"""Return a callable for the list online evaluators method over gRPC. + + Lists the OnlineEvaluators for the given project and + location. + + Returns: + Callable[[~.ListOnlineEvaluatorsRequest], + ~.ListOnlineEvaluatorsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_online_evaluators" not in self._stubs: + self._stubs["list_online_evaluators"] = self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.OnlineEvaluatorService/ListOnlineEvaluators", + request_serializer=online_evaluator_service.ListOnlineEvaluatorsRequest.serialize, + response_deserializer=online_evaluator_service.ListOnlineEvaluatorsResponse.deserialize, + ) + return self._stubs["list_online_evaluators"] + + @property + def activate_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.ActivateOnlineEvaluatorRequest], + operations_pb2.Operation, + ]: + r"""Return a callable for the activate online evaluator method over gRPC. + + Activates an OnlineEvaluator. + + Returns: + Callable[[~.ActivateOnlineEvaluatorRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "activate_online_evaluator" not in self._stubs: + self._stubs["activate_online_evaluator"] = self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.OnlineEvaluatorService/ActivateOnlineEvaluator", + request_serializer=online_evaluator_service.ActivateOnlineEvaluatorRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["activate_online_evaluator"] + + @property + def suspend_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.SuspendOnlineEvaluatorRequest], + operations_pb2.Operation, + ]: + r"""Return a callable for the suspend online evaluator method over gRPC. + + Suspends an OnlineEvaluator. When an OnlineEvaluator + is suspended, it won't run any evaluations until it is + activated again. + + Returns: + Callable[[~.SuspendOnlineEvaluatorRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "suspend_online_evaluator" not in self._stubs: + self._stubs["suspend_online_evaluator"] = self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.OnlineEvaluatorService/SuspendOnlineEvaluator", + request_serializer=online_evaluator_service.SuspendOnlineEvaluatorRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["suspend_online_evaluator"] + + def close(self): + self._logged_channel.close() + + @property + def delete_operation( + self, + ) -> Callable[[operations_pb2.DeleteOperationRequest], None]: + r"""Return a callable for the delete_operation method over gRPC.""" + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "delete_operation" not in self._stubs: + self._stubs["delete_operation"] = self._logged_channel.unary_unary( + "/google.longrunning.Operations/DeleteOperation", + request_serializer=operations_pb2.DeleteOperationRequest.SerializeToString, + response_deserializer=None, + ) + return self._stubs["delete_operation"] + + @property + def cancel_operation( + self, + ) -> Callable[[operations_pb2.CancelOperationRequest], None]: + r"""Return a callable for the cancel_operation method over gRPC.""" + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "cancel_operation" not in self._stubs: + self._stubs["cancel_operation"] = self._logged_channel.unary_unary( + "/google.longrunning.Operations/CancelOperation", + request_serializer=operations_pb2.CancelOperationRequest.SerializeToString, + response_deserializer=None, + ) + return self._stubs["cancel_operation"] + + @property + def wait_operation( + self, + ) -> Callable[[operations_pb2.WaitOperationRequest], None]: + r"""Return a callable for the wait_operation method over gRPC.""" + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "wait_operation" not in self._stubs: + self._stubs["wait_operation"] = self._logged_channel.unary_unary( + "/google.longrunning.Operations/WaitOperation", + request_serializer=operations_pb2.WaitOperationRequest.SerializeToString, + response_deserializer=None, + ) + return self._stubs["wait_operation"] + + @property + def get_operation( + self, + ) -> Callable[[operations_pb2.GetOperationRequest], operations_pb2.Operation]: + r"""Return a callable for the get_operation method over gRPC.""" + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_operation" not in self._stubs: + self._stubs["get_operation"] = self._logged_channel.unary_unary( + "/google.longrunning.Operations/GetOperation", + request_serializer=operations_pb2.GetOperationRequest.SerializeToString, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["get_operation"] + + @property + def list_operations( + self, + ) -> Callable[ + [operations_pb2.ListOperationsRequest], operations_pb2.ListOperationsResponse + ]: + r"""Return a callable for the list_operations method over gRPC.""" + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_operations" not in self._stubs: + self._stubs["list_operations"] = self._logged_channel.unary_unary( + "/google.longrunning.Operations/ListOperations", + request_serializer=operations_pb2.ListOperationsRequest.SerializeToString, + response_deserializer=operations_pb2.ListOperationsResponse.FromString, + ) + return self._stubs["list_operations"] + + @property + def list_locations( + self, + ) -> Callable[ + [locations_pb2.ListLocationsRequest], locations_pb2.ListLocationsResponse + ]: + r"""Return a callable for the list locations method over gRPC.""" + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_locations" not in self._stubs: + self._stubs["list_locations"] = self._logged_channel.unary_unary( + "/google.cloud.location.Locations/ListLocations", + request_serializer=locations_pb2.ListLocationsRequest.SerializeToString, + response_deserializer=locations_pb2.ListLocationsResponse.FromString, + ) + return self._stubs["list_locations"] + + @property + def get_location( + self, + ) -> Callable[[locations_pb2.GetLocationRequest], locations_pb2.Location]: + r"""Return a callable for the list locations method over gRPC.""" + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_location" not in self._stubs: + self._stubs["get_location"] = self._logged_channel.unary_unary( + "/google.cloud.location.Locations/GetLocation", + request_serializer=locations_pb2.GetLocationRequest.SerializeToString, + response_deserializer=locations_pb2.Location.FromString, + ) + return self._stubs["get_location"] + + @property + def set_iam_policy( + self, + ) -> Callable[[iam_policy_pb2.SetIamPolicyRequest], policy_pb2.Policy]: + r"""Return a callable for the set iam policy method over gRPC. + Sets the IAM access control policy on the specified + function. Replaces any existing policy. + Returns: + Callable[[~.SetIamPolicyRequest], + ~.Policy]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "set_iam_policy" not in self._stubs: + self._stubs["set_iam_policy"] = self._logged_channel.unary_unary( + "/google.iam.v1.IAMPolicy/SetIamPolicy", + request_serializer=iam_policy_pb2.SetIamPolicyRequest.SerializeToString, + response_deserializer=policy_pb2.Policy.FromString, + ) + return self._stubs["set_iam_policy"] + + @property + def get_iam_policy( + self, + ) -> Callable[[iam_policy_pb2.GetIamPolicyRequest], policy_pb2.Policy]: + r"""Return a callable for the get iam policy method over gRPC. + Gets the IAM access control policy for a function. + Returns an empty policy if the function exists and does + not have a policy set. + Returns: + Callable[[~.GetIamPolicyRequest], + ~.Policy]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_iam_policy" not in self._stubs: + self._stubs["get_iam_policy"] = self._logged_channel.unary_unary( + "/google.iam.v1.IAMPolicy/GetIamPolicy", + request_serializer=iam_policy_pb2.GetIamPolicyRequest.SerializeToString, + response_deserializer=policy_pb2.Policy.FromString, + ) + return self._stubs["get_iam_policy"] + + @property + def test_iam_permissions( + self, + ) -> Callable[ + [iam_policy_pb2.TestIamPermissionsRequest], + iam_policy_pb2.TestIamPermissionsResponse, + ]: + r"""Return a callable for the test iam permissions method over gRPC. + Tests the specified permissions against the IAM access control + policy for a function. If the function does not exist, this will + return an empty set of permissions, not a NOT_FOUND error. + Returns: + Callable[[~.TestIamPermissionsRequest], + ~.TestIamPermissionsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "test_iam_permissions" not in self._stubs: + self._stubs["test_iam_permissions"] = self._logged_channel.unary_unary( + "/google.iam.v1.IAMPolicy/TestIamPermissions", + request_serializer=iam_policy_pb2.TestIamPermissionsRequest.SerializeToString, + response_deserializer=iam_policy_pb2.TestIamPermissionsResponse.FromString, + ) + return self._stubs["test_iam_permissions"] + + @property + def kind(self) -> str: + return "grpc" + + +__all__ = ("OnlineEvaluatorServiceGrpcTransport",) diff --git a/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/grpc_asyncio.py new file mode 100644 index 0000000000..e3c196c5e0 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/grpc_asyncio.py @@ -0,0 +1,870 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import inspect +import json +import pickle +import logging as std_logging +import warnings +from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union + +from google.api_core import gapic_v1 +from google.api_core import grpc_helpers_async +from google.api_core import exceptions as core_exceptions +from google.api_core import retry_async as retries +from google.api_core import operations_v1 +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore +from google.protobuf.json_format import MessageToJson +import google.protobuf.message + +import grpc # type: ignore +import proto # type: ignore +from grpc.experimental import aio # type: ignore + +from google.cloud.aiplatform_v1beta1.types import online_evaluator +from google.cloud.aiplatform_v1beta1.types import online_evaluator_service +from google.cloud.location import locations_pb2 # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.longrunning import operations_pb2 # type: ignore +from .base import OnlineEvaluatorServiceTransport, DEFAULT_CLIENT_INFO +from .grpc import OnlineEvaluatorServiceGrpcTransport + +try: + from google.api_core import client_logging # type: ignore + + CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER +except ImportError: # pragma: NO COVER + CLIENT_LOGGING_SUPPORTED = False + +_LOGGER = std_logging.getLogger(__name__) + + +class _LoggingClientAIOInterceptor( + grpc.aio.UnaryUnaryClientInterceptor +): # pragma: NO COVER + async def intercept_unary_unary(self, continuation, client_call_details, request): + logging_enabled = CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + std_logging.DEBUG + ) + if logging_enabled: # pragma: NO COVER + request_metadata = client_call_details.metadata + if isinstance(request, proto.Message): + request_payload = type(request).to_json(request) + elif isinstance(request, google.protobuf.message.Message): + request_payload = MessageToJson(request) + else: + request_payload = f"{type(request).__name__}: {pickle.dumps(request)}" + + request_metadata = { + key: value.decode("utf-8") if isinstance(value, bytes) else value + for key, value in request_metadata + } + grpc_request = { + "payload": request_payload, + "requestMethod": "grpc", + "metadata": dict(request_metadata), + } + _LOGGER.debug( + f"Sending request for {client_call_details.method}", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": str(client_call_details.method), + "request": grpc_request, + "metadata": grpc_request["metadata"], + }, + ) + response = await continuation(client_call_details, request) + if logging_enabled: # pragma: NO COVER + response_metadata = await response.trailing_metadata() + # Convert gRPC metadata `` to list of tuples + metadata = ( + dict([(k, str(v)) for k, v in response_metadata]) + if response_metadata + else None + ) + result = await response + if isinstance(result, proto.Message): + response_payload = type(result).to_json(result) + elif isinstance(result, google.protobuf.message.Message): + response_payload = MessageToJson(result) + else: + response_payload = f"{type(result).__name__}: {pickle.dumps(result)}" + grpc_response = { + "payload": response_payload, + "metadata": metadata, + "status": "OK", + } + _LOGGER.debug( + f"Received response to rpc {client_call_details.method}.", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": str(client_call_details.method), + "response": grpc_response, + "metadata": grpc_response["metadata"], + }, + ) + return response + + +class OnlineEvaluatorServiceGrpcAsyncIOTransport(OnlineEvaluatorServiceTransport): + """gRPC AsyncIO backend transport for OnlineEvaluatorService. + + This service is used to create and manage Vertex AI + OnlineEvaluators. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends protocol buffers over the wire using gRPC (which is built on + top of HTTP/2); the ``grpcio`` package must be installed. + """ + + _grpc_channel: aio.Channel + _stubs: Dict[str, Callable] = {} + + @classmethod + def create_channel( + cls, + host: str = "aiplatform.googleapis.com", + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + quota_project_id: Optional[str] = None, + **kwargs, + ) -> aio.Channel: + """Create and return a gRPC AsyncIO channel object. + Args: + host (Optional[str]): The host for the channel to use. + credentials (Optional[~.Credentials]): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If + none are specified, the client will attempt to ascertain + the credentials from the environment. + credentials_file (Optional[str]): Deprecated. A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. This argument will be + removed in the next major version of this library. + scopes (Optional[Sequence[str]]): A optional list of scopes needed for this + service. These are only used when credentials are not specified and + are passed to :func:`google.auth.default`. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + kwargs (Optional[dict]): Keyword arguments, which are passed to the + channel creation. + Returns: + aio.Channel: A gRPC AsyncIO channel object. + """ + + return grpc_helpers_async.create_channel( + host, + credentials=credentials, + credentials_file=credentials_file, + quota_project_id=quota_project_id, + default_scopes=cls.AUTH_SCOPES, + scopes=scopes, + default_host=cls.DEFAULT_HOST, + **kwargs, + ) + + def __init__( + self, + *, + host: str = "aiplatform.googleapis.com", + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[Union[aio.Channel, Callable[..., aio.Channel]]] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + api_audience: Optional[str] = None, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to (default: 'aiplatform.googleapis.com'). + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + This argument is ignored if a ``channel`` instance is provided. + credentials_file (Optional[str]): Deprecated. A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is ignored if a ``channel`` instance is provided. + This argument will be removed in the next major version of this library. + scopes (Optional[Sequence[str]]): A optional list of scopes needed for this + service. These are only used when credentials are not specified and + are passed to :func:`google.auth.default`. + channel (Optional[Union[aio.Channel, Callable[..., aio.Channel]]]): + A ``Channel`` instance through which to make calls, or a Callable + that constructs and returns one. If set to None, ``self.create_channel`` + is used to create the channel. If a Callable is given, it will be called + with the same arguments as used in ``self.create_channel``. + api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. + If provided, it overrides the ``host`` argument and tries to create + a mutual TLS channel with client SSL credentials from + ``client_cert_source`` or application default SSL credentials. + client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): + Deprecated. A callback to provide client SSL certificate bytes and + private key bytes, both in PEM format. It is ignored if + ``api_mtls_endpoint`` is None. + ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials + for the grpc channel. It is ignored if a ``channel`` instance is provided. + client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): + A callback to provide client certificate bytes and private key bytes, + both in PEM format. It is used to configure a mutual TLS channel. It is + ignored if a ``channel`` instance or ``ssl_channel_credentials`` is provided. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + + Raises: + google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport + creation failed for any reason. + google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` + and ``credentials_file`` are passed. + """ + self._grpc_channel = None + self._ssl_channel_credentials = ssl_channel_credentials + self._stubs: Dict[str, Callable] = {} + self._operations_client: Optional[operations_v1.OperationsAsyncClient] = None + + if api_mtls_endpoint: + warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) + if client_cert_source: + warnings.warn("client_cert_source is deprecated", DeprecationWarning) + + if isinstance(channel, aio.Channel): + # Ignore credentials if a channel was passed. + credentials = None + self._ignore_credentials = True + # If a channel was explicitly provided, set it. + self._grpc_channel = channel + self._ssl_channel_credentials = None + else: + if api_mtls_endpoint: + host = api_mtls_endpoint + + # Create SSL credentials with client_cert_source or application + # default SSL credentials. + if client_cert_source: + cert, key = client_cert_source() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + else: + self._ssl_channel_credentials = SslCredentials().ssl_credentials + + else: + if client_cert_source_for_mtls and not ssl_channel_credentials: + cert, key = client_cert_source_for_mtls() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + + # The base transport sets the host, credentials and scopes + super().__init__( + host=host, + credentials=credentials, + credentials_file=credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + client_info=client_info, + always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, + ) + + if not self._grpc_channel: + # initialize with the provided callable or the default channel + channel_init = channel or type(self).create_channel + self._grpc_channel = channel_init( + self._host, + # use the credentials which are saved + credentials=self._credentials, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, + scopes=self._scopes, + ssl_credentials=self._ssl_channel_credentials, + quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + self._interceptor = _LoggingClientAIOInterceptor() + self._grpc_channel._unary_unary_interceptors.append(self._interceptor) + self._logged_channel = self._grpc_channel + self._wrap_with_kind = ( + "kind" in inspect.signature(gapic_v1.method_async.wrap_method).parameters + ) + # Wrap messages. This must be done after self._logged_channel exists + self._prep_wrapped_messages(client_info) + + @property + def grpc_channel(self) -> aio.Channel: + """Create the channel designed to connect to this service. + + This property caches on the instance; repeated calls return + the same channel. + """ + # Return the channel from cache. + return self._grpc_channel + + @property + def operations_client(self) -> operations_v1.OperationsAsyncClient: + """Create the client designed to process long-running operations. + + This property caches on the instance; repeated calls return the same + client. + """ + # Quick check: Only create a new client if we do not already have one. + if self._operations_client is None: + self._operations_client = operations_v1.OperationsAsyncClient( + self._logged_channel + ) + + # Return the client from cache. + return self._operations_client + + @property + def create_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.CreateOnlineEvaluatorRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the create online evaluator method over gRPC. + + Creates an OnlineEvaluator in the given project and + location. + + Returns: + Callable[[~.CreateOnlineEvaluatorRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "create_online_evaluator" not in self._stubs: + self._stubs["create_online_evaluator"] = self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.OnlineEvaluatorService/CreateOnlineEvaluator", + request_serializer=online_evaluator_service.CreateOnlineEvaluatorRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["create_online_evaluator"] + + @property + def get_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.GetOnlineEvaluatorRequest], + Awaitable[online_evaluator.OnlineEvaluator], + ]: + r"""Return a callable for the get online evaluator method over gRPC. + + Gets details of an OnlineEvaluator. + + Returns: + Callable[[~.GetOnlineEvaluatorRequest], + Awaitable[~.OnlineEvaluator]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_online_evaluator" not in self._stubs: + self._stubs["get_online_evaluator"] = self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.OnlineEvaluatorService/GetOnlineEvaluator", + request_serializer=online_evaluator_service.GetOnlineEvaluatorRequest.serialize, + response_deserializer=online_evaluator.OnlineEvaluator.deserialize, + ) + return self._stubs["get_online_evaluator"] + + @property + def update_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.UpdateOnlineEvaluatorRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the update online evaluator method over gRPC. + + Updates the fields of an OnlineEvaluator. + + Returns: + Callable[[~.UpdateOnlineEvaluatorRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "update_online_evaluator" not in self._stubs: + self._stubs["update_online_evaluator"] = self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.OnlineEvaluatorService/UpdateOnlineEvaluator", + request_serializer=online_evaluator_service.UpdateOnlineEvaluatorRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["update_online_evaluator"] + + @property + def delete_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.DeleteOnlineEvaluatorRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the delete online evaluator method over gRPC. + + Deletes an OnlineEvaluator. + + Returns: + Callable[[~.DeleteOnlineEvaluatorRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "delete_online_evaluator" not in self._stubs: + self._stubs["delete_online_evaluator"] = self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.OnlineEvaluatorService/DeleteOnlineEvaluator", + request_serializer=online_evaluator_service.DeleteOnlineEvaluatorRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["delete_online_evaluator"] + + @property + def list_online_evaluators( + self, + ) -> Callable[ + [online_evaluator_service.ListOnlineEvaluatorsRequest], + Awaitable[online_evaluator_service.ListOnlineEvaluatorsResponse], + ]: + r"""Return a callable for the list online evaluators method over gRPC. + + Lists the OnlineEvaluators for the given project and + location. + + Returns: + Callable[[~.ListOnlineEvaluatorsRequest], + Awaitable[~.ListOnlineEvaluatorsResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_online_evaluators" not in self._stubs: + self._stubs["list_online_evaluators"] = self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.OnlineEvaluatorService/ListOnlineEvaluators", + request_serializer=online_evaluator_service.ListOnlineEvaluatorsRequest.serialize, + response_deserializer=online_evaluator_service.ListOnlineEvaluatorsResponse.deserialize, + ) + return self._stubs["list_online_evaluators"] + + @property + def activate_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.ActivateOnlineEvaluatorRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the activate online evaluator method over gRPC. + + Activates an OnlineEvaluator. + + Returns: + Callable[[~.ActivateOnlineEvaluatorRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "activate_online_evaluator" not in self._stubs: + self._stubs["activate_online_evaluator"] = self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.OnlineEvaluatorService/ActivateOnlineEvaluator", + request_serializer=online_evaluator_service.ActivateOnlineEvaluatorRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["activate_online_evaluator"] + + @property + def suspend_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.SuspendOnlineEvaluatorRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the suspend online evaluator method over gRPC. + + Suspends an OnlineEvaluator. When an OnlineEvaluator + is suspended, it won't run any evaluations until it is + activated again. + + Returns: + Callable[[~.SuspendOnlineEvaluatorRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "suspend_online_evaluator" not in self._stubs: + self._stubs["suspend_online_evaluator"] = self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.OnlineEvaluatorService/SuspendOnlineEvaluator", + request_serializer=online_evaluator_service.SuspendOnlineEvaluatorRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["suspend_online_evaluator"] + + def _prep_wrapped_messages(self, client_info): + """Precompute the wrapped methods, overriding the base class method to use async wrappers.""" + self._wrapped_methods = { + self.create_online_evaluator: self._wrap_method( + self.create_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.get_online_evaluator: self._wrap_method( + self.get_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.update_online_evaluator: self._wrap_method( + self.update_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.delete_online_evaluator: self._wrap_method( + self.delete_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.list_online_evaluators: self._wrap_method( + self.list_online_evaluators, + default_timeout=None, + client_info=client_info, + ), + self.activate_online_evaluator: self._wrap_method( + self.activate_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.suspend_online_evaluator: self._wrap_method( + self.suspend_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.get_location: self._wrap_method( + self.get_location, + default_timeout=None, + client_info=client_info, + ), + self.list_locations: self._wrap_method( + self.list_locations, + default_timeout=None, + client_info=client_info, + ), + self.get_iam_policy: self._wrap_method( + self.get_iam_policy, + default_timeout=None, + client_info=client_info, + ), + self.set_iam_policy: self._wrap_method( + self.set_iam_policy, + default_timeout=None, + client_info=client_info, + ), + self.test_iam_permissions: self._wrap_method( + self.test_iam_permissions, + default_timeout=None, + client_info=client_info, + ), + self.cancel_operation: self._wrap_method( + self.cancel_operation, + default_timeout=None, + client_info=client_info, + ), + self.delete_operation: self._wrap_method( + self.delete_operation, + default_timeout=None, + client_info=client_info, + ), + self.get_operation: self._wrap_method( + self.get_operation, + default_timeout=None, + client_info=client_info, + ), + self.list_operations: self._wrap_method( + self.list_operations, + default_timeout=None, + client_info=client_info, + ), + self.wait_operation: self._wrap_method( + self.wait_operation, + default_timeout=None, + client_info=client_info, + ), + } + + def _wrap_method(self, func, *args, **kwargs): + if self._wrap_with_kind: # pragma: NO COVER + kwargs["kind"] = self.kind + return gapic_v1.method_async.wrap_method(func, *args, **kwargs) + + def close(self): + return self._logged_channel.close() + + @property + def kind(self) -> str: + return "grpc_asyncio" + + @property + def delete_operation( + self, + ) -> Callable[[operations_pb2.DeleteOperationRequest], None]: + r"""Return a callable for the delete_operation method over gRPC.""" + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "delete_operation" not in self._stubs: + self._stubs["delete_operation"] = self._logged_channel.unary_unary( + "/google.longrunning.Operations/DeleteOperation", + request_serializer=operations_pb2.DeleteOperationRequest.SerializeToString, + response_deserializer=None, + ) + return self._stubs["delete_operation"] + + @property + def cancel_operation( + self, + ) -> Callable[[operations_pb2.CancelOperationRequest], None]: + r"""Return a callable for the cancel_operation method over gRPC.""" + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "cancel_operation" not in self._stubs: + self._stubs["cancel_operation"] = self._logged_channel.unary_unary( + "/google.longrunning.Operations/CancelOperation", + request_serializer=operations_pb2.CancelOperationRequest.SerializeToString, + response_deserializer=None, + ) + return self._stubs["cancel_operation"] + + @property + def wait_operation( + self, + ) -> Callable[[operations_pb2.WaitOperationRequest], None]: + r"""Return a callable for the wait_operation method over gRPC.""" + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "wait_operation" not in self._stubs: + self._stubs["wait_operation"] = self._logged_channel.unary_unary( + "/google.longrunning.Operations/WaitOperation", + request_serializer=operations_pb2.WaitOperationRequest.SerializeToString, + response_deserializer=None, + ) + return self._stubs["wait_operation"] + + @property + def get_operation( + self, + ) -> Callable[[operations_pb2.GetOperationRequest], operations_pb2.Operation]: + r"""Return a callable for the get_operation method over gRPC.""" + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_operation" not in self._stubs: + self._stubs["get_operation"] = self._logged_channel.unary_unary( + "/google.longrunning.Operations/GetOperation", + request_serializer=operations_pb2.GetOperationRequest.SerializeToString, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["get_operation"] + + @property + def list_operations( + self, + ) -> Callable[ + [operations_pb2.ListOperationsRequest], operations_pb2.ListOperationsResponse + ]: + r"""Return a callable for the list_operations method over gRPC.""" + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_operations" not in self._stubs: + self._stubs["list_operations"] = self._logged_channel.unary_unary( + "/google.longrunning.Operations/ListOperations", + request_serializer=operations_pb2.ListOperationsRequest.SerializeToString, + response_deserializer=operations_pb2.ListOperationsResponse.FromString, + ) + return self._stubs["list_operations"] + + @property + def list_locations( + self, + ) -> Callable[ + [locations_pb2.ListLocationsRequest], locations_pb2.ListLocationsResponse + ]: + r"""Return a callable for the list locations method over gRPC.""" + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_locations" not in self._stubs: + self._stubs["list_locations"] = self._logged_channel.unary_unary( + "/google.cloud.location.Locations/ListLocations", + request_serializer=locations_pb2.ListLocationsRequest.SerializeToString, + response_deserializer=locations_pb2.ListLocationsResponse.FromString, + ) + return self._stubs["list_locations"] + + @property + def get_location( + self, + ) -> Callable[[locations_pb2.GetLocationRequest], locations_pb2.Location]: + r"""Return a callable for the list locations method over gRPC.""" + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_location" not in self._stubs: + self._stubs["get_location"] = self._logged_channel.unary_unary( + "/google.cloud.location.Locations/GetLocation", + request_serializer=locations_pb2.GetLocationRequest.SerializeToString, + response_deserializer=locations_pb2.Location.FromString, + ) + return self._stubs["get_location"] + + @property + def set_iam_policy( + self, + ) -> Callable[[iam_policy_pb2.SetIamPolicyRequest], policy_pb2.Policy]: + r"""Return a callable for the set iam policy method over gRPC. + Sets the IAM access control policy on the specified + function. Replaces any existing policy. + Returns: + Callable[[~.SetIamPolicyRequest], + ~.Policy]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "set_iam_policy" not in self._stubs: + self._stubs["set_iam_policy"] = self._logged_channel.unary_unary( + "/google.iam.v1.IAMPolicy/SetIamPolicy", + request_serializer=iam_policy_pb2.SetIamPolicyRequest.SerializeToString, + response_deserializer=policy_pb2.Policy.FromString, + ) + return self._stubs["set_iam_policy"] + + @property + def get_iam_policy( + self, + ) -> Callable[[iam_policy_pb2.GetIamPolicyRequest], policy_pb2.Policy]: + r"""Return a callable for the get iam policy method over gRPC. + Gets the IAM access control policy for a function. + Returns an empty policy if the function exists and does + not have a policy set. + Returns: + Callable[[~.GetIamPolicyRequest], + ~.Policy]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_iam_policy" not in self._stubs: + self._stubs["get_iam_policy"] = self._logged_channel.unary_unary( + "/google.iam.v1.IAMPolicy/GetIamPolicy", + request_serializer=iam_policy_pb2.GetIamPolicyRequest.SerializeToString, + response_deserializer=policy_pb2.Policy.FromString, + ) + return self._stubs["get_iam_policy"] + + @property + def test_iam_permissions( + self, + ) -> Callable[ + [iam_policy_pb2.TestIamPermissionsRequest], + iam_policy_pb2.TestIamPermissionsResponse, + ]: + r"""Return a callable for the test iam permissions method over gRPC. + Tests the specified permissions against the IAM access control + policy for a function. If the function does not exist, this will + return an empty set of permissions, not a NOT_FOUND error. + Returns: + Callable[[~.TestIamPermissionsRequest], + ~.TestIamPermissionsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "test_iam_permissions" not in self._stubs: + self._stubs["test_iam_permissions"] = self._logged_channel.unary_unary( + "/google.iam.v1.IAMPolicy/TestIamPermissions", + request_serializer=iam_policy_pb2.TestIamPermissionsRequest.SerializeToString, + response_deserializer=iam_policy_pb2.TestIamPermissionsResponse.FromString, + ) + return self._stubs["test_iam_permissions"] + + +__all__ = ("OnlineEvaluatorServiceGrpcAsyncIOTransport",) diff --git a/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/rest.py new file mode 100644 index 0000000000..56d8dfee93 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/rest.py @@ -0,0 +1,5603 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import logging +import json # type: ignore + +from google.auth.transport.requests import AuthorizedSession # type: ignore +from google.auth import credentials as ga_credentials # type: ignore +from google.api_core import exceptions as core_exceptions +from google.api_core import retry as retries +from google.api_core import rest_helpers +from google.api_core import rest_streaming +from google.api_core import gapic_v1 +import google.protobuf + +from google.protobuf import json_format +from google.api_core import operations_v1 +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.cloud.location import locations_pb2 # type: ignore + +from requests import __version__ as requests_version +import dataclasses +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union +import warnings + + +from google.cloud.aiplatform_v1beta1.types import online_evaluator +from google.cloud.aiplatform_v1beta1.types import online_evaluator_service +from google.longrunning import operations_pb2 # type: ignore + + +from .rest_base import _BaseOnlineEvaluatorServiceRestTransport +from .base import DEFAULT_CLIENT_INFO as BASE_DEFAULT_CLIENT_INFO + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object, None] # type: ignore + +try: + from google.api_core import client_logging # type: ignore + + CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER +except ImportError: # pragma: NO COVER + CLIENT_LOGGING_SUPPORTED = False + +_LOGGER = logging.getLogger(__name__) + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=BASE_DEFAULT_CLIENT_INFO.gapic_version, + grpc_version=None, + rest_version=f"requests@{requests_version}", +) + +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + + +class OnlineEvaluatorServiceRestInterceptor: + """Interceptor for OnlineEvaluatorService. + + Interceptors are used to manipulate requests, request metadata, and responses + in arbitrary ways. + Example use cases include: + * Logging + * Verifying requests according to service or custom semantics + * Stripping extraneous information from responses + + These use cases and more can be enabled by injecting an + instance of a custom subclass when constructing the OnlineEvaluatorServiceRestTransport. + + .. code-block:: python + class MyCustomOnlineEvaluatorServiceInterceptor(OnlineEvaluatorServiceRestInterceptor): + def pre_activate_online_evaluator(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_activate_online_evaluator(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_create_online_evaluator(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_create_online_evaluator(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_delete_online_evaluator(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_delete_online_evaluator(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_get_online_evaluator(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_get_online_evaluator(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_list_online_evaluators(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_list_online_evaluators(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_suspend_online_evaluator(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_suspend_online_evaluator(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_update_online_evaluator(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_update_online_evaluator(self, response): + logging.log(f"Received response: {response}") + return response + + transport = OnlineEvaluatorServiceRestTransport(interceptor=MyCustomOnlineEvaluatorServiceInterceptor()) + client = OnlineEvaluatorServiceClient(transport=transport) + + + """ + + def pre_activate_online_evaluator( + self, + request: online_evaluator_service.ActivateOnlineEvaluatorRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator_service.ActivateOnlineEvaluatorRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for activate_online_evaluator + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_activate_online_evaluator( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for activate_online_evaluator + + DEPRECATED. Please use the `post_activate_online_evaluator_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. This `post_activate_online_evaluator` interceptor runs + before the `post_activate_online_evaluator_with_metadata` interceptor. + """ + return response + + def post_activate_online_evaluator_with_metadata( + self, + response: operations_pb2.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for activate_online_evaluator + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the OnlineEvaluatorService server but before it is returned to user code. + + We recommend only using this `post_activate_online_evaluator_with_metadata` + interceptor in new development instead of the `post_activate_online_evaluator` interceptor. + When both interceptors are used, this `post_activate_online_evaluator_with_metadata` interceptor runs after the + `post_activate_online_evaluator` interceptor. The (possibly modified) response returned by + `post_activate_online_evaluator` will be passed to + `post_activate_online_evaluator_with_metadata`. + """ + return response, metadata + + def pre_create_online_evaluator( + self, + request: online_evaluator_service.CreateOnlineEvaluatorRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator_service.CreateOnlineEvaluatorRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for create_online_evaluator + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_create_online_evaluator( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for create_online_evaluator + + DEPRECATED. Please use the `post_create_online_evaluator_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. This `post_create_online_evaluator` interceptor runs + before the `post_create_online_evaluator_with_metadata` interceptor. + """ + return response + + def post_create_online_evaluator_with_metadata( + self, + response: operations_pb2.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for create_online_evaluator + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the OnlineEvaluatorService server but before it is returned to user code. + + We recommend only using this `post_create_online_evaluator_with_metadata` + interceptor in new development instead of the `post_create_online_evaluator` interceptor. + When both interceptors are used, this `post_create_online_evaluator_with_metadata` interceptor runs after the + `post_create_online_evaluator` interceptor. The (possibly modified) response returned by + `post_create_online_evaluator` will be passed to + `post_create_online_evaluator_with_metadata`. + """ + return response, metadata + + def pre_delete_online_evaluator( + self, + request: online_evaluator_service.DeleteOnlineEvaluatorRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator_service.DeleteOnlineEvaluatorRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for delete_online_evaluator + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_delete_online_evaluator( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for delete_online_evaluator + + DEPRECATED. Please use the `post_delete_online_evaluator_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. This `post_delete_online_evaluator` interceptor runs + before the `post_delete_online_evaluator_with_metadata` interceptor. + """ + return response + + def post_delete_online_evaluator_with_metadata( + self, + response: operations_pb2.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for delete_online_evaluator + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the OnlineEvaluatorService server but before it is returned to user code. + + We recommend only using this `post_delete_online_evaluator_with_metadata` + interceptor in new development instead of the `post_delete_online_evaluator` interceptor. + When both interceptors are used, this `post_delete_online_evaluator_with_metadata` interceptor runs after the + `post_delete_online_evaluator` interceptor. The (possibly modified) response returned by + `post_delete_online_evaluator` will be passed to + `post_delete_online_evaluator_with_metadata`. + """ + return response, metadata + + def pre_get_online_evaluator( + self, + request: online_evaluator_service.GetOnlineEvaluatorRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator_service.GetOnlineEvaluatorRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for get_online_evaluator + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_get_online_evaluator( + self, response: online_evaluator.OnlineEvaluator + ) -> online_evaluator.OnlineEvaluator: + """Post-rpc interceptor for get_online_evaluator + + DEPRECATED. Please use the `post_get_online_evaluator_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. This `post_get_online_evaluator` interceptor runs + before the `post_get_online_evaluator_with_metadata` interceptor. + """ + return response + + def post_get_online_evaluator_with_metadata( + self, + response: online_evaluator.OnlineEvaluator, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator.OnlineEvaluator, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Post-rpc interceptor for get_online_evaluator + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the OnlineEvaluatorService server but before it is returned to user code. + + We recommend only using this `post_get_online_evaluator_with_metadata` + interceptor in new development instead of the `post_get_online_evaluator` interceptor. + When both interceptors are used, this `post_get_online_evaluator_with_metadata` interceptor runs after the + `post_get_online_evaluator` interceptor. The (possibly modified) response returned by + `post_get_online_evaluator` will be passed to + `post_get_online_evaluator_with_metadata`. + """ + return response, metadata + + def pre_list_online_evaluators( + self, + request: online_evaluator_service.ListOnlineEvaluatorsRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator_service.ListOnlineEvaluatorsRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for list_online_evaluators + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_list_online_evaluators( + self, response: online_evaluator_service.ListOnlineEvaluatorsResponse + ) -> online_evaluator_service.ListOnlineEvaluatorsResponse: + """Post-rpc interceptor for list_online_evaluators + + DEPRECATED. Please use the `post_list_online_evaluators_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. This `post_list_online_evaluators` interceptor runs + before the `post_list_online_evaluators_with_metadata` interceptor. + """ + return response + + def post_list_online_evaluators_with_metadata( + self, + response: online_evaluator_service.ListOnlineEvaluatorsResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator_service.ListOnlineEvaluatorsResponse, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Post-rpc interceptor for list_online_evaluators + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the OnlineEvaluatorService server but before it is returned to user code. + + We recommend only using this `post_list_online_evaluators_with_metadata` + interceptor in new development instead of the `post_list_online_evaluators` interceptor. + When both interceptors are used, this `post_list_online_evaluators_with_metadata` interceptor runs after the + `post_list_online_evaluators` interceptor. The (possibly modified) response returned by + `post_list_online_evaluators` will be passed to + `post_list_online_evaluators_with_metadata`. + """ + return response, metadata + + def pre_suspend_online_evaluator( + self, + request: online_evaluator_service.SuspendOnlineEvaluatorRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator_service.SuspendOnlineEvaluatorRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for suspend_online_evaluator + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_suspend_online_evaluator( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for suspend_online_evaluator + + DEPRECATED. Please use the `post_suspend_online_evaluator_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. This `post_suspend_online_evaluator` interceptor runs + before the `post_suspend_online_evaluator_with_metadata` interceptor. + """ + return response + + def post_suspend_online_evaluator_with_metadata( + self, + response: operations_pb2.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for suspend_online_evaluator + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the OnlineEvaluatorService server but before it is returned to user code. + + We recommend only using this `post_suspend_online_evaluator_with_metadata` + interceptor in new development instead of the `post_suspend_online_evaluator` interceptor. + When both interceptors are used, this `post_suspend_online_evaluator_with_metadata` interceptor runs after the + `post_suspend_online_evaluator` interceptor. The (possibly modified) response returned by + `post_suspend_online_evaluator` will be passed to + `post_suspend_online_evaluator_with_metadata`. + """ + return response, metadata + + def pre_update_online_evaluator( + self, + request: online_evaluator_service.UpdateOnlineEvaluatorRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator_service.UpdateOnlineEvaluatorRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for update_online_evaluator + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_update_online_evaluator( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for update_online_evaluator + + DEPRECATED. Please use the `post_update_online_evaluator_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. This `post_update_online_evaluator` interceptor runs + before the `post_update_online_evaluator_with_metadata` interceptor. + """ + return response + + def post_update_online_evaluator_with_metadata( + self, + response: operations_pb2.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for update_online_evaluator + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the OnlineEvaluatorService server but before it is returned to user code. + + We recommend only using this `post_update_online_evaluator_with_metadata` + interceptor in new development instead of the `post_update_online_evaluator` interceptor. + When both interceptors are used, this `post_update_online_evaluator_with_metadata` interceptor runs after the + `post_update_online_evaluator` interceptor. The (possibly modified) response returned by + `post_update_online_evaluator` will be passed to + `post_update_online_evaluator_with_metadata`. + """ + return response, metadata + + def pre_get_location( + self, + request: locations_pb2.GetLocationRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + locations_pb2.GetLocationRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for get_location + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_get_location( + self, response: locations_pb2.Location + ) -> locations_pb2.Location: + """Post-rpc interceptor for get_location + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + def pre_list_locations( + self, + request: locations_pb2.ListLocationsRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + locations_pb2.ListLocationsRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for list_locations + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_list_locations( + self, response: locations_pb2.ListLocationsResponse + ) -> locations_pb2.ListLocationsResponse: + """Post-rpc interceptor for list_locations + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + def pre_get_iam_policy( + self, + request: iam_policy_pb2.GetIamPolicyRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + iam_policy_pb2.GetIamPolicyRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for get_iam_policy + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_get_iam_policy(self, response: policy_pb2.Policy) -> policy_pb2.Policy: + """Post-rpc interceptor for get_iam_policy + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + def pre_set_iam_policy( + self, + request: iam_policy_pb2.SetIamPolicyRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + iam_policy_pb2.SetIamPolicyRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for set_iam_policy + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_set_iam_policy(self, response: policy_pb2.Policy) -> policy_pb2.Policy: + """Post-rpc interceptor for set_iam_policy + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + def pre_test_iam_permissions( + self, + request: iam_policy_pb2.TestIamPermissionsRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + iam_policy_pb2.TestIamPermissionsRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for test_iam_permissions + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_test_iam_permissions( + self, response: iam_policy_pb2.TestIamPermissionsResponse + ) -> iam_policy_pb2.TestIamPermissionsResponse: + """Post-rpc interceptor for test_iam_permissions + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + def pre_cancel_operation( + self, + request: operations_pb2.CancelOperationRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + operations_pb2.CancelOperationRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for cancel_operation + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_cancel_operation(self, response: None) -> None: + """Post-rpc interceptor for cancel_operation + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + def pre_delete_operation( + self, + request: operations_pb2.DeleteOperationRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + operations_pb2.DeleteOperationRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for delete_operation + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_delete_operation(self, response: None) -> None: + """Post-rpc interceptor for delete_operation + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + def pre_get_operation( + self, + request: operations_pb2.GetOperationRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + operations_pb2.GetOperationRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for get_operation + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_get_operation( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for get_operation + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + def pre_list_operations( + self, + request: operations_pb2.ListOperationsRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + operations_pb2.ListOperationsRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for list_operations + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_list_operations( + self, response: operations_pb2.ListOperationsResponse + ) -> operations_pb2.ListOperationsResponse: + """Post-rpc interceptor for list_operations + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + def pre_wait_operation( + self, + request: operations_pb2.WaitOperationRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + operations_pb2.WaitOperationRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for wait_operation + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + def post_wait_operation( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for wait_operation + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + +@dataclasses.dataclass +class OnlineEvaluatorServiceRestStub: + _session: AuthorizedSession + _host: str + _interceptor: OnlineEvaluatorServiceRestInterceptor + + +class OnlineEvaluatorServiceRestTransport(_BaseOnlineEvaluatorServiceRestTransport): + """REST backend synchronous transport for OnlineEvaluatorService. + + This service is used to create and manage Vertex AI + OnlineEvaluators. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends JSON representations of protocol buffers over HTTP/1.1 + """ + + def __init__( + self, + *, + host: str = "aiplatform.googleapis.com", + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + url_scheme: str = "https", + interceptor: Optional[OnlineEvaluatorServiceRestInterceptor] = None, + api_audience: Optional[str] = None, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to (default: 'aiplatform.googleapis.com'). + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + + credentials_file (Optional[str]): Deprecated. A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is ignored if ``channel`` is provided. This argument will be + removed in the next major version of this library. + scopes (Optional(Sequence[str])): A list of scopes. This argument is + ignored if ``channel`` is provided. + client_cert_source_for_mtls (Callable[[], Tuple[bytes, bytes]]): Client + certificate to configure mutual TLS HTTP channel. It is ignored + if ``channel`` is provided. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you are developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + url_scheme: the protocol scheme for the API endpoint. Normally + "https", but for testing or local servers, + "http" can be specified. + """ + # Run the base constructor + # TODO(yon-mg): resolve other ctor params i.e. scopes, quota, etc. + # TODO: When custom host (api_endpoint) is set, `scopes` must *also* be set on the + # credentials object + super().__init__( + host=host, + credentials=credentials, + client_info=client_info, + always_use_jwt_access=always_use_jwt_access, + url_scheme=url_scheme, + api_audience=api_audience, + ) + self._session = AuthorizedSession( + self._credentials, default_host=self.DEFAULT_HOST + ) + self._operations_client: Optional[operations_v1.AbstractOperationsClient] = None + if client_cert_source_for_mtls: + self._session.configure_mtls_channel(client_cert_source_for_mtls) + self._interceptor = interceptor or OnlineEvaluatorServiceRestInterceptor() + self._prep_wrapped_messages(client_info) + + @property + def operations_client(self) -> operations_v1.AbstractOperationsClient: + """Create the client designed to process long-running operations. + + This property caches on the instance; repeated calls return the same + client. + """ + # Only create a new client if we do not already have one. + if self._operations_client is None: + http_options: Dict[str, List[Dict[str, str]]] = { + "google.longrunning.Operations.CancelOperation": [ + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, + ], + "google.longrunning.Operations.DeleteOperation": [ + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, + ], + "google.longrunning.Operations.GetOperation": [ + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, + ], + "google.longrunning.Operations.ListOperations": [ + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/agents/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/apps/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/schedules/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, + ], + "google.longrunning.Operations.WaitOperation": [ + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, + ], + } + + rest_transport = operations_v1.OperationsRestTransport( + host=self._host, + # use the credentials which are saved + credentials=self._credentials, + scopes=self._scopes, + http_options=http_options, + path_prefix="v1beta1", + ) + + self._operations_client = operations_v1.AbstractOperationsClient( + transport=rest_transport + ) + + # Return the client from cache. + return self._operations_client + + class _ActivateOnlineEvaluator( + _BaseOnlineEvaluatorServiceRestTransport._BaseActivateOnlineEvaluator, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.ActivateOnlineEvaluator") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: online_evaluator_service.ActivateOnlineEvaluatorRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the activate online evaluator method over HTTP. + + Args: + request (~.online_evaluator_service.ActivateOnlineEvaluatorRequest): + The request object. Request message for + ActivateOnlineEvaluator. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.operations_pb2.Operation: + This resource represents a + long-running operation that is the + result of a network API call. + + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseActivateOnlineEvaluator._get_http_options() + ) + + request, metadata = self._interceptor.pre_activate_online_evaluator( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseActivateOnlineEvaluator._get_transcoded_request( + http_options, request + ) + + body = _BaseOnlineEvaluatorServiceRestTransport._BaseActivateOnlineEvaluator._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseActivateOnlineEvaluator._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.ActivateOnlineEvaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "ActivateOnlineEvaluator", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = OnlineEvaluatorServiceRestTransport._ActivateOnlineEvaluator._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = operations_pb2.Operation() + json_format.Parse(response.content, resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_activate_online_evaluator(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_activate_online_evaluator_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.activate_online_evaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "ActivateOnlineEvaluator", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _CreateOnlineEvaluator( + _BaseOnlineEvaluatorServiceRestTransport._BaseCreateOnlineEvaluator, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.CreateOnlineEvaluator") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: online_evaluator_service.CreateOnlineEvaluatorRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the create online evaluator method over HTTP. + + Args: + request (~.online_evaluator_service.CreateOnlineEvaluatorRequest): + The request object. Request message for + CreateOnlineEvaluator. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.operations_pb2.Operation: + This resource represents a + long-running operation that is the + result of a network API call. + + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseCreateOnlineEvaluator._get_http_options() + ) + + request, metadata = self._interceptor.pre_create_online_evaluator( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseCreateOnlineEvaluator._get_transcoded_request( + http_options, request + ) + + body = _BaseOnlineEvaluatorServiceRestTransport._BaseCreateOnlineEvaluator._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseCreateOnlineEvaluator._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.CreateOnlineEvaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "CreateOnlineEvaluator", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = OnlineEvaluatorServiceRestTransport._CreateOnlineEvaluator._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = operations_pb2.Operation() + json_format.Parse(response.content, resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_create_online_evaluator(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_create_online_evaluator_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.create_online_evaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "CreateOnlineEvaluator", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _DeleteOnlineEvaluator( + _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOnlineEvaluator, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.DeleteOnlineEvaluator") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: online_evaluator_service.DeleteOnlineEvaluatorRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the delete online evaluator method over HTTP. + + Args: + request (~.online_evaluator_service.DeleteOnlineEvaluatorRequest): + The request object. Request message for + DeleteOnlineEvaluator. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.operations_pb2.Operation: + This resource represents a + long-running operation that is the + result of a network API call. + + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOnlineEvaluator._get_http_options() + ) + + request, metadata = self._interceptor.pre_delete_online_evaluator( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOnlineEvaluator._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOnlineEvaluator._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.DeleteOnlineEvaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "DeleteOnlineEvaluator", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = OnlineEvaluatorServiceRestTransport._DeleteOnlineEvaluator._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = operations_pb2.Operation() + json_format.Parse(response.content, resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_delete_online_evaluator(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_delete_online_evaluator_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.delete_online_evaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "DeleteOnlineEvaluator", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _GetOnlineEvaluator( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetOnlineEvaluator, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.GetOnlineEvaluator") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: online_evaluator_service.GetOnlineEvaluatorRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> online_evaluator.OnlineEvaluator: + r"""Call the get online evaluator method over HTTP. + + Args: + request (~.online_evaluator_service.GetOnlineEvaluatorRequest): + The request object. Request message for + GetOnlineEvaluator. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.online_evaluator.OnlineEvaluator: + An OnlineEvaluator contains the + configuration for an Online Evaluation. + + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetOnlineEvaluator._get_http_options() + ) + + request, metadata = self._interceptor.pre_get_online_evaluator( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseGetOnlineEvaluator._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseGetOnlineEvaluator._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.GetOnlineEvaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "GetOnlineEvaluator", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ( + OnlineEvaluatorServiceRestTransport._GetOnlineEvaluator._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = online_evaluator.OnlineEvaluator() + pb_resp = online_evaluator.OnlineEvaluator.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_get_online_evaluator(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_get_online_evaluator_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = online_evaluator.OnlineEvaluator.to_json( + response + ) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.get_online_evaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "GetOnlineEvaluator", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _ListOnlineEvaluators( + _BaseOnlineEvaluatorServiceRestTransport._BaseListOnlineEvaluators, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.ListOnlineEvaluators") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: online_evaluator_service.ListOnlineEvaluatorsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> online_evaluator_service.ListOnlineEvaluatorsResponse: + r"""Call the list online evaluators method over HTTP. + + Args: + request (~.online_evaluator_service.ListOnlineEvaluatorsRequest): + The request object. Request message for + ListOnlineEvaluators. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.online_evaluator_service.ListOnlineEvaluatorsResponse: + Response message for + ListOnlineEvaluators. + + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseListOnlineEvaluators._get_http_options() + ) + + request, metadata = self._interceptor.pre_list_online_evaluators( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseListOnlineEvaluators._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseListOnlineEvaluators._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.ListOnlineEvaluators", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "ListOnlineEvaluators", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ( + OnlineEvaluatorServiceRestTransport._ListOnlineEvaluators._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = online_evaluator_service.ListOnlineEvaluatorsResponse() + pb_resp = online_evaluator_service.ListOnlineEvaluatorsResponse.pb(resp) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_list_online_evaluators(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_list_online_evaluators_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = ( + online_evaluator_service.ListOnlineEvaluatorsResponse.to_json( + response + ) + ) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.list_online_evaluators", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "ListOnlineEvaluators", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _SuspendOnlineEvaluator( + _BaseOnlineEvaluatorServiceRestTransport._BaseSuspendOnlineEvaluator, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.SuspendOnlineEvaluator") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: online_evaluator_service.SuspendOnlineEvaluatorRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the suspend online evaluator method over HTTP. + + Args: + request (~.online_evaluator_service.SuspendOnlineEvaluatorRequest): + The request object. Request message for + SuspendOnlineEvaluator. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.operations_pb2.Operation: + This resource represents a + long-running operation that is the + result of a network API call. + + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseSuspendOnlineEvaluator._get_http_options() + ) + + request, metadata = self._interceptor.pre_suspend_online_evaluator( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseSuspendOnlineEvaluator._get_transcoded_request( + http_options, request + ) + + body = _BaseOnlineEvaluatorServiceRestTransport._BaseSuspendOnlineEvaluator._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseSuspendOnlineEvaluator._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.SuspendOnlineEvaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "SuspendOnlineEvaluator", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = OnlineEvaluatorServiceRestTransport._SuspendOnlineEvaluator._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = operations_pb2.Operation() + json_format.Parse(response.content, resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_suspend_online_evaluator(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_suspend_online_evaluator_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.suspend_online_evaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "SuspendOnlineEvaluator", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _UpdateOnlineEvaluator( + _BaseOnlineEvaluatorServiceRestTransport._BaseUpdateOnlineEvaluator, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.UpdateOnlineEvaluator") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: online_evaluator_service.UpdateOnlineEvaluatorRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the update online evaluator method over HTTP. + + Args: + request (~.online_evaluator_service.UpdateOnlineEvaluatorRequest): + The request object. Request message for + UpdateOnlineEvaluator. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.operations_pb2.Operation: + This resource represents a + long-running operation that is the + result of a network API call. + + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseUpdateOnlineEvaluator._get_http_options() + ) + + request, metadata = self._interceptor.pre_update_online_evaluator( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseUpdateOnlineEvaluator._get_transcoded_request( + http_options, request + ) + + body = _BaseOnlineEvaluatorServiceRestTransport._BaseUpdateOnlineEvaluator._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseUpdateOnlineEvaluator._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.UpdateOnlineEvaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "UpdateOnlineEvaluator", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = OnlineEvaluatorServiceRestTransport._UpdateOnlineEvaluator._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = operations_pb2.Operation() + json_format.Parse(response.content, resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_update_online_evaluator(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_update_online_evaluator_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.update_online_evaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "UpdateOnlineEvaluator", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + @property + def activate_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.ActivateOnlineEvaluatorRequest], + operations_pb2.Operation, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._ActivateOnlineEvaluator(self._session, self._host, self._interceptor) # type: ignore + + @property + def create_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.CreateOnlineEvaluatorRequest], + operations_pb2.Operation, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._CreateOnlineEvaluator(self._session, self._host, self._interceptor) # type: ignore + + @property + def delete_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.DeleteOnlineEvaluatorRequest], + operations_pb2.Operation, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._DeleteOnlineEvaluator(self._session, self._host, self._interceptor) # type: ignore + + @property + def get_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.GetOnlineEvaluatorRequest], + online_evaluator.OnlineEvaluator, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._GetOnlineEvaluator(self._session, self._host, self._interceptor) # type: ignore + + @property + def list_online_evaluators( + self, + ) -> Callable[ + [online_evaluator_service.ListOnlineEvaluatorsRequest], + online_evaluator_service.ListOnlineEvaluatorsResponse, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._ListOnlineEvaluators(self._session, self._host, self._interceptor) # type: ignore + + @property + def suspend_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.SuspendOnlineEvaluatorRequest], + operations_pb2.Operation, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._SuspendOnlineEvaluator(self._session, self._host, self._interceptor) # type: ignore + + @property + def update_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.UpdateOnlineEvaluatorRequest], + operations_pb2.Operation, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._UpdateOnlineEvaluator(self._session, self._host, self._interceptor) # type: ignore + + @property + def get_location(self): + return self._GetLocation(self._session, self._host, self._interceptor) # type: ignore + + class _GetLocation( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetLocation, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.GetLocation") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: locations_pb2.GetLocationRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> locations_pb2.Location: + r"""Call the get location method over HTTP. + + Args: + request (locations_pb2.GetLocationRequest): + The request object for GetLocation method. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + locations_pb2.Location: Response from GetLocation method. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetLocation._get_http_options() + ) + + request, metadata = self._interceptor.pre_get_location(request, metadata) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseGetLocation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseGetLocation._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.GetLocation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "GetLocation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = OnlineEvaluatorServiceRestTransport._GetLocation._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + content = response.content.decode("utf-8") + resp = locations_pb2.Location() + resp = json_format.Parse(content, resp) + resp = self._interceptor.post_get_location(resp) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.GetLocation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "GetLocation", + "httpResponse": http_response, + "metadata": http_response["headers"], + }, + ) + return resp + + @property + def list_locations(self): + return self._ListLocations(self._session, self._host, self._interceptor) # type: ignore + + class _ListLocations( + _BaseOnlineEvaluatorServiceRestTransport._BaseListLocations, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.ListLocations") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: locations_pb2.ListLocationsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> locations_pb2.ListLocationsResponse: + r"""Call the list locations method over HTTP. + + Args: + request (locations_pb2.ListLocationsRequest): + The request object for ListLocations method. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + locations_pb2.ListLocationsResponse: Response from ListLocations method. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseListLocations._get_http_options() + ) + + request, metadata = self._interceptor.pre_list_locations(request, metadata) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseListLocations._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseListLocations._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.ListLocations", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "ListLocations", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = OnlineEvaluatorServiceRestTransport._ListLocations._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + content = response.content.decode("utf-8") + resp = locations_pb2.ListLocationsResponse() + resp = json_format.Parse(content, resp) + resp = self._interceptor.post_list_locations(resp) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.ListLocations", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "ListLocations", + "httpResponse": http_response, + "metadata": http_response["headers"], + }, + ) + return resp + + @property + def get_iam_policy(self): + return self._GetIamPolicy(self._session, self._host, self._interceptor) # type: ignore + + class _GetIamPolicy( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetIamPolicy, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.GetIamPolicy") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: iam_policy_pb2.GetIamPolicyRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> policy_pb2.Policy: + r"""Call the get iam policy method over HTTP. + + Args: + request (iam_policy_pb2.GetIamPolicyRequest): + The request object for GetIamPolicy method. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + policy_pb2.Policy: Response from GetIamPolicy method. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetIamPolicy._get_http_options() + ) + + request, metadata = self._interceptor.pre_get_iam_policy(request, metadata) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseGetIamPolicy._get_transcoded_request( + http_options, request + ) + + body = _BaseOnlineEvaluatorServiceRestTransport._BaseGetIamPolicy._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseGetIamPolicy._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.GetIamPolicy", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "GetIamPolicy", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = OnlineEvaluatorServiceRestTransport._GetIamPolicy._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + content = response.content.decode("utf-8") + resp = policy_pb2.Policy() + resp = json_format.Parse(content, resp) + resp = self._interceptor.post_get_iam_policy(resp) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.GetIamPolicy", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "GetIamPolicy", + "httpResponse": http_response, + "metadata": http_response["headers"], + }, + ) + return resp + + @property + def set_iam_policy(self): + return self._SetIamPolicy(self._session, self._host, self._interceptor) # type: ignore + + class _SetIamPolicy( + _BaseOnlineEvaluatorServiceRestTransport._BaseSetIamPolicy, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.SetIamPolicy") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: iam_policy_pb2.SetIamPolicyRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> policy_pb2.Policy: + r"""Call the set iam policy method over HTTP. + + Args: + request (iam_policy_pb2.SetIamPolicyRequest): + The request object for SetIamPolicy method. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + policy_pb2.Policy: Response from SetIamPolicy method. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseSetIamPolicy._get_http_options() + ) + + request, metadata = self._interceptor.pre_set_iam_policy(request, metadata) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseSetIamPolicy._get_transcoded_request( + http_options, request + ) + + body = _BaseOnlineEvaluatorServiceRestTransport._BaseSetIamPolicy._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseSetIamPolicy._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.SetIamPolicy", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "SetIamPolicy", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = OnlineEvaluatorServiceRestTransport._SetIamPolicy._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + content = response.content.decode("utf-8") + resp = policy_pb2.Policy() + resp = json_format.Parse(content, resp) + resp = self._interceptor.post_set_iam_policy(resp) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.SetIamPolicy", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "SetIamPolicy", + "httpResponse": http_response, + "metadata": http_response["headers"], + }, + ) + return resp + + @property + def test_iam_permissions(self): + return self._TestIamPermissions(self._session, self._host, self._interceptor) # type: ignore + + class _TestIamPermissions( + _BaseOnlineEvaluatorServiceRestTransport._BaseTestIamPermissions, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.TestIamPermissions") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: iam_policy_pb2.TestIamPermissionsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> iam_policy_pb2.TestIamPermissionsResponse: + r"""Call the test iam permissions method over HTTP. + + Args: + request (iam_policy_pb2.TestIamPermissionsRequest): + The request object for TestIamPermissions method. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + iam_policy_pb2.TestIamPermissionsResponse: Response from TestIamPermissions method. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseTestIamPermissions._get_http_options() + ) + + request, metadata = self._interceptor.pre_test_iam_permissions( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseTestIamPermissions._get_transcoded_request( + http_options, request + ) + + body = _BaseOnlineEvaluatorServiceRestTransport._BaseTestIamPermissions._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseTestIamPermissions._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.TestIamPermissions", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "TestIamPermissions", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ( + OnlineEvaluatorServiceRestTransport._TestIamPermissions._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + content = response.content.decode("utf-8") + resp = iam_policy_pb2.TestIamPermissionsResponse() + resp = json_format.Parse(content, resp) + resp = self._interceptor.post_test_iam_permissions(resp) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.TestIamPermissions", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "TestIamPermissions", + "httpResponse": http_response, + "metadata": http_response["headers"], + }, + ) + return resp + + @property + def cancel_operation(self): + return self._CancelOperation(self._session, self._host, self._interceptor) # type: ignore + + class _CancelOperation( + _BaseOnlineEvaluatorServiceRestTransport._BaseCancelOperation, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.CancelOperation") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: operations_pb2.CancelOperationRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> None: + r"""Call the cancel operation method over HTTP. + + Args: + request (operations_pb2.CancelOperationRequest): + The request object for CancelOperation method. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseCancelOperation._get_http_options() + ) + + request, metadata = self._interceptor.pre_cancel_operation( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseCancelOperation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseCancelOperation._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.CancelOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "CancelOperation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ( + OnlineEvaluatorServiceRestTransport._CancelOperation._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + return self._interceptor.post_cancel_operation(None) + + @property + def delete_operation(self): + return self._DeleteOperation(self._session, self._host, self._interceptor) # type: ignore + + class _DeleteOperation( + _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOperation, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.DeleteOperation") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: operations_pb2.DeleteOperationRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> None: + r"""Call the delete operation method over HTTP. + + Args: + request (operations_pb2.DeleteOperationRequest): + The request object for DeleteOperation method. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOperation._get_http_options() + ) + + request, metadata = self._interceptor.pre_delete_operation( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOperation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOperation._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.DeleteOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "DeleteOperation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ( + OnlineEvaluatorServiceRestTransport._DeleteOperation._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + return self._interceptor.post_delete_operation(None) + + @property + def get_operation(self): + return self._GetOperation(self._session, self._host, self._interceptor) # type: ignore + + class _GetOperation( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetOperation, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.GetOperation") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: operations_pb2.GetOperationRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the get operation method over HTTP. + + Args: + request (operations_pb2.GetOperationRequest): + The request object for GetOperation method. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + operations_pb2.Operation: Response from GetOperation method. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetOperation._get_http_options() + ) + + request, metadata = self._interceptor.pre_get_operation(request, metadata) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseGetOperation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseGetOperation._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.GetOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "GetOperation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = OnlineEvaluatorServiceRestTransport._GetOperation._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + content = response.content.decode("utf-8") + resp = operations_pb2.Operation() + resp = json_format.Parse(content, resp) + resp = self._interceptor.post_get_operation(resp) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.GetOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "GetOperation", + "httpResponse": http_response, + "metadata": http_response["headers"], + }, + ) + return resp + + @property + def list_operations(self): + return self._ListOperations(self._session, self._host, self._interceptor) # type: ignore + + class _ListOperations( + _BaseOnlineEvaluatorServiceRestTransport._BaseListOperations, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.ListOperations") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: operations_pb2.ListOperationsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.ListOperationsResponse: + r"""Call the list operations method over HTTP. + + Args: + request (operations_pb2.ListOperationsRequest): + The request object for ListOperations method. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + operations_pb2.ListOperationsResponse: Response from ListOperations method. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseListOperations._get_http_options() + ) + + request, metadata = self._interceptor.pre_list_operations(request, metadata) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseListOperations._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseListOperations._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.ListOperations", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "ListOperations", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ( + OnlineEvaluatorServiceRestTransport._ListOperations._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + content = response.content.decode("utf-8") + resp = operations_pb2.ListOperationsResponse() + resp = json_format.Parse(content, resp) + resp = self._interceptor.post_list_operations(resp) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.ListOperations", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "ListOperations", + "httpResponse": http_response, + "metadata": http_response["headers"], + }, + ) + return resp + + @property + def wait_operation(self): + return self._WaitOperation(self._session, self._host, self._interceptor) # type: ignore + + class _WaitOperation( + _BaseOnlineEvaluatorServiceRestTransport._BaseWaitOperation, + OnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("OnlineEvaluatorServiceRestTransport.WaitOperation") + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + def __call__( + self, + request: operations_pb2.WaitOperationRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the wait operation method over HTTP. + + Args: + request (operations_pb2.WaitOperationRequest): + The request object for WaitOperation method. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + operations_pb2.Operation: Response from WaitOperation method. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseWaitOperation._get_http_options() + ) + + request, metadata = self._interceptor.pre_wait_operation(request, metadata) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseWaitOperation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseWaitOperation._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.WaitOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "WaitOperation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = OnlineEvaluatorServiceRestTransport._WaitOperation._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + content = response.content.decode("utf-8") + resp = operations_pb2.Operation() + resp = json_format.Parse(content, resp) + resp = self._interceptor.post_wait_operation(resp) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.WaitOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "WaitOperation", + "httpResponse": http_response, + "metadata": http_response["headers"], + }, + ) + return resp + + @property + def kind(self) -> str: + return "rest" + + def close(self): + self._session.close() + + +__all__ = ("OnlineEvaluatorServiceRestTransport",) diff --git a/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/rest_asyncio.py new file mode 100644 index 0000000000..85b855f4a9 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/rest_asyncio.py @@ -0,0 +1,5813 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import google.auth + +try: + import aiohttp # type: ignore + from google.auth.aio.transport.sessions import AsyncAuthorizedSession # type: ignore + from google.api_core import rest_streaming_async # type: ignore + from google.api_core.operations_v1 import AsyncOperationsRestClient # type: ignore +except ImportError as e: # pragma: NO COVER + raise ImportError( + "`rest_asyncio` transport requires the library to be installed with the `async_rest` extra. Install the library with the `async_rest` extra using `pip install google-cloud-aiplatform[async_rest]`" + ) from e + +from google.auth.aio import credentials as ga_credentials_async # type: ignore + +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import operations_v1 +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.cloud.location import locations_pb2 # type: ignore +from google.api_core import retry_async as retries +from google.api_core import rest_helpers +from google.api_core import rest_streaming_async # type: ignore +import google.protobuf + +from google.protobuf import json_format +from google.api_core import operations_v1 +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.cloud.location import locations_pb2 # type: ignore + +import json # type: ignore +import dataclasses +from typing import Any, Dict, List, Callable, Tuple, Optional, Sequence, Union + + +from google.cloud.aiplatform_v1beta1.types import online_evaluator +from google.cloud.aiplatform_v1beta1.types import online_evaluator_service +from google.longrunning import operations_pb2 # type: ignore + + +from .rest_base import _BaseOnlineEvaluatorServiceRestTransport + +from .base import DEFAULT_CLIENT_INFO as BASE_DEFAULT_CLIENT_INFO + + +import logging + +try: + from google.api_core import client_logging # type: ignore + + CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER +except ImportError: # pragma: NO COVER + CLIENT_LOGGING_SUPPORTED = False + +_LOGGER = logging.getLogger(__name__) + +try: + OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault, None] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore + +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=BASE_DEFAULT_CLIENT_INFO.gapic_version, + grpc_version=None, + rest_version=f"google-auth@{google.auth.__version__}", +) + +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + + +class AsyncOnlineEvaluatorServiceRestInterceptor: + """Asynchronous Interceptor for OnlineEvaluatorService. + + Interceptors are used to manipulate requests, request metadata, and responses + in arbitrary ways. + Example use cases include: + * Logging + * Verifying requests according to service or custom semantics + * Stripping extraneous information from responses + + These use cases and more can be enabled by injecting an + instance of a custom subclass when constructing the AsyncOnlineEvaluatorServiceRestTransport. + + .. code-block:: python + class MyCustomOnlineEvaluatorServiceInterceptor(OnlineEvaluatorServiceRestInterceptor): + async def pre_activate_online_evaluator(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + async def post_activate_online_evaluator(self, response): + logging.log(f"Received response: {response}") + return response + + async def pre_create_online_evaluator(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + async def post_create_online_evaluator(self, response): + logging.log(f"Received response: {response}") + return response + + async def pre_delete_online_evaluator(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + async def post_delete_online_evaluator(self, response): + logging.log(f"Received response: {response}") + return response + + async def pre_get_online_evaluator(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + async def post_get_online_evaluator(self, response): + logging.log(f"Received response: {response}") + return response + + async def pre_list_online_evaluators(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + async def post_list_online_evaluators(self, response): + logging.log(f"Received response: {response}") + return response + + async def pre_suspend_online_evaluator(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + async def post_suspend_online_evaluator(self, response): + logging.log(f"Received response: {response}") + return response + + async def pre_update_online_evaluator(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + async def post_update_online_evaluator(self, response): + logging.log(f"Received response: {response}") + return response + + transport = AsyncOnlineEvaluatorServiceRestTransport(interceptor=MyCustomOnlineEvaluatorServiceInterceptor()) + client = async OnlineEvaluatorServiceClient(transport=transport) + + + """ + + async def pre_activate_online_evaluator( + self, + request: online_evaluator_service.ActivateOnlineEvaluatorRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator_service.ActivateOnlineEvaluatorRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for activate_online_evaluator + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_activate_online_evaluator( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for activate_online_evaluator + + DEPRECATED. Please use the `post_activate_online_evaluator_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. This `post_activate_online_evaluator` interceptor runs + before the `post_activate_online_evaluator_with_metadata` interceptor. + """ + return response + + async def post_activate_online_evaluator_with_metadata( + self, + response: operations_pb2.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for activate_online_evaluator + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the OnlineEvaluatorService server but before it is returned to user code. + + We recommend only using this `post_activate_online_evaluator_with_metadata` + interceptor in new development instead of the `post_activate_online_evaluator` interceptor. + When both interceptors are used, this `post_activate_online_evaluator_with_metadata` interceptor runs after the + `post_activate_online_evaluator` interceptor. The (possibly modified) response returned by + `post_activate_online_evaluator` will be passed to + `post_activate_online_evaluator_with_metadata`. + """ + return response, metadata + + async def pre_create_online_evaluator( + self, + request: online_evaluator_service.CreateOnlineEvaluatorRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator_service.CreateOnlineEvaluatorRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for create_online_evaluator + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_create_online_evaluator( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for create_online_evaluator + + DEPRECATED. Please use the `post_create_online_evaluator_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. This `post_create_online_evaluator` interceptor runs + before the `post_create_online_evaluator_with_metadata` interceptor. + """ + return response + + async def post_create_online_evaluator_with_metadata( + self, + response: operations_pb2.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for create_online_evaluator + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the OnlineEvaluatorService server but before it is returned to user code. + + We recommend only using this `post_create_online_evaluator_with_metadata` + interceptor in new development instead of the `post_create_online_evaluator` interceptor. + When both interceptors are used, this `post_create_online_evaluator_with_metadata` interceptor runs after the + `post_create_online_evaluator` interceptor. The (possibly modified) response returned by + `post_create_online_evaluator` will be passed to + `post_create_online_evaluator_with_metadata`. + """ + return response, metadata + + async def pre_delete_online_evaluator( + self, + request: online_evaluator_service.DeleteOnlineEvaluatorRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator_service.DeleteOnlineEvaluatorRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for delete_online_evaluator + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_delete_online_evaluator( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for delete_online_evaluator + + DEPRECATED. Please use the `post_delete_online_evaluator_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. This `post_delete_online_evaluator` interceptor runs + before the `post_delete_online_evaluator_with_metadata` interceptor. + """ + return response + + async def post_delete_online_evaluator_with_metadata( + self, + response: operations_pb2.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for delete_online_evaluator + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the OnlineEvaluatorService server but before it is returned to user code. + + We recommend only using this `post_delete_online_evaluator_with_metadata` + interceptor in new development instead of the `post_delete_online_evaluator` interceptor. + When both interceptors are used, this `post_delete_online_evaluator_with_metadata` interceptor runs after the + `post_delete_online_evaluator` interceptor. The (possibly modified) response returned by + `post_delete_online_evaluator` will be passed to + `post_delete_online_evaluator_with_metadata`. + """ + return response, metadata + + async def pre_get_online_evaluator( + self, + request: online_evaluator_service.GetOnlineEvaluatorRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator_service.GetOnlineEvaluatorRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for get_online_evaluator + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_get_online_evaluator( + self, response: online_evaluator.OnlineEvaluator + ) -> online_evaluator.OnlineEvaluator: + """Post-rpc interceptor for get_online_evaluator + + DEPRECATED. Please use the `post_get_online_evaluator_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. This `post_get_online_evaluator` interceptor runs + before the `post_get_online_evaluator_with_metadata` interceptor. + """ + return response + + async def post_get_online_evaluator_with_metadata( + self, + response: online_evaluator.OnlineEvaluator, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator.OnlineEvaluator, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Post-rpc interceptor for get_online_evaluator + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the OnlineEvaluatorService server but before it is returned to user code. + + We recommend only using this `post_get_online_evaluator_with_metadata` + interceptor in new development instead of the `post_get_online_evaluator` interceptor. + When both interceptors are used, this `post_get_online_evaluator_with_metadata` interceptor runs after the + `post_get_online_evaluator` interceptor. The (possibly modified) response returned by + `post_get_online_evaluator` will be passed to + `post_get_online_evaluator_with_metadata`. + """ + return response, metadata + + async def pre_list_online_evaluators( + self, + request: online_evaluator_service.ListOnlineEvaluatorsRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator_service.ListOnlineEvaluatorsRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for list_online_evaluators + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_list_online_evaluators( + self, response: online_evaluator_service.ListOnlineEvaluatorsResponse + ) -> online_evaluator_service.ListOnlineEvaluatorsResponse: + """Post-rpc interceptor for list_online_evaluators + + DEPRECATED. Please use the `post_list_online_evaluators_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. This `post_list_online_evaluators` interceptor runs + before the `post_list_online_evaluators_with_metadata` interceptor. + """ + return response + + async def post_list_online_evaluators_with_metadata( + self, + response: online_evaluator_service.ListOnlineEvaluatorsResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator_service.ListOnlineEvaluatorsResponse, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Post-rpc interceptor for list_online_evaluators + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the OnlineEvaluatorService server but before it is returned to user code. + + We recommend only using this `post_list_online_evaluators_with_metadata` + interceptor in new development instead of the `post_list_online_evaluators` interceptor. + When both interceptors are used, this `post_list_online_evaluators_with_metadata` interceptor runs after the + `post_list_online_evaluators` interceptor. The (possibly modified) response returned by + `post_list_online_evaluators` will be passed to + `post_list_online_evaluators_with_metadata`. + """ + return response, metadata + + async def pre_suspend_online_evaluator( + self, + request: online_evaluator_service.SuspendOnlineEvaluatorRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator_service.SuspendOnlineEvaluatorRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for suspend_online_evaluator + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_suspend_online_evaluator( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for suspend_online_evaluator + + DEPRECATED. Please use the `post_suspend_online_evaluator_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. This `post_suspend_online_evaluator` interceptor runs + before the `post_suspend_online_evaluator_with_metadata` interceptor. + """ + return response + + async def post_suspend_online_evaluator_with_metadata( + self, + response: operations_pb2.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for suspend_online_evaluator + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the OnlineEvaluatorService server but before it is returned to user code. + + We recommend only using this `post_suspend_online_evaluator_with_metadata` + interceptor in new development instead of the `post_suspend_online_evaluator` interceptor. + When both interceptors are used, this `post_suspend_online_evaluator_with_metadata` interceptor runs after the + `post_suspend_online_evaluator` interceptor. The (possibly modified) response returned by + `post_suspend_online_evaluator` will be passed to + `post_suspend_online_evaluator_with_metadata`. + """ + return response, metadata + + async def pre_update_online_evaluator( + self, + request: online_evaluator_service.UpdateOnlineEvaluatorRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + online_evaluator_service.UpdateOnlineEvaluatorRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for update_online_evaluator + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_update_online_evaluator( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for update_online_evaluator + + DEPRECATED. Please use the `post_update_online_evaluator_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. This `post_update_online_evaluator` interceptor runs + before the `post_update_online_evaluator_with_metadata` interceptor. + """ + return response + + async def post_update_online_evaluator_with_metadata( + self, + response: operations_pb2.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for update_online_evaluator + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the OnlineEvaluatorService server but before it is returned to user code. + + We recommend only using this `post_update_online_evaluator_with_metadata` + interceptor in new development instead of the `post_update_online_evaluator` interceptor. + When both interceptors are used, this `post_update_online_evaluator_with_metadata` interceptor runs after the + `post_update_online_evaluator` interceptor. The (possibly modified) response returned by + `post_update_online_evaluator` will be passed to + `post_update_online_evaluator_with_metadata`. + """ + return response, metadata + + async def pre_get_location( + self, + request: locations_pb2.GetLocationRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + locations_pb2.GetLocationRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for get_location + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_get_location( + self, response: locations_pb2.Location + ) -> locations_pb2.Location: + """Post-rpc interceptor for get_location + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + async def pre_list_locations( + self, + request: locations_pb2.ListLocationsRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + locations_pb2.ListLocationsRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for list_locations + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_list_locations( + self, response: locations_pb2.ListLocationsResponse + ) -> locations_pb2.ListLocationsResponse: + """Post-rpc interceptor for list_locations + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + async def pre_get_iam_policy( + self, + request: iam_policy_pb2.GetIamPolicyRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + iam_policy_pb2.GetIamPolicyRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for get_iam_policy + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_get_iam_policy( + self, response: policy_pb2.Policy + ) -> policy_pb2.Policy: + """Post-rpc interceptor for get_iam_policy + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + async def pre_set_iam_policy( + self, + request: iam_policy_pb2.SetIamPolicyRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + iam_policy_pb2.SetIamPolicyRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for set_iam_policy + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_set_iam_policy( + self, response: policy_pb2.Policy + ) -> policy_pb2.Policy: + """Post-rpc interceptor for set_iam_policy + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + async def pre_test_iam_permissions( + self, + request: iam_policy_pb2.TestIamPermissionsRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + iam_policy_pb2.TestIamPermissionsRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for test_iam_permissions + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_test_iam_permissions( + self, response: iam_policy_pb2.TestIamPermissionsResponse + ) -> iam_policy_pb2.TestIamPermissionsResponse: + """Post-rpc interceptor for test_iam_permissions + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + async def pre_cancel_operation( + self, + request: operations_pb2.CancelOperationRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + operations_pb2.CancelOperationRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for cancel_operation + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_cancel_operation(self, response: None) -> None: + """Post-rpc interceptor for cancel_operation + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + async def pre_delete_operation( + self, + request: operations_pb2.DeleteOperationRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + operations_pb2.DeleteOperationRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for delete_operation + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_delete_operation(self, response: None) -> None: + """Post-rpc interceptor for delete_operation + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + async def pre_get_operation( + self, + request: operations_pb2.GetOperationRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + operations_pb2.GetOperationRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for get_operation + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_get_operation( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for get_operation + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + async def pre_list_operations( + self, + request: operations_pb2.ListOperationsRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + operations_pb2.ListOperationsRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for list_operations + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_list_operations( + self, response: operations_pb2.ListOperationsResponse + ) -> operations_pb2.ListOperationsResponse: + """Post-rpc interceptor for list_operations + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + async def pre_wait_operation( + self, + request: operations_pb2.WaitOperationRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + operations_pb2.WaitOperationRequest, Sequence[Tuple[str, Union[str, bytes]]] + ]: + """Pre-rpc interceptor for wait_operation + + Override in a subclass to manipulate the request or metadata + before they are sent to the OnlineEvaluatorService server. + """ + return request, metadata + + async def post_wait_operation( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for wait_operation + + Override in a subclass to manipulate the response + after it is returned by the OnlineEvaluatorService server but before + it is returned to user code. + """ + return response + + +@dataclasses.dataclass +class AsyncOnlineEvaluatorServiceRestStub: + _session: AsyncAuthorizedSession + _host: str + _interceptor: AsyncOnlineEvaluatorServiceRestInterceptor + + +class AsyncOnlineEvaluatorServiceRestTransport( + _BaseOnlineEvaluatorServiceRestTransport +): + """Asynchronous REST backend transport for OnlineEvaluatorService. + + This service is used to create and manage Vertex AI + OnlineEvaluators. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends JSON representations of protocol buffers over HTTP/1.1 + """ + + def __init__( + self, + *, + host: str = "aiplatform.googleapis.com", + credentials: Optional[ga_credentials_async.Credentials] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + url_scheme: str = "https", + interceptor: Optional[AsyncOnlineEvaluatorServiceRestInterceptor] = None, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to (default: 'aiplatform.googleapis.com'). + credentials (Optional[google.auth.aio.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you are developing + your own client library. + url_scheme (str): the protocol scheme for the API endpoint. Normally + "https", but for testing or local servers, + "http" can be specified. + """ + # Run the base constructor + super().__init__( + host=host, + credentials=credentials, + client_info=client_info, + always_use_jwt_access=False, + url_scheme=url_scheme, + api_audience=None, + ) + self._session = AsyncAuthorizedSession(self._credentials) # type: ignore + self._interceptor = interceptor or AsyncOnlineEvaluatorServiceRestInterceptor() + self._wrap_with_kind = True + self._prep_wrapped_messages(client_info) + self._operations_client: Optional[operations_v1.AsyncOperationsRestClient] = ( + None + ) + + def _prep_wrapped_messages(self, client_info): + """Precompute the wrapped methods, overriding the base class method to use async wrappers.""" + self._wrapped_methods = { + self.create_online_evaluator: self._wrap_method( + self.create_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.get_online_evaluator: self._wrap_method( + self.get_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.update_online_evaluator: self._wrap_method( + self.update_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.delete_online_evaluator: self._wrap_method( + self.delete_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.list_online_evaluators: self._wrap_method( + self.list_online_evaluators, + default_timeout=None, + client_info=client_info, + ), + self.activate_online_evaluator: self._wrap_method( + self.activate_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.suspend_online_evaluator: self._wrap_method( + self.suspend_online_evaluator, + default_timeout=None, + client_info=client_info, + ), + self.get_location: self._wrap_method( + self.get_location, + default_timeout=None, + client_info=client_info, + ), + self.list_locations: self._wrap_method( + self.list_locations, + default_timeout=None, + client_info=client_info, + ), + self.get_iam_policy: self._wrap_method( + self.get_iam_policy, + default_timeout=None, + client_info=client_info, + ), + self.set_iam_policy: self._wrap_method( + self.set_iam_policy, + default_timeout=None, + client_info=client_info, + ), + self.test_iam_permissions: self._wrap_method( + self.test_iam_permissions, + default_timeout=None, + client_info=client_info, + ), + self.cancel_operation: self._wrap_method( + self.cancel_operation, + default_timeout=None, + client_info=client_info, + ), + self.delete_operation: self._wrap_method( + self.delete_operation, + default_timeout=None, + client_info=client_info, + ), + self.get_operation: self._wrap_method( + self.get_operation, + default_timeout=None, + client_info=client_info, + ), + self.list_operations: self._wrap_method( + self.list_operations, + default_timeout=None, + client_info=client_info, + ), + self.wait_operation: self._wrap_method( + self.wait_operation, + default_timeout=None, + client_info=client_info, + ), + } + + def _wrap_method(self, func, *args, **kwargs): + if self._wrap_with_kind: # pragma: NO COVER + kwargs["kind"] = self.kind + return gapic_v1.method_async.wrap_method(func, *args, **kwargs) + + class _ActivateOnlineEvaluator( + _BaseOnlineEvaluatorServiceRestTransport._BaseActivateOnlineEvaluator, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncOnlineEvaluatorServiceRestTransport.ActivateOnlineEvaluator" + ) + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + async def __call__( + self, + request: online_evaluator_service.ActivateOnlineEvaluatorRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the activate online evaluator method over HTTP. + + Args: + request (~.online_evaluator_service.ActivateOnlineEvaluatorRequest): + The request object. Request message for + ActivateOnlineEvaluator. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.operations_pb2.Operation: + This resource represents a + long-running operation that is the + result of a network API call. + + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseActivateOnlineEvaluator._get_http_options() + ) + + request, metadata = await self._interceptor.pre_activate_online_evaluator( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseActivateOnlineEvaluator._get_transcoded_request( + http_options, request + ) + + body = _BaseOnlineEvaluatorServiceRestTransport._BaseActivateOnlineEvaluator._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseActivateOnlineEvaluator._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.ActivateOnlineEvaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "ActivateOnlineEvaluator", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._ActivateOnlineEvaluator._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + # Return the response + resp = operations_pb2.Operation() + pb_resp = resp + content = await response.read() + json_format.Parse(content, pb_resp, ignore_unknown_fields=True) + resp = await self._interceptor.post_activate_online_evaluator(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + await self._interceptor.post_activate_online_evaluator_with_metadata( + resp, response_metadata + ) + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": "OK", # need to obtain this properly + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.activate_online_evaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "ActivateOnlineEvaluator", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + + return resp + + class _CreateOnlineEvaluator( + _BaseOnlineEvaluatorServiceRestTransport._BaseCreateOnlineEvaluator, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncOnlineEvaluatorServiceRestTransport.CreateOnlineEvaluator" + ) + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + async def __call__( + self, + request: online_evaluator_service.CreateOnlineEvaluatorRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the create online evaluator method over HTTP. + + Args: + request (~.online_evaluator_service.CreateOnlineEvaluatorRequest): + The request object. Request message for + CreateOnlineEvaluator. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.operations_pb2.Operation: + This resource represents a + long-running operation that is the + result of a network API call. + + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseCreateOnlineEvaluator._get_http_options() + ) + + request, metadata = await self._interceptor.pre_create_online_evaluator( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseCreateOnlineEvaluator._get_transcoded_request( + http_options, request + ) + + body = _BaseOnlineEvaluatorServiceRestTransport._BaseCreateOnlineEvaluator._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseCreateOnlineEvaluator._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.CreateOnlineEvaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "CreateOnlineEvaluator", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._CreateOnlineEvaluator._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + # Return the response + resp = operations_pb2.Operation() + pb_resp = resp + content = await response.read() + json_format.Parse(content, pb_resp, ignore_unknown_fields=True) + resp = await self._interceptor.post_create_online_evaluator(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + await self._interceptor.post_create_online_evaluator_with_metadata( + resp, response_metadata + ) + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": "OK", # need to obtain this properly + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.create_online_evaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "CreateOnlineEvaluator", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + + return resp + + class _DeleteOnlineEvaluator( + _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOnlineEvaluator, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncOnlineEvaluatorServiceRestTransport.DeleteOnlineEvaluator" + ) + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + async def __call__( + self, + request: online_evaluator_service.DeleteOnlineEvaluatorRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the delete online evaluator method over HTTP. + + Args: + request (~.online_evaluator_service.DeleteOnlineEvaluatorRequest): + The request object. Request message for + DeleteOnlineEvaluator. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.operations_pb2.Operation: + This resource represents a + long-running operation that is the + result of a network API call. + + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOnlineEvaluator._get_http_options() + ) + + request, metadata = await self._interceptor.pre_delete_online_evaluator( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOnlineEvaluator._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOnlineEvaluator._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.DeleteOnlineEvaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "DeleteOnlineEvaluator", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._DeleteOnlineEvaluator._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + # Return the response + resp = operations_pb2.Operation() + pb_resp = resp + content = await response.read() + json_format.Parse(content, pb_resp, ignore_unknown_fields=True) + resp = await self._interceptor.post_delete_online_evaluator(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + await self._interceptor.post_delete_online_evaluator_with_metadata( + resp, response_metadata + ) + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": "OK", # need to obtain this properly + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.delete_online_evaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "DeleteOnlineEvaluator", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + + return resp + + class _GetOnlineEvaluator( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetOnlineEvaluator, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("AsyncOnlineEvaluatorServiceRestTransport.GetOnlineEvaluator") + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + async def __call__( + self, + request: online_evaluator_service.GetOnlineEvaluatorRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> online_evaluator.OnlineEvaluator: + r"""Call the get online evaluator method over HTTP. + + Args: + request (~.online_evaluator_service.GetOnlineEvaluatorRequest): + The request object. Request message for + GetOnlineEvaluator. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.online_evaluator.OnlineEvaluator: + An OnlineEvaluator contains the + configuration for an Online Evaluation. + + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetOnlineEvaluator._get_http_options() + ) + + request, metadata = await self._interceptor.pre_get_online_evaluator( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseGetOnlineEvaluator._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseGetOnlineEvaluator._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.GetOnlineEvaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "GetOnlineEvaluator", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._GetOnlineEvaluator._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + # Return the response + resp = online_evaluator.OnlineEvaluator() + pb_resp = online_evaluator.OnlineEvaluator.pb(resp) + content = await response.read() + json_format.Parse(content, pb_resp, ignore_unknown_fields=True) + resp = await self._interceptor.post_get_online_evaluator(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = await self._interceptor.post_get_online_evaluator_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = online_evaluator.OnlineEvaluator.to_json( + response + ) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": "OK", # need to obtain this properly + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.get_online_evaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "GetOnlineEvaluator", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + + return resp + + class _ListOnlineEvaluators( + _BaseOnlineEvaluatorServiceRestTransport._BaseListOnlineEvaluators, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("AsyncOnlineEvaluatorServiceRestTransport.ListOnlineEvaluators") + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + async def __call__( + self, + request: online_evaluator_service.ListOnlineEvaluatorsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> online_evaluator_service.ListOnlineEvaluatorsResponse: + r"""Call the list online evaluators method over HTTP. + + Args: + request (~.online_evaluator_service.ListOnlineEvaluatorsRequest): + The request object. Request message for + ListOnlineEvaluators. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.online_evaluator_service.ListOnlineEvaluatorsResponse: + Response message for + ListOnlineEvaluators. + + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseListOnlineEvaluators._get_http_options() + ) + + request, metadata = await self._interceptor.pre_list_online_evaluators( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseListOnlineEvaluators._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseListOnlineEvaluators._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.ListOnlineEvaluators", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "ListOnlineEvaluators", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._ListOnlineEvaluators._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + # Return the response + resp = online_evaluator_service.ListOnlineEvaluatorsResponse() + pb_resp = online_evaluator_service.ListOnlineEvaluatorsResponse.pb(resp) + content = await response.read() + json_format.Parse(content, pb_resp, ignore_unknown_fields=True) + resp = await self._interceptor.post_list_online_evaluators(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = await self._interceptor.post_list_online_evaluators_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = ( + online_evaluator_service.ListOnlineEvaluatorsResponse.to_json( + response + ) + ) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": "OK", # need to obtain this properly + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.list_online_evaluators", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "ListOnlineEvaluators", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + + return resp + + class _SuspendOnlineEvaluator( + _BaseOnlineEvaluatorServiceRestTransport._BaseSuspendOnlineEvaluator, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncOnlineEvaluatorServiceRestTransport.SuspendOnlineEvaluator" + ) + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + async def __call__( + self, + request: online_evaluator_service.SuspendOnlineEvaluatorRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the suspend online evaluator method over HTTP. + + Args: + request (~.online_evaluator_service.SuspendOnlineEvaluatorRequest): + The request object. Request message for + SuspendOnlineEvaluator. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.operations_pb2.Operation: + This resource represents a + long-running operation that is the + result of a network API call. + + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseSuspendOnlineEvaluator._get_http_options() + ) + + request, metadata = await self._interceptor.pre_suspend_online_evaluator( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseSuspendOnlineEvaluator._get_transcoded_request( + http_options, request + ) + + body = _BaseOnlineEvaluatorServiceRestTransport._BaseSuspendOnlineEvaluator._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseSuspendOnlineEvaluator._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.SuspendOnlineEvaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "SuspendOnlineEvaluator", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._SuspendOnlineEvaluator._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + # Return the response + resp = operations_pb2.Operation() + pb_resp = resp + content = await response.read() + json_format.Parse(content, pb_resp, ignore_unknown_fields=True) + resp = await self._interceptor.post_suspend_online_evaluator(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + await self._interceptor.post_suspend_online_evaluator_with_metadata( + resp, response_metadata + ) + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": "OK", # need to obtain this properly + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.suspend_online_evaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "SuspendOnlineEvaluator", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + + return resp + + class _UpdateOnlineEvaluator( + _BaseOnlineEvaluatorServiceRestTransport._BaseUpdateOnlineEvaluator, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncOnlineEvaluatorServiceRestTransport.UpdateOnlineEvaluator" + ) + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + async def __call__( + self, + request: online_evaluator_service.UpdateOnlineEvaluatorRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the update online evaluator method over HTTP. + + Args: + request (~.online_evaluator_service.UpdateOnlineEvaluatorRequest): + The request object. Request message for + UpdateOnlineEvaluator. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.operations_pb2.Operation: + This resource represents a + long-running operation that is the + result of a network API call. + + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseUpdateOnlineEvaluator._get_http_options() + ) + + request, metadata = await self._interceptor.pre_update_online_evaluator( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseUpdateOnlineEvaluator._get_transcoded_request( + http_options, request + ) + + body = _BaseOnlineEvaluatorServiceRestTransport._BaseUpdateOnlineEvaluator._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseUpdateOnlineEvaluator._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.UpdateOnlineEvaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "UpdateOnlineEvaluator", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._UpdateOnlineEvaluator._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + # Return the response + resp = operations_pb2.Operation() + pb_resp = resp + content = await response.read() + json_format.Parse(content, pb_resp, ignore_unknown_fields=True) + resp = await self._interceptor.post_update_online_evaluator(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + await self._interceptor.post_update_online_evaluator_with_metadata( + resp, response_metadata + ) + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": "OK", # need to obtain this properly + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.update_online_evaluator", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "UpdateOnlineEvaluator", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + + return resp + + @property + def operations_client(self) -> AsyncOperationsRestClient: + """Create the async client designed to process long-running operations. + + This property caches on the instance; repeated calls return the same + client. + """ + # Only create a new client if we do not already have one. + if self._operations_client is None: + http_options: Dict[str, List[Dict[str, str]]] = { + "google.longrunning.Operations.CancelOperation": [ + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, + ], + "google.longrunning.Operations.DeleteOperation": [ + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, + ], + "google.longrunning.Operations.GetOperation": [ + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, + ], + "google.longrunning.Operations.ListOperations": [ + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/agents/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/apps/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/schedules/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, + ], + "google.longrunning.Operations.WaitOperation": [ + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, + ], + } + + rest_transport = operations_v1.AsyncOperationsRestTransport( # type: ignore + host=self._host, + # use the credentials which are saved + credentials=self._credentials, # type: ignore + http_options=http_options, + path_prefix="v1beta1", + ) + + self._operations_client = AsyncOperationsRestClient( + transport=rest_transport + ) + + # Return the client from cache. + return self._operations_client + + @property + def activate_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.ActivateOnlineEvaluatorRequest], + operations_pb2.Operation, + ]: + return self._ActivateOnlineEvaluator(self._session, self._host, self._interceptor) # type: ignore + + @property + def create_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.CreateOnlineEvaluatorRequest], + operations_pb2.Operation, + ]: + return self._CreateOnlineEvaluator(self._session, self._host, self._interceptor) # type: ignore + + @property + def delete_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.DeleteOnlineEvaluatorRequest], + operations_pb2.Operation, + ]: + return self._DeleteOnlineEvaluator(self._session, self._host, self._interceptor) # type: ignore + + @property + def get_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.GetOnlineEvaluatorRequest], + online_evaluator.OnlineEvaluator, + ]: + return self._GetOnlineEvaluator(self._session, self._host, self._interceptor) # type: ignore + + @property + def list_online_evaluators( + self, + ) -> Callable[ + [online_evaluator_service.ListOnlineEvaluatorsRequest], + online_evaluator_service.ListOnlineEvaluatorsResponse, + ]: + return self._ListOnlineEvaluators(self._session, self._host, self._interceptor) # type: ignore + + @property + def suspend_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.SuspendOnlineEvaluatorRequest], + operations_pb2.Operation, + ]: + return self._SuspendOnlineEvaluator(self._session, self._host, self._interceptor) # type: ignore + + @property + def update_online_evaluator( + self, + ) -> Callable[ + [online_evaluator_service.UpdateOnlineEvaluatorRequest], + operations_pb2.Operation, + ]: + return self._UpdateOnlineEvaluator(self._session, self._host, self._interceptor) # type: ignore + + @property + def get_location(self): + return self._GetLocation(self._session, self._host, self._interceptor) # type: ignore + + class _GetLocation( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetLocation, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("AsyncOnlineEvaluatorServiceRestTransport.GetLocation") + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + async def __call__( + self, + request: locations_pb2.GetLocationRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> locations_pb2.Location: + r"""Call the get location method over HTTP. + + Args: + request (locations_pb2.GetLocationRequest): + The request object for GetLocation method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + locations_pb2.Location: Response from GetLocation method. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetLocation._get_http_options() + ) + + request, metadata = await self._interceptor.pre_get_location( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseGetLocation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseGetLocation._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.GetLocation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "GetLocation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._GetLocation._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + content = await response.read() + resp = locations_pb2.Location() + resp = json_format.Parse(content, resp) + resp = await self._interceptor.post_get_location(resp) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.GetLocation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "GetLocation", + "httpResponse": http_response, + "metadata": http_response["headers"], + }, + ) + return resp + + @property + def list_locations(self): + return self._ListLocations(self._session, self._host, self._interceptor) # type: ignore + + class _ListLocations( + _BaseOnlineEvaluatorServiceRestTransport._BaseListLocations, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("AsyncOnlineEvaluatorServiceRestTransport.ListLocations") + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + async def __call__( + self, + request: locations_pb2.ListLocationsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> locations_pb2.ListLocationsResponse: + r"""Call the list locations method over HTTP. + + Args: + request (locations_pb2.ListLocationsRequest): + The request object for ListLocations method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + locations_pb2.ListLocationsResponse: Response from ListLocations method. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseListLocations._get_http_options() + ) + + request, metadata = await self._interceptor.pre_list_locations( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseListLocations._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseListLocations._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.ListLocations", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "ListLocations", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._ListLocations._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + content = await response.read() + resp = locations_pb2.ListLocationsResponse() + resp = json_format.Parse(content, resp) + resp = await self._interceptor.post_list_locations(resp) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.ListLocations", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "ListLocations", + "httpResponse": http_response, + "metadata": http_response["headers"], + }, + ) + return resp + + @property + def get_iam_policy(self): + return self._GetIamPolicy(self._session, self._host, self._interceptor) # type: ignore + + class _GetIamPolicy( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetIamPolicy, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("AsyncOnlineEvaluatorServiceRestTransport.GetIamPolicy") + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + async def __call__( + self, + request: iam_policy_pb2.GetIamPolicyRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> policy_pb2.Policy: + r"""Call the get iam policy method over HTTP. + + Args: + request (iam_policy_pb2.GetIamPolicyRequest): + The request object for GetIamPolicy method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + policy_pb2.Policy: Response from GetIamPolicy method. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetIamPolicy._get_http_options() + ) + + request, metadata = await self._interceptor.pre_get_iam_policy( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseGetIamPolicy._get_transcoded_request( + http_options, request + ) + + body = _BaseOnlineEvaluatorServiceRestTransport._BaseGetIamPolicy._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseGetIamPolicy._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.GetIamPolicy", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "GetIamPolicy", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._GetIamPolicy._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + content = await response.read() + resp = policy_pb2.Policy() + resp = json_format.Parse(content, resp) + resp = await self._interceptor.post_get_iam_policy(resp) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.GetIamPolicy", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "GetIamPolicy", + "httpResponse": http_response, + "metadata": http_response["headers"], + }, + ) + return resp + + @property + def set_iam_policy(self): + return self._SetIamPolicy(self._session, self._host, self._interceptor) # type: ignore + + class _SetIamPolicy( + _BaseOnlineEvaluatorServiceRestTransport._BaseSetIamPolicy, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("AsyncOnlineEvaluatorServiceRestTransport.SetIamPolicy") + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + async def __call__( + self, + request: iam_policy_pb2.SetIamPolicyRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> policy_pb2.Policy: + r"""Call the set iam policy method over HTTP. + + Args: + request (iam_policy_pb2.SetIamPolicyRequest): + The request object for SetIamPolicy method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + policy_pb2.Policy: Response from SetIamPolicy method. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseSetIamPolicy._get_http_options() + ) + + request, metadata = await self._interceptor.pre_set_iam_policy( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseSetIamPolicy._get_transcoded_request( + http_options, request + ) + + body = _BaseOnlineEvaluatorServiceRestTransport._BaseSetIamPolicy._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseSetIamPolicy._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.SetIamPolicy", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "SetIamPolicy", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._SetIamPolicy._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + content = await response.read() + resp = policy_pb2.Policy() + resp = json_format.Parse(content, resp) + resp = await self._interceptor.post_set_iam_policy(resp) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.SetIamPolicy", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "SetIamPolicy", + "httpResponse": http_response, + "metadata": http_response["headers"], + }, + ) + return resp + + @property + def test_iam_permissions(self): + return self._TestIamPermissions(self._session, self._host, self._interceptor) # type: ignore + + class _TestIamPermissions( + _BaseOnlineEvaluatorServiceRestTransport._BaseTestIamPermissions, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("AsyncOnlineEvaluatorServiceRestTransport.TestIamPermissions") + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + async def __call__( + self, + request: iam_policy_pb2.TestIamPermissionsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> iam_policy_pb2.TestIamPermissionsResponse: + r"""Call the test iam permissions method over HTTP. + + Args: + request (iam_policy_pb2.TestIamPermissionsRequest): + The request object for TestIamPermissions method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + iam_policy_pb2.TestIamPermissionsResponse: Response from TestIamPermissions method. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseTestIamPermissions._get_http_options() + ) + + request, metadata = await self._interceptor.pre_test_iam_permissions( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseTestIamPermissions._get_transcoded_request( + http_options, request + ) + + body = _BaseOnlineEvaluatorServiceRestTransport._BaseTestIamPermissions._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseTestIamPermissions._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.TestIamPermissions", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "TestIamPermissions", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._TestIamPermissions._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + content = await response.read() + resp = iam_policy_pb2.TestIamPermissionsResponse() + resp = json_format.Parse(content, resp) + resp = await self._interceptor.post_test_iam_permissions(resp) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.TestIamPermissions", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "TestIamPermissions", + "httpResponse": http_response, + "metadata": http_response["headers"], + }, + ) + return resp + + @property + def cancel_operation(self): + return self._CancelOperation(self._session, self._host, self._interceptor) # type: ignore + + class _CancelOperation( + _BaseOnlineEvaluatorServiceRestTransport._BaseCancelOperation, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("AsyncOnlineEvaluatorServiceRestTransport.CancelOperation") + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + async def __call__( + self, + request: operations_pb2.CancelOperationRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> None: + r"""Call the cancel operation method over HTTP. + + Args: + request (operations_pb2.CancelOperationRequest): + The request object for CancelOperation method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseCancelOperation._get_http_options() + ) + + request, metadata = await self._interceptor.pre_cancel_operation( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseCancelOperation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseCancelOperation._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.CancelOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "CancelOperation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._CancelOperation._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + return await self._interceptor.post_cancel_operation(None) + + @property + def delete_operation(self): + return self._DeleteOperation(self._session, self._host, self._interceptor) # type: ignore + + class _DeleteOperation( + _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOperation, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("AsyncOnlineEvaluatorServiceRestTransport.DeleteOperation") + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + async def __call__( + self, + request: operations_pb2.DeleteOperationRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> None: + r"""Call the delete operation method over HTTP. + + Args: + request (operations_pb2.DeleteOperationRequest): + The request object for DeleteOperation method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOperation._get_http_options() + ) + + request, metadata = await self._interceptor.pre_delete_operation( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOperation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOperation._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.DeleteOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "DeleteOperation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._DeleteOperation._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + return await self._interceptor.post_delete_operation(None) + + @property + def get_operation(self): + return self._GetOperation(self._session, self._host, self._interceptor) # type: ignore + + class _GetOperation( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetOperation, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("AsyncOnlineEvaluatorServiceRestTransport.GetOperation") + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + async def __call__( + self, + request: operations_pb2.GetOperationRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the get operation method over HTTP. + + Args: + request (operations_pb2.GetOperationRequest): + The request object for GetOperation method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + operations_pb2.Operation: Response from GetOperation method. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetOperation._get_http_options() + ) + + request, metadata = await self._interceptor.pre_get_operation( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseGetOperation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseGetOperation._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.GetOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "GetOperation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._GetOperation._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + content = await response.read() + resp = operations_pb2.Operation() + resp = json_format.Parse(content, resp) + resp = await self._interceptor.post_get_operation(resp) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.GetOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "GetOperation", + "httpResponse": http_response, + "metadata": http_response["headers"], + }, + ) + return resp + + @property + def list_operations(self): + return self._ListOperations(self._session, self._host, self._interceptor) # type: ignore + + class _ListOperations( + _BaseOnlineEvaluatorServiceRestTransport._BaseListOperations, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("AsyncOnlineEvaluatorServiceRestTransport.ListOperations") + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + async def __call__( + self, + request: operations_pb2.ListOperationsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.ListOperationsResponse: + r"""Call the list operations method over HTTP. + + Args: + request (operations_pb2.ListOperationsRequest): + The request object for ListOperations method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + operations_pb2.ListOperationsResponse: Response from ListOperations method. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseListOperations._get_http_options() + ) + + request, metadata = await self._interceptor.pre_list_operations( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseListOperations._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseListOperations._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.ListOperations", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "ListOperations", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._ListOperations._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + content = await response.read() + resp = operations_pb2.ListOperationsResponse() + resp = json_format.Parse(content, resp) + resp = await self._interceptor.post_list_operations(resp) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.ListOperations", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "ListOperations", + "httpResponse": http_response, + "metadata": http_response["headers"], + }, + ) + return resp + + @property + def wait_operation(self): + return self._WaitOperation(self._session, self._host, self._interceptor) # type: ignore + + class _WaitOperation( + _BaseOnlineEvaluatorServiceRestTransport._BaseWaitOperation, + AsyncOnlineEvaluatorServiceRestStub, + ): + def __hash__(self): + return hash("AsyncOnlineEvaluatorServiceRestTransport.WaitOperation") + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + ) + return response + + async def __call__( + self, + request: operations_pb2.WaitOperationRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the wait operation method over HTTP. + + Args: + request (operations_pb2.WaitOperationRequest): + The request object for WaitOperation method. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + operations_pb2.Operation: Response from WaitOperation method. + """ + + http_options = ( + _BaseOnlineEvaluatorServiceRestTransport._BaseWaitOperation._get_http_options() + ) + + request, metadata = await self._interceptor.pre_wait_operation( + request, metadata + ) + transcoded_request = _BaseOnlineEvaluatorServiceRestTransport._BaseWaitOperation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseOnlineEvaluatorServiceRestTransport._BaseWaitOperation._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = json_format.MessageToJson(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.WaitOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "WaitOperation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncOnlineEvaluatorServiceRestTransport._WaitOperation._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + content = await response.read() + resp = operations_pb2.Operation() + resp = json_format.Parse(content, resp) + resp = await self._interceptor.post_wait_operation(resp) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.WaitOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "rpcName": "WaitOperation", + "httpResponse": http_response, + "metadata": http_response["headers"], + }, + ) + return resp + + @property + def kind(self) -> str: + return "rest_asyncio" + + async def close(self): + await self._session.close() diff --git a/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/rest_base.py new file mode 100644 index 0000000000..8d6c3b19c6 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/rest_base.py @@ -0,0 +1,3106 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import json # type: ignore +from google.api_core import path_template +from google.api_core import gapic_v1 + +from google.protobuf import json_format +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.cloud.location import locations_pb2 # type: ignore +from .base import OnlineEvaluatorServiceTransport, DEFAULT_CLIENT_INFO + +import re +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union + + +from google.cloud.aiplatform_v1beta1.types import online_evaluator +from google.cloud.aiplatform_v1beta1.types import online_evaluator_service +from google.longrunning import operations_pb2 # type: ignore + + +class _BaseOnlineEvaluatorServiceRestTransport(OnlineEvaluatorServiceTransport): + """Base REST backend transport for OnlineEvaluatorService. + + Note: This class is not meant to be used directly. Use its sync and + async sub-classes instead. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends JSON representations of protocol buffers over HTTP/1.1 + """ + + def __init__( + self, + *, + host: str = "aiplatform.googleapis.com", + credentials: Optional[Any] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + url_scheme: str = "https", + api_audience: Optional[str] = None, + ) -> None: + """Instantiate the transport. + Args: + host (Optional[str]): + The hostname to connect to (default: 'aiplatform.googleapis.com'). + credentials (Optional[Any]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you are developing + your own client library. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + url_scheme: the protocol scheme for the API endpoint. Normally + "https", but for testing or local servers, + "http" can be specified. + """ + # Run the base constructor + maybe_url_match = re.match("^(?Phttp(?:s)?://)?(?P.*)$", host) + if maybe_url_match is None: + raise ValueError( + f"Unexpected hostname structure: {host}" + ) # pragma: NO COVER + + url_match_items = maybe_url_match.groupdict() + + host = f"{url_scheme}://{host}" if not url_match_items["scheme"] else host + + super().__init__( + host=host, + credentials=credentials, + client_info=client_info, + always_use_jwt_access=always_use_jwt_access, + api_audience=api_audience, + ) + + class _BaseActivateOnlineEvaluator: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}:activate", + "body": "*", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = online_evaluator_service.ActivateOnlineEvaluatorRequest.pb( + request + ) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=True + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=True, + ) + ) + query_params.update( + _BaseOnlineEvaluatorServiceRestTransport._BaseActivateOnlineEvaluator._get_unset_required_fields( + query_params + ) + ) + + query_params["$alt"] = "json;enum-encoding=int" + return query_params + + class _BaseCreateOnlineEvaluator: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/v1beta1/{parent=projects/*/locations/*}/onlineEvaluators", + "body": "online_evaluator", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = online_evaluator_service.CreateOnlineEvaluatorRequest.pb( + request + ) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=True + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=True, + ) + ) + query_params.update( + _BaseOnlineEvaluatorServiceRestTransport._BaseCreateOnlineEvaluator._get_unset_required_fields( + query_params + ) + ) + + query_params["$alt"] = "json;enum-encoding=int" + return query_params + + class _BaseDeleteOnlineEvaluator: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = online_evaluator_service.DeleteOnlineEvaluatorRequest.pb( + request + ) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=True, + ) + ) + query_params.update( + _BaseOnlineEvaluatorServiceRestTransport._BaseDeleteOnlineEvaluator._get_unset_required_fields( + query_params + ) + ) + + query_params["$alt"] = "json;enum-encoding=int" + return query_params + + class _BaseGetOnlineEvaluator: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = online_evaluator_service.GetOnlineEvaluatorRequest.pb(request) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=True, + ) + ) + query_params.update( + _BaseOnlineEvaluatorServiceRestTransport._BaseGetOnlineEvaluator._get_unset_required_fields( + query_params + ) + ) + + query_params["$alt"] = "json;enum-encoding=int" + return query_params + + class _BaseListOnlineEvaluators: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/v1beta1/{parent=projects/*/locations/*}/onlineEvaluators", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = online_evaluator_service.ListOnlineEvaluatorsRequest.pb( + request + ) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=True, + ) + ) + query_params.update( + _BaseOnlineEvaluatorServiceRestTransport._BaseListOnlineEvaluators._get_unset_required_fields( + query_params + ) + ) + + query_params["$alt"] = "json;enum-encoding=int" + return query_params + + class _BaseSuspendOnlineEvaluator: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}:suspend", + "body": "*", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = online_evaluator_service.SuspendOnlineEvaluatorRequest.pb( + request + ) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=True + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=True, + ) + ) + query_params.update( + _BaseOnlineEvaluatorServiceRestTransport._BaseSuspendOnlineEvaluator._get_unset_required_fields( + query_params + ) + ) + + query_params["$alt"] = "json;enum-encoding=int" + return query_params + + class _BaseUpdateOnlineEvaluator: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "patch", + "uri": "/v1beta1/{online_evaluator.name=projects/*/locations/*/onlineEvaluators/*}", + "body": "online_evaluator", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = online_evaluator_service.UpdateOnlineEvaluatorRequest.pb( + request + ) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=True + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=True, + ) + ) + query_params.update( + _BaseOnlineEvaluatorServiceRestTransport._BaseUpdateOnlineEvaluator._get_unset_required_fields( + query_params + ) + ) + + query_params["$alt"] = "json;enum-encoding=int" + return query_params + + class _BaseGetLocation: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*}", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + request_kwargs = json_format.MessageToDict(request) + transcoded_request = path_template.transcode(http_options, **request_kwargs) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads(json.dumps(transcoded_request["query_params"])) + return query_params + + class _BaseListLocations: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/ui/{name=projects/*}/locations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*}/locations", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + request_kwargs = json_format.MessageToDict(request) + transcoded_request = path_template.transcode(http_options, **request_kwargs) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads(json.dumps(transcoded_request["query_params"])) + return query_params + + class _BaseGetIamPolicy: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy", + "body": "*", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/publishers/*/models/*}:getIamPolicy", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/publishers/*/models/*}:getIamPolicy", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + request_kwargs = json_format.MessageToDict(request) + transcoded_request = path_template.transcode(http_options, **request_kwargs) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + body = json.dumps(transcoded_request["body"]) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads(json.dumps(transcoded_request["query_params"])) + return query_params + + class _BaseSetIamPolicy: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy", + "body": "*", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy", + "body": "*", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy", + "body": "*", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy", + "body": "*", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy", + "body": "*", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy", + "body": "*", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy", + "body": "*", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy", + "body": "*", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy", + "body": "*", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy", + "body": "*", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy", + "body": "*", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy", + "body": "*", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy", + "body": "*", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy", + "body": "*", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy", + "body": "*", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy", + "body": "*", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + request_kwargs = json_format.MessageToDict(request) + transcoded_request = path_template.transcode(http_options, **request_kwargs) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + body = json.dumps(transcoded_request["body"]) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads(json.dumps(transcoded_request["query_params"])) + return query_params + + class _BaseTestIamPermissions: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions", + "body": "*", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions", + }, + { + "method": "post", + "uri": "/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions", + }, + { + "method": "post", + "uri": "/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + request_kwargs = json_format.MessageToDict(request) + transcoded_request = path_template.transcode(http_options, **request_kwargs) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + body = json.dumps(transcoded_request["body"]) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads(json.dumps(transcoded_request["query_params"])) + return query_params + + class _BaseCancelOperation: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + request_kwargs = json_format.MessageToDict(request) + transcoded_request = path_template.transcode(http_options, **request_kwargs) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads(json.dumps(transcoded_request["query_params"])) + return query_params + + class _BaseDeleteOperation: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + request_kwargs = json_format.MessageToDict(request) + transcoded_request = path_template.transcode(http_options, **request_kwargs) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads(json.dumps(transcoded_request["query_params"])) + return query_params + + class _BaseGetOperation: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + request_kwargs = json_format.MessageToDict(request) + transcoded_request = path_template.transcode(http_options, **request_kwargs) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads(json.dumps(transcoded_request["query_params"])) + return query_params + + class _BaseListOperations: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/agents/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/apps/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/schedules/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + request_kwargs = json_format.MessageToDict(request) + transcoded_request = path_template.transcode(http_options, **request_kwargs) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads(json.dumps(transcoded_request["query_params"])) + return query_params + + class _BaseWaitOperation: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + request_kwargs = json_format.MessageToDict(request) + transcoded_request = path_template.transcode(http_options, **request_kwargs) + return transcoded_request + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads(json.dumps(transcoded_request["query_params"])) + return query_params + + +__all__ = ("_BaseOnlineEvaluatorServiceRestTransport",) diff --git a/google/cloud/aiplatform_v1beta1/services/persistent_resource_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/persistent_resource_service/transports/rest.py index 28da0fe14c..7ac71606e9 100644 --- a/google/cloud/aiplatform_v1beta1/services/persistent_resource_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/persistent_resource_service/transports/rest.py @@ -1103,6 +1103,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1171,6 +1175,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1513,6 +1521,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1605,6 +1617,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -1955,6 +1971,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2047,6 +2067,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2393,6 +2417,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2485,6 +2513,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -2831,6 +2863,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2919,6 +2955,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/persistent_resource_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/persistent_resource_service/transports/rest_asyncio.py index 602d762c10..74ed997973 100644 --- a/google/cloud/aiplatform_v1beta1/services/persistent_resource_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/persistent_resource_service/transports/rest_asyncio.py @@ -2193,6 +2193,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2261,6 +2265,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2603,6 +2611,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2695,6 +2707,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -3045,6 +3061,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3137,6 +3157,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3483,6 +3507,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3575,6 +3603,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3921,6 +3953,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -4009,6 +4045,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/persistent_resource_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/persistent_resource_service/transports/rest_base.py index ca90d3284d..1df91b54bb 100644 --- a/google/cloud/aiplatform_v1beta1/services/persistent_resource_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/persistent_resource_service/transports/rest_base.py @@ -1103,6 +1103,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1171,6 +1175,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1532,6 +1540,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1624,6 +1636,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -1993,6 +2009,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2085,6 +2105,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2450,6 +2474,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2542,6 +2570,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2907,6 +2939,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2995,6 +3031,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/rest.py index c9cb039137..515b4df879 100644 --- a/google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/rest.py @@ -1379,6 +1379,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1447,6 +1451,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1789,6 +1797,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1881,6 +1893,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2231,6 +2247,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2323,6 +2343,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2669,6 +2693,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2761,6 +2789,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3107,6 +3139,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3195,6 +3231,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/rest_asyncio.py index 37c8b6b631..e19bf212a9 100644 --- a/google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/rest_asyncio.py @@ -3372,6 +3372,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -3440,6 +3444,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -3782,6 +3790,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3874,6 +3886,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -4224,6 +4240,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -4316,6 +4336,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -4662,6 +4686,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -4754,6 +4782,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -5100,6 +5132,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -5188,6 +5224,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/rest_base.py index 51cd6b039f..8dc0021234 100644 --- a/google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/rest_base.py @@ -1405,6 +1405,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1473,6 +1477,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1834,6 +1842,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1926,6 +1938,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2295,6 +2311,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2387,6 +2407,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2752,6 +2776,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2844,6 +2872,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -3209,6 +3241,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3297,6 +3333,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/prediction_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/prediction_service/transports/rest_base.py index a8c2990820..1824e3afe0 100644 --- a/google/cloud/aiplatform_v1beta1/services/prediction_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/prediction_service/transports/rest_base.py @@ -1525,6 +1525,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1593,6 +1597,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1954,6 +1962,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2046,6 +2058,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2415,6 +2431,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2507,6 +2527,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2872,6 +2896,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2964,6 +2992,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -3329,6 +3361,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3417,6 +3453,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/async_client.py index fa9e8ac3e6..ee9ebbf6fd 100644 --- a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/async_client.py @@ -53,6 +53,8 @@ from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore +import google.api_core.operation as operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore import google.protobuf.any_pb2 as any_pb2 # type: ignore import google.protobuf.struct_pb2 as struct_pb2 # type: ignore from .transports.base import ( @@ -561,6 +563,117 @@ async def sample_stream_query_reasoning_engine(): # Done; return the response. return response + async def async_query_reasoning_engine( + self, + request: Optional[ + Union[ + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + dict, + ] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation_async.AsyncOperation: + r"""Async query using a reasoning engine. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + async def sample_async_query_reasoning_engine(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineExecutionServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.AsyncQueryReasoningEngineRequest( + name="name_value", + ) + + # Make the request + operation = client.async_query_reasoning_engine(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.cloud.aiplatform_v1beta1.types.AsyncQueryReasoningEngineRequest, dict]]): + The request object. Request message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.aiplatform_v1beta1.types.AsyncQueryReasoningEngineResponse` Response message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + + """ + # Create or coerce a protobuf request object. + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest + ): + request = ( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest( + request + ) + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._client._transport._wrapped_methods[ + self._client._transport.async_query_reasoning_engine + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + reasoning_engine_execution_service.AsyncQueryReasoningEngineResponse, + metadata_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineOperationMetadata, + ) + + # Done; return the response. + return response + async def list_operations( self, request: Optional[operations_pb2.ListOperationsRequest] = None, diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/client.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/client.py index b20f9a12b6..b29135e3e4 100644 --- a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/client.py @@ -68,6 +68,8 @@ from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore +import google.api_core.operation as operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore import google.protobuf.any_pb2 as any_pb2 # type: ignore import google.protobuf.struct_pb2 as struct_pb2 # type: ignore from .transports.base import ( @@ -1038,6 +1040,117 @@ def sample_stream_query_reasoning_engine(): # Done; return the response. return response + def async_query_reasoning_engine( + self, + request: Optional[ + Union[ + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + dict, + ] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operation.Operation: + r"""Async query using a reasoning engine. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1beta1 + + def sample_async_query_reasoning_engine(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineExecutionServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.AsyncQueryReasoningEngineRequest( + name="name_value", + ) + + # Make the request + operation = client.async_query_reasoning_engine(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.AsyncQueryReasoningEngineRequest, dict]): + The request object. Request message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.aiplatform_v1beta1.types.AsyncQueryReasoningEngineResponse` Response message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + + """ + # Create or coerce a protobuf request object. + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance( + request, reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest + ): + request = ( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest( + request + ) + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.async_query_reasoning_engine + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + reasoning_engine_execution_service.AsyncQueryReasoningEngineResponse, + metadata_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineOperationMetadata, + ) + + # Done; return the response. + return response + def __enter__(self) -> "ReasoningEngineExecutionServiceClient": return self diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/base.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/base.py index 8957a813d5..c9ac9c62bf 100644 --- a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/base.py +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/base.py @@ -23,6 +23,7 @@ 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 operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore import google.protobuf @@ -152,6 +153,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.async_query_reasoning_engine: gapic_v1.method.wrap_method( + self.async_query_reasoning_engine, + default_timeout=None, + client_info=client_info, + ), self.get_location: gapic_v1.method.wrap_method( self.get_location, default_timeout=None, @@ -213,6 +219,11 @@ def close(self): """ raise NotImplementedError() + @property + def operations_client(self): + """Return the client designed to process long-running operations.""" + raise NotImplementedError() + @property def query_reasoning_engine( self, @@ -234,6 +245,15 @@ def stream_query_reasoning_engine( ]: raise NotImplementedError() + @property + def async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + @property def list_operations( self, diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/grpc.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/grpc.py index c7dc217df7..36c16e5125 100644 --- a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/grpc.py +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/grpc.py @@ -20,6 +20,7 @@ from typing import Callable, Dict, Optional, Sequence, Tuple, Union from google.api_core import grpc_helpers +from google.api_core import operations_v1 from google.api_core import gapic_v1 import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore @@ -202,6 +203,7 @@ def __init__( self._grpc_channel = None self._ssl_channel_credentials = ssl_channel_credentials self._stubs: Dict[str, Callable] = {} + self._operations_client: Optional[operations_v1.OperationsClient] = None if api_mtls_endpoint: warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) @@ -329,6 +331,22 @@ def grpc_channel(self) -> grpc.Channel: """Return the channel designed to connect to this service.""" return self._grpc_channel + @property + def operations_client(self) -> operations_v1.OperationsClient: + """Create the client designed to process long-running operations. + + This property caches on the instance; repeated calls return the same + client. + """ + # Quick check: Only create a new client if we do not already have one. + if self._operations_client is None: + self._operations_client = operations_v1.OperationsClient( + self._logged_channel + ) + + # Return the client from cache. + return self._operations_client + @property def query_reasoning_engine( self, @@ -389,6 +407,37 @@ def stream_query_reasoning_engine( ) return self._stubs["stream_query_reasoning_engine"] + @property + def async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest], + operations_pb2.Operation, + ]: + r"""Return a callable for the async query reasoning engine method over gRPC. + + Async query using a reasoning engine. + + Returns: + Callable[[~.AsyncQueryReasoningEngineRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "async_query_reasoning_engine" not in self._stubs: + self._stubs["async_query_reasoning_engine"] = ( + self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService/AsyncQueryReasoningEngine", + request_serializer=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + ) + return self._stubs["async_query_reasoning_engine"] + def close(self): self._logged_channel.close() diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/grpc_asyncio.py index 3e1b4e9b92..ba885de8de 100644 --- a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/grpc_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/grpc_asyncio.py @@ -24,6 +24,7 @@ from google.api_core import grpc_helpers_async from google.api_core import exceptions as core_exceptions from google.api_core import retry_async as retries +from google.api_core import operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.protobuf.json_format import MessageToJson @@ -253,6 +254,7 @@ def __init__( self._grpc_channel = None self._ssl_channel_credentials = ssl_channel_credentials self._stubs: Dict[str, Callable] = {} + self._operations_client: Optional[operations_v1.OperationsAsyncClient] = None if api_mtls_endpoint: warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) @@ -337,6 +339,22 @@ def grpc_channel(self) -> aio.Channel: # Return the channel from cache. return self._grpc_channel + @property + def operations_client(self) -> operations_v1.OperationsAsyncClient: + """Create the client designed to process long-running operations. + + This property caches on the instance; repeated calls return the same + client. + """ + # Quick check: Only create a new client if we do not already have one. + if self._operations_client is None: + self._operations_client = operations_v1.OperationsAsyncClient( + self._logged_channel + ) + + # Return the client from cache. + return self._operations_client + @property def query_reasoning_engine( self, @@ -397,6 +415,37 @@ def stream_query_reasoning_engine( ) return self._stubs["stream_query_reasoning_engine"] + @property + def async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the async query reasoning engine method over gRPC. + + Async query using a reasoning engine. + + Returns: + Callable[[~.AsyncQueryReasoningEngineRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "async_query_reasoning_engine" not in self._stubs: + self._stubs["async_query_reasoning_engine"] = ( + self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService/AsyncQueryReasoningEngine", + request_serializer=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + ) + return self._stubs["async_query_reasoning_engine"] + def _prep_wrapped_messages(self, client_info): """Precompute the wrapped methods, overriding the base class method to use async wrappers.""" self._wrapped_methods = { @@ -410,6 +459,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.async_query_reasoning_engine: self._wrap_method( + self.async_query_reasoning_engine, + default_timeout=None, + client_info=client_info, + ), self.get_location: self._wrap_method( self.get_location, default_timeout=None, diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/rest.py index 7b1d565a1a..715ca2ec2d 100644 --- a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/rest.py @@ -26,6 +26,7 @@ import google.protobuf from google.protobuf import json_format +from google.api_core import operations_v1 from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.cloud.location import locations_pb2 # type: ignore @@ -83,6 +84,14 @@ class ReasoningEngineExecutionServiceRestInterceptor: .. code-block:: python class MyCustomReasoningEngineExecutionServiceInterceptor(ReasoningEngineExecutionServiceRestInterceptor): + def pre_async_query_reasoning_engine(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_async_query_reasoning_engine(self, response): + logging.log(f"Received response: {response}") + return response + def pre_query_reasoning_engine(self, request, metadata): logging.log(f"Received request: {request}") return request, metadata @@ -105,6 +114,55 @@ def post_stream_query_reasoning_engine(self, response): """ + def pre_async_query_reasoning_engine( + self, + request: reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for async_query_reasoning_engine + + Override in a subclass to manipulate the request or metadata + before they are sent to the ReasoningEngineExecutionService server. + """ + return request, metadata + + def post_async_query_reasoning_engine( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for async_query_reasoning_engine + + DEPRECATED. Please use the `post_async_query_reasoning_engine_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the ReasoningEngineExecutionService server but before + it is returned to user code. This `post_async_query_reasoning_engine` interceptor runs + before the `post_async_query_reasoning_engine_with_metadata` interceptor. + """ + return response + + def post_async_query_reasoning_engine_with_metadata( + self, + response: operations_pb2.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for async_query_reasoning_engine + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the ReasoningEngineExecutionService server but before it is returned to user code. + + We recommend only using this `post_async_query_reasoning_engine_with_metadata` + interceptor in new development instead of the `post_async_query_reasoning_engine` interceptor. + When both interceptors are used, this `post_async_query_reasoning_engine_with_metadata` interceptor runs after the + `post_async_query_reasoning_engine` interceptor. The (possibly modified) response returned by + `post_async_query_reasoning_engine` will be passed to + `post_async_query_reasoning_engine_with_metadata`. + """ + return response, metadata + def pre_query_reasoning_engine( self, request: reasoning_engine_execution_service.QueryReasoningEngineRequest, @@ -536,6 +594,7 @@ def __init__( self._session = AuthorizedSession( self._credentials, default_host=self.DEFAULT_HOST ) + self._operations_client: Optional[operations_v1.AbstractOperationsClient] = None if client_cert_source_for_mtls: self._session.configure_mtls_channel(client_cert_source_for_mtls) self._interceptor = ( @@ -543,227 +602,2592 @@ def __init__( ) self._prep_wrapped_messages(client_info) - class _QueryReasoningEngine( - _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine, - ReasoningEngineExecutionServiceRestStub, - ): - def __hash__(self): - return hash( - "ReasoningEngineExecutionServiceRestTransport.QueryReasoningEngine" - ) - - @staticmethod - def _get_response( - host, - metadata, - query_params, - session, - timeout, - transcoded_request, - body=None, - ): - - uri = transcoded_request["uri"] - method = transcoded_request["method"] - headers = dict(metadata) - headers["Content-Type"] = "application/json" - response = getattr(session, method)( - "{host}{uri}".format(host=host, uri=uri), - timeout=timeout, - headers=headers, - params=rest_helpers.flatten_query_params(query_params, strict=True), - data=body, - ) - return response - - def __call__( - self, - request: reasoning_engine_execution_service.QueryReasoningEngineRequest, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, - metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), - ) -> reasoning_engine_execution_service.QueryReasoningEngineResponse: - r"""Call the query reasoning engine method over HTTP. - - Args: - request (~.reasoning_engine_execution_service.QueryReasoningEngineRequest): - The request object. Request message for - [ReasoningEngineExecutionService.Query][]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be - sent along with the request as metadata. Normally, each value must be of type `str`, - but for metadata keys ending with the suffix `-bin`, the corresponding values must - be of type `bytes`. - - Returns: - ~.reasoning_engine_execution_service.QueryReasoningEngineResponse: - Response message for - [ReasoningEngineExecutionService.Query][] - - """ - - http_options = ( - _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine._get_http_options() - ) - - request, metadata = self._interceptor.pre_query_reasoning_engine( - request, metadata - ) - transcoded_request = _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine._get_transcoded_request( - http_options, request - ) - - body = _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine._get_request_body_json( - transcoded_request - ) - - # Jsonify the query params - query_params = _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine._get_query_params_json( - transcoded_request - ) + @property + def operations_client(self) -> operations_v1.AbstractOperationsClient: + """Create the client designed to process long-running operations. - if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( - logging.DEBUG - ): # pragma: NO COVER - request_url = "{host}{uri}".format( - host=self._host, uri=transcoded_request["uri"] - ) - method = transcoded_request["method"] - try: - request_payload = type(request).to_json(request) - except: - request_payload = None - http_request = { - "payload": request_payload, - "requestMethod": method, - "requestUrl": request_url, - "headers": dict(metadata), - } - _LOGGER.debug( - f"Sending request for google.cloud.aiplatform_v1beta1.ReasoningEngineExecutionServiceClient.QueryReasoningEngine", - extra={ - "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService", - "rpcName": "QueryReasoningEngine", - "httpRequest": http_request, - "metadata": http_request["headers"], + This property caches on the instance; repeated calls return the same + client. + """ + # Only create a new client if we do not already have one. + if self._operations_client is None: + http_options: Dict[str, List[Dict[str, str]]] = { + "google.longrunning.Operations.CancelOperation": [ + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/operations/*}:cancel", }, - ) - - # Send the request - response = ReasoningEngineExecutionServiceRestTransport._QueryReasoningEngine._get_response( - self._host, - metadata, - query_params, - self._session, - timeout, - transcoded_request, - body, - ) - - # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception - # subclass. - if response.status_code >= 400: - raise core_exceptions.from_http_response(response) - - # Return the response - resp = reasoning_engine_execution_service.QueryReasoningEngineResponse() - pb_resp = ( - reasoning_engine_execution_service.QueryReasoningEngineResponse.pb(resp) - ) - - json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) - - resp = self._interceptor.post_query_reasoning_engine(resp) - response_metadata = [(k, str(v)) for k, v in response.headers.items()] - resp, _ = self._interceptor.post_query_reasoning_engine_with_metadata( - resp, response_metadata - ) - if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( - logging.DEBUG - ): # pragma: NO COVER - try: - response_payload = reasoning_engine_execution_service.QueryReasoningEngineResponse.to_json( - response - ) - except: - response_payload = None - http_response = { - "payload": response_payload, - "headers": dict(response.headers), - "status": response.status_code, - } - _LOGGER.debug( - "Received response for google.cloud.aiplatform_v1beta1.ReasoningEngineExecutionServiceClient.query_reasoning_engine", - extra={ - "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService", - "rpcName": "QueryReasoningEngine", - "metadata": http_response["headers"], - "httpResponse": http_response, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel", }, - ) - return resp - - class _StreamQueryReasoningEngine( - _BaseReasoningEngineExecutionServiceRestTransport._BaseStreamQueryReasoningEngine, - ReasoningEngineExecutionServiceRestStub, - ): - def __hash__(self): - return hash( - "ReasoningEngineExecutionServiceRestTransport.StreamQueryReasoningEngine" - ) - - @staticmethod - def _get_response( - host, - metadata, - query_params, - session, - timeout, - transcoded_request, - body=None, - ): - - uri = transcoded_request["uri"] - method = transcoded_request["method"] - headers = dict(metadata) - headers["Content-Type"] = "application/json" - response = getattr(session, method)( - "{host}{uri}".format(host=host, uri=uri), - timeout=timeout, - headers=headers, - params=rest_helpers.flatten_query_params(query_params, strict=True), - data=body, - stream=True, - ) - return response - - def __call__( - self, - request: reasoning_engine_execution_service.StreamQueryReasoningEngineRequest, - *, - retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: Optional[float] = None, - metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), - ) -> rest_streaming.ResponseIterator: - r"""Call the stream query reasoning - engine method over HTTP. - - Args: - request (~.reasoning_engine_execution_service.StreamQueryReasoningEngineRequest): - The request object. Request message for - [ReasoningEngineExecutionService.StreamQuery][]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, - should be retried. - timeout (float): The timeout for this request. - metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be - sent along with the request as metadata. Normally, each value must be of type `str`, - but for metadata keys ending with the suffix `-bin`, the corresponding values must - be of type `bytes`. - - Returns: + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, + ], + "google.longrunning.Operations.DeleteOperation": [ + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, + ], + "google.longrunning.Operations.GetOperation": [ + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, + ], + "google.longrunning.Operations.ListOperations": [ + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/agents/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/apps/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/schedules/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, + ], + "google.longrunning.Operations.WaitOperation": [ + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, + ], + } + + rest_transport = operations_v1.OperationsRestTransport( + host=self._host, + # use the credentials which are saved + credentials=self._credentials, + scopes=self._scopes, + http_options=http_options, + path_prefix="v1beta1", + ) + + self._operations_client = operations_v1.AbstractOperationsClient( + transport=rest_transport + ) + + # Return the client from cache. + return self._operations_client + + class _AsyncQueryReasoningEngine( + _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine, + ReasoningEngineExecutionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineExecutionServiceRestTransport.AsyncQueryReasoningEngine" + ) + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the async query reasoning + engine method over HTTP. + + Args: + request (~.reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest): + The request object. Request message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.operations_pb2.Operation: + This resource represents a + long-running operation that is the + result of a network API call. + + """ + + http_options = ( + _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_http_options() + ) + + request, metadata = self._interceptor.pre_async_query_reasoning_engine( + request, metadata + ) + transcoded_request = _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_transcoded_request( + http_options, request + ) + + body = _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.ReasoningEngineExecutionServiceClient.AsyncQueryReasoningEngine", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService", + "rpcName": "AsyncQueryReasoningEngine", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineExecutionServiceRestTransport._AsyncQueryReasoningEngine._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = operations_pb2.Operation() + json_format.Parse(response.content, resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_async_query_reasoning_engine(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_async_query_reasoning_engine_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.ReasoningEngineExecutionServiceClient.async_query_reasoning_engine", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService", + "rpcName": "AsyncQueryReasoningEngine", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _QueryReasoningEngine( + _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine, + ReasoningEngineExecutionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineExecutionServiceRestTransport.QueryReasoningEngine" + ) + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + def __call__( + self, + request: reasoning_engine_execution_service.QueryReasoningEngineRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> reasoning_engine_execution_service.QueryReasoningEngineResponse: + r"""Call the query reasoning engine method over HTTP. + + Args: + request (~.reasoning_engine_execution_service.QueryReasoningEngineRequest): + The request object. Request message for + [ReasoningEngineExecutionService.Query][]. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.reasoning_engine_execution_service.QueryReasoningEngineResponse: + Response message for + [ReasoningEngineExecutionService.Query][] + + """ + + http_options = ( + _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine._get_http_options() + ) + + request, metadata = self._interceptor.pre_query_reasoning_engine( + request, metadata + ) + transcoded_request = _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine._get_transcoded_request( + http_options, request + ) + + body = _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.ReasoningEngineExecutionServiceClient.QueryReasoningEngine", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService", + "rpcName": "QueryReasoningEngine", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineExecutionServiceRestTransport._QueryReasoningEngine._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + raise core_exceptions.from_http_response(response) + + # Return the response + resp = reasoning_engine_execution_service.QueryReasoningEngineResponse() + pb_resp = ( + reasoning_engine_execution_service.QueryReasoningEngineResponse.pb(resp) + ) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_query_reasoning_engine(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = self._interceptor.post_query_reasoning_engine_with_metadata( + resp, response_metadata + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = reasoning_engine_execution_service.QueryReasoningEngineResponse.to_json( + response + ) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.ReasoningEngineExecutionServiceClient.query_reasoning_engine", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService", + "rpcName": "QueryReasoningEngine", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _StreamQueryReasoningEngine( + _BaseReasoningEngineExecutionServiceRestTransport._BaseStreamQueryReasoningEngine, + ReasoningEngineExecutionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineExecutionServiceRestTransport.StreamQueryReasoningEngine" + ) + + @staticmethod + def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + stream=True, + ) + return response + + def __call__( + self, + request: reasoning_engine_execution_service.StreamQueryReasoningEngineRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> rest_streaming.ResponseIterator: + r"""Call the stream query reasoning + engine method over HTTP. + + Args: + request (~.reasoning_engine_execution_service.StreamQueryReasoningEngineRequest): + The request object. Request message for + [ReasoningEngineExecutionService.StreamQuery][]. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: ~.httpbody_pb2.HttpBody: Message that represents an arbitrary HTTP body. It should only be used for payload formats that can't be @@ -908,6 +3332,17 @@ def __call__( ) return resp + @property + def async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest], + operations_pb2.Operation, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._AsyncQueryReasoningEngine(self._session, self._host, self._interceptor) # type: ignore + @property def query_reasoning_engine( self, diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/rest_asyncio.py index 64d66dc9b2..4beffc63db 100644 --- a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/rest_asyncio.py @@ -30,6 +30,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 +from google.api_core import operations_v1 from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.cloud.location import locations_pb2 # type: ignore @@ -39,6 +40,7 @@ import google.protobuf from google.protobuf import json_format +from google.api_core import operations_v1 from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.cloud.location import locations_pb2 # type: ignore @@ -99,6 +101,14 @@ class AsyncReasoningEngineExecutionServiceRestInterceptor: .. code-block:: python class MyCustomReasoningEngineExecutionServiceInterceptor(ReasoningEngineExecutionServiceRestInterceptor): + async def pre_async_query_reasoning_engine(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + async def post_async_query_reasoning_engine(self, response): + logging.log(f"Received response: {response}") + return response + async def pre_query_reasoning_engine(self, request, metadata): logging.log(f"Received request: {request}") return request, metadata @@ -121,6 +131,55 @@ async def post_stream_query_reasoning_engine(self, response): """ + async def pre_async_query_reasoning_engine( + self, + request: reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for async_query_reasoning_engine + + Override in a subclass to manipulate the request or metadata + before they are sent to the ReasoningEngineExecutionService server. + """ + return request, metadata + + async def post_async_query_reasoning_engine( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for async_query_reasoning_engine + + DEPRECATED. Please use the `post_async_query_reasoning_engine_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the ReasoningEngineExecutionService server but before + it is returned to user code. This `post_async_query_reasoning_engine` interceptor runs + before the `post_async_query_reasoning_engine_with_metadata` interceptor. + """ + return response + + async def post_async_query_reasoning_engine_with_metadata( + self, + response: operations_pb2.Operation, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[operations_pb2.Operation, Sequence[Tuple[str, Union[str, bytes]]]]: + """Post-rpc interceptor for async_query_reasoning_engine + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the ReasoningEngineExecutionService server but before it is returned to user code. + + We recommend only using this `post_async_query_reasoning_engine_with_metadata` + interceptor in new development instead of the `post_async_query_reasoning_engine` interceptor. + When both interceptors are used, this `post_async_query_reasoning_engine_with_metadata` interceptor runs after the + `post_async_query_reasoning_engine` interceptor. The (possibly modified) response returned by + `post_async_query_reasoning_engine` will be passed to + `post_async_query_reasoning_engine_with_metadata`. + """ + return response, metadata + async def pre_query_reasoning_engine( self, request: reasoning_engine_execution_service.QueryReasoningEngineRequest, @@ -539,6 +598,9 @@ def __init__( ) self._wrap_with_kind = True self._prep_wrapped_messages(client_info) + self._operations_client: Optional[operations_v1.AsyncOperationsRestClient] = ( + None + ) def _prep_wrapped_messages(self, client_info): """Precompute the wrapped methods, overriding the base class method to use async wrappers.""" @@ -553,6 +615,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.async_query_reasoning_engine: self._wrap_method( + self.async_query_reasoning_engine, + default_timeout=None, + client_info=client_info, + ), self.get_location: self._wrap_method( self.get_location, default_timeout=None, @@ -610,6 +677,177 @@ def _wrap_method(self, func, *args, **kwargs): kwargs["kind"] = self.kind return gapic_v1.method_async.wrap_method(func, *args, **kwargs) + class _AsyncQueryReasoningEngine( + _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine, + AsyncReasoningEngineExecutionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineExecutionServiceRestTransport.AsyncQueryReasoningEngine" + ) + + @staticmethod + async def _get_response( + host, + metadata, + query_params, + session, + timeout, + transcoded_request, + body=None, + ): + + uri = transcoded_request["uri"] + method = transcoded_request["method"] + headers = dict(metadata) + headers["Content-Type"] = "application/json" + response = await getattr(session, method)( + "{host}{uri}".format(host=host, uri=uri), + timeout=timeout, + headers=headers, + params=rest_helpers.flatten_query_params(query_params, strict=True), + data=body, + ) + return response + + async def __call__( + self, + request: reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the async query reasoning + engine method over HTTP. + + Args: + request (~.reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest): + The request object. Request message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + 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, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + ~.operations_pb2.Operation: + This resource represents a + long-running operation that is the + result of a network API call. + + """ + + http_options = ( + _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_http_options() + ) + + request, metadata = ( + await self._interceptor.pre_async_query_reasoning_engine( + request, metadata + ) + ) + transcoded_request = _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_transcoded_request( + http_options, request + ) + + body = _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_query_params_json( + transcoded_request + ) + + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + try: + request_payload = type(request).to_json(request) + except: + request_payload = None + http_request = { + "payload": request_payload, + "requestMethod": method, + "requestUrl": request_url, + "headers": dict(metadata), + } + _LOGGER.debug( + f"Sending request for google.cloud.aiplatform_v1beta1.ReasoningEngineExecutionServiceClient.AsyncQueryReasoningEngine", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService", + "rpcName": "AsyncQueryReasoningEngine", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineExecutionServiceRestTransport._AsyncQueryReasoningEngine._get_response( + self._host, + metadata, + query_params, + self._session, + timeout, + transcoded_request, + body, + ) + + # In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception + # subclass. + if response.status_code >= 400: + content = await response.read() + payload = json.loads(content.decode("utf-8")) + request_url = "{host}{uri}".format( + host=self._host, uri=transcoded_request["uri"] + ) + method = transcoded_request["method"] + raise core_exceptions.format_http_response_error(response, method, request_url, payload) # type: ignore + + # Return the response + resp = operations_pb2.Operation() + pb_resp = resp + content = await response.read() + json_format.Parse(content, pb_resp, ignore_unknown_fields=True) + resp = await self._interceptor.post_async_query_reasoning_engine(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + await self._interceptor.post_async_query_reasoning_engine_with_metadata( + resp, response_metadata + ) + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = json_format.MessageToJson(resp) + except: + response_payload = None + http_response = { + "payload": response_payload, + "headers": dict(response.headers), + "status": "OK", # need to obtain this properly + } + _LOGGER.debug( + "Received response for google.cloud.aiplatform_v1beta1.ReasoningEngineExecutionServiceAsyncClient.async_query_reasoning_engine", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService", + "rpcName": "AsyncQueryReasoningEngine", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + + return resp + class _QueryReasoningEngine( _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine, AsyncReasoningEngineExecutionServiceRestStub, @@ -990,6 +1228,2220 @@ async def __call__( return resp + @property + def operations_client(self) -> AsyncOperationsRestClient: + """Create the async client designed to process long-running operations. + + This property caches on the instance; repeated calls return the same + client. + """ + # Only create a new client if we do not already have one. + if self._operations_client is None: + http_options: Dict[str, List[Dict[str, str]]] = { + "google.longrunning.Operations.CancelOperation": [ + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", + }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, + ], + "google.longrunning.Operations.DeleteOperation": [ + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, + ], + "google.longrunning.Operations.GetOperation": [ + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", + }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, + ], + "google.longrunning.Operations.ListOperations": [ + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/agents/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/apps/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/schedules/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", + }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, + ], + "google.longrunning.Operations.WaitOperation": [ + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/extensions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/schedules/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/ragEngineConfig/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragEngineConfig/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/memories/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", + }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, + ], + } + + rest_transport = operations_v1.AsyncOperationsRestTransport( # type: ignore + host=self._host, + # use the credentials which are saved + credentials=self._credentials, # type: ignore + http_options=http_options, + path_prefix="v1beta1", + ) + + self._operations_client = AsyncOperationsRestClient( + transport=rest_transport + ) + + # Return the client from cache. + return self._operations_client + + @property + def async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest], + operations_pb2.Operation, + ]: + return self._AsyncQueryReasoningEngine(self._session, self._host, self._interceptor) # type: ignore + @property def query_reasoning_engine( self, diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/rest_base.py index 7c0c35b7c6..0684bac86e 100644 --- a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_execution_service/transports/rest_base.py @@ -96,6 +96,72 @@ def __init__( api_audience=api_audience, ) + class _BaseAsyncQueryReasoningEngine: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + + __REQUIRED_FIELDS_DEFAULT_VALUES: Dict[str, Any] = {} + + @classmethod + def _get_unset_required_fields(cls, message_dict): + return { + k: v + for k, v in cls.__REQUIRED_FIELDS_DEFAULT_VALUES.items() + if k not in message_dict + } + + @staticmethod + def _get_http_options(): + http_options: List[Dict[str, str]] = [ + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*}:asyncQuery", + "body": "*", + }, + { + "method": "post", + "uri": "/v1beta1/{name=reasoningEngines/*}:asyncQuery", + "body": "*", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = ( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest.pb( + request + ) + ) + transcoded_request = path_template.transcode(http_options, pb_request) + return transcoded_request + + @staticmethod + def _get_request_body_json(transcoded_request): + # Jsonify the request body + + body = json_format.MessageToJson( + transcoded_request["body"], use_integers_for_enums=True + ) + return body + + @staticmethod + def _get_query_params_json(transcoded_request): + query_params = json.loads( + json_format.MessageToJson( + transcoded_request["query_params"], + use_integers_for_enums=True, + ) + ) + query_params.update( + _BaseReasoningEngineExecutionServiceRestTransport._BaseAsyncQueryReasoningEngine._get_unset_required_fields( + query_params + ) + ) + + query_params["$alt"] = "json;enum-encoding=int" + return query_params + class _BaseQueryReasoningEngine: def __hash__(self): # pragma: NO COVER return NotImplementedError("__hash__ must be implemented.") @@ -909,6 +975,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -977,6 +1047,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1338,6 +1412,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1430,6 +1508,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -1799,6 +1881,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1891,6 +1977,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2256,6 +2346,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2348,6 +2442,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2713,6 +2811,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2801,6 +2903,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/transports/rest.py index 7f16513217..46cf41c439 100644 --- a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/transports/rest.py @@ -1043,6 +1043,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1111,6 +1115,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1453,6 +1461,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1545,6 +1557,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -1895,6 +1911,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1987,6 +2007,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2333,6 +2357,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2425,6 +2453,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -2771,6 +2803,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2859,6 +2895,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/transports/rest_asyncio.py index 431fd49390..34151786cd 100644 --- a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/transports/rest_asyncio.py @@ -1947,6 +1947,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2015,6 +2019,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2357,6 +2365,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2449,6 +2461,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2799,6 +2815,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2891,6 +2911,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3237,6 +3261,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3329,6 +3357,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3675,6 +3707,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3763,6 +3799,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/transports/rest_base.py index 4113743522..087adce853 100644 --- a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/transports/rest_base.py @@ -1060,6 +1060,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1128,6 +1132,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1489,6 +1497,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1581,6 +1593,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -1950,6 +1966,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2042,6 +2062,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2407,6 +2431,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2499,6 +2527,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2864,6 +2896,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2952,6 +2988,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/schedule_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/schedule_service/transports/rest.py index 66ed1e828e..fabe89a820 100644 --- a/google/cloud/aiplatform_v1beta1/services/schedule_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/schedule_service/transports/rest.py @@ -1073,6 +1073,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1141,6 +1145,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1483,6 +1491,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1575,6 +1587,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -1925,6 +1941,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2017,6 +2037,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2363,6 +2387,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2455,6 +2483,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -2801,6 +2833,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2889,6 +2925,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/schedule_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/schedule_service/transports/rest_asyncio.py index 2675ebbd93..564d042c94 100644 --- a/google/cloud/aiplatform_v1beta1/services/schedule_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/schedule_service/transports/rest_asyncio.py @@ -2230,6 +2230,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2298,6 +2302,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2640,6 +2648,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2732,6 +2744,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -3082,6 +3098,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3174,6 +3194,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3520,6 +3544,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3612,6 +3640,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3958,6 +3990,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -4046,6 +4082,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/schedule_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/schedule_service/transports/rest_base.py index 5cc027b519..4a9b71eb0e 100644 --- a/google/cloud/aiplatform_v1beta1/services/schedule_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/schedule_service/transports/rest_base.py @@ -1148,6 +1148,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1216,6 +1220,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1577,6 +1585,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1669,6 +1681,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2038,6 +2054,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2130,6 +2150,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2495,6 +2519,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2587,6 +2615,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2952,6 +2984,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3040,6 +3076,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/session_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/session_service/transports/rest.py index a089785a17..b411864017 100644 --- a/google/cloud/aiplatform_v1beta1/services/session_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/session_service/transports/rest.py @@ -1148,6 +1148,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1216,6 +1220,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1558,6 +1566,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1650,6 +1662,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2000,6 +2016,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2092,6 +2112,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2438,6 +2462,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2530,6 +2558,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -2876,6 +2908,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2964,6 +3000,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/session_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/session_service/transports/rest_asyncio.py index ac774b0716..08e596f8af 100644 --- a/google/cloud/aiplatform_v1beta1/services/session_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/session_service/transports/rest_asyncio.py @@ -2374,6 +2374,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2442,6 +2446,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2784,6 +2792,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2876,6 +2888,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -3226,6 +3242,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3318,6 +3338,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3664,6 +3688,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3756,6 +3784,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -4102,6 +4134,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -4190,6 +4226,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/session_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/session_service/transports/rest_base.py index 5794ca44e4..d1dc7cfd32 100644 --- a/google/cloud/aiplatform_v1beta1/services/session_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/session_service/transports/rest_base.py @@ -1166,6 +1166,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1234,6 +1238,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1595,6 +1603,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1687,6 +1699,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2056,6 +2072,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2148,6 +2168,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2513,6 +2537,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2605,6 +2633,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2970,6 +3002,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3058,6 +3094,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/transports/rest.py index 4bed237c35..78119861e7 100644 --- a/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/transports/rest.py @@ -1046,6 +1046,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1114,6 +1118,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1456,6 +1464,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1548,6 +1560,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -1898,6 +1914,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1990,6 +2010,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2336,6 +2360,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2428,6 +2456,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -2774,6 +2806,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2862,6 +2898,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/transports/rest_asyncio.py index f81b85910b..3b4a8f0b40 100644 --- a/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/transports/rest_asyncio.py @@ -1942,6 +1942,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2010,6 +2014,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2352,6 +2360,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2444,6 +2456,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2794,6 +2810,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2886,6 +2906,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3232,6 +3256,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3324,6 +3352,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3670,6 +3702,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3758,6 +3794,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/transports/rest_base.py index 6a5b8226c1..1356064d85 100644 --- a/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/transports/rest_base.py @@ -1032,6 +1032,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1100,6 +1104,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1461,6 +1469,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1553,6 +1565,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -1922,6 +1938,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2014,6 +2034,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2379,6 +2403,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2471,6 +2499,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2836,6 +2868,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2924,6 +2960,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/rest.py index 67935764d3..14df86aa43 100644 --- a/google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/rest.py @@ -2536,6 +2536,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2604,6 +2608,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2946,6 +2954,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3038,6 +3050,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -3388,6 +3404,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3480,6 +3500,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3826,6 +3850,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3918,6 +3946,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -4264,6 +4296,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -4352,6 +4388,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/rest_asyncio.py index c3e1364c72..235ec627fa 100644 --- a/google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/rest_asyncio.py @@ -7736,6 +7736,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -7804,6 +7808,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -8146,6 +8154,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -8238,6 +8250,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -8588,6 +8604,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -8680,6 +8700,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -9026,6 +9050,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -9118,6 +9146,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -9464,6 +9496,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -9552,6 +9588,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/rest_base.py index 53d784edb9..cdbf4ff196 100644 --- a/google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/rest_base.py @@ -2369,6 +2369,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2437,6 +2441,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -2798,6 +2806,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2890,6 +2902,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -3259,6 +3275,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3351,6 +3371,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -3716,6 +3740,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3808,6 +3836,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -4173,6 +4205,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -4261,6 +4297,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/vertex_rag_data_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/vertex_rag_data_service/transports/rest.py index f5ac4ea64d..99e66b9a8c 100644 --- a/google/cloud/aiplatform_v1beta1/services/vertex_rag_data_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/vertex_rag_data_service/transports/rest.py @@ -2120,6 +2120,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2188,6 +2192,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2530,6 +2538,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2622,6 +2634,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2972,6 +2988,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3064,6 +3084,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3410,6 +3434,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3502,6 +3530,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3848,6 +3880,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3936,6 +3972,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/vertex_rag_data_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/vertex_rag_data_service/transports/rest_asyncio.py index 5e3bd2f9cb..2cd1a7359c 100644 --- a/google/cloud/aiplatform_v1beta1/services/vertex_rag_data_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/vertex_rag_data_service/transports/rest_asyncio.py @@ -6264,6 +6264,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -6332,6 +6336,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -6674,6 +6682,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -6766,6 +6778,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -7116,6 +7132,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -7208,6 +7228,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -7554,6 +7578,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -7646,6 +7674,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -7992,6 +8024,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -8080,6 +8116,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/vertex_rag_data_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/vertex_rag_data_service/transports/rest_base.py index be93d8b68c..b8967f39c2 100644 --- a/google/cloud/aiplatform_v1beta1/services/vertex_rag_data_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/vertex_rag_data_service/transports/rest_base.py @@ -2081,6 +2081,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2149,6 +2153,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -2510,6 +2518,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2602,6 +2614,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2971,6 +2987,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -3063,6 +3083,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -3428,6 +3452,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3520,6 +3548,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -3885,6 +3917,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3973,6 +4009,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/vertex_rag_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/vertex_rag_service/transports/rest.py index e2b7675116..0a1b3dded6 100644 --- a/google/cloud/aiplatform_v1beta1/services/vertex_rag_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/vertex_rag_service/transports/rest.py @@ -1046,6 +1046,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1114,6 +1118,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1456,6 +1464,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1548,6 +1560,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -1898,6 +1914,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1990,6 +2010,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2336,6 +2360,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2428,6 +2456,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -2774,6 +2806,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2862,6 +2898,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/vertex_rag_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/vertex_rag_service/transports/rest_asyncio.py index ef3e97ac2a..25bff4bf40 100644 --- a/google/cloud/aiplatform_v1beta1/services/vertex_rag_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/vertex_rag_service/transports/rest_asyncio.py @@ -1955,6 +1955,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -2023,6 +2027,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -2365,6 +2373,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2457,6 +2469,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2807,6 +2823,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2899,6 +2919,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -3245,6 +3269,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3337,6 +3365,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3683,6 +3715,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3771,6 +3807,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/vertex_rag_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/vertex_rag_service/transports/rest_base.py index b9a87c1571..96d72c4ad2 100644 --- a/google/cloud/aiplatform_v1beta1/services/vertex_rag_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/vertex_rag_service/transports/rest_base.py @@ -1059,6 +1059,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1127,6 +1131,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -1488,6 +1496,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -1580,6 +1592,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -1949,6 +1965,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2041,6 +2061,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2406,6 +2430,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2498,6 +2526,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -2863,6 +2895,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -2951,6 +2987,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/services/vizier_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/vizier_service/transports/rest.py index cda8075881..ac26c79a27 100644 --- a/google/cloud/aiplatform_v1beta1/services/vizier_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/vizier_service/transports/rest.py @@ -1498,6 +1498,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1566,6 +1570,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -1908,6 +1916,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2000,6 +2012,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -2350,6 +2366,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2442,6 +2462,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -2788,6 +2812,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -2880,6 +2908,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -3226,6 +3258,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3314,6 +3350,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/vizier_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/vizier_service/transports/rest_asyncio.py index 127a2a9851..3ed7a4d36d 100644 --- a/google/cloud/aiplatform_v1beta1/services/vizier_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/vizier_service/transports/rest_asyncio.py @@ -4007,6 +4007,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -4075,6 +4079,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ], "google.longrunning.Operations.DeleteOperation": [ { @@ -4417,6 +4425,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -4509,6 +4521,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.GetOperation": [ { @@ -4859,6 +4875,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -4951,6 +4971,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ], "google.longrunning.Operations.ListOperations": [ { @@ -5297,6 +5321,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -5389,6 +5417,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ], "google.longrunning.Operations.WaitOperation": [ { @@ -5735,6 +5767,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -5823,6 +5859,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ], } diff --git a/google/cloud/aiplatform_v1beta1/services/vizier_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/vizier_service/transports/rest_base.py index 011697575a..06843caaea 100644 --- a/google/cloud/aiplatform_v1beta1/services/vizier_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1beta1/services/vizier_service/transports/rest_base.py @@ -1572,6 +1572,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel", @@ -1640,6 +1644,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:cancel", + }, ] return http_options @@ -2001,6 +2009,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2093,6 +2105,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2462,6 +2478,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}", @@ -2554,6 +2574,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}", + }, ] return http_options @@ -2919,6 +2943,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations", @@ -3011,6 +3039,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=onlineEvaluators/*}/operations", + }, ] return http_options @@ -3376,6 +3408,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait", @@ -3464,6 +3500,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=onlineEvaluators/*/operations/*}:wait", + }, ] return http_options diff --git a/google/cloud/aiplatform_v1beta1/types/__init__.py b/google/cloud/aiplatform_v1beta1/types/__init__.py index 87d44add38..58d1fece91 100644 --- a/google/cloud/aiplatform_v1beta1/types/__init__.py +++ b/google/cloud/aiplatform_v1beta1/types/__init__.py @@ -218,6 +218,17 @@ EvaluatedAnnotation, EvaluatedAnnotationExplanation, ) +from .evaluation_agent_data import ( + AgentConfig, + AgentData, + AgentEvent, + ConversationTurn, +) +from .evaluation_rubric import ( + Rubric, + RubricGroup, + RubricVerdict, +) from .evaluation_service import ( AggregationOutput, AggregationResult, @@ -237,6 +248,8 @@ CometSpec, ComputationBasedMetricSpec, ContentMap, + CustomCodeExecutionResult, + CustomCodeExecutionSpec, CustomOutput, CustomOutputFormatConfig, EvaluateDatasetOperationMetadata, @@ -245,6 +258,8 @@ EvaluateInstancesRequest, EvaluateInstancesResponse, EvaluationDataset, + EvaluationInstance, + EvaluationParserConfig, ExactMatchInput, ExactMatchInstance, ExactMatchMetricValue, @@ -258,13 +273,17 @@ FulfillmentInstance, FulfillmentResult, FulfillmentSpec, + GenerateInstanceRubricsRequest, + GenerateInstanceRubricsResponse, GroundednessInput, GroundednessInstance, GroundednessResult, GroundednessSpec, LLMBasedMetricSpec, Metric, + MetricMetadata, MetricResult, + MetricSource, MetricxInput, MetricxInstance, MetricxResult, @@ -315,6 +334,7 @@ RubricBasedInstructionFollowingResult, RubricBasedInstructionFollowingSpec, RubricCritiqueResult, + RubricGenerationSpec, SafetyInput, SafetyInstance, SafetyResult, @@ -1078,6 +1098,24 @@ NotebookSoftwareConfig, PostStartupScriptConfig, ) +from .online_evaluator import ( + OnlineEvaluator, +) +from .online_evaluator_service import ( + ActivateOnlineEvaluatorOperationMetadata, + ActivateOnlineEvaluatorRequest, + CreateOnlineEvaluatorOperationMetadata, + CreateOnlineEvaluatorRequest, + DeleteOnlineEvaluatorOperationMetadata, + DeleteOnlineEvaluatorRequest, + GetOnlineEvaluatorRequest, + ListOnlineEvaluatorsRequest, + ListOnlineEvaluatorsResponse, + SuspendOnlineEvaluatorOperationMetadata, + SuspendOnlineEvaluatorRequest, + UpdateOnlineEvaluatorOperationMetadata, + UpdateOnlineEvaluatorRequest, +) from .openapi import ( Schema, Type, @@ -1180,6 +1218,9 @@ ReasoningEngineSpec, ) from .reasoning_engine_execution_service import ( + AsyncQueryReasoningEngineOperationMetadata, + AsyncQueryReasoningEngineRequest, + AsyncQueryReasoningEngineResponse, QueryReasoningEngineRequest, QueryReasoningEngineResponse, StreamQueryReasoningEngineRequest, @@ -1384,6 +1425,7 @@ TuningDataStats, TuningJob, VeoHyperParameters, + VeoLoraTuningSpec, VeoTuningSpec, ) from .types import ( @@ -1668,6 +1710,13 @@ "ErrorAnalysisAnnotation", "EvaluatedAnnotation", "EvaluatedAnnotationExplanation", + "AgentConfig", + "AgentData", + "AgentEvent", + "ConversationTurn", + "Rubric", + "RubricGroup", + "RubricVerdict", "AggregationOutput", "AggregationResult", "AutoraterConfig", @@ -1686,6 +1735,8 @@ "CometSpec", "ComputationBasedMetricSpec", "ContentMap", + "CustomCodeExecutionResult", + "CustomCodeExecutionSpec", "CustomOutput", "CustomOutputFormatConfig", "EvaluateDatasetOperationMetadata", @@ -1694,6 +1745,8 @@ "EvaluateInstancesRequest", "EvaluateInstancesResponse", "EvaluationDataset", + "EvaluationInstance", + "EvaluationParserConfig", "ExactMatchInput", "ExactMatchInstance", "ExactMatchMetricValue", @@ -1707,13 +1760,17 @@ "FulfillmentInstance", "FulfillmentResult", "FulfillmentSpec", + "GenerateInstanceRubricsRequest", + "GenerateInstanceRubricsResponse", "GroundednessInput", "GroundednessInstance", "GroundednessResult", "GroundednessSpec", "LLMBasedMetricSpec", "Metric", + "MetricMetadata", "MetricResult", + "MetricSource", "MetricxInput", "MetricxInstance", "MetricxResult", @@ -1764,6 +1821,7 @@ "RubricBasedInstructionFollowingResult", "RubricBasedInstructionFollowingSpec", "RubricCritiqueResult", + "RubricGenerationSpec", "SafetyInput", "SafetyInstance", "SafetyResult", @@ -2386,6 +2444,20 @@ "ColabImage", "NotebookSoftwareConfig", "PostStartupScriptConfig", + "OnlineEvaluator", + "ActivateOnlineEvaluatorOperationMetadata", + "ActivateOnlineEvaluatorRequest", + "CreateOnlineEvaluatorOperationMetadata", + "CreateOnlineEvaluatorRequest", + "DeleteOnlineEvaluatorOperationMetadata", + "DeleteOnlineEvaluatorRequest", + "GetOnlineEvaluatorRequest", + "ListOnlineEvaluatorsRequest", + "ListOnlineEvaluatorsResponse", + "SuspendOnlineEvaluatorOperationMetadata", + "SuspendOnlineEvaluatorRequest", + "UpdateOnlineEvaluatorOperationMetadata", + "UpdateOnlineEvaluatorRequest", "Schema", "Type", "DeleteOperationMetadata", @@ -2465,6 +2537,9 @@ "ReasoningEngine", "ReasoningEngineContextSpec", "ReasoningEngineSpec", + "AsyncQueryReasoningEngineOperationMetadata", + "AsyncQueryReasoningEngineRequest", + "AsyncQueryReasoningEngineResponse", "QueryReasoningEngineRequest", "QueryReasoningEngineResponse", "StreamQueryReasoningEngineRequest", @@ -2629,6 +2704,7 @@ "TuningDataStats", "TuningJob", "VeoHyperParameters", + "VeoLoraTuningSpec", "VeoTuningSpec", "BoolArray", "DoubleArray", diff --git a/google/cloud/aiplatform_v1beta1/types/evaluation_agent_data.py b/google/cloud/aiplatform_v1beta1/types/evaluation_agent_data.py new file mode 100644 index 0000000000..45a2888b25 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/types/evaluation_agent_data.py @@ -0,0 +1,229 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.cloud.aiplatform_v1beta1.types import content as gca_content +from google.cloud.aiplatform_v1beta1.types import tool +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore + + +__protobuf__ = proto.module( + package="google.cloud.aiplatform.v1beta1", + manifest={ + "AgentData", + "AgentConfig", + "ConversationTurn", + "AgentEvent", + }, +) + + +class AgentData(proto.Message): + r"""Represents data specific to multi-turn agent evaluations. + + Attributes: + agents (MutableMapping[str, google.cloud.aiplatform_v1beta1.types.AgentConfig]): + Optional. A map containing the static configurations for + each agent in the system. Key: agent_id (matches the + ``author`` field in events). Value: The static configuration + of the agent. + turns (MutableSequence[google.cloud.aiplatform_v1beta1.types.ConversationTurn]): + Optional. A chronological list of + conversation turns. Each turn represents a + logical execution cycle (e.g., User Input -> + Agent Response). + """ + + agents: MutableMapping[str, "AgentConfig"] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=1, + message="AgentConfig", + ) + turns: MutableSequence["ConversationTurn"] = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="ConversationTurn", + ) + + +class AgentConfig(proto.Message): + r"""Represents configuration for an Agent. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + agent_id (str): + Required. Unique identifier of the agent. This ID is used to + refer to this agent, e.g., in AgentEvent.author, or in the + ``sub_agents`` field. It must be unique within the + ``agents`` map. + + This field is a member of `oneof`_ ``_agent_id``. + agent_type (str): + Optional. The type or class of the agent + (e.g., "LlmAgent", "RouterAgent", + "ToolUseAgent"). Useful for the autorater to + understand the expected behavior of the agent. + description (str): + Optional. A high-level description of the + agent's role and responsibilities. Critical for + evaluating if the agent is routing tasks + correctly. + instruction (str): + Optional. Provides instructions for the LLM model, guiding + the agent's behavior. Can be static or dynamic. Dynamic + instructions can contain placeholders like {variable_name} + that will be resolved at runtime using the + ``AgentEvent.state_delta`` field. + tools (MutableSequence[google.cloud.aiplatform_v1beta1.types.Tool]): + Optional. The list of tools available to this + agent. + sub_agents (MutableSequence[str]): + Optional. The list of valid agent IDs that + this agent can delegate to. This defines the + directed edges in the multi-agent system graph + topology. + """ + + agent_id: str = proto.Field( + proto.STRING, + number=1, + optional=True, + ) + agent_type: str = proto.Field( + proto.STRING, + number=2, + ) + description: str = proto.Field( + proto.STRING, + number=3, + ) + instruction: str = proto.Field( + proto.STRING, + number=4, + ) + tools: MutableSequence[tool.Tool] = proto.RepeatedField( + proto.MESSAGE, + number=5, + message=tool.Tool, + ) + sub_agents: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=6, + ) + + +class ConversationTurn(proto.Message): + r"""Represents a single turn/invocation in the conversation. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + turn_index (int): + Required. The 0-based index of the turn in + the conversation sequence. + + This field is a member of `oneof`_ ``_turn_index``. + turn_id (str): + Optional. A unique identifier for the turn. + Useful for referencing specific turns across + systems. + events (MutableSequence[google.cloud.aiplatform_v1beta1.types.AgentEvent]): + Optional. The list of events that occurred + during this turn. + """ + + turn_index: int = proto.Field( + proto.INT32, + number=1, + optional=True, + ) + turn_id: str = proto.Field( + proto.STRING, + number=2, + ) + events: MutableSequence["AgentEvent"] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message="AgentEvent", + ) + + +class AgentEvent(proto.Message): + r"""Represents a single event in the execution trace. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + author (str): + Required. The ID of the agent or entity that + generated this event. Use "user" to denote + events generated by the end-user. + + This field is a member of `oneof`_ ``_author``. + content (google.cloud.aiplatform_v1beta1.types.Content): + Required. The content of the event (e.g., + text response, tool call, tool response). + + This field is a member of `oneof`_ ``_content``. + event_time (google.protobuf.timestamp_pb2.Timestamp): + Optional. The timestamp when the event + occurred. + state_delta (google.protobuf.struct_pb2.Struct): + Optional. The change in the session state + caused by this event. This is a key-value map of + fields that were modified or added by the event. + active_tools (MutableSequence[google.cloud.aiplatform_v1beta1.types.Tool]): + Optional. The list of tools that were active/available to + the agent at the time of this event. This overrides the + ``AgentConfig.tools`` if set. + """ + + author: str = proto.Field( + proto.STRING, + number=1, + optional=True, + ) + content: gca_content.Content = proto.Field( + proto.MESSAGE, + number=2, + optional=True, + message=gca_content.Content, + ) + event_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + state_delta: struct_pb2.Struct = proto.Field( + proto.MESSAGE, + number=4, + message=struct_pb2.Struct, + ) + active_tools: MutableSequence[tool.Tool] = proto.RepeatedField( + proto.MESSAGE, + number=5, + message=tool.Tool, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1beta1/types/evaluation_rubric.py b/google/cloud/aiplatform_v1beta1/types/evaluation_rubric.py new file mode 100644 index 0000000000..3a3fd631fb --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/types/evaluation_rubric.py @@ -0,0 +1,214 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + + +__protobuf__ = proto.module( + package="google.cloud.aiplatform.v1beta1", + manifest={ + "Rubric", + "RubricGroup", + "RubricVerdict", + }, +) + + +class Rubric(proto.Message): + r"""Message representing a single testable criterion for + evaluation. One input prompt could have multiple rubrics. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + rubric_id (str): + Unique identifier for the rubric. + This ID is used to refer to this rubric, e.g., + in RubricVerdict. + content (google.cloud.aiplatform_v1beta1.types.Rubric.Content): + Required. The actual testable criteria for + the rubric. + type_ (str): + Optional. A type designator for the rubric, which can inform + how it's evaluated or interpreted by systems or users. It's + recommended to use consistent, well-defined, upper + snake_case strings. Examples: "SUMMARIZATION_QUALITY", + "SAFETY_HARMFUL_CONTENT", "INSTRUCTION_ADHERENCE". + + This field is a member of `oneof`_ ``_type``. + importance (google.cloud.aiplatform_v1beta1.types.Rubric.Importance): + Optional. The relative importance of this + rubric. + + This field is a member of `oneof`_ ``_importance``. + """ + + class Importance(proto.Enum): + r"""Importance level of the rubric. + + Values: + IMPORTANCE_UNSPECIFIED (0): + Importance is not specified. + HIGH (1): + High importance. + MEDIUM (2): + Medium importance. + LOW (3): + Low importance. + """ + + IMPORTANCE_UNSPECIFIED = 0 + HIGH = 1 + MEDIUM = 2 + LOW = 3 + + class Content(proto.Message): + r"""Content of the rubric, defining the testable criteria. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + property (google.cloud.aiplatform_v1beta1.types.Rubric.Content.Property): + Evaluation criteria based on a specific + property. + + This field is a member of `oneof`_ ``content_type``. + """ + + class Property(proto.Message): + r"""Defines criteria based on a specific property. + + Attributes: + description (str): + Description of the property being evaluated. + Example: "The model's response is grammatically + correct.". + """ + + description: str = proto.Field( + proto.STRING, + number=1, + ) + + property: "Rubric.Content.Property" = proto.Field( + proto.MESSAGE, + number=1, + oneof="content_type", + message="Rubric.Content.Property", + ) + + rubric_id: str = proto.Field( + proto.STRING, + number=1, + ) + content: Content = proto.Field( + proto.MESSAGE, + number=2, + message=Content, + ) + type_: str = proto.Field( + proto.STRING, + number=3, + optional=True, + ) + importance: Importance = proto.Field( + proto.ENUM, + number=4, + optional=True, + enum=Importance, + ) + + +class RubricGroup(proto.Message): + r"""A group of rubrics, used for grouping rubrics based on a + metric or a version. + + Attributes: + group_id (str): + Unique identifier for the group. + display_name (str): + Human-readable name for the group. This + should be unique within a given context if used + for display or selection. Example: "Instruction + Following V1", "Content Quality - Summarization + Task". + rubrics (MutableSequence[google.cloud.aiplatform_v1beta1.types.Rubric]): + Rubrics that are part of this group. + """ + + group_id: str = proto.Field( + proto.STRING, + number=1, + ) + display_name: str = proto.Field( + proto.STRING, + number=2, + ) + rubrics: MutableSequence["Rubric"] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message="Rubric", + ) + + +class RubricVerdict(proto.Message): + r"""Represents the verdict of an evaluation against a single + rubric. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + evaluated_rubric (google.cloud.aiplatform_v1beta1.types.Rubric): + Required. The full rubric definition that was + evaluated. Storing this ensures the verdict is + self-contained and understandable, especially if + the original rubric definition changes or was + dynamically generated. + verdict (bool): + Required. Outcome of the evaluation against the rubric, + represented as a boolean. ``true`` indicates a "Pass", + ``false`` indicates a "Fail". + reasoning (str): + Optional. Human-readable reasoning or + explanation for the verdict. This can include + specific examples or details from the evaluated + content that justify the given verdict. + + This field is a member of `oneof`_ ``_reasoning``. + """ + + evaluated_rubric: "Rubric" = proto.Field( + proto.MESSAGE, + number=1, + message="Rubric", + ) + verdict: bool = proto.Field( + proto.BOOL, + number=2, + ) + reasoning: str = proto.Field( + proto.STRING, + number=3, + optional=True, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1beta1/types/evaluation_service.py b/google/cloud/aiplatform_v1beta1/types/evaluation_service.py index 22162001b3..b005a4bd9c 100644 --- a/google/cloud/aiplatform_v1beta1/types/evaluation_service.py +++ b/google/cloud/aiplatform_v1beta1/types/evaluation_service.py @@ -19,10 +19,14 @@ import proto # type: ignore -from google.cloud.aiplatform_v1beta1.types import content +from google.cloud.aiplatform_v1beta1.types import content as gca_content +from google.cloud.aiplatform_v1beta1.types import evaluation_agent_data +from google.cloud.aiplatform_v1beta1.types import evaluation_rubric from google.cloud.aiplatform_v1beta1.types import io from google.cloud.aiplatform_v1beta1.types import operation +from google.cloud.aiplatform_v1beta1.types import tool as gca_tool import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore import google.rpc.status_pb2 as status_pb2 # type: ignore @@ -30,22 +34,28 @@ package="google.cloud.aiplatform.v1beta1", manifest={ "PairwiseChoice", - "EvaluateDatasetOperationMetadata", - "EvaluateDatasetResponse", - "OutputInfo", - "AggregationOutput", - "AggregationResult", - "EvaluateDatasetRequest", - "OutputConfig", + "EvaluateInstancesRequest", "Metric", - "EvaluationDataset", + "MetricMetadata", + "MetricSource", + "EvaluationInstance", "AutoraterConfig", - "EvaluateInstancesRequest", "EvaluateInstancesResponse", "MetricResult", + "GenerateInstanceRubricsRequest", + "GenerateInstanceRubricsResponse", + "EvaluateDatasetRequest", + "OutputConfig", + "EvaluationDataset", + "EvaluateDatasetResponse", + "EvaluateDatasetOperationMetadata", + "OutputInfo", + "AggregationOutput", + "AggregationResult", "PredefinedMetricSpec", "ComputationBasedMetricSpec", "LLMBasedMetricSpec", + "CustomCodeExecutionSpec", "ExactMatchInput", "ExactMatchInstance", "ExactMatchSpec", @@ -61,6 +71,7 @@ "RougeSpec", "RougeResults", "RougeMetricValue", + "CustomCodeExecutionResult", "CoherenceInput", "CoherenceInstance", "CoherenceSpec", @@ -194,6 +205,8 @@ "Trajectory", "ToolCall", "ContentMap", + "EvaluationParserConfig", + "RubricGenerationSpec", }, ) @@ -218,227 +231,404 @@ class PairwiseChoice(proto.Enum): TIE = 3 -class EvaluateDatasetOperationMetadata(proto.Message): - r"""Operation metadata for Dataset Evaluation. +class EvaluateInstancesRequest(proto.Message): + r"""Request message for EvaluationService.EvaluateInstances. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - generic_metadata (google.cloud.aiplatform_v1beta1.types.GenericOperationMetadata): - Generic operation metadata. - """ + exact_match_input (google.cloud.aiplatform_v1beta1.types.ExactMatchInput): + Auto metric instances. + Instances and metric spec for exact match + metric. - generic_metadata: operation.GenericOperationMetadata = proto.Field( - proto.MESSAGE, - number=1, - message=operation.GenericOperationMetadata, - ) + This field is a member of `oneof`_ ``metric_inputs``. + bleu_input (google.cloud.aiplatform_v1beta1.types.BleuInput): + Instances and metric spec for bleu metric. + This field is a member of `oneof`_ ``metric_inputs``. + rouge_input (google.cloud.aiplatform_v1beta1.types.RougeInput): + Instances and metric spec for rouge metric. -class EvaluateDatasetResponse(proto.Message): - r"""The results from an evaluation run performed by the - EvaluationService. + This field is a member of `oneof`_ ``metric_inputs``. + fluency_input (google.cloud.aiplatform_v1beta1.types.FluencyInput): + LLM-based metric instance. + General text generation metrics, applicable to + other categories. Input for fluency metric. - Attributes: - aggregation_output (google.cloud.aiplatform_v1beta1.types.AggregationOutput): - Output only. Aggregation statistics derived - from results of EvaluationService. - output_info (google.cloud.aiplatform_v1beta1.types.OutputInfo): - Output only. Output info for - EvaluationService. - """ + This field is a member of `oneof`_ ``metric_inputs``. + coherence_input (google.cloud.aiplatform_v1beta1.types.CoherenceInput): + Input for coherence metric. - aggregation_output: "AggregationOutput" = proto.Field( - proto.MESSAGE, - number=1, - message="AggregationOutput", - ) - output_info: "OutputInfo" = proto.Field( - proto.MESSAGE, - number=3, - message="OutputInfo", - ) + This field is a member of `oneof`_ ``metric_inputs``. + safety_input (google.cloud.aiplatform_v1beta1.types.SafetyInput): + Input for safety metric. + This field is a member of `oneof`_ ``metric_inputs``. + groundedness_input (google.cloud.aiplatform_v1beta1.types.GroundednessInput): + Input for groundedness metric. -class OutputInfo(proto.Message): - r"""Describes the info for output of EvaluationService. + This field is a member of `oneof`_ ``metric_inputs``. + fulfillment_input (google.cloud.aiplatform_v1beta1.types.FulfillmentInput): + Input for fulfillment metric. - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + This field is a member of `oneof`_ ``metric_inputs``. + summarization_quality_input (google.cloud.aiplatform_v1beta1.types.SummarizationQualityInput): + Input for summarization quality metric. - Attributes: - gcs_output_directory (str): - Output only. The full path of the Cloud - Storage directory created, into which the - evaluation results and aggregation results are - written. + This field is a member of `oneof`_ ``metric_inputs``. + pairwise_summarization_quality_input (google.cloud.aiplatform_v1beta1.types.PairwiseSummarizationQualityInput): + Input for pairwise summarization quality + metric. - This field is a member of `oneof`_ ``output_location``. - """ + This field is a member of `oneof`_ ``metric_inputs``. + summarization_helpfulness_input (google.cloud.aiplatform_v1beta1.types.SummarizationHelpfulnessInput): + Input for summarization helpfulness metric. - gcs_output_directory: str = proto.Field( - proto.STRING, - number=1, - oneof="output_location", - ) + This field is a member of `oneof`_ ``metric_inputs``. + summarization_verbosity_input (google.cloud.aiplatform_v1beta1.types.SummarizationVerbosityInput): + Input for summarization verbosity metric. + This field is a member of `oneof`_ ``metric_inputs``. + question_answering_quality_input (google.cloud.aiplatform_v1beta1.types.QuestionAnsweringQualityInput): + Input for question answering quality metric. -class AggregationOutput(proto.Message): - r"""The aggregation result for the entire dataset and all - metrics. + This field is a member of `oneof`_ ``metric_inputs``. + pairwise_question_answering_quality_input (google.cloud.aiplatform_v1beta1.types.PairwiseQuestionAnsweringQualityInput): + Input for pairwise question answering quality + metric. - Attributes: - dataset (google.cloud.aiplatform_v1beta1.types.EvaluationDataset): - The dataset used for evaluation & - aggregation. - aggregation_results (MutableSequence[google.cloud.aiplatform_v1beta1.types.AggregationResult]): - One AggregationResult per metric. - """ + This field is a member of `oneof`_ ``metric_inputs``. + question_answering_relevance_input (google.cloud.aiplatform_v1beta1.types.QuestionAnsweringRelevanceInput): + Input for question answering relevance + metric. - dataset: "EvaluationDataset" = proto.Field( - proto.MESSAGE, - number=1, - message="EvaluationDataset", - ) - aggregation_results: MutableSequence["AggregationResult"] = proto.RepeatedField( - proto.MESSAGE, - number=2, - message="AggregationResult", - ) + This field is a member of `oneof`_ ``metric_inputs``. + question_answering_helpfulness_input (google.cloud.aiplatform_v1beta1.types.QuestionAnsweringHelpfulnessInput): + Input for question answering helpfulness + metric. + This field is a member of `oneof`_ ``metric_inputs``. + question_answering_correctness_input (google.cloud.aiplatform_v1beta1.types.QuestionAnsweringCorrectnessInput): + Input for question answering correctness + metric. -class AggregationResult(proto.Message): - r"""The aggregation result for a single metric. + This field is a member of `oneof`_ ``metric_inputs``. + pointwise_metric_input (google.cloud.aiplatform_v1beta1.types.PointwiseMetricInput): + Input for pointwise metric. - This message has `oneof`_ fields (mutually exclusive fields). - For each oneof, at most one member field can be set at the same time. - Setting any member of the oneof automatically clears all other - members. + This field is a member of `oneof`_ ``metric_inputs``. + pairwise_metric_input (google.cloud.aiplatform_v1beta1.types.PairwiseMetricInput): + Input for pairwise metric. - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + This field is a member of `oneof`_ ``metric_inputs``. + tool_call_valid_input (google.cloud.aiplatform_v1beta1.types.ToolCallValidInput): + Tool call metric instances. + Input for tool call valid metric. - Attributes: - pointwise_metric_result (google.cloud.aiplatform_v1beta1.types.PointwiseMetricResult): - Result for pointwise metric. + This field is a member of `oneof`_ ``metric_inputs``. + tool_name_match_input (google.cloud.aiplatform_v1beta1.types.ToolNameMatchInput): + Input for tool name match metric. - This field is a member of `oneof`_ ``aggregation_result``. - pairwise_metric_result (google.cloud.aiplatform_v1beta1.types.PairwiseMetricResult): - Result for pairwise metric. + This field is a member of `oneof`_ ``metric_inputs``. + tool_parameter_key_match_input (google.cloud.aiplatform_v1beta1.types.ToolParameterKeyMatchInput): + Input for tool parameter key match metric. - This field is a member of `oneof`_ ``aggregation_result``. - exact_match_metric_value (google.cloud.aiplatform_v1beta1.types.ExactMatchMetricValue): - Results for exact match metric. + This field is a member of `oneof`_ ``metric_inputs``. + tool_parameter_kv_match_input (google.cloud.aiplatform_v1beta1.types.ToolParameterKVMatchInput): + Input for tool parameter key value match + metric. - This field is a member of `oneof`_ ``aggregation_result``. - bleu_metric_value (google.cloud.aiplatform_v1beta1.types.BleuMetricValue): - Results for bleu metric. + This field is a member of `oneof`_ ``metric_inputs``. + comet_input (google.cloud.aiplatform_v1beta1.types.CometInput): + Translation metrics. + Input for Comet metric. - This field is a member of `oneof`_ ``aggregation_result``. - rouge_metric_value (google.cloud.aiplatform_v1beta1.types.RougeMetricValue): - Results for rouge metric. + This field is a member of `oneof`_ ``metric_inputs``. + metricx_input (google.cloud.aiplatform_v1beta1.types.MetricxInput): + Input for Metricx metric. - This field is a member of `oneof`_ ``aggregation_result``. - aggregation_metric (google.cloud.aiplatform_v1beta1.types.Metric.AggregationMetric): - Aggregation metric. + This field is a member of `oneof`_ ``metric_inputs``. + trajectory_exact_match_input (google.cloud.aiplatform_v1beta1.types.TrajectoryExactMatchInput): + Input for trajectory exact match metric. + + This field is a member of `oneof`_ ``metric_inputs``. + trajectory_in_order_match_input (google.cloud.aiplatform_v1beta1.types.TrajectoryInOrderMatchInput): + Input for trajectory in order match metric. + + This field is a member of `oneof`_ ``metric_inputs``. + trajectory_any_order_match_input (google.cloud.aiplatform_v1beta1.types.TrajectoryAnyOrderMatchInput): + Input for trajectory match any order metric. + + This field is a member of `oneof`_ ``metric_inputs``. + trajectory_precision_input (google.cloud.aiplatform_v1beta1.types.TrajectoryPrecisionInput): + Input for trajectory precision metric. + + This field is a member of `oneof`_ ``metric_inputs``. + trajectory_recall_input (google.cloud.aiplatform_v1beta1.types.TrajectoryRecallInput): + Input for trajectory recall metric. + + This field is a member of `oneof`_ ``metric_inputs``. + trajectory_single_tool_use_input (google.cloud.aiplatform_v1beta1.types.TrajectorySingleToolUseInput): + Input for trajectory single tool use metric. + + This field is a member of `oneof`_ ``metric_inputs``. + rubric_based_instruction_following_input (google.cloud.aiplatform_v1beta1.types.RubricBasedInstructionFollowingInput): + Rubric Based Instruction Following metric. + + This field is a member of `oneof`_ ``metric_inputs``. + location (str): + Required. The resource name of the Location to evaluate the + instances. Format: + ``projects/{project}/locations/{location}`` + metrics (MutableSequence[google.cloud.aiplatform_v1beta1.types.Metric]): + The metrics used for evaluation. + Currently, we only support evaluating a single + metric. If multiple metrics are provided, only + the first one will be evaluated. + metric_sources (MutableSequence[google.cloud.aiplatform_v1beta1.types.MetricSource]): + Optional. The metrics (either inline or + registered) used for evaluation. Currently, we + only support evaluating a single metric. If + multiple metrics are provided, only the first + one will be evaluated. + instance (google.cloud.aiplatform_v1beta1.types.EvaluationInstance): + The instance to be evaluated. + autorater_config (google.cloud.aiplatform_v1beta1.types.AutoraterConfig): + Optional. Autorater config used for + evaluation. """ - pointwise_metric_result: "PointwiseMetricResult" = proto.Field( + exact_match_input: "ExactMatchInput" = proto.Field( proto.MESSAGE, - number=5, - oneof="aggregation_result", - message="PointwiseMetricResult", + number=2, + oneof="metric_inputs", + message="ExactMatchInput", ) - pairwise_metric_result: "PairwiseMetricResult" = proto.Field( + bleu_input: "BleuInput" = proto.Field( proto.MESSAGE, - number=6, - oneof="aggregation_result", - message="PairwiseMetricResult", - ) - exact_match_metric_value: "ExactMatchMetricValue" = proto.Field( + number=3, + oneof="metric_inputs", + message="BleuInput", + ) + rouge_input: "RougeInput" = proto.Field( proto.MESSAGE, - number=7, - oneof="aggregation_result", - message="ExactMatchMetricValue", + number=4, + oneof="metric_inputs", + message="RougeInput", ) - bleu_metric_value: "BleuMetricValue" = proto.Field( + fluency_input: "FluencyInput" = proto.Field( + proto.MESSAGE, + number=5, + oneof="metric_inputs", + message="FluencyInput", + ) + coherence_input: "CoherenceInput" = proto.Field( + proto.MESSAGE, + number=6, + oneof="metric_inputs", + message="CoherenceInput", + ) + safety_input: "SafetyInput" = proto.Field( proto.MESSAGE, number=8, - oneof="aggregation_result", - message="BleuMetricValue", + oneof="metric_inputs", + message="SafetyInput", ) - rouge_metric_value: "RougeMetricValue" = proto.Field( + groundedness_input: "GroundednessInput" = proto.Field( proto.MESSAGE, number=9, - oneof="aggregation_result", - message="RougeMetricValue", + oneof="metric_inputs", + message="GroundednessInput", ) - aggregation_metric: "Metric.AggregationMetric" = proto.Field( - proto.ENUM, - number=4, - enum="Metric.AggregationMetric", + fulfillment_input: "FulfillmentInput" = proto.Field( + proto.MESSAGE, + number=12, + oneof="metric_inputs", + message="FulfillmentInput", + ) + summarization_quality_input: "SummarizationQualityInput" = proto.Field( + proto.MESSAGE, + number=7, + oneof="metric_inputs", + message="SummarizationQualityInput", + ) + pairwise_summarization_quality_input: "PairwiseSummarizationQualityInput" = ( + proto.Field( + proto.MESSAGE, + number=23, + oneof="metric_inputs", + message="PairwiseSummarizationQualityInput", + ) + ) + summarization_helpfulness_input: "SummarizationHelpfulnessInput" = proto.Field( + proto.MESSAGE, + number=14, + oneof="metric_inputs", + message="SummarizationHelpfulnessInput", + ) + summarization_verbosity_input: "SummarizationVerbosityInput" = proto.Field( + proto.MESSAGE, + number=15, + oneof="metric_inputs", + message="SummarizationVerbosityInput", + ) + question_answering_quality_input: "QuestionAnsweringQualityInput" = proto.Field( + proto.MESSAGE, + number=10, + oneof="metric_inputs", + message="QuestionAnsweringQualityInput", + ) + pairwise_question_answering_quality_input: ( + "PairwiseQuestionAnsweringQualityInput" + ) = proto.Field( + proto.MESSAGE, + number=24, + oneof="metric_inputs", + message="PairwiseQuestionAnsweringQualityInput", + ) + question_answering_relevance_input: "QuestionAnsweringRelevanceInput" = proto.Field( + proto.MESSAGE, + number=16, + oneof="metric_inputs", + message="QuestionAnsweringRelevanceInput", + ) + question_answering_helpfulness_input: "QuestionAnsweringHelpfulnessInput" = ( + proto.Field( + proto.MESSAGE, + number=17, + oneof="metric_inputs", + message="QuestionAnsweringHelpfulnessInput", + ) + ) + question_answering_correctness_input: "QuestionAnsweringCorrectnessInput" = ( + proto.Field( + proto.MESSAGE, + number=18, + oneof="metric_inputs", + message="QuestionAnsweringCorrectnessInput", + ) + ) + pointwise_metric_input: "PointwiseMetricInput" = proto.Field( + proto.MESSAGE, + number=28, + oneof="metric_inputs", + message="PointwiseMetricInput", + ) + pairwise_metric_input: "PairwiseMetricInput" = proto.Field( + proto.MESSAGE, + number=29, + oneof="metric_inputs", + message="PairwiseMetricInput", + ) + tool_call_valid_input: "ToolCallValidInput" = proto.Field( + proto.MESSAGE, + number=19, + oneof="metric_inputs", + message="ToolCallValidInput", + ) + tool_name_match_input: "ToolNameMatchInput" = proto.Field( + proto.MESSAGE, + number=20, + oneof="metric_inputs", + message="ToolNameMatchInput", + ) + tool_parameter_key_match_input: "ToolParameterKeyMatchInput" = proto.Field( + proto.MESSAGE, + number=21, + oneof="metric_inputs", + message="ToolParameterKeyMatchInput", + ) + tool_parameter_kv_match_input: "ToolParameterKVMatchInput" = proto.Field( + proto.MESSAGE, + number=22, + oneof="metric_inputs", + message="ToolParameterKVMatchInput", + ) + comet_input: "CometInput" = proto.Field( + proto.MESSAGE, + number=31, + oneof="metric_inputs", + message="CometInput", + ) + metricx_input: "MetricxInput" = proto.Field( + proto.MESSAGE, + number=32, + oneof="metric_inputs", + message="MetricxInput", + ) + trajectory_exact_match_input: "TrajectoryExactMatchInput" = proto.Field( + proto.MESSAGE, + number=33, + oneof="metric_inputs", + message="TrajectoryExactMatchInput", + ) + trajectory_in_order_match_input: "TrajectoryInOrderMatchInput" = proto.Field( + proto.MESSAGE, + number=34, + oneof="metric_inputs", + message="TrajectoryInOrderMatchInput", + ) + trajectory_any_order_match_input: "TrajectoryAnyOrderMatchInput" = proto.Field( + proto.MESSAGE, + number=35, + oneof="metric_inputs", + message="TrajectoryAnyOrderMatchInput", + ) + trajectory_precision_input: "TrajectoryPrecisionInput" = proto.Field( + proto.MESSAGE, + number=37, + oneof="metric_inputs", + message="TrajectoryPrecisionInput", + ) + trajectory_recall_input: "TrajectoryRecallInput" = proto.Field( + proto.MESSAGE, + number=38, + oneof="metric_inputs", + message="TrajectoryRecallInput", + ) + trajectory_single_tool_use_input: "TrajectorySingleToolUseInput" = proto.Field( + proto.MESSAGE, + number=39, + oneof="metric_inputs", + message="TrajectorySingleToolUseInput", + ) + rubric_based_instruction_following_input: "RubricBasedInstructionFollowingInput" = ( + proto.Field( + proto.MESSAGE, + number=40, + oneof="metric_inputs", + message="RubricBasedInstructionFollowingInput", + ) ) - - -class EvaluateDatasetRequest(proto.Message): - r"""Request message for EvaluationService.EvaluateDataset. - - Attributes: - location (str): - Required. The resource name of the Location to evaluate the - dataset. Format: ``projects/{project}/locations/{location}`` - dataset (google.cloud.aiplatform_v1beta1.types.EvaluationDataset): - Required. The dataset used for evaluation. - metrics (MutableSequence[google.cloud.aiplatform_v1beta1.types.Metric]): - Required. The metrics used for evaluation. - output_config (google.cloud.aiplatform_v1beta1.types.OutputConfig): - Required. Config for evaluation output. - autorater_config (google.cloud.aiplatform_v1beta1.types.AutoraterConfig): - Optional. Autorater config used for evaluation. Currently - only publisher Gemini models are supported. Format: - ``projects/{PROJECT}/locations/{LOCATION}/publishers/google/models/{MODEL}.`` - """ - location: str = proto.Field( proto.STRING, number=1, ) - dataset: "EvaluationDataset" = proto.Field( - proto.MESSAGE, - number=2, - message="EvaluationDataset", - ) metrics: MutableSequence["Metric"] = proto.RepeatedField( proto.MESSAGE, - number=3, + number=49, message="Metric", ) - output_config: "OutputConfig" = proto.Field( + metric_sources: MutableSequence["MetricSource"] = proto.RepeatedField( proto.MESSAGE, - number=4, - message="OutputConfig", + number=52, + message="MetricSource", ) - autorater_config: "AutoraterConfig" = proto.Field( + instance: "EvaluationInstance" = proto.Field( proto.MESSAGE, - number=5, - message="AutoraterConfig", + number=50, + message="EvaluationInstance", ) - - -class OutputConfig(proto.Message): - r"""Config for evaluation output. - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - gcs_destination (google.cloud.aiplatform_v1beta1.types.GcsDestination): - Cloud storage destination for evaluation - output. - - This field is a member of `oneof`_ ``destination``. - """ - - gcs_destination: io.GcsDestination = proto.Field( + autorater_config: "AutoraterConfig" = proto.Field( proto.MESSAGE, - number=1, - oneof="destination", - message=io.GcsDestination, + number=30, + message="AutoraterConfig", ) @@ -464,6 +654,10 @@ class Metric(proto.Message): llm_based_metric_spec (google.cloud.aiplatform_v1beta1.types.LLMBasedMetricSpec): Spec for an LLM based metric. + This field is a member of `oneof`_ ``metric_spec``. + custom_code_execution_spec (google.cloud.aiplatform_v1beta1.types.CustomCodeExecutionSpec): + Spec for Custom Code Execution metric. + This field is a member of `oneof`_ ``metric_spec``. pointwise_metric_spec (google.cloud.aiplatform_v1beta1.types.PointwiseMetricSpec): Spec for pointwise metric. @@ -487,6 +681,9 @@ class Metric(proto.Message): This field is a member of `oneof`_ ``metric_spec``. aggregation_metrics (MutableSequence[google.cloud.aiplatform_v1beta1.types.Metric.AggregationMetric]): Optional. The aggregation metrics to use. + metadata (google.cloud.aiplatform_v1beta1.types.MetricMetadata): + Optional. Metadata about the metric, used for + visualization and organization. """ class AggregationMetric(proto.Enum): @@ -557,6 +754,12 @@ class AggregationMetric(proto.Enum): oneof="metric_spec", message="LLMBasedMetricSpec", ) + custom_code_execution_spec: "CustomCodeExecutionSpec" = proto.Field( + proto.MESSAGE, + number=11, + oneof="metric_spec", + message="CustomCodeExecutionSpec", + ) pointwise_metric_spec: "PointwiseMetricSpec" = proto.Field( proto.MESSAGE, number=2, @@ -592,99 +795,97 @@ class AggregationMetric(proto.Enum): number=1, enum=AggregationMetric, ) - - -class EvaluationDataset(proto.Message): - r"""The dataset used for evaluation. - - This message has `oneof`_ fields (mutually exclusive fields). - For each oneof, at most one member field can be set at the same time. - Setting any member of the oneof automatically clears all other - members. - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - - Attributes: - gcs_source (google.cloud.aiplatform_v1beta1.types.GcsSource): - Cloud storage source holds the dataset. - Currently only one Cloud Storage file path is - supported. - - This field is a member of `oneof`_ ``source``. - bigquery_source (google.cloud.aiplatform_v1beta1.types.BigQuerySource): - BigQuery source holds the dataset. - - This field is a member of `oneof`_ ``source``. - """ - - gcs_source: io.GcsSource = proto.Field( - proto.MESSAGE, - number=1, - oneof="source", - message=io.GcsSource, - ) - bigquery_source: io.BigQuerySource = proto.Field( + metadata: "MetricMetadata" = proto.Field( proto.MESSAGE, - number=2, - oneof="source", - message=io.BigQuerySource, + number=13, + message="MetricMetadata", ) -class AutoraterConfig(proto.Message): - r"""The configs for autorater. This is applicable to both - EvaluateInstances and EvaluateDataset. - - - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields +class MetricMetadata(proto.Message): + r"""Metadata about the metric, used for visualization and + organization. Attributes: - sampling_count (int): - Optional. Number of samples for each instance - in the dataset. If not specified, the default is - 4. Minimum value is 1, maximum value is 32. + title (str): + Optional. The user-friendly name for the + metric. If not set for a registered metric, it + will default to the metric's display name. + score_range (google.cloud.aiplatform_v1beta1.types.MetricMetadata.ScoreRange): + Optional. The range of possible scores for + this metric, used for plotting. + other_metadata (google.protobuf.struct_pb2.Struct): + Optional. Flexible metadata for user-defined + attributes. + """ - This field is a member of `oneof`_ ``_sampling_count``. - flip_enabled (bool): - Optional. Default is true. Whether to flip the candidate and - baseline responses. This is only applicable to the pairwise - metric. If enabled, also provide - PairwiseMetricSpec.candidate_response_field_name and - PairwiseMetricSpec.baseline_response_field_name. When - rendering PairwiseMetricSpec.metric_prompt_template, the - candidate and baseline fields will be flipped for half of - the samples to reduce bias. + class ScoreRange(proto.Message): + r"""The range of possible scores for this metric, used for + plotting. - This field is a member of `oneof`_ ``_flip_enabled``. - autorater_model (str): - Optional. The fully qualified name of the publisher model or - tuned autorater endpoint to use. - Publisher model format: - ``projects/{project}/locations/{location}/publishers/*/models/*`` + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - Tuned model endpoint format: - ``projects/{project}/locations/{location}/endpoints/{endpoint}`` - """ + Attributes: + min_ (float): + Required. The minimum value of the score + range (inclusive). + + This field is a member of `oneof`_ ``_min``. + max_ (float): + Required. The maximum value of the score + range (inclusive). + + This field is a member of `oneof`_ ``_max``. + step (float): + Optional. The distance between discrete steps + in the range. If unset, the range is assumed to + be continuous. + + This field is a member of `oneof`_ ``_step``. + description (str): + Optional. The description of the score + explaining the directionality etc. + """ - sampling_count: int = proto.Field( - proto.INT32, + min_: float = proto.Field( + proto.DOUBLE, + number=1, + optional=True, + ) + max_: float = proto.Field( + proto.DOUBLE, + number=2, + optional=True, + ) + step: float = proto.Field( + proto.DOUBLE, + number=3, + optional=True, + ) + description: str = proto.Field( + proto.STRING, + number=4, + ) + + title: str = proto.Field( + proto.STRING, number=1, - optional=True, ) - flip_enabled: bool = proto.Field( - proto.BOOL, + score_range: ScoreRange = proto.Field( + proto.MESSAGE, number=2, - optional=True, + message=ScoreRange, ) - autorater_model: str = proto.Field( - proto.STRING, + other_metadata: struct_pb2.Struct = proto.Field( + proto.MESSAGE, number=3, + message=struct_pb2.Struct, ) -class EvaluateInstancesRequest(proto.Message): - r"""Request message for EvaluationService.EvaluateInstances. +class MetricSource(proto.Message): + r"""The metric source used for evaluation. This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. @@ -694,365 +895,528 @@ class EvaluateInstancesRequest(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - exact_match_input (google.cloud.aiplatform_v1beta1.types.ExactMatchInput): - Auto metric instances. - Instances and metric spec for exact match - metric. - - This field is a member of `oneof`_ ``metric_inputs``. - bleu_input (google.cloud.aiplatform_v1beta1.types.BleuInput): - Instances and metric spec for bleu metric. - - This field is a member of `oneof`_ ``metric_inputs``. - rouge_input (google.cloud.aiplatform_v1beta1.types.RougeInput): - Instances and metric spec for rouge metric. - - This field is a member of `oneof`_ ``metric_inputs``. - fluency_input (google.cloud.aiplatform_v1beta1.types.FluencyInput): - LLM-based metric instance. - General text generation metrics, applicable to - other categories. Input for fluency metric. + metric (google.cloud.aiplatform_v1beta1.types.Metric): + Inline metric config. - This field is a member of `oneof`_ ``metric_inputs``. - coherence_input (google.cloud.aiplatform_v1beta1.types.CoherenceInput): - Input for coherence metric. + This field is a member of `oneof`_ ``metric_source``. + metric_resource_name (str): + Resource name for registered metric. - This field is a member of `oneof`_ ``metric_inputs``. - safety_input (google.cloud.aiplatform_v1beta1.types.SafetyInput): - Input for safety metric. - - This field is a member of `oneof`_ ``metric_inputs``. - groundedness_input (google.cloud.aiplatform_v1beta1.types.GroundednessInput): - Input for groundedness metric. - - This field is a member of `oneof`_ ``metric_inputs``. - fulfillment_input (google.cloud.aiplatform_v1beta1.types.FulfillmentInput): - Input for fulfillment metric. + This field is a member of `oneof`_ ``metric_source``. + """ - This field is a member of `oneof`_ ``metric_inputs``. - summarization_quality_input (google.cloud.aiplatform_v1beta1.types.SummarizationQualityInput): - Input for summarization quality metric. + metric: "Metric" = proto.Field( + proto.MESSAGE, + number=1, + oneof="metric_source", + message="Metric", + ) + metric_resource_name: str = proto.Field( + proto.STRING, + number=2, + oneof="metric_source", + ) + + +class EvaluationInstance(proto.Message): + r"""A single instance to be evaluated. + Instances are used to specify the input data for evaluation, + from simple string comparisons to complex, multi-turn model + evaluations + + Attributes: + prompt (google.cloud.aiplatform_v1beta1.types.EvaluationInstance.InstanceData): + Optional. Data used to populate placeholder ``prompt`` in a + metric prompt template. + rubric_groups (MutableMapping[str, google.cloud.aiplatform_v1beta1.types.RubricGroup]): + Optional. Named groups of rubrics associated + with the prompt. This is used for rubric-based + evaluations where rubrics can be referenced by a + key. The key could represent versions, + associated metrics, etc. + response (google.cloud.aiplatform_v1beta1.types.EvaluationInstance.InstanceData): + Optional. Data used to populate placeholder ``response`` in + a metric prompt template. + reference (google.cloud.aiplatform_v1beta1.types.EvaluationInstance.InstanceData): + Optional. Data used to populate placeholder ``reference`` in + a metric prompt template. + other_data (google.cloud.aiplatform_v1beta1.types.EvaluationInstance.MapInstance): + Optional. Other data used to populate placeholders based on + their key. If a key conflicts with a field in the + EvaluationInstance (e.g. ``prompt``), the value of the field + will take precedence over the value in other_data. + agent_data (google.cloud.aiplatform_v1beta1.types.EvaluationInstance.DeprecatedAgentData): + Optional. Deprecated: Use ``agent_eval_data`` instead. Data + used for agent evaluation. + agent_eval_data (google.cloud.aiplatform_v1beta1.types.AgentData): + Optional. Data used for agent evaluation. + """ + + class InstanceData(proto.Message): + r"""Instance data used to populate placeholders in a metric + prompt template. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - This field is a member of `oneof`_ ``metric_inputs``. - pairwise_summarization_quality_input (google.cloud.aiplatform_v1beta1.types.PairwiseSummarizationQualityInput): - Input for pairwise summarization quality - metric. + Attributes: + text (str): + Text data. - This field is a member of `oneof`_ ``metric_inputs``. - summarization_helpfulness_input (google.cloud.aiplatform_v1beta1.types.SummarizationHelpfulnessInput): - Input for summarization helpfulness metric. + This field is a member of `oneof`_ ``data``. + contents (google.cloud.aiplatform_v1beta1.types.EvaluationInstance.InstanceData.Contents): + List of Gemini content data. - This field is a member of `oneof`_ ``metric_inputs``. - summarization_verbosity_input (google.cloud.aiplatform_v1beta1.types.SummarizationVerbosityInput): - Input for summarization verbosity metric. + This field is a member of `oneof`_ ``data``. + """ - This field is a member of `oneof`_ ``metric_inputs``. - question_answering_quality_input (google.cloud.aiplatform_v1beta1.types.QuestionAnsweringQualityInput): - Input for question answering quality metric. + class Contents(proto.Message): + r"""List of standard Content messages from Gemini API. - This field is a member of `oneof`_ ``metric_inputs``. - pairwise_question_answering_quality_input (google.cloud.aiplatform_v1beta1.types.PairwiseQuestionAnsweringQualityInput): - Input for pairwise question answering quality - metric. + Attributes: + contents (MutableSequence[google.cloud.aiplatform_v1beta1.types.Content]): + Optional. Repeated contents. + """ - This field is a member of `oneof`_ ``metric_inputs``. - question_answering_relevance_input (google.cloud.aiplatform_v1beta1.types.QuestionAnsweringRelevanceInput): - Input for question answering relevance - metric. + contents: MutableSequence[gca_content.Content] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gca_content.Content, + ) - This field is a member of `oneof`_ ``metric_inputs``. - question_answering_helpfulness_input (google.cloud.aiplatform_v1beta1.types.QuestionAnsweringHelpfulnessInput): - Input for question answering helpfulness - metric. - - This field is a member of `oneof`_ ``metric_inputs``. - question_answering_correctness_input (google.cloud.aiplatform_v1beta1.types.QuestionAnsweringCorrectnessInput): - Input for question answering correctness - metric. + text: str = proto.Field( + proto.STRING, + number=1, + oneof="data", + ) + contents: "EvaluationInstance.InstanceData.Contents" = proto.Field( + proto.MESSAGE, + number=2, + oneof="data", + message="EvaluationInstance.InstanceData.Contents", + ) - This field is a member of `oneof`_ ``metric_inputs``. - pointwise_metric_input (google.cloud.aiplatform_v1beta1.types.PointwiseMetricInput): - Input for pointwise metric. + class MapInstance(proto.Message): + r"""Instance data specified as a map. - This field is a member of `oneof`_ ``metric_inputs``. - pairwise_metric_input (google.cloud.aiplatform_v1beta1.types.PairwiseMetricInput): - Input for pairwise metric. + Attributes: + map_instance (MutableMapping[str, google.cloud.aiplatform_v1beta1.types.EvaluationInstance.InstanceData]): + Optional. Map of instance data. + """ - This field is a member of `oneof`_ ``metric_inputs``. - tool_call_valid_input (google.cloud.aiplatform_v1beta1.types.ToolCallValidInput): - Tool call metric instances. - Input for tool call valid metric. + map_instance: MutableMapping[str, "EvaluationInstance.InstanceData"] = ( + proto.MapField( + proto.STRING, + proto.MESSAGE, + number=1, + message="EvaluationInstance.InstanceData", + ) + ) - This field is a member of `oneof`_ ``metric_inputs``. - tool_name_match_input (google.cloud.aiplatform_v1beta1.types.ToolNameMatchInput): - Input for tool name match metric. + class DeprecatedAgentData(proto.Message): + r"""Deprecated: Use ``agent_eval_data`` instead. Contains data specific + to agent evaluations. - This field is a member of `oneof`_ ``metric_inputs``. - tool_parameter_key_match_input (google.cloud.aiplatform_v1beta1.types.ToolParameterKeyMatchInput): - Input for tool parameter key match metric. + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. - This field is a member of `oneof`_ ``metric_inputs``. - tool_parameter_kv_match_input (google.cloud.aiplatform_v1beta1.types.ToolParameterKVMatchInput): - Input for tool parameter key value match - metric. + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - This field is a member of `oneof`_ ``metric_inputs``. - comet_input (google.cloud.aiplatform_v1beta1.types.CometInput): - Translation metrics. - Input for Comet metric. + Attributes: + tools_text (str): + A JSON string containing a list of tools + available to an agent with info such as name, + description, parameters and required parameters. + + This field is a member of `oneof`_ ``tools_data``. + tools (google.cloud.aiplatform_v1beta1.types.EvaluationInstance.DeprecatedAgentData.Tools): + List of tools. + + This field is a member of `oneof`_ ``tools_data``. + events (google.cloud.aiplatform_v1beta1.types.EvaluationInstance.DeprecatedAgentData.Events): + A list of events. + + This field is a member of `oneof`_ ``events_data``. + agents (MutableMapping[str, google.cloud.aiplatform_v1beta1.types.EvaluationInstance.DeprecatedAgentConfig]): + Optional. The static Agent Configuration. This map defines + the graph structure of the agent system. Key: agent_id + (matches the ``author`` field in events). Value: The static + configuration of the agent (tools, instructions, + sub-agents). + turns (MutableSequence[google.cloud.aiplatform_v1beta1.types.EvaluationInstance.DeprecatedAgentData.ConversationTurn]): + Optional. The chronological list of + conversation turns. Each turn represents a + logical execution cycle (e.g., User Input -> + Agent Response). + developer_instruction (google.cloud.aiplatform_v1beta1.types.EvaluationInstance.InstanceData): + Optional. Deprecated: Use ``agents.developer_instruction`` + or ``turns.events.active_instruction`` instead. A field + containing instructions from the developer for the agent. + agent_config (google.cloud.aiplatform_v1beta1.types.EvaluationInstance.DeprecatedAgentConfig): + Optional. Deprecated: Use ``agent_eval_data`` instead. Agent + configuration. + """ - This field is a member of `oneof`_ ``metric_inputs``. - metricx_input (google.cloud.aiplatform_v1beta1.types.MetricxInput): - Input for Metricx metric. + class ConversationTurn(proto.Message): + r"""Represents a single turn/invocation in the conversation. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + turn_index (int): + Required. The 0-based index of the turn in + the conversation sequence. + + This field is a member of `oneof`_ ``_turn_index``. + turn_id (str): + Optional. A unique identifier for the turn. + Useful for referencing specific turns across + systems. + events (MutableSequence[google.cloud.aiplatform_v1beta1.types.EvaluationInstance.DeprecatedAgentData.AgentEvent]): + Optional. The list of events that occurred + during this turn. + """ + + turn_index: int = proto.Field( + proto.INT32, + number=1, + optional=True, + ) + turn_id: str = proto.Field( + proto.STRING, + number=2, + ) + events: MutableSequence[ + "EvaluationInstance.DeprecatedAgentData.AgentEvent" + ] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message="EvaluationInstance.DeprecatedAgentData.AgentEvent", + ) + + class AgentEvent(proto.Message): + r"""A single event in the execution trace. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + author (str): + Required. The ID of the agent or entity that + generated this event. + + This field is a member of `oneof`_ ``_author``. + content (google.cloud.aiplatform_v1beta1.types.Content): + Required. The content of the event (e.g., + text response, tool call, tool response). + event_time (google.protobuf.timestamp_pb2.Timestamp): + Optional. The timestamp when the event + occurred. + state_delta (google.protobuf.struct_pb2.Struct): + Optional. The change in the session state + caused by this event. This is a key-value map of + fields that were modified or added by the event. + active_tools (MutableSequence[google.cloud.aiplatform_v1beta1.types.Tool]): + Optional. The list of tools that were active/available to + the agent at the time of this event. This overrides the + ``AgentConfig.tools`` if set. + """ + + author: str = proto.Field( + proto.STRING, + number=1, + optional=True, + ) + content: gca_content.Content = proto.Field( + proto.MESSAGE, + number=2, + message=gca_content.Content, + ) + event_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + state_delta: struct_pb2.Struct = proto.Field( + proto.MESSAGE, + number=4, + message=struct_pb2.Struct, + ) + active_tools: MutableSequence[gca_tool.Tool] = proto.RepeatedField( + proto.MESSAGE, + number=5, + message=gca_tool.Tool, + ) + + class Tools(proto.Message): + r"""Deprecated: Use ``agent_eval_data`` instead. Represents a list of + tools for an agent. + + Attributes: + tool (MutableSequence[google.cloud.aiplatform_v1beta1.types.Tool]): + Optional. List of tools: each tool can have + multiple function declarations. + """ + + tool: MutableSequence[gca_tool.Tool] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gca_tool.Tool, + ) + + class Events(proto.Message): + r"""Represents a list of events for an agent. + + Attributes: + event (MutableSequence[google.cloud.aiplatform_v1beta1.types.Content]): + Optional. A list of events. + """ + + event: MutableSequence[gca_content.Content] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gca_content.Content, + ) + + tools_text: str = proto.Field( + proto.STRING, + number=1, + oneof="tools_data", + ) + tools: "EvaluationInstance.DeprecatedAgentData.Tools" = proto.Field( + proto.MESSAGE, + number=2, + oneof="tools_data", + message="EvaluationInstance.DeprecatedAgentData.Tools", + ) + events: "EvaluationInstance.DeprecatedAgentData.Events" = proto.Field( + proto.MESSAGE, + number=5, + oneof="events_data", + message="EvaluationInstance.DeprecatedAgentData.Events", + ) + agents: MutableMapping[str, "EvaluationInstance.DeprecatedAgentConfig"] = ( + proto.MapField( + proto.STRING, + proto.MESSAGE, + number=7, + message="EvaluationInstance.DeprecatedAgentConfig", + ) + ) + turns: MutableSequence[ + "EvaluationInstance.DeprecatedAgentData.ConversationTurn" + ] = proto.RepeatedField( + proto.MESSAGE, + number=8, + message="EvaluationInstance.DeprecatedAgentData.ConversationTurn", + ) + developer_instruction: "EvaluationInstance.InstanceData" = proto.Field( + proto.MESSAGE, + number=3, + message="EvaluationInstance.InstanceData", + ) + agent_config: "EvaluationInstance.DeprecatedAgentConfig" = proto.Field( + proto.MESSAGE, + number=6, + message="EvaluationInstance.DeprecatedAgentConfig", + ) - This field is a member of `oneof`_ ``metric_inputs``. - trajectory_exact_match_input (google.cloud.aiplatform_v1beta1.types.TrajectoryExactMatchInput): - Input for trajectory exact match metric. + class DeprecatedAgentConfig(proto.Message): + r"""Deprecated: Use ``google.cloud.aiplatform.master.AgentConfig`` in + ``agent_eval_data`` instead. Configuration for an Agent. - This field is a member of `oneof`_ ``metric_inputs``. - trajectory_in_order_match_input (google.cloud.aiplatform_v1beta1.types.TrajectoryInOrderMatchInput): - Input for trajectory in order match metric. + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. - This field is a member of `oneof`_ ``metric_inputs``. - trajectory_any_order_match_input (google.cloud.aiplatform_v1beta1.types.TrajectoryAnyOrderMatchInput): - Input for trajectory match any order metric. + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields - This field is a member of `oneof`_ ``metric_inputs``. - trajectory_precision_input (google.cloud.aiplatform_v1beta1.types.TrajectoryPrecisionInput): - Input for trajectory precision metric. + Attributes: + tools_text (str): + A JSON string containing a list of tools + available to an agent with info such as name, + description, parameters and required parameters. + + This field is a member of `oneof`_ ``tools_data``. + tools (google.cloud.aiplatform_v1beta1.types.EvaluationInstance.DeprecatedAgentConfig.Tools): + List of tools. + + This field is a member of `oneof`_ ``tools_data``. + agent_id (str): + Optional. Unique identifier of the agent. This ID is used to + refer to this agent, e.g., in AgentEvent.author, or in the + ``sub_agents`` field. It must be unique within the + ``agents`` map. + agent_type (str): + Optional. The type or class of the agent + (e.g., "LlmAgent", "RouterAgent", + "ToolUseAgent"). Useful for the autorater to + understand the expected behavior of the agent. + description (str): + Optional. A high-level description of the + agent's role and responsibilities. Critical for + evaluating if the agent is routing tasks + correctly. + sub_agents (MutableSequence[str]): + Optional. The list of valid agent IDs (names) + that this agent can delegate to. This defines + the directed edges in the agent system graph + topology. + developer_instruction (google.cloud.aiplatform_v1beta1.types.EvaluationInstance.InstanceData): + Optional. Contains instructions from the developer for the + agent. Can be static or a dynamic prompt template used with + the ``AgentEvent.state_delta`` field. + """ - This field is a member of `oneof`_ ``metric_inputs``. - trajectory_recall_input (google.cloud.aiplatform_v1beta1.types.TrajectoryRecallInput): - Input for trajectory recall metric. + class Tools(proto.Message): + r"""Represents a list of tools for an agent. - This field is a member of `oneof`_ ``metric_inputs``. - trajectory_single_tool_use_input (google.cloud.aiplatform_v1beta1.types.TrajectorySingleToolUseInput): - Input for trajectory single tool use metric. + Attributes: + tool (MutableSequence[google.cloud.aiplatform_v1beta1.types.Tool]): + Optional. List of tools: each tool can have + multiple function declarations. + """ - This field is a member of `oneof`_ ``metric_inputs``. - rubric_based_instruction_following_input (google.cloud.aiplatform_v1beta1.types.RubricBasedInstructionFollowingInput): - Rubric Based Instruction Following metric. + tool: MutableSequence[gca_tool.Tool] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gca_tool.Tool, + ) - This field is a member of `oneof`_ ``metric_inputs``. - location (str): - Required. The resource name of the Location to evaluate the - instances. Format: - ``projects/{project}/locations/{location}`` - autorater_config (google.cloud.aiplatform_v1beta1.types.AutoraterConfig): - Optional. Autorater config used for - evaluation. - """ - - exact_match_input: "ExactMatchInput" = proto.Field( - proto.MESSAGE, - number=2, - oneof="metric_inputs", - message="ExactMatchInput", - ) - bleu_input: "BleuInput" = proto.Field( - proto.MESSAGE, - number=3, - oneof="metric_inputs", - message="BleuInput", - ) - rouge_input: "RougeInput" = proto.Field( - proto.MESSAGE, - number=4, - oneof="metric_inputs", - message="RougeInput", - ) - fluency_input: "FluencyInput" = proto.Field( - proto.MESSAGE, - number=5, - oneof="metric_inputs", - message="FluencyInput", - ) - coherence_input: "CoherenceInput" = proto.Field( - proto.MESSAGE, - number=6, - oneof="metric_inputs", - message="CoherenceInput", - ) - safety_input: "SafetyInput" = proto.Field( - proto.MESSAGE, - number=8, - oneof="metric_inputs", - message="SafetyInput", - ) - groundedness_input: "GroundednessInput" = proto.Field( - proto.MESSAGE, - number=9, - oneof="metric_inputs", - message="GroundednessInput", - ) - fulfillment_input: "FulfillmentInput" = proto.Field( - proto.MESSAGE, - number=12, - oneof="metric_inputs", - message="FulfillmentInput", - ) - summarization_quality_input: "SummarizationQualityInput" = proto.Field( - proto.MESSAGE, - number=7, - oneof="metric_inputs", - message="SummarizationQualityInput", - ) - pairwise_summarization_quality_input: "PairwiseSummarizationQualityInput" = ( - proto.Field( - proto.MESSAGE, - number=23, - oneof="metric_inputs", - message="PairwiseSummarizationQualityInput", + tools_text: str = proto.Field( + proto.STRING, + number=1, + oneof="tools_data", ) - ) - summarization_helpfulness_input: "SummarizationHelpfulnessInput" = proto.Field( - proto.MESSAGE, - number=14, - oneof="metric_inputs", - message="SummarizationHelpfulnessInput", - ) - summarization_verbosity_input: "SummarizationVerbosityInput" = proto.Field( - proto.MESSAGE, - number=15, - oneof="metric_inputs", - message="SummarizationVerbosityInput", - ) - question_answering_quality_input: "QuestionAnsweringQualityInput" = proto.Field( - proto.MESSAGE, - number=10, - oneof="metric_inputs", - message="QuestionAnsweringQualityInput", - ) - pairwise_question_answering_quality_input: ( - "PairwiseQuestionAnsweringQualityInput" - ) = proto.Field( - proto.MESSAGE, - number=24, - oneof="metric_inputs", - message="PairwiseQuestionAnsweringQualityInput", - ) - question_answering_relevance_input: "QuestionAnsweringRelevanceInput" = proto.Field( - proto.MESSAGE, - number=16, - oneof="metric_inputs", - message="QuestionAnsweringRelevanceInput", - ) - question_answering_helpfulness_input: "QuestionAnsweringHelpfulnessInput" = ( - proto.Field( + tools: "EvaluationInstance.DeprecatedAgentConfig.Tools" = proto.Field( proto.MESSAGE, - number=17, - oneof="metric_inputs", - message="QuestionAnsweringHelpfulnessInput", + number=2, + oneof="tools_data", + message="EvaluationInstance.DeprecatedAgentConfig.Tools", ) - ) - question_answering_correctness_input: "QuestionAnsweringCorrectnessInput" = ( - proto.Field( + agent_id: str = proto.Field( + proto.STRING, + number=4, + ) + agent_type: str = proto.Field( + proto.STRING, + number=5, + ) + description: str = proto.Field( + proto.STRING, + number=6, + ) + sub_agents: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=7, + ) + developer_instruction: "EvaluationInstance.InstanceData" = proto.Field( proto.MESSAGE, - number=18, - oneof="metric_inputs", - message="QuestionAnsweringCorrectnessInput", + number=3, + message="EvaluationInstance.InstanceData", ) - ) - pointwise_metric_input: "PointwiseMetricInput" = proto.Field( - proto.MESSAGE, - number=28, - oneof="metric_inputs", - message="PointwiseMetricInput", - ) - pairwise_metric_input: "PairwiseMetricInput" = proto.Field( - proto.MESSAGE, - number=29, - oneof="metric_inputs", - message="PairwiseMetricInput", - ) - tool_call_valid_input: "ToolCallValidInput" = proto.Field( - proto.MESSAGE, - number=19, - oneof="metric_inputs", - message="ToolCallValidInput", - ) - tool_name_match_input: "ToolNameMatchInput" = proto.Field( - proto.MESSAGE, - number=20, - oneof="metric_inputs", - message="ToolNameMatchInput", - ) - tool_parameter_key_match_input: "ToolParameterKeyMatchInput" = proto.Field( - proto.MESSAGE, - number=21, - oneof="metric_inputs", - message="ToolParameterKeyMatchInput", - ) - tool_parameter_kv_match_input: "ToolParameterKVMatchInput" = proto.Field( - proto.MESSAGE, - number=22, - oneof="metric_inputs", - message="ToolParameterKVMatchInput", - ) - comet_input: "CometInput" = proto.Field( + + prompt: InstanceData = proto.Field( proto.MESSAGE, - number=31, - oneof="metric_inputs", - message="CometInput", + number=1, + message=InstanceData, ) - metricx_input: "MetricxInput" = proto.Field( + rubric_groups: MutableMapping[str, evaluation_rubric.RubricGroup] = proto.MapField( + proto.STRING, proto.MESSAGE, - number=32, - oneof="metric_inputs", - message="MetricxInput", + number=2, + message=evaluation_rubric.RubricGroup, ) - trajectory_exact_match_input: "TrajectoryExactMatchInput" = proto.Field( + response: InstanceData = proto.Field( proto.MESSAGE, - number=33, - oneof="metric_inputs", - message="TrajectoryExactMatchInput", + number=3, + message=InstanceData, ) - trajectory_in_order_match_input: "TrajectoryInOrderMatchInput" = proto.Field( + reference: InstanceData = proto.Field( proto.MESSAGE, - number=34, - oneof="metric_inputs", - message="TrajectoryInOrderMatchInput", + number=4, + message=InstanceData, ) - trajectory_any_order_match_input: "TrajectoryAnyOrderMatchInput" = proto.Field( + other_data: MapInstance = proto.Field( proto.MESSAGE, - number=35, - oneof="metric_inputs", - message="TrajectoryAnyOrderMatchInput", + number=5, + message=MapInstance, ) - trajectory_precision_input: "TrajectoryPrecisionInput" = proto.Field( + agent_data: DeprecatedAgentData = proto.Field( proto.MESSAGE, - number=37, - oneof="metric_inputs", - message="TrajectoryPrecisionInput", + number=6, + message=DeprecatedAgentData, ) - trajectory_recall_input: "TrajectoryRecallInput" = proto.Field( + agent_eval_data: evaluation_agent_data.AgentData = proto.Field( proto.MESSAGE, - number=38, - oneof="metric_inputs", - message="TrajectoryRecallInput", + number=7, + message=evaluation_agent_data.AgentData, ) - trajectory_single_tool_use_input: "TrajectorySingleToolUseInput" = proto.Field( - proto.MESSAGE, - number=39, - oneof="metric_inputs", - message="TrajectorySingleToolUseInput", + + +class AutoraterConfig(proto.Message): + r"""The configs for autorater. This is applicable to both + EvaluateInstances and EvaluateDataset. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + sampling_count (int): + Optional. Number of samples for each instance + in the dataset. If not specified, the default is + 4. Minimum value is 1, maximum value is 32. + + This field is a member of `oneof`_ ``_sampling_count``. + flip_enabled (bool): + Optional. Default is true. Whether to flip the candidate and + baseline responses. This is only applicable to the pairwise + metric. If enabled, also provide + PairwiseMetricSpec.candidate_response_field_name and + PairwiseMetricSpec.baseline_response_field_name. When + rendering PairwiseMetricSpec.metric_prompt_template, the + candidate and baseline fields will be flipped for half of + the samples to reduce bias. + + This field is a member of `oneof`_ ``_flip_enabled``. + autorater_model (str): + Optional. The fully qualified name of the publisher model or + tuned autorater endpoint to use. + + Publisher model format: + ``projects/{project}/locations/{location}/publishers/*/models/*`` + + Tuned model endpoint format: + ``projects/{project}/locations/{location}/endpoints/{endpoint}`` + generation_config (google.cloud.aiplatform_v1beta1.types.GenerationConfig): + Optional. Configuration options for model + generation and outputs. + """ + + sampling_count: int = proto.Field( + proto.INT32, + number=1, + optional=True, ) - rubric_based_instruction_following_input: "RubricBasedInstructionFollowingInput" = ( - proto.Field( - proto.MESSAGE, - number=40, - oneof="metric_inputs", - message="RubricBasedInstructionFollowingInput", - ) + flip_enabled: bool = proto.Field( + proto.BOOL, + number=2, + optional=True, ) - location: str = proto.Field( + autorater_model: str = proto.Field( proto.STRING, - number=1, + number=3, ) - autorater_config: "AutoraterConfig" = proto.Field( + generation_config: gca_content.GenerationConfig = proto.Field( proto.MESSAGE, - number=30, - message="AutoraterConfig", + number=4, + message=gca_content.GenerationConfig, ) @@ -1404,70 +1768,424 @@ class EvaluateInstancesResponse(proto.Message): ) trajectory_recall_results: "TrajectoryRecallResults" = proto.Field( proto.MESSAGE, - number=36, - oneof="evaluation_results", - message="TrajectoryRecallResults", + number=36, + oneof="evaluation_results", + message="TrajectoryRecallResults", + ) + trajectory_single_tool_use_results: "TrajectorySingleToolUseResults" = proto.Field( + proto.MESSAGE, + number=37, + oneof="evaluation_results", + message="TrajectorySingleToolUseResults", + ) + rubric_based_instruction_following_result: ( + "RubricBasedInstructionFollowingResult" + ) = proto.Field( + proto.MESSAGE, + number=38, + oneof="evaluation_results", + message="RubricBasedInstructionFollowingResult", + ) + metric_results: MutableSequence["MetricResult"] = proto.RepeatedField( + proto.MESSAGE, + number=43, + message="MetricResult", + ) + + +class MetricResult(proto.Message): + r"""Result for a single metric on a single instance. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + score (float): + Output only. The score for the metric. + Please refer to each metric's documentation for + the meaning of the score. + + This field is a member of `oneof`_ ``_score``. + rubric_verdicts (MutableSequence[google.cloud.aiplatform_v1beta1.types.RubricVerdict]): + Output only. For rubric-based metrics, the + verdicts for each rubric. + explanation (str): + Output only. The explanation for the metric + result. + + This field is a member of `oneof`_ ``_explanation``. + error (google.rpc.status_pb2.Status): + Output only. The error status for the metric + result. + + This field is a member of `oneof`_ ``_error``. + """ + + score: float = proto.Field( + proto.FLOAT, + number=1, + optional=True, + ) + rubric_verdicts: MutableSequence[evaluation_rubric.RubricVerdict] = ( + proto.RepeatedField( + proto.MESSAGE, + number=2, + message=evaluation_rubric.RubricVerdict, + ) + ) + explanation: str = proto.Field( + proto.STRING, + number=3, + optional=True, + ) + error: status_pb2.Status = proto.Field( + proto.MESSAGE, + number=4, + optional=True, + message=status_pb2.Status, + ) + + +class GenerateInstanceRubricsRequest(proto.Message): + r"""Request message for + EvaluationService.GenerateInstanceRubrics. + + Attributes: + location (str): + Required. The resource name of the Location to generate + rubrics from. Format: + ``projects/{project}/locations/{location}`` + contents (MutableSequence[google.cloud.aiplatform_v1beta1.types.Content]): + Required. The prompt to generate rubrics + from. For single-turn queries, this is a single + instance. For multi-turn queries, this is a + repeated field that contains conversation + history + latest request. + predefined_rubric_generation_spec (google.cloud.aiplatform_v1beta1.types.PredefinedMetricSpec): + Optional. Specification for using the rubric generation + configs of a pre-defined metric, e.g. "generic_quality_v1" + and "instruction_following_v1". Some of the configs may be + only used in rubric generation and not supporting + evaluation, e.g. "fully_customized_generic_quality_v1". If + this field is set, the ``rubric_generation_spec`` field will + be ignored. + rubric_generation_spec (google.cloud.aiplatform_v1beta1.types.RubricGenerationSpec): + Optional. Specification for how the rubrics + should be generated. + agent_config (google.cloud.aiplatform_v1beta1.types.EvaluationInstance.DeprecatedAgentConfig): + Optional. Agent configuration, required for + agent-based rubric generation. + """ + + location: str = proto.Field( + proto.STRING, + number=1, + ) + contents: MutableSequence[gca_content.Content] = proto.RepeatedField( + proto.MESSAGE, + number=2, + message=gca_content.Content, + ) + predefined_rubric_generation_spec: "PredefinedMetricSpec" = proto.Field( + proto.MESSAGE, + number=4, + message="PredefinedMetricSpec", + ) + rubric_generation_spec: "RubricGenerationSpec" = proto.Field( + proto.MESSAGE, + number=3, + message="RubricGenerationSpec", + ) + agent_config: "EvaluationInstance.DeprecatedAgentConfig" = proto.Field( + proto.MESSAGE, + number=5, + message="EvaluationInstance.DeprecatedAgentConfig", + ) + + +class GenerateInstanceRubricsResponse(proto.Message): + r"""Response message for + EvaluationService.GenerateInstanceRubrics. + + Attributes: + generated_rubrics (MutableSequence[google.cloud.aiplatform_v1beta1.types.Rubric]): + Output only. A list of generated rubrics. + """ + + generated_rubrics: MutableSequence[evaluation_rubric.Rubric] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=evaluation_rubric.Rubric, + ) + + +class EvaluateDatasetRequest(proto.Message): + r"""Request message for EvaluationService.EvaluateDataset. + + Attributes: + location (str): + Required. The resource name of the Location to evaluate the + dataset. Format: ``projects/{project}/locations/{location}`` + dataset (google.cloud.aiplatform_v1beta1.types.EvaluationDataset): + Required. The dataset used for evaluation. + metrics (MutableSequence[google.cloud.aiplatform_v1beta1.types.Metric]): + Required. The metrics used for evaluation. + output_config (google.cloud.aiplatform_v1beta1.types.OutputConfig): + Required. Config for evaluation output. + autorater_config (google.cloud.aiplatform_v1beta1.types.AutoraterConfig): + Optional. Autorater config used for evaluation. Currently + only publisher Gemini models are supported. Format: + ``projects/{PROJECT}/locations/{LOCATION}/publishers/google/models/{MODEL}.`` + """ + + location: str = proto.Field( + proto.STRING, + number=1, + ) + dataset: "EvaluationDataset" = proto.Field( + proto.MESSAGE, + number=2, + message="EvaluationDataset", + ) + metrics: MutableSequence["Metric"] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message="Metric", + ) + output_config: "OutputConfig" = proto.Field( + proto.MESSAGE, + number=4, + message="OutputConfig", + ) + autorater_config: "AutoraterConfig" = proto.Field( + proto.MESSAGE, + number=5, + message="AutoraterConfig", + ) + + +class OutputConfig(proto.Message): + r"""Config for evaluation output. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + gcs_destination (google.cloud.aiplatform_v1beta1.types.GcsDestination): + Cloud storage destination for evaluation + output. + + This field is a member of `oneof`_ ``destination``. + """ + + gcs_destination: io.GcsDestination = proto.Field( + proto.MESSAGE, + number=1, + oneof="destination", + message=io.GcsDestination, + ) + + +class EvaluationDataset(proto.Message): + r"""The dataset used for evaluation. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + gcs_source (google.cloud.aiplatform_v1beta1.types.GcsSource): + Cloud storage source holds the dataset. + Currently only one Cloud Storage file path is + supported. + + This field is a member of `oneof`_ ``source``. + bigquery_source (google.cloud.aiplatform_v1beta1.types.BigQuerySource): + BigQuery source holds the dataset. + + This field is a member of `oneof`_ ``source``. + """ + + gcs_source: io.GcsSource = proto.Field( + proto.MESSAGE, + number=1, + oneof="source", + message=io.GcsSource, + ) + bigquery_source: io.BigQuerySource = proto.Field( + proto.MESSAGE, + number=2, + oneof="source", + message=io.BigQuerySource, + ) + + +class EvaluateDatasetResponse(proto.Message): + r"""The results from an evaluation run performed by the + EvaluationService. + + Attributes: + aggregation_output (google.cloud.aiplatform_v1beta1.types.AggregationOutput): + Output only. Aggregation statistics derived + from results of EvaluationService. + output_info (google.cloud.aiplatform_v1beta1.types.OutputInfo): + Output only. Output info for + EvaluationService. + """ + + aggregation_output: "AggregationOutput" = proto.Field( + proto.MESSAGE, + number=1, + message="AggregationOutput", + ) + output_info: "OutputInfo" = proto.Field( + proto.MESSAGE, + number=3, + message="OutputInfo", + ) + + +class EvaluateDatasetOperationMetadata(proto.Message): + r"""Operation metadata for Dataset Evaluation. + + Attributes: + generic_metadata (google.cloud.aiplatform_v1beta1.types.GenericOperationMetadata): + Generic operation metadata. + """ + + generic_metadata: operation.GenericOperationMetadata = proto.Field( + proto.MESSAGE, + number=1, + message=operation.GenericOperationMetadata, ) - trajectory_single_tool_use_results: "TrajectorySingleToolUseResults" = proto.Field( - proto.MESSAGE, - number=37, - oneof="evaluation_results", - message="TrajectorySingleToolUseResults", + + +class OutputInfo(proto.Message): + r"""Describes the info for output of EvaluationService. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + gcs_output_directory (str): + Output only. The full path of the Cloud + Storage directory created, into which the + evaluation results and aggregation results are + written. + + This field is a member of `oneof`_ ``output_location``. + """ + + gcs_output_directory: str = proto.Field( + proto.STRING, + number=1, + oneof="output_location", ) - rubric_based_instruction_following_result: ( - "RubricBasedInstructionFollowingResult" - ) = proto.Field( + + +class AggregationOutput(proto.Message): + r"""The aggregation result for the entire dataset and all + metrics. + + Attributes: + dataset (google.cloud.aiplatform_v1beta1.types.EvaluationDataset): + The dataset used for evaluation & + aggregation. + aggregation_results (MutableSequence[google.cloud.aiplatform_v1beta1.types.AggregationResult]): + One AggregationResult per metric. + """ + + dataset: "EvaluationDataset" = proto.Field( proto.MESSAGE, - number=38, - oneof="evaluation_results", - message="RubricBasedInstructionFollowingResult", + number=1, + message="EvaluationDataset", ) - metric_results: MutableSequence["MetricResult"] = proto.RepeatedField( + aggregation_results: MutableSequence["AggregationResult"] = proto.RepeatedField( proto.MESSAGE, - number=43, - message="MetricResult", + number=2, + message="AggregationResult", ) -class MetricResult(proto.Message): - r"""Result for a single metric on a single instance. +class AggregationResult(proto.Message): + r"""The aggregation result for a single metric. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - score (float): - Output only. The score for the metric. - Please refer to each metric's documentation for - the meaning of the score. + pointwise_metric_result (google.cloud.aiplatform_v1beta1.types.PointwiseMetricResult): + Result for pointwise metric. - This field is a member of `oneof`_ ``_score``. - explanation (str): - Output only. The explanation for the metric - result. + This field is a member of `oneof`_ ``aggregation_result``. + pairwise_metric_result (google.cloud.aiplatform_v1beta1.types.PairwiseMetricResult): + Result for pairwise metric. - This field is a member of `oneof`_ ``_explanation``. - error (google.rpc.status_pb2.Status): - Output only. The error status for the metric - result. + This field is a member of `oneof`_ ``aggregation_result``. + exact_match_metric_value (google.cloud.aiplatform_v1beta1.types.ExactMatchMetricValue): + Results for exact match metric. - This field is a member of `oneof`_ ``_error``. + This field is a member of `oneof`_ ``aggregation_result``. + bleu_metric_value (google.cloud.aiplatform_v1beta1.types.BleuMetricValue): + Results for bleu metric. + + This field is a member of `oneof`_ ``aggregation_result``. + rouge_metric_value (google.cloud.aiplatform_v1beta1.types.RougeMetricValue): + Results for rouge metric. + + This field is a member of `oneof`_ ``aggregation_result``. + custom_code_execution_result (google.cloud.aiplatform_v1beta1.types.CustomCodeExecutionResult): + Result for code execution metric. + + This field is a member of `oneof`_ ``aggregation_result``. + aggregation_metric (google.cloud.aiplatform_v1beta1.types.Metric.AggregationMetric): + Aggregation metric. """ - score: float = proto.Field( - proto.FLOAT, - number=1, - optional=True, + pointwise_metric_result: "PointwiseMetricResult" = proto.Field( + proto.MESSAGE, + number=5, + oneof="aggregation_result", + message="PointwiseMetricResult", ) - explanation: str = proto.Field( - proto.STRING, - number=3, - optional=True, + pairwise_metric_result: "PairwiseMetricResult" = proto.Field( + proto.MESSAGE, + number=6, + oneof="aggregation_result", + message="PairwiseMetricResult", ) - error: status_pb2.Status = proto.Field( + exact_match_metric_value: "ExactMatchMetricValue" = proto.Field( + proto.MESSAGE, + number=7, + oneof="aggregation_result", + message="ExactMatchMetricValue", + ) + bleu_metric_value: "BleuMetricValue" = proto.Field( + proto.MESSAGE, + number=8, + oneof="aggregation_result", + message="BleuMetricValue", + ) + rouge_metric_value: "RougeMetricValue" = proto.Field( + proto.MESSAGE, + number=9, + oneof="aggregation_result", + message="RougeMetricValue", + ) + custom_code_execution_result: "CustomCodeExecutionResult" = proto.Field( proto.MESSAGE, + number=10, + oneof="aggregation_result", + message="CustomCodeExecutionResult", + ) + aggregation_metric: "Metric.AggregationMetric" = proto.Field( + proto.ENUM, number=4, - optional=True, - message=status_pb2.Status, + enum="Metric.AggregationMetric", ) @@ -1561,6 +2279,11 @@ class LLMBasedMetricSpec(proto.Message): input. Refers to a key in the rubric_groups map of EvaluationInstance. + This field is a member of `oneof`_ ``rubrics_source``. + rubric_generation_spec (google.cloud.aiplatform_v1beta1.types.RubricGenerationSpec): + Dynamically generate rubrics using this + specification. + This field is a member of `oneof`_ ``rubrics_source``. predefined_rubric_generation_spec (google.cloud.aiplatform_v1beta1.types.PredefinedMetricSpec): Dynamically generate rubrics using a @@ -1587,6 +2310,9 @@ class LLMBasedMetricSpec(proto.Message): for the metric. This field is a member of `oneof`_ ``_additional_config``. + result_parser_config (google.cloud.aiplatform_v1beta1.types.EvaluationParserConfig): + Optional. The parser config for the metric + result. """ rubric_group_key: str = proto.Field( @@ -1594,6 +2320,12 @@ class LLMBasedMetricSpec(proto.Message): number=4, oneof="rubrics_source", ) + rubric_generation_spec: "RubricGenerationSpec" = proto.Field( + proto.MESSAGE, + number=5, + oneof="rubrics_source", + message="RubricGenerationSpec", + ) predefined_rubric_generation_spec: "PredefinedMetricSpec" = proto.Field( proto.MESSAGE, number=6, @@ -1622,6 +2354,69 @@ class LLMBasedMetricSpec(proto.Message): optional=True, message=struct_pb2.Struct, ) + result_parser_config: "EvaluationParserConfig" = proto.Field( + proto.MESSAGE, + number=8, + message="EvaluationParserConfig", + ) + + +class CustomCodeExecutionSpec(proto.Message): + r"""Specificies a metric that is populated by evaluating + user-defined Python code. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + evaluation_function (str): + Required. Python function. Expected user to define the + following function, e.g.: def evaluate(instance: dict[str, + Any]) -> float: Please include this function signature in + the code snippet. Instance is the evaluation instance, any + fields populated in the instance are available to the + function as instance[field_name]. + + Example: Example input: + + :: + + instance= EvaluationInstance( + response=EvaluationInstance.InstanceData(text="The answer is 4."), + reference=EvaluationInstance.InstanceData(text="4") + ) + + Example converted input: + + :: + + { + 'response': {'text': 'The answer is 4.'}, + 'reference': {'text': '4'} + } + + Example python function: + + :: + + def evaluate(instance: dict[str, Any]) -> float: + if instance['response']['text'] == instance['reference']['text']: + return 1.0 + return 0.0 + + CustomCodeExecutionSpec is also supported in Batch + Evaluation (EvalDataset RPC) and Tuning Evaluation. Each + line in the input jsonl file will be converted to dict[str, + Any] and passed to the evaluation function. + + This field is a member of `oneof`_ ``_evaluation_function``. + """ + + evaluation_function: str = proto.Field( + proto.STRING, + number=1, + optional=True, + ) class ExactMatchInput(proto.Message): @@ -1936,6 +2731,25 @@ class RougeMetricValue(proto.Message): ) +class CustomCodeExecutionResult(proto.Message): + r"""Result for custom code execution metric. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + score (float): + Output only. Custom code execution score. + + This field is a member of `oneof`_ ``_score``. + """ + + score: float = proto.Field( + proto.FLOAT, + number=1, + optional=True, + ) + + class CoherenceInput(proto.Message): r"""Input for coherence metric. @@ -5360,10 +6174,10 @@ class Contents(proto.Message): Optional. Repeated contents. """ - contents: MutableSequence[content.Content] = proto.RepeatedField( + contents: MutableSequence[gca_content.Content] = proto.RepeatedField( proto.MESSAGE, number=1, - message=content.Content, + message=gca_content.Content, ) values: MutableMapping[str, Contents] = proto.MapField( @@ -5374,4 +6188,136 @@ class Contents(proto.Message): ) +class EvaluationParserConfig(proto.Message): + r"""Config for parsing LLM responses. + It can be used to parse the LLM response to be evaluated, or the + LLM response from LLM-based metrics/Autoraters. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + custom_code_parser_config (google.cloud.aiplatform_v1beta1.types.EvaluationParserConfig.CustomCodeParserConfig): + Optional. Use custom code to parse the LLM + response. + + This field is a member of `oneof`_ ``parser``. + """ + + class CustomCodeParserConfig(proto.Message): + r"""Configuration for parsing the LLM response using custom code. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + parsing_function (str): + Required. Python function for parsing results. The function + should be defined within this string. + + The function takes a list of strings (LLM responses) and + should return either a list of dictionaries (for rubrics) or + a single dictionary (for a metric result). + + Example function signature: def parse(responses: list[str]) + -> list[dict[str, Any]] \| dict[str, Any]: + + When parsing rubrics, return a list of dictionaries, where + each dictionary represents a Rubric. Example for rubrics: [ + { "content": {"property": {"description": "The response is + factual."}}, "type": "FACTUALITY", "importance": "HIGH" }, { + "content": {"property": {"description": "The response is + fluent."}}, "type": "FLUENCY", "importance": "MEDIUM" } ] + + When parsing critique results, return a dictionary + representing a MetricResult. Example for a metric result: { + "score": 0.8, "explanation": "The model followed most + instructions.", "rubric_verdicts": [...] } + + ... code for result extraction and aggregation + + This field is a member of `oneof`_ ``_parsing_function``. + """ + + parsing_function: str = proto.Field( + proto.STRING, + number=1, + optional=True, + ) + + custom_code_parser_config: CustomCodeParserConfig = proto.Field( + proto.MESSAGE, + number=2, + oneof="parser", + message=CustomCodeParserConfig, + ) + + +class RubricGenerationSpec(proto.Message): + r"""Specification for how rubrics should be generated. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + prompt_template (str): + Template for the prompt used to generate + rubrics. The details should be updated based on + the most-recent recipe requirements. + model_config (google.cloud.aiplatform_v1beta1.types.AutoraterConfig): + Configuration for the model used in rubric + generation. Configs including sampling count and + base model can be specified here. Flipping is + not supported for rubric generation. + + This field is a member of `oneof`_ ``_model_config``. + rubric_content_type (google.cloud.aiplatform_v1beta1.types.RubricGenerationSpec.RubricContentType): + The type of rubric content to be generated. + rubric_type_ontology (MutableSequence[str]): + Optional. An optional, pre-defined list of allowed types for + generated rubrics. If this field is provided, it implies + ``include_rubric_type`` should be true, and the generated + rubric types should be chosen from this ontology. + """ + + class RubricContentType(proto.Enum): + r"""Specifies the type of rubric content to generate. + + Values: + RUBRIC_CONTENT_TYPE_UNSPECIFIED (0): + The content type to generate is not + specified. + PROPERTY (1): + Generate rubrics based on properties. + NL_QUESTION_ANSWER (2): + Generate rubrics in an NL question answer + format. + PYTHON_CODE_ASSERTION (3): + Generate rubrics in a unit test format. + """ + + RUBRIC_CONTENT_TYPE_UNSPECIFIED = 0 + PROPERTY = 1 + NL_QUESTION_ANSWER = 2 + PYTHON_CODE_ASSERTION = 3 + + prompt_template: str = proto.Field( + proto.STRING, + number=1, + ) + model_config: "AutoraterConfig" = proto.Field( + proto.MESSAGE, + number=4, + optional=True, + message="AutoraterConfig", + ) + rubric_content_type: RubricContentType = proto.Field( + proto.ENUM, + number=5, + enum=RubricContentType, + ) + rubric_type_ontology: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=6, + ) + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1beta1/types/model_service.py b/google/cloud/aiplatform_v1beta1/types/model_service.py index 0b4b555656..c8aada7ffe 100644 --- a/google/cloud/aiplatform_v1beta1/types/model_service.py +++ b/google/cloud/aiplatform_v1beta1/types/model_service.py @@ -831,6 +831,19 @@ class CopyModelRequest(proto.Message): Customer-managed encryption key options. If this is set, then the Model copy will be encrypted with the provided encryption key. + custom_service_account (str): + Optional. The user-provided custom service account to use to + do the copy model. If empty, `Vertex AI Service + Agent `__ + will be used to access resources needed to upload the model. + This account must belong to the destination project where + the model is copied to, i.e., the project specified in the + ``parent`` field of this request and have the Vertex AI + Service Agent role in the source project. + + Requires the user copying the Model to have the + ``iam.serviceAccounts.actAs`` permission on this service + account. """ model_id: str = proto.Field( @@ -856,6 +869,10 @@ class CopyModelRequest(proto.Message): number=3, message=gca_encryption_spec.EncryptionSpec, ) + custom_service_account: str = proto.Field( + proto.STRING, + number=7, + ) class CopyModelOperationMetadata(proto.Message): diff --git a/google/cloud/aiplatform_v1beta1/types/online_evaluator.py b/google/cloud/aiplatform_v1beta1/types/online_evaluator.py new file mode 100644 index 0000000000..5a69914196 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/types/online_evaluator.py @@ -0,0 +1,414 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.cloud.aiplatform_v1beta1.types import evaluation_service +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore + + +__protobuf__ = proto.module( + package="google.cloud.aiplatform.v1beta1", + manifest={ + "OnlineEvaluator", + }, +) + + +class OnlineEvaluator(proto.Message): + r"""An OnlineEvaluator contains the configuration for an Online + Evaluation. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + cloud_observability (google.cloud.aiplatform_v1beta1.types.OnlineEvaluator.CloudObservability): + Data source for the OnlineEvaluator, based on + GCP Observability stack (Cloud Trace & Cloud + Logging). + + This field is a member of `oneof`_ ``data_source``. + name (str): + Identifier. The resource name of the + OnlineEvaluator. Format: + projects/{project}/locations/{location}/onlineEvaluators/{id}. + agent_resource (str): + Required. Immutable. The name of the agent that the + OnlineEvaluator evaluates periodically. This value is used + to filter the traces with a matching cloud.resource_id and + link the evaluation results with relevant dashboards/UIs. + + This field is immutable. Once set, it cannot be changed. + metric_sources (MutableSequence[google.cloud.aiplatform_v1beta1.types.MetricSource]): + Required. A list of metric sources to be used for evaluating + samples. At least one MetricSource must be provided. Right + now, only predefined metrics and registered metrics are + supported. + + Every registered metric must have ``display_name`` (or + ``title``) and ``score_range`` defined. Otherwise, the + evaluations will fail. + + The maximum number of ``metric_sources`` is 25. + config (google.cloud.aiplatform_v1beta1.types.OnlineEvaluator.Config): + Required. Configuration for the + OnlineEvaluator. + state (google.cloud.aiplatform_v1beta1.types.OnlineEvaluator.State): + Output only. The state of the + OnlineEvaluator. + state_details (MutableSequence[google.cloud.aiplatform_v1beta1.types.OnlineEvaluator.StateDetails]): + Output only. Contains additional information + about the state of the OnlineEvaluator. This is + used to provide more details in the event of a + failure. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. Timestamp when the + OnlineEvaluator was created. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. Timestamp when the + OnlineEvaluator was last updated. + display_name (str): + Optional. Human-readable name for the ``OnlineEvaluator``. + + The name doesn't have to be unique. + + The name can consist of any UTF-8 characters. The maximum + length is ``63`` characters. If the display name exceeds max + characters, an ``INVALID_ARGUMENT`` error is returned. + """ + + class State(proto.Enum): + r"""The state of the OnlineEvaluator. + + Values: + STATE_UNSPECIFIED (0): + Default value. + ACTIVE (1): + Indicates that the OnlineEvaluator is active. + SUSPENDED (2): + Indicates that the OnlineEvaluator is + suspended. In this state, the OnlineEvaluator + will not evaluate any samples. + FAILED (3): + Indicates that the OnlineEvaluator is in a failed state. + + This can happen if, for example, the ``log_view`` or + ``trace_view`` set on the ``CloudObservability`` does not + exist. + WARNING (4): + Indicates that the OnlineEvaluator is in a warning state. + This can happen if, for example, some of the metrics in the + ``metric_sources`` are invalid. Evaluation will still run + with the remaining valid metrics. + """ + + STATE_UNSPECIFIED = 0 + ACTIVE = 1 + SUSPENDED = 2 + FAILED = 3 + WARNING = 4 + + class CloudObservability(proto.Message): + r"""Data source for the OnlineEvaluator, based on GCP + Observability stack (Cloud Trace & Cloud Logging). + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + trace_scope (google.cloud.aiplatform_v1beta1.types.OnlineEvaluator.CloudObservability.TraceScope): + Scope online evaluation to single traces. + + This field is a member of `oneof`_ ``eval_scope``. + open_telemetry (google.cloud.aiplatform_v1beta1.types.OnlineEvaluator.CloudObservability.OpenTelemetry): + Data source follows OpenTelemetry convention. + + This field is a member of `oneof`_ ``convention``. + log_view (str): + Optional. Optional log view that will be used to query logs. + If empty, the ``_Default`` view will be used. + trace_view (str): + Optional. Optional trace view that will be used to query + traces. If empty, the ``_Default`` view will be used. + + NOTE: This field is not supported yet and will be ignored if + set. + """ + + class NumericPredicate(proto.Message): + r"""Defines a predicate for filtering based on a numeric value. + + Attributes: + comparison_operator (google.cloud.aiplatform_v1beta1.types.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator): + Required. The comparison operator to apply. + value (float): + Required. The value to compare against. + """ + + class ComparisonOperator(proto.Enum): + r"""Comparison operators for numeric predicates. + + Values: + COMPARISON_OPERATOR_UNSPECIFIED (0): + Unspecified comparison operator. This value + should not be used. + LESS (1): + Less than. + LESS_OR_EQUAL (2): + Less than or equal to. + EQUAL (3): + Equal to. + NOT_EQUAL (4): + Not equal to. + GREATER_OR_EQUAL (5): + Greater than or equal to. + GREATER (6): + Greater than. + """ + + COMPARISON_OPERATOR_UNSPECIFIED = 0 + LESS = 1 + LESS_OR_EQUAL = 2 + EQUAL = 3 + NOT_EQUAL = 4 + GREATER_OR_EQUAL = 5 + GREATER = 6 + + comparison_operator: ( + "OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator" + ) = proto.Field( + proto.ENUM, + number=1, + enum="OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator", + ) + value: float = proto.Field( + proto.FLOAT, + number=2, + ) + + class TraceScope(proto.Message): + r"""If chosen, the online evaluator will evaluate single traces matching + specified ``filter``. + + Attributes: + filter (MutableSequence[google.cloud.aiplatform_v1beta1.types.OnlineEvaluator.CloudObservability.TraceScope.Predicate]): + Optional. A list of predicates to filter + traces. Multiple predicates are combined using + AND. + + The maximum number of predicates is 10. + """ + + class Predicate(proto.Message): + r"""Defines a single filter predicate. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + duration (google.cloud.aiplatform_v1beta1.types.OnlineEvaluator.CloudObservability.NumericPredicate): + Filter on the duration of a trace. + + This field is a member of `oneof`_ ``predicate``. + total_token_usage (google.cloud.aiplatform_v1beta1.types.OnlineEvaluator.CloudObservability.NumericPredicate): + Filter on the total token usage within a + trace. + + This field is a member of `oneof`_ ``predicate``. + """ + + duration: "OnlineEvaluator.CloudObservability.NumericPredicate" = ( + proto.Field( + proto.MESSAGE, + number=1, + oneof="predicate", + message="OnlineEvaluator.CloudObservability.NumericPredicate", + ) + ) + total_token_usage: ( + "OnlineEvaluator.CloudObservability.NumericPredicate" + ) = proto.Field( + proto.MESSAGE, + number=2, + oneof="predicate", + message="OnlineEvaluator.CloudObservability.NumericPredicate", + ) + + filter: MutableSequence[ + "OnlineEvaluator.CloudObservability.TraceScope.Predicate" + ] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="OnlineEvaluator.CloudObservability.TraceScope.Predicate", + ) + + class OpenTelemetry(proto.Message): + r"""Configuration for data source following OpenTelemetry. + + Attributes: + semconv_version (str): + Required. Defines which version OTel Semantic + Convention the data follows. Can be "1.39.0" or + newer. + """ + + semconv_version: str = proto.Field( + proto.STRING, + number=1, + ) + + trace_scope: "OnlineEvaluator.CloudObservability.TraceScope" = proto.Field( + proto.MESSAGE, + number=3, + oneof="eval_scope", + message="OnlineEvaluator.CloudObservability.TraceScope", + ) + open_telemetry: "OnlineEvaluator.CloudObservability.OpenTelemetry" = ( + proto.Field( + proto.MESSAGE, + number=4, + oneof="convention", + message="OnlineEvaluator.CloudObservability.OpenTelemetry", + ) + ) + log_view: str = proto.Field( + proto.STRING, + number=1, + ) + trace_view: str = proto.Field( + proto.STRING, + number=2, + ) + + class Config(proto.Message): + r"""Configuration for sampling behavior of the OnlineEvaluator. + The OnlineEvaluator runs at a fixed interval of 10 minutes. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + random_sampling (google.cloud.aiplatform_v1beta1.types.OnlineEvaluator.Config.RandomSampling): + Random sampling method. + + This field is a member of `oneof`_ ``sampling_method``. + max_evaluated_samples_per_run (int): + Optional. The maximum number of evaluations + to perform per run. If set to 0, the number is + unbounded. + """ + + class RandomSampling(proto.Message): + r"""Configuration for random sampling. + + Attributes: + percentage (int): + Required. The percentage of traces to sample for evaluation. + Must be an integer between ``1`` and ``100``. + """ + + percentage: int = proto.Field( + proto.INT32, + number=1, + ) + + random_sampling: "OnlineEvaluator.Config.RandomSampling" = proto.Field( + proto.MESSAGE, + number=2, + oneof="sampling_method", + message="OnlineEvaluator.Config.RandomSampling", + ) + max_evaluated_samples_per_run: int = proto.Field( + proto.INT64, + number=1, + ) + + class StateDetails(proto.Message): + r"""Contains additional information about the state of the + OnlineEvaluator. + + Attributes: + message (str): + Output only. Human-readable message + describing the state of the OnlineEvaluator. + """ + + message: str = proto.Field( + proto.STRING, + number=1, + ) + + cloud_observability: CloudObservability = proto.Field( + proto.MESSAGE, + number=4, + oneof="data_source", + message=CloudObservability, + ) + name: str = proto.Field( + proto.STRING, + number=1, + ) + agent_resource: str = proto.Field( + proto.STRING, + number=2, + ) + metric_sources: MutableSequence[evaluation_service.MetricSource] = ( + proto.RepeatedField( + proto.MESSAGE, + number=3, + message=evaluation_service.MetricSource, + ) + ) + config: Config = proto.Field( + proto.MESSAGE, + number=5, + message=Config, + ) + state: State = proto.Field( + proto.ENUM, + number=6, + enum=State, + ) + state_details: MutableSequence[StateDetails] = proto.RepeatedField( + proto.MESSAGE, + number=10, + message=StateDetails, + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=7, + message=timestamp_pb2.Timestamp, + ) + update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=8, + message=timestamp_pb2.Timestamp, + ) + display_name: str = proto.Field( + proto.STRING, + number=9, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1beta1/types/online_evaluator_service.py b/google/cloud/aiplatform_v1beta1/types/online_evaluator_service.py new file mode 100644 index 0000000000..4966caf9b7 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/types/online_evaluator_service.py @@ -0,0 +1,324 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.cloud.aiplatform_v1beta1.types import ( + online_evaluator as gca_online_evaluator, +) +from google.cloud.aiplatform_v1beta1.types import operation +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore + + +__protobuf__ = proto.module( + package="google.cloud.aiplatform.v1beta1", + manifest={ + "CreateOnlineEvaluatorRequest", + "CreateOnlineEvaluatorOperationMetadata", + "GetOnlineEvaluatorRequest", + "UpdateOnlineEvaluatorRequest", + "UpdateOnlineEvaluatorOperationMetadata", + "DeleteOnlineEvaluatorRequest", + "DeleteOnlineEvaluatorOperationMetadata", + "ListOnlineEvaluatorsRequest", + "ListOnlineEvaluatorsResponse", + "ActivateOnlineEvaluatorRequest", + "ActivateOnlineEvaluatorOperationMetadata", + "SuspendOnlineEvaluatorRequest", + "SuspendOnlineEvaluatorOperationMetadata", + }, +) + + +class CreateOnlineEvaluatorRequest(proto.Message): + r"""Request message for CreateOnlineEvaluator. + + Attributes: + parent (str): + Required. The parent resource where the + OnlineEvaluator will be created. Format: + projects/{project}/locations/{location}. + online_evaluator (google.cloud.aiplatform_v1beta1.types.OnlineEvaluator): + Required. The OnlineEvaluator to create. + """ + + parent: str = proto.Field( + proto.STRING, + number=1, + ) + online_evaluator: gca_online_evaluator.OnlineEvaluator = proto.Field( + proto.MESSAGE, + number=2, + message=gca_online_evaluator.OnlineEvaluator, + ) + + +class CreateOnlineEvaluatorOperationMetadata(proto.Message): + r"""Metadata for the CreateOnlineEvaluator operation. + + Attributes: + generic_metadata (google.cloud.aiplatform_v1beta1.types.GenericOperationMetadata): + Common part of operation metadata. + """ + + generic_metadata: operation.GenericOperationMetadata = proto.Field( + proto.MESSAGE, + number=1, + message=operation.GenericOperationMetadata, + ) + + +class GetOnlineEvaluatorRequest(proto.Message): + r"""Request message for GetOnlineEvaluator. + + Attributes: + name (str): + Required. The name of the OnlineEvaluator to + retrieve. Format: + projects/{project}/locations/{location}/onlineEvaluators/{id}. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + + +class UpdateOnlineEvaluatorRequest(proto.Message): + r"""Request message for UpdateOnlineEvaluator. + + Attributes: + online_evaluator (google.cloud.aiplatform_v1beta1.types.OnlineEvaluator): + Required. The OnlineEvaluator to update. + Format: + projects/{project}/locations/{location}/onlineEvaluators/{id}. + update_mask (google.protobuf.field_mask_pb2.FieldMask): + Optional. Field mask is used to control which + fields get updated. If the mask is not present, + all fields will be updated. + """ + + online_evaluator: gca_online_evaluator.OnlineEvaluator = proto.Field( + proto.MESSAGE, + number=1, + message=gca_online_evaluator.OnlineEvaluator, + ) + update_mask: field_mask_pb2.FieldMask = proto.Field( + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, + ) + + +class UpdateOnlineEvaluatorOperationMetadata(proto.Message): + r"""Metadata for the UpdateOnlineEvaluator operation. + + Attributes: + generic_metadata (google.cloud.aiplatform_v1beta1.types.GenericOperationMetadata): + Generic operation metadata. + """ + + generic_metadata: operation.GenericOperationMetadata = proto.Field( + proto.MESSAGE, + number=1, + message=operation.GenericOperationMetadata, + ) + + +class DeleteOnlineEvaluatorRequest(proto.Message): + r"""Request message for DeleteOnlineEvaluator. + + Attributes: + name (str): + Required. The name of the OnlineEvaluator to + delete. Format: + projects/{project}/locations/{location}/onlineEvaluators/{id}. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + + +class DeleteOnlineEvaluatorOperationMetadata(proto.Message): + r"""Metadata for the DeleteOnlineEvaluator operation. + + Attributes: + generic_metadata (google.cloud.aiplatform_v1beta1.types.GenericOperationMetadata): + Generic operation metadata. + """ + + generic_metadata: operation.GenericOperationMetadata = proto.Field( + proto.MESSAGE, + number=1, + message=operation.GenericOperationMetadata, + ) + + +class ListOnlineEvaluatorsRequest(proto.Message): + r"""Request message for ListOnlineEvaluators. + + Attributes: + parent (str): + Required. The parent resource of the + OnlineEvaluators to list. Format: + projects/{project}/locations/{location}. + page_size (int): + Optional. The maximum number of + OnlineEvaluators to return. The service may + return fewer than this value. If unspecified, at + most 50 OnlineEvaluators will be returned. The + maximum value is 100; values above 100 will be + coerced to 100. Based on aip.dev/158. + page_token (str): + Optional. A token identifying a page of + results the server should return. Based on + aip.dev/158. + filter (str): + Optional. Standard list filter. Supported fields: \* + ``create_time`` \* ``update_time`` \* ``agent_resource`` + Example: ``create_time>"2026-01-01T00:00:00-04:00"`` where + the timestamp is in RFC 3339 format) Based on aip.dev/160. + order_by (str): + Optional. A comma-separated list of fields to order by. The + default sorting order is ascending. Use "desc" after a field + name for descending. Supported fields: + + - ``create_time`` + - ``update_time`` + + Example: ``create_time desc``. Based on aip.dev/132. + """ + + parent: str = proto.Field( + proto.STRING, + number=1, + ) + page_size: int = proto.Field( + proto.INT32, + number=2, + ) + page_token: str = proto.Field( + proto.STRING, + number=3, + ) + filter: str = proto.Field( + proto.STRING, + number=4, + ) + order_by: str = proto.Field( + proto.STRING, + number=5, + ) + + +class ListOnlineEvaluatorsResponse(proto.Message): + r"""Response message for ListOnlineEvaluators. + + Attributes: + online_evaluators (MutableSequence[google.cloud.aiplatform_v1beta1.types.OnlineEvaluator]): + A list of OnlineEvaluators matching the + request. + next_page_token (str): + A token to retrieve the next page. Absence of + this field indicates there are no subsequent + pages. + """ + + @property + def raw_page(self): + return self + + online_evaluators: MutableSequence[gca_online_evaluator.OnlineEvaluator] = ( + proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gca_online_evaluator.OnlineEvaluator, + ) + ) + next_page_token: str = proto.Field( + proto.STRING, + number=2, + ) + + +class ActivateOnlineEvaluatorRequest(proto.Message): + r"""Request message for ActivateOnlineEvaluator. + + Attributes: + name (str): + Required. The name of the OnlineEvaluator to + activate. Format: + projects/{project}/locations/{location}/onlineEvaluators/{id}. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + + +class ActivateOnlineEvaluatorOperationMetadata(proto.Message): + r"""Metadata for the ActivateOnlineEvaluator operation. + + Attributes: + generic_metadata (google.cloud.aiplatform_v1beta1.types.GenericOperationMetadata): + Common part of operation metadata. + """ + + generic_metadata: operation.GenericOperationMetadata = proto.Field( + proto.MESSAGE, + number=1, + message=operation.GenericOperationMetadata, + ) + + +class SuspendOnlineEvaluatorRequest(proto.Message): + r"""Request message for SuspendOnlineEvaluator. + + Attributes: + name (str): + Required. The name of the OnlineEvaluator to + suspend. Format: + projects/{project}/locations/{location}/onlineEvaluators/{id}. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + + +class SuspendOnlineEvaluatorOperationMetadata(proto.Message): + r"""Metadata for the SuspendOnlineEvaluator operation. + + Attributes: + generic_metadata (google.cloud.aiplatform_v1beta1.types.GenericOperationMetadata): + Common part of operation metadata. + """ + + generic_metadata: operation.GenericOperationMetadata = proto.Field( + proto.MESSAGE, + number=1, + message=operation.GenericOperationMetadata, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1beta1/types/reasoning_engine_execution_service.py b/google/cloud/aiplatform_v1beta1/types/reasoning_engine_execution_service.py index 0078c735b9..7560198ed4 100644 --- a/google/cloud/aiplatform_v1beta1/types/reasoning_engine_execution_service.py +++ b/google/cloud/aiplatform_v1beta1/types/reasoning_engine_execution_service.py @@ -19,6 +19,7 @@ import proto # type: ignore +from google.cloud.aiplatform_v1beta1.types import operation import google.protobuf.struct_pb2 as struct_pb2 # type: ignore @@ -28,6 +29,9 @@ "QueryReasoningEngineRequest", "QueryReasoningEngineResponse", "StreamQueryReasoningEngineRequest", + "AsyncQueryReasoningEngineRequest", + "AsyncQueryReasoningEngineOperationMetadata", + "AsyncQueryReasoningEngineResponse", }, ) @@ -113,4 +117,66 @@ class StreamQueryReasoningEngineRequest(proto.Message): ) +class AsyncQueryReasoningEngineRequest(proto.Message): + r"""Request message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + + Attributes: + name (str): + Required. The name of the ReasoningEngine resource to use. + Format: + ``projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`` + input_gcs_uri (str): + Optional. Input Cloud Storage URI for the + Async query. + output_gcs_uri (str): + Optional. Output Cloud Storage URI for the + Async query. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + input_gcs_uri: str = proto.Field( + proto.STRING, + number=2, + ) + output_gcs_uri: str = proto.Field( + proto.STRING, + number=3, + ) + + +class AsyncQueryReasoningEngineOperationMetadata(proto.Message): + r"""Operation metadata message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + + Attributes: + generic_metadata (google.cloud.aiplatform_v1beta1.types.GenericOperationMetadata): + The common part of the operation metadata. + """ + + generic_metadata: operation.GenericOperationMetadata = proto.Field( + proto.MESSAGE, + number=1, + message=operation.GenericOperationMetadata, + ) + + +class AsyncQueryReasoningEngineResponse(proto.Message): + r"""Response message for + [ReasoningEngineExecutionService.AsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine]. + + Attributes: + output_gcs_uri (str): + Output Cloud Storage URI for the Async query. + """ + + output_gcs_uri: str = proto.Field( + proto.STRING, + number=1, + ) + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1beta1/types/tuning_job.py b/google/cloud/aiplatform_v1beta1/types/tuning_job.py index 322ee59d28..5ab994ff84 100644 --- a/google/cloud/aiplatform_v1beta1/types/tuning_job.py +++ b/google/cloud/aiplatform_v1beta1/types/tuning_job.py @@ -47,6 +47,7 @@ "TunedModelRef", "VeoHyperParameters", "VeoTuningSpec", + "VeoLoraTuningSpec", "EvaluationConfig", "EvaluateDatasetRun", "TunedModelCheckpoint", @@ -91,6 +92,10 @@ class TuningJob(proto.Message): veo_tuning_spec (google.cloud.aiplatform_v1beta1.types.VeoTuningSpec): Tuning Spec for Veo Tuning. + This field is a member of `oneof`_ ``tuning_spec``. + veo_lora_tuning_spec (google.cloud.aiplatform_v1beta1.types.VeoLoraTuningSpec): + Tuning Spec for Veo LoRA Tuning. + This field is a member of `oneof`_ ``tuning_spec``. name (str): Output only. Identifier. Resource name of a TuningJob. @@ -222,6 +227,12 @@ class TuningJob(proto.Message): oneof="tuning_spec", message="VeoTuningSpec", ) + veo_lora_tuning_spec: "VeoLoraTuningSpec" = proto.Field( + proto.MESSAGE, + number=38, + oneof="tuning_spec", + message="VeoLoraTuningSpec", + ) name: str = proto.Field( proto.STRING, number=1, @@ -1110,6 +1121,8 @@ class TunedModelRef(proto.Message): class VeoHyperParameters(proto.Message): r"""Hyperparameters for Veo. + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: epoch_count (int): Optional. Number of complete passes the model @@ -1120,6 +1133,21 @@ class VeoHyperParameters(proto.Message): default learning rate. tuning_task (google.cloud.aiplatform_v1beta1.types.VeoHyperParameters.TuningTask): Optional. The tuning task. Either I2V or T2V. + veo_data_mixture_ratio (float): + Optional. The ratio of Google internal dataset to use in the + training mixture, in range of ``[0, 1)``. If ``0.2``, it + means 20% of Google internal dataset and 80% of user dataset + will be used for training. If not set, the default value is + 0.1. + + This field is a member of `oneof`_ ``_veo_data_mixture_ratio``. + tuning_speed (google.cloud.aiplatform_v1beta1.types.VeoHyperParameters.TuningSpeed): + The speed of the tuning job. Only supported + for Veo 3.0 models. + + This field is a member of `oneof`_ ``_tuning_speed``. + adapter_size (google.cloud.aiplatform_v1beta1.types.VeoHyperParameters.AdapterSize): + Optional. The adapter size for LoRA tuning. """ class TuningTask(proto.Enum): @@ -1132,11 +1160,53 @@ class TuningTask(proto.Enum): Tuning task for image to video. TUNING_TASK_T2V (2): Tuning task for text to video. + TUNING_TASK_R2V (3): + Tuning task for reference to video. """ TUNING_TASK_UNSPECIFIED = 0 TUNING_TASK_I2V = 1 TUNING_TASK_T2V = 2 + TUNING_TASK_R2V = 3 + + class TuningSpeed(proto.Enum): + r"""The speed of the tuning job. Only supported for Veo 3.0 + models. + + Values: + TUNING_SPEED_UNSPECIFIED (0): + The default / unset value. For Veo 3.0 + models, this defaults to FAST. + REGULAR (1): + Regular tuning speed. + FAST (2): + Fast tuning speed. + """ + + TUNING_SPEED_UNSPECIFIED = 0 + REGULAR = 1 + FAST = 2 + + class AdapterSize(proto.Enum): + r"""Adapter size for LoRA tuning. + + Values: + ADAPTER_SIZE_UNSPECIFIED (0): + Adapter size is unspecified. + ADAPTER_SIZE_EIGHT (8): + Adapter size 8. + This is the default adapter size for Veo LoRA + tuning. + ADAPTER_SIZE_SIXTEEN (16): + Adapter size 16. + ADAPTER_SIZE_THIRTY_TWO (32): + Adapter size 32. + """ + + ADAPTER_SIZE_UNSPECIFIED = 0 + ADAPTER_SIZE_EIGHT = 8 + ADAPTER_SIZE_SIXTEEN = 16 + ADAPTER_SIZE_THIRTY_TWO = 32 epoch_count: int = proto.Field( proto.INT64, @@ -1151,6 +1221,22 @@ class TuningTask(proto.Enum): number=3, enum=TuningTask, ) + veo_data_mixture_ratio: float = proto.Field( + proto.DOUBLE, + number=4, + optional=True, + ) + tuning_speed: TuningSpeed = proto.Field( + proto.ENUM, + number=5, + optional=True, + enum=TuningSpeed, + ) + adapter_size: AdapterSize = proto.Field( + proto.ENUM, + number=6, + enum=AdapterSize, + ) class VeoTuningSpec(proto.Message): @@ -1186,6 +1272,39 @@ class VeoTuningSpec(proto.Message): ) +class VeoLoraTuningSpec(proto.Message): + r"""Tuning Spec for Veo LoRA Model Tuning. + + Attributes: + training_dataset_uri (str): + Required. Training dataset used for tuning. + The dataset can be specified as either a Cloud + Storage path to a JSONL file or as the resource + name of a Vertex Multimodal Dataset. + validation_dataset_uri (str): + Optional. Validation dataset used for tuning. + The dataset can be specified as either a Cloud + Storage path to a JSONL file or as the resource + name of a Vertex Multimodal Dataset. + hyper_parameters (google.cloud.aiplatform_v1beta1.types.VeoHyperParameters): + Optional. Hyperparameters for Veo LoRA. + """ + + training_dataset_uri: str = proto.Field( + proto.STRING, + number=1, + ) + validation_dataset_uri: str = proto.Field( + proto.STRING, + number=2, + ) + hyper_parameters: "VeoHyperParameters" = proto.Field( + proto.MESSAGE, + number=3, + message="VeoHyperParameters", + ) + + class EvaluationConfig(proto.Message): r"""Evaluation Config for Tuning Job. diff --git a/samples/generated_samples/aiplatform_v1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_async.py b/samples/generated_samples/aiplatform_v1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_async.py new file mode 100644 index 0000000000..0d2bc628a5 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AsyncQueryReasoningEngine +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1_generated_ReasoningEngineExecutionService_AsyncQueryReasoningEngine_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1 + + +async def sample_async_query_reasoning_engine(): + # Create a client + client = aiplatform_v1.ReasoningEngineExecutionServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1.AsyncQueryReasoningEngineRequest( + name="name_value", + ) + + # Make the request + operation = client.async_query_reasoning_engine(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END aiplatform_v1_generated_ReasoningEngineExecutionService_AsyncQueryReasoningEngine_async] diff --git a/samples/generated_samples/aiplatform_v1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_sync.py b/samples/generated_samples/aiplatform_v1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_sync.py new file mode 100644 index 0000000000..577b75f47f --- /dev/null +++ b/samples/generated_samples/aiplatform_v1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AsyncQueryReasoningEngine +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1_generated_ReasoningEngineExecutionService_AsyncQueryReasoningEngine_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1 + + +def sample_async_query_reasoning_engine(): + # Create a client + client = aiplatform_v1.ReasoningEngineExecutionServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1.AsyncQueryReasoningEngineRequest( + name="name_value", + ) + + # Make the request + operation = client.async_query_reasoning_engine(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END aiplatform_v1_generated_ReasoningEngineExecutionService_AsyncQueryReasoningEngine_sync] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_evaluation_service_generate_instance_rubrics_async.py b/samples/generated_samples/aiplatform_v1beta1_generated_evaluation_service_generate_instance_rubrics_async.py new file mode 100644 index 0000000000..b853fa1c6c --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_evaluation_service_generate_instance_rubrics_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GenerateInstanceRubrics +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_EvaluationService_GenerateInstanceRubrics_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +async def sample_generate_instance_rubrics(): + # Create a client + client = aiplatform_v1beta1.EvaluationServiceAsyncClient() + + # Initialize request argument(s) + contents = aiplatform_v1beta1.Content() + contents.parts.text = "text_value" + + request = aiplatform_v1beta1.GenerateInstanceRubricsRequest( + location="location_value", + contents=contents, + ) + + # Make the request + response = await client.generate_instance_rubrics(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_EvaluationService_GenerateInstanceRubrics_async] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_evaluation_service_generate_instance_rubrics_sync.py b/samples/generated_samples/aiplatform_v1beta1_generated_evaluation_service_generate_instance_rubrics_sync.py new file mode 100644 index 0000000000..29f4b3933d --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_evaluation_service_generate_instance_rubrics_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GenerateInstanceRubrics +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_EvaluationService_GenerateInstanceRubrics_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +def sample_generate_instance_rubrics(): + # Create a client + client = aiplatform_v1beta1.EvaluationServiceClient() + + # Initialize request argument(s) + contents = aiplatform_v1beta1.Content() + contents.parts.text = "text_value" + + request = aiplatform_v1beta1.GenerateInstanceRubricsRequest( + location="location_value", + contents=contents, + ) + + # Make the request + response = client.generate_instance_rubrics(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_EvaluationService_GenerateInstanceRubrics_sync] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_activate_online_evaluator_async.py b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_activate_online_evaluator_async.py new file mode 100644 index 0000000000..9ce6e573d2 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_activate_online_evaluator_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ActivateOnlineEvaluator +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_OnlineEvaluatorService_ActivateOnlineEvaluator_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +async def sample_activate_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.ActivateOnlineEvaluatorRequest( + name="name_value", + ) + + # Make the request + operation = client.activate_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_OnlineEvaluatorService_ActivateOnlineEvaluator_async] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_activate_online_evaluator_sync.py b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_activate_online_evaluator_sync.py new file mode 100644 index 0000000000..148fded2bd --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_activate_online_evaluator_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ActivateOnlineEvaluator +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_OnlineEvaluatorService_ActivateOnlineEvaluator_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +def sample_activate_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.ActivateOnlineEvaluatorRequest( + name="name_value", + ) + + # Make the request + operation = client.activate_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_OnlineEvaluatorService_ActivateOnlineEvaluator_sync] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_create_online_evaluator_async.py b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_create_online_evaluator_async.py new file mode 100644 index 0000000000..163c43b949 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_create_online_evaluator_async.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateOnlineEvaluator +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_OnlineEvaluatorService_CreateOnlineEvaluator_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +async def sample_create_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient() + + # Initialize request argument(s) + online_evaluator = aiplatform_v1beta1.OnlineEvaluator() + online_evaluator.cloud_observability.open_telemetry.semconv_version = "semconv_version_value" + online_evaluator.agent_resource = "agent_resource_value" + online_evaluator.metric_sources.metric.predefined_metric_spec.metric_spec_name = "metric_spec_name_value" + online_evaluator.config.random_sampling.percentage = 1054 + + request = aiplatform_v1beta1.CreateOnlineEvaluatorRequest( + parent="parent_value", + online_evaluator=online_evaluator, + ) + + # Make the request + operation = client.create_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_OnlineEvaluatorService_CreateOnlineEvaluator_async] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_create_online_evaluator_sync.py b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_create_online_evaluator_sync.py new file mode 100644 index 0000000000..532edbf46d --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_create_online_evaluator_sync.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateOnlineEvaluator +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_OnlineEvaluatorService_CreateOnlineEvaluator_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +def sample_create_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceClient() + + # Initialize request argument(s) + online_evaluator = aiplatform_v1beta1.OnlineEvaluator() + online_evaluator.cloud_observability.open_telemetry.semconv_version = "semconv_version_value" + online_evaluator.agent_resource = "agent_resource_value" + online_evaluator.metric_sources.metric.predefined_metric_spec.metric_spec_name = "metric_spec_name_value" + online_evaluator.config.random_sampling.percentage = 1054 + + request = aiplatform_v1beta1.CreateOnlineEvaluatorRequest( + parent="parent_value", + online_evaluator=online_evaluator, + ) + + # Make the request + operation = client.create_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_OnlineEvaluatorService_CreateOnlineEvaluator_sync] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_delete_online_evaluator_async.py b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_delete_online_evaluator_async.py new file mode 100644 index 0000000000..bdc65b97c3 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_delete_online_evaluator_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteOnlineEvaluator +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_OnlineEvaluatorService_DeleteOnlineEvaluator_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +async def sample_delete_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.DeleteOnlineEvaluatorRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_OnlineEvaluatorService_DeleteOnlineEvaluator_async] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_delete_online_evaluator_sync.py b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_delete_online_evaluator_sync.py new file mode 100644 index 0000000000..448e634d77 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_delete_online_evaluator_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteOnlineEvaluator +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_OnlineEvaluatorService_DeleteOnlineEvaluator_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +def sample_delete_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.DeleteOnlineEvaluatorRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_OnlineEvaluatorService_DeleteOnlineEvaluator_sync] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_get_online_evaluator_async.py b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_get_online_evaluator_async.py new file mode 100644 index 0000000000..76af0dfbbf --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_get_online_evaluator_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetOnlineEvaluator +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_OnlineEvaluatorService_GetOnlineEvaluator_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +async def sample_get_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.GetOnlineEvaluatorRequest( + name="name_value", + ) + + # Make the request + response = await client.get_online_evaluator(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_OnlineEvaluatorService_GetOnlineEvaluator_async] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_get_online_evaluator_sync.py b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_get_online_evaluator_sync.py new file mode 100644 index 0000000000..f2af842b06 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_get_online_evaluator_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetOnlineEvaluator +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_OnlineEvaluatorService_GetOnlineEvaluator_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +def sample_get_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.GetOnlineEvaluatorRequest( + name="name_value", + ) + + # Make the request + response = client.get_online_evaluator(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_OnlineEvaluatorService_GetOnlineEvaluator_sync] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_list_online_evaluators_async.py b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_list_online_evaluators_async.py new file mode 100644 index 0000000000..ef60ff310c --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_list_online_evaluators_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOnlineEvaluators +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_OnlineEvaluatorService_ListOnlineEvaluators_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +async def sample_list_online_evaluators(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.ListOnlineEvaluatorsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_online_evaluators(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END aiplatform_v1beta1_generated_OnlineEvaluatorService_ListOnlineEvaluators_async] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_list_online_evaluators_sync.py b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_list_online_evaluators_sync.py new file mode 100644 index 0000000000..6b3b054a3a --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_list_online_evaluators_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOnlineEvaluators +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_OnlineEvaluatorService_ListOnlineEvaluators_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +def sample_list_online_evaluators(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.ListOnlineEvaluatorsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_online_evaluators(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END aiplatform_v1beta1_generated_OnlineEvaluatorService_ListOnlineEvaluators_sync] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_suspend_online_evaluator_async.py b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_suspend_online_evaluator_async.py new file mode 100644 index 0000000000..cd379568cb --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_suspend_online_evaluator_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SuspendOnlineEvaluator +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_OnlineEvaluatorService_SuspendOnlineEvaluator_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +async def sample_suspend_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.SuspendOnlineEvaluatorRequest( + name="name_value", + ) + + # Make the request + operation = client.suspend_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_OnlineEvaluatorService_SuspendOnlineEvaluator_async] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_suspend_online_evaluator_sync.py b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_suspend_online_evaluator_sync.py new file mode 100644 index 0000000000..2370dbe663 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_suspend_online_evaluator_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SuspendOnlineEvaluator +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_OnlineEvaluatorService_SuspendOnlineEvaluator_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +def sample_suspend_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.SuspendOnlineEvaluatorRequest( + name="name_value", + ) + + # Make the request + operation = client.suspend_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_OnlineEvaluatorService_SuspendOnlineEvaluator_sync] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_update_online_evaluator_async.py b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_update_online_evaluator_async.py new file mode 100644 index 0000000000..1941db6d3b --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_update_online_evaluator_async.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateOnlineEvaluator +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_OnlineEvaluatorService_UpdateOnlineEvaluator_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +async def sample_update_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient() + + # Initialize request argument(s) + online_evaluator = aiplatform_v1beta1.OnlineEvaluator() + online_evaluator.cloud_observability.open_telemetry.semconv_version = "semconv_version_value" + online_evaluator.agent_resource = "agent_resource_value" + online_evaluator.metric_sources.metric.predefined_metric_spec.metric_spec_name = "metric_spec_name_value" + online_evaluator.config.random_sampling.percentage = 1054 + + request = aiplatform_v1beta1.UpdateOnlineEvaluatorRequest( + online_evaluator=online_evaluator, + ) + + # Make the request + operation = client.update_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_OnlineEvaluatorService_UpdateOnlineEvaluator_async] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_update_online_evaluator_sync.py b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_update_online_evaluator_sync.py new file mode 100644 index 0000000000..dc30426667 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_online_evaluator_service_update_online_evaluator_sync.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateOnlineEvaluator +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_OnlineEvaluatorService_UpdateOnlineEvaluator_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +def sample_update_online_evaluator(): + # Create a client + client = aiplatform_v1beta1.OnlineEvaluatorServiceClient() + + # Initialize request argument(s) + online_evaluator = aiplatform_v1beta1.OnlineEvaluator() + online_evaluator.cloud_observability.open_telemetry.semconv_version = "semconv_version_value" + online_evaluator.agent_resource = "agent_resource_value" + online_evaluator.metric_sources.metric.predefined_metric_spec.metric_spec_name = "metric_spec_name_value" + online_evaluator.config.random_sampling.percentage = 1054 + + request = aiplatform_v1beta1.UpdateOnlineEvaluatorRequest( + online_evaluator=online_evaluator, + ) + + # Make the request + operation = client.update_online_evaluator(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_OnlineEvaluatorService_UpdateOnlineEvaluator_sync] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_async.py b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_async.py new file mode 100644 index 0000000000..1558923d0a --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AsyncQueryReasoningEngine +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_ReasoningEngineExecutionService_AsyncQueryReasoningEngine_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +async def sample_async_query_reasoning_engine(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineExecutionServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.AsyncQueryReasoningEngineRequest( + name="name_value", + ) + + # Make the request + operation = client.async_query_reasoning_engine(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_ReasoningEngineExecutionService_AsyncQueryReasoningEngine_async] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_sync.py b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_sync.py new file mode 100644 index 0000000000..57709eacda --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AsyncQueryReasoningEngine +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_ReasoningEngineExecutionService_AsyncQueryReasoningEngine_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import aiplatform_v1beta1 + + +def sample_async_query_reasoning_engine(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineExecutionServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.AsyncQueryReasoningEngineRequest( + name="name_value", + ) + + # Make the request + operation = client.async_query_reasoning_engine(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_ReasoningEngineExecutionService_AsyncQueryReasoningEngine_sync] diff --git a/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json index d5b8c31919..33e9f50775 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-aiplatform", - "version": "1.148.1" + "version": "0.0.0" }, "snippets": [ { @@ -41832,6 +41832,159 @@ ], "title": "aiplatform_v1_generated_prediction_service_streaming_raw_predict_sync.py" }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1.ReasoningEngineExecutionServiceAsyncClient", + "shortName": "ReasoningEngineExecutionServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1.ReasoningEngineExecutionServiceAsyncClient.async_query_reasoning_engine", + "method": { + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine", + "service": { + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService", + "shortName": "ReasoningEngineExecutionService" + }, + "shortName": "AsyncQueryReasoningEngine" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1.types.AsyncQueryReasoningEngineRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "async_query_reasoning_engine" + }, + "description": "Sample for AsyncQueryReasoningEngine", + "file": "aiplatform_v1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1_generated_ReasoningEngineExecutionService_AsyncQueryReasoningEngine_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1.ReasoningEngineExecutionServiceClient", + "shortName": "ReasoningEngineExecutionServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1.ReasoningEngineExecutionServiceClient.async_query_reasoning_engine", + "method": { + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine", + "service": { + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService", + "shortName": "ReasoningEngineExecutionService" + }, + "shortName": "AsyncQueryReasoningEngine" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1.types.AsyncQueryReasoningEngineRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "async_query_reasoning_engine" + }, + "description": "Sample for AsyncQueryReasoningEngine", + "file": "aiplatform_v1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1_generated_ReasoningEngineExecutionService_AsyncQueryReasoningEngine_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_sync.py" + }, { "canonical": true, "clientMethod": { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json index 378a78a6da..82c0895bc3 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.aiplatform.v1beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-aiplatform", - "version": "1.148.1" + "version": "0.0.0" }, "snippets": [ { @@ -6563,6 +6563,159 @@ ], "title": "aiplatform_v1beta1_generated_evaluation_service_evaluate_instances_sync.py" }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.EvaluationServiceAsyncClient", + "shortName": "EvaluationServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.EvaluationServiceAsyncClient.generate_instance_rubrics", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.EvaluationService.GenerateInstanceRubrics", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.EvaluationService", + "shortName": "EvaluationService" + }, + "shortName": "GenerateInstanceRubrics" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.GenerateInstanceRubricsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.aiplatform_v1beta1.types.GenerateInstanceRubricsResponse", + "shortName": "generate_instance_rubrics" + }, + "description": "Sample for GenerateInstanceRubrics", + "file": "aiplatform_v1beta1_generated_evaluation_service_generate_instance_rubrics_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_EvaluationService_GenerateInstanceRubrics_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 49, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 50, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_evaluation_service_generate_instance_rubrics_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.EvaluationServiceClient", + "shortName": "EvaluationServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.EvaluationServiceClient.generate_instance_rubrics", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.EvaluationService.GenerateInstanceRubrics", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.EvaluationService", + "shortName": "EvaluationService" + }, + "shortName": "GenerateInstanceRubrics" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.GenerateInstanceRubricsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.aiplatform_v1beta1.types.GenerateInstanceRubricsResponse", + "shortName": "generate_instance_rubrics" + }, + "description": "Sample for GenerateInstanceRubrics", + "file": "aiplatform_v1beta1_generated_evaluation_service_generate_instance_rubrics_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_EvaluationService_GenerateInstanceRubrics_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 49, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 50, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_evaluation_service_generate_instance_rubrics_sync.py" + }, { "canonical": true, "clientMethod": { @@ -45206,33 +45359,25 @@ "clientMethod": { "async": true, "client": { - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient", - "shortName": "PersistentResourceServiceAsyncClient" + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient", + "shortName": "OnlineEvaluatorServiceAsyncClient" }, - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient.create_persistent_resource", + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.activate_online_evaluator", "method": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.CreatePersistentResource", + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService.ActivateOnlineEvaluator", "service": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", - "shortName": "PersistentResourceService" + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "shortName": "OnlineEvaluatorService" }, - "shortName": "CreatePersistentResource" + "shortName": "ActivateOnlineEvaluator" }, "parameters": [ { "name": "request", - "type": "google.cloud.aiplatform_v1beta1.types.CreatePersistentResourceRequest" - }, - { - "name": "parent", - "type": "str" + "type": "google.cloud.aiplatform_v1beta1.types.ActivateOnlineEvaluatorRequest" }, { - "name": "persistent_resource", - "type": "google.cloud.aiplatform_v1beta1.types.PersistentResource" - }, - { - "name": "persistent_resource_id", + "name": "name", "type": "str" }, { @@ -45249,21 +45394,21 @@ } ], "resultType": "google.api_core.operation_async.AsyncOperation", - "shortName": "create_persistent_resource" + "shortName": "activate_online_evaluator" }, - "description": "Sample for CreatePersistentResource", - "file": "aiplatform_v1beta1_generated_persistent_resource_service_create_persistent_resource_async.py", + "description": "Sample for ActivateOnlineEvaluator", + "file": "aiplatform_v1beta1_generated_online_evaluator_service_activate_online_evaluator_async.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_CreatePersistentResource_async", + "regionTag": "aiplatform_v1beta1_generated_OnlineEvaluatorService_ActivateOnlineEvaluator_async", "segments": [ { - "end": 56, + "end": 55, "start": 27, "type": "FULL" }, { - "end": 56, + "end": 55, "start": 27, "type": "SHORT" }, @@ -45273,132 +45418,43 @@ "type": "CLIENT_INITIALIZATION" }, { - "end": 46, + "end": 45, "start": 41, "type": "REQUEST_INITIALIZATION" }, { - "end": 53, - "start": 47, + "end": 52, + "start": 46, "type": "REQUEST_EXECUTION" }, - { - "end": 57, - "start": 54, - "type": "RESPONSE_HANDLING" - } - ], - "title": "aiplatform_v1beta1_generated_persistent_resource_service_create_persistent_resource_async.py" - }, - { - "canonical": true, - "clientMethod": { - "client": { - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient", - "shortName": "PersistentResourceServiceClient" - }, - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient.create_persistent_resource", - "method": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.CreatePersistentResource", - "service": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", - "shortName": "PersistentResourceService" - }, - "shortName": "CreatePersistentResource" - }, - "parameters": [ - { - "name": "request", - "type": "google.cloud.aiplatform_v1beta1.types.CreatePersistentResourceRequest" - }, - { - "name": "parent", - "type": "str" - }, - { - "name": "persistent_resource", - "type": "google.cloud.aiplatform_v1beta1.types.PersistentResource" - }, - { - "name": "persistent_resource_id", - "type": "str" - }, - { - "name": "retry", - "type": "google.api_core.retry.Retry" - }, - { - "name": "timeout", - "type": "float" - }, - { - "name": "metadata", - "type": "Sequence[Tuple[str, Union[str, bytes]]]" - } - ], - "resultType": "google.api_core.operation.Operation", - "shortName": "create_persistent_resource" - }, - "description": "Sample for CreatePersistentResource", - "file": "aiplatform_v1beta1_generated_persistent_resource_service_create_persistent_resource_sync.py", - "language": "PYTHON", - "origin": "API_DEFINITION", - "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_CreatePersistentResource_sync", - "segments": [ { "end": 56, - "start": 27, - "type": "FULL" - }, - { - "end": 56, - "start": 27, - "type": "SHORT" - }, - { - "end": 40, - "start": 38, - "type": "CLIENT_INITIALIZATION" - }, - { - "end": 46, - "start": 41, - "type": "REQUEST_INITIALIZATION" - }, - { - "end": 53, - "start": 47, - "type": "REQUEST_EXECUTION" - }, - { - "end": 57, - "start": 54, + "start": 53, "type": "RESPONSE_HANDLING" } ], - "title": "aiplatform_v1beta1_generated_persistent_resource_service_create_persistent_resource_sync.py" + "title": "aiplatform_v1beta1_generated_online_evaluator_service_activate_online_evaluator_async.py" }, { "canonical": true, "clientMethod": { - "async": true, "client": { - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient", - "shortName": "PersistentResourceServiceAsyncClient" + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient", + "shortName": "OnlineEvaluatorServiceClient" }, - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient.delete_persistent_resource", + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.activate_online_evaluator", "method": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.DeletePersistentResource", + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService.ActivateOnlineEvaluator", "service": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", - "shortName": "PersistentResourceService" + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "shortName": "OnlineEvaluatorService" }, - "shortName": "DeletePersistentResource" + "shortName": "ActivateOnlineEvaluator" }, "parameters": [ { "name": "request", - "type": "google.cloud.aiplatform_v1beta1.types.DeletePersistentResourceRequest" + "type": "google.cloud.aiplatform_v1beta1.types.ActivateOnlineEvaluatorRequest" }, { "name": "name", @@ -45417,14 +45473,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.operation_async.AsyncOperation", - "shortName": "delete_persistent_resource" + "resultType": "google.api_core.operation.Operation", + "shortName": "activate_online_evaluator" }, - "description": "Sample for DeletePersistentResource", - "file": "aiplatform_v1beta1_generated_persistent_resource_service_delete_persistent_resource_async.py", + "description": "Sample for ActivateOnlineEvaluator", + "file": "aiplatform_v1beta1_generated_online_evaluator_service_activate_online_evaluator_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_DeletePersistentResource_async", + "regionTag": "aiplatform_v1beta1_generated_OnlineEvaluatorService_ActivateOnlineEvaluator_sync", "segments": [ { "end": 55, @@ -45457,33 +45513,122 @@ "type": "RESPONSE_HANDLING" } ], - "title": "aiplatform_v1beta1_generated_persistent_resource_service_delete_persistent_resource_async.py" + "title": "aiplatform_v1beta1_generated_online_evaluator_service_activate_online_evaluator_sync.py" }, { "canonical": true, "clientMethod": { + "async": true, "client": { - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient", - "shortName": "PersistentResourceServiceClient" + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient", + "shortName": "OnlineEvaluatorServiceAsyncClient" }, - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient.delete_persistent_resource", + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.create_online_evaluator", "method": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.DeletePersistentResource", + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService.CreateOnlineEvaluator", "service": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", - "shortName": "PersistentResourceService" + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "shortName": "OnlineEvaluatorService" }, - "shortName": "DeletePersistentResource" + "shortName": "CreateOnlineEvaluator" }, "parameters": [ { "name": "request", - "type": "google.cloud.aiplatform_v1beta1.types.DeletePersistentResourceRequest" + "type": "google.cloud.aiplatform_v1beta1.types.CreateOnlineEvaluatorRequest" }, { - "name": "name", + "name": "parent", + "type": "str" + }, + { + "name": "online_evaluator", + "type": "google.cloud.aiplatform_v1beta1.types.OnlineEvaluator" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_online_evaluator" + }, + "description": "Sample for CreateOnlineEvaluator", + "file": "aiplatform_v1beta1_generated_online_evaluator_service_create_online_evaluator_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_OnlineEvaluatorService_CreateOnlineEvaluator_async", + "segments": [ + { + "end": 62, + "start": 27, + "type": "FULL" + }, + { + "end": 62, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 52, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 59, + "start": 53, + "type": "REQUEST_EXECUTION" + }, + { + "end": 63, + "start": 60, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_online_evaluator_service_create_online_evaluator_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient", + "shortName": "OnlineEvaluatorServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.create_online_evaluator", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService.CreateOnlineEvaluator", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "shortName": "OnlineEvaluatorService" + }, + "shortName": "CreateOnlineEvaluator" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.CreateOnlineEvaluatorRequest" + }, + { + "name": "parent", "type": "str" }, + { + "name": "online_evaluator", + "type": "google.cloud.aiplatform_v1beta1.types.OnlineEvaluator" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -45498,13 +45643,94 @@ } ], "resultType": "google.api_core.operation.Operation", - "shortName": "delete_persistent_resource" + "shortName": "create_online_evaluator" }, - "description": "Sample for DeletePersistentResource", - "file": "aiplatform_v1beta1_generated_persistent_resource_service_delete_persistent_resource_sync.py", + "description": "Sample for CreateOnlineEvaluator", + "file": "aiplatform_v1beta1_generated_online_evaluator_service_create_online_evaluator_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_DeletePersistentResource_sync", + "regionTag": "aiplatform_v1beta1_generated_OnlineEvaluatorService_CreateOnlineEvaluator_sync", + "segments": [ + { + "end": 62, + "start": 27, + "type": "FULL" + }, + { + "end": 62, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 52, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 59, + "start": 53, + "type": "REQUEST_EXECUTION" + }, + { + "end": 63, + "start": 60, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_online_evaluator_service_create_online_evaluator_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient", + "shortName": "OnlineEvaluatorServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.delete_online_evaluator", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService.DeleteOnlineEvaluator", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "shortName": "OnlineEvaluatorService" + }, + "shortName": "DeleteOnlineEvaluator" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.DeleteOnlineEvaluatorRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_online_evaluator" + }, + "description": "Sample for DeleteOnlineEvaluator", + "file": "aiplatform_v1beta1_generated_online_evaluator_service_delete_online_evaluator_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_OnlineEvaluatorService_DeleteOnlineEvaluator_async", "segments": [ { "end": 55, @@ -45537,29 +45763,28 @@ "type": "RESPONSE_HANDLING" } ], - "title": "aiplatform_v1beta1_generated_persistent_resource_service_delete_persistent_resource_sync.py" + "title": "aiplatform_v1beta1_generated_online_evaluator_service_delete_online_evaluator_async.py" }, { "canonical": true, "clientMethod": { - "async": true, "client": { - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient", - "shortName": "PersistentResourceServiceAsyncClient" + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient", + "shortName": "OnlineEvaluatorServiceClient" }, - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient.get_persistent_resource", + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.delete_online_evaluator", "method": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.GetPersistentResource", + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService.DeleteOnlineEvaluator", "service": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", - "shortName": "PersistentResourceService" + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "shortName": "OnlineEvaluatorService" }, - "shortName": "GetPersistentResource" + "shortName": "DeleteOnlineEvaluator" }, "parameters": [ { "name": "request", - "type": "google.cloud.aiplatform_v1beta1.types.GetPersistentResourceRequest" + "type": "google.cloud.aiplatform_v1beta1.types.DeleteOnlineEvaluatorRequest" }, { "name": "name", @@ -45578,22 +45803,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.aiplatform_v1beta1.types.PersistentResource", - "shortName": "get_persistent_resource" + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_online_evaluator" }, - "description": "Sample for GetPersistentResource", - "file": "aiplatform_v1beta1_generated_persistent_resource_service_get_persistent_resource_async.py", + "description": "Sample for DeleteOnlineEvaluator", + "file": "aiplatform_v1beta1_generated_online_evaluator_service_delete_online_evaluator_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_GetPersistentResource_async", + "regionTag": "aiplatform_v1beta1_generated_OnlineEvaluatorService_DeleteOnlineEvaluator_sync", "segments": [ { - "end": 51, + "end": 55, "start": 27, "type": "FULL" }, { - "end": 51, + "end": 55, "start": 27, "type": "SHORT" }, @@ -45608,38 +45833,39 @@ "type": "REQUEST_INITIALIZATION" }, { - "end": 48, + "end": 52, "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 52, - "start": 49, + "end": 56, + "start": 53, "type": "RESPONSE_HANDLING" } ], - "title": "aiplatform_v1beta1_generated_persistent_resource_service_get_persistent_resource_async.py" + "title": "aiplatform_v1beta1_generated_online_evaluator_service_delete_online_evaluator_sync.py" }, { "canonical": true, "clientMethod": { + "async": true, "client": { - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient", - "shortName": "PersistentResourceServiceClient" + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient", + "shortName": "OnlineEvaluatorServiceAsyncClient" }, - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient.get_persistent_resource", + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.get_online_evaluator", "method": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.GetPersistentResource", + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService.GetOnlineEvaluator", "service": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", - "shortName": "PersistentResourceService" + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "shortName": "OnlineEvaluatorService" }, - "shortName": "GetPersistentResource" + "shortName": "GetOnlineEvaluator" }, "parameters": [ { "name": "request", - "type": "google.cloud.aiplatform_v1beta1.types.GetPersistentResourceRequest" + "type": "google.cloud.aiplatform_v1beta1.types.GetOnlineEvaluatorRequest" }, { "name": "name", @@ -45658,14 +45884,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.aiplatform_v1beta1.types.PersistentResource", - "shortName": "get_persistent_resource" + "resultType": "google.cloud.aiplatform_v1beta1.types.OnlineEvaluator", + "shortName": "get_online_evaluator" }, - "description": "Sample for GetPersistentResource", - "file": "aiplatform_v1beta1_generated_persistent_resource_service_get_persistent_resource_sync.py", + "description": "Sample for GetOnlineEvaluator", + "file": "aiplatform_v1beta1_generated_online_evaluator_service_get_online_evaluator_async.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_GetPersistentResource_sync", + "regionTag": "aiplatform_v1beta1_generated_OnlineEvaluatorService_GetOnlineEvaluator_async", "segments": [ { "end": 51, @@ -45698,32 +45924,31 @@ "type": "RESPONSE_HANDLING" } ], - "title": "aiplatform_v1beta1_generated_persistent_resource_service_get_persistent_resource_sync.py" + "title": "aiplatform_v1beta1_generated_online_evaluator_service_get_online_evaluator_async.py" }, { "canonical": true, "clientMethod": { - "async": true, "client": { - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient", - "shortName": "PersistentResourceServiceAsyncClient" + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient", + "shortName": "OnlineEvaluatorServiceClient" }, - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient.list_persistent_resources", + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.get_online_evaluator", "method": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.ListPersistentResources", + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService.GetOnlineEvaluator", "service": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", - "shortName": "PersistentResourceService" + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "shortName": "OnlineEvaluatorService" }, - "shortName": "ListPersistentResources" + "shortName": "GetOnlineEvaluator" }, "parameters": [ { "name": "request", - "type": "google.cloud.aiplatform_v1beta1.types.ListPersistentResourcesRequest" + "type": "google.cloud.aiplatform_v1beta1.types.GetOnlineEvaluatorRequest" }, { - "name": "parent", + "name": "name", "type": "str" }, { @@ -45739,22 +45964,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.aiplatform_v1beta1.services.persistent_resource_service.pagers.ListPersistentResourcesAsyncPager", - "shortName": "list_persistent_resources" + "resultType": "google.cloud.aiplatform_v1beta1.types.OnlineEvaluator", + "shortName": "get_online_evaluator" }, - "description": "Sample for ListPersistentResources", - "file": "aiplatform_v1beta1_generated_persistent_resource_service_list_persistent_resources_async.py", + "description": "Sample for GetOnlineEvaluator", + "file": "aiplatform_v1beta1_generated_online_evaluator_service_get_online_evaluator_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_ListPersistentResources_async", + "regionTag": "aiplatform_v1beta1_generated_OnlineEvaluatorService_GetOnlineEvaluator_sync", "segments": [ { - "end": 52, + "end": 51, "start": 27, "type": "FULL" }, { - "end": 52, + "end": 51, "start": 27, "type": "SHORT" }, @@ -45774,33 +45999,34 @@ "type": "REQUEST_EXECUTION" }, { - "end": 53, + "end": 52, "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "aiplatform_v1beta1_generated_persistent_resource_service_list_persistent_resources_async.py" + "title": "aiplatform_v1beta1_generated_online_evaluator_service_get_online_evaluator_sync.py" }, { "canonical": true, "clientMethod": { + "async": true, "client": { - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient", - "shortName": "PersistentResourceServiceClient" + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient", + "shortName": "OnlineEvaluatorServiceAsyncClient" }, - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient.list_persistent_resources", + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.list_online_evaluators", "method": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.ListPersistentResources", + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService.ListOnlineEvaluators", "service": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", - "shortName": "PersistentResourceService" + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "shortName": "OnlineEvaluatorService" }, - "shortName": "ListPersistentResources" + "shortName": "ListOnlineEvaluators" }, "parameters": [ { "name": "request", - "type": "google.cloud.aiplatform_v1beta1.types.ListPersistentResourcesRequest" + "type": "google.cloud.aiplatform_v1beta1.types.ListOnlineEvaluatorsRequest" }, { "name": "parent", @@ -45819,14 +46045,14 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.cloud.aiplatform_v1beta1.services.persistent_resource_service.pagers.ListPersistentResourcesPager", - "shortName": "list_persistent_resources" + "resultType": "google.cloud.aiplatform_v1beta1.services.online_evaluator_service.pagers.ListOnlineEvaluatorsAsyncPager", + "shortName": "list_online_evaluators" }, - "description": "Sample for ListPersistentResources", - "file": "aiplatform_v1beta1_generated_persistent_resource_service_list_persistent_resources_sync.py", + "description": "Sample for ListOnlineEvaluators", + "file": "aiplatform_v1beta1_generated_online_evaluator_service_list_online_evaluators_async.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_ListPersistentResources_sync", + "regionTag": "aiplatform_v1beta1_generated_OnlineEvaluatorService_ListOnlineEvaluators_async", "segments": [ { "end": 52, @@ -45859,32 +46085,31 @@ "type": "RESPONSE_HANDLING" } ], - "title": "aiplatform_v1beta1_generated_persistent_resource_service_list_persistent_resources_sync.py" + "title": "aiplatform_v1beta1_generated_online_evaluator_service_list_online_evaluators_async.py" }, { "canonical": true, "clientMethod": { - "async": true, "client": { - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient", - "shortName": "PersistentResourceServiceAsyncClient" + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient", + "shortName": "OnlineEvaluatorServiceClient" }, - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient.reboot_persistent_resource", + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.list_online_evaluators", "method": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.RebootPersistentResource", + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService.ListOnlineEvaluators", "service": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", - "shortName": "PersistentResourceService" + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "shortName": "OnlineEvaluatorService" }, - "shortName": "RebootPersistentResource" + "shortName": "ListOnlineEvaluators" }, "parameters": [ { "name": "request", - "type": "google.cloud.aiplatform_v1beta1.types.RebootPersistentResourceRequest" + "type": "google.cloud.aiplatform_v1beta1.types.ListOnlineEvaluatorsRequest" }, { - "name": "name", + "name": "parent", "type": "str" }, { @@ -45900,22 +46125,22 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.operation_async.AsyncOperation", - "shortName": "reboot_persistent_resource" + "resultType": "google.cloud.aiplatform_v1beta1.services.online_evaluator_service.pagers.ListOnlineEvaluatorsPager", + "shortName": "list_online_evaluators" }, - "description": "Sample for RebootPersistentResource", - "file": "aiplatform_v1beta1_generated_persistent_resource_service_reboot_persistent_resource_async.py", + "description": "Sample for ListOnlineEvaluators", + "file": "aiplatform_v1beta1_generated_online_evaluator_service_list_online_evaluators_sync.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_RebootPersistentResource_async", + "regionTag": "aiplatform_v1beta1_generated_OnlineEvaluatorService_ListOnlineEvaluators_sync", "segments": [ { - "end": 55, + "end": 52, "start": 27, "type": "FULL" }, { - "end": 55, + "end": 52, "start": 27, "type": "SHORT" }, @@ -45930,38 +46155,39 @@ "type": "REQUEST_INITIALIZATION" }, { - "end": 52, + "end": 48, "start": 46, "type": "REQUEST_EXECUTION" }, { - "end": 56, - "start": 53, + "end": 53, + "start": 49, "type": "RESPONSE_HANDLING" } ], - "title": "aiplatform_v1beta1_generated_persistent_resource_service_reboot_persistent_resource_async.py" + "title": "aiplatform_v1beta1_generated_online_evaluator_service_list_online_evaluators_sync.py" }, { "canonical": true, "clientMethod": { + "async": true, "client": { - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient", - "shortName": "PersistentResourceServiceClient" + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient", + "shortName": "OnlineEvaluatorServiceAsyncClient" }, - "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient.reboot_persistent_resource", + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.suspend_online_evaluator", "method": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.RebootPersistentResource", + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService.SuspendOnlineEvaluator", "service": { - "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", - "shortName": "PersistentResourceService" + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "shortName": "OnlineEvaluatorService" }, - "shortName": "RebootPersistentResource" + "shortName": "SuspendOnlineEvaluator" }, "parameters": [ { "name": "request", - "type": "google.cloud.aiplatform_v1beta1.types.RebootPersistentResourceRequest" + "type": "google.cloud.aiplatform_v1beta1.types.SuspendOnlineEvaluatorRequest" }, { "name": "name", @@ -45980,14 +46206,1084 @@ "type": "Sequence[Tuple[str, Union[str, bytes]]]" } ], - "resultType": "google.api_core.operation.Operation", - "shortName": "reboot_persistent_resource" + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "suspend_online_evaluator" }, - "description": "Sample for RebootPersistentResource", - "file": "aiplatform_v1beta1_generated_persistent_resource_service_reboot_persistent_resource_sync.py", + "description": "Sample for SuspendOnlineEvaluator", + "file": "aiplatform_v1beta1_generated_online_evaluator_service_suspend_online_evaluator_async.py", "language": "PYTHON", "origin": "API_DEFINITION", - "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_RebootPersistentResource_sync", + "regionTag": "aiplatform_v1beta1_generated_OnlineEvaluatorService_SuspendOnlineEvaluator_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_online_evaluator_service_suspend_online_evaluator_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient", + "shortName": "OnlineEvaluatorServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.suspend_online_evaluator", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService.SuspendOnlineEvaluator", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "shortName": "OnlineEvaluatorService" + }, + "shortName": "SuspendOnlineEvaluator" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.SuspendOnlineEvaluatorRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "suspend_online_evaluator" + }, + "description": "Sample for SuspendOnlineEvaluator", + "file": "aiplatform_v1beta1_generated_online_evaluator_service_suspend_online_evaluator_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_OnlineEvaluatorService_SuspendOnlineEvaluator_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_online_evaluator_service_suspend_online_evaluator_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient", + "shortName": "OnlineEvaluatorServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceAsyncClient.update_online_evaluator", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService.UpdateOnlineEvaluator", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "shortName": "OnlineEvaluatorService" + }, + "shortName": "UpdateOnlineEvaluator" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.UpdateOnlineEvaluatorRequest" + }, + { + "name": "online_evaluator", + "type": "google.cloud.aiplatform_v1beta1.types.OnlineEvaluator" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_online_evaluator" + }, + "description": "Sample for UpdateOnlineEvaluator", + "file": "aiplatform_v1beta1_generated_online_evaluator_service_update_online_evaluator_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_OnlineEvaluatorService_UpdateOnlineEvaluator_async", + "segments": [ + { + "end": 61, + "start": 27, + "type": "FULL" + }, + { + "end": 61, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 51, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 58, + "start": 52, + "type": "REQUEST_EXECUTION" + }, + { + "end": 62, + "start": 59, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_online_evaluator_service_update_online_evaluator_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient", + "shortName": "OnlineEvaluatorServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.OnlineEvaluatorServiceClient.update_online_evaluator", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService.UpdateOnlineEvaluator", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.OnlineEvaluatorService", + "shortName": "OnlineEvaluatorService" + }, + "shortName": "UpdateOnlineEvaluator" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.UpdateOnlineEvaluatorRequest" + }, + { + "name": "online_evaluator", + "type": "google.cloud.aiplatform_v1beta1.types.OnlineEvaluator" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_online_evaluator" + }, + "description": "Sample for UpdateOnlineEvaluator", + "file": "aiplatform_v1beta1_generated_online_evaluator_service_update_online_evaluator_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_OnlineEvaluatorService_UpdateOnlineEvaluator_sync", + "segments": [ + { + "end": 61, + "start": 27, + "type": "FULL" + }, + { + "end": 61, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 51, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 58, + "start": 52, + "type": "REQUEST_EXECUTION" + }, + { + "end": 62, + "start": 59, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_online_evaluator_service_update_online_evaluator_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient", + "shortName": "PersistentResourceServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient.create_persistent_resource", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.CreatePersistentResource", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", + "shortName": "PersistentResourceService" + }, + "shortName": "CreatePersistentResource" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.CreatePersistentResourceRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "persistent_resource", + "type": "google.cloud.aiplatform_v1beta1.types.PersistentResource" + }, + { + "name": "persistent_resource_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_persistent_resource" + }, + "description": "Sample for CreatePersistentResource", + "file": "aiplatform_v1beta1_generated_persistent_resource_service_create_persistent_resource_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_CreatePersistentResource_async", + "segments": [ + { + "end": 56, + "start": 27, + "type": "FULL" + }, + { + "end": 56, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 53, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 57, + "start": 54, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_persistent_resource_service_create_persistent_resource_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient", + "shortName": "PersistentResourceServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient.create_persistent_resource", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.CreatePersistentResource", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", + "shortName": "PersistentResourceService" + }, + "shortName": "CreatePersistentResource" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.CreatePersistentResourceRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "persistent_resource", + "type": "google.cloud.aiplatform_v1beta1.types.PersistentResource" + }, + { + "name": "persistent_resource_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_persistent_resource" + }, + "description": "Sample for CreatePersistentResource", + "file": "aiplatform_v1beta1_generated_persistent_resource_service_create_persistent_resource_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_CreatePersistentResource_sync", + "segments": [ + { + "end": 56, + "start": 27, + "type": "FULL" + }, + { + "end": 56, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 53, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 57, + "start": 54, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_persistent_resource_service_create_persistent_resource_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient", + "shortName": "PersistentResourceServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient.delete_persistent_resource", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.DeletePersistentResource", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", + "shortName": "PersistentResourceService" + }, + "shortName": "DeletePersistentResource" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.DeletePersistentResourceRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_persistent_resource" + }, + "description": "Sample for DeletePersistentResource", + "file": "aiplatform_v1beta1_generated_persistent_resource_service_delete_persistent_resource_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_DeletePersistentResource_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_persistent_resource_service_delete_persistent_resource_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient", + "shortName": "PersistentResourceServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient.delete_persistent_resource", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.DeletePersistentResource", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", + "shortName": "PersistentResourceService" + }, + "shortName": "DeletePersistentResource" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.DeletePersistentResourceRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_persistent_resource" + }, + "description": "Sample for DeletePersistentResource", + "file": "aiplatform_v1beta1_generated_persistent_resource_service_delete_persistent_resource_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_DeletePersistentResource_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_persistent_resource_service_delete_persistent_resource_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient", + "shortName": "PersistentResourceServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient.get_persistent_resource", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.GetPersistentResource", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", + "shortName": "PersistentResourceService" + }, + "shortName": "GetPersistentResource" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.GetPersistentResourceRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.aiplatform_v1beta1.types.PersistentResource", + "shortName": "get_persistent_resource" + }, + "description": "Sample for GetPersistentResource", + "file": "aiplatform_v1beta1_generated_persistent_resource_service_get_persistent_resource_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_GetPersistentResource_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_persistent_resource_service_get_persistent_resource_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient", + "shortName": "PersistentResourceServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient.get_persistent_resource", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.GetPersistentResource", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", + "shortName": "PersistentResourceService" + }, + "shortName": "GetPersistentResource" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.GetPersistentResourceRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.aiplatform_v1beta1.types.PersistentResource", + "shortName": "get_persistent_resource" + }, + "description": "Sample for GetPersistentResource", + "file": "aiplatform_v1beta1_generated_persistent_resource_service_get_persistent_resource_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_GetPersistentResource_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_persistent_resource_service_get_persistent_resource_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient", + "shortName": "PersistentResourceServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient.list_persistent_resources", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.ListPersistentResources", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", + "shortName": "PersistentResourceService" + }, + "shortName": "ListPersistentResources" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.ListPersistentResourcesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.aiplatform_v1beta1.services.persistent_resource_service.pagers.ListPersistentResourcesAsyncPager", + "shortName": "list_persistent_resources" + }, + "description": "Sample for ListPersistentResources", + "file": "aiplatform_v1beta1_generated_persistent_resource_service_list_persistent_resources_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_ListPersistentResources_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_persistent_resource_service_list_persistent_resources_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient", + "shortName": "PersistentResourceServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient.list_persistent_resources", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.ListPersistentResources", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", + "shortName": "PersistentResourceService" + }, + "shortName": "ListPersistentResources" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.ListPersistentResourcesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.aiplatform_v1beta1.services.persistent_resource_service.pagers.ListPersistentResourcesPager", + "shortName": "list_persistent_resources" + }, + "description": "Sample for ListPersistentResources", + "file": "aiplatform_v1beta1_generated_persistent_resource_service_list_persistent_resources_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_ListPersistentResources_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_persistent_resource_service_list_persistent_resources_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient", + "shortName": "PersistentResourceServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceAsyncClient.reboot_persistent_resource", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.RebootPersistentResource", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", + "shortName": "PersistentResourceService" + }, + "shortName": "RebootPersistentResource" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.RebootPersistentResourceRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "reboot_persistent_resource" + }, + "description": "Sample for RebootPersistentResource", + "file": "aiplatform_v1beta1_generated_persistent_resource_service_reboot_persistent_resource_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_RebootPersistentResource_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_persistent_resource_service_reboot_persistent_resource_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient", + "shortName": "PersistentResourceServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.PersistentResourceServiceClient.reboot_persistent_resource", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService.RebootPersistentResource", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.PersistentResourceService", + "shortName": "PersistentResourceService" + }, + "shortName": "RebootPersistentResource" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.RebootPersistentResourceRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "reboot_persistent_resource" + }, + "description": "Sample for RebootPersistentResource", + "file": "aiplatform_v1beta1_generated_persistent_resource_service_reboot_persistent_resource_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_PersistentResourceService_RebootPersistentResource_sync", "segments": [ { "end": 55, @@ -50767,6 +52063,159 @@ ], "title": "aiplatform_v1beta1_generated_prediction_service_streaming_raw_predict_sync.py" }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineExecutionServiceAsyncClient", + "shortName": "ReasoningEngineExecutionServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineExecutionServiceAsyncClient.async_query_reasoning_engine", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService", + "shortName": "ReasoningEngineExecutionService" + }, + "shortName": "AsyncQueryReasoningEngine" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.AsyncQueryReasoningEngineRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "async_query_reasoning_engine" + }, + "description": "Sample for AsyncQueryReasoningEngine", + "file": "aiplatform_v1beta1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_ReasoningEngineExecutionService_AsyncQueryReasoningEngine_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineExecutionServiceClient", + "shortName": "ReasoningEngineExecutionServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineExecutionServiceClient.async_query_reasoning_engine", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.AsyncQueryReasoningEngine", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService", + "shortName": "ReasoningEngineExecutionService" + }, + "shortName": "AsyncQueryReasoningEngine" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.AsyncQueryReasoningEngineRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "async_query_reasoning_engine" + }, + "description": "Sample for AsyncQueryReasoningEngine", + "file": "aiplatform_v1beta1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_ReasoningEngineExecutionService_AsyncQueryReasoningEngine_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_sync.py" + }, { "canonical": true, "clientMethod": { diff --git a/tests/unit/gapic/aiplatform_v1/test_evaluation_service.py b/tests/unit/gapic/aiplatform_v1/test_evaluation_service.py index ea77f183b2..3de3ad40fe 100644 --- a/tests/unit/gapic/aiplatform_v1/test_evaluation_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_evaluation_service.py @@ -70,7 +70,9 @@ EvaluationServiceClient, ) from google.cloud.aiplatform_v1.services.evaluation_service import transports +from google.cloud.aiplatform_v1.types import content from google.cloud.aiplatform_v1.types import evaluation_service +from google.cloud.aiplatform_v1.types import tool from google.cloud.location import locations_pb2 from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import options_pb2 # type: ignore @@ -78,6 +80,8 @@ from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account import google.auth +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore CRED_INFO_JSON = { diff --git a/tests/unit/gapic/aiplatform_v1/test_gen_ai_tuning_service.py b/tests/unit/gapic/aiplatform_v1/test_gen_ai_tuning_service.py index e23e353b98..3438eb27d7 100644 --- a/tests/unit/gapic/aiplatform_v1/test_gen_ai_tuning_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_gen_ai_tuning_service.py @@ -76,9 +76,11 @@ from google.cloud.aiplatform_v1.services.gen_ai_tuning_service import transports from google.cloud.aiplatform_v1.types import content from google.cloud.aiplatform_v1.types import encryption_spec +from google.cloud.aiplatform_v1.types import evaluation_service from google.cloud.aiplatform_v1.types import genai_tuning_service from google.cloud.aiplatform_v1.types import io from google.cloud.aiplatform_v1.types import job_state +from google.cloud.aiplatform_v1.types import openapi from google.cloud.aiplatform_v1.types import tool from google.cloud.aiplatform_v1.types import tuning_job from google.cloud.aiplatform_v1.types import tuning_job as gca_tuning_job @@ -4742,6 +4744,155 @@ def test_create_tuning_job_rest_call_success(request_type): "adapter_size": 1, }, "export_last_checkpoint_only": True, + "evaluation_config": { + "metrics": [ + { + "predefined_metric_spec": { + "metric_spec_name": "metric_spec_name_value", + "metric_spec_parameters": {"fields": {}}, + }, + "computation_based_metric_spec": {"type_": 1, "parameters": {}}, + "llm_based_metric_spec": { + "rubric_group_key": "rubric_group_key_value", + "predefined_rubric_generation_spec": {}, + "metric_prompt_template": "metric_prompt_template_value", + "system_instruction": "system_instruction_value", + "judge_autorater_config": { + "sampling_count": 1507, + "flip_enabled": True, + "autorater_model": "autorater_model_value", + "generation_config": { + "temperature": 0.1198, + "top_p": 0.546, + "top_k": 0.541, + "candidate_count": 1573, + "max_output_tokens": 1865, + "stop_sequences": [ + "stop_sequences_value1", + "stop_sequences_value2", + ], + "response_logprobs": True, + "logprobs": 872, + "presence_penalty": 0.1713, + "frequency_penalty": 0.18380000000000002, + "seed": 417, + "response_mime_type": "response_mime_type_value", + "response_schema": { + "type_": 1, + "format_": "format__value", + "title": "title_value", + "description": "description_value", + "nullable": True, + "default": { + "null_value": 0, + "number_value": 0.1285, + "string_value": "string_value_value", + "bool_value": True, + "struct_value": {}, + "list_value": {"values": {}}, + }, + "items": {}, + "min_items": 965, + "max_items": 967, + "enum": ["enum_value1", "enum_value2"], + "properties": {}, + "property_ordering": [ + "property_ordering_value1", + "property_ordering_value2", + ], + "required": [ + "required_value1", + "required_value2", + ], + "min_properties": 1520, + "max_properties": 1522, + "minimum": 0.764, + "maximum": 0.766, + "min_length": 1061, + "max_length": 1063, + "pattern": "pattern_value", + "example": {}, + "any_of": {}, + "additional_properties": {}, + "ref": "ref_value", + "defs": {}, + }, + "response_json_schema": {}, + "routing_config": { + "auto_mode": {"model_routing_preference": 1}, + "manual_mode": { + "model_name": "model_name_value" + }, + }, + "audio_timestamp": True, + "response_modalities": [1], + "media_resolution": 1, + "speech_config": { + "voice_config": { + "prebuilt_voice_config": { + "voice_name": "voice_name_value" + }, + "replicated_voice_config": { + "mime_type": "mime_type_value", + "voice_sample_audio": b"voice_sample_audio_blob", + }, + }, + "language_code": "language_code_value", + "multi_speaker_voice_config": { + "speaker_voice_configs": [ + { + "speaker": "speaker_value", + "voice_config": {}, + } + ] + }, + }, + "thinking_config": { + "include_thoughts": True, + "thinking_budget": 1590, + "thinking_level": 1, + }, + "image_config": { + "image_output_options": { + "mime_type": "mime_type_value", + "compression_quality": 2074, + }, + "aspect_ratio": "aspect_ratio_value", + "person_generation": 1, + "image_size": "image_size_value", + }, + }, + }, + "additional_config": {}, + }, + "pointwise_metric_spec": { + "metric_prompt_template": "metric_prompt_template_value", + "system_instruction": "system_instruction_value", + "custom_output_format_config": {"return_raw_output": True}, + }, + "pairwise_metric_spec": { + "metric_prompt_template": "metric_prompt_template_value", + "candidate_response_field_name": "candidate_response_field_name_value", + "baseline_response_field_name": "baseline_response_field_name_value", + "system_instruction": "system_instruction_value", + "custom_output_format_config": {}, + }, + "exact_match_spec": {}, + "bleu_spec": {"use_effective_order": True}, + "rouge_spec": { + "rouge_type": "rouge_type_value", + "use_stemmer": True, + "split_summaries": True, + }, + "aggregation_metrics": [1], + } + ], + "output_config": { + "gcs_destination": {"output_uri_prefix": "output_uri_prefix_value"} + }, + "autorater_config": {}, + "inference_generation_config": {}, + }, }, "name": "name_value", "tuned_model_display_name": "tuned_model_display_name_value", @@ -4811,7 +4962,7 @@ def test_create_tuning_job_rest_call_success(request_type): }, "function_call": { "name": "name_value", - "args": {"fields": {}}, + "args": {}, "partial_args": [ { "null_value": 0, @@ -4872,6 +5023,50 @@ def test_create_tuning_job_rest_call_success(request_type): }, "encryption_spec": {"kms_key_name": "kms_key_name_value"}, "service_account": "service_account_value", + "evaluate_dataset_runs": [ + { + "operation_name": "operation_name_value", + "evaluation_run": "evaluation_run_value", + "checkpoint_id": "checkpoint_id_value", + "evaluate_dataset_response": { + "aggregation_output": { + "dataset": { + "gcs_source": {"uris": ["uris_value1", "uris_value2"]}, + "bigquery_source": {"input_uri": "input_uri_value"}, + }, + "aggregation_results": [ + { + "pointwise_metric_result": { + "score": 0.54, + "explanation": "explanation_value", + "custom_output": { + "raw_outputs": { + "raw_output": [ + "raw_output_value1", + "raw_output_value2", + ] + } + }, + }, + "pairwise_metric_result": { + "pairwise_choice": 1, + "explanation": "explanation_value", + "custom_output": {}, + }, + "exact_match_metric_value": {"score": 0.54}, + "bleu_metric_value": {"score": 0.54}, + "rouge_metric_value": {"score": 0.54}, + "aggregation_metric": 1, + } + ], + }, + "output_info": { + "gcs_output_directory": "gcs_output_directory_value" + }, + }, + "error": {}, + } + ], } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -6375,6 +6570,155 @@ async def test_create_tuning_job_rest_asyncio_call_success(request_type): "adapter_size": 1, }, "export_last_checkpoint_only": True, + "evaluation_config": { + "metrics": [ + { + "predefined_metric_spec": { + "metric_spec_name": "metric_spec_name_value", + "metric_spec_parameters": {"fields": {}}, + }, + "computation_based_metric_spec": {"type_": 1, "parameters": {}}, + "llm_based_metric_spec": { + "rubric_group_key": "rubric_group_key_value", + "predefined_rubric_generation_spec": {}, + "metric_prompt_template": "metric_prompt_template_value", + "system_instruction": "system_instruction_value", + "judge_autorater_config": { + "sampling_count": 1507, + "flip_enabled": True, + "autorater_model": "autorater_model_value", + "generation_config": { + "temperature": 0.1198, + "top_p": 0.546, + "top_k": 0.541, + "candidate_count": 1573, + "max_output_tokens": 1865, + "stop_sequences": [ + "stop_sequences_value1", + "stop_sequences_value2", + ], + "response_logprobs": True, + "logprobs": 872, + "presence_penalty": 0.1713, + "frequency_penalty": 0.18380000000000002, + "seed": 417, + "response_mime_type": "response_mime_type_value", + "response_schema": { + "type_": 1, + "format_": "format__value", + "title": "title_value", + "description": "description_value", + "nullable": True, + "default": { + "null_value": 0, + "number_value": 0.1285, + "string_value": "string_value_value", + "bool_value": True, + "struct_value": {}, + "list_value": {"values": {}}, + }, + "items": {}, + "min_items": 965, + "max_items": 967, + "enum": ["enum_value1", "enum_value2"], + "properties": {}, + "property_ordering": [ + "property_ordering_value1", + "property_ordering_value2", + ], + "required": [ + "required_value1", + "required_value2", + ], + "min_properties": 1520, + "max_properties": 1522, + "minimum": 0.764, + "maximum": 0.766, + "min_length": 1061, + "max_length": 1063, + "pattern": "pattern_value", + "example": {}, + "any_of": {}, + "additional_properties": {}, + "ref": "ref_value", + "defs": {}, + }, + "response_json_schema": {}, + "routing_config": { + "auto_mode": {"model_routing_preference": 1}, + "manual_mode": { + "model_name": "model_name_value" + }, + }, + "audio_timestamp": True, + "response_modalities": [1], + "media_resolution": 1, + "speech_config": { + "voice_config": { + "prebuilt_voice_config": { + "voice_name": "voice_name_value" + }, + "replicated_voice_config": { + "mime_type": "mime_type_value", + "voice_sample_audio": b"voice_sample_audio_blob", + }, + }, + "language_code": "language_code_value", + "multi_speaker_voice_config": { + "speaker_voice_configs": [ + { + "speaker": "speaker_value", + "voice_config": {}, + } + ] + }, + }, + "thinking_config": { + "include_thoughts": True, + "thinking_budget": 1590, + "thinking_level": 1, + }, + "image_config": { + "image_output_options": { + "mime_type": "mime_type_value", + "compression_quality": 2074, + }, + "aspect_ratio": "aspect_ratio_value", + "person_generation": 1, + "image_size": "image_size_value", + }, + }, + }, + "additional_config": {}, + }, + "pointwise_metric_spec": { + "metric_prompt_template": "metric_prompt_template_value", + "system_instruction": "system_instruction_value", + "custom_output_format_config": {"return_raw_output": True}, + }, + "pairwise_metric_spec": { + "metric_prompt_template": "metric_prompt_template_value", + "candidate_response_field_name": "candidate_response_field_name_value", + "baseline_response_field_name": "baseline_response_field_name_value", + "system_instruction": "system_instruction_value", + "custom_output_format_config": {}, + }, + "exact_match_spec": {}, + "bleu_spec": {"use_effective_order": True}, + "rouge_spec": { + "rouge_type": "rouge_type_value", + "use_stemmer": True, + "split_summaries": True, + }, + "aggregation_metrics": [1], + } + ], + "output_config": { + "gcs_destination": {"output_uri_prefix": "output_uri_prefix_value"} + }, + "autorater_config": {}, + "inference_generation_config": {}, + }, }, "name": "name_value", "tuned_model_display_name": "tuned_model_display_name_value", @@ -6444,7 +6788,7 @@ async def test_create_tuning_job_rest_asyncio_call_success(request_type): }, "function_call": { "name": "name_value", - "args": {"fields": {}}, + "args": {}, "partial_args": [ { "null_value": 0, @@ -6505,6 +6849,50 @@ async def test_create_tuning_job_rest_asyncio_call_success(request_type): }, "encryption_spec": {"kms_key_name": "kms_key_name_value"}, "service_account": "service_account_value", + "evaluate_dataset_runs": [ + { + "operation_name": "operation_name_value", + "evaluation_run": "evaluation_run_value", + "checkpoint_id": "checkpoint_id_value", + "evaluate_dataset_response": { + "aggregation_output": { + "dataset": { + "gcs_source": {"uris": ["uris_value1", "uris_value2"]}, + "bigquery_source": {"input_uri": "input_uri_value"}, + }, + "aggregation_results": [ + { + "pointwise_metric_result": { + "score": 0.54, + "explanation": "explanation_value", + "custom_output": { + "raw_outputs": { + "raw_output": [ + "raw_output_value1", + "raw_output_value2", + ] + } + }, + }, + "pairwise_metric_result": { + "pairwise_choice": 1, + "explanation": "explanation_value", + "custom_output": {}, + }, + "exact_match_metric_value": {"score": 0.54}, + "bleu_metric_value": {"score": 0.54}, + "rouge_metric_value": {"score": 0.54}, + "aggregation_metric": 1, + } + ], + }, + "output_info": { + "gcs_output_directory": "gcs_output_directory_value" + }, + }, + "error": {}, + } + ], } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency diff --git a/tests/unit/gapic/aiplatform_v1/test_model_service.py b/tests/unit/gapic/aiplatform_v1/test_model_service.py index 4591968814..2a1afa47e5 100644 --- a/tests/unit/gapic/aiplatform_v1/test_model_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_model_service.py @@ -5959,6 +5959,7 @@ def test_copy_model_non_empty_request_with_auto_populated_field(): parent_model="parent_model_value", parent="parent_value", source_model="source_model_value", + custom_service_account="custom_service_account_value", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5974,6 +5975,7 @@ def test_copy_model_non_empty_request_with_auto_populated_field(): parent_model="parent_model_value", parent="parent_value", source_model="source_model_value", + custom_service_account="custom_service_account_value", ) diff --git a/tests/unit/gapic/aiplatform_v1/test_reasoning_engine_execution_service.py b/tests/unit/gapic/aiplatform_v1/test_reasoning_engine_execution_service.py index 7d79a91f8d..2aee96606c 100644 --- a/tests/unit/gapic/aiplatform_v1/test_reasoning_engine_execution_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_reasoning_engine_execution_service.py @@ -56,9 +56,12 @@ from google.api_core import client_options from google.api_core import exceptions as core_exceptions +from google.api_core import future from google.api_core import gapic_v1 from google.api_core import grpc_helpers from google.api_core import grpc_helpers_async +from google.api_core import operation +from google.api_core import operations_v1 from google.api_core import path_template from google.api_core import retry as retries from google.auth import credentials as ga_credentials @@ -80,6 +83,7 @@ from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore +import google.api_core.operation_async as operation_async # type: ignore import google.auth import google.protobuf.any_pb2 as any_pb2 # type: ignore import google.protobuf.struct_pb2 as struct_pb2 # type: ignore @@ -1978,6 +1982,273 @@ async def test_stream_query_reasoning_engine_field_headers_async(): ) in kw["metadata"] +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + dict, + ], +) +def test_async_query_reasoning_engine(request_type, transport: str = "grpc"): + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + request = reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_async_query_reasoning_engine_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Populate all string fields in the request which are not UUID4 + # since we want to check that UUID4 are populated automatically + # if they meet the requirements of AIP 4235. + request = reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest( + name="name_value", + input_gcs_uri="input_gcs_uri_value", + output_gcs_uri="output_gcs_uri_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.async_query_reasoning_engine(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[ + 0 + ] == reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest( + name="name_value", + input_gcs_uri="input_gcs_uri_value", + output_gcs_uri="output_gcs_uri_value", + ) + + +def test_async_query_reasoning_engine_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.async_query_reasoning_engine + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.async_query_reasoning_engine + ] = mock_rpc + request = {} + client.async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.async_query_reasoning_engine(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_async_query_reasoning_engine_async_use_cached_wrapped_rpc( + transport: str = "grpc_asyncio", +): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._client._transport.async_query_reasoning_engine + in client._client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.AsyncMock() + mock_rpc.return_value = mock.Mock() + client._client._transport._wrapped_methods[ + client._client._transport.async_query_reasoning_engine + ] = mock_rpc + + request = {} + await client.async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + await client.async_query_reasoning_engine(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_async_query_reasoning_engine_async( + transport: str = "grpc_asyncio", + request_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, +): + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + request = reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_async_query_reasoning_engine_async_from_dict(): + await test_async_query_reasoning_engine_async(request_type=dict) + + +def test_async_query_reasoning_engine_field_headers(): + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=name_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_async_query_reasoning_engine_field_headers_async(): + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=name_value", + ) in kw["metadata"] + + def test_query_reasoning_engine_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call @@ -2237,6 +2508,133 @@ def test_stream_query_reasoning_engine_rest_unset_required_fields(): assert set(unset_fields) == (set(()) & set(("name",))) +def test_async_query_reasoning_engine_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.async_query_reasoning_engine + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.async_query_reasoning_engine + ] = mock_rpc + + request = {} + client.async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.async_query_reasoning_engine(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_async_query_reasoning_engine_rest_required_fields( + request_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, +): + transport_class = transports.ReasoningEngineExecutionServiceRestTransport + + request_init = {} + request_init["name"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).async_query_reasoning_engine._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["name"] = "name_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).async_query_reasoning_engine._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "name" in jsonified_request + assert jsonified_request["name"] == "name_value" + + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.async_query_reasoning_engine(request) + + expected_params = [("$alt", "json;enum-encoding=int")] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_async_query_reasoning_engine_rest_unset_required_fields(): + transport = transports.ReasoningEngineExecutionServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.async_query_reasoning_engine._get_unset_required_fields({}) + assert set(unset_fields) == (set(()) & set(("name",))) + + def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.ReasoningEngineExecutionServiceGrpcTransport( @@ -2393,6 +2791,31 @@ def test_stream_query_reasoning_engine_empty_call_grpc(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_async_query_reasoning_engine_empty_call_grpc(): + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.async_query_reasoning_engine(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + ) + + assert args[0] == request_msg + + def test_transport_kind_grpc_asyncio(): transport = ReasoningEngineExecutionServiceAsyncClient.get_transport_class( "grpc_asyncio" @@ -2462,6 +2885,35 @@ async def test_stream_query_reasoning_engine_empty_call_grpc_asyncio(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_async_query_reasoning_engine_empty_call_grpc_asyncio(): + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + await client.async_query_reasoning_engine(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + ) + + assert args[0] == request_msg + + def test_transport_kind_rest(): transport = ReasoningEngineExecutionServiceClient.get_transport_class("rest")( credentials=ga_credentials.AnonymousCredentials() @@ -2604,7 +3056,148 @@ def test_query_reasoning_engine_rest_interceptors(null_interceptor): metadata, ) - client.query_reasoning_engine( + client.query_reasoning_engine( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_stream_query_reasoning_engine_rest_bad_request( + request_type=reasoning_engine_execution_service.StreamQueryReasoningEngineRequest, +): + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.stream_query_reasoning_engine(request) + + +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_execution_service.StreamQueryReasoningEngineRequest, + dict, + ], +) +def test_stream_query_reasoning_engine_rest_call_success(request_type): + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = httpbody_pb2.HttpBody( + content_type="content_type_value", + data=b"data_blob", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + json_return_value = "[{}]".format(json_return_value) + response_value.iter_content = mock.Mock(return_value=iter(json_return_value)) + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.stream_query_reasoning_engine(request) + + assert isinstance(response, Iterable) + response = next(response) + + # Establish that the response is the type that we expect. + assert isinstance(response, httpbody_pb2.HttpBody) + assert response.content_type == "content_type_value" + assert response.data == b"data_blob" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_stream_query_reasoning_engine_rest_interceptors(null_interceptor): + transport = transports.ReasoningEngineExecutionServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=( + None + if null_interceptor + else transports.ReasoningEngineExecutionServiceRestInterceptor() + ), + ) + client = ReasoningEngineExecutionServiceClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.ReasoningEngineExecutionServiceRestInterceptor, + "post_stream_query_reasoning_engine", + ) as post, mock.patch.object( + transports.ReasoningEngineExecutionServiceRestInterceptor, + "post_stream_query_reasoning_engine_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.ReasoningEngineExecutionServiceRestInterceptor, + "pre_stream_query_reasoning_engine", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = ( + reasoning_engine_execution_service.StreamQueryReasoningEngineRequest.pb( + reasoning_engine_execution_service.StreamQueryReasoningEngineRequest() + ) + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = json_format.MessageToJson(httpbody_pb2.HttpBody()) + req.return_value.iter_content = mock.Mock(return_value=iter(return_value)) + + request = reasoning_engine_execution_service.StreamQueryReasoningEngineRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = httpbody_pb2.HttpBody() + post_with_metadata.return_value = httpbody_pb2.HttpBody(), metadata + + client.stream_query_reasoning_engine( request, metadata=[ ("key", "val"), @@ -2617,8 +3210,8 @@ def test_query_reasoning_engine_rest_interceptors(null_interceptor): post_with_metadata.assert_called_once() -def test_stream_query_reasoning_engine_rest_bad_request( - request_type=reasoning_engine_execution_service.StreamQueryReasoningEngineRequest, +def test_async_query_reasoning_engine_rest_bad_request( + request_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, ): client = ReasoningEngineExecutionServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" @@ -2641,17 +3234,17 @@ def test_stream_query_reasoning_engine_rest_bad_request( response_value.request = mock.Mock() req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - client.stream_query_reasoning_engine(request) + client.async_query_reasoning_engine(request) @pytest.mark.parametrize( "request_type", [ - reasoning_engine_execution_service.StreamQueryReasoningEngineRequest, + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, dict, ], ) -def test_stream_query_reasoning_engine_rest_call_success(request_type): +def test_async_query_reasoning_engine_rest_call_success(request_type): client = ReasoningEngineExecutionServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2665,32 +3258,23 @@ def test_stream_query_reasoning_engine_rest_call_success(request_type): # Mock the http request call within the method and fake a response. with mock.patch.object(type(client.transport._session), "request") as req: # Designate an appropriate value for the returned response. - return_value = httpbody_pb2.HttpBody( - content_type="content_type_value", - data=b"data_blob", - ) + return_value = operations_pb2.Operation(name="operations/spam") # Wrap the value into a proper Response obj response_value = mock.Mock() response_value.status_code = 200 json_return_value = json_format.MessageToJson(return_value) - json_return_value = "[{}]".format(json_return_value) - response_value.iter_content = mock.Mock(return_value=iter(json_return_value)) + response_value.content = json_return_value.encode("UTF-8") req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.stream_query_reasoning_engine(request) - - assert isinstance(response, Iterable) - response = next(response) + response = client.async_query_reasoning_engine(request) # Establish that the response is the type that we expect. - assert isinstance(response, httpbody_pb2.HttpBody) - assert response.content_type == "content_type_value" - assert response.data == b"data_blob" + json_return_value = json_format.MessageToJson(return_value) @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_stream_query_reasoning_engine_rest_interceptors(null_interceptor): +def test_async_query_reasoning_engine_rest_interceptors(null_interceptor): transport = transports.ReasoningEngineExecutionServiceRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=( @@ -2706,21 +3290,23 @@ def test_stream_query_reasoning_engine_rest_interceptors(null_interceptor): ) as req, mock.patch.object( path_template, "transcode" ) as transcode, mock.patch.object( + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( transports.ReasoningEngineExecutionServiceRestInterceptor, - "post_stream_query_reasoning_engine", + "post_async_query_reasoning_engine", ) as post, mock.patch.object( transports.ReasoningEngineExecutionServiceRestInterceptor, - "post_stream_query_reasoning_engine_with_metadata", + "post_async_query_reasoning_engine_with_metadata", ) as post_with_metadata, mock.patch.object( transports.ReasoningEngineExecutionServiceRestInterceptor, - "pre_stream_query_reasoning_engine", + "pre_async_query_reasoning_engine", ) as pre: pre.assert_not_called() post.assert_not_called() post_with_metadata.assert_not_called() pb_message = ( - reasoning_engine_execution_service.StreamQueryReasoningEngineRequest.pb( - reasoning_engine_execution_service.StreamQueryReasoningEngineRequest() + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest.pb( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() ) ) transcode.return_value = { @@ -2733,19 +3319,19 @@ def test_stream_query_reasoning_engine_rest_interceptors(null_interceptor): req.return_value = mock.Mock() req.return_value.status_code = 200 req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - return_value = json_format.MessageToJson(httpbody_pb2.HttpBody()) - req.return_value.iter_content = mock.Mock(return_value=iter(return_value)) + return_value = json_format.MessageToJson(operations_pb2.Operation()) + req.return_value.content = return_value - request = reasoning_engine_execution_service.StreamQueryReasoningEngineRequest() + request = reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() metadata = [ ("key", "val"), ("cephalopod", "squid"), ] pre.return_value = request, metadata - post.return_value = httpbody_pb2.HttpBody() - post_with_metadata.return_value = httpbody_pb2.HttpBody(), metadata + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata - client.stream_query_reasoning_engine( + client.async_query_reasoning_engine( request, metadata=[ ("key", "val"), @@ -3436,6 +4022,47 @@ def test_stream_query_reasoning_engine_empty_call_rest(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_async_query_reasoning_engine_empty_call_rest(): + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + client.async_query_reasoning_engine(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + ) + + assert args[0] == request_msg + + +def test_reasoning_engine_execution_service_rest_lro_client(): + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + transport = client.transport + + # Ensure that we have an api-core operations client. + assert isinstance( + transport.operations_client, + operations_v1.AbstractOperationsClient, + ) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + def test_transport_kind_rest_asyncio(): if not HAS_ASYNC_REST_EXTRA: pytest.skip( @@ -3768,6 +4395,156 @@ async def test_stream_query_reasoning_engine_rest_asyncio_interceptors( post_with_metadata.assert_called_once() +@pytest.mark.asyncio +async def test_async_query_reasoning_engine_rest_asyncio_bad_request( + request_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.async_query_reasoning_engine(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + dict, + ], +) +async def test_async_query_reasoning_engine_rest_asyncio_call_success(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = await client.async_query_reasoning_engine(request) + + # Establish that the response is the type that we expect. + json_return_value = json_format.MessageToJson(return_value) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("null_interceptor", [True, False]) +async def test_async_query_reasoning_engine_rest_asyncio_interceptors(null_interceptor): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + transport = transports.AsyncReasoningEngineExecutionServiceRestTransport( + credentials=async_anonymous_credentials(), + interceptor=( + None + if null_interceptor + else transports.AsyncReasoningEngineExecutionServiceRestInterceptor() + ), + ) + client = ReasoningEngineExecutionServiceAsyncClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( + transports.AsyncReasoningEngineExecutionServiceRestInterceptor, + "post_async_query_reasoning_engine", + ) as post, mock.patch.object( + transports.AsyncReasoningEngineExecutionServiceRestInterceptor, + "post_async_query_reasoning_engine_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.AsyncReasoningEngineExecutionServiceRestInterceptor, + "pre_async_query_reasoning_engine", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = ( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest.pb( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + ) + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = json_format.MessageToJson(operations_pb2.Operation()) + req.return_value.read = mock.AsyncMock(return_value=return_value) + + request = reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata + + await client.async_query_reasoning_engine( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + @pytest.mark.asyncio async def test_get_location_rest_asyncio_bad_request( request_type=locations_pb2.GetLocationRequest, @@ -4572,6 +5349,56 @@ async def test_stream_query_reasoning_engine_empty_call_rest_asyncio(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_async_query_reasoning_engine_empty_call_rest_asyncio(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + await client.async_query_reasoning_engine(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + ) + + assert args[0] == request_msg + + +def test_reasoning_engine_execution_service_rest_asyncio_lro_client(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + transport = client.transport + + # Ensure that we have an api-core operations client. + assert isinstance( + transport.operations_client, + operations_v1.AsyncOperationsRestClient, + ) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + def test_unsupported_parameter_rest_asyncio(): if not HAS_ASYNC_REST_EXTRA: pytest.skip( @@ -4621,6 +5448,7 @@ def test_reasoning_engine_execution_service_base_transport(): methods = ( "query_reasoning_engine", "stream_query_reasoning_engine", + "async_query_reasoning_engine", "set_iam_policy", "get_iam_policy", "test_iam_permissions", @@ -4639,6 +5467,11 @@ def test_reasoning_engine_execution_service_base_transport(): with pytest.raises(NotImplementedError): transport.close() + # Additionally, the LRO client (a property) should + # also raise NotImplementedError + with pytest.raises(NotImplementedError): + transport.operations_client + # Catch all for all remaining methods and properties remainder = [ "kind", @@ -4906,6 +5739,9 @@ def test_reasoning_engine_execution_service_client_transport_session_collision( session1 = client1.transport.stream_query_reasoning_engine._session session2 = client2.transport.stream_query_reasoning_engine._session assert session1 != session2 + session1 = client1.transport.async_query_reasoning_engine._session + session2 = client2.transport.async_query_reasoning_engine._session + assert session1 != session2 def test_reasoning_engine_execution_service_grpc_transport_channel(): @@ -5037,6 +5873,40 @@ def test_reasoning_engine_execution_service_transport_channel_mtls_with_adc( assert transport.grpc_channel == mock_grpc_channel +def test_reasoning_engine_execution_service_grpc_lro_client(): + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + transport = client.transport + + # Ensure that we have a api-core operations client. + assert isinstance( + transport.operations_client, + operations_v1.OperationsClient, + ) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + +def test_reasoning_engine_execution_service_grpc_lro_async_client(): + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", + ) + transport = client.transport + + # Ensure that we have a api-core operations client. + assert isinstance( + transport.operations_client, + operations_v1.OperationsAsyncClient, + ) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + def test_reasoning_engine_path(): project = "squid" location = "clam" diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_evaluation_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_evaluation_service.py index 18ca9e4410..69417b6158 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_evaluation_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_evaluation_service.py @@ -74,8 +74,11 @@ ) from google.cloud.aiplatform_v1beta1.services.evaluation_service import transports from google.cloud.aiplatform_v1beta1.types import content +from google.cloud.aiplatform_v1beta1.types import evaluation_agent_data +from google.cloud.aiplatform_v1beta1.types import evaluation_rubric from google.cloud.aiplatform_v1beta1.types import evaluation_service from google.cloud.aiplatform_v1beta1.types import io +from google.cloud.aiplatform_v1beta1.types import openapi from google.cloud.aiplatform_v1beta1.types import tool from google.cloud.location import locations_pb2 from google.iam.v1 import iam_policy_pb2 # type: ignore @@ -87,6 +90,7 @@ import google.auth import google.protobuf.duration_pb2 as duration_pb2 # type: ignore import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore CRED_INFO_JSON = { @@ -1868,6 +1872,257 @@ async def test_evaluate_dataset_field_headers_async(): ) in kw["metadata"] +@pytest.mark.parametrize( + "request_type", + [ + evaluation_service.GenerateInstanceRubricsRequest, + dict, + ], +) +def test_generate_instance_rubrics(request_type, transport: str = "grpc"): + client = EvaluationServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.generate_instance_rubrics), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = evaluation_service.GenerateInstanceRubricsResponse() + response = client.generate_instance_rubrics(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + request = evaluation_service.GenerateInstanceRubricsRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, evaluation_service.GenerateInstanceRubricsResponse) + + +def test_generate_instance_rubrics_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. + client = EvaluationServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Populate all string fields in the request which are not UUID4 + # since we want to check that UUID4 are populated automatically + # if they meet the requirements of AIP 4235. + request = evaluation_service.GenerateInstanceRubricsRequest( + location="location_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.generate_instance_rubrics), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.generate_instance_rubrics(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == evaluation_service.GenerateInstanceRubricsRequest( + location="location_value", + ) + + +def test_generate_instance_rubrics_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = EvaluationServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.generate_instance_rubrics + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.generate_instance_rubrics + ] = mock_rpc + request = {} + client.generate_instance_rubrics(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.generate_instance_rubrics(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_generate_instance_rubrics_async_use_cached_wrapped_rpc( + transport: str = "grpc_asyncio", +): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: + client = EvaluationServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._client._transport.generate_instance_rubrics + in client._client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.AsyncMock() + mock_rpc.return_value = mock.Mock() + client._client._transport._wrapped_methods[ + client._client._transport.generate_instance_rubrics + ] = mock_rpc + + request = {} + await client.generate_instance_rubrics(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + await client.generate_instance_rubrics(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_generate_instance_rubrics_async( + transport: str = "grpc_asyncio", + request_type=evaluation_service.GenerateInstanceRubricsRequest, +): + client = EvaluationServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.generate_instance_rubrics), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + evaluation_service.GenerateInstanceRubricsResponse() + ) + response = await client.generate_instance_rubrics(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + request = evaluation_service.GenerateInstanceRubricsRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, evaluation_service.GenerateInstanceRubricsResponse) + + +@pytest.mark.asyncio +async def test_generate_instance_rubrics_async_from_dict(): + await test_generate_instance_rubrics_async(request_type=dict) + + +def test_generate_instance_rubrics_field_headers(): + client = EvaluationServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = evaluation_service.GenerateInstanceRubricsRequest() + + request.location = "location_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.generate_instance_rubrics), "__call__" + ) as call: + call.return_value = evaluation_service.GenerateInstanceRubricsResponse() + client.generate_instance_rubrics(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "location=location_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_generate_instance_rubrics_field_headers_async(): + client = EvaluationServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = evaluation_service.GenerateInstanceRubricsRequest() + + request.location = "location_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.generate_instance_rubrics), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + evaluation_service.GenerateInstanceRubricsResponse() + ) + await client.generate_instance_rubrics(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "location=location_value", + ) in kw["metadata"] + + def test_evaluate_instances_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call @@ -2127,6 +2382,142 @@ def test_evaluate_dataset_rest_unset_required_fields(): ) +def test_generate_instance_rubrics_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = EvaluationServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.generate_instance_rubrics + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.generate_instance_rubrics + ] = mock_rpc + + request = {} + client.generate_instance_rubrics(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.generate_instance_rubrics(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_generate_instance_rubrics_rest_required_fields( + request_type=evaluation_service.GenerateInstanceRubricsRequest, +): + transport_class = transports.EvaluationServiceRestTransport + + request_init = {} + request_init["location"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).generate_instance_rubrics._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["location"] = "location_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).generate_instance_rubrics._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "location" in jsonified_request + assert jsonified_request["location"] == "location_value" + + client = EvaluationServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = evaluation_service.GenerateInstanceRubricsResponse() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = evaluation_service.GenerateInstanceRubricsResponse.pb( + return_value + ) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.generate_instance_rubrics(request) + + expected_params = [("$alt", "json;enum-encoding=int")] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_generate_instance_rubrics_rest_unset_required_fields(): + transport = transports.EvaluationServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.generate_instance_rubrics._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "location", + "contents", + ) + ) + ) + + def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.EvaluationServiceGrpcTransport( @@ -2277,6 +2668,29 @@ def test_evaluate_dataset_empty_call_grpc(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_generate_instance_rubrics_empty_call_grpc(): + client = EvaluationServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.generate_instance_rubrics), "__call__" + ) as call: + call.return_value = evaluation_service.GenerateInstanceRubricsResponse() + client.generate_instance_rubrics(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = evaluation_service.GenerateInstanceRubricsRequest() + + assert args[0] == request_msg + + def test_transport_kind_grpc_asyncio(): transport = EvaluationServiceAsyncClient.get_transport_class("grpc_asyncio")( credentials=async_anonymous_credentials() @@ -2343,6 +2757,33 @@ async def test_evaluate_dataset_empty_call_grpc_asyncio(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_generate_instance_rubrics_empty_call_grpc_asyncio(): + client = EvaluationServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.generate_instance_rubrics), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + evaluation_service.GenerateInstanceRubricsResponse() + ) + await client.generate_instance_rubrics(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = evaluation_service.GenerateInstanceRubricsRequest() + + assert args[0] == request_msg + + def test_transport_kind_rest(): transport = EvaluationServiceClient.get_transport_class("rest")( credentials=ga_credentials.AnonymousCredentials() @@ -2378,11 +2819,141 @@ def test_evaluate_instances_rest_bad_request( @pytest.mark.parametrize( "request_type", [ - evaluation_service.EvaluateInstancesRequest, + evaluation_service.EvaluateInstancesRequest, + dict, + ], +) +def test_evaluate_instances_rest_call_success(request_type): + client = EvaluationServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"location": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = evaluation_service.EvaluateInstancesResponse() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = evaluation_service.EvaluateInstancesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.evaluate_instances(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, evaluation_service.EvaluateInstancesResponse) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_evaluate_instances_rest_interceptors(null_interceptor): + transport = transports.EvaluationServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=( + None if null_interceptor else transports.EvaluationServiceRestInterceptor() + ), + ) + client = EvaluationServiceClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.EvaluationServiceRestInterceptor, "post_evaluate_instances" + ) as post, mock.patch.object( + transports.EvaluationServiceRestInterceptor, + "post_evaluate_instances_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.EvaluationServiceRestInterceptor, "pre_evaluate_instances" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = evaluation_service.EvaluateInstancesRequest.pb( + evaluation_service.EvaluateInstancesRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = evaluation_service.EvaluateInstancesResponse.to_json( + evaluation_service.EvaluateInstancesResponse() + ) + req.return_value.content = return_value + + request = evaluation_service.EvaluateInstancesRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = evaluation_service.EvaluateInstancesResponse() + post_with_metadata.return_value = ( + evaluation_service.EvaluateInstancesResponse(), + metadata, + ) + + client.evaluate_instances( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_evaluate_dataset_rest_bad_request( + request_type=evaluation_service.EvaluateDatasetRequest, +): + client = EvaluationServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"location": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.evaluate_dataset(request) + + +@pytest.mark.parametrize( + "request_type", + [ + evaluation_service.EvaluateDatasetRequest, dict, ], ) -def test_evaluate_instances_rest_call_success(request_type): +def test_evaluate_dataset_rest_call_success(request_type): client = EvaluationServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2394,26 +2965,23 @@ def test_evaluate_instances_rest_call_success(request_type): # Mock the http request call within the method and fake a response. with mock.patch.object(type(client.transport._session), "request") as req: # Designate an appropriate value for the returned response. - return_value = evaluation_service.EvaluateInstancesResponse() + return_value = operations_pb2.Operation(name="operations/spam") # Wrap the value into a proper Response obj response_value = mock.Mock() response_value.status_code = 200 - - # Convert return value to protobuf type - return_value = evaluation_service.EvaluateInstancesResponse.pb(return_value) json_return_value = json_format.MessageToJson(return_value) response_value.content = json_return_value.encode("UTF-8") req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.evaluate_instances(request) + response = client.evaluate_dataset(request) # Establish that the response is the type that we expect. - assert isinstance(response, evaluation_service.EvaluateInstancesResponse) + json_return_value = json_format.MessageToJson(return_value) @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_evaluate_instances_rest_interceptors(null_interceptor): +def test_evaluate_dataset_rest_interceptors(null_interceptor): transport = transports.EvaluationServiceRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=( @@ -2427,18 +2995,20 @@ def test_evaluate_instances_rest_interceptors(null_interceptor): ) as req, mock.patch.object( path_template, "transcode" ) as transcode, mock.patch.object( - transports.EvaluationServiceRestInterceptor, "post_evaluate_instances" + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( + transports.EvaluationServiceRestInterceptor, "post_evaluate_dataset" ) as post, mock.patch.object( transports.EvaluationServiceRestInterceptor, - "post_evaluate_instances_with_metadata", + "post_evaluate_dataset_with_metadata", ) as post_with_metadata, mock.patch.object( - transports.EvaluationServiceRestInterceptor, "pre_evaluate_instances" + transports.EvaluationServiceRestInterceptor, "pre_evaluate_dataset" ) as pre: pre.assert_not_called() post.assert_not_called() post_with_metadata.assert_not_called() - pb_message = evaluation_service.EvaluateInstancesRequest.pb( - evaluation_service.EvaluateInstancesRequest() + pb_message = evaluation_service.EvaluateDatasetRequest.pb( + evaluation_service.EvaluateDatasetRequest() ) transcode.return_value = { "method": "post", @@ -2450,24 +3020,19 @@ def test_evaluate_instances_rest_interceptors(null_interceptor): req.return_value = mock.Mock() req.return_value.status_code = 200 req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - return_value = evaluation_service.EvaluateInstancesResponse.to_json( - evaluation_service.EvaluateInstancesResponse() - ) + return_value = json_format.MessageToJson(operations_pb2.Operation()) req.return_value.content = return_value - request = evaluation_service.EvaluateInstancesRequest() + request = evaluation_service.EvaluateDatasetRequest() metadata = [ ("key", "val"), ("cephalopod", "squid"), ] pre.return_value = request, metadata - post.return_value = evaluation_service.EvaluateInstancesResponse() - post_with_metadata.return_value = ( - evaluation_service.EvaluateInstancesResponse(), - metadata, - ) + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata - client.evaluate_instances( + client.evaluate_dataset( request, metadata=[ ("key", "val"), @@ -2480,8 +3045,8 @@ def test_evaluate_instances_rest_interceptors(null_interceptor): post_with_metadata.assert_called_once() -def test_evaluate_dataset_rest_bad_request( - request_type=evaluation_service.EvaluateDatasetRequest, +def test_generate_instance_rubrics_rest_bad_request( + request_type=evaluation_service.GenerateInstanceRubricsRequest, ): client = EvaluationServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" @@ -2502,17 +3067,17 @@ def test_evaluate_dataset_rest_bad_request( response_value.request = mock.Mock() req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - client.evaluate_dataset(request) + client.generate_instance_rubrics(request) @pytest.mark.parametrize( "request_type", [ - evaluation_service.EvaluateDatasetRequest, + evaluation_service.GenerateInstanceRubricsRequest, dict, ], ) -def test_evaluate_dataset_rest_call_success(request_type): +def test_generate_instance_rubrics_rest_call_success(request_type): client = EvaluationServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2524,23 +3089,28 @@ def test_evaluate_dataset_rest_call_success(request_type): # Mock the http request call within the method and fake a response. with mock.patch.object(type(client.transport._session), "request") as req: # Designate an appropriate value for the returned response. - return_value = operations_pb2.Operation(name="operations/spam") + return_value = evaluation_service.GenerateInstanceRubricsResponse() # Wrap the value into a proper Response obj response_value = mock.Mock() response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = evaluation_service.GenerateInstanceRubricsResponse.pb( + return_value + ) json_return_value = json_format.MessageToJson(return_value) response_value.content = json_return_value.encode("UTF-8") req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.evaluate_dataset(request) + response = client.generate_instance_rubrics(request) # Establish that the response is the type that we expect. - json_return_value = json_format.MessageToJson(return_value) + assert isinstance(response, evaluation_service.GenerateInstanceRubricsResponse) @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_evaluate_dataset_rest_interceptors(null_interceptor): +def test_generate_instance_rubrics_rest_interceptors(null_interceptor): transport = transports.EvaluationServiceRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=( @@ -2554,20 +3124,18 @@ def test_evaluate_dataset_rest_interceptors(null_interceptor): ) as req, mock.patch.object( path_template, "transcode" ) as transcode, mock.patch.object( - operation.Operation, "_set_result_from_operation" - ), mock.patch.object( - transports.EvaluationServiceRestInterceptor, "post_evaluate_dataset" + transports.EvaluationServiceRestInterceptor, "post_generate_instance_rubrics" ) as post, mock.patch.object( transports.EvaluationServiceRestInterceptor, - "post_evaluate_dataset_with_metadata", + "post_generate_instance_rubrics_with_metadata", ) as post_with_metadata, mock.patch.object( - transports.EvaluationServiceRestInterceptor, "pre_evaluate_dataset" + transports.EvaluationServiceRestInterceptor, "pre_generate_instance_rubrics" ) as pre: pre.assert_not_called() post.assert_not_called() post_with_metadata.assert_not_called() - pb_message = evaluation_service.EvaluateDatasetRequest.pb( - evaluation_service.EvaluateDatasetRequest() + pb_message = evaluation_service.GenerateInstanceRubricsRequest.pb( + evaluation_service.GenerateInstanceRubricsRequest() ) transcode.return_value = { "method": "post", @@ -2579,19 +3147,24 @@ def test_evaluate_dataset_rest_interceptors(null_interceptor): req.return_value = mock.Mock() req.return_value.status_code = 200 req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - return_value = json_format.MessageToJson(operations_pb2.Operation()) + return_value = evaluation_service.GenerateInstanceRubricsResponse.to_json( + evaluation_service.GenerateInstanceRubricsResponse() + ) req.return_value.content = return_value - request = evaluation_service.EvaluateDatasetRequest() + request = evaluation_service.GenerateInstanceRubricsRequest() metadata = [ ("key", "val"), ("cephalopod", "squid"), ] pre.return_value = request, metadata - post.return_value = operations_pb2.Operation() - post_with_metadata.return_value = operations_pb2.Operation(), metadata + post.return_value = evaluation_service.GenerateInstanceRubricsResponse() + post_with_metadata.return_value = ( + evaluation_service.GenerateInstanceRubricsResponse(), + metadata, + ) - client.evaluate_dataset( + client.generate_instance_rubrics( request, metadata=[ ("key", "val"), @@ -3278,6 +3851,28 @@ def test_evaluate_dataset_empty_call_rest(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_generate_instance_rubrics_empty_call_rest(): + client = EvaluationServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.generate_instance_rubrics), "__call__" + ) as call: + client.generate_instance_rubrics(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = evaluation_service.GenerateInstanceRubricsRequest() + + assert args[0] == request_msg + + def test_evaluation_service_rest_lro_client(): client = EvaluationServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -3596,6 +4191,158 @@ async def test_evaluate_dataset_rest_asyncio_interceptors(null_interceptor): post_with_metadata.assert_called_once() +@pytest.mark.asyncio +async def test_generate_instance_rubrics_rest_asyncio_bad_request( + request_type=evaluation_service.GenerateInstanceRubricsRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = EvaluationServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + # send a request that will satisfy transcoding + request_init = {"location": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.generate_instance_rubrics(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + evaluation_service.GenerateInstanceRubricsRequest, + dict, + ], +) +async def test_generate_instance_rubrics_rest_asyncio_call_success(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = EvaluationServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + + # send a request that will satisfy transcoding + request_init = {"location": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = evaluation_service.GenerateInstanceRubricsResponse() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = evaluation_service.GenerateInstanceRubricsResponse.pb( + return_value + ) + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = await client.generate_instance_rubrics(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, evaluation_service.GenerateInstanceRubricsResponse) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("null_interceptor", [True, False]) +async def test_generate_instance_rubrics_rest_asyncio_interceptors(null_interceptor): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + transport = transports.AsyncEvaluationServiceRestTransport( + credentials=async_anonymous_credentials(), + interceptor=( + None + if null_interceptor + else transports.AsyncEvaluationServiceRestInterceptor() + ), + ) + client = EvaluationServiceAsyncClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.AsyncEvaluationServiceRestInterceptor, + "post_generate_instance_rubrics", + ) as post, mock.patch.object( + transports.AsyncEvaluationServiceRestInterceptor, + "post_generate_instance_rubrics_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.AsyncEvaluationServiceRestInterceptor, + "pre_generate_instance_rubrics", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = evaluation_service.GenerateInstanceRubricsRequest.pb( + evaluation_service.GenerateInstanceRubricsRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = evaluation_service.GenerateInstanceRubricsResponse.to_json( + evaluation_service.GenerateInstanceRubricsResponse() + ) + req.return_value.read = mock.AsyncMock(return_value=return_value) + + request = evaluation_service.GenerateInstanceRubricsRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = evaluation_service.GenerateInstanceRubricsResponse() + post_with_metadata.return_value = ( + evaluation_service.GenerateInstanceRubricsResponse(), + metadata, + ) + + await client.generate_instance_rubrics( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + @pytest.mark.asyncio async def test_get_location_rest_asyncio_bad_request( request_type=locations_pb2.GetLocationRequest, @@ -4396,6 +5143,33 @@ async def test_evaluate_dataset_empty_call_rest_asyncio(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_generate_instance_rubrics_empty_call_rest_asyncio(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = EvaluationServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.generate_instance_rubrics), "__call__" + ) as call: + await client.generate_instance_rubrics(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = evaluation_service.GenerateInstanceRubricsRequest() + + assert args[0] == request_msg + + def test_evaluation_service_rest_asyncio_lro_client(): if not HAS_ASYNC_REST_EXTRA: pytest.skip( @@ -4466,6 +5240,7 @@ def test_evaluation_service_base_transport(): methods = ( "evaluate_instances", "evaluate_dataset", + "generate_instance_rubrics", "set_iam_policy", "get_iam_policy", "test_iam_permissions", @@ -4745,6 +5520,9 @@ def test_evaluation_service_client_transport_session_collision(transport_name): session1 = client1.transport.evaluate_dataset._session session2 = client2.transport.evaluate_dataset._session assert session1 != session2 + session1 = client1.transport.generate_instance_rubrics._session + session2 = client2.transport.generate_instance_rubrics._session + assert session1 != session2 def test_evaluation_service_grpc_transport_channel(): @@ -4908,8 +5686,34 @@ def test_evaluation_service_grpc_lro_async_client(): assert transport.operations_client is transport.operations_client +def test_rag_corpus_path(): + project = "squid" + location = "clam" + rag_corpus = "whelk" + expected = "projects/{project}/locations/{location}/ragCorpora/{rag_corpus}".format( + project=project, + location=location, + rag_corpus=rag_corpus, + ) + actual = EvaluationServiceClient.rag_corpus_path(project, location, rag_corpus) + assert expected == actual + + +def test_parse_rag_corpus_path(): + expected = { + "project": "octopus", + "location": "oyster", + "rag_corpus": "nudibranch", + } + path = EvaluationServiceClient.rag_corpus_path(**expected) + + # Check that the path construction is reversible. + actual = EvaluationServiceClient.parse_rag_corpus_path(path) + assert expected == actual + + def test_common_billing_account_path(): - billing_account = "squid" + billing_account = "cuttlefish" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -4919,7 +5723,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "clam", + "billing_account": "mussel", } path = EvaluationServiceClient.common_billing_account_path(**expected) @@ -4929,7 +5733,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "whelk" + folder = "winkle" expected = "folders/{folder}".format( folder=folder, ) @@ -4939,7 +5743,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "octopus", + "folder": "nautilus", } path = EvaluationServiceClient.common_folder_path(**expected) @@ -4949,7 +5753,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "oyster" + organization = "scallop" expected = "organizations/{organization}".format( organization=organization, ) @@ -4959,7 +5763,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "nudibranch", + "organization": "abalone", } path = EvaluationServiceClient.common_organization_path(**expected) @@ -4969,7 +5773,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "cuttlefish" + project = "squid" expected = "projects/{project}".format( project=project, ) @@ -4979,7 +5783,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "mussel", + "project": "clam", } path = EvaluationServiceClient.common_project_path(**expected) @@ -4989,8 +5793,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "winkle" - location = "nautilus" + project = "whelk" + location = "octopus" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -5001,8 +5805,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "scallop", - "location": "abalone", + "project": "oyster", + "location": "nudibranch", } path = EvaluationServiceClient.common_location_path(**expected) diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_gen_ai_tuning_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_gen_ai_tuning_service.py index 3139d937ed..df7d0116d0 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_gen_ai_tuning_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_gen_ai_tuning_service.py @@ -4789,15 +4789,131 @@ def test_create_tuning_job_rest_call_success(request_type): "computation_based_metric_spec": {"type_": 1, "parameters": {}}, "llm_based_metric_spec": { "rubric_group_key": "rubric_group_key_value", + "rubric_generation_spec": { + "prompt_template": "prompt_template_value", + "model_config": { + "sampling_count": 1507, + "flip_enabled": True, + "autorater_model": "autorater_model_value", + "generation_config": { + "temperature": 0.1198, + "top_p": 0.546, + "top_k": 0.541, + "candidate_count": 1573, + "max_output_tokens": 1865, + "stop_sequences": [ + "stop_sequences_value1", + "stop_sequences_value2", + ], + "response_logprobs": True, + "logprobs": 872, + "presence_penalty": 0.1713, + "frequency_penalty": 0.18380000000000002, + "seed": 417, + "response_mime_type": "response_mime_type_value", + "response_schema": { + "type_": 1, + "format_": "format__value", + "title": "title_value", + "description": "description_value", + "nullable": True, + "default": { + "null_value": 0, + "number_value": 0.1285, + "string_value": "string_value_value", + "bool_value": True, + "struct_value": {}, + "list_value": {"values": {}}, + }, + "items": {}, + "min_items": 965, + "max_items": 967, + "enum": ["enum_value1", "enum_value2"], + "properties": {}, + "property_ordering": [ + "property_ordering_value1", + "property_ordering_value2", + ], + "required": [ + "required_value1", + "required_value2", + ], + "min_properties": 1520, + "max_properties": 1522, + "minimum": 0.764, + "maximum": 0.766, + "min_length": 1061, + "max_length": 1063, + "pattern": "pattern_value", + "example": {}, + "any_of": {}, + "additional_properties": {}, + "ref": "ref_value", + "defs": {}, + }, + "response_json_schema": {}, + "routing_config": { + "auto_mode": { + "model_routing_preference": 1 + }, + "manual_mode": { + "model_name": "model_name_value" + }, + }, + "audio_timestamp": True, + "response_modalities": [1], + "media_resolution": 1, + "speech_config": { + "voice_config": { + "prebuilt_voice_config": { + "voice_name": "voice_name_value" + }, + "replicated_voice_config": { + "mime_type": "mime_type_value", + "voice_sample_audio": b"voice_sample_audio_blob", + }, + }, + "language_code": "language_code_value", + "multi_speaker_voice_config": { + "speaker_voice_configs": [ + { + "speaker": "speaker_value", + "voice_config": {}, + } + ] + }, + }, + "thinking_config": { + "include_thoughts": True, + "thinking_budget": 1590, + }, + "model_config": { + "feature_selection_preference": 1 + }, + "image_config": { + "aspect_ratio": "aspect_ratio_value" + }, + }, + }, + "rubric_content_type": 1, + "rubric_type_ontology": [ + "rubric_type_ontology_value1", + "rubric_type_ontology_value2", + ], + }, "predefined_rubric_generation_spec": {}, "metric_prompt_template": "metric_prompt_template_value", "system_instruction": "system_instruction_value", - "judge_autorater_config": { - "sampling_count": 1507, - "flip_enabled": True, - "autorater_model": "autorater_model_value", - }, + "judge_autorater_config": {}, "additional_config": {}, + "result_parser_config": { + "custom_code_parser_config": { + "parsing_function": "parsing_function_value" + } + }, + }, + "custom_code_execution_spec": { + "evaluation_function": "evaluation_function_value" }, "pointwise_metric_spec": { "metric_prompt_template": "metric_prompt_template_value", @@ -4819,95 +4935,23 @@ def test_create_tuning_job_rest_call_success(request_type): "split_summaries": True, }, "aggregation_metrics": [1], + "metadata": { + "title": "title_value", + "score_range": { + "min_": 0.419, + "max_": 0.421, + "step": 0.444, + "description": "description_value", + }, + "other_metadata": {}, + }, } ], "output_config": { "gcs_destination": {"output_uri_prefix": "output_uri_prefix_value"} }, "autorater_config": {}, - "inference_generation_config": { - "temperature": 0.1198, - "top_p": 0.546, - "top_k": 0.541, - "candidate_count": 1573, - "max_output_tokens": 1865, - "stop_sequences": [ - "stop_sequences_value1", - "stop_sequences_value2", - ], - "response_logprobs": True, - "logprobs": 872, - "presence_penalty": 0.1713, - "frequency_penalty": 0.18380000000000002, - "seed": 417, - "response_mime_type": "response_mime_type_value", - "response_schema": { - "type_": 1, - "format_": "format__value", - "title": "title_value", - "description": "description_value", - "nullable": True, - "default": { - "null_value": 0, - "number_value": 0.1285, - "string_value": "string_value_value", - "bool_value": True, - "struct_value": {}, - "list_value": {"values": {}}, - }, - "items": {}, - "min_items": 965, - "max_items": 967, - "enum": ["enum_value1", "enum_value2"], - "properties": {}, - "property_ordering": [ - "property_ordering_value1", - "property_ordering_value2", - ], - "required": ["required_value1", "required_value2"], - "min_properties": 1520, - "max_properties": 1522, - "minimum": 0.764, - "maximum": 0.766, - "min_length": 1061, - "max_length": 1063, - "pattern": "pattern_value", - "example": {}, - "any_of": {}, - "additional_properties": {}, - "ref": "ref_value", - "defs": {}, - }, - "response_json_schema": {}, - "routing_config": { - "auto_mode": {"model_routing_preference": 1}, - "manual_mode": {"model_name": "model_name_value"}, - }, - "audio_timestamp": True, - "response_modalities": [1], - "media_resolution": 1, - "speech_config": { - "voice_config": { - "prebuilt_voice_config": {"voice_name": "voice_name_value"}, - "replicated_voice_config": { - "mime_type": "mime_type_value", - "voice_sample_audio": b"voice_sample_audio_blob", - }, - }, - "language_code": "language_code_value", - "multi_speaker_voice_config": { - "speaker_voice_configs": [ - {"speaker": "speaker_value", "voice_config": {}} - ] - }, - }, - "thinking_config": { - "include_thoughts": True, - "thinking_budget": 1590, - }, - "model_config": {"feature_selection_preference": 1}, - "image_config": {"aspect_ratio": "aspect_ratio_value"}, - }, + "inference_generation_config": {}, }, "tuning_mode": 1, }, @@ -4936,8 +4980,16 @@ def test_create_tuning_job_rest_call_success(request_type): "epoch_count": 1175, "learning_rate_multiplier": 0.2561, "tuning_task": 1, + "veo_data_mixture_ratio": 0.23500000000000001, + "tuning_speed": 1, + "adapter_size": 8, }, }, + "veo_lora_tuning_spec": { + "training_dataset_uri": "training_dataset_uri_value", + "validation_dataset_uri": "validation_dataset_uri_value", + "hyper_parameters": {}, + }, "name": "name_value", "tuned_model_display_name": "tuned_model_display_name_value", "description": "description_value", @@ -5124,6 +5176,7 @@ def test_create_tuning_job_rest_call_success(request_type): "exact_match_metric_value": {"score": 0.54}, "bleu_metric_value": {"score": 0.54}, "rouge_metric_value": {"score": 0.54}, + "custom_code_execution_result": {"score": 0.54}, "aggregation_metric": 1, } ], @@ -6662,15 +6715,131 @@ async def test_create_tuning_job_rest_asyncio_call_success(request_type): "computation_based_metric_spec": {"type_": 1, "parameters": {}}, "llm_based_metric_spec": { "rubric_group_key": "rubric_group_key_value", + "rubric_generation_spec": { + "prompt_template": "prompt_template_value", + "model_config": { + "sampling_count": 1507, + "flip_enabled": True, + "autorater_model": "autorater_model_value", + "generation_config": { + "temperature": 0.1198, + "top_p": 0.546, + "top_k": 0.541, + "candidate_count": 1573, + "max_output_tokens": 1865, + "stop_sequences": [ + "stop_sequences_value1", + "stop_sequences_value2", + ], + "response_logprobs": True, + "logprobs": 872, + "presence_penalty": 0.1713, + "frequency_penalty": 0.18380000000000002, + "seed": 417, + "response_mime_type": "response_mime_type_value", + "response_schema": { + "type_": 1, + "format_": "format__value", + "title": "title_value", + "description": "description_value", + "nullable": True, + "default": { + "null_value": 0, + "number_value": 0.1285, + "string_value": "string_value_value", + "bool_value": True, + "struct_value": {}, + "list_value": {"values": {}}, + }, + "items": {}, + "min_items": 965, + "max_items": 967, + "enum": ["enum_value1", "enum_value2"], + "properties": {}, + "property_ordering": [ + "property_ordering_value1", + "property_ordering_value2", + ], + "required": [ + "required_value1", + "required_value2", + ], + "min_properties": 1520, + "max_properties": 1522, + "minimum": 0.764, + "maximum": 0.766, + "min_length": 1061, + "max_length": 1063, + "pattern": "pattern_value", + "example": {}, + "any_of": {}, + "additional_properties": {}, + "ref": "ref_value", + "defs": {}, + }, + "response_json_schema": {}, + "routing_config": { + "auto_mode": { + "model_routing_preference": 1 + }, + "manual_mode": { + "model_name": "model_name_value" + }, + }, + "audio_timestamp": True, + "response_modalities": [1], + "media_resolution": 1, + "speech_config": { + "voice_config": { + "prebuilt_voice_config": { + "voice_name": "voice_name_value" + }, + "replicated_voice_config": { + "mime_type": "mime_type_value", + "voice_sample_audio": b"voice_sample_audio_blob", + }, + }, + "language_code": "language_code_value", + "multi_speaker_voice_config": { + "speaker_voice_configs": [ + { + "speaker": "speaker_value", + "voice_config": {}, + } + ] + }, + }, + "thinking_config": { + "include_thoughts": True, + "thinking_budget": 1590, + }, + "model_config": { + "feature_selection_preference": 1 + }, + "image_config": { + "aspect_ratio": "aspect_ratio_value" + }, + }, + }, + "rubric_content_type": 1, + "rubric_type_ontology": [ + "rubric_type_ontology_value1", + "rubric_type_ontology_value2", + ], + }, "predefined_rubric_generation_spec": {}, "metric_prompt_template": "metric_prompt_template_value", "system_instruction": "system_instruction_value", - "judge_autorater_config": { - "sampling_count": 1507, - "flip_enabled": True, - "autorater_model": "autorater_model_value", - }, + "judge_autorater_config": {}, "additional_config": {}, + "result_parser_config": { + "custom_code_parser_config": { + "parsing_function": "parsing_function_value" + } + }, + }, + "custom_code_execution_spec": { + "evaluation_function": "evaluation_function_value" }, "pointwise_metric_spec": { "metric_prompt_template": "metric_prompt_template_value", @@ -6692,95 +6861,23 @@ async def test_create_tuning_job_rest_asyncio_call_success(request_type): "split_summaries": True, }, "aggregation_metrics": [1], + "metadata": { + "title": "title_value", + "score_range": { + "min_": 0.419, + "max_": 0.421, + "step": 0.444, + "description": "description_value", + }, + "other_metadata": {}, + }, } ], "output_config": { "gcs_destination": {"output_uri_prefix": "output_uri_prefix_value"} }, "autorater_config": {}, - "inference_generation_config": { - "temperature": 0.1198, - "top_p": 0.546, - "top_k": 0.541, - "candidate_count": 1573, - "max_output_tokens": 1865, - "stop_sequences": [ - "stop_sequences_value1", - "stop_sequences_value2", - ], - "response_logprobs": True, - "logprobs": 872, - "presence_penalty": 0.1713, - "frequency_penalty": 0.18380000000000002, - "seed": 417, - "response_mime_type": "response_mime_type_value", - "response_schema": { - "type_": 1, - "format_": "format__value", - "title": "title_value", - "description": "description_value", - "nullable": True, - "default": { - "null_value": 0, - "number_value": 0.1285, - "string_value": "string_value_value", - "bool_value": True, - "struct_value": {}, - "list_value": {"values": {}}, - }, - "items": {}, - "min_items": 965, - "max_items": 967, - "enum": ["enum_value1", "enum_value2"], - "properties": {}, - "property_ordering": [ - "property_ordering_value1", - "property_ordering_value2", - ], - "required": ["required_value1", "required_value2"], - "min_properties": 1520, - "max_properties": 1522, - "minimum": 0.764, - "maximum": 0.766, - "min_length": 1061, - "max_length": 1063, - "pattern": "pattern_value", - "example": {}, - "any_of": {}, - "additional_properties": {}, - "ref": "ref_value", - "defs": {}, - }, - "response_json_schema": {}, - "routing_config": { - "auto_mode": {"model_routing_preference": 1}, - "manual_mode": {"model_name": "model_name_value"}, - }, - "audio_timestamp": True, - "response_modalities": [1], - "media_resolution": 1, - "speech_config": { - "voice_config": { - "prebuilt_voice_config": {"voice_name": "voice_name_value"}, - "replicated_voice_config": { - "mime_type": "mime_type_value", - "voice_sample_audio": b"voice_sample_audio_blob", - }, - }, - "language_code": "language_code_value", - "multi_speaker_voice_config": { - "speaker_voice_configs": [ - {"speaker": "speaker_value", "voice_config": {}} - ] - }, - }, - "thinking_config": { - "include_thoughts": True, - "thinking_budget": 1590, - }, - "model_config": {"feature_selection_preference": 1}, - "image_config": {"aspect_ratio": "aspect_ratio_value"}, - }, + "inference_generation_config": {}, }, "tuning_mode": 1, }, @@ -6809,8 +6906,16 @@ async def test_create_tuning_job_rest_asyncio_call_success(request_type): "epoch_count": 1175, "learning_rate_multiplier": 0.2561, "tuning_task": 1, + "veo_data_mixture_ratio": 0.23500000000000001, + "tuning_speed": 1, + "adapter_size": 8, }, }, + "veo_lora_tuning_spec": { + "training_dataset_uri": "training_dataset_uri_value", + "validation_dataset_uri": "validation_dataset_uri_value", + "hyper_parameters": {}, + }, "name": "name_value", "tuned_model_display_name": "tuned_model_display_name_value", "description": "description_value", @@ -6997,6 +7102,7 @@ async def test_create_tuning_job_rest_asyncio_call_success(request_type): "exact_match_metric_value": {"score": 0.54}, "bleu_metric_value": {"score": 0.54}, "rouge_metric_value": {"score": 0.54}, + "custom_code_execution_result": {"score": 0.54}, "aggregation_metric": 1, } ], diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_model_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_model_service.py index f3fe607aab..2cc332f305 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_model_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_model_service.py @@ -5949,6 +5949,7 @@ def test_copy_model_non_empty_request_with_auto_populated_field(): parent_model="parent_model_value", parent="parent_value", source_model="source_model_value", + custom_service_account="custom_service_account_value", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5964,6 +5965,7 @@ def test_copy_model_non_empty_request_with_auto_populated_field(): parent_model="parent_model_value", parent="parent_value", source_model="source_model_value", + custom_service_account="custom_service_account_value", ) diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_online_evaluator_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_online_evaluator_service.py new file mode 100644 index 0000000000..ba6358480f --- /dev/null +++ b/tests/unit/gapic/aiplatform_v1beta1/test_online_evaluator_service.py @@ -0,0 +1,13214 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +import os + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock # pragma: NO COVER +except ImportError: # pragma: NO COVER + import mock + +import grpc +from grpc.experimental import aio +from collections.abc import Iterable, AsyncIterable +from google.protobuf import json_format +import json +import math +import pytest +from collections.abc import Sequence, Mapping +from google.api_core import api_core_version +from proto.marshal.rules.dates import DurationRule, TimestampRule +from proto.marshal.rules import wrappers + +try: + import aiohttp # type: ignore + from google.auth.aio.transport.sessions import AsyncAuthorizedSession + from google.api_core.operations_v1 import AsyncOperationsRestClient + + HAS_ASYNC_REST_EXTRA = True +except ImportError: # pragma: NO COVER + HAS_ASYNC_REST_EXTRA = False +from requests import Response +from requests import Request, PreparedRequest +from requests.sessions import Session +from google.protobuf import json_format + +try: + from google.auth.aio import credentials as ga_credentials_async + + HAS_GOOGLE_AUTH_AIO = True +except ImportError: # pragma: NO COVER + HAS_GOOGLE_AUTH_AIO = False + +from google.api_core import client_options +from google.api_core import exceptions as core_exceptions +from google.api_core import future +from google.api_core import gapic_v1 +from google.api_core import grpc_helpers +from google.api_core import grpc_helpers_async +from google.api_core import operation +from google.api_core import operations_v1 +from google.api_core import path_template +from google.api_core import retry as retries +from google.auth import credentials as ga_credentials +from google.auth.exceptions import MutualTLSChannelError +from google.cloud.aiplatform_v1beta1.services.online_evaluator_service import ( + OnlineEvaluatorServiceAsyncClient, +) +from google.cloud.aiplatform_v1beta1.services.online_evaluator_service import ( + OnlineEvaluatorServiceClient, +) +from google.cloud.aiplatform_v1beta1.services.online_evaluator_service import pagers +from google.cloud.aiplatform_v1beta1.services.online_evaluator_service import transports +from google.cloud.aiplatform_v1beta1.types import content +from google.cloud.aiplatform_v1beta1.types import evaluation_service +from google.cloud.aiplatform_v1beta1.types import online_evaluator +from google.cloud.aiplatform_v1beta1.types import ( + online_evaluator as gca_online_evaluator, +) +from google.cloud.aiplatform_v1beta1.types import online_evaluator_service +from google.cloud.aiplatform_v1beta1.types import openapi +from google.cloud.location import locations_pb2 +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import options_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.longrunning import operations_pb2 # type: ignore +from google.oauth2 import service_account +import google.api_core.operation_async as operation_async # type: ignore +import google.auth +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore + + +CRED_INFO_JSON = { + "credential_source": "/path/to/file", + "credential_type": "service account credentials", + "principal": "service-account@example.com", +} +CRED_INFO_STRING = json.dumps(CRED_INFO_JSON) + + +async def mock_async_gen(data, chunk_size=1): + for i in range(0, len(data)): # pragma: NO COVER + chunk = data[i : i + chunk_size] + yield chunk.encode("utf-8") + + +def client_cert_source_callback(): + return b"cert bytes", b"key bytes" + + +# TODO: use async auth anon credentials by default once the minimum version of google-auth is upgraded. +# See related issue: https://github.com/googleapis/gapic-generator-python/issues/2107. +def async_anonymous_credentials(): + if HAS_GOOGLE_AUTH_AIO: + return ga_credentials_async.AnonymousCredentials() + return ga_credentials.AnonymousCredentials() + + +# If default endpoint is localhost, then default mtls endpoint will be the same. +# This method modifies the default endpoint so the client can produce a different +# mtls endpoint for endpoint testing purposes. +def modify_default_endpoint(client): + return ( + "foo.googleapis.com" + if ("localhost" in client.DEFAULT_ENDPOINT) + else client.DEFAULT_ENDPOINT + ) + + +# If default endpoint template is localhost, then default mtls endpoint will be the same. +# This method modifies the default endpoint template so the client can produce a different +# mtls endpoint for endpoint testing purposes. +def modify_default_endpoint_template(client): + return ( + "test.{UNIVERSE_DOMAIN}" + if ("localhost" in client._DEFAULT_ENDPOINT_TEMPLATE) + else client._DEFAULT_ENDPOINT_TEMPLATE + ) + + +def test__get_default_mtls_endpoint(): + api_endpoint = "example.googleapis.com" + api_mtls_endpoint = "example.mtls.googleapis.com" + sandbox_endpoint = "example.sandbox.googleapis.com" + sandbox_mtls_endpoint = "example.mtls.sandbox.googleapis.com" + non_googleapi = "api.example.com" + + assert OnlineEvaluatorServiceClient._get_default_mtls_endpoint(None) is None + assert ( + OnlineEvaluatorServiceClient._get_default_mtls_endpoint(api_endpoint) + == api_mtls_endpoint + ) + assert ( + OnlineEvaluatorServiceClient._get_default_mtls_endpoint(api_mtls_endpoint) + == api_mtls_endpoint + ) + assert ( + OnlineEvaluatorServiceClient._get_default_mtls_endpoint(sandbox_endpoint) + == sandbox_mtls_endpoint + ) + assert ( + OnlineEvaluatorServiceClient._get_default_mtls_endpoint(sandbox_mtls_endpoint) + == sandbox_mtls_endpoint + ) + assert ( + OnlineEvaluatorServiceClient._get_default_mtls_endpoint(non_googleapi) + == non_googleapi + ) + + +def test__read_environment_variables(): + assert OnlineEvaluatorServiceClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + assert OnlineEvaluatorServiceClient._read_environment_variables() == ( + True, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + assert OnlineEvaluatorServiceClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} + ): + if not hasattr(google.auth.transport.mtls, "should_use_client_cert"): + with pytest.raises(ValueError) as excinfo: + OnlineEvaluatorServiceClient._read_environment_variables() + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + else: + assert OnlineEvaluatorServiceClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + assert OnlineEvaluatorServiceClient._read_environment_variables() == ( + False, + "never", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + assert OnlineEvaluatorServiceClient._read_environment_variables() == ( + False, + "always", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}): + assert OnlineEvaluatorServiceClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError) as excinfo: + OnlineEvaluatorServiceClient._read_environment_variables() + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + with mock.patch.dict(os.environ, {"GOOGLE_CLOUD_UNIVERSE_DOMAIN": "foo.com"}): + assert OnlineEvaluatorServiceClient._read_environment_variables() == ( + False, + "auto", + "foo.com", + ) + + +def test_use_client_cert_effective(): + # Test case 1: Test when `should_use_client_cert` returns True. + # We mock the `should_use_client_cert` function to simulate a scenario where + # the google-auth library supports automatic mTLS and determines that a + # client certificate should be used. + if hasattr(google.auth.transport.mtls, "should_use_client_cert"): + with mock.patch( + "google.auth.transport.mtls.should_use_client_cert", return_value=True + ): + assert OnlineEvaluatorServiceClient._use_client_cert_effective() is True + + # Test case 2: Test when `should_use_client_cert` returns False. + # We mock the `should_use_client_cert` function to simulate a scenario where + # the google-auth library supports automatic mTLS and determines that a + # client certificate should NOT be used. + if hasattr(google.auth.transport.mtls, "should_use_client_cert"): + with mock.patch( + "google.auth.transport.mtls.should_use_client_cert", return_value=False + ): + assert OnlineEvaluatorServiceClient._use_client_cert_effective() is False + + # Test case 3: Test when `should_use_client_cert` is unavailable and the + # `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is set to "true". + if not hasattr(google.auth.transport.mtls, "should_use_client_cert"): + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + assert OnlineEvaluatorServiceClient._use_client_cert_effective() is True + + # Test case 4: Test when `should_use_client_cert` is unavailable and the + # `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is set to "false". + if not hasattr(google.auth.transport.mtls, "should_use_client_cert"): + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"} + ): + assert OnlineEvaluatorServiceClient._use_client_cert_effective() is False + + # Test case 5: Test when `should_use_client_cert` is unavailable and the + # `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is set to "True". + if not hasattr(google.auth.transport.mtls, "should_use_client_cert"): + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "True"}): + assert OnlineEvaluatorServiceClient._use_client_cert_effective() is True + + # Test case 6: Test when `should_use_client_cert` is unavailable and the + # `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is set to "False". + if not hasattr(google.auth.transport.mtls, "should_use_client_cert"): + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "False"} + ): + assert OnlineEvaluatorServiceClient._use_client_cert_effective() is False + + # Test case 7: Test when `should_use_client_cert` is unavailable and the + # `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is set to "TRUE". + if not hasattr(google.auth.transport.mtls, "should_use_client_cert"): + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "TRUE"}): + assert OnlineEvaluatorServiceClient._use_client_cert_effective() is True + + # Test case 8: Test when `should_use_client_cert` is unavailable and the + # `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is set to "FALSE". + if not hasattr(google.auth.transport.mtls, "should_use_client_cert"): + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "FALSE"} + ): + assert OnlineEvaluatorServiceClient._use_client_cert_effective() is False + + # Test case 9: Test when `should_use_client_cert` is unavailable and the + # `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not set. + # In this case, the method should return False, which is the default value. + if not hasattr(google.auth.transport.mtls, "should_use_client_cert"): + with mock.patch.dict(os.environ, clear=True): + assert OnlineEvaluatorServiceClient._use_client_cert_effective() is False + + # Test case 10: Test when `should_use_client_cert` is unavailable and the + # `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is set to an invalid value. + # The method should raise a ValueError as the environment variable must be either + # "true" or "false". + if not hasattr(google.auth.transport.mtls, "should_use_client_cert"): + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "unsupported"} + ): + with pytest.raises(ValueError): + OnlineEvaluatorServiceClient._use_client_cert_effective() + + # Test case 11: Test when `should_use_client_cert` is available and the + # `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is set to an invalid value. + # The method should return False as the environment variable is set to an invalid value. + if hasattr(google.auth.transport.mtls, "should_use_client_cert"): + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "unsupported"} + ): + assert OnlineEvaluatorServiceClient._use_client_cert_effective() is False + + # Test case 12: Test when `should_use_client_cert` is available and the + # `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is unset. Also, + # the GOOGLE_API_CONFIG environment variable is unset. + if hasattr(google.auth.transport.mtls, "should_use_client_cert"): + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": ""}): + with mock.patch.dict(os.environ, {"GOOGLE_API_CERTIFICATE_CONFIG": ""}): + assert ( + OnlineEvaluatorServiceClient._use_client_cert_effective() is False + ) + + +def test__get_client_cert_source(): + mock_provided_cert_source = mock.Mock() + mock_default_cert_source = mock.Mock() + + assert OnlineEvaluatorServiceClient._get_client_cert_source(None, False) is None + assert ( + OnlineEvaluatorServiceClient._get_client_cert_source( + mock_provided_cert_source, False + ) + is None + ) + assert ( + OnlineEvaluatorServiceClient._get_client_cert_source( + mock_provided_cert_source, True + ) + == mock_provided_cert_source + ) + + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", return_value=True + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=mock_default_cert_source, + ): + assert ( + OnlineEvaluatorServiceClient._get_client_cert_source(None, True) + is mock_default_cert_source + ) + assert ( + OnlineEvaluatorServiceClient._get_client_cert_source( + mock_provided_cert_source, "true" + ) + is mock_provided_cert_source + ) + + +@mock.patch.object( + OnlineEvaluatorServiceClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(OnlineEvaluatorServiceClient), +) +@mock.patch.object( + OnlineEvaluatorServiceAsyncClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(OnlineEvaluatorServiceAsyncClient), +) +def test__get_api_endpoint(): + api_override = "foo.com" + mock_client_cert_source = mock.Mock() + default_universe = OnlineEvaluatorServiceClient._DEFAULT_UNIVERSE + default_endpoint = OnlineEvaluatorServiceClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=default_universe + ) + mock_universe = "bar.com" + mock_endpoint = OnlineEvaluatorServiceClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=mock_universe + ) + + assert ( + OnlineEvaluatorServiceClient._get_api_endpoint( + api_override, mock_client_cert_source, default_universe, "always" + ) + == api_override + ) + assert ( + OnlineEvaluatorServiceClient._get_api_endpoint( + None, mock_client_cert_source, default_universe, "auto" + ) + == OnlineEvaluatorServiceClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + OnlineEvaluatorServiceClient._get_api_endpoint( + None, None, default_universe, "auto" + ) + == default_endpoint + ) + assert ( + OnlineEvaluatorServiceClient._get_api_endpoint( + None, None, default_universe, "always" + ) + == OnlineEvaluatorServiceClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + OnlineEvaluatorServiceClient._get_api_endpoint( + None, mock_client_cert_source, default_universe, "always" + ) + == OnlineEvaluatorServiceClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + OnlineEvaluatorServiceClient._get_api_endpoint( + None, None, mock_universe, "never" + ) + == mock_endpoint + ) + assert ( + OnlineEvaluatorServiceClient._get_api_endpoint( + None, None, default_universe, "never" + ) + == default_endpoint + ) + + with pytest.raises(MutualTLSChannelError) as excinfo: + OnlineEvaluatorServiceClient._get_api_endpoint( + None, mock_client_cert_source, mock_universe, "auto" + ) + assert ( + str(excinfo.value) + == "mTLS is not supported in any universe other than googleapis.com." + ) + + +def test__get_universe_domain(): + client_universe_domain = "foo.com" + universe_domain_env = "bar.com" + + assert ( + OnlineEvaluatorServiceClient._get_universe_domain( + client_universe_domain, universe_domain_env + ) + == client_universe_domain + ) + assert ( + OnlineEvaluatorServiceClient._get_universe_domain(None, universe_domain_env) + == universe_domain_env + ) + assert ( + OnlineEvaluatorServiceClient._get_universe_domain(None, None) + == OnlineEvaluatorServiceClient._DEFAULT_UNIVERSE + ) + + with pytest.raises(ValueError) as excinfo: + OnlineEvaluatorServiceClient._get_universe_domain("", None) + assert str(excinfo.value) == "Universe Domain cannot be an empty string." + + +@pytest.mark.parametrize( + "error_code,cred_info_json,show_cred_info", + [ + (401, CRED_INFO_JSON, True), + (403, CRED_INFO_JSON, True), + (404, CRED_INFO_JSON, True), + (500, CRED_INFO_JSON, False), + (401, None, False), + (403, None, False), + (404, None, False), + (500, None, False), + ], +) +def test__add_cred_info_for_auth_errors(error_code, cred_info_json, show_cred_info): + cred = mock.Mock(["get_cred_info"]) + cred.get_cred_info = mock.Mock(return_value=cred_info_json) + client = OnlineEvaluatorServiceClient(credentials=cred) + client._transport._credentials = cred + + error = core_exceptions.GoogleAPICallError("message", details=["foo"]) + error.code = error_code + + client._add_cred_info_for_auth_errors(error) + if show_cred_info: + assert error.details == ["foo", CRED_INFO_STRING] + else: + assert error.details == ["foo"] + + +@pytest.mark.parametrize("error_code", [401, 403, 404, 500]) +def test__add_cred_info_for_auth_errors_no_get_cred_info(error_code): + cred = mock.Mock([]) + assert not hasattr(cred, "get_cred_info") + client = OnlineEvaluatorServiceClient(credentials=cred) + client._transport._credentials = cred + + error = core_exceptions.GoogleAPICallError("message", details=[]) + error.code = error_code + + client._add_cred_info_for_auth_errors(error) + assert error.details == [] + + +@pytest.mark.parametrize( + "client_class,transport_name", + [ + (OnlineEvaluatorServiceClient, "grpc"), + (OnlineEvaluatorServiceAsyncClient, "grpc_asyncio"), + (OnlineEvaluatorServiceClient, "rest"), + ], +) +def test_online_evaluator_service_client_from_service_account_info( + client_class, transport_name +): + creds = ga_credentials.AnonymousCredentials() + with mock.patch.object( + service_account.Credentials, "from_service_account_info" + ) as factory: + factory.return_value = creds + info = {"valid": True} + client = client_class.from_service_account_info(info, transport=transport_name) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + assert client.transport._host == ( + "aiplatform.googleapis.com:443" + if transport_name in ["grpc", "grpc_asyncio"] + else "https://aiplatform.googleapis.com" + ) + + +@pytest.mark.parametrize( + "transport_class,transport_name", + [ + (transports.OnlineEvaluatorServiceGrpcTransport, "grpc"), + (transports.OnlineEvaluatorServiceGrpcAsyncIOTransport, "grpc_asyncio"), + (transports.OnlineEvaluatorServiceRestTransport, "rest"), + ], +) +def test_online_evaluator_service_client_service_account_always_use_jwt( + transport_class, transport_name +): + with mock.patch.object( + service_account.Credentials, "with_always_use_jwt_access", create=True + ) as use_jwt: + creds = service_account.Credentials(None, None, None) + transport = transport_class(credentials=creds, always_use_jwt_access=True) + use_jwt.assert_called_once_with(True) + + with mock.patch.object( + service_account.Credentials, "with_always_use_jwt_access", create=True + ) as use_jwt: + creds = service_account.Credentials(None, None, None) + transport = transport_class(credentials=creds, always_use_jwt_access=False) + use_jwt.assert_not_called() + + +@pytest.mark.parametrize( + "client_class,transport_name", + [ + (OnlineEvaluatorServiceClient, "grpc"), + (OnlineEvaluatorServiceAsyncClient, "grpc_asyncio"), + (OnlineEvaluatorServiceClient, "rest"), + ], +) +def test_online_evaluator_service_client_from_service_account_file( + client_class, transport_name +): + creds = ga_credentials.AnonymousCredentials() + with mock.patch.object( + service_account.Credentials, "from_service_account_file" + ) as factory: + factory.return_value = creds + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + assert client.transport._host == ( + "aiplatform.googleapis.com:443" + if transport_name in ["grpc", "grpc_asyncio"] + else "https://aiplatform.googleapis.com" + ) + + +def test_online_evaluator_service_client_get_transport_class(): + transport = OnlineEvaluatorServiceClient.get_transport_class() + available_transports = [ + transports.OnlineEvaluatorServiceGrpcTransport, + transports.OnlineEvaluatorServiceRestTransport, + ] + assert transport in available_transports + + transport = OnlineEvaluatorServiceClient.get_transport_class("grpc") + assert transport == transports.OnlineEvaluatorServiceGrpcTransport + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + ( + OnlineEvaluatorServiceClient, + transports.OnlineEvaluatorServiceGrpcTransport, + "grpc", + ), + ( + OnlineEvaluatorServiceAsyncClient, + transports.OnlineEvaluatorServiceGrpcAsyncIOTransport, + "grpc_asyncio", + ), + ( + OnlineEvaluatorServiceClient, + transports.OnlineEvaluatorServiceRestTransport, + "rest", + ), + ], +) +@mock.patch.object( + OnlineEvaluatorServiceClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(OnlineEvaluatorServiceClient), +) +@mock.patch.object( + OnlineEvaluatorServiceAsyncClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(OnlineEvaluatorServiceAsyncClient), +) +def test_online_evaluator_service_client_client_options( + client_class, transport_class, transport_name +): + # Check that if channel is provided we won't create a new one. + with mock.patch.object(OnlineEvaluatorServiceClient, "get_transport_class") as gtc: + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) + client = client_class(transport=transport) + gtc.assert_not_called() + + # Check that if channel is provided via str we will create a new one. + with mock.patch.object(OnlineEvaluatorServiceClient, "get_transport_class") as gtc: + client = client_class(transport=transport_name) + gtc.assert_called() + + # Check the case api_endpoint is provided. + options = client_options.ClientOptions(api_endpoint="squid.clam.whelk") + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name, client_options=options) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host="squid.clam.whelk", + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is + # "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is + # "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_MTLS_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has + # unsupported value. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError) as excinfo: + client = client_class(transport=transport_name) + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + # Check the case quota_project_id is provided + options = client_options.ClientOptions(quota_project_id="octopus") + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id="octopus", + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + # Check the case api_endpoint is provided + options = client_options.ClientOptions( + api_audience="https://language.googleapis.com" + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience="https://language.googleapis.com", + ) + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,use_client_cert_env", + [ + ( + OnlineEvaluatorServiceClient, + transports.OnlineEvaluatorServiceGrpcTransport, + "grpc", + "true", + ), + ( + OnlineEvaluatorServiceAsyncClient, + transports.OnlineEvaluatorServiceGrpcAsyncIOTransport, + "grpc_asyncio", + "true", + ), + ( + OnlineEvaluatorServiceClient, + transports.OnlineEvaluatorServiceGrpcTransport, + "grpc", + "false", + ), + ( + OnlineEvaluatorServiceAsyncClient, + transports.OnlineEvaluatorServiceGrpcAsyncIOTransport, + "grpc_asyncio", + "false", + ), + ( + OnlineEvaluatorServiceClient, + transports.OnlineEvaluatorServiceRestTransport, + "rest", + "true", + ), + ( + OnlineEvaluatorServiceClient, + transports.OnlineEvaluatorServiceRestTransport, + "rest", + "false", + ), + ], +) +@mock.patch.object( + OnlineEvaluatorServiceClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(OnlineEvaluatorServiceClient), +) +@mock.patch.object( + OnlineEvaluatorServiceAsyncClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(OnlineEvaluatorServiceAsyncClient), +) +@mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}) +def test_online_evaluator_service_client_mtls_env_auto( + client_class, transport_class, transport_name, use_client_cert_env +): + # This tests the endpoint autoswitch behavior. Endpoint is autoswitched to the default + # mtls endpoint, if GOOGLE_API_USE_CLIENT_CERTIFICATE is "true" and client cert exists. + + # Check the case client_cert_source is provided. Whether client cert is used depends on + # GOOGLE_API_USE_CLIENT_CERTIFICATE value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + options = client_options.ClientOptions( + client_cert_source=client_cert_source_callback + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + + if use_client_cert_env == "false": + expected_client_cert_source = None + expected_host = client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ) + else: + expected_client_cert_source = client_cert_source_callback + expected_host = client.DEFAULT_MTLS_ENDPOINT + + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=expected_host, + scopes=None, + client_cert_source_for_mtls=expected_client_cert_source, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case ADC client cert is provided. Whether client cert is used depends on + # GOOGLE_API_USE_CLIENT_CERTIFICATE value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + with mock.patch.object(transport_class, "__init__") as patched: + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=client_cert_source_callback, + ): + if use_client_cert_env == "false": + expected_host = client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ) + expected_client_cert_source = None + else: + expected_host = client.DEFAULT_MTLS_ENDPOINT + expected_client_cert_source = client_cert_source_callback + + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=expected_host, + scopes=None, + client_cert_source_for_mtls=expected_client_cert_source, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # Check the case client_cert_source and ADC client cert are not provided. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + with mock.patch.object(transport_class, "__init__") as patched: + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + +@pytest.mark.parametrize( + "client_class", [OnlineEvaluatorServiceClient, OnlineEvaluatorServiceAsyncClient] +) +@mock.patch.object( + OnlineEvaluatorServiceClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(OnlineEvaluatorServiceClient), +) +@mock.patch.object( + OnlineEvaluatorServiceAsyncClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(OnlineEvaluatorServiceAsyncClient), +) +def test_online_evaluator_service_client_get_mtls_endpoint_and_cert_source( + client_class, +): + mock_client_cert_source = mock.Mock() + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "true". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source == mock_client_cert_source + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "false". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + mock_client_cert_source = mock.Mock() + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source is None + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "Unsupported". + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} + ): + if hasattr(google.auth.transport.mtls, "should_use_client_cert"): + mock_client_cert_source = mock.Mock() + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, + api_endpoint=mock_api_endpoint, + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source is None + + # Test cases for mTLS enablement when GOOGLE_API_USE_CLIENT_CERTIFICATE is unset. + test_cases = [ + ( + # With workloads present in config, mTLS is enabled. + { + "version": 1, + "cert_configs": { + "workload": { + "cert_path": "path/to/cert/file", + "key_path": "path/to/key/file", + } + }, + }, + mock_client_cert_source, + ), + ( + # With workloads not present in config, mTLS is disabled. + { + "version": 1, + "cert_configs": {}, + }, + None, + ), + ] + if hasattr(google.auth.transport.mtls, "should_use_client_cert"): + for config_data, expected_cert_source in test_cases: + env = os.environ.copy() + env.pop("GOOGLE_API_USE_CLIENT_CERTIFICATE", None) + with mock.patch.dict(os.environ, env, clear=True): + config_filename = "mock_certificate_config.json" + config_file_content = json.dumps(config_data) + m = mock.mock_open(read_data=config_file_content) + with mock.patch("builtins.open", m): + with mock.patch.dict( + os.environ, {"GOOGLE_API_CERTIFICATE_CONFIG": config_filename} + ): + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, + api_endpoint=mock_api_endpoint, + ) + api_endpoint, cert_source = ( + client_class.get_mtls_endpoint_and_cert_source(options) + ) + assert api_endpoint == mock_api_endpoint + assert cert_source is expected_cert_source + + # Test cases for mTLS enablement when GOOGLE_API_USE_CLIENT_CERTIFICATE is unset(empty). + test_cases = [ + ( + # With workloads present in config, mTLS is enabled. + { + "version": 1, + "cert_configs": { + "workload": { + "cert_path": "path/to/cert/file", + "key_path": "path/to/key/file", + } + }, + }, + mock_client_cert_source, + ), + ( + # With workloads not present in config, mTLS is disabled. + { + "version": 1, + "cert_configs": {}, + }, + None, + ), + ] + if hasattr(google.auth.transport.mtls, "should_use_client_cert"): + for config_data, expected_cert_source in test_cases: + env = os.environ.copy() + env.pop("GOOGLE_API_USE_CLIENT_CERTIFICATE", "") + with mock.patch.dict(os.environ, env, clear=True): + config_filename = "mock_certificate_config.json" + config_file_content = json.dumps(config_data) + m = mock.mock_open(read_data=config_file_content) + with mock.patch("builtins.open", m): + with mock.patch.dict( + os.environ, {"GOOGLE_API_CERTIFICATE_CONFIG": config_filename} + ): + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, + api_endpoint=mock_api_endpoint, + ) + api_endpoint, cert_source = ( + client_class.get_mtls_endpoint_and_cert_source(options) + ) + assert api_endpoint == mock_api_endpoint + assert cert_source is expected_cert_source + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert doesn't exist. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert exists. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=mock_client_cert_source, + ): + api_endpoint, cert_source = ( + client_class.get_mtls_endpoint_and_cert_source() + ) + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source == mock_client_cert_source + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has + # unsupported value. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError) as excinfo: + client_class.get_mtls_endpoint_and_cert_source() + + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + +@pytest.mark.parametrize( + "client_class", [OnlineEvaluatorServiceClient, OnlineEvaluatorServiceAsyncClient] +) +@mock.patch.object( + OnlineEvaluatorServiceClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(OnlineEvaluatorServiceClient), +) +@mock.patch.object( + OnlineEvaluatorServiceAsyncClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(OnlineEvaluatorServiceAsyncClient), +) +def test_online_evaluator_service_client_client_api_endpoint(client_class): + mock_client_cert_source = client_cert_source_callback + api_override = "foo.com" + default_universe = OnlineEvaluatorServiceClient._DEFAULT_UNIVERSE + default_endpoint = OnlineEvaluatorServiceClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=default_universe + ) + mock_universe = "bar.com" + mock_endpoint = OnlineEvaluatorServiceClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=mock_universe + ) + + # If ClientOptions.api_endpoint is set and GOOGLE_API_USE_CLIENT_CERTIFICATE="true", + # use ClientOptions.api_endpoint as the api endpoint regardless. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" + ): + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=api_override + ) + client = client_class( + client_options=options, + credentials=ga_credentials.AnonymousCredentials(), + ) + assert client.api_endpoint == api_override + + # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="never", + # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + client = client_class(credentials=ga_credentials.AnonymousCredentials()) + assert client.api_endpoint == default_endpoint + + # If ClientOptions.api_endpoint is not set and GOOGLE_API_USE_MTLS_ENDPOINT="always", + # use the DEFAULT_MTLS_ENDPOINT as the api endpoint. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + client = client_class(credentials=ga_credentials.AnonymousCredentials()) + assert client.api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + + # If ClientOptions.api_endpoint is not set, GOOGLE_API_USE_MTLS_ENDPOINT="auto" (default), + # GOOGLE_API_USE_CLIENT_CERTIFICATE="false" (default), default cert source doesn't exist, + # and ClientOptions.universe_domain="bar.com", + # use the _DEFAULT_ENDPOINT_TEMPLATE populated with universe domain as the api endpoint. + options = client_options.ClientOptions() + universe_exists = hasattr(options, "universe_domain") + if universe_exists: + options = client_options.ClientOptions(universe_domain=mock_universe) + client = client_class( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + else: + client = client_class( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + assert client.api_endpoint == ( + mock_endpoint if universe_exists else default_endpoint + ) + assert client.universe_domain == ( + mock_universe if universe_exists else default_universe + ) + + # If ClientOptions does not have a universe domain attribute and GOOGLE_API_USE_MTLS_ENDPOINT="never", + # use the _DEFAULT_ENDPOINT_TEMPLATE populated with GDU as the api endpoint. + options = client_options.ClientOptions() + if hasattr(options, "universe_domain"): + delattr(options, "universe_domain") + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + client = client_class( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + assert client.api_endpoint == default_endpoint + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + ( + OnlineEvaluatorServiceClient, + transports.OnlineEvaluatorServiceGrpcTransport, + "grpc", + ), + ( + OnlineEvaluatorServiceAsyncClient, + transports.OnlineEvaluatorServiceGrpcAsyncIOTransport, + "grpc_asyncio", + ), + ( + OnlineEvaluatorServiceClient, + transports.OnlineEvaluatorServiceRestTransport, + "rest", + ), + ], +) +def test_online_evaluator_service_client_client_options_scopes( + client_class, transport_class, transport_name +): + # Check the case scopes are provided. + options = client_options.ClientOptions( + scopes=["1", "2"], + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=["1", "2"], + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + OnlineEvaluatorServiceClient, + transports.OnlineEvaluatorServiceGrpcTransport, + "grpc", + grpc_helpers, + ), + ( + OnlineEvaluatorServiceAsyncClient, + transports.OnlineEvaluatorServiceGrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ( + OnlineEvaluatorServiceClient, + transports.OnlineEvaluatorServiceRestTransport, + "rest", + None, + ), + ], +) +def test_online_evaluator_service_client_client_options_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + +def test_online_evaluator_service_client_client_options_from_dict(): + with mock.patch( + "google.cloud.aiplatform_v1beta1.services.online_evaluator_service.transports.OnlineEvaluatorServiceGrpcTransport.__init__" + ) as grpc_transport: + grpc_transport.return_value = None + client = OnlineEvaluatorServiceClient( + client_options={"api_endpoint": "squid.clam.whelk"} + ) + grpc_transport.assert_called_once_with( + credentials=None, + credentials_file=None, + host="squid.clam.whelk", + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + OnlineEvaluatorServiceClient, + transports.OnlineEvaluatorServiceGrpcTransport, + "grpc", + grpc_helpers, + ), + ( + OnlineEvaluatorServiceAsyncClient, + transports.OnlineEvaluatorServiceGrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_online_evaluator_service_client_create_channel_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) + + # test that the credentials from file are saved and used as the credentials. + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel" + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() + load_creds.return_value = (file_creds, None) + adc.return_value = (creds, None) + client = client_class(client_options=options, transport=transport_name) + create_channel.assert_called_with( + "aiplatform.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=("https://www.googleapis.com/auth/cloud-platform",), + scopes=None, + default_host="aiplatform.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.CreateOnlineEvaluatorRequest, + dict, + ], +) +def test_create_online_evaluator(request_type, transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.create_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + request = online_evaluator_service.CreateOnlineEvaluatorRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_create_online_evaluator_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Populate all string fields in the request which are not UUID4 + # since we want to check that UUID4 are populated automatically + # if they meet the requirements of AIP 4235. + request = online_evaluator_service.CreateOnlineEvaluatorRequest( + parent="parent_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_online_evaluator), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.create_online_evaluator(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == online_evaluator_service.CreateOnlineEvaluatorRequest( + parent="parent_value", + ) + + +def test_create_online_evaluator_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.create_online_evaluator + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.create_online_evaluator + ] = mock_rpc + request = {} + client.create_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.create_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_create_online_evaluator_async_use_cached_wrapped_rpc( + transport: str = "grpc_asyncio", +): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._client._transport.create_online_evaluator + in client._client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.AsyncMock() + mock_rpc.return_value = mock.Mock() + client._client._transport._wrapped_methods[ + client._client._transport.create_online_evaluator + ] = mock_rpc + + request = {} + await client.create_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + await client.create_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_create_online_evaluator_async( + transport: str = "grpc_asyncio", + request_type=online_evaluator_service.CreateOnlineEvaluatorRequest, +): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.create_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + request = online_evaluator_service.CreateOnlineEvaluatorRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_create_online_evaluator_async_from_dict(): + await test_create_online_evaluator_async(request_type=dict) + + +def test_create_online_evaluator_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = online_evaluator_service.CreateOnlineEvaluatorRequest() + + request.parent = "parent_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_online_evaluator), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.create_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "parent=parent_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_create_online_evaluator_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = online_evaluator_service.CreateOnlineEvaluatorRequest() + + request.parent = "parent_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_online_evaluator), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.create_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "parent=parent_value", + ) in kw["metadata"] + + +def test_create_online_evaluator_flattened(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.create_online_evaluator( + parent="parent_value", + online_evaluator=gca_online_evaluator.OnlineEvaluator( + cloud_observability=gca_online_evaluator.OnlineEvaluator.CloudObservability( + trace_scope=gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope( + filter=[ + gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope.Predicate( + duration=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate( + comparison_operator=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator.LESS + ) + ) + ] + ) + ) + ), + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].online_evaluator + mock_val = gca_online_evaluator.OnlineEvaluator( + cloud_observability=gca_online_evaluator.OnlineEvaluator.CloudObservability( + trace_scope=gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope( + filter=[ + gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope.Predicate( + duration=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate( + comparison_operator=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator.LESS + ) + ) + ] + ) + ) + ) + assert arg == mock_val + + +def test_create_online_evaluator_flattened_error(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.create_online_evaluator( + online_evaluator_service.CreateOnlineEvaluatorRequest(), + parent="parent_value", + online_evaluator=gca_online_evaluator.OnlineEvaluator( + cloud_observability=gca_online_evaluator.OnlineEvaluator.CloudObservability( + trace_scope=gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope( + filter=[ + gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope.Predicate( + duration=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate( + comparison_operator=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator.LESS + ) + ) + ] + ) + ) + ), + ) + + +@pytest.mark.asyncio +async def test_create_online_evaluator_flattened_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.create_online_evaluator( + parent="parent_value", + online_evaluator=gca_online_evaluator.OnlineEvaluator( + cloud_observability=gca_online_evaluator.OnlineEvaluator.CloudObservability( + trace_scope=gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope( + filter=[ + gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope.Predicate( + duration=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate( + comparison_operator=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator.LESS + ) + ) + ] + ) + ) + ), + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].online_evaluator + mock_val = gca_online_evaluator.OnlineEvaluator( + cloud_observability=gca_online_evaluator.OnlineEvaluator.CloudObservability( + trace_scope=gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope( + filter=[ + gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope.Predicate( + duration=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate( + comparison_operator=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator.LESS + ) + ) + ] + ) + ) + ) + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_create_online_evaluator_flattened_error_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.create_online_evaluator( + online_evaluator_service.CreateOnlineEvaluatorRequest(), + parent="parent_value", + online_evaluator=gca_online_evaluator.OnlineEvaluator( + cloud_observability=gca_online_evaluator.OnlineEvaluator.CloudObservability( + trace_scope=gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope( + filter=[ + gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope.Predicate( + duration=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate( + comparison_operator=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator.LESS + ) + ) + ] + ) + ) + ), + ) + + +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.GetOnlineEvaluatorRequest, + dict, + ], +) +def test_get_online_evaluator(request_type, transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = online_evaluator.OnlineEvaluator( + name="name_value", + agent_resource="agent_resource_value", + state=online_evaluator.OnlineEvaluator.State.ACTIVE, + display_name="display_name_value", + ) + response = client.get_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + request = online_evaluator_service.GetOnlineEvaluatorRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, online_evaluator.OnlineEvaluator) + assert response.name == "name_value" + assert response.agent_resource == "agent_resource_value" + assert response.state == online_evaluator.OnlineEvaluator.State.ACTIVE + assert response.display_name == "display_name_value" + + +def test_get_online_evaluator_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Populate all string fields in the request which are not UUID4 + # since we want to check that UUID4 are populated automatically + # if they meet the requirements of AIP 4235. + request = online_evaluator_service.GetOnlineEvaluatorRequest( + name="name_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_online_evaluator), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.get_online_evaluator(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == online_evaluator_service.GetOnlineEvaluatorRequest( + name="name_value", + ) + + +def test_get_online_evaluator_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.get_online_evaluator in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.get_online_evaluator] = ( + mock_rpc + ) + request = {} + client.get_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.get_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_get_online_evaluator_async_use_cached_wrapped_rpc( + transport: str = "grpc_asyncio", +): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._client._transport.get_online_evaluator + in client._client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.AsyncMock() + mock_rpc.return_value = mock.Mock() + client._client._transport._wrapped_methods[ + client._client._transport.get_online_evaluator + ] = mock_rpc + + request = {} + await client.get_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + await client.get_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_get_online_evaluator_async( + transport: str = "grpc_asyncio", + request_type=online_evaluator_service.GetOnlineEvaluatorRequest, +): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + online_evaluator.OnlineEvaluator( + name="name_value", + agent_resource="agent_resource_value", + state=online_evaluator.OnlineEvaluator.State.ACTIVE, + display_name="display_name_value", + ) + ) + response = await client.get_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + request = online_evaluator_service.GetOnlineEvaluatorRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, online_evaluator.OnlineEvaluator) + assert response.name == "name_value" + assert response.agent_resource == "agent_resource_value" + assert response.state == online_evaluator.OnlineEvaluator.State.ACTIVE + assert response.display_name == "display_name_value" + + +@pytest.mark.asyncio +async def test_get_online_evaluator_async_from_dict(): + await test_get_online_evaluator_async(request_type=dict) + + +def test_get_online_evaluator_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = online_evaluator_service.GetOnlineEvaluatorRequest() + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_online_evaluator), "__call__" + ) as call: + call.return_value = online_evaluator.OnlineEvaluator() + client.get_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=name_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_get_online_evaluator_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = online_evaluator_service.GetOnlineEvaluatorRequest() + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_online_evaluator), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + online_evaluator.OnlineEvaluator() + ) + await client.get_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=name_value", + ) in kw["metadata"] + + +def test_get_online_evaluator_flattened(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = online_evaluator.OnlineEvaluator() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.get_online_evaluator( + name="name_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +def test_get_online_evaluator_flattened_error(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get_online_evaluator( + online_evaluator_service.GetOnlineEvaluatorRequest(), + name="name_value", + ) + + +@pytest.mark.asyncio +async def test_get_online_evaluator_flattened_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = online_evaluator.OnlineEvaluator() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + online_evaluator.OnlineEvaluator() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.get_online_evaluator( + name="name_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_get_online_evaluator_flattened_error_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.get_online_evaluator( + online_evaluator_service.GetOnlineEvaluatorRequest(), + name="name_value", + ) + + +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.UpdateOnlineEvaluatorRequest, + dict, + ], +) +def test_update_online_evaluator(request_type, transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.update_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + request = online_evaluator_service.UpdateOnlineEvaluatorRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_update_online_evaluator_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Populate all string fields in the request which are not UUID4 + # since we want to check that UUID4 are populated automatically + # if they meet the requirements of AIP 4235. + request = online_evaluator_service.UpdateOnlineEvaluatorRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_online_evaluator), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.update_online_evaluator(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == online_evaluator_service.UpdateOnlineEvaluatorRequest() + + +def test_update_online_evaluator_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.update_online_evaluator + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.update_online_evaluator + ] = mock_rpc + request = {} + client.update_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.update_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_update_online_evaluator_async_use_cached_wrapped_rpc( + transport: str = "grpc_asyncio", +): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._client._transport.update_online_evaluator + in client._client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.AsyncMock() + mock_rpc.return_value = mock.Mock() + client._client._transport._wrapped_methods[ + client._client._transport.update_online_evaluator + ] = mock_rpc + + request = {} + await client.update_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + await client.update_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_update_online_evaluator_async( + transport: str = "grpc_asyncio", + request_type=online_evaluator_service.UpdateOnlineEvaluatorRequest, +): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.update_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + request = online_evaluator_service.UpdateOnlineEvaluatorRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_update_online_evaluator_async_from_dict(): + await test_update_online_evaluator_async(request_type=dict) + + +def test_update_online_evaluator_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = online_evaluator_service.UpdateOnlineEvaluatorRequest() + + request.online_evaluator.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_online_evaluator), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.update_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "online_evaluator.name=name_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_update_online_evaluator_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = online_evaluator_service.UpdateOnlineEvaluatorRequest() + + request.online_evaluator.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_online_evaluator), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.update_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "online_evaluator.name=name_value", + ) in kw["metadata"] + + +def test_update_online_evaluator_flattened(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.update_online_evaluator( + online_evaluator=gca_online_evaluator.OnlineEvaluator( + cloud_observability=gca_online_evaluator.OnlineEvaluator.CloudObservability( + trace_scope=gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope( + filter=[ + gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope.Predicate( + duration=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate( + comparison_operator=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator.LESS + ) + ) + ] + ) + ) + ), + update_mask=field_mask_pb2.FieldMask(paths=["paths_value"]), + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].online_evaluator + mock_val = gca_online_evaluator.OnlineEvaluator( + cloud_observability=gca_online_evaluator.OnlineEvaluator.CloudObservability( + trace_scope=gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope( + filter=[ + gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope.Predicate( + duration=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate( + comparison_operator=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator.LESS + ) + ) + ] + ) + ) + ) + assert arg == mock_val + arg = args[0].update_mask + mock_val = field_mask_pb2.FieldMask(paths=["paths_value"]) + assert arg == mock_val + + +def test_update_online_evaluator_flattened_error(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.update_online_evaluator( + online_evaluator_service.UpdateOnlineEvaluatorRequest(), + online_evaluator=gca_online_evaluator.OnlineEvaluator( + cloud_observability=gca_online_evaluator.OnlineEvaluator.CloudObservability( + trace_scope=gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope( + filter=[ + gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope.Predicate( + duration=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate( + comparison_operator=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator.LESS + ) + ) + ] + ) + ) + ), + update_mask=field_mask_pb2.FieldMask(paths=["paths_value"]), + ) + + +@pytest.mark.asyncio +async def test_update_online_evaluator_flattened_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.update_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.update_online_evaluator( + online_evaluator=gca_online_evaluator.OnlineEvaluator( + cloud_observability=gca_online_evaluator.OnlineEvaluator.CloudObservability( + trace_scope=gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope( + filter=[ + gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope.Predicate( + duration=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate( + comparison_operator=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator.LESS + ) + ) + ] + ) + ) + ), + update_mask=field_mask_pb2.FieldMask(paths=["paths_value"]), + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].online_evaluator + mock_val = gca_online_evaluator.OnlineEvaluator( + cloud_observability=gca_online_evaluator.OnlineEvaluator.CloudObservability( + trace_scope=gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope( + filter=[ + gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope.Predicate( + duration=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate( + comparison_operator=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator.LESS + ) + ) + ] + ) + ) + ) + assert arg == mock_val + arg = args[0].update_mask + mock_val = field_mask_pb2.FieldMask(paths=["paths_value"]) + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_update_online_evaluator_flattened_error_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.update_online_evaluator( + online_evaluator_service.UpdateOnlineEvaluatorRequest(), + online_evaluator=gca_online_evaluator.OnlineEvaluator( + cloud_observability=gca_online_evaluator.OnlineEvaluator.CloudObservability( + trace_scope=gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope( + filter=[ + gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope.Predicate( + duration=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate( + comparison_operator=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator.LESS + ) + ) + ] + ) + ) + ), + update_mask=field_mask_pb2.FieldMask(paths=["paths_value"]), + ) + + +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.DeleteOnlineEvaluatorRequest, + dict, + ], +) +def test_delete_online_evaluator(request_type, transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.delete_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + request = online_evaluator_service.DeleteOnlineEvaluatorRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_delete_online_evaluator_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Populate all string fields in the request which are not UUID4 + # since we want to check that UUID4 are populated automatically + # if they meet the requirements of AIP 4235. + request = online_evaluator_service.DeleteOnlineEvaluatorRequest( + name="name_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_online_evaluator), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.delete_online_evaluator(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == online_evaluator_service.DeleteOnlineEvaluatorRequest( + name="name_value", + ) + + +def test_delete_online_evaluator_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.delete_online_evaluator + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.delete_online_evaluator + ] = mock_rpc + request = {} + client.delete_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.delete_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_delete_online_evaluator_async_use_cached_wrapped_rpc( + transport: str = "grpc_asyncio", +): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._client._transport.delete_online_evaluator + in client._client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.AsyncMock() + mock_rpc.return_value = mock.Mock() + client._client._transport._wrapped_methods[ + client._client._transport.delete_online_evaluator + ] = mock_rpc + + request = {} + await client.delete_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + await client.delete_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_delete_online_evaluator_async( + transport: str = "grpc_asyncio", + request_type=online_evaluator_service.DeleteOnlineEvaluatorRequest, +): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.delete_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + request = online_evaluator_service.DeleteOnlineEvaluatorRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_delete_online_evaluator_async_from_dict(): + await test_delete_online_evaluator_async(request_type=dict) + + +def test_delete_online_evaluator_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = online_evaluator_service.DeleteOnlineEvaluatorRequest() + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_online_evaluator), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.delete_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=name_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_delete_online_evaluator_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = online_evaluator_service.DeleteOnlineEvaluatorRequest() + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_online_evaluator), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.delete_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=name_value", + ) in kw["metadata"] + + +def test_delete_online_evaluator_flattened(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.delete_online_evaluator( + name="name_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +def test_delete_online_evaluator_flattened_error(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.delete_online_evaluator( + online_evaluator_service.DeleteOnlineEvaluatorRequest(), + name="name_value", + ) + + +@pytest.mark.asyncio +async def test_delete_online_evaluator_flattened_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.delete_online_evaluator( + name="name_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_delete_online_evaluator_flattened_error_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.delete_online_evaluator( + online_evaluator_service.DeleteOnlineEvaluatorRequest(), + name="name_value", + ) + + +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.ListOnlineEvaluatorsRequest, + dict, + ], +) +def test_list_online_evaluators(request_type, transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_online_evaluators), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = online_evaluator_service.ListOnlineEvaluatorsResponse( + next_page_token="next_page_token_value", + ) + response = client.list_online_evaluators(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + request = online_evaluator_service.ListOnlineEvaluatorsRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListOnlineEvaluatorsPager) + assert response.next_page_token == "next_page_token_value" + + +def test_list_online_evaluators_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Populate all string fields in the request which are not UUID4 + # since we want to check that UUID4 are populated automatically + # if they meet the requirements of AIP 4235. + request = online_evaluator_service.ListOnlineEvaluatorsRequest( + parent="parent_value", + page_token="page_token_value", + filter="filter_value", + order_by="order_by_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_online_evaluators), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.list_online_evaluators(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == online_evaluator_service.ListOnlineEvaluatorsRequest( + parent="parent_value", + page_token="page_token_value", + filter="filter_value", + order_by="order_by_value", + ) + + +def test_list_online_evaluators_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.list_online_evaluators + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.list_online_evaluators] = ( + mock_rpc + ) + request = {} + client.list_online_evaluators(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.list_online_evaluators(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_list_online_evaluators_async_use_cached_wrapped_rpc( + transport: str = "grpc_asyncio", +): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._client._transport.list_online_evaluators + in client._client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.AsyncMock() + mock_rpc.return_value = mock.Mock() + client._client._transport._wrapped_methods[ + client._client._transport.list_online_evaluators + ] = mock_rpc + + request = {} + await client.list_online_evaluators(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + await client.list_online_evaluators(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_list_online_evaluators_async( + transport: str = "grpc_asyncio", + request_type=online_evaluator_service.ListOnlineEvaluatorsRequest, +): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_online_evaluators), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + online_evaluator_service.ListOnlineEvaluatorsResponse( + next_page_token="next_page_token_value", + ) + ) + response = await client.list_online_evaluators(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + request = online_evaluator_service.ListOnlineEvaluatorsRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListOnlineEvaluatorsAsyncPager) + assert response.next_page_token == "next_page_token_value" + + +@pytest.mark.asyncio +async def test_list_online_evaluators_async_from_dict(): + await test_list_online_evaluators_async(request_type=dict) + + +def test_list_online_evaluators_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = online_evaluator_service.ListOnlineEvaluatorsRequest() + + request.parent = "parent_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_online_evaluators), "__call__" + ) as call: + call.return_value = online_evaluator_service.ListOnlineEvaluatorsResponse() + client.list_online_evaluators(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "parent=parent_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_list_online_evaluators_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = online_evaluator_service.ListOnlineEvaluatorsRequest() + + request.parent = "parent_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_online_evaluators), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + online_evaluator_service.ListOnlineEvaluatorsResponse() + ) + await client.list_online_evaluators(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "parent=parent_value", + ) in kw["metadata"] + + +def test_list_online_evaluators_flattened(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_online_evaluators), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = online_evaluator_service.ListOnlineEvaluatorsResponse() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.list_online_evaluators( + parent="parent_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + + +def test_list_online_evaluators_flattened_error(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.list_online_evaluators( + online_evaluator_service.ListOnlineEvaluatorsRequest(), + parent="parent_value", + ) + + +@pytest.mark.asyncio +async def test_list_online_evaluators_flattened_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_online_evaluators), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = online_evaluator_service.ListOnlineEvaluatorsResponse() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + online_evaluator_service.ListOnlineEvaluatorsResponse() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.list_online_evaluators( + parent="parent_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_list_online_evaluators_flattened_error_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.list_online_evaluators( + online_evaluator_service.ListOnlineEvaluatorsRequest(), + parent="parent_value", + ) + + +def test_list_online_evaluators_pager(transport_name: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_online_evaluators), "__call__" + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[ + online_evaluator.OnlineEvaluator(), + online_evaluator.OnlineEvaluator(), + online_evaluator.OnlineEvaluator(), + ], + next_page_token="abc", + ), + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[], + next_page_token="def", + ), + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[ + online_evaluator.OnlineEvaluator(), + ], + next_page_token="ghi", + ), + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[ + online_evaluator.OnlineEvaluator(), + online_evaluator.OnlineEvaluator(), + ], + ), + RuntimeError, + ) + + expected_metadata = () + retry = retries.Retry() + timeout = 5 + expected_metadata = tuple(expected_metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", ""),)), + ) + pager = client.list_online_evaluators(request={}, retry=retry, timeout=timeout) + + assert pager._metadata == expected_metadata + assert pager._retry == retry + assert pager._timeout == timeout + + results = list(pager) + assert len(results) == 6 + assert all(isinstance(i, online_evaluator.OnlineEvaluator) for i in results) + + +def test_list_online_evaluators_pages(transport_name: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_online_evaluators), "__call__" + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[ + online_evaluator.OnlineEvaluator(), + online_evaluator.OnlineEvaluator(), + online_evaluator.OnlineEvaluator(), + ], + next_page_token="abc", + ), + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[], + next_page_token="def", + ), + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[ + online_evaluator.OnlineEvaluator(), + ], + next_page_token="ghi", + ), + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[ + online_evaluator.OnlineEvaluator(), + online_evaluator.OnlineEvaluator(), + ], + ), + RuntimeError, + ) + pages = list(client.list_online_evaluators(request={}).pages) + for page_, token in zip(pages, ["abc", "def", "ghi", ""]): + assert page_.raw_page.next_page_token == token + + +@pytest.mark.asyncio +async def test_list_online_evaluators_async_pager(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_online_evaluators), + "__call__", + new_callable=mock.AsyncMock, + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[ + online_evaluator.OnlineEvaluator(), + online_evaluator.OnlineEvaluator(), + online_evaluator.OnlineEvaluator(), + ], + next_page_token="abc", + ), + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[], + next_page_token="def", + ), + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[ + online_evaluator.OnlineEvaluator(), + ], + next_page_token="ghi", + ), + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[ + online_evaluator.OnlineEvaluator(), + online_evaluator.OnlineEvaluator(), + ], + ), + RuntimeError, + ) + async_pager = await client.list_online_evaluators( + request={}, + ) + assert async_pager.next_page_token == "abc" + responses = [] + async for response in async_pager: # pragma: no branch + responses.append(response) + + assert len(responses) == 6 + assert all(isinstance(i, online_evaluator.OnlineEvaluator) for i in responses) + + +@pytest.mark.asyncio +async def test_list_online_evaluators_async_pages(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_online_evaluators), + "__call__", + new_callable=mock.AsyncMock, + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[ + online_evaluator.OnlineEvaluator(), + online_evaluator.OnlineEvaluator(), + online_evaluator.OnlineEvaluator(), + ], + next_page_token="abc", + ), + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[], + next_page_token="def", + ), + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[ + online_evaluator.OnlineEvaluator(), + ], + next_page_token="ghi", + ), + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[ + online_evaluator.OnlineEvaluator(), + online_evaluator.OnlineEvaluator(), + ], + ), + RuntimeError, + ) + pages = [] + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch + await client.list_online_evaluators(request={}) + ).pages: + pages.append(page_) + for page_, token in zip(pages, ["abc", "def", "ghi", ""]): + assert page_.raw_page.next_page_token == token + + +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.ActivateOnlineEvaluatorRequest, + dict, + ], +) +def test_activate_online_evaluator(request_type, transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.activate_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.activate_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + request = online_evaluator_service.ActivateOnlineEvaluatorRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_activate_online_evaluator_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Populate all string fields in the request which are not UUID4 + # since we want to check that UUID4 are populated automatically + # if they meet the requirements of AIP 4235. + request = online_evaluator_service.ActivateOnlineEvaluatorRequest( + name="name_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.activate_online_evaluator), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.activate_online_evaluator(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == online_evaluator_service.ActivateOnlineEvaluatorRequest( + name="name_value", + ) + + +def test_activate_online_evaluator_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.activate_online_evaluator + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.activate_online_evaluator + ] = mock_rpc + request = {} + client.activate_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.activate_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_activate_online_evaluator_async_use_cached_wrapped_rpc( + transport: str = "grpc_asyncio", +): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._client._transport.activate_online_evaluator + in client._client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.AsyncMock() + mock_rpc.return_value = mock.Mock() + client._client._transport._wrapped_methods[ + client._client._transport.activate_online_evaluator + ] = mock_rpc + + request = {} + await client.activate_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + await client.activate_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_activate_online_evaluator_async( + transport: str = "grpc_asyncio", + request_type=online_evaluator_service.ActivateOnlineEvaluatorRequest, +): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.activate_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.activate_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + request = online_evaluator_service.ActivateOnlineEvaluatorRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_activate_online_evaluator_async_from_dict(): + await test_activate_online_evaluator_async(request_type=dict) + + +def test_activate_online_evaluator_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = online_evaluator_service.ActivateOnlineEvaluatorRequest() + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.activate_online_evaluator), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.activate_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=name_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_activate_online_evaluator_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = online_evaluator_service.ActivateOnlineEvaluatorRequest() + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.activate_online_evaluator), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.activate_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=name_value", + ) in kw["metadata"] + + +def test_activate_online_evaluator_flattened(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.activate_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.activate_online_evaluator( + name="name_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +def test_activate_online_evaluator_flattened_error(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.activate_online_evaluator( + online_evaluator_service.ActivateOnlineEvaluatorRequest(), + name="name_value", + ) + + +@pytest.mark.asyncio +async def test_activate_online_evaluator_flattened_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.activate_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.activate_online_evaluator( + name="name_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_activate_online_evaluator_flattened_error_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.activate_online_evaluator( + online_evaluator_service.ActivateOnlineEvaluatorRequest(), + name="name_value", + ) + + +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.SuspendOnlineEvaluatorRequest, + dict, + ], +) +def test_suspend_online_evaluator(request_type, transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.suspend_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.suspend_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + request = online_evaluator_service.SuspendOnlineEvaluatorRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_suspend_online_evaluator_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Populate all string fields in the request which are not UUID4 + # since we want to check that UUID4 are populated automatically + # if they meet the requirements of AIP 4235. + request = online_evaluator_service.SuspendOnlineEvaluatorRequest( + name="name_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.suspend_online_evaluator), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.suspend_online_evaluator(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == online_evaluator_service.SuspendOnlineEvaluatorRequest( + name="name_value", + ) + + +def test_suspend_online_evaluator_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.suspend_online_evaluator + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.suspend_online_evaluator + ] = mock_rpc + request = {} + client.suspend_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.suspend_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_suspend_online_evaluator_async_use_cached_wrapped_rpc( + transport: str = "grpc_asyncio", +): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._client._transport.suspend_online_evaluator + in client._client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.AsyncMock() + mock_rpc.return_value = mock.Mock() + client._client._transport._wrapped_methods[ + client._client._transport.suspend_online_evaluator + ] = mock_rpc + + request = {} + await client.suspend_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + await client.suspend_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_suspend_online_evaluator_async( + transport: str = "grpc_asyncio", + request_type=online_evaluator_service.SuspendOnlineEvaluatorRequest, +): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.suspend_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.suspend_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + request = online_evaluator_service.SuspendOnlineEvaluatorRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_suspend_online_evaluator_async_from_dict(): + await test_suspend_online_evaluator_async(request_type=dict) + + +def test_suspend_online_evaluator_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = online_evaluator_service.SuspendOnlineEvaluatorRequest() + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.suspend_online_evaluator), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.suspend_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=name_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_suspend_online_evaluator_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = online_evaluator_service.SuspendOnlineEvaluatorRequest() + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.suspend_online_evaluator), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.suspend_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=name_value", + ) in kw["metadata"] + + +def test_suspend_online_evaluator_flattened(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.suspend_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.suspend_online_evaluator( + name="name_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +def test_suspend_online_evaluator_flattened_error(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.suspend_online_evaluator( + online_evaluator_service.SuspendOnlineEvaluatorRequest(), + name="name_value", + ) + + +@pytest.mark.asyncio +async def test_suspend_online_evaluator_flattened_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.suspend_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.suspend_online_evaluator( + name="name_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_suspend_online_evaluator_flattened_error_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.suspend_online_evaluator( + online_evaluator_service.SuspendOnlineEvaluatorRequest(), + name="name_value", + ) + + +def test_create_online_evaluator_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.create_online_evaluator + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.create_online_evaluator + ] = mock_rpc + + request = {} + client.create_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.create_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_create_online_evaluator_rest_required_fields( + request_type=online_evaluator_service.CreateOnlineEvaluatorRequest, +): + transport_class = transports.OnlineEvaluatorServiceRestTransport + + request_init = {} + request_init["parent"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).create_online_evaluator._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["parent"] = "parent_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).create_online_evaluator._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "parent" in jsonified_request + assert jsonified_request["parent"] == "parent_value" + + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.create_online_evaluator(request) + + expected_params = [("$alt", "json;enum-encoding=int")] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_create_online_evaluator_rest_unset_required_fields(): + transport = transports.OnlineEvaluatorServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.create_online_evaluator._get_unset_required_fields({}) + assert set(unset_fields) == ( + set(()) + & set( + ( + "parent", + "onlineEvaluator", + ) + ) + ) + + +def test_create_online_evaluator_rest_flattened(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # get arguments that satisfy an http rule for this method + sample_request = {"parent": "projects/sample1/locations/sample2"} + + # get truthy value for each flattened field + mock_args = dict( + parent="parent_value", + online_evaluator=gca_online_evaluator.OnlineEvaluator( + cloud_observability=gca_online_evaluator.OnlineEvaluator.CloudObservability( + trace_scope=gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope( + filter=[ + gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope.Predicate( + duration=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate( + comparison_operator=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator.LESS + ) + ) + ] + ) + ) + ), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.create_online_evaluator(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/v1beta1/{parent=projects/*/locations/*}/onlineEvaluators" + % client.transport._host, + args[1], + ) + + +def test_create_online_evaluator_rest_flattened_error(transport: str = "rest"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.create_online_evaluator( + online_evaluator_service.CreateOnlineEvaluatorRequest(), + parent="parent_value", + online_evaluator=gca_online_evaluator.OnlineEvaluator( + cloud_observability=gca_online_evaluator.OnlineEvaluator.CloudObservability( + trace_scope=gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope( + filter=[ + gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope.Predicate( + duration=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate( + comparison_operator=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator.LESS + ) + ) + ] + ) + ) + ), + ) + + +def test_get_online_evaluator_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.get_online_evaluator in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.get_online_evaluator] = ( + mock_rpc + ) + + request = {} + client.get_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.get_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_get_online_evaluator_rest_required_fields( + request_type=online_evaluator_service.GetOnlineEvaluatorRequest, +): + transport_class = transports.OnlineEvaluatorServiceRestTransport + + request_init = {} + request_init["name"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).get_online_evaluator._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["name"] = "name_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).get_online_evaluator._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "name" in jsonified_request + assert jsonified_request["name"] == "name_value" + + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = online_evaluator.OnlineEvaluator() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "get", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = online_evaluator.OnlineEvaluator.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.get_online_evaluator(request) + + expected_params = [("$alt", "json;enum-encoding=int")] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_get_online_evaluator_rest_unset_required_fields(): + transport = transports.OnlineEvaluatorServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.get_online_evaluator._get_unset_required_fields({}) + assert set(unset_fields) == (set(()) & set(("name",))) + + +def test_get_online_evaluator_rest_flattened(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = online_evaluator.OnlineEvaluator() + + # get arguments that satisfy an http rule for this method + sample_request = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + + # get truthy value for each flattened field + mock_args = dict( + name="name_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = online_evaluator.OnlineEvaluator.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.get_online_evaluator(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}" + % client.transport._host, + args[1], + ) + + +def test_get_online_evaluator_rest_flattened_error(transport: str = "rest"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get_online_evaluator( + online_evaluator_service.GetOnlineEvaluatorRequest(), + name="name_value", + ) + + +def test_update_online_evaluator_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.update_online_evaluator + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.update_online_evaluator + ] = mock_rpc + + request = {} + client.update_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.update_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_update_online_evaluator_rest_required_fields( + request_type=online_evaluator_service.UpdateOnlineEvaluatorRequest, +): + transport_class = transports.OnlineEvaluatorServiceRestTransport + + request_init = {} + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).update_online_evaluator._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).update_online_evaluator._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set(("update_mask",)) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "patch", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.update_online_evaluator(request) + + expected_params = [("$alt", "json;enum-encoding=int")] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_update_online_evaluator_rest_unset_required_fields(): + transport = transports.OnlineEvaluatorServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.update_online_evaluator._get_unset_required_fields({}) + assert set(unset_fields) == (set(("updateMask",)) & set(("onlineEvaluator",))) + + +def test_update_online_evaluator_rest_flattened(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # get arguments that satisfy an http rule for this method + sample_request = { + "online_evaluator": { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + } + + # get truthy value for each flattened field + mock_args = dict( + online_evaluator=gca_online_evaluator.OnlineEvaluator( + cloud_observability=gca_online_evaluator.OnlineEvaluator.CloudObservability( + trace_scope=gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope( + filter=[ + gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope.Predicate( + duration=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate( + comparison_operator=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator.LESS + ) + ) + ] + ) + ) + ), + update_mask=field_mask_pb2.FieldMask(paths=["paths_value"]), + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.update_online_evaluator(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/v1beta1/{online_evaluator.name=projects/*/locations/*/onlineEvaluators/*}" + % client.transport._host, + args[1], + ) + + +def test_update_online_evaluator_rest_flattened_error(transport: str = "rest"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.update_online_evaluator( + online_evaluator_service.UpdateOnlineEvaluatorRequest(), + online_evaluator=gca_online_evaluator.OnlineEvaluator( + cloud_observability=gca_online_evaluator.OnlineEvaluator.CloudObservability( + trace_scope=gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope( + filter=[ + gca_online_evaluator.OnlineEvaluator.CloudObservability.TraceScope.Predicate( + duration=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate( + comparison_operator=gca_online_evaluator.OnlineEvaluator.CloudObservability.NumericPredicate.ComparisonOperator.LESS + ) + ) + ] + ) + ) + ), + update_mask=field_mask_pb2.FieldMask(paths=["paths_value"]), + ) + + +def test_delete_online_evaluator_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.delete_online_evaluator + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.delete_online_evaluator + ] = mock_rpc + + request = {} + client.delete_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.delete_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_delete_online_evaluator_rest_required_fields( + request_type=online_evaluator_service.DeleteOnlineEvaluatorRequest, +): + transport_class = transports.OnlineEvaluatorServiceRestTransport + + request_init = {} + request_init["name"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).delete_online_evaluator._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["name"] = "name_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).delete_online_evaluator._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "name" in jsonified_request + assert jsonified_request["name"] == "name_value" + + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "delete", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.delete_online_evaluator(request) + + expected_params = [("$alt", "json;enum-encoding=int")] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_delete_online_evaluator_rest_unset_required_fields(): + transport = transports.OnlineEvaluatorServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.delete_online_evaluator._get_unset_required_fields({}) + assert set(unset_fields) == (set(()) & set(("name",))) + + +def test_delete_online_evaluator_rest_flattened(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # get arguments that satisfy an http rule for this method + sample_request = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + + # get truthy value for each flattened field + mock_args = dict( + name="name_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.delete_online_evaluator(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}" + % client.transport._host, + args[1], + ) + + +def test_delete_online_evaluator_rest_flattened_error(transport: str = "rest"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.delete_online_evaluator( + online_evaluator_service.DeleteOnlineEvaluatorRequest(), + name="name_value", + ) + + +def test_list_online_evaluators_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.list_online_evaluators + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[client._transport.list_online_evaluators] = ( + mock_rpc + ) + + request = {} + client.list_online_evaluators(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.list_online_evaluators(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_list_online_evaluators_rest_required_fields( + request_type=online_evaluator_service.ListOnlineEvaluatorsRequest, +): + transport_class = transports.OnlineEvaluatorServiceRestTransport + + request_init = {} + request_init["parent"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).list_online_evaluators._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["parent"] = "parent_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).list_online_evaluators._get_unset_required_fields(jsonified_request) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set( + ( + "filter", + "order_by", + "page_size", + "page_token", + ) + ) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "parent" in jsonified_request + assert jsonified_request["parent"] == "parent_value" + + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = online_evaluator_service.ListOnlineEvaluatorsResponse() + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "get", + "query_params": pb_request, + } + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = online_evaluator_service.ListOnlineEvaluatorsResponse.pb( + return_value + ) + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.list_online_evaluators(request) + + expected_params = [("$alt", "json;enum-encoding=int")] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_list_online_evaluators_rest_unset_required_fields(): + transport = transports.OnlineEvaluatorServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.list_online_evaluators._get_unset_required_fields({}) + assert set(unset_fields) == ( + set( + ( + "filter", + "orderBy", + "pageSize", + "pageToken", + ) + ) + & set(("parent",)) + ) + + +def test_list_online_evaluators_rest_flattened(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = online_evaluator_service.ListOnlineEvaluatorsResponse() + + # get arguments that satisfy an http rule for this method + sample_request = {"parent": "projects/sample1/locations/sample2"} + + # get truthy value for each flattened field + mock_args = dict( + parent="parent_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + # Convert return value to protobuf type + return_value = online_evaluator_service.ListOnlineEvaluatorsResponse.pb( + return_value + ) + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.list_online_evaluators(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/v1beta1/{parent=projects/*/locations/*}/onlineEvaluators" + % client.transport._host, + args[1], + ) + + +def test_list_online_evaluators_rest_flattened_error(transport: str = "rest"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.list_online_evaluators( + online_evaluator_service.ListOnlineEvaluatorsRequest(), + parent="parent_value", + ) + + +def test_list_online_evaluators_rest_pager(transport: str = "rest"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # TODO(kbandes): remove this mock unless there's a good reason for it. + # with mock.patch.object(path_template, 'transcode') as transcode: + # Set the response as a series of pages + response = ( + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[ + online_evaluator.OnlineEvaluator(), + online_evaluator.OnlineEvaluator(), + online_evaluator.OnlineEvaluator(), + ], + next_page_token="abc", + ), + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[], + next_page_token="def", + ), + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[ + online_evaluator.OnlineEvaluator(), + ], + next_page_token="ghi", + ), + online_evaluator_service.ListOnlineEvaluatorsResponse( + online_evaluators=[ + online_evaluator.OnlineEvaluator(), + online_evaluator.OnlineEvaluator(), + ], + ), + ) + # Two responses for two calls + response = response + response + + # Wrap the values into proper Response objs + response = tuple( + online_evaluator_service.ListOnlineEvaluatorsResponse.to_json(x) + for x in response + ) + return_values = tuple(Response() for i in response) + for return_val, response_val in zip(return_values, response): + return_val._content = response_val.encode("UTF-8") + return_val.status_code = 200 + req.side_effect = return_values + + sample_request = {"parent": "projects/sample1/locations/sample2"} + + pager = client.list_online_evaluators(request=sample_request) + + results = list(pager) + assert len(results) == 6 + assert all(isinstance(i, online_evaluator.OnlineEvaluator) for i in results) + + pages = list(client.list_online_evaluators(request=sample_request).pages) + for page_, token in zip(pages, ["abc", "def", "ghi", ""]): + assert page_.raw_page.next_page_token == token + + +def test_activate_online_evaluator_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.activate_online_evaluator + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.activate_online_evaluator + ] = mock_rpc + + request = {} + client.activate_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.activate_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_activate_online_evaluator_rest_required_fields( + request_type=online_evaluator_service.ActivateOnlineEvaluatorRequest, +): + transport_class = transports.OnlineEvaluatorServiceRestTransport + + request_init = {} + request_init["name"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).activate_online_evaluator._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["name"] = "name_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).activate_online_evaluator._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "name" in jsonified_request + assert jsonified_request["name"] == "name_value" + + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.activate_online_evaluator(request) + + expected_params = [("$alt", "json;enum-encoding=int")] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_activate_online_evaluator_rest_unset_required_fields(): + transport = transports.OnlineEvaluatorServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.activate_online_evaluator._get_unset_required_fields({}) + assert set(unset_fields) == (set(()) & set(("name",))) + + +def test_activate_online_evaluator_rest_flattened(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # get arguments that satisfy an http rule for this method + sample_request = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + + # get truthy value for each flattened field + mock_args = dict( + name="name_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.activate_online_evaluator(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}:activate" + % client.transport._host, + args[1], + ) + + +def test_activate_online_evaluator_rest_flattened_error(transport: str = "rest"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.activate_online_evaluator( + online_evaluator_service.ActivateOnlineEvaluatorRequest(), + name="name_value", + ) + + +def test_suspend_online_evaluator_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.suspend_online_evaluator + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.suspend_online_evaluator + ] = mock_rpc + + request = {} + client.suspend_online_evaluator(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.suspend_online_evaluator(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_suspend_online_evaluator_rest_required_fields( + request_type=online_evaluator_service.SuspendOnlineEvaluatorRequest, +): + transport_class = transports.OnlineEvaluatorServiceRestTransport + + request_init = {} + request_init["name"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).suspend_online_evaluator._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["name"] = "name_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).suspend_online_evaluator._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "name" in jsonified_request + assert jsonified_request["name"] == "name_value" + + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.suspend_online_evaluator(request) + + expected_params = [("$alt", "json;enum-encoding=int")] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_suspend_online_evaluator_rest_unset_required_fields(): + transport = transports.OnlineEvaluatorServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.suspend_online_evaluator._get_unset_required_fields({}) + assert set(unset_fields) == (set(()) & set(("name",))) + + +def test_suspend_online_evaluator_rest_flattened(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # get arguments that satisfy an http rule for this method + sample_request = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + + # get truthy value for each flattened field + mock_args = dict( + name="name_value", + ) + mock_args.update(sample_request) + + # Wrap the value into a proper Response obj + response_value = Response() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + client.suspend_online_evaluator(**mock_args) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(req.mock_calls) == 1 + _, args, _ = req.mock_calls[0] + assert path_template.validate( + "%s/v1beta1/{name=projects/*/locations/*/onlineEvaluators/*}:suspend" + % client.transport._host, + args[1], + ) + + +def test_suspend_online_evaluator_rest_flattened_error(transport: str = "rest"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.suspend_online_evaluator( + online_evaluator_service.SuspendOnlineEvaluatorRequest(), + name="name_value", + ) + + +def test_credentials_transport_error(): + # It is an error to provide credentials and a transport instance. + transport = transports.OnlineEvaluatorServiceGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # It is an error to provide a credentials file and a transport instance. + transport = transports.OnlineEvaluatorServiceGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = OnlineEvaluatorServiceClient( + client_options={"credentials_file": "credentials.json"}, + transport=transport, + ) + + # It is an error to provide an api_key and a transport instance. + transport = transports.OnlineEvaluatorServiceGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = OnlineEvaluatorServiceClient( + client_options=options, + transport=transport, + ) + + # It is an error to provide an api_key and a credential. + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = OnlineEvaluatorServiceClient( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + + # It is an error to provide scopes and a transport instance. + transport = transports.OnlineEvaluatorServiceGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = OnlineEvaluatorServiceClient( + client_options={"scopes": ["1", "2"]}, + transport=transport, + ) + + +def test_transport_instance(): + # A client may be instantiated with a custom transport instance. + transport = transports.OnlineEvaluatorServiceGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + client = OnlineEvaluatorServiceClient(transport=transport) + assert client.transport is transport + + +def test_transport_get_channel(): + # A client may be instantiated with a custom transport instance. + transport = transports.OnlineEvaluatorServiceGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + channel = transport.grpc_channel + assert channel + + transport = transports.OnlineEvaluatorServiceGrpcAsyncIOTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + channel = transport.grpc_channel + assert channel + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.OnlineEvaluatorServiceGrpcTransport, + transports.OnlineEvaluatorServiceGrpcAsyncIOTransport, + transports.OnlineEvaluatorServiceRestTransport, + ], +) +def test_transport_adc(transport_class): + # Test default credentials are used if not provided. + with mock.patch.object(google.auth, "default") as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport_class() + adc.assert_called_once() + + +def test_transport_kind_grpc(): + transport = OnlineEvaluatorServiceClient.get_transport_class("grpc")( + credentials=ga_credentials.AnonymousCredentials() + ) + assert transport.kind == "grpc" + + +def test_initialize_client_w_grpc(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc" + ) + assert client is not None + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_online_evaluator_empty_call_grpc(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.create_online_evaluator), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.create_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.CreateOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_online_evaluator_empty_call_grpc(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.get_online_evaluator), "__call__" + ) as call: + call.return_value = online_evaluator.OnlineEvaluator() + client.get_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.GetOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_online_evaluator_empty_call_grpc(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.update_online_evaluator), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.update_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.UpdateOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_online_evaluator_empty_call_grpc(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.delete_online_evaluator), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.delete_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.DeleteOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_online_evaluators_empty_call_grpc(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.list_online_evaluators), "__call__" + ) as call: + call.return_value = online_evaluator_service.ListOnlineEvaluatorsResponse() + client.list_online_evaluators(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.ListOnlineEvaluatorsRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_activate_online_evaluator_empty_call_grpc(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.activate_online_evaluator), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.activate_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.ActivateOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_suspend_online_evaluator_empty_call_grpc(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.suspend_online_evaluator), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.suspend_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.SuspendOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +def test_transport_kind_grpc_asyncio(): + transport = OnlineEvaluatorServiceAsyncClient.get_transport_class("grpc_asyncio")( + credentials=async_anonymous_credentials() + ) + assert transport.kind == "grpc_asyncio" + + +def test_initialize_client_w_grpc_asyncio(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="grpc_asyncio" + ) + assert client is not None + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_create_online_evaluator_empty_call_grpc_asyncio(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.create_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + await client.create_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.CreateOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_online_evaluator_empty_call_grpc_asyncio(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.get_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + online_evaluator.OnlineEvaluator( + name="name_value", + agent_resource="agent_resource_value", + state=online_evaluator.OnlineEvaluator.State.ACTIVE, + display_name="display_name_value", + ) + ) + await client.get_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.GetOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_online_evaluator_empty_call_grpc_asyncio(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.update_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + await client.update_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.UpdateOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_delete_online_evaluator_empty_call_grpc_asyncio(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.delete_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + await client.delete_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.DeleteOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_online_evaluators_empty_call_grpc_asyncio(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.list_online_evaluators), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + online_evaluator_service.ListOnlineEvaluatorsResponse( + next_page_token="next_page_token_value", + ) + ) + await client.list_online_evaluators(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.ListOnlineEvaluatorsRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_activate_online_evaluator_empty_call_grpc_asyncio(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.activate_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + await client.activate_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.ActivateOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_suspend_online_evaluator_empty_call_grpc_asyncio(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.suspend_online_evaluator), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + await client.suspend_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.SuspendOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +def test_transport_kind_rest(): + transport = OnlineEvaluatorServiceClient.get_transport_class("rest")( + credentials=ga_credentials.AnonymousCredentials() + ) + assert transport.kind == "rest" + + +def test_create_online_evaluator_rest_bad_request( + request_type=online_evaluator_service.CreateOnlineEvaluatorRequest, +): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"parent": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.create_online_evaluator(request) + + +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.CreateOnlineEvaluatorRequest, + dict, + ], +) +def test_create_online_evaluator_rest_call_success(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"parent": "projects/sample1/locations/sample2"} + request_init["online_evaluator"] = { + "cloud_observability": { + "trace_scope": { + "filter": [ + { + "duration": {"comparison_operator": 1, "value": 0.541}, + "total_token_usage": {}, + } + ] + }, + "open_telemetry": {"semconv_version": "semconv_version_value"}, + "log_view": "log_view_value", + "trace_view": "trace_view_value", + }, + "name": "name_value", + "agent_resource": "agent_resource_value", + "metric_sources": [ + { + "metric": { + "predefined_metric_spec": { + "metric_spec_name": "metric_spec_name_value", + "metric_spec_parameters": {"fields": {}}, + }, + "computation_based_metric_spec": {"type_": 1, "parameters": {}}, + "llm_based_metric_spec": { + "rubric_group_key": "rubric_group_key_value", + "rubric_generation_spec": { + "prompt_template": "prompt_template_value", + "model_config": { + "sampling_count": 1507, + "flip_enabled": True, + "autorater_model": "autorater_model_value", + "generation_config": { + "temperature": 0.1198, + "top_p": 0.546, + "top_k": 0.541, + "candidate_count": 1573, + "max_output_tokens": 1865, + "stop_sequences": [ + "stop_sequences_value1", + "stop_sequences_value2", + ], + "response_logprobs": True, + "logprobs": 872, + "presence_penalty": 0.1713, + "frequency_penalty": 0.18380000000000002, + "seed": 417, + "response_mime_type": "response_mime_type_value", + "response_schema": { + "type_": 1, + "format_": "format__value", + "title": "title_value", + "description": "description_value", + "nullable": True, + "default": { + "null_value": 0, + "number_value": 0.1285, + "string_value": "string_value_value", + "bool_value": True, + "struct_value": {}, + "list_value": {"values": {}}, + }, + "items": {}, + "min_items": 965, + "max_items": 967, + "enum": ["enum_value1", "enum_value2"], + "properties": {}, + "property_ordering": [ + "property_ordering_value1", + "property_ordering_value2", + ], + "required": [ + "required_value1", + "required_value2", + ], + "min_properties": 1520, + "max_properties": 1522, + "minimum": 0.764, + "maximum": 0.766, + "min_length": 1061, + "max_length": 1063, + "pattern": "pattern_value", + "example": {}, + "any_of": {}, + "additional_properties": {}, + "ref": "ref_value", + "defs": {}, + }, + "response_json_schema": {}, + "routing_config": { + "auto_mode": {"model_routing_preference": 1}, + "manual_mode": { + "model_name": "model_name_value" + }, + }, + "audio_timestamp": True, + "response_modalities": [1], + "media_resolution": 1, + "speech_config": { + "voice_config": { + "prebuilt_voice_config": { + "voice_name": "voice_name_value" + }, + "replicated_voice_config": { + "mime_type": "mime_type_value", + "voice_sample_audio": b"voice_sample_audio_blob", + }, + }, + "language_code": "language_code_value", + "multi_speaker_voice_config": { + "speaker_voice_configs": [ + { + "speaker": "speaker_value", + "voice_config": {}, + } + ] + }, + }, + "thinking_config": { + "include_thoughts": True, + "thinking_budget": 1590, + }, + "model_config": {"feature_selection_preference": 1}, + "image_config": { + "aspect_ratio": "aspect_ratio_value" + }, + }, + }, + "rubric_content_type": 1, + "rubric_type_ontology": [ + "rubric_type_ontology_value1", + "rubric_type_ontology_value2", + ], + }, + "predefined_rubric_generation_spec": {}, + "metric_prompt_template": "metric_prompt_template_value", + "system_instruction": "system_instruction_value", + "judge_autorater_config": {}, + "additional_config": {}, + "result_parser_config": { + "custom_code_parser_config": { + "parsing_function": "parsing_function_value" + } + }, + }, + "custom_code_execution_spec": { + "evaluation_function": "evaluation_function_value" + }, + "pointwise_metric_spec": { + "metric_prompt_template": "metric_prompt_template_value", + "system_instruction": "system_instruction_value", + "custom_output_format_config": {"return_raw_output": True}, + }, + "pairwise_metric_spec": { + "metric_prompt_template": "metric_prompt_template_value", + "candidate_response_field_name": "candidate_response_field_name_value", + "baseline_response_field_name": "baseline_response_field_name_value", + "system_instruction": "system_instruction_value", + "custom_output_format_config": {}, + }, + "exact_match_spec": {}, + "bleu_spec": {"use_effective_order": True}, + "rouge_spec": { + "rouge_type": "rouge_type_value", + "use_stemmer": True, + "split_summaries": True, + }, + "aggregation_metrics": [1], + "metadata": { + "title": "title_value", + "score_range": { + "min_": 0.419, + "max_": 0.421, + "step": 0.444, + "description": "description_value", + }, + "other_metadata": {}, + }, + }, + "metric_resource_name": "metric_resource_name_value", + } + ], + "config": { + "random_sampling": {"percentage": 1054}, + "max_evaluated_samples_per_run": 3086, + }, + "state": 1, + "state_details": [{"message": "message_value"}], + "create_time": {"seconds": 751, "nanos": 543}, + "update_time": {}, + "display_name": "display_name_value", + } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = online_evaluator_service.CreateOnlineEvaluatorRequest.meta.fields[ + "online_evaluator" + ] + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + # Add `# pragma: NO COVER` because there may not be any `*_pb2` field types + else: # pragma: NO COVER + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for field, value in request_init["online_evaluator"].items(): # pragma: NO COVER + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for subfield_to_delete in subfields_not_in_runtime: # pragma: NO COVER + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range(0, len(request_init["online_evaluator"][field])): + del request_init["online_evaluator"][field][i][subfield] + else: + del request_init["online_evaluator"][field][subfield] + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.create_online_evaluator(request) + + # Establish that the response is the type that we expect. + json_return_value = json_format.MessageToJson(return_value) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_create_online_evaluator_rest_interceptors(null_interceptor): + transport = transports.OnlineEvaluatorServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=( + None + if null_interceptor + else transports.OnlineEvaluatorServiceRestInterceptor() + ), + ) + client = OnlineEvaluatorServiceClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, "post_create_online_evaluator" + ) as post, mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, + "post_create_online_evaluator_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, "pre_create_online_evaluator" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = online_evaluator_service.CreateOnlineEvaluatorRequest.pb( + online_evaluator_service.CreateOnlineEvaluatorRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = json_format.MessageToJson(operations_pb2.Operation()) + req.return_value.content = return_value + + request = online_evaluator_service.CreateOnlineEvaluatorRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata + + client.create_online_evaluator( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_get_online_evaluator_rest_bad_request( + request_type=online_evaluator_service.GetOnlineEvaluatorRequest, +): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.get_online_evaluator(request) + + +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.GetOnlineEvaluatorRequest, + dict, + ], +) +def test_get_online_evaluator_rest_call_success(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = online_evaluator.OnlineEvaluator( + name="name_value", + agent_resource="agent_resource_value", + state=online_evaluator.OnlineEvaluator.State.ACTIVE, + display_name="display_name_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = online_evaluator.OnlineEvaluator.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.get_online_evaluator(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, online_evaluator.OnlineEvaluator) + assert response.name == "name_value" + assert response.agent_resource == "agent_resource_value" + assert response.state == online_evaluator.OnlineEvaluator.State.ACTIVE + assert response.display_name == "display_name_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_get_online_evaluator_rest_interceptors(null_interceptor): + transport = transports.OnlineEvaluatorServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=( + None + if null_interceptor + else transports.OnlineEvaluatorServiceRestInterceptor() + ), + ) + client = OnlineEvaluatorServiceClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, "post_get_online_evaluator" + ) as post, mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, + "post_get_online_evaluator_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, "pre_get_online_evaluator" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = online_evaluator_service.GetOnlineEvaluatorRequest.pb( + online_evaluator_service.GetOnlineEvaluatorRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = online_evaluator.OnlineEvaluator.to_json( + online_evaluator.OnlineEvaluator() + ) + req.return_value.content = return_value + + request = online_evaluator_service.GetOnlineEvaluatorRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = online_evaluator.OnlineEvaluator() + post_with_metadata.return_value = online_evaluator.OnlineEvaluator(), metadata + + client.get_online_evaluator( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_update_online_evaluator_rest_bad_request( + request_type=online_evaluator_service.UpdateOnlineEvaluatorRequest, +): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = { + "online_evaluator": { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.update_online_evaluator(request) + + +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.UpdateOnlineEvaluatorRequest, + dict, + ], +) +def test_update_online_evaluator_rest_call_success(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = { + "online_evaluator": { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + } + request_init["online_evaluator"] = { + "cloud_observability": { + "trace_scope": { + "filter": [ + { + "duration": {"comparison_operator": 1, "value": 0.541}, + "total_token_usage": {}, + } + ] + }, + "open_telemetry": {"semconv_version": "semconv_version_value"}, + "log_view": "log_view_value", + "trace_view": "trace_view_value", + }, + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3", + "agent_resource": "agent_resource_value", + "metric_sources": [ + { + "metric": { + "predefined_metric_spec": { + "metric_spec_name": "metric_spec_name_value", + "metric_spec_parameters": {"fields": {}}, + }, + "computation_based_metric_spec": {"type_": 1, "parameters": {}}, + "llm_based_metric_spec": { + "rubric_group_key": "rubric_group_key_value", + "rubric_generation_spec": { + "prompt_template": "prompt_template_value", + "model_config": { + "sampling_count": 1507, + "flip_enabled": True, + "autorater_model": "autorater_model_value", + "generation_config": { + "temperature": 0.1198, + "top_p": 0.546, + "top_k": 0.541, + "candidate_count": 1573, + "max_output_tokens": 1865, + "stop_sequences": [ + "stop_sequences_value1", + "stop_sequences_value2", + ], + "response_logprobs": True, + "logprobs": 872, + "presence_penalty": 0.1713, + "frequency_penalty": 0.18380000000000002, + "seed": 417, + "response_mime_type": "response_mime_type_value", + "response_schema": { + "type_": 1, + "format_": "format__value", + "title": "title_value", + "description": "description_value", + "nullable": True, + "default": { + "null_value": 0, + "number_value": 0.1285, + "string_value": "string_value_value", + "bool_value": True, + "struct_value": {}, + "list_value": {"values": {}}, + }, + "items": {}, + "min_items": 965, + "max_items": 967, + "enum": ["enum_value1", "enum_value2"], + "properties": {}, + "property_ordering": [ + "property_ordering_value1", + "property_ordering_value2", + ], + "required": [ + "required_value1", + "required_value2", + ], + "min_properties": 1520, + "max_properties": 1522, + "minimum": 0.764, + "maximum": 0.766, + "min_length": 1061, + "max_length": 1063, + "pattern": "pattern_value", + "example": {}, + "any_of": {}, + "additional_properties": {}, + "ref": "ref_value", + "defs": {}, + }, + "response_json_schema": {}, + "routing_config": { + "auto_mode": {"model_routing_preference": 1}, + "manual_mode": { + "model_name": "model_name_value" + }, + }, + "audio_timestamp": True, + "response_modalities": [1], + "media_resolution": 1, + "speech_config": { + "voice_config": { + "prebuilt_voice_config": { + "voice_name": "voice_name_value" + }, + "replicated_voice_config": { + "mime_type": "mime_type_value", + "voice_sample_audio": b"voice_sample_audio_blob", + }, + }, + "language_code": "language_code_value", + "multi_speaker_voice_config": { + "speaker_voice_configs": [ + { + "speaker": "speaker_value", + "voice_config": {}, + } + ] + }, + }, + "thinking_config": { + "include_thoughts": True, + "thinking_budget": 1590, + }, + "model_config": {"feature_selection_preference": 1}, + "image_config": { + "aspect_ratio": "aspect_ratio_value" + }, + }, + }, + "rubric_content_type": 1, + "rubric_type_ontology": [ + "rubric_type_ontology_value1", + "rubric_type_ontology_value2", + ], + }, + "predefined_rubric_generation_spec": {}, + "metric_prompt_template": "metric_prompt_template_value", + "system_instruction": "system_instruction_value", + "judge_autorater_config": {}, + "additional_config": {}, + "result_parser_config": { + "custom_code_parser_config": { + "parsing_function": "parsing_function_value" + } + }, + }, + "custom_code_execution_spec": { + "evaluation_function": "evaluation_function_value" + }, + "pointwise_metric_spec": { + "metric_prompt_template": "metric_prompt_template_value", + "system_instruction": "system_instruction_value", + "custom_output_format_config": {"return_raw_output": True}, + }, + "pairwise_metric_spec": { + "metric_prompt_template": "metric_prompt_template_value", + "candidate_response_field_name": "candidate_response_field_name_value", + "baseline_response_field_name": "baseline_response_field_name_value", + "system_instruction": "system_instruction_value", + "custom_output_format_config": {}, + }, + "exact_match_spec": {}, + "bleu_spec": {"use_effective_order": True}, + "rouge_spec": { + "rouge_type": "rouge_type_value", + "use_stemmer": True, + "split_summaries": True, + }, + "aggregation_metrics": [1], + "metadata": { + "title": "title_value", + "score_range": { + "min_": 0.419, + "max_": 0.421, + "step": 0.444, + "description": "description_value", + }, + "other_metadata": {}, + }, + }, + "metric_resource_name": "metric_resource_name_value", + } + ], + "config": { + "random_sampling": {"percentage": 1054}, + "max_evaluated_samples_per_run": 3086, + }, + "state": 1, + "state_details": [{"message": "message_value"}], + "create_time": {"seconds": 751, "nanos": 543}, + "update_time": {}, + "display_name": "display_name_value", + } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = online_evaluator_service.UpdateOnlineEvaluatorRequest.meta.fields[ + "online_evaluator" + ] + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + # Add `# pragma: NO COVER` because there may not be any `*_pb2` field types + else: # pragma: NO COVER + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for field, value in request_init["online_evaluator"].items(): # pragma: NO COVER + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for subfield_to_delete in subfields_not_in_runtime: # pragma: NO COVER + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range(0, len(request_init["online_evaluator"][field])): + del request_init["online_evaluator"][field][i][subfield] + else: + del request_init["online_evaluator"][field][subfield] + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.update_online_evaluator(request) + + # Establish that the response is the type that we expect. + json_return_value = json_format.MessageToJson(return_value) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_update_online_evaluator_rest_interceptors(null_interceptor): + transport = transports.OnlineEvaluatorServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=( + None + if null_interceptor + else transports.OnlineEvaluatorServiceRestInterceptor() + ), + ) + client = OnlineEvaluatorServiceClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, "post_update_online_evaluator" + ) as post, mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, + "post_update_online_evaluator_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, "pre_update_online_evaluator" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = online_evaluator_service.UpdateOnlineEvaluatorRequest.pb( + online_evaluator_service.UpdateOnlineEvaluatorRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = json_format.MessageToJson(operations_pb2.Operation()) + req.return_value.content = return_value + + request = online_evaluator_service.UpdateOnlineEvaluatorRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata + + client.update_online_evaluator( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_delete_online_evaluator_rest_bad_request( + request_type=online_evaluator_service.DeleteOnlineEvaluatorRequest, +): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.delete_online_evaluator(request) + + +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.DeleteOnlineEvaluatorRequest, + dict, + ], +) +def test_delete_online_evaluator_rest_call_success(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.delete_online_evaluator(request) + + # Establish that the response is the type that we expect. + json_return_value = json_format.MessageToJson(return_value) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_delete_online_evaluator_rest_interceptors(null_interceptor): + transport = transports.OnlineEvaluatorServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=( + None + if null_interceptor + else transports.OnlineEvaluatorServiceRestInterceptor() + ), + ) + client = OnlineEvaluatorServiceClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, "post_delete_online_evaluator" + ) as post, mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, + "post_delete_online_evaluator_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, "pre_delete_online_evaluator" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = online_evaluator_service.DeleteOnlineEvaluatorRequest.pb( + online_evaluator_service.DeleteOnlineEvaluatorRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = json_format.MessageToJson(operations_pb2.Operation()) + req.return_value.content = return_value + + request = online_evaluator_service.DeleteOnlineEvaluatorRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata + + client.delete_online_evaluator( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_list_online_evaluators_rest_bad_request( + request_type=online_evaluator_service.ListOnlineEvaluatorsRequest, +): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = {"parent": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.list_online_evaluators(request) + + +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.ListOnlineEvaluatorsRequest, + dict, + ], +) +def test_list_online_evaluators_rest_call_success(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = {"parent": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = online_evaluator_service.ListOnlineEvaluatorsResponse( + next_page_token="next_page_token_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = online_evaluator_service.ListOnlineEvaluatorsResponse.pb( + return_value + ) + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.list_online_evaluators(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListOnlineEvaluatorsPager) + assert response.next_page_token == "next_page_token_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_list_online_evaluators_rest_interceptors(null_interceptor): + transport = transports.OnlineEvaluatorServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=( + None + if null_interceptor + else transports.OnlineEvaluatorServiceRestInterceptor() + ), + ) + client = OnlineEvaluatorServiceClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, "post_list_online_evaluators" + ) as post, mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, + "post_list_online_evaluators_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, "pre_list_online_evaluators" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = online_evaluator_service.ListOnlineEvaluatorsRequest.pb( + online_evaluator_service.ListOnlineEvaluatorsRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = online_evaluator_service.ListOnlineEvaluatorsResponse.to_json( + online_evaluator_service.ListOnlineEvaluatorsResponse() + ) + req.return_value.content = return_value + + request = online_evaluator_service.ListOnlineEvaluatorsRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = online_evaluator_service.ListOnlineEvaluatorsResponse() + post_with_metadata.return_value = ( + online_evaluator_service.ListOnlineEvaluatorsResponse(), + metadata, + ) + + client.list_online_evaluators( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_activate_online_evaluator_rest_bad_request( + request_type=online_evaluator_service.ActivateOnlineEvaluatorRequest, +): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.activate_online_evaluator(request) + + +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.ActivateOnlineEvaluatorRequest, + dict, + ], +) +def test_activate_online_evaluator_rest_call_success(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.activate_online_evaluator(request) + + # Establish that the response is the type that we expect. + json_return_value = json_format.MessageToJson(return_value) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_activate_online_evaluator_rest_interceptors(null_interceptor): + transport = transports.OnlineEvaluatorServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=( + None + if null_interceptor + else transports.OnlineEvaluatorServiceRestInterceptor() + ), + ) + client = OnlineEvaluatorServiceClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, + "post_activate_online_evaluator", + ) as post, mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, + "post_activate_online_evaluator_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, + "pre_activate_online_evaluator", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = online_evaluator_service.ActivateOnlineEvaluatorRequest.pb( + online_evaluator_service.ActivateOnlineEvaluatorRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = json_format.MessageToJson(operations_pb2.Operation()) + req.return_value.content = return_value + + request = online_evaluator_service.ActivateOnlineEvaluatorRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata + + client.activate_online_evaluator( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_suspend_online_evaluator_rest_bad_request( + request_type=online_evaluator_service.SuspendOnlineEvaluatorRequest, +): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.suspend_online_evaluator(request) + + +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.SuspendOnlineEvaluatorRequest, + dict, + ], +) +def test_suspend_online_evaluator_rest_call_success(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.suspend_online_evaluator(request) + + # Establish that the response is the type that we expect. + json_return_value = json_format.MessageToJson(return_value) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_suspend_online_evaluator_rest_interceptors(null_interceptor): + transport = transports.OnlineEvaluatorServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=( + None + if null_interceptor + else transports.OnlineEvaluatorServiceRestInterceptor() + ), + ) + client = OnlineEvaluatorServiceClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, + "post_suspend_online_evaluator", + ) as post, mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, + "post_suspend_online_evaluator_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.OnlineEvaluatorServiceRestInterceptor, "pre_suspend_online_evaluator" + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = online_evaluator_service.SuspendOnlineEvaluatorRequest.pb( + online_evaluator_service.SuspendOnlineEvaluatorRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = json_format.MessageToJson(operations_pb2.Operation()) + req.return_value.content = return_value + + request = online_evaluator_service.SuspendOnlineEvaluatorRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata + + client.suspend_online_evaluator( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_get_location_rest_bad_request(request_type=locations_pb2.GetLocationRequest): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type() + request = json_format.ParseDict( + {"name": "projects/sample1/locations/sample2"}, request + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = Response() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.get_location(request) + + +@pytest.mark.parametrize( + "request_type", + [ + locations_pb2.GetLocationRequest, + dict, + ], +) +def test_get_location_rest(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + request_init = {"name": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # Designate an appropriate value for the returned response. + return_value = locations_pb2.Location() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.get_location(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, locations_pb2.Location) + + +def test_list_locations_rest_bad_request( + request_type=locations_pb2.ListLocationsRequest, +): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type() + request = json_format.ParseDict({"name": "projects/sample1"}, request) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = Response() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.list_locations(request) + + +@pytest.mark.parametrize( + "request_type", + [ + locations_pb2.ListLocationsRequest, + dict, + ], +) +def test_list_locations_rest(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + request_init = {"name": "projects/sample1"} + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # Designate an appropriate value for the returned response. + return_value = locations_pb2.ListLocationsResponse() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.list_locations(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, locations_pb2.ListLocationsResponse) + + +def test_get_iam_policy_rest_bad_request( + request_type=iam_policy_pb2.GetIamPolicyRequest, +): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type() + request = json_format.ParseDict( + {"resource": "projects/sample1/locations/sample2/featurestores/sample3"}, + request, + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = Response() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.get_iam_policy(request) + + +@pytest.mark.parametrize( + "request_type", + [ + iam_policy_pb2.GetIamPolicyRequest, + dict, + ], +) +def test_get_iam_policy_rest(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + request_init = { + "resource": "projects/sample1/locations/sample2/featurestores/sample3" + } + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # Designate an appropriate value for the returned response. + return_value = policy_pb2.Policy() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.get_iam_policy(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, policy_pb2.Policy) + + +def test_set_iam_policy_rest_bad_request( + request_type=iam_policy_pb2.SetIamPolicyRequest, +): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type() + request = json_format.ParseDict( + {"resource": "projects/sample1/locations/sample2/featurestores/sample3"}, + request, + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = Response() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.set_iam_policy(request) + + +@pytest.mark.parametrize( + "request_type", + [ + iam_policy_pb2.SetIamPolicyRequest, + dict, + ], +) +def test_set_iam_policy_rest(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + request_init = { + "resource": "projects/sample1/locations/sample2/featurestores/sample3" + } + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # Designate an appropriate value for the returned response. + return_value = policy_pb2.Policy() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.set_iam_policy(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, policy_pb2.Policy) + + +def test_test_iam_permissions_rest_bad_request( + request_type=iam_policy_pb2.TestIamPermissionsRequest, +): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type() + request = json_format.ParseDict( + {"resource": "projects/sample1/locations/sample2/featurestores/sample3"}, + request, + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = Response() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.test_iam_permissions(request) + + +@pytest.mark.parametrize( + "request_type", + [ + iam_policy_pb2.TestIamPermissionsRequest, + dict, + ], +) +def test_test_iam_permissions_rest(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + request_init = { + "resource": "projects/sample1/locations/sample2/featurestores/sample3" + } + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # Designate an appropriate value for the returned response. + return_value = iam_policy_pb2.TestIamPermissionsResponse() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.test_iam_permissions(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, iam_policy_pb2.TestIamPermissionsResponse) + + +def test_cancel_operation_rest_bad_request( + request_type=operations_pb2.CancelOperationRequest, +): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type() + request = json_format.ParseDict( + {"name": "projects/sample1/locations/sample2/operations/sample3"}, request + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = Response() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.cancel_operation(request) + + +@pytest.mark.parametrize( + "request_type", + [ + operations_pb2.CancelOperationRequest, + dict, + ], +) +def test_cancel_operation_rest(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # Designate an appropriate value for the returned response. + return_value = None + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = "{}" + response_value.content = json_return_value.encode("UTF-8") + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.cancel_operation(request) + + # Establish that the response is the type that we expect. + assert response is None + + +def test_delete_operation_rest_bad_request( + request_type=operations_pb2.DeleteOperationRequest, +): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type() + request = json_format.ParseDict( + {"name": "projects/sample1/locations/sample2/operations/sample3"}, request + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = Response() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.delete_operation(request) + + +@pytest.mark.parametrize( + "request_type", + [ + operations_pb2.DeleteOperationRequest, + dict, + ], +) +def test_delete_operation_rest(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # Designate an appropriate value for the returned response. + return_value = None + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = "{}" + response_value.content = json_return_value.encode("UTF-8") + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.delete_operation(request) + + # Establish that the response is the type that we expect. + assert response is None + + +def test_get_operation_rest_bad_request( + request_type=operations_pb2.GetOperationRequest, +): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type() + request = json_format.ParseDict( + {"name": "projects/sample1/locations/sample2/operations/sample3"}, request + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = Response() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.get_operation(request) + + +@pytest.mark.parametrize( + "request_type", + [ + operations_pb2.GetOperationRequest, + dict, + ], +) +def test_get_operation_rest(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.get_operation(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, operations_pb2.Operation) + + +def test_list_operations_rest_bad_request( + request_type=operations_pb2.ListOperationsRequest, +): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type() + request = json_format.ParseDict( + {"name": "projects/sample1/locations/sample2"}, request + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = Response() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.list_operations(request) + + +@pytest.mark.parametrize( + "request_type", + [ + operations_pb2.ListOperationsRequest, + dict, + ], +) +def test_list_operations_rest(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + request_init = {"name": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.ListOperationsResponse() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.list_operations(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, operations_pb2.ListOperationsResponse) + + +def test_wait_operation_rest_bad_request( + request_type=operations_pb2.WaitOperationRequest, +): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type() + request = json_format.ParseDict( + {"name": "projects/sample1/locations/sample2/operations/sample3"}, request + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = Response() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = Request() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.wait_operation(request) + + +@pytest.mark.parametrize( + "request_type", + [ + operations_pb2.WaitOperationRequest, + dict, + ], +) +def test_wait_operation_rest(request_type): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.content = json_return_value.encode("UTF-8") + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.wait_operation(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, operations_pb2.Operation) + + +def test_initialize_client_w_rest(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + assert client is not None + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_create_online_evaluator_empty_call_rest(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.create_online_evaluator), "__call__" + ) as call: + client.create_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.CreateOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_get_online_evaluator_empty_call_rest(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.get_online_evaluator), "__call__" + ) as call: + client.get_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.GetOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_update_online_evaluator_empty_call_rest(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.update_online_evaluator), "__call__" + ) as call: + client.update_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.UpdateOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_delete_online_evaluator_empty_call_rest(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.delete_online_evaluator), "__call__" + ) as call: + client.delete_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.DeleteOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_list_online_evaluators_empty_call_rest(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.list_online_evaluators), "__call__" + ) as call: + client.list_online_evaluators(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.ListOnlineEvaluatorsRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_activate_online_evaluator_empty_call_rest(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.activate_online_evaluator), "__call__" + ) as call: + client.activate_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.ActivateOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_suspend_online_evaluator_empty_call_rest(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.suspend_online_evaluator), "__call__" + ) as call: + client.suspend_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.SuspendOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +def test_online_evaluator_service_rest_lro_client(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + transport = client.transport + + # Ensure that we have an api-core operations client. + assert isinstance( + transport.operations_client, + operations_v1.AbstractOperationsClient, + ) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + +def test_transport_kind_rest_asyncio(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + transport = OnlineEvaluatorServiceAsyncClient.get_transport_class("rest_asyncio")( + credentials=async_anonymous_credentials() + ) + assert transport.kind == "rest_asyncio" + + +@pytest.mark.asyncio +async def test_create_online_evaluator_rest_asyncio_bad_request( + request_type=online_evaluator_service.CreateOnlineEvaluatorRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + # send a request that will satisfy transcoding + request_init = {"parent": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.create_online_evaluator(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.CreateOnlineEvaluatorRequest, + dict, + ], +) +async def test_create_online_evaluator_rest_asyncio_call_success(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + + # send a request that will satisfy transcoding + request_init = {"parent": "projects/sample1/locations/sample2"} + request_init["online_evaluator"] = { + "cloud_observability": { + "trace_scope": { + "filter": [ + { + "duration": {"comparison_operator": 1, "value": 0.541}, + "total_token_usage": {}, + } + ] + }, + "open_telemetry": {"semconv_version": "semconv_version_value"}, + "log_view": "log_view_value", + "trace_view": "trace_view_value", + }, + "name": "name_value", + "agent_resource": "agent_resource_value", + "metric_sources": [ + { + "metric": { + "predefined_metric_spec": { + "metric_spec_name": "metric_spec_name_value", + "metric_spec_parameters": {"fields": {}}, + }, + "computation_based_metric_spec": {"type_": 1, "parameters": {}}, + "llm_based_metric_spec": { + "rubric_group_key": "rubric_group_key_value", + "rubric_generation_spec": { + "prompt_template": "prompt_template_value", + "model_config": { + "sampling_count": 1507, + "flip_enabled": True, + "autorater_model": "autorater_model_value", + "generation_config": { + "temperature": 0.1198, + "top_p": 0.546, + "top_k": 0.541, + "candidate_count": 1573, + "max_output_tokens": 1865, + "stop_sequences": [ + "stop_sequences_value1", + "stop_sequences_value2", + ], + "response_logprobs": True, + "logprobs": 872, + "presence_penalty": 0.1713, + "frequency_penalty": 0.18380000000000002, + "seed": 417, + "response_mime_type": "response_mime_type_value", + "response_schema": { + "type_": 1, + "format_": "format__value", + "title": "title_value", + "description": "description_value", + "nullable": True, + "default": { + "null_value": 0, + "number_value": 0.1285, + "string_value": "string_value_value", + "bool_value": True, + "struct_value": {}, + "list_value": {"values": {}}, + }, + "items": {}, + "min_items": 965, + "max_items": 967, + "enum": ["enum_value1", "enum_value2"], + "properties": {}, + "property_ordering": [ + "property_ordering_value1", + "property_ordering_value2", + ], + "required": [ + "required_value1", + "required_value2", + ], + "min_properties": 1520, + "max_properties": 1522, + "minimum": 0.764, + "maximum": 0.766, + "min_length": 1061, + "max_length": 1063, + "pattern": "pattern_value", + "example": {}, + "any_of": {}, + "additional_properties": {}, + "ref": "ref_value", + "defs": {}, + }, + "response_json_schema": {}, + "routing_config": { + "auto_mode": {"model_routing_preference": 1}, + "manual_mode": { + "model_name": "model_name_value" + }, + }, + "audio_timestamp": True, + "response_modalities": [1], + "media_resolution": 1, + "speech_config": { + "voice_config": { + "prebuilt_voice_config": { + "voice_name": "voice_name_value" + }, + "replicated_voice_config": { + "mime_type": "mime_type_value", + "voice_sample_audio": b"voice_sample_audio_blob", + }, + }, + "language_code": "language_code_value", + "multi_speaker_voice_config": { + "speaker_voice_configs": [ + { + "speaker": "speaker_value", + "voice_config": {}, + } + ] + }, + }, + "thinking_config": { + "include_thoughts": True, + "thinking_budget": 1590, + }, + "model_config": {"feature_selection_preference": 1}, + "image_config": { + "aspect_ratio": "aspect_ratio_value" + }, + }, + }, + "rubric_content_type": 1, + "rubric_type_ontology": [ + "rubric_type_ontology_value1", + "rubric_type_ontology_value2", + ], + }, + "predefined_rubric_generation_spec": {}, + "metric_prompt_template": "metric_prompt_template_value", + "system_instruction": "system_instruction_value", + "judge_autorater_config": {}, + "additional_config": {}, + "result_parser_config": { + "custom_code_parser_config": { + "parsing_function": "parsing_function_value" + } + }, + }, + "custom_code_execution_spec": { + "evaluation_function": "evaluation_function_value" + }, + "pointwise_metric_spec": { + "metric_prompt_template": "metric_prompt_template_value", + "system_instruction": "system_instruction_value", + "custom_output_format_config": {"return_raw_output": True}, + }, + "pairwise_metric_spec": { + "metric_prompt_template": "metric_prompt_template_value", + "candidate_response_field_name": "candidate_response_field_name_value", + "baseline_response_field_name": "baseline_response_field_name_value", + "system_instruction": "system_instruction_value", + "custom_output_format_config": {}, + }, + "exact_match_spec": {}, + "bleu_spec": {"use_effective_order": True}, + "rouge_spec": { + "rouge_type": "rouge_type_value", + "use_stemmer": True, + "split_summaries": True, + }, + "aggregation_metrics": [1], + "metadata": { + "title": "title_value", + "score_range": { + "min_": 0.419, + "max_": 0.421, + "step": 0.444, + "description": "description_value", + }, + "other_metadata": {}, + }, + }, + "metric_resource_name": "metric_resource_name_value", + } + ], + "config": { + "random_sampling": {"percentage": 1054}, + "max_evaluated_samples_per_run": 3086, + }, + "state": 1, + "state_details": [{"message": "message_value"}], + "create_time": {"seconds": 751, "nanos": 543}, + "update_time": {}, + "display_name": "display_name_value", + } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = online_evaluator_service.CreateOnlineEvaluatorRequest.meta.fields[ + "online_evaluator" + ] + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + # Add `# pragma: NO COVER` because there may not be any `*_pb2` field types + else: # pragma: NO COVER + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for field, value in request_init["online_evaluator"].items(): # pragma: NO COVER + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for subfield_to_delete in subfields_not_in_runtime: # pragma: NO COVER + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range(0, len(request_init["online_evaluator"][field])): + del request_init["online_evaluator"][field][i][subfield] + else: + del request_init["online_evaluator"][field][subfield] + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = await client.create_online_evaluator(request) + + # Establish that the response is the type that we expect. + json_return_value = json_format.MessageToJson(return_value) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("null_interceptor", [True, False]) +async def test_create_online_evaluator_rest_asyncio_interceptors(null_interceptor): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + transport = transports.AsyncOnlineEvaluatorServiceRestTransport( + credentials=async_anonymous_credentials(), + interceptor=( + None + if null_interceptor + else transports.AsyncOnlineEvaluatorServiceRestInterceptor() + ), + ) + client = OnlineEvaluatorServiceAsyncClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "post_create_online_evaluator", + ) as post, mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "post_create_online_evaluator_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "pre_create_online_evaluator", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = online_evaluator_service.CreateOnlineEvaluatorRequest.pb( + online_evaluator_service.CreateOnlineEvaluatorRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = json_format.MessageToJson(operations_pb2.Operation()) + req.return_value.read = mock.AsyncMock(return_value=return_value) + + request = online_evaluator_service.CreateOnlineEvaluatorRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata + + await client.create_online_evaluator( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +@pytest.mark.asyncio +async def test_get_online_evaluator_rest_asyncio_bad_request( + request_type=online_evaluator_service.GetOnlineEvaluatorRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.get_online_evaluator(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.GetOnlineEvaluatorRequest, + dict, + ], +) +async def test_get_online_evaluator_rest_asyncio_call_success(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = online_evaluator.OnlineEvaluator( + name="name_value", + agent_resource="agent_resource_value", + state=online_evaluator.OnlineEvaluator.State.ACTIVE, + display_name="display_name_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = online_evaluator.OnlineEvaluator.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = await client.get_online_evaluator(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, online_evaluator.OnlineEvaluator) + assert response.name == "name_value" + assert response.agent_resource == "agent_resource_value" + assert response.state == online_evaluator.OnlineEvaluator.State.ACTIVE + assert response.display_name == "display_name_value" + + +@pytest.mark.asyncio +@pytest.mark.parametrize("null_interceptor", [True, False]) +async def test_get_online_evaluator_rest_asyncio_interceptors(null_interceptor): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + transport = transports.AsyncOnlineEvaluatorServiceRestTransport( + credentials=async_anonymous_credentials(), + interceptor=( + None + if null_interceptor + else transports.AsyncOnlineEvaluatorServiceRestInterceptor() + ), + ) + client = OnlineEvaluatorServiceAsyncClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "post_get_online_evaluator", + ) as post, mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "post_get_online_evaluator_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "pre_get_online_evaluator", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = online_evaluator_service.GetOnlineEvaluatorRequest.pb( + online_evaluator_service.GetOnlineEvaluatorRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = online_evaluator.OnlineEvaluator.to_json( + online_evaluator.OnlineEvaluator() + ) + req.return_value.read = mock.AsyncMock(return_value=return_value) + + request = online_evaluator_service.GetOnlineEvaluatorRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = online_evaluator.OnlineEvaluator() + post_with_metadata.return_value = online_evaluator.OnlineEvaluator(), metadata + + await client.get_online_evaluator( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +@pytest.mark.asyncio +async def test_update_online_evaluator_rest_asyncio_bad_request( + request_type=online_evaluator_service.UpdateOnlineEvaluatorRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + # send a request that will satisfy transcoding + request_init = { + "online_evaluator": { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.update_online_evaluator(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.UpdateOnlineEvaluatorRequest, + dict, + ], +) +async def test_update_online_evaluator_rest_asyncio_call_success(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + + # send a request that will satisfy transcoding + request_init = { + "online_evaluator": { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + } + request_init["online_evaluator"] = { + "cloud_observability": { + "trace_scope": { + "filter": [ + { + "duration": {"comparison_operator": 1, "value": 0.541}, + "total_token_usage": {}, + } + ] + }, + "open_telemetry": {"semconv_version": "semconv_version_value"}, + "log_view": "log_view_value", + "trace_view": "trace_view_value", + }, + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3", + "agent_resource": "agent_resource_value", + "metric_sources": [ + { + "metric": { + "predefined_metric_spec": { + "metric_spec_name": "metric_spec_name_value", + "metric_spec_parameters": {"fields": {}}, + }, + "computation_based_metric_spec": {"type_": 1, "parameters": {}}, + "llm_based_metric_spec": { + "rubric_group_key": "rubric_group_key_value", + "rubric_generation_spec": { + "prompt_template": "prompt_template_value", + "model_config": { + "sampling_count": 1507, + "flip_enabled": True, + "autorater_model": "autorater_model_value", + "generation_config": { + "temperature": 0.1198, + "top_p": 0.546, + "top_k": 0.541, + "candidate_count": 1573, + "max_output_tokens": 1865, + "stop_sequences": [ + "stop_sequences_value1", + "stop_sequences_value2", + ], + "response_logprobs": True, + "logprobs": 872, + "presence_penalty": 0.1713, + "frequency_penalty": 0.18380000000000002, + "seed": 417, + "response_mime_type": "response_mime_type_value", + "response_schema": { + "type_": 1, + "format_": "format__value", + "title": "title_value", + "description": "description_value", + "nullable": True, + "default": { + "null_value": 0, + "number_value": 0.1285, + "string_value": "string_value_value", + "bool_value": True, + "struct_value": {}, + "list_value": {"values": {}}, + }, + "items": {}, + "min_items": 965, + "max_items": 967, + "enum": ["enum_value1", "enum_value2"], + "properties": {}, + "property_ordering": [ + "property_ordering_value1", + "property_ordering_value2", + ], + "required": [ + "required_value1", + "required_value2", + ], + "min_properties": 1520, + "max_properties": 1522, + "minimum": 0.764, + "maximum": 0.766, + "min_length": 1061, + "max_length": 1063, + "pattern": "pattern_value", + "example": {}, + "any_of": {}, + "additional_properties": {}, + "ref": "ref_value", + "defs": {}, + }, + "response_json_schema": {}, + "routing_config": { + "auto_mode": {"model_routing_preference": 1}, + "manual_mode": { + "model_name": "model_name_value" + }, + }, + "audio_timestamp": True, + "response_modalities": [1], + "media_resolution": 1, + "speech_config": { + "voice_config": { + "prebuilt_voice_config": { + "voice_name": "voice_name_value" + }, + "replicated_voice_config": { + "mime_type": "mime_type_value", + "voice_sample_audio": b"voice_sample_audio_blob", + }, + }, + "language_code": "language_code_value", + "multi_speaker_voice_config": { + "speaker_voice_configs": [ + { + "speaker": "speaker_value", + "voice_config": {}, + } + ] + }, + }, + "thinking_config": { + "include_thoughts": True, + "thinking_budget": 1590, + }, + "model_config": {"feature_selection_preference": 1}, + "image_config": { + "aspect_ratio": "aspect_ratio_value" + }, + }, + }, + "rubric_content_type": 1, + "rubric_type_ontology": [ + "rubric_type_ontology_value1", + "rubric_type_ontology_value2", + ], + }, + "predefined_rubric_generation_spec": {}, + "metric_prompt_template": "metric_prompt_template_value", + "system_instruction": "system_instruction_value", + "judge_autorater_config": {}, + "additional_config": {}, + "result_parser_config": { + "custom_code_parser_config": { + "parsing_function": "parsing_function_value" + } + }, + }, + "custom_code_execution_spec": { + "evaluation_function": "evaluation_function_value" + }, + "pointwise_metric_spec": { + "metric_prompt_template": "metric_prompt_template_value", + "system_instruction": "system_instruction_value", + "custom_output_format_config": {"return_raw_output": True}, + }, + "pairwise_metric_spec": { + "metric_prompt_template": "metric_prompt_template_value", + "candidate_response_field_name": "candidate_response_field_name_value", + "baseline_response_field_name": "baseline_response_field_name_value", + "system_instruction": "system_instruction_value", + "custom_output_format_config": {}, + }, + "exact_match_spec": {}, + "bleu_spec": {"use_effective_order": True}, + "rouge_spec": { + "rouge_type": "rouge_type_value", + "use_stemmer": True, + "split_summaries": True, + }, + "aggregation_metrics": [1], + "metadata": { + "title": "title_value", + "score_range": { + "min_": 0.419, + "max_": 0.421, + "step": 0.444, + "description": "description_value", + }, + "other_metadata": {}, + }, + }, + "metric_resource_name": "metric_resource_name_value", + } + ], + "config": { + "random_sampling": {"percentage": 1054}, + "max_evaluated_samples_per_run": 3086, + }, + "state": 1, + "state_details": [{"message": "message_value"}], + "create_time": {"seconds": 751, "nanos": 543}, + "update_time": {}, + "display_name": "display_name_value", + } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = online_evaluator_service.UpdateOnlineEvaluatorRequest.meta.fields[ + "online_evaluator" + ] + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + # Add `# pragma: NO COVER` because there may not be any `*_pb2` field types + else: # pragma: NO COVER + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for field, value in request_init["online_evaluator"].items(): # pragma: NO COVER + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + # Add `# pragma: NO COVER` because this test code will not run if all subfields are present at runtime + for subfield_to_delete in subfields_not_in_runtime: # pragma: NO COVER + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range(0, len(request_init["online_evaluator"][field])): + del request_init["online_evaluator"][field][i][subfield] + else: + del request_init["online_evaluator"][field][subfield] + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = await client.update_online_evaluator(request) + + # Establish that the response is the type that we expect. + json_return_value = json_format.MessageToJson(return_value) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("null_interceptor", [True, False]) +async def test_update_online_evaluator_rest_asyncio_interceptors(null_interceptor): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + transport = transports.AsyncOnlineEvaluatorServiceRestTransport( + credentials=async_anonymous_credentials(), + interceptor=( + None + if null_interceptor + else transports.AsyncOnlineEvaluatorServiceRestInterceptor() + ), + ) + client = OnlineEvaluatorServiceAsyncClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "post_update_online_evaluator", + ) as post, mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "post_update_online_evaluator_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "pre_update_online_evaluator", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = online_evaluator_service.UpdateOnlineEvaluatorRequest.pb( + online_evaluator_service.UpdateOnlineEvaluatorRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = json_format.MessageToJson(operations_pb2.Operation()) + req.return_value.read = mock.AsyncMock(return_value=return_value) + + request = online_evaluator_service.UpdateOnlineEvaluatorRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata + + await client.update_online_evaluator( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +@pytest.mark.asyncio +async def test_delete_online_evaluator_rest_asyncio_bad_request( + request_type=online_evaluator_service.DeleteOnlineEvaluatorRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.delete_online_evaluator(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.DeleteOnlineEvaluatorRequest, + dict, + ], +) +async def test_delete_online_evaluator_rest_asyncio_call_success(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = await client.delete_online_evaluator(request) + + # Establish that the response is the type that we expect. + json_return_value = json_format.MessageToJson(return_value) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("null_interceptor", [True, False]) +async def test_delete_online_evaluator_rest_asyncio_interceptors(null_interceptor): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + transport = transports.AsyncOnlineEvaluatorServiceRestTransport( + credentials=async_anonymous_credentials(), + interceptor=( + None + if null_interceptor + else transports.AsyncOnlineEvaluatorServiceRestInterceptor() + ), + ) + client = OnlineEvaluatorServiceAsyncClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "post_delete_online_evaluator", + ) as post, mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "post_delete_online_evaluator_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "pre_delete_online_evaluator", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = online_evaluator_service.DeleteOnlineEvaluatorRequest.pb( + online_evaluator_service.DeleteOnlineEvaluatorRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = json_format.MessageToJson(operations_pb2.Operation()) + req.return_value.read = mock.AsyncMock(return_value=return_value) + + request = online_evaluator_service.DeleteOnlineEvaluatorRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata + + await client.delete_online_evaluator( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +@pytest.mark.asyncio +async def test_list_online_evaluators_rest_asyncio_bad_request( + request_type=online_evaluator_service.ListOnlineEvaluatorsRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + # send a request that will satisfy transcoding + request_init = {"parent": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.list_online_evaluators(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.ListOnlineEvaluatorsRequest, + dict, + ], +) +async def test_list_online_evaluators_rest_asyncio_call_success(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + + # send a request that will satisfy transcoding + request_init = {"parent": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = online_evaluator_service.ListOnlineEvaluatorsResponse( + next_page_token="next_page_token_value", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = online_evaluator_service.ListOnlineEvaluatorsResponse.pb( + return_value + ) + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = await client.list_online_evaluators(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListOnlineEvaluatorsAsyncPager) + assert response.next_page_token == "next_page_token_value" + + +@pytest.mark.asyncio +@pytest.mark.parametrize("null_interceptor", [True, False]) +async def test_list_online_evaluators_rest_asyncio_interceptors(null_interceptor): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + transport = transports.AsyncOnlineEvaluatorServiceRestTransport( + credentials=async_anonymous_credentials(), + interceptor=( + None + if null_interceptor + else transports.AsyncOnlineEvaluatorServiceRestInterceptor() + ), + ) + client = OnlineEvaluatorServiceAsyncClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "post_list_online_evaluators", + ) as post, mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "post_list_online_evaluators_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "pre_list_online_evaluators", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = online_evaluator_service.ListOnlineEvaluatorsRequest.pb( + online_evaluator_service.ListOnlineEvaluatorsRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = online_evaluator_service.ListOnlineEvaluatorsResponse.to_json( + online_evaluator_service.ListOnlineEvaluatorsResponse() + ) + req.return_value.read = mock.AsyncMock(return_value=return_value) + + request = online_evaluator_service.ListOnlineEvaluatorsRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = online_evaluator_service.ListOnlineEvaluatorsResponse() + post_with_metadata.return_value = ( + online_evaluator_service.ListOnlineEvaluatorsResponse(), + metadata, + ) + + await client.list_online_evaluators( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +@pytest.mark.asyncio +async def test_activate_online_evaluator_rest_asyncio_bad_request( + request_type=online_evaluator_service.ActivateOnlineEvaluatorRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.activate_online_evaluator(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.ActivateOnlineEvaluatorRequest, + dict, + ], +) +async def test_activate_online_evaluator_rest_asyncio_call_success(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = await client.activate_online_evaluator(request) + + # Establish that the response is the type that we expect. + json_return_value = json_format.MessageToJson(return_value) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("null_interceptor", [True, False]) +async def test_activate_online_evaluator_rest_asyncio_interceptors(null_interceptor): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + transport = transports.AsyncOnlineEvaluatorServiceRestTransport( + credentials=async_anonymous_credentials(), + interceptor=( + None + if null_interceptor + else transports.AsyncOnlineEvaluatorServiceRestInterceptor() + ), + ) + client = OnlineEvaluatorServiceAsyncClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "post_activate_online_evaluator", + ) as post, mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "post_activate_online_evaluator_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "pre_activate_online_evaluator", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = online_evaluator_service.ActivateOnlineEvaluatorRequest.pb( + online_evaluator_service.ActivateOnlineEvaluatorRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = json_format.MessageToJson(operations_pb2.Operation()) + req.return_value.read = mock.AsyncMock(return_value=return_value) + + request = online_evaluator_service.ActivateOnlineEvaluatorRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata + + await client.activate_online_evaluator( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +@pytest.mark.asyncio +async def test_suspend_online_evaluator_rest_asyncio_bad_request( + request_type=online_evaluator_service.SuspendOnlineEvaluatorRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.suspend_online_evaluator(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + online_evaluator_service.SuspendOnlineEvaluatorRequest, + dict, + ], +) +async def test_suspend_online_evaluator_rest_asyncio_call_success(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/onlineEvaluators/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = await client.suspend_online_evaluator(request) + + # Establish that the response is the type that we expect. + json_return_value = json_format.MessageToJson(return_value) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("null_interceptor", [True, False]) +async def test_suspend_online_evaluator_rest_asyncio_interceptors(null_interceptor): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + transport = transports.AsyncOnlineEvaluatorServiceRestTransport( + credentials=async_anonymous_credentials(), + interceptor=( + None + if null_interceptor + else transports.AsyncOnlineEvaluatorServiceRestInterceptor() + ), + ) + client = OnlineEvaluatorServiceAsyncClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "post_suspend_online_evaluator", + ) as post, mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "post_suspend_online_evaluator_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.AsyncOnlineEvaluatorServiceRestInterceptor, + "pre_suspend_online_evaluator", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = online_evaluator_service.SuspendOnlineEvaluatorRequest.pb( + online_evaluator_service.SuspendOnlineEvaluatorRequest() + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = json_format.MessageToJson(operations_pb2.Operation()) + req.return_value.read = mock.AsyncMock(return_value=return_value) + + request = online_evaluator_service.SuspendOnlineEvaluatorRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata + + await client.suspend_online_evaluator( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +@pytest.mark.asyncio +async def test_get_location_rest_asyncio_bad_request( + request_type=locations_pb2.GetLocationRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + request = request_type() + request = json_format.ParseDict( + {"name": "projects/sample1/locations/sample2"}, request + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.get_location(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + locations_pb2.GetLocationRequest, + dict, + ], +) +async def test_get_location_rest_asyncio(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + request_init = {"name": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(AsyncAuthorizedSession, "request") as req: + # Designate an appropriate value for the returned response. + return_value = locations_pb2.Location() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = await client.get_location(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, locations_pb2.Location) + + +@pytest.mark.asyncio +async def test_list_locations_rest_asyncio_bad_request( + request_type=locations_pb2.ListLocationsRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + request = request_type() + request = json_format.ParseDict({"name": "projects/sample1"}, request) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.list_locations(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + locations_pb2.ListLocationsRequest, + dict, + ], +) +async def test_list_locations_rest_asyncio(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + request_init = {"name": "projects/sample1"} + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(AsyncAuthorizedSession, "request") as req: + # Designate an appropriate value for the returned response. + return_value = locations_pb2.ListLocationsResponse() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = await client.list_locations(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, locations_pb2.ListLocationsResponse) + + +@pytest.mark.asyncio +async def test_get_iam_policy_rest_asyncio_bad_request( + request_type=iam_policy_pb2.GetIamPolicyRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + request = request_type() + request = json_format.ParseDict( + {"resource": "projects/sample1/locations/sample2/featurestores/sample3"}, + request, + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.get_iam_policy(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + iam_policy_pb2.GetIamPolicyRequest, + dict, + ], +) +async def test_get_iam_policy_rest_asyncio(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + request_init = { + "resource": "projects/sample1/locations/sample2/featurestores/sample3" + } + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(AsyncAuthorizedSession, "request") as req: + # Designate an appropriate value for the returned response. + return_value = policy_pb2.Policy() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = await client.get_iam_policy(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, policy_pb2.Policy) + + +@pytest.mark.asyncio +async def test_set_iam_policy_rest_asyncio_bad_request( + request_type=iam_policy_pb2.SetIamPolicyRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + request = request_type() + request = json_format.ParseDict( + {"resource": "projects/sample1/locations/sample2/featurestores/sample3"}, + request, + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.set_iam_policy(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + iam_policy_pb2.SetIamPolicyRequest, + dict, + ], +) +async def test_set_iam_policy_rest_asyncio(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + request_init = { + "resource": "projects/sample1/locations/sample2/featurestores/sample3" + } + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(AsyncAuthorizedSession, "request") as req: + # Designate an appropriate value for the returned response. + return_value = policy_pb2.Policy() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = await client.set_iam_policy(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, policy_pb2.Policy) + + +@pytest.mark.asyncio +async def test_test_iam_permissions_rest_asyncio_bad_request( + request_type=iam_policy_pb2.TestIamPermissionsRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + request = request_type() + request = json_format.ParseDict( + {"resource": "projects/sample1/locations/sample2/featurestores/sample3"}, + request, + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.test_iam_permissions(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + iam_policy_pb2.TestIamPermissionsRequest, + dict, + ], +) +async def test_test_iam_permissions_rest_asyncio(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + request_init = { + "resource": "projects/sample1/locations/sample2/featurestores/sample3" + } + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(AsyncAuthorizedSession, "request") as req: + # Designate an appropriate value for the returned response. + return_value = iam_policy_pb2.TestIamPermissionsResponse() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = await client.test_iam_permissions(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, iam_policy_pb2.TestIamPermissionsResponse) + + +@pytest.mark.asyncio +async def test_cancel_operation_rest_asyncio_bad_request( + request_type=operations_pb2.CancelOperationRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + request = request_type() + request = json_format.ParseDict( + {"name": "projects/sample1/locations/sample2/operations/sample3"}, request + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.cancel_operation(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + operations_pb2.CancelOperationRequest, + dict, + ], +) +async def test_cancel_operation_rest_asyncio(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(AsyncAuthorizedSession, "request") as req: + # Designate an appropriate value for the returned response. + return_value = None + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = "{}" + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = await client.cancel_operation(request) + + # Establish that the response is the type that we expect. + assert response is None + + +@pytest.mark.asyncio +async def test_delete_operation_rest_asyncio_bad_request( + request_type=operations_pb2.DeleteOperationRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + request = request_type() + request = json_format.ParseDict( + {"name": "projects/sample1/locations/sample2/operations/sample3"}, request + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.delete_operation(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + operations_pb2.DeleteOperationRequest, + dict, + ], +) +async def test_delete_operation_rest_asyncio(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(AsyncAuthorizedSession, "request") as req: + # Designate an appropriate value for the returned response. + return_value = None + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = "{}" + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = await client.delete_operation(request) + + # Establish that the response is the type that we expect. + assert response is None + + +@pytest.mark.asyncio +async def test_get_operation_rest_asyncio_bad_request( + request_type=operations_pb2.GetOperationRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + request = request_type() + request = json_format.ParseDict( + {"name": "projects/sample1/locations/sample2/operations/sample3"}, request + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.get_operation(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + operations_pb2.GetOperationRequest, + dict, + ], +) +async def test_get_operation_rest_asyncio(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(AsyncAuthorizedSession, "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = await client.get_operation(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, operations_pb2.Operation) + + +@pytest.mark.asyncio +async def test_list_operations_rest_asyncio_bad_request( + request_type=operations_pb2.ListOperationsRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + request = request_type() + request = json_format.ParseDict( + {"name": "projects/sample1/locations/sample2"}, request + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.list_operations(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + operations_pb2.ListOperationsRequest, + dict, + ], +) +async def test_list_operations_rest_asyncio(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + request_init = {"name": "projects/sample1/locations/sample2"} + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(AsyncAuthorizedSession, "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.ListOperationsResponse() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = await client.list_operations(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, operations_pb2.ListOperationsResponse) + + +@pytest.mark.asyncio +async def test_wait_operation_rest_asyncio_bad_request( + request_type=operations_pb2.WaitOperationRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + request = request_type() + request = json_format.ParseDict( + {"name": "projects/sample1/locations/sample2/operations/sample3"}, request + ) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.wait_operation(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + operations_pb2.WaitOperationRequest, + dict, + ], +) +async def test_wait_operation_rest_asyncio(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + request_init = {"name": "projects/sample1/locations/sample2/operations/sample3"} + request = request_type(**request_init) + # Mock the http request call within the method and fake a response. + with mock.patch.object(AsyncAuthorizedSession, "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation() + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = await client.wait_operation(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, operations_pb2.Operation) + + +def test_initialize_client_w_rest_asyncio(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + assert client is not None + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_create_online_evaluator_empty_call_rest_asyncio(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.create_online_evaluator), "__call__" + ) as call: + await client.create_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.CreateOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_get_online_evaluator_empty_call_rest_asyncio(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.get_online_evaluator), "__call__" + ) as call: + await client.get_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.GetOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_update_online_evaluator_empty_call_rest_asyncio(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.update_online_evaluator), "__call__" + ) as call: + await client.update_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.UpdateOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_delete_online_evaluator_empty_call_rest_asyncio(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.delete_online_evaluator), "__call__" + ) as call: + await client.delete_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.DeleteOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_list_online_evaluators_empty_call_rest_asyncio(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.list_online_evaluators), "__call__" + ) as call: + await client.list_online_evaluators(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.ListOnlineEvaluatorsRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_activate_online_evaluator_empty_call_rest_asyncio(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.activate_online_evaluator), "__call__" + ) as call: + await client.activate_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.ActivateOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_suspend_online_evaluator_empty_call_rest_asyncio(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.suspend_online_evaluator), "__call__" + ) as call: + await client.suspend_online_evaluator(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = online_evaluator_service.SuspendOnlineEvaluatorRequest() + + assert args[0] == request_msg + + +def test_online_evaluator_service_rest_asyncio_lro_client(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + transport = client.transport + + # Ensure that we have an api-core operations client. + assert isinstance( + transport.operations_client, + operations_v1.AsyncOperationsRestClient, + ) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + +def test_unsupported_parameter_rest_asyncio(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + options = client_options.ClientOptions(quota_project_id="octopus") + with pytest.raises(core_exceptions.AsyncRestUnsupportedParameterError, match="google.api_core.client_options.ClientOptions.quota_project_id") as exc: # type: ignore + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + client_options=options, + ) + + +def test_transport_grpc_default(): + # A client should use the gRPC transport by default. + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.OnlineEvaluatorServiceGrpcTransport, + ) + + +def test_online_evaluator_service_base_transport_error(): + # Passing both a credentials object and credentials_file should raise an error + with pytest.raises(core_exceptions.DuplicateCredentialArgs): + transport = transports.OnlineEvaluatorServiceTransport( + credentials=ga_credentials.AnonymousCredentials(), + credentials_file="credentials.json", + ) + + +def test_online_evaluator_service_base_transport(): + # Instantiate the base transport. + with mock.patch( + "google.cloud.aiplatform_v1beta1.services.online_evaluator_service.transports.OnlineEvaluatorServiceTransport.__init__" + ) as Transport: + Transport.return_value = None + transport = transports.OnlineEvaluatorServiceTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Every method on the transport should just blindly + # raise NotImplementedError. + methods = ( + "create_online_evaluator", + "get_online_evaluator", + "update_online_evaluator", + "delete_online_evaluator", + "list_online_evaluators", + "activate_online_evaluator", + "suspend_online_evaluator", + "set_iam_policy", + "get_iam_policy", + "test_iam_permissions", + "get_location", + "list_locations", + "get_operation", + "wait_operation", + "cancel_operation", + "delete_operation", + "list_operations", + ) + for method in methods: + with pytest.raises(NotImplementedError): + getattr(transport, method)(request=object()) + + with pytest.raises(NotImplementedError): + transport.close() + + # Additionally, the LRO client (a property) should + # also raise NotImplementedError + with pytest.raises(NotImplementedError): + transport.operations_client + + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + + +def test_online_evaluator_service_base_transport_with_credentials_file(): + # Instantiate the base transport with a credentials file + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch( + "google.cloud.aiplatform_v1beta1.services.online_evaluator_service.transports.OnlineEvaluatorServiceTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.OnlineEvaluatorServiceTransport( + credentials_file="credentials.json", + quota_project_id="octopus", + ) + load_creds.assert_called_once_with( + "credentials.json", + scopes=None, + default_scopes=("https://www.googleapis.com/auth/cloud-platform",), + quota_project_id="octopus", + ) + + +def test_online_evaluator_service_base_transport_with_adc(): + # Test the default credentials are used if credentials and credentials_file are None. + with mock.patch.object(google.auth, "default", autospec=True) as adc, mock.patch( + "google.cloud.aiplatform_v1beta1.services.online_evaluator_service.transports.OnlineEvaluatorServiceTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.OnlineEvaluatorServiceTransport() + adc.assert_called_once() + + +def test_online_evaluator_service_auth_adc(): + # If no credentials are provided, we should use ADC credentials. + with mock.patch.object(google.auth, "default", autospec=True) as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + OnlineEvaluatorServiceClient() + adc.assert_called_once_with( + scopes=None, + default_scopes=("https://www.googleapis.com/auth/cloud-platform",), + quota_project_id=None, + ) + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.OnlineEvaluatorServiceGrpcTransport, + transports.OnlineEvaluatorServiceGrpcAsyncIOTransport, + ], +) +def test_online_evaluator_service_transport_auth_adc(transport_class): + # If credentials and host are not provided, the transport class should use + # ADC credentials. + with mock.patch.object(google.auth, "default", autospec=True) as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport_class(quota_project_id="octopus", scopes=["1", "2"]) + adc.assert_called_once_with( + scopes=["1", "2"], + default_scopes=("https://www.googleapis.com/auth/cloud-platform",), + quota_project_id="octopus", + ) + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.OnlineEvaluatorServiceGrpcTransport, + transports.OnlineEvaluatorServiceGrpcAsyncIOTransport, + transports.OnlineEvaluatorServiceRestTransport, + ], +) +def test_online_evaluator_service_transport_auth_gdch_credentials(transport_class): + host = "https://language.com" + api_audience_tests = [None, "https://language2.com"] + api_audience_expect = [host, "https://language2.com"] + for t, e in zip(api_audience_tests, api_audience_expect): + with mock.patch.object(google.auth, "default", autospec=True) as adc: + gdch_mock = mock.MagicMock() + type(gdch_mock).with_gdch_audience = mock.PropertyMock( + return_value=gdch_mock + ) + adc.return_value = (gdch_mock, None) + transport_class(host=host, api_audience=t) + gdch_mock.with_gdch_audience.assert_called_once_with(e) + + +@pytest.mark.parametrize( + "transport_class,grpc_helpers", + [ + (transports.OnlineEvaluatorServiceGrpcTransport, grpc_helpers), + (transports.OnlineEvaluatorServiceGrpcAsyncIOTransport, grpc_helpers_async), + ], +) +def test_online_evaluator_service_transport_create_channel( + transport_class, grpc_helpers +): + # If credentials and host are not provided, the transport class should use + # ADC credentials. + with mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel", autospec=True + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + adc.return_value = (creds, None) + transport_class(quota_project_id="octopus", scopes=["1", "2"]) + + create_channel.assert_called_with( + "aiplatform.googleapis.com:443", + credentials=creds, + credentials_file=None, + quota_project_id="octopus", + default_scopes=("https://www.googleapis.com/auth/cloud-platform",), + scopes=["1", "2"], + default_host="aiplatform.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.OnlineEvaluatorServiceGrpcTransport, + transports.OnlineEvaluatorServiceGrpcAsyncIOTransport, + ], +) +def test_online_evaluator_service_grpc_transport_client_cert_source_for_mtls( + transport_class, +): + cred = ga_credentials.AnonymousCredentials() + + # Check ssl_channel_credentials is used if provided. + with mock.patch.object(transport_class, "create_channel") as mock_create_channel: + mock_ssl_channel_creds = mock.Mock() + transport_class( + host="squid.clam.whelk", + credentials=cred, + ssl_channel_credentials=mock_ssl_channel_creds, + ) + mock_create_channel.assert_called_once_with( + "squid.clam.whelk:443", + credentials=cred, + credentials_file=None, + scopes=None, + ssl_credentials=mock_ssl_channel_creds, + quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + # Check if ssl_channel_credentials is not provided, then client_cert_source_for_mtls + # is used. + with mock.patch.object(transport_class, "create_channel", return_value=mock.Mock()): + with mock.patch("grpc.ssl_channel_credentials") as mock_ssl_cred: + transport_class( + credentials=cred, + client_cert_source_for_mtls=client_cert_source_callback, + ) + expected_cert, expected_key = client_cert_source_callback() + mock_ssl_cred.assert_called_once_with( + certificate_chain=expected_cert, private_key=expected_key + ) + + +def test_online_evaluator_service_http_transport_client_cert_source_for_mtls(): + cred = ga_credentials.AnonymousCredentials() + with mock.patch( + "google.auth.transport.requests.AuthorizedSession.configure_mtls_channel" + ) as mock_configure_mtls_channel: + transports.OnlineEvaluatorServiceRestTransport( + credentials=cred, client_cert_source_for_mtls=client_cert_source_callback + ) + mock_configure_mtls_channel.assert_called_once_with(client_cert_source_callback) + + +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + "rest", + ], +) +def test_online_evaluator_service_host_no_port(transport_name): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + client_options=client_options.ClientOptions( + api_endpoint="aiplatform.googleapis.com" + ), + transport=transport_name, + ) + assert client.transport._host == ( + "aiplatform.googleapis.com:443" + if transport_name in ["grpc", "grpc_asyncio"] + else "https://aiplatform.googleapis.com" + ) + + +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + "rest", + ], +) +def test_online_evaluator_service_host_with_port(transport_name): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + client_options=client_options.ClientOptions( + api_endpoint="aiplatform.googleapis.com:8000" + ), + transport=transport_name, + ) + assert client.transport._host == ( + "aiplatform.googleapis.com:8000" + if transport_name in ["grpc", "grpc_asyncio"] + else "https://aiplatform.googleapis.com:8000" + ) + + +@pytest.mark.parametrize( + "transport_name", + [ + "rest", + ], +) +def test_online_evaluator_service_client_transport_session_collision(transport_name): + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() + client1 = OnlineEvaluatorServiceClient( + credentials=creds1, + transport=transport_name, + ) + client2 = OnlineEvaluatorServiceClient( + credentials=creds2, + transport=transport_name, + ) + session1 = client1.transport.create_online_evaluator._session + session2 = client2.transport.create_online_evaluator._session + assert session1 != session2 + session1 = client1.transport.get_online_evaluator._session + session2 = client2.transport.get_online_evaluator._session + assert session1 != session2 + session1 = client1.transport.update_online_evaluator._session + session2 = client2.transport.update_online_evaluator._session + assert session1 != session2 + session1 = client1.transport.delete_online_evaluator._session + session2 = client2.transport.delete_online_evaluator._session + assert session1 != session2 + session1 = client1.transport.list_online_evaluators._session + session2 = client2.transport.list_online_evaluators._session + assert session1 != session2 + session1 = client1.transport.activate_online_evaluator._session + session2 = client2.transport.activate_online_evaluator._session + assert session1 != session2 + session1 = client1.transport.suspend_online_evaluator._session + session2 = client2.transport.suspend_online_evaluator._session + assert session1 != session2 + + +def test_online_evaluator_service_grpc_transport_channel(): + channel = grpc.secure_channel("http://localhost/", grpc.local_channel_credentials()) + + # Check that channel is used if provided. + transport = transports.OnlineEvaluatorServiceGrpcTransport( + host="squid.clam.whelk", + channel=channel, + ) + assert transport.grpc_channel == channel + assert transport._host == "squid.clam.whelk:443" + assert transport._ssl_channel_credentials == None + + +def test_online_evaluator_service_grpc_asyncio_transport_channel(): + channel = aio.secure_channel("http://localhost/", grpc.local_channel_credentials()) + + # Check that channel is used if provided. + transport = transports.OnlineEvaluatorServiceGrpcAsyncIOTransport( + host="squid.clam.whelk", + channel=channel, + ) + assert transport.grpc_channel == channel + assert transport._host == "squid.clam.whelk:443" + assert transport._ssl_channel_credentials == None + + +# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are +# removed from grpc/grpc_asyncio transport constructor. +@pytest.mark.filterwarnings("ignore::FutureWarning") +@pytest.mark.parametrize( + "transport_class", + [ + transports.OnlineEvaluatorServiceGrpcTransport, + transports.OnlineEvaluatorServiceGrpcAsyncIOTransport, + ], +) +def test_online_evaluator_service_transport_channel_mtls_with_client_cert_source( + transport_class, +): + with mock.patch( + "grpc.ssl_channel_credentials", autospec=True + ) as grpc_ssl_channel_cred: + with mock.patch.object( + transport_class, "create_channel" + ) as grpc_create_channel: + mock_ssl_cred = mock.Mock() + grpc_ssl_channel_cred.return_value = mock_ssl_cred + + mock_grpc_channel = mock.Mock() + grpc_create_channel.return_value = mock_grpc_channel + + cred = ga_credentials.AnonymousCredentials() + with pytest.warns(DeprecationWarning): + with mock.patch.object(google.auth, "default") as adc: + adc.return_value = (cred, None) + transport = transport_class( + host="squid.clam.whelk", + api_mtls_endpoint="mtls.squid.clam.whelk", + client_cert_source=client_cert_source_callback, + ) + adc.assert_called_once() + + grpc_ssl_channel_cred.assert_called_once_with( + certificate_chain=b"cert bytes", private_key=b"key bytes" + ) + grpc_create_channel.assert_called_once_with( + "mtls.squid.clam.whelk:443", + credentials=cred, + credentials_file=None, + scopes=None, + ssl_credentials=mock_ssl_cred, + quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + assert transport.grpc_channel == mock_grpc_channel + assert transport._ssl_channel_credentials == mock_ssl_cred + + +# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are +# removed from grpc/grpc_asyncio transport constructor. +@pytest.mark.parametrize( + "transport_class", + [ + transports.OnlineEvaluatorServiceGrpcTransport, + transports.OnlineEvaluatorServiceGrpcAsyncIOTransport, + ], +) +def test_online_evaluator_service_transport_channel_mtls_with_adc(transport_class): + mock_ssl_cred = mock.Mock() + with mock.patch.multiple( + "google.auth.transport.grpc.SslCredentials", + __init__=mock.Mock(return_value=None), + ssl_credentials=mock.PropertyMock(return_value=mock_ssl_cred), + ): + with mock.patch.object( + transport_class, "create_channel" + ) as grpc_create_channel: + mock_grpc_channel = mock.Mock() + grpc_create_channel.return_value = mock_grpc_channel + mock_cred = mock.Mock() + + with pytest.warns(DeprecationWarning): + transport = transport_class( + host="squid.clam.whelk", + credentials=mock_cred, + api_mtls_endpoint="mtls.squid.clam.whelk", + client_cert_source=None, + ) + + grpc_create_channel.assert_called_once_with( + "mtls.squid.clam.whelk:443", + credentials=mock_cred, + credentials_file=None, + scopes=None, + ssl_credentials=mock_ssl_cred, + quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + assert transport.grpc_channel == mock_grpc_channel + + +def test_online_evaluator_service_grpc_lro_client(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + transport = client.transport + + # Ensure that we have a api-core operations client. + assert isinstance( + transport.operations_client, + operations_v1.OperationsClient, + ) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + +def test_online_evaluator_service_grpc_lro_async_client(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", + ) + transport = client.transport + + # Ensure that we have a api-core operations client. + assert isinstance( + transport.operations_client, + operations_v1.OperationsAsyncClient, + ) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + +def test_online_evaluator_path(): + project = "squid" + location = "clam" + online_evaluator = "whelk" + expected = "projects/{project}/locations/{location}/onlineEvaluators/{online_evaluator}".format( + project=project, + location=location, + online_evaluator=online_evaluator, + ) + actual = OnlineEvaluatorServiceClient.online_evaluator_path( + project, location, online_evaluator + ) + assert expected == actual + + +def test_parse_online_evaluator_path(): + expected = { + "project": "octopus", + "location": "oyster", + "online_evaluator": "nudibranch", + } + path = OnlineEvaluatorServiceClient.online_evaluator_path(**expected) + + # Check that the path construction is reversible. + actual = OnlineEvaluatorServiceClient.parse_online_evaluator_path(path) + assert expected == actual + + +def test_common_billing_account_path(): + billing_account = "cuttlefish" + expected = "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + actual = OnlineEvaluatorServiceClient.common_billing_account_path(billing_account) + assert expected == actual + + +def test_parse_common_billing_account_path(): + expected = { + "billing_account": "mussel", + } + path = OnlineEvaluatorServiceClient.common_billing_account_path(**expected) + + # Check that the path construction is reversible. + actual = OnlineEvaluatorServiceClient.parse_common_billing_account_path(path) + assert expected == actual + + +def test_common_folder_path(): + folder = "winkle" + expected = "folders/{folder}".format( + folder=folder, + ) + actual = OnlineEvaluatorServiceClient.common_folder_path(folder) + assert expected == actual + + +def test_parse_common_folder_path(): + expected = { + "folder": "nautilus", + } + path = OnlineEvaluatorServiceClient.common_folder_path(**expected) + + # Check that the path construction is reversible. + actual = OnlineEvaluatorServiceClient.parse_common_folder_path(path) + assert expected == actual + + +def test_common_organization_path(): + organization = "scallop" + expected = "organizations/{organization}".format( + organization=organization, + ) + actual = OnlineEvaluatorServiceClient.common_organization_path(organization) + assert expected == actual + + +def test_parse_common_organization_path(): + expected = { + "organization": "abalone", + } + path = OnlineEvaluatorServiceClient.common_organization_path(**expected) + + # Check that the path construction is reversible. + actual = OnlineEvaluatorServiceClient.parse_common_organization_path(path) + assert expected == actual + + +def test_common_project_path(): + project = "squid" + expected = "projects/{project}".format( + project=project, + ) + actual = OnlineEvaluatorServiceClient.common_project_path(project) + assert expected == actual + + +def test_parse_common_project_path(): + expected = { + "project": "clam", + } + path = OnlineEvaluatorServiceClient.common_project_path(**expected) + + # Check that the path construction is reversible. + actual = OnlineEvaluatorServiceClient.parse_common_project_path(path) + assert expected == actual + + +def test_common_location_path(): + project = "whelk" + location = "octopus" + expected = "projects/{project}/locations/{location}".format( + project=project, + location=location, + ) + actual = OnlineEvaluatorServiceClient.common_location_path(project, location) + assert expected == actual + + +def test_parse_common_location_path(): + expected = { + "project": "oyster", + "location": "nudibranch", + } + path = OnlineEvaluatorServiceClient.common_location_path(**expected) + + # Check that the path construction is reversible. + actual = OnlineEvaluatorServiceClient.parse_common_location_path(path) + assert expected == actual + + +def test_client_with_default_client_info(): + client_info = gapic_v1.client_info.ClientInfo() + + with mock.patch.object( + transports.OnlineEvaluatorServiceTransport, "_prep_wrapped_messages" + ) as prep: + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, + ) + prep.assert_called_once_with(client_info) + + with mock.patch.object( + transports.OnlineEvaluatorServiceTransport, "_prep_wrapped_messages" + ) as prep: + transport_class = OnlineEvaluatorServiceClient.get_transport_class() + transport = transport_class( + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, + ) + prep.assert_called_once_with(client_info) + + +def test_delete_operation(transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = operations_pb2.DeleteOperationRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = None + response = client.delete_operation(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert response is None + + +@pytest.mark.asyncio +async def test_delete_operation_async(transport: str = "grpc_asyncio"): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = operations_pb2.DeleteOperationRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + response = await client.delete_operation(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert response is None + + +def test_delete_operation_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = operations_pb2.DeleteOperationRequest() + request.name = "locations" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: + call.return_value = None + + client.delete_operation(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=locations", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_delete_operation_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = operations_pb2.DeleteOperationRequest() + request.name = "locations" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.delete_operation(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=locations", + ) in kw["metadata"] + + +def test_delete_operation_from_dict(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = None + + response = client.delete_operation( + request={ + "name": "locations", + } + ) + call.assert_called() + + +@pytest.mark.asyncio +async def test_delete_operation_from_dict_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.delete_operation), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + response = await client.delete_operation( + request={ + "name": "locations", + } + ) + call.assert_called() + + +def test_cancel_operation(transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = operations_pb2.CancelOperationRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = None + response = client.cancel_operation(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert response is None + + +@pytest.mark.asyncio +async def test_cancel_operation_async(transport: str = "grpc_asyncio"): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = operations_pb2.CancelOperationRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + response = await client.cancel_operation(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert response is None + + +def test_cancel_operation_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = operations_pb2.CancelOperationRequest() + request.name = "locations" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: + call.return_value = None + + client.cancel_operation(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=locations", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_cancel_operation_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = operations_pb2.CancelOperationRequest() + request.name = "locations" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + await client.cancel_operation(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=locations", + ) in kw["metadata"] + + +def test_cancel_operation_from_dict(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = None + + response = client.cancel_operation( + request={ + "name": "locations", + } + ) + call.assert_called() + + +@pytest.mark.asyncio +async def test_cancel_operation_from_dict_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) + response = await client.cancel_operation( + request={ + "name": "locations", + } + ) + call.assert_called() + + +def test_wait_operation(transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = operations_pb2.WaitOperationRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.wait_operation), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation() + response = client.wait_operation(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, operations_pb2.Operation) + + +@pytest.mark.asyncio +async def test_wait_operation(transport: str = "grpc_asyncio"): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = operations_pb2.WaitOperationRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.wait_operation), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation() + ) + response = await client.wait_operation(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, operations_pb2.Operation) + + +def test_wait_operation_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = operations_pb2.WaitOperationRequest() + request.name = "locations" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.wait_operation), "__call__") as call: + call.return_value = operations_pb2.Operation() + + client.wait_operation(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=locations", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_wait_operation_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = operations_pb2.WaitOperationRequest() + request.name = "locations" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.wait_operation), "__call__") as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation() + ) + await client.wait_operation(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=locations", + ) in kw["metadata"] + + +def test_wait_operation_from_dict(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.wait_operation), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation() + + response = client.wait_operation( + request={ + "name": "locations", + } + ) + call.assert_called() + + +@pytest.mark.asyncio +async def test_wait_operation_from_dict_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.wait_operation), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation() + ) + response = await client.wait_operation( + request={ + "name": "locations", + } + ) + call.assert_called() + + +def test_get_operation(transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = operations_pb2.GetOperationRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_operation), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation() + response = client.get_operation(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, operations_pb2.Operation) + + +@pytest.mark.asyncio +async def test_get_operation_async(transport: str = "grpc_asyncio"): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = operations_pb2.GetOperationRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_operation), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation() + ) + response = await client.get_operation(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, operations_pb2.Operation) + + +def test_get_operation_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = operations_pb2.GetOperationRequest() + request.name = "locations" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_operation), "__call__") as call: + call.return_value = operations_pb2.Operation() + + client.get_operation(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=locations", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_get_operation_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = operations_pb2.GetOperationRequest() + request.name = "locations" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_operation), "__call__") as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation() + ) + await client.get_operation(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=locations", + ) in kw["metadata"] + + +def test_get_operation_from_dict(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_operation), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation() + + response = client.get_operation( + request={ + "name": "locations", + } + ) + call.assert_called() + + +@pytest.mark.asyncio +async def test_get_operation_from_dict_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_operation), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation() + ) + response = await client.get_operation( + request={ + "name": "locations", + } + ) + call.assert_called() + + +def test_list_operations(transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = operations_pb2.ListOperationsRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_operations), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.ListOperationsResponse() + response = client.list_operations(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, operations_pb2.ListOperationsResponse) + + +@pytest.mark.asyncio +async def test_list_operations_async(transport: str = "grpc_asyncio"): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = operations_pb2.ListOperationsRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_operations), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.ListOperationsResponse() + ) + response = await client.list_operations(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, operations_pb2.ListOperationsResponse) + + +def test_list_operations_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = operations_pb2.ListOperationsRequest() + request.name = "locations" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_operations), "__call__") as call: + call.return_value = operations_pb2.ListOperationsResponse() + + client.list_operations(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=locations", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_list_operations_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = operations_pb2.ListOperationsRequest() + request.name = "locations" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_operations), "__call__") as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.ListOperationsResponse() + ) + await client.list_operations(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=locations", + ) in kw["metadata"] + + +def test_list_operations_from_dict(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_operations), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.ListOperationsResponse() + + response = client.list_operations( + request={ + "name": "locations", + } + ) + call.assert_called() + + +@pytest.mark.asyncio +async def test_list_operations_from_dict_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_operations), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.ListOperationsResponse() + ) + response = await client.list_operations( + request={ + "name": "locations", + } + ) + call.assert_called() + + +def test_list_locations(transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = locations_pb2.ListLocationsRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = locations_pb2.ListLocationsResponse() + response = client.list_locations(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, locations_pb2.ListLocationsResponse) + + +@pytest.mark.asyncio +async def test_list_locations_async(transport: str = "grpc_asyncio"): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = locations_pb2.ListLocationsRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + locations_pb2.ListLocationsResponse() + ) + response = await client.list_locations(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, locations_pb2.ListLocationsResponse) + + +def test_list_locations_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = locations_pb2.ListLocationsRequest() + request.name = "locations" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + call.return_value = locations_pb2.ListLocationsResponse() + + client.list_locations(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=locations", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_list_locations_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = locations_pb2.ListLocationsRequest() + request.name = "locations" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + locations_pb2.ListLocationsResponse() + ) + await client.list_locations(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=locations", + ) in kw["metadata"] + + +def test_list_locations_from_dict(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = locations_pb2.ListLocationsResponse() + + response = client.list_locations( + request={ + "name": "locations", + } + ) + call.assert_called() + + +@pytest.mark.asyncio +async def test_list_locations_from_dict_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + locations_pb2.ListLocationsResponse() + ) + response = await client.list_locations( + request={ + "name": "locations", + } + ) + call.assert_called() + + +def test_get_location(transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = locations_pb2.GetLocationRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_location), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = locations_pb2.Location() + response = client.get_location(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, locations_pb2.Location) + + +@pytest.mark.asyncio +async def test_get_location_async(transport: str = "grpc_asyncio"): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = locations_pb2.GetLocationRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_location), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + locations_pb2.Location() + ) + response = await client.get_location(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, locations_pb2.Location) + + +def test_get_location_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials() + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = locations_pb2.GetLocationRequest() + request.name = "locations/abc" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_location), "__call__") as call: + call.return_value = locations_pb2.Location() + + client.get_location(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=locations/abc", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_get_location_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials() + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = locations_pb2.GetLocationRequest() + request.name = "locations/abc" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_location), "__call__") as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + locations_pb2.Location() + ) + await client.get_location(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=locations/abc", + ) in kw["metadata"] + + +def test_get_location_from_dict(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = locations_pb2.Location() + + response = client.get_location( + request={ + "name": "locations/abc", + } + ) + call.assert_called() + + +@pytest.mark.asyncio +async def test_get_location_from_dict_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + locations_pb2.Location() + ) + response = await client.get_location( + request={ + "name": "locations", + } + ) + call.assert_called() + + +def test_set_iam_policy(transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = iam_policy_pb2.SetIamPolicyRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = policy_pb2.Policy( + version=774, + etag=b"etag_blob", + ) + response = client.set_iam_policy(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, policy_pb2.Policy) + + assert response.version == 774 + + assert response.etag == b"etag_blob" + + +@pytest.mark.asyncio +async def test_set_iam_policy_async(transport: str = "grpc_asyncio"): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = iam_policy_pb2.SetIamPolicyRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: + # Designate an appropriate return value for the call. + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + policy_pb2.Policy( + version=774, + etag=b"etag_blob", + ) + ) + response = await client.set_iam_policy(request) + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, policy_pb2.Policy) + + assert response.version == 774 + + assert response.etag == b"etag_blob" + + +def test_set_iam_policy_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = iam_policy_pb2.SetIamPolicyRequest() + request.resource = "resource/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: + call.return_value = policy_pb2.Policy() + + client.set_iam_policy(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_set_iam_policy_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = iam_policy_pb2.SetIamPolicyRequest() + request.resource = "resource/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy_pb2.Policy()) + + await client.set_iam_policy(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] + + +def test_set_iam_policy_from_dict(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = policy_pb2.Policy() + + response = client.set_iam_policy( + request={ + "resource": "resource_value", + "policy": policy_pb2.Policy(version=774), + } + ) + call.assert_called() + + +@pytest.mark.asyncio +async def test_set_iam_policy_from_dict_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy_pb2.Policy()) + + response = await client.set_iam_policy( + request={ + "resource": "resource_value", + "policy": policy_pb2.Policy(version=774), + } + ) + call.assert_called() + + +def test_get_iam_policy(transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = iam_policy_pb2.GetIamPolicyRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = policy_pb2.Policy( + version=774, + etag=b"etag_blob", + ) + + response = client.get_iam_policy(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, policy_pb2.Policy) + + assert response.version == 774 + + assert response.etag == b"etag_blob" + + +@pytest.mark.asyncio +async def test_get_iam_policy_async(transport: str = "grpc_asyncio"): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = iam_policy_pb2.GetIamPolicyRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + policy_pb2.Policy( + version=774, + etag=b"etag_blob", + ) + ) + + response = await client.get_iam_policy(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, policy_pb2.Policy) + + assert response.version == 774 + + assert response.etag == b"etag_blob" + + +def test_get_iam_policy_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = iam_policy_pb2.GetIamPolicyRequest() + request.resource = "resource/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: + call.return_value = policy_pb2.Policy() + + client.get_iam_policy(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_get_iam_policy_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = iam_policy_pb2.GetIamPolicyRequest() + request.resource = "resource/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy_pb2.Policy()) + + await client.get_iam_policy(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] + + +def test_get_iam_policy_from_dict(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = policy_pb2.Policy() + + response = client.get_iam_policy( + request={ + "resource": "resource_value", + "options": options_pb2.GetPolicyOptions(requested_policy_version=2598), + } + ) + call.assert_called() + + +@pytest.mark.asyncio +async def test_get_iam_policy_from_dict_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy_pb2.Policy()) + + response = await client.get_iam_policy( + request={ + "resource": "resource_value", + "options": options_pb2.GetPolicyOptions(requested_policy_version=2598), + } + ) + call.assert_called() + + +def test_test_iam_permissions(transport: str = "grpc"): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = iam_policy_pb2.TestIamPermissionsRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.test_iam_permissions), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = iam_policy_pb2.TestIamPermissionsResponse( + permissions=["permissions_value"], + ) + + response = client.test_iam_permissions(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, iam_policy_pb2.TestIamPermissionsResponse) + + assert response.permissions == ["permissions_value"] + + +@pytest.mark.asyncio +async def test_test_iam_permissions_async(transport: str = "grpc_asyncio"): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = iam_policy_pb2.TestIamPermissionsRequest() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.test_iam_permissions), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + iam_policy_pb2.TestIamPermissionsResponse( + permissions=["permissions_value"], + ) + ) + + response = await client.test_iam_permissions(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, iam_policy_pb2.TestIamPermissionsResponse) + + assert response.permissions == ["permissions_value"] + + +def test_test_iam_permissions_field_headers(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = iam_policy_pb2.TestIamPermissionsRequest() + request.resource = "resource/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.test_iam_permissions), "__call__" + ) as call: + call.return_value = iam_policy_pb2.TestIamPermissionsResponse() + + client.test_iam_permissions(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_test_iam_permissions_field_headers_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = iam_policy_pb2.TestIamPermissionsRequest() + request.resource = "resource/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.test_iam_permissions), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + iam_policy_pb2.TestIamPermissionsResponse() + ) + + await client.test_iam_permissions(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] + + +def test_test_iam_permissions_from_dict(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.test_iam_permissions), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = iam_policy_pb2.TestIamPermissionsResponse() + + response = client.test_iam_permissions( + request={ + "resource": "resource_value", + "permissions": ["permissions_value"], + } + ) + call.assert_called() + + +@pytest.mark.asyncio +async def test_test_iam_permissions_from_dict_async(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.test_iam_permissions), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + iam_policy_pb2.TestIamPermissionsResponse() + ) + + response = await client.test_iam_permissions( + request={ + "resource": "resource_value", + "permissions": ["permissions_value"], + } + ) + call.assert_called() + + +def test_transport_close_grpc(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc" + ) + with mock.patch.object( + type(getattr(client.transport, "_grpc_channel")), "close" + ) as close: + with client: + close.assert_not_called() + close.assert_called_once() + + +@pytest.mark.asyncio +async def test_transport_close_grpc_asyncio(): + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="grpc_asyncio" + ) + with mock.patch.object( + type(getattr(client.transport, "_grpc_channel")), "close" + ) as close: + async with client: + close.assert_not_called() + close.assert_called_once() + + +def test_transport_close_rest(): + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + with mock.patch.object( + type(getattr(client.transport, "_session")), "close" + ) as close: + with client: + close.assert_not_called() + close.assert_called_once() + + +@pytest.mark.asyncio +async def test_transport_close_rest_asyncio(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = OnlineEvaluatorServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + with mock.patch.object( + type(getattr(client.transport, "_session")), "close" + ) as close: + async with client: + close.assert_not_called() + close.assert_called_once() + + +def test_client_ctx(): + transports = [ + "rest", + "grpc", + ] + for transport in transports: + client = OnlineEvaluatorServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport + ) + # Test client calls underlying transport. + with mock.patch.object(type(client.transport), "close") as close: + close.assert_not_called() + with client: + pass + close.assert_called() + + +@pytest.mark.parametrize( + "client_class,transport_class", + [ + (OnlineEvaluatorServiceClient, transports.OnlineEvaluatorServiceGrpcTransport), + ( + OnlineEvaluatorServiceAsyncClient, + transports.OnlineEvaluatorServiceGrpcAsyncIOTransport, + ), + ], +) +def test_api_key_credentials(client_class, transport_class): + with mock.patch.object( + google.auth._default, "get_api_key_credentials", create=True + ) as get_api_key_credentials: + mock_cred = mock.Mock() + get_api_key_credentials.return_value = mock_cred + options = client_options.ClientOptions() + options.api_key = "api_key" + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options) + patched.assert_called_once_with( + credentials=mock_cred, + credentials_file=None, + host=client._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=client._DEFAULT_UNIVERSE + ), + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + api_audience=None, + ) diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_reasoning_engine_execution_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_reasoning_engine_execution_service.py index ded4e3891b..6f95c89654 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_reasoning_engine_execution_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_reasoning_engine_execution_service.py @@ -56,9 +56,12 @@ from google.api_core import client_options from google.api_core import exceptions as core_exceptions +from google.api_core import future from google.api_core import gapic_v1 from google.api_core import grpc_helpers from google.api_core import grpc_helpers_async +from google.api_core import operation +from google.api_core import operations_v1 from google.api_core import path_template from google.api_core import retry as retries from google.auth import credentials as ga_credentials @@ -80,6 +83,7 @@ from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore +import google.api_core.operation_async as operation_async # type: ignore import google.auth import google.protobuf.any_pb2 as any_pb2 # type: ignore import google.protobuf.struct_pb2 as struct_pb2 # type: ignore @@ -1978,6 +1982,273 @@ async def test_stream_query_reasoning_engine_field_headers_async(): ) in kw["metadata"] +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + dict, + ], +) +def test_async_query_reasoning_engine(request_type, transport: str = "grpc"): + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + request = reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_async_query_reasoning_engine_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Populate all string fields in the request which are not UUID4 + # since we want to check that UUID4 are populated automatically + # if they meet the requirements of AIP 4235. + request = reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest( + name="name_value", + input_gcs_uri="input_gcs_uri_value", + output_gcs_uri="output_gcs_uri_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.async_query_reasoning_engine(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[ + 0 + ] == reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest( + name="name_value", + input_gcs_uri="input_gcs_uri_value", + output_gcs_uri="output_gcs_uri_value", + ) + + +def test_async_query_reasoning_engine_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.async_query_reasoning_engine + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.async_query_reasoning_engine + ] = mock_rpc + request = {} + client.async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.async_query_reasoning_engine(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_async_query_reasoning_engine_async_use_cached_wrapped_rpc( + transport: str = "grpc_asyncio", +): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._client._transport.async_query_reasoning_engine + in client._client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.AsyncMock() + mock_rpc.return_value = mock.Mock() + client._client._transport._wrapped_methods[ + client._client._transport.async_query_reasoning_engine + ] = mock_rpc + + request = {} + await client.async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods call wrapper_fn to build a cached + # client._transport.operations_client instance on first rpc call. + # Subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + await client.async_query_reasoning_engine(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_async_query_reasoning_engine_async( + transport: str = "grpc_asyncio", + request_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, +): + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + request = reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_async_query_reasoning_engine_async_from_dict(): + await test_async_query_reasoning_engine_async(request_type=dict) + + +def test_async_query_reasoning_engine_field_headers(): + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=name_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_async_query_reasoning_engine_field_headers_async(): + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=name_value", + ) in kw["metadata"] + + def test_query_reasoning_engine_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call @@ -2237,6 +2508,133 @@ def test_stream_query_reasoning_engine_rest_unset_required_fields(): assert set(unset_fields) == (set(()) & set(("name",))) +def test_async_query_reasoning_engine_rest_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.async_query_reasoning_engine + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.async_query_reasoning_engine + ] = mock_rpc + + request = {} + client.async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + # Operation methods build a cached wrapper on first rpc call + # subsequent calls should use the cached wrapper + wrapper_fn.reset_mock() + + client.async_query_reasoning_engine(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +def test_async_query_reasoning_engine_rest_required_fields( + request_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, +): + transport_class = transports.ReasoningEngineExecutionServiceRestTransport + + request_init = {} + request_init["name"] = "" + request = request_type(**request_init) + pb_request = request_type.pb(request) + jsonified_request = json.loads( + json_format.MessageToJson(pb_request, use_integers_for_enums=False) + ) + + # verify fields with default values are dropped + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).async_query_reasoning_engine._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with default values are now present + + jsonified_request["name"] = "name_value" + + unset_fields = transport_class( + credentials=ga_credentials.AnonymousCredentials() + ).async_query_reasoning_engine._get_unset_required_fields(jsonified_request) + jsonified_request.update(unset_fields) + + # verify required fields with non-default values are left alone + assert "name" in jsonified_request + assert jsonified_request["name"] == "name_value" + + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + # Mock the http request call within the method and fake a response. + with mock.patch.object(Session, "request") as req: + # We need to mock transcode() because providing default values + # for required fields will fail the real version if the http_options + # expect actual values for those fields. + with mock.patch.object(path_template, "transcode") as transcode: + # A uri without fields and an empty body will force all the + # request fields to show up in the query_params. + pb_request = request_type.pb(request) + transcode_result = { + "uri": "v1/sample_method", + "method": "post", + "query_params": pb_request, + } + transcode_result["body"] = pb_request + transcode.return_value = transcode_result + + response_value = Response() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + + response_value._content = json_return_value.encode("UTF-8") + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + + response = client.async_query_reasoning_engine(request) + + expected_params = [("$alt", "json;enum-encoding=int")] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_async_query_reasoning_engine_rest_unset_required_fields(): + transport = transports.ReasoningEngineExecutionServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.async_query_reasoning_engine._get_unset_required_fields({}) + assert set(unset_fields) == (set(()) & set(("name",))) + + def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.ReasoningEngineExecutionServiceGrpcTransport( @@ -2393,6 +2791,31 @@ def test_stream_query_reasoning_engine_empty_call_grpc(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_async_query_reasoning_engine_empty_call_grpc(): + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.async_query_reasoning_engine(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + ) + + assert args[0] == request_msg + + def test_transport_kind_grpc_asyncio(): transport = ReasoningEngineExecutionServiceAsyncClient.get_transport_class( "grpc_asyncio" @@ -2462,6 +2885,35 @@ async def test_stream_query_reasoning_engine_empty_call_grpc_asyncio(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_async_query_reasoning_engine_empty_call_grpc_asyncio(): + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + await client.async_query_reasoning_engine(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + ) + + assert args[0] == request_msg + + def test_transport_kind_rest(): transport = ReasoningEngineExecutionServiceClient.get_transport_class("rest")( credentials=ga_credentials.AnonymousCredentials() @@ -2604,7 +3056,148 @@ def test_query_reasoning_engine_rest_interceptors(null_interceptor): metadata, ) - client.query_reasoning_engine( + client.query_reasoning_engine( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_stream_query_reasoning_engine_rest_bad_request( + request_type=reasoning_engine_execution_service.StreamQueryReasoningEngineRequest, +): + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(Session, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + json_return_value = "" + response_value.json = mock.Mock(return_value={}) + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + client.stream_query_reasoning_engine(request) + + +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_execution_service.StreamQueryReasoningEngineRequest, + dict, + ], +) +def test_stream_query_reasoning_engine_rest_call_success(request_type): + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = httpbody_pb2.HttpBody( + content_type="content_type_value", + data=b"data_blob", + ) + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + json_return_value = "[{}]".format(json_return_value) + response_value.iter_content = mock.Mock(return_value=iter(json_return_value)) + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = client.stream_query_reasoning_engine(request) + + assert isinstance(response, Iterable) + response = next(response) + + # Establish that the response is the type that we expect. + assert isinstance(response, httpbody_pb2.HttpBody) + assert response.content_type == "content_type_value" + assert response.data == b"data_blob" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_stream_query_reasoning_engine_rest_interceptors(null_interceptor): + transport = transports.ReasoningEngineExecutionServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=( + None + if null_interceptor + else transports.ReasoningEngineExecutionServiceRestInterceptor() + ), + ) + client = ReasoningEngineExecutionServiceClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + transports.ReasoningEngineExecutionServiceRestInterceptor, + "post_stream_query_reasoning_engine", + ) as post, mock.patch.object( + transports.ReasoningEngineExecutionServiceRestInterceptor, + "post_stream_query_reasoning_engine_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.ReasoningEngineExecutionServiceRestInterceptor, + "pre_stream_query_reasoning_engine", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = ( + reasoning_engine_execution_service.StreamQueryReasoningEngineRequest.pb( + reasoning_engine_execution_service.StreamQueryReasoningEngineRequest() + ) + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = json_format.MessageToJson(httpbody_pb2.HttpBody()) + req.return_value.iter_content = mock.Mock(return_value=iter(return_value)) + + request = reasoning_engine_execution_service.StreamQueryReasoningEngineRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = httpbody_pb2.HttpBody() + post_with_metadata.return_value = httpbody_pb2.HttpBody(), metadata + + client.stream_query_reasoning_engine( request, metadata=[ ("key", "val"), @@ -2617,8 +3210,8 @@ def test_query_reasoning_engine_rest_interceptors(null_interceptor): post_with_metadata.assert_called_once() -def test_stream_query_reasoning_engine_rest_bad_request( - request_type=reasoning_engine_execution_service.StreamQueryReasoningEngineRequest, +def test_async_query_reasoning_engine_rest_bad_request( + request_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, ): client = ReasoningEngineExecutionServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" @@ -2641,17 +3234,17 @@ def test_stream_query_reasoning_engine_rest_bad_request( response_value.request = mock.Mock() req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - client.stream_query_reasoning_engine(request) + client.async_query_reasoning_engine(request) @pytest.mark.parametrize( "request_type", [ - reasoning_engine_execution_service.StreamQueryReasoningEngineRequest, + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, dict, ], ) -def test_stream_query_reasoning_engine_rest_call_success(request_type): +def test_async_query_reasoning_engine_rest_call_success(request_type): client = ReasoningEngineExecutionServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -2665,32 +3258,23 @@ def test_stream_query_reasoning_engine_rest_call_success(request_type): # Mock the http request call within the method and fake a response. with mock.patch.object(type(client.transport._session), "request") as req: # Designate an appropriate value for the returned response. - return_value = httpbody_pb2.HttpBody( - content_type="content_type_value", - data=b"data_blob", - ) + return_value = operations_pb2.Operation(name="operations/spam") # Wrap the value into a proper Response obj response_value = mock.Mock() response_value.status_code = 200 json_return_value = json_format.MessageToJson(return_value) - json_return_value = "[{}]".format(json_return_value) - response_value.iter_content = mock.Mock(return_value=iter(json_return_value)) + response_value.content = json_return_value.encode("UTF-8") req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.stream_query_reasoning_engine(request) - - assert isinstance(response, Iterable) - response = next(response) + response = client.async_query_reasoning_engine(request) # Establish that the response is the type that we expect. - assert isinstance(response, httpbody_pb2.HttpBody) - assert response.content_type == "content_type_value" - assert response.data == b"data_blob" + json_return_value = json_format.MessageToJson(return_value) @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_stream_query_reasoning_engine_rest_interceptors(null_interceptor): +def test_async_query_reasoning_engine_rest_interceptors(null_interceptor): transport = transports.ReasoningEngineExecutionServiceRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=( @@ -2706,21 +3290,23 @@ def test_stream_query_reasoning_engine_rest_interceptors(null_interceptor): ) as req, mock.patch.object( path_template, "transcode" ) as transcode, mock.patch.object( + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( transports.ReasoningEngineExecutionServiceRestInterceptor, - "post_stream_query_reasoning_engine", + "post_async_query_reasoning_engine", ) as post, mock.patch.object( transports.ReasoningEngineExecutionServiceRestInterceptor, - "post_stream_query_reasoning_engine_with_metadata", + "post_async_query_reasoning_engine_with_metadata", ) as post_with_metadata, mock.patch.object( transports.ReasoningEngineExecutionServiceRestInterceptor, - "pre_stream_query_reasoning_engine", + "pre_async_query_reasoning_engine", ) as pre: pre.assert_not_called() post.assert_not_called() post_with_metadata.assert_not_called() pb_message = ( - reasoning_engine_execution_service.StreamQueryReasoningEngineRequest.pb( - reasoning_engine_execution_service.StreamQueryReasoningEngineRequest() + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest.pb( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() ) ) transcode.return_value = { @@ -2733,19 +3319,19 @@ def test_stream_query_reasoning_engine_rest_interceptors(null_interceptor): req.return_value = mock.Mock() req.return_value.status_code = 200 req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - return_value = json_format.MessageToJson(httpbody_pb2.HttpBody()) - req.return_value.iter_content = mock.Mock(return_value=iter(return_value)) + return_value = json_format.MessageToJson(operations_pb2.Operation()) + req.return_value.content = return_value - request = reasoning_engine_execution_service.StreamQueryReasoningEngineRequest() + request = reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() metadata = [ ("key", "val"), ("cephalopod", "squid"), ] pre.return_value = request, metadata - post.return_value = httpbody_pb2.HttpBody() - post_with_metadata.return_value = httpbody_pb2.HttpBody(), metadata + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata - client.stream_query_reasoning_engine( + client.async_query_reasoning_engine( request, metadata=[ ("key", "val"), @@ -3436,6 +4022,47 @@ def test_stream_query_reasoning_engine_empty_call_rest(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_async_query_reasoning_engine_empty_call_rest(): + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + client.async_query_reasoning_engine(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + ) + + assert args[0] == request_msg + + +def test_reasoning_engine_execution_service_rest_lro_client(): + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + transport = client.transport + + # Ensure that we have an api-core operations client. + assert isinstance( + transport.operations_client, + operations_v1.AbstractOperationsClient, + ) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + def test_transport_kind_rest_asyncio(): if not HAS_ASYNC_REST_EXTRA: pytest.skip( @@ -3768,6 +4395,156 @@ async def test_stream_query_reasoning_engine_rest_asyncio_interceptors( post_with_metadata.assert_called_once() +@pytest.mark.asyncio +async def test_async_query_reasoning_engine_rest_asyncio_bad_request( + request_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a BadRequest error. + with mock.patch.object(AsyncAuthorizedSession, "request") as req, pytest.raises( + core_exceptions.BadRequest + ): + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.read = mock.AsyncMock(return_value=b"{}") + response_value.status_code = 400 + response_value.request = mock.Mock() + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + await client.async_query_reasoning_engine(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + dict, + ], +) +async def test_async_query_reasoning_engine_rest_asyncio_call_success(request_type): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3" + } + request = request_type(**request_init) + + # Mock the http request call within the method and fake a response. + with mock.patch.object(type(client.transport._session), "request") as req: + # Designate an appropriate value for the returned response. + return_value = operations_pb2.Operation(name="operations/spam") + + # Wrap the value into a proper Response obj + response_value = mock.Mock() + response_value.status_code = 200 + json_return_value = json_format.MessageToJson(return_value) + response_value.read = mock.AsyncMock( + return_value=json_return_value.encode("UTF-8") + ) + req.return_value = response_value + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + response = await client.async_query_reasoning_engine(request) + + # Establish that the response is the type that we expect. + json_return_value = json_format.MessageToJson(return_value) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("null_interceptor", [True, False]) +async def test_async_query_reasoning_engine_rest_asyncio_interceptors(null_interceptor): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + transport = transports.AsyncReasoningEngineExecutionServiceRestTransport( + credentials=async_anonymous_credentials(), + interceptor=( + None + if null_interceptor + else transports.AsyncReasoningEngineExecutionServiceRestInterceptor() + ), + ) + client = ReasoningEngineExecutionServiceAsyncClient(transport=transport) + + with mock.patch.object( + type(client.transport._session), "request" + ) as req, mock.patch.object( + path_template, "transcode" + ) as transcode, mock.patch.object( + operation.Operation, "_set_result_from_operation" + ), mock.patch.object( + transports.AsyncReasoningEngineExecutionServiceRestInterceptor, + "post_async_query_reasoning_engine", + ) as post, mock.patch.object( + transports.AsyncReasoningEngineExecutionServiceRestInterceptor, + "post_async_query_reasoning_engine_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.AsyncReasoningEngineExecutionServiceRestInterceptor, + "pre_async_query_reasoning_engine", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = ( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest.pb( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + ) + ) + transcode.return_value = { + "method": "post", + "uri": "my_uri", + "body": pb_message, + "query_params": pb_message, + } + + req.return_value = mock.Mock() + req.return_value.status_code = 200 + req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} + return_value = json_format.MessageToJson(operations_pb2.Operation()) + req.return_value.read = mock.AsyncMock(return_value=return_value) + + request = reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = operations_pb2.Operation() + post_with_metadata.return_value = operations_pb2.Operation(), metadata + + await client.async_query_reasoning_engine( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + @pytest.mark.asyncio async def test_get_location_rest_asyncio_bad_request( request_type=locations_pb2.GetLocationRequest, @@ -4572,6 +5349,56 @@ async def test_stream_query_reasoning_engine_empty_call_rest_asyncio(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_async_query_reasoning_engine_empty_call_rest_asyncio(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.async_query_reasoning_engine), "__call__" + ) as call: + await client.async_query_reasoning_engine(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + ) + + assert args[0] == request_msg + + +def test_reasoning_engine_execution_service_rest_asyncio_lro_client(): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + transport = client.transport + + # Ensure that we have an api-core operations client. + assert isinstance( + transport.operations_client, + operations_v1.AsyncOperationsRestClient, + ) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + def test_unsupported_parameter_rest_asyncio(): if not HAS_ASYNC_REST_EXTRA: pytest.skip( @@ -4621,6 +5448,7 @@ def test_reasoning_engine_execution_service_base_transport(): methods = ( "query_reasoning_engine", "stream_query_reasoning_engine", + "async_query_reasoning_engine", "set_iam_policy", "get_iam_policy", "test_iam_permissions", @@ -4639,6 +5467,11 @@ def test_reasoning_engine_execution_service_base_transport(): with pytest.raises(NotImplementedError): transport.close() + # Additionally, the LRO client (a property) should + # also raise NotImplementedError + with pytest.raises(NotImplementedError): + transport.operations_client + # Catch all for all remaining methods and properties remainder = [ "kind", @@ -4906,6 +5739,9 @@ def test_reasoning_engine_execution_service_client_transport_session_collision( session1 = client1.transport.stream_query_reasoning_engine._session session2 = client2.transport.stream_query_reasoning_engine._session assert session1 != session2 + session1 = client1.transport.async_query_reasoning_engine._session + session2 = client2.transport.async_query_reasoning_engine._session + assert session1 != session2 def test_reasoning_engine_execution_service_grpc_transport_channel(): @@ -5037,6 +5873,40 @@ def test_reasoning_engine_execution_service_transport_channel_mtls_with_adc( assert transport.grpc_channel == mock_grpc_channel +def test_reasoning_engine_execution_service_grpc_lro_client(): + client = ReasoningEngineExecutionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + transport = client.transport + + # Ensure that we have a api-core operations client. + assert isinstance( + transport.operations_client, + operations_v1.OperationsClient, + ) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + +def test_reasoning_engine_execution_service_grpc_lro_async_client(): + client = ReasoningEngineExecutionServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", + ) + transport = client.transport + + # Ensure that we have a api-core operations client. + assert isinstance( + transport.operations_client, + operations_v1.OperationsAsyncClient, + ) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + def test_reasoning_engine_path(): project = "squid" location = "clam"