diff --git a/.kokoro/samples/python3.9/common.cfg b/.kokoro/samples/python3.9/common.cfg new file mode 100644 index 0000000000..b1b695fdfc --- /dev/null +++ b/.kokoro/samples/python3.9/common.cfg @@ -0,0 +1,40 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Specify which tests to run +env_vars: { + key: "RUN_TESTS_SESSION" + value: "py-3.9" +} + +# Declare build specific Cloud project. +env_vars: { + key: "BUILD_SPECIFIC_GCLOUD_PROJECT" + value: "python-docs-samples-tests-py39" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-aiplatform/.kokoro/test-samples.sh" +} + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" +} + +# Download secrets for samples +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "python-aiplatform/.kokoro/trampoline_v2.sh" \ No newline at end of file diff --git a/.kokoro/samples/python3.9/continuous.cfg b/.kokoro/samples/python3.9/continuous.cfg new file mode 100644 index 0000000000..a1c8d9759c --- /dev/null +++ b/.kokoro/samples/python3.9/continuous.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.9/periodic-head.cfg b/.kokoro/samples/python3.9/periodic-head.cfg new file mode 100644 index 0000000000..88d5235e34 --- /dev/null +++ b/.kokoro/samples/python3.9/periodic-head.cfg @@ -0,0 +1,11 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-aiplatform/.kokoro/test-samples-against-head.sh" +} diff --git a/.kokoro/samples/python3.9/periodic.cfg b/.kokoro/samples/python3.9/periodic.cfg new file mode 100644 index 0000000000..71cd1e597e --- /dev/null +++ b/.kokoro/samples/python3.9/periodic.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "False" +} diff --git a/.kokoro/samples/python3.9/presubmit.cfg b/.kokoro/samples/python3.9/presubmit.cfg new file mode 100644 index 0000000000..a1c8d9759c --- /dev/null +++ b/.kokoro/samples/python3.9/presubmit.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/docs/aiplatform_v1beta1/reasoning_engine_runtime_revision_service.rst b/docs/aiplatform_v1beta1/reasoning_engine_runtime_revision_service.rst new file mode 100644 index 0000000000..9c5b0ae2f9 --- /dev/null +++ b/docs/aiplatform_v1beta1/reasoning_engine_runtime_revision_service.rst @@ -0,0 +1,10 @@ +ReasoningEngineRuntimeRevisionService +------------------------------------------------------- + +.. automodule:: google.cloud.aiplatform_v1beta1.services.reasoning_engine_runtime_revision_service + :members: + :inherited-members: + +.. automodule:: google.cloud.aiplatform_v1beta1.services.reasoning_engine_runtime_revision_service.pagers + :members: + :inherited-members: diff --git a/docs/aiplatform_v1beta1/services_.rst b/docs/aiplatform_v1beta1/services_.rst index 0d906736bc..1c07eb87ea 100644 --- a/docs/aiplatform_v1beta1/services_.rst +++ b/docs/aiplatform_v1beta1/services_.rst @@ -34,6 +34,7 @@ Services for Google Cloud Aiplatform v1beta1 API pipeline_service prediction_service reasoning_engine_execution_service + reasoning_engine_runtime_revision_service reasoning_engine_service schedule_service session_service diff --git a/google/cloud/aiplatform_v1/__init__.py b/google/cloud/aiplatform_v1/__init__.py index b28c7f0dd6..1534d3093c 100644 --- a/google/cloud/aiplatform_v1/__init__.py +++ b/google/cloud/aiplatform_v1/__init__.py @@ -900,6 +900,12 @@ ) from .types.reasoning_engine_execution_service import AsyncQueryReasoningEngineRequest from .types.reasoning_engine_execution_service import AsyncQueryReasoningEngineResponse +from .types.reasoning_engine_execution_service import ( + CancelAsyncQueryReasoningEngineRequest, +) +from .types.reasoning_engine_execution_service import ( + CancelAsyncQueryReasoningEngineResponse, +) from .types.reasoning_engine_execution_service import QueryReasoningEngineRequest from .types.reasoning_engine_execution_service import QueryReasoningEngineResponse from .types.reasoning_engine_execution_service import StreamQueryReasoningEngineRequest @@ -1338,6 +1344,8 @@ def _get_version(dependency_name): "BlurBaselineConfig", "BoolArray", "CachedContent", + "CancelAsyncQueryReasoningEngineRequest", + "CancelAsyncQueryReasoningEngineResponse", "CancelBatchPredictionJobRequest", "CancelCustomJobRequest", "CancelDataLabelingJobRequest", diff --git a/google/cloud/aiplatform_v1/gapic_metadata.json b/google/cloud/aiplatform_v1/gapic_metadata.json index 7aeb9b5405..df020ac8ac 100644 --- a/google/cloud/aiplatform_v1/gapic_metadata.json +++ b/google/cloud/aiplatform_v1/gapic_metadata.json @@ -4315,6 +4315,11 @@ "async_query_reasoning_engine" ] }, + "CancelAsyncQueryReasoningEngine": { + "methods": [ + "cancel_async_query_reasoning_engine" + ] + }, "QueryReasoningEngine": { "methods": [ "query_reasoning_engine" @@ -4335,6 +4340,11 @@ "async_query_reasoning_engine" ] }, + "CancelAsyncQueryReasoningEngine": { + "methods": [ + "cancel_async_query_reasoning_engine" + ] + }, "QueryReasoningEngine": { "methods": [ "query_reasoning_engine" @@ -4355,6 +4365,11 @@ "async_query_reasoning_engine" ] }, + "CancelAsyncQueryReasoningEngine": { + "methods": [ + "cancel_async_query_reasoning_engine" + ] + }, "QueryReasoningEngine": { "methods": [ "query_reasoning_engine" diff --git a/google/cloud/aiplatform_v1/services/migration_service/client.py b/google/cloud/aiplatform_v1/services/migration_service/client.py index 074244583d..ac9969783e 100644 --- a/google/cloud/aiplatform_v1/services/migration_service/client.py +++ b/google/cloud/aiplatform_v1/services/migration_service/client.py @@ -271,40 +271,40 @@ def parse_annotated_dataset_path(path: str) -> Dict[str, str]: @staticmethod def dataset_path( project: str, - location: str, dataset: str, ) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/locations/{location}/datasets/{dataset}".format( + return "projects/{project}/datasets/{dataset}".format( project=project, - location=location, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match( - r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", - path, - ) + m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) return m.groupdict() if m else {} @staticmethod def dataset_path( project: str, + location: str, dataset: str, ) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/datasets/{dataset}".format( + return "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, + location=location, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", + path, + ) return m.groupdict() if m else {} @staticmethod 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 1657bda42f..da4f4a8568 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 @@ -674,6 +674,103 @@ async def sample_async_query_reasoning_engine(): # Done; return the response. return response + async def cancel_async_query_reasoning_engine( + self, + request: Optional[ + Union[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, + dict, + ] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse: + r"""Cancels an AsyncQueryReasoningEngine operation. + + .. 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_cancel_async_query_reasoning_engine(): + # Create a client + client = aiplatform_v1.ReasoningEngineExecutionServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1.CancelAsyncQueryReasoningEngineRequest( + name="name_value", + operation_name="operation_name_value", + ) + + # Make the request + response = await client.cancel_async_query_reasoning_engine(request=request) + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.cloud.aiplatform_v1.types.CancelAsyncQueryReasoningEngineRequest, dict]]): + The request object. Request message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + 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_v1.types.CancelAsyncQueryReasoningEngineResponse: + Response message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + + """ + # 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.CancelAsyncQueryReasoningEngineRequest, + ): + request = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest( + request + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._client._transport._wrapped_methods[ + self._client._transport.cancel_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, + ) + + # 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 dafb51beb3..6b1ab42adc 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 @@ -1151,6 +1151,103 @@ def sample_async_query_reasoning_engine(): # Done; return the response. return response + def cancel_async_query_reasoning_engine( + self, + request: Optional[ + Union[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, + dict, + ] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse: + r"""Cancels an AsyncQueryReasoningEngine operation. + + .. 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_cancel_async_query_reasoning_engine(): + # Create a client + client = aiplatform_v1.ReasoningEngineExecutionServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1.CancelAsyncQueryReasoningEngineRequest( + name="name_value", + operation_name="operation_name_value", + ) + + # Make the request + response = client.cancel_async_query_reasoning_engine(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1.types.CancelAsyncQueryReasoningEngineRequest, dict]): + The request object. Request message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + 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_v1.types.CancelAsyncQueryReasoningEngineResponse: + Response message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + + """ + # 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.CancelAsyncQueryReasoningEngineRequest, + ): + request = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest( + request + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.cancel_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, + ) + + # 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 ef64a8b119..305f14cf32 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 @@ -158,6 +158,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.cancel_async_query_reasoning_engine: gapic_v1.method.wrap_method( + self.cancel_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, @@ -254,6 +259,20 @@ def async_query_reasoning_engine( ]: raise NotImplementedError() + @property + def cancel_async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest], + Union[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + Awaitable[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse + ], + ], + ]: + 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 092271fa04..2db495b6a8 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 @@ -438,6 +438,38 @@ def async_query_reasoning_engine( ) return self._stubs["async_query_reasoning_engine"] + @property + def cancel_async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest], + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ]: + r"""Return a callable for the cancel async query reasoning + engine method over gRPC. + + Cancels an AsyncQueryReasoningEngine operation. + + Returns: + Callable[[~.CancelAsyncQueryReasoningEngineRequest], + ~.CancelAsyncQueryReasoningEngineResponse]: + 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 "cancel_async_query_reasoning_engine" not in self._stubs: + self._stubs["cancel_async_query_reasoning_engine"] = ( + self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1.ReasoningEngineExecutionService/CancelAsyncQueryReasoningEngine", + request_serializer=reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest.serialize, + response_deserializer=reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.deserialize, + ) + ) + return self._stubs["cancel_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 c8f1da0170..a92d7c4312 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 @@ -446,6 +446,40 @@ def async_query_reasoning_engine( ) return self._stubs["async_query_reasoning_engine"] + @property + def cancel_async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest], + Awaitable[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse + ], + ]: + r"""Return a callable for the cancel async query reasoning + engine method over gRPC. + + Cancels an AsyncQueryReasoningEngine operation. + + Returns: + Callable[[~.CancelAsyncQueryReasoningEngineRequest], + Awaitable[~.CancelAsyncQueryReasoningEngineResponse]]: + 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 "cancel_async_query_reasoning_engine" not in self._stubs: + self._stubs["cancel_async_query_reasoning_engine"] = ( + self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1.ReasoningEngineExecutionService/CancelAsyncQueryReasoningEngine", + request_serializer=reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest.serialize, + response_deserializer=reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.deserialize, + ) + ) + return self._stubs["cancel_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 = { @@ -464,6 +498,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.cancel_async_query_reasoning_engine: self._wrap_method( + self.cancel_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 4934a84cc1..1d26ad78d5 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 @@ -92,6 +92,14 @@ def post_async_query_reasoning_engine(self, response): logging.log(f"Received response: {response}") return response + def pre_cancel_async_query_reasoning_engine(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_cancel_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 @@ -163,6 +171,59 @@ def post_async_query_reasoning_engine_with_metadata( """ return response, metadata + def pre_cancel_async_query_reasoning_engine( + self, + request: reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for cancel_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_cancel_async_query_reasoning_engine( + self, + response: reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ) -> reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse: + """Post-rpc interceptor for cancel_async_query_reasoning_engine + + DEPRECATED. Please use the `post_cancel_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_cancel_async_query_reasoning_engine` interceptor runs + before the `post_cancel_async_query_reasoning_engine_with_metadata` interceptor. + """ + return response + + def post_cancel_async_query_reasoning_engine_with_metadata( + self, + response: reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Post-rpc interceptor for cancel_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_cancel_async_query_reasoning_engine_with_metadata` + interceptor in new development instead of the `post_cancel_async_query_reasoning_engine` interceptor. + When both interceptors are used, this `post_cancel_async_query_reasoning_engine_with_metadata` interceptor runs after the + `post_cancel_async_query_reasoning_engine` interceptor. The (possibly modified) response returned by + `post_cancel_async_query_reasoning_engine` will be passed to + `post_cancel_async_query_reasoning_engine_with_metadata`. + """ + return response, metadata + def pre_query_reasoning_engine( self, request: reasoning_engine_execution_service.QueryReasoningEngineRequest, @@ -2755,6 +2816,176 @@ def __call__( ) return resp + class _CancelAsyncQueryReasoningEngine( + _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine, + ReasoningEngineExecutionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineExecutionServiceRestTransport.CancelAsyncQueryReasoningEngine" + ) + + @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.CancelAsyncQueryReasoningEngineRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse: + r"""Call the cancel async query + reasoning engine method over HTTP. + + Args: + request (~.reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest): + The request object. Request message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + 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.CancelAsyncQueryReasoningEngineResponse: + Response message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + + """ + + http_options = ( + _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine._get_http_options() + ) + + request, metadata = ( + self._interceptor.pre_cancel_async_query_reasoning_engine( + request, metadata + ) + ) + transcoded_request = _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine._get_transcoded_request( + http_options, request + ) + + body = _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine._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.CancelAsyncQueryReasoningEngine", + extra={ + "serviceName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService", + "rpcName": "CancelAsyncQueryReasoningEngine", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineExecutionServiceRestTransport._CancelAsyncQueryReasoningEngine._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.CancelAsyncQueryReasoningEngineResponse() + ) + pb_resp = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.pb( + resp + ) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_cancel_async_query_reasoning_engine(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + self._interceptor.post_cancel_async_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.CancelAsyncQueryReasoningEngineResponse.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.cancel_async_query_reasoning_engine", + extra={ + "serviceName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService", + "rpcName": "CancelAsyncQueryReasoningEngine", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + class _QueryReasoningEngine( _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine, ReasoningEngineExecutionServiceRestStub, @@ -3131,6 +3362,17 @@ def async_query_reasoning_engine( # In C++ this would require a dynamic_cast return self._AsyncQueryReasoningEngine(self._session, self._host, self._interceptor) # type: ignore + @property + def cancel_async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest], + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ]: + # 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._CancelAsyncQueryReasoningEngine(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 0876c4d1b9..beab865f52 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 @@ -109,6 +109,14 @@ async def post_async_query_reasoning_engine(self, response): logging.log(f"Received response: {response}") return response + async def pre_cancel_async_query_reasoning_engine(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + async def post_cancel_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 @@ -180,6 +188,59 @@ async def post_async_query_reasoning_engine_with_metadata( """ return response, metadata + async def pre_cancel_async_query_reasoning_engine( + self, + request: reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for cancel_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_cancel_async_query_reasoning_engine( + self, + response: reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ) -> reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse: + """Post-rpc interceptor for cancel_async_query_reasoning_engine + + DEPRECATED. Please use the `post_cancel_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_cancel_async_query_reasoning_engine` interceptor runs + before the `post_cancel_async_query_reasoning_engine_with_metadata` interceptor. + """ + return response + + async def post_cancel_async_query_reasoning_engine_with_metadata( + self, + response: reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Post-rpc interceptor for cancel_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_cancel_async_query_reasoning_engine_with_metadata` + interceptor in new development instead of the `post_cancel_async_query_reasoning_engine` interceptor. + When both interceptors are used, this `post_cancel_async_query_reasoning_engine_with_metadata` interceptor runs after the + `post_cancel_async_query_reasoning_engine` interceptor. The (possibly modified) response returned by + `post_cancel_async_query_reasoning_engine` will be passed to + `post_cancel_async_query_reasoning_engine_with_metadata`. + """ + return response, metadata + async def pre_query_reasoning_engine( self, request: reasoning_engine_execution_service.QueryReasoningEngineRequest, @@ -620,6 +681,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.cancel_async_query_reasoning_engine: self._wrap_method( + self.cancel_async_query_reasoning_engine, + default_timeout=None, + client_info=client_info, + ), self.get_location: self._wrap_method( self.get_location, default_timeout=None, @@ -848,6 +914,184 @@ async def __call__( return resp + class _CancelAsyncQueryReasoningEngine( + _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine, + AsyncReasoningEngineExecutionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineExecutionServiceRestTransport.CancelAsyncQueryReasoningEngine" + ) + + @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.CancelAsyncQueryReasoningEngineRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse: + r"""Call the cancel async query + reasoning engine method over HTTP. + + Args: + request (~.reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest): + The request object. Request message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + 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: + ~.reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse: + Response message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + + """ + + http_options = ( + _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine._get_http_options() + ) + + request, metadata = ( + await self._interceptor.pre_cancel_async_query_reasoning_engine( + request, metadata + ) + ) + transcoded_request = _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine._get_transcoded_request( + http_options, request + ) + + body = _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine._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.CancelAsyncQueryReasoningEngine", + extra={ + "serviceName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService", + "rpcName": "CancelAsyncQueryReasoningEngine", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineExecutionServiceRestTransport._CancelAsyncQueryReasoningEngine._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 = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + pb_resp = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.pb( + resp + ) + content = await response.read() + json_format.Parse(content, pb_resp, ignore_unknown_fields=True) + resp = await self._interceptor.post_cancel_async_query_reasoning_engine( + resp + ) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + await self._interceptor.post_cancel_async_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.CancelAsyncQueryReasoningEngineResponse.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_v1.ReasoningEngineExecutionServiceAsyncClient.cancel_async_query_reasoning_engine", + extra={ + "serviceName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService", + "rpcName": "CancelAsyncQueryReasoningEngine", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + + return resp + class _QueryReasoningEngine( _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine, AsyncReasoningEngineExecutionServiceRestStub, @@ -3230,6 +3474,15 @@ def async_query_reasoning_engine( ]: return self._AsyncQueryReasoningEngine(self._session, self._host, self._interceptor) # type: ignore + @property + def cancel_async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest], + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ]: + return self._CancelAsyncQueryReasoningEngine(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 68ab560759..4fe32e8973 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 @@ -162,6 +162,70 @@ def _get_query_params_json(transcoded_request): query_params["$alt"] = "json;enum-encoding=int" return query_params + class _BaseCancelAsyncQueryReasoningEngine: + 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/*}:cancelAsyncQuery", + "body": "*", + }, + { + "method": "post", + "uri": "/v1/{name=reasoningEngines/*}:cancelAsyncQuery", + "body": "*", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest.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._BaseCancelAsyncQueryReasoningEngine._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 4edbfef98b..c519fd7465 100644 --- a/google/cloud/aiplatform_v1/types/__init__.py +++ b/google/cloud/aiplatform_v1/types/__init__.py @@ -971,6 +971,8 @@ AsyncQueryReasoningEngineOperationMetadata, AsyncQueryReasoningEngineRequest, AsyncQueryReasoningEngineResponse, + CancelAsyncQueryReasoningEngineRequest, + CancelAsyncQueryReasoningEngineResponse, QueryReasoningEngineRequest, QueryReasoningEngineResponse, StreamQueryReasoningEngineRequest, @@ -2038,6 +2040,8 @@ "AsyncQueryReasoningEngineOperationMetadata", "AsyncQueryReasoningEngineRequest", "AsyncQueryReasoningEngineResponse", + "CancelAsyncQueryReasoningEngineRequest", + "CancelAsyncQueryReasoningEngineResponse", "QueryReasoningEngineRequest", "QueryReasoningEngineResponse", "StreamQueryReasoningEngineRequest", 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 fe8fe31e20..986324b98d 100644 --- a/google/cloud/aiplatform_v1/types/reasoning_engine_execution_service.py +++ b/google/cloud/aiplatform_v1/types/reasoning_engine_execution_service.py @@ -32,6 +32,8 @@ "AsyncQueryReasoningEngineRequest", "AsyncQueryReasoningEngineOperationMetadata", "AsyncQueryReasoningEngineResponse", + "CancelAsyncQueryReasoningEngineRequest", + "CancelAsyncQueryReasoningEngineResponse", }, ) @@ -179,4 +181,36 @@ class AsyncQueryReasoningEngineResponse(proto.Message): ) +class CancelAsyncQueryReasoningEngineRequest(proto.Message): + r"""Request message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + + Attributes: + name (str): + Required. The name of the ReasoningEngine resource to use. + Format: + ``projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`` + operation_name (str): + Required. The name of the longrunning operation returned + from AsyncQueryReasoningEngine. Format: + ``projects/{project}/locations/{location}/operations/{operation}`` + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + operation_name: str = proto.Field( + proto.STRING, + number=2, + ) + + +class CancelAsyncQueryReasoningEngineResponse(proto.Message): + r"""Response message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + + """ + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1/types/tool.py b/google/cloud/aiplatform_v1/types/tool.py index dc2dc99760..18beef18ea 100644 --- a/google/cloud/aiplatform_v1/types/tool.py +++ b/google/cloud/aiplatform_v1/types/tool.py @@ -96,6 +96,12 @@ class Tool(proto.Message): Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. + parallel_ai_search (google.cloud.aiplatform_v1.types.Tool.ParallelAiSearch): + Optional. If specified, Vertex AI will use + Parallel.ai to search for information to answer + user queries. The search results will be + grounded on Parallel.ai and presented to the + model for response generation code_execution (google.cloud.aiplatform_v1.types.Tool.CodeExecution): Optional. CodeExecution tool type. Enables the model to execute code as part of @@ -178,6 +184,44 @@ class GoogleSearch(proto.Message): enum="Tool.PhishBlockThreshold", ) + class ParallelAiSearch(proto.Message): + r"""ParallelAiSearch tool type. + A tool that uses the Parallel.ai search engine for grounding. + + Attributes: + api_key (str): + Optional. The API key for ParallelAiSearch. + If an API key is not provided, the system will + attempt to verify access by checking for an + active Parallel.ai subscription through the + Google Cloud Marketplace. + See + https://docs.parallel.ai/search/search-quickstart + for more details. + custom_configs (google.protobuf.struct_pb2.Struct): + Optional. Custom configs for ParallelAiSearch. This field + can be used to pass any parameter from the Parallel.ai + Search API. See the Parallel.ai documentation for the full + list of available parameters and their usage: + https://docs.parallel.ai/api-reference/search-beta/search + Currently only ``source_policy``, ``excerpts``, + ``max_results``, ``mode``, ``fetch_policy`` can be set via + this field. For example: { "source_policy": { + "include_domains": ["google.com", "wikipedia.org"], + "exclude_domains": ["example.com"] }, "fetch_policy": { + "max_age_seconds": 3600 } } + """ + + api_key: str = proto.Field( + proto.STRING, + number=1, + ) + custom_configs: struct_pb2.Struct = proto.Field( + proto.MESSAGE, + number=3, + message=struct_pb2.Struct, + ) + class CodeExecution(proto.Message): r"""Tool that executes code generated by the model, and automatically returns the result to the model. @@ -259,6 +303,11 @@ class Environment(proto.Enum): number=6, message="EnterpriseWebSearch", ) + parallel_ai_search: ParallelAiSearch = proto.Field( + proto.MESSAGE, + number=13, + message=ParallelAiSearch, + ) code_execution: CodeExecution = proto.Field( proto.MESSAGE, number=4, diff --git a/google/cloud/aiplatform_v1beta1/__init__.py b/google/cloud/aiplatform_v1beta1/__init__.py index 5d2e8430b9..92d690d4cd 100644 --- a/google/cloud/aiplatform_v1beta1/__init__.py +++ b/google/cloud/aiplatform_v1beta1/__init__.py @@ -106,6 +106,12 @@ from .services.reasoning_engine_execution_service import ( ReasoningEngineExecutionServiceAsyncClient, ) +from .services.reasoning_engine_runtime_revision_service import ( + ReasoningEngineRuntimeRevisionServiceClient, +) +from .services.reasoning_engine_runtime_revision_service import ( + ReasoningEngineRuntimeRevisionServiceAsyncClient, +) from .services.reasoning_engine_service import ReasoningEngineServiceClient from .services.reasoning_engine_service import ReasoningEngineServiceAsyncClient from .services.schedule_service import ScheduleServiceClient @@ -1122,9 +1128,31 @@ ) from .types.reasoning_engine_execution_service import AsyncQueryReasoningEngineRequest from .types.reasoning_engine_execution_service import AsyncQueryReasoningEngineResponse +from .types.reasoning_engine_execution_service import ( + CancelAsyncQueryReasoningEngineRequest, +) +from .types.reasoning_engine_execution_service import ( + CancelAsyncQueryReasoningEngineResponse, +) from .types.reasoning_engine_execution_service import QueryReasoningEngineRequest from .types.reasoning_engine_execution_service import QueryReasoningEngineResponse from .types.reasoning_engine_execution_service import StreamQueryReasoningEngineRequest +from .types.reasoning_engine_runtime_revision import ReasoningEngineRuntimeRevision +from .types.reasoning_engine_runtime_revision_service import ( + DeleteReasoningEngineRuntimeRevisionOperationMetadata, +) +from .types.reasoning_engine_runtime_revision_service import ( + DeleteReasoningEngineRuntimeRevisionRequest, +) +from .types.reasoning_engine_runtime_revision_service import ( + GetReasoningEngineRuntimeRevisionRequest, +) +from .types.reasoning_engine_runtime_revision_service import ( + ListReasoningEngineRuntimeRevisionsRequest, +) +from .types.reasoning_engine_runtime_revision_service import ( + ListReasoningEngineRuntimeRevisionsResponse, +) from .types.reasoning_engine_service import CreateReasoningEngineOperationMetadata from .types.reasoning_engine_service import CreateReasoningEngineRequest from .types.reasoning_engine_service import DeleteReasoningEngineRequest @@ -1524,6 +1552,7 @@ def _get_version(dependency_name): "PipelineServiceAsyncClient", "PredictionServiceAsyncClient", "ReasoningEngineExecutionServiceAsyncClient", + "ReasoningEngineRuntimeRevisionServiceAsyncClient", "ReasoningEngineServiceAsyncClient", "ScheduleServiceAsyncClient", "SessionServiceAsyncClient", @@ -1626,6 +1655,8 @@ def _get_version(dependency_name): "BlurBaselineConfig", "BoolArray", "CachedContent", + "CancelAsyncQueryReasoningEngineRequest", + "CancelAsyncQueryReasoningEngineResponse", "CancelBatchPredictionJobRequest", "CancelCustomJobRequest", "CancelDataLabelingJobRequest", @@ -1819,6 +1850,8 @@ def _get_version(dependency_name): "DeleteRagFileRequest", "DeleteRagMetadataRequest", "DeleteReasoningEngineRequest", + "DeleteReasoningEngineRuntimeRevisionOperationMetadata", + "DeleteReasoningEngineRuntimeRevisionRequest", "DeleteSavedQueryRequest", "DeleteScheduleRequest", "DeleteSessionRequest", @@ -2064,6 +2097,7 @@ def _get_version(dependency_name): "GetRagFileRequest", "GetRagMetadataRequest", "GetReasoningEngineRequest", + "GetReasoningEngineRuntimeRevisionRequest", "GetScheduleRequest", "GetSessionRequest", "GetSpecialistPoolRequest", @@ -2228,6 +2262,8 @@ def _get_version(dependency_name): "ListRagFilesResponse", "ListRagMetadataRequest", "ListRagMetadataResponse", + "ListReasoningEngineRuntimeRevisionsRequest", + "ListReasoningEngineRuntimeRevisionsResponse", "ListReasoningEnginesRequest", "ListReasoningEnginesResponse", "ListSavedQueriesRequest", @@ -2483,6 +2519,8 @@ def _get_version(dependency_name): "ReasoningEngine", "ReasoningEngineContextSpec", "ReasoningEngineExecutionServiceClient", + "ReasoningEngineRuntimeRevision", + "ReasoningEngineRuntimeRevisionServiceClient", "ReasoningEngineServiceClient", "ReasoningEngineSpec", "RebaseTunedModelOperationMetadata", diff --git a/google/cloud/aiplatform_v1beta1/gapic_metadata.json b/google/cloud/aiplatform_v1beta1/gapic_metadata.json index 0903836a72..ecf47ccdbd 100644 --- a/google/cloud/aiplatform_v1beta1/gapic_metadata.json +++ b/google/cloud/aiplatform_v1beta1/gapic_metadata.json @@ -5355,6 +5355,11 @@ "async_query_reasoning_engine" ] }, + "CancelAsyncQueryReasoningEngine": { + "methods": [ + "cancel_async_query_reasoning_engine" + ] + }, "QueryReasoningEngine": { "methods": [ "query_reasoning_engine" @@ -5375,6 +5380,11 @@ "async_query_reasoning_engine" ] }, + "CancelAsyncQueryReasoningEngine": { + "methods": [ + "cancel_async_query_reasoning_engine" + ] + }, "QueryReasoningEngine": { "methods": [ "query_reasoning_engine" @@ -5395,6 +5405,11 @@ "async_query_reasoning_engine" ] }, + "CancelAsyncQueryReasoningEngine": { + "methods": [ + "cancel_async_query_reasoning_engine" + ] + }, "QueryReasoningEngine": { "methods": [ "query_reasoning_engine" @@ -5409,6 +5424,70 @@ } } }, + "ReasoningEngineRuntimeRevisionService": { + "clients": { + "grpc": { + "libraryClient": "ReasoningEngineRuntimeRevisionServiceClient", + "rpcs": { + "DeleteReasoningEngineRuntimeRevision": { + "methods": [ + "delete_reasoning_engine_runtime_revision" + ] + }, + "GetReasoningEngineRuntimeRevision": { + "methods": [ + "get_reasoning_engine_runtime_revision" + ] + }, + "ListReasoningEngineRuntimeRevisions": { + "methods": [ + "list_reasoning_engine_runtime_revisions" + ] + } + } + }, + "grpc-async": { + "libraryClient": "ReasoningEngineRuntimeRevisionServiceAsyncClient", + "rpcs": { + "DeleteReasoningEngineRuntimeRevision": { + "methods": [ + "delete_reasoning_engine_runtime_revision" + ] + }, + "GetReasoningEngineRuntimeRevision": { + "methods": [ + "get_reasoning_engine_runtime_revision" + ] + }, + "ListReasoningEngineRuntimeRevisions": { + "methods": [ + "list_reasoning_engine_runtime_revisions" + ] + } + } + }, + "rest": { + "libraryClient": "ReasoningEngineRuntimeRevisionServiceClient", + "rpcs": { + "DeleteReasoningEngineRuntimeRevision": { + "methods": [ + "delete_reasoning_engine_runtime_revision" + ] + }, + "GetReasoningEngineRuntimeRevision": { + "methods": [ + "get_reasoning_engine_runtime_revision" + ] + }, + "ListReasoningEngineRuntimeRevisions": { + "methods": [ + "list_reasoning_engine_runtime_revisions" + ] + } + } + } + } + }, "ReasoningEngineService": { "clients": { "grpc": { 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 5586c52f9b..71f85a1bed 100644 --- a/google/cloud/aiplatform_v1beta1/services/dataset_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/dataset_service/transports/rest.py @@ -2001,6 +2001,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2403,6 +2407,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2853,6 +2861,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3299,6 +3311,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3745,6 +3761,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 d69b2f56b0..9f43acac6e 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 @@ -5562,6 +5562,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -5964,6 +5968,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -6414,6 +6422,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -6860,6 +6872,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -7306,6 +7322,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 29505e10a5..7a1fe6da83 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 @@ -1946,6 +1946,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2367,6 +2371,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2836,6 +2844,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3301,6 +3313,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3766,6 +3782,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 fb95b86af1..d3d9535f55 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 @@ -1157,6 +1157,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1559,6 +1563,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2009,6 +2017,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2455,6 +2467,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2901,6 +2917,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 f9e784e498..b0fd153931 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 @@ -2256,6 +2256,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2658,6 +2662,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3108,6 +3116,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3554,6 +3566,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -4000,6 +4016,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 5c082506f1..d705dbe2a2 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 @@ -1151,6 +1151,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1572,6 +1576,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2041,6 +2049,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2506,6 +2518,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2971,6 +2987,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 06d0b5914f..8b14d36e9b 100644 --- a/google/cloud/aiplatform_v1beta1/services/endpoint_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/endpoint_service/transports/rest.py @@ -1422,6 +1422,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1824,6 +1828,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2274,6 +2282,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2720,6 +2732,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3166,6 +3182,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 7ef61e7240..de2c35ffc3 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 @@ -3339,6 +3339,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -3741,6 +3745,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -4191,6 +4199,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -4637,6 +4649,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -5083,6 +5099,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 79267fad6d..16d1ff99eb 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 @@ -1413,6 +1413,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1834,6 +1838,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2303,6 +2311,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2768,6 +2780,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3233,6 +3249,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 b6d5452984..83dc3c3fa1 100644 --- a/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/evaluation_service/transports/rest.py @@ -977,6 +977,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1379,6 +1383,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1829,6 +1837,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2275,6 +2287,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2721,6 +2737,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 2b873c58a2..b6d58fcda6 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 @@ -1547,6 +1547,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1949,6 +1953,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2399,6 +2407,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2845,6 +2857,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3291,6 +3307,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 3bc5eb9b4d..68fd30a533 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 @@ -1008,6 +1008,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1429,6 +1433,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1898,6 +1906,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2363,6 +2375,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2828,6 +2844,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 0850280fc0..ab1a81b9df 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 @@ -1329,6 +1329,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1731,6 +1735,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2181,6 +2189,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2627,6 +2639,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3073,6 +3089,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 7ad9713367..e666254f58 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 @@ -2895,6 +2895,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -3297,6 +3301,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3747,6 +3755,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -4193,6 +4205,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -4639,6 +4655,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 c1c050cf2a..a9a7df2adc 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 @@ -1310,6 +1310,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1731,6 +1735,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2200,6 +2208,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2665,6 +2677,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3130,6 +3146,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 dc51ff66b2..875857248e 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 @@ -936,6 +936,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1357,6 +1361,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1826,6 +1834,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2291,6 +2303,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2756,6 +2772,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 fc2d71bb6c..8e61e2c08c 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 @@ -1088,6 +1088,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1490,6 +1494,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1940,6 +1948,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2386,6 +2398,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2832,6 +2848,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 0814c913e7..de0f6c92a5 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 @@ -1981,6 +1981,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2383,6 +2387,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2833,6 +2841,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3279,6 +3291,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3725,6 +3741,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 59db4ab89e..a32c42e250 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 @@ -1081,6 +1081,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1502,6 +1506,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1971,6 +1979,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2436,6 +2448,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2901,6 +2917,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 d34017ff41..876926f6a8 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 @@ -1566,6 +1566,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1968,6 +1972,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2418,6 +2426,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2864,6 +2876,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3310,6 +3326,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 dd20bd0e66..46b62438ad 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 @@ -3837,6 +3837,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -4239,6 +4243,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -4689,6 +4697,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -5135,6 +5147,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -5581,6 +5597,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 27d2b36be8..e6e5f25309 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 @@ -1530,6 +1530,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1951,6 +1955,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2420,6 +2428,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2885,6 +2897,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3350,6 +3366,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 d693f36e19..0f977fb377 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 @@ -992,6 +992,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1413,6 +1417,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1882,6 +1890,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2347,6 +2359,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2812,6 +2828,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 04f5d5de82..d2a9298a5e 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 @@ -1906,6 +1906,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2308,6 +2312,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2758,6 +2766,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3204,6 +3216,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3650,6 +3666,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 527c8fc1f2..11da2856ad 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 @@ -5137,6 +5137,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -5539,6 +5543,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -5989,6 +5997,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -6435,6 +6447,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -6881,6 +6897,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 5f3d839916..e2dd7e9cfc 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 @@ -1821,6 +1821,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2242,6 +2246,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2711,6 +2719,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3176,6 +3188,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3641,6 +3657,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 80135a4aae..f9656791d5 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 @@ -1003,6 +1003,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1424,6 +1428,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1893,6 +1901,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2358,6 +2370,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2823,6 +2839,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 e04f16c32b..38ed128d93 100644 --- a/google/cloud/aiplatform_v1beta1/services/featurestore_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/featurestore_service/transports/rest.py @@ -2010,6 +2010,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2412,6 +2416,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2862,6 +2870,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3308,6 +3320,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3754,6 +3770,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 171ae9193d..aec3522f38 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 @@ -5590,6 +5590,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -5992,6 +5996,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -6442,6 +6450,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -6888,6 +6900,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -7334,6 +7350,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 e03521838f..38f27bf89d 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 @@ -1930,6 +1930,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2351,6 +2355,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2820,6 +2828,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3285,6 +3297,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3750,6 +3766,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 d6e976462e..d91a017ffe 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 @@ -1082,6 +1082,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1503,6 +1507,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1972,6 +1980,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2437,6 +2449,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2902,6 +2918,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 da7ffaa119..0d10a3afff 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 @@ -1053,6 +1053,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1455,6 +1459,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1905,6 +1913,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2351,6 +2363,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2797,6 +2813,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 ba28b1c88f..ae28a04e20 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 @@ -1903,6 +1903,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2305,6 +2309,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2755,6 +2763,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3201,6 +3213,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3647,6 +3663,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 d9638b3461..8ea5662c0a 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 @@ -1090,6 +1090,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1511,6 +1515,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1980,6 +1988,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2445,6 +2457,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2910,6 +2926,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 11616084ef..e47fa2e5ea 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 @@ -1263,6 +1263,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1665,6 +1669,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2115,6 +2123,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2561,6 +2573,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3007,6 +3023,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 0c17171219..14b1553505 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 @@ -2661,6 +2661,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -3063,6 +3067,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3513,6 +3521,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3959,6 +3971,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -4405,6 +4421,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 9f575e43fa..46fb79a5c5 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 @@ -1252,6 +1252,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1673,6 +1677,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2142,6 +2150,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2607,6 +2619,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3072,6 +3088,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 2b49d38a65..b323d3d20c 100644 --- a/google/cloud/aiplatform_v1beta1/services/index_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/index_service/transports/rest.py @@ -1250,6 +1250,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1652,6 +1656,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2102,6 +2110,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2548,6 +2560,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2994,6 +3010,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 cfa424a3cd..c8339cd344 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 @@ -2669,6 +2669,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -3071,6 +3075,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3521,6 +3529,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3967,6 +3979,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -4413,6 +4429,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 f015c84c3a..3568944a20 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 @@ -1249,6 +1249,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1670,6 +1674,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2139,6 +2147,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2604,6 +2616,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3069,6 +3085,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 e19f73c98a..a7b6c569f4 100644 --- a/google/cloud/aiplatform_v1beta1/services/job_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/job_service/transports/rest.py @@ -2571,6 +2571,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2973,6 +2977,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3423,6 +3431,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3869,6 +3881,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -4315,6 +4331,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 07a46236ef..b0428be3ee 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 @@ -8338,6 +8338,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -8740,6 +8744,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -9190,6 +9198,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -9636,6 +9648,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -10082,6 +10098,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 e74d28d8f5..97f0b3eec1 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 @@ -2656,6 +2656,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -3077,6 +3081,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3546,6 +3554,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -4011,6 +4023,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -4476,6 +4492,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 7656cd093b..97361862fe 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 @@ -894,6 +894,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1315,6 +1319,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1784,6 +1792,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2249,6 +2261,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2714,6 +2730,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 c677db6ce6..e8b6948c6c 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 @@ -936,6 +936,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1357,6 +1361,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1826,6 +1834,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2291,6 +2303,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2756,6 +2772,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 11ec09165f..6f2e3918a8 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 @@ -1199,6 +1199,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1601,6 +1605,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2051,6 +2059,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2497,6 +2509,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2943,6 +2959,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 5cdbbcee62..670a00cf1d 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 @@ -2430,6 +2430,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2832,6 +2836,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3282,6 +3290,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3728,6 +3740,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -4174,6 +4190,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 f36581afd4..74d6019558 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 @@ -1224,6 +1224,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1645,6 +1649,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2114,6 +2122,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2579,6 +2591,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3044,6 +3060,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 4434970a3b..0678cefb92 100644 --- a/google/cloud/aiplatform_v1beta1/services/metadata_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/metadata_service/transports/rest.py @@ -2638,6 +2638,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -3040,6 +3044,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3490,6 +3498,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3936,6 +3948,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -4382,6 +4398,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 be0aa4bc7f..184629f7b8 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 @@ -8057,6 +8057,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -8459,6 +8463,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -8909,6 +8917,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -9355,6 +9367,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -9801,6 +9817,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 ba1ba221a7..ffed77f4af 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 @@ -2492,6 +2492,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2913,6 +2917,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3382,6 +3390,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3847,6 +3859,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -4312,6 +4328,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 550880c042..0436b3bdad 100644 --- a/google/cloud/aiplatform_v1beta1/services/migration_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/migration_service/transports/rest.py @@ -918,6 +918,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1320,6 +1324,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1770,6 +1778,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2216,6 +2228,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2662,6 +2678,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 76aaab2196..300d796931 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 @@ -1321,6 +1321,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1723,6 +1727,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2173,6 +2181,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2619,6 +2631,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3065,6 +3081,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 d702be4f42..27ecb15ed2 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 @@ -936,6 +936,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1357,6 +1361,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1826,6 +1834,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2291,6 +2303,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2756,6 +2772,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 3b942b1f7b..a71d3af549 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 @@ -1208,6 +1208,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1610,6 +1614,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2060,6 +2068,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2506,6 +2518,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2952,6 +2968,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 705aac85c1..df17d88f8f 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 @@ -2456,6 +2456,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2858,6 +2862,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3308,6 +3316,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3754,6 +3766,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -4200,6 +4216,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 c300162c44..d88d0c8395 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 @@ -1208,6 +1208,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1629,6 +1633,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2098,6 +2106,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2563,6 +2575,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3028,6 +3044,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 4ba43d089d..191ec61f88 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 @@ -1451,6 +1451,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1853,6 +1857,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2303,6 +2311,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2749,6 +2761,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3195,6 +3211,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 85af3b9077..7dc93a79ac 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 @@ -3384,6 +3384,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -3786,6 +3790,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -4236,6 +4244,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -4682,6 +4694,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -5128,6 +5144,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 ee83e64216..948194a0a7 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 @@ -1408,6 +1408,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1829,6 +1833,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2298,6 +2306,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2763,6 +2775,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3228,6 +3244,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 cc4320dc04..4366c72b25 100644 --- a/google/cloud/aiplatform_v1beta1/services/model_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/model_service/transports/rest.py @@ -1950,6 +1950,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2352,6 +2356,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2802,6 +2810,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3248,6 +3260,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3694,6 +3710,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 141b5ce8c0..df79ecc9a7 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 @@ -5410,6 +5410,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -5812,6 +5816,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -6262,6 +6270,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -6708,6 +6720,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -7154,6 +7170,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 7b60e3ad8b..1a05d6d34c 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 @@ -1875,6 +1875,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2296,6 +2300,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2765,6 +2773,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3230,6 +3242,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3695,6 +3711,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 415b290198..c6d6cb48c6 100644 --- a/google/cloud/aiplatform_v1beta1/services/notebook_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/notebook_service/transports/rest.py @@ -1735,6 +1735,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2137,6 +2141,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2587,6 +2595,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3033,6 +3045,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3479,6 +3495,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 65f4998efe..71cfcce97c 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 @@ -4521,6 +4521,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -4923,6 +4927,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -5373,6 +5381,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -5819,6 +5831,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -6265,6 +6281,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 24080e63b1..aa7a272b2e 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 @@ -1656,6 +1656,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2077,6 +2081,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2546,6 +2554,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3011,6 +3023,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3476,6 +3492,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 index 56d8dfee93..2b8bbc8232 100644 --- a/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/online_evaluator_service/transports/rest.py @@ -1206,6 +1206,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1608,6 +1612,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2058,6 +2066,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2504,6 +2516,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2950,6 +2966,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 index 85b855f4a9..b908312eeb 100644 --- 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 @@ -2454,6 +2454,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2856,6 +2860,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3306,6 +3314,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3752,6 +3764,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -4198,6 +4214,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 index 8d6c3b19c6..79e29003e6 100644 --- 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 @@ -1204,6 +1204,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1625,6 +1629,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2094,6 +2102,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2559,6 +2571,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3024,6 +3040,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 7ac71606e9..0f159fa4a9 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 @@ -1151,6 +1151,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1553,6 +1557,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2003,6 +2011,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2449,6 +2461,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2895,6 +2911,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 74ed997973..fd9522c273 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 @@ -2241,6 +2241,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2643,6 +2647,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3093,6 +3101,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3539,6 +3551,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3985,6 +4001,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 1df91b54bb..c142e9c335 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 @@ -1151,6 +1151,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1572,6 +1576,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2041,6 +2049,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2506,6 +2518,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2971,6 +2987,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 515b4df879..91e1565c93 100644 --- a/google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/rest.py @@ -1427,6 +1427,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1829,6 +1833,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2279,6 +2287,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2725,6 +2737,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3171,6 +3187,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 e19bf212a9..b08f56b343 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 @@ -3420,6 +3420,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -3822,6 +3826,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -4272,6 +4280,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -4718,6 +4730,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -5164,6 +5180,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 8dc0021234..4748e7cee2 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 @@ -1453,6 +1453,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1874,6 +1878,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2343,6 +2351,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2808,6 +2820,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3273,6 +3289,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 1824e3afe0..259947cce9 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 @@ -1573,6 +1573,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1994,6 +1998,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2463,6 +2471,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2928,6 +2940,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3393,6 +3409,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 ee9ebbf6fd..640b2fb010 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 @@ -674,6 +674,103 @@ async def sample_async_query_reasoning_engine(): # Done; return the response. return response + async def cancel_async_query_reasoning_engine( + self, + request: Optional[ + Union[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, + dict, + ] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse: + r"""Cancels an AsyncQueryReasoningEngine operation. + + .. 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_cancel_async_query_reasoning_engine(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineExecutionServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.CancelAsyncQueryReasoningEngineRequest( + name="name_value", + operation_name="operation_name_value", + ) + + # Make the request + response = await client.cancel_async_query_reasoning_engine(request=request) + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.cloud.aiplatform_v1beta1.types.CancelAsyncQueryReasoningEngineRequest, dict]]): + The request object. Request message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + 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.CancelAsyncQueryReasoningEngineResponse: + Response message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + + """ + # 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.CancelAsyncQueryReasoningEngineRequest, + ): + request = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest( + request + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._client._transport._wrapped_methods[ + self._client._transport.cancel_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, + ) + + # 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 b29135e3e4..1c40f2790f 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 @@ -1151,6 +1151,103 @@ def sample_async_query_reasoning_engine(): # Done; return the response. return response + def cancel_async_query_reasoning_engine( + self, + request: Optional[ + Union[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, + dict, + ] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse: + r"""Cancels an AsyncQueryReasoningEngine operation. + + .. 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_cancel_async_query_reasoning_engine(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineExecutionServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.CancelAsyncQueryReasoningEngineRequest( + name="name_value", + operation_name="operation_name_value", + ) + + # Make the request + response = client.cancel_async_query_reasoning_engine(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.CancelAsyncQueryReasoningEngineRequest, dict]): + The request object. Request message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + 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.CancelAsyncQueryReasoningEngineResponse: + Response message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + + """ + # 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.CancelAsyncQueryReasoningEngineRequest, + ): + request = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest( + request + ) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.cancel_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, + ) + + # 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 c9ac9c62bf..eef635ecaf 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 @@ -158,6 +158,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.cancel_async_query_reasoning_engine: gapic_v1.method.wrap_method( + self.cancel_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, @@ -254,6 +259,20 @@ def async_query_reasoning_engine( ]: raise NotImplementedError() + @property + def cancel_async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest], + Union[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + Awaitable[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse + ], + ], + ]: + 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 36c16e5125..7838548eb2 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 @@ -438,6 +438,38 @@ def async_query_reasoning_engine( ) return self._stubs["async_query_reasoning_engine"] + @property + def cancel_async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest], + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ]: + r"""Return a callable for the cancel async query reasoning + engine method over gRPC. + + Cancels an AsyncQueryReasoningEngine operation. + + Returns: + Callable[[~.CancelAsyncQueryReasoningEngineRequest], + ~.CancelAsyncQueryReasoningEngineResponse]: + 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 "cancel_async_query_reasoning_engine" not in self._stubs: + self._stubs["cancel_async_query_reasoning_engine"] = ( + self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService/CancelAsyncQueryReasoningEngine", + request_serializer=reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest.serialize, + response_deserializer=reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.deserialize, + ) + ) + return self._stubs["cancel_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 ba885de8de..4609f8370a 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 @@ -446,6 +446,40 @@ def async_query_reasoning_engine( ) return self._stubs["async_query_reasoning_engine"] + @property + def cancel_async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest], + Awaitable[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse + ], + ]: + r"""Return a callable for the cancel async query reasoning + engine method over gRPC. + + Cancels an AsyncQueryReasoningEngine operation. + + Returns: + Callable[[~.CancelAsyncQueryReasoningEngineRequest], + Awaitable[~.CancelAsyncQueryReasoningEngineResponse]]: + 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 "cancel_async_query_reasoning_engine" not in self._stubs: + self._stubs["cancel_async_query_reasoning_engine"] = ( + self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService/CancelAsyncQueryReasoningEngine", + request_serializer=reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest.serialize, + response_deserializer=reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.deserialize, + ) + ) + return self._stubs["cancel_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 = { @@ -464,6 +498,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.cancel_async_query_reasoning_engine: self._wrap_method( + self.cancel_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 715ca2ec2d..ec7679b24a 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 @@ -92,6 +92,14 @@ def post_async_query_reasoning_engine(self, response): logging.log(f"Received response: {response}") return response + def pre_cancel_async_query_reasoning_engine(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_cancel_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 @@ -163,6 +171,59 @@ def post_async_query_reasoning_engine_with_metadata( """ return response, metadata + def pre_cancel_async_query_reasoning_engine( + self, + request: reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for cancel_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_cancel_async_query_reasoning_engine( + self, + response: reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ) -> reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse: + """Post-rpc interceptor for cancel_async_query_reasoning_engine + + DEPRECATED. Please use the `post_cancel_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_cancel_async_query_reasoning_engine` interceptor runs + before the `post_cancel_async_query_reasoning_engine_with_metadata` interceptor. + """ + return response + + def post_cancel_async_query_reasoning_engine_with_metadata( + self, + response: reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Post-rpc interceptor for cancel_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_cancel_async_query_reasoning_engine_with_metadata` + interceptor in new development instead of the `post_cancel_async_query_reasoning_engine` interceptor. + When both interceptors are used, this `post_cancel_async_query_reasoning_engine_with_metadata` interceptor runs after the + `post_cancel_async_query_reasoning_engine` interceptor. The (possibly modified) response returned by + `post_cancel_async_query_reasoning_engine` will be passed to + `post_cancel_async_query_reasoning_engine_with_metadata`. + """ + return response, metadata + def pre_query_reasoning_engine( self, request: reasoning_engine_execution_service.QueryReasoningEngineRequest, @@ -981,6 +1042,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1383,6 +1448,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1833,6 +1902,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2279,6 +2352,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2725,6 +2802,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", @@ -2967,6 +3048,176 @@ def __call__( ) return resp + class _CancelAsyncQueryReasoningEngine( + _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine, + ReasoningEngineExecutionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineExecutionServiceRestTransport.CancelAsyncQueryReasoningEngine" + ) + + @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.CancelAsyncQueryReasoningEngineRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse: + r"""Call the cancel async query + reasoning engine method over HTTP. + + Args: + request (~.reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest): + The request object. Request message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + 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.CancelAsyncQueryReasoningEngineResponse: + Response message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + + """ + + http_options = ( + _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine._get_http_options() + ) + + request, metadata = ( + self._interceptor.pre_cancel_async_query_reasoning_engine( + request, metadata + ) + ) + transcoded_request = _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine._get_transcoded_request( + http_options, request + ) + + body = _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine._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.CancelAsyncQueryReasoningEngine", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService", + "rpcName": "CancelAsyncQueryReasoningEngine", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineExecutionServiceRestTransport._CancelAsyncQueryReasoningEngine._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.CancelAsyncQueryReasoningEngineResponse() + ) + pb_resp = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.pb( + resp + ) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_cancel_async_query_reasoning_engine(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + self._interceptor.post_cancel_async_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.CancelAsyncQueryReasoningEngineResponse.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.cancel_async_query_reasoning_engine", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService", + "rpcName": "CancelAsyncQueryReasoningEngine", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + class _QueryReasoningEngine( _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine, ReasoningEngineExecutionServiceRestStub, @@ -3343,6 +3594,17 @@ def async_query_reasoning_engine( # In C++ this would require a dynamic_cast return self._AsyncQueryReasoningEngine(self._session, self._host, self._interceptor) # type: ignore + @property + def cancel_async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest], + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ]: + # 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._CancelAsyncQueryReasoningEngine(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 4beffc63db..fa59b19f3e 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 @@ -109,6 +109,14 @@ async def post_async_query_reasoning_engine(self, response): logging.log(f"Received response: {response}") return response + async def pre_cancel_async_query_reasoning_engine(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + async def post_cancel_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 @@ -180,6 +188,59 @@ async def post_async_query_reasoning_engine_with_metadata( """ return response, metadata + async def pre_cancel_async_query_reasoning_engine( + self, + request: reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for cancel_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_cancel_async_query_reasoning_engine( + self, + response: reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ) -> reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse: + """Post-rpc interceptor for cancel_async_query_reasoning_engine + + DEPRECATED. Please use the `post_cancel_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_cancel_async_query_reasoning_engine` interceptor runs + before the `post_cancel_async_query_reasoning_engine_with_metadata` interceptor. + """ + return response + + async def post_cancel_async_query_reasoning_engine_with_metadata( + self, + response: reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Post-rpc interceptor for cancel_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_cancel_async_query_reasoning_engine_with_metadata` + interceptor in new development instead of the `post_cancel_async_query_reasoning_engine` interceptor. + When both interceptors are used, this `post_cancel_async_query_reasoning_engine_with_metadata` interceptor runs after the + `post_cancel_async_query_reasoning_engine` interceptor. The (possibly modified) response returned by + `post_cancel_async_query_reasoning_engine` will be passed to + `post_cancel_async_query_reasoning_engine_with_metadata`. + """ + return response, metadata + async def pre_query_reasoning_engine( self, request: reasoning_engine_execution_service.QueryReasoningEngineRequest, @@ -620,6 +681,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.cancel_async_query_reasoning_engine: self._wrap_method( + self.cancel_async_query_reasoning_engine, + default_timeout=None, + client_info=client_info, + ), self.get_location: self._wrap_method( self.get_location, default_timeout=None, @@ -848,6 +914,184 @@ async def __call__( return resp + class _CancelAsyncQueryReasoningEngine( + _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine, + AsyncReasoningEngineExecutionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineExecutionServiceRestTransport.CancelAsyncQueryReasoningEngine" + ) + + @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.CancelAsyncQueryReasoningEngineRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse: + r"""Call the cancel async query + reasoning engine method over HTTP. + + Args: + request (~.reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest): + The request object. Request message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + 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: + ~.reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse: + Response message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + + """ + + http_options = ( + _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine._get_http_options() + ) + + request, metadata = ( + await self._interceptor.pre_cancel_async_query_reasoning_engine( + request, metadata + ) + ) + transcoded_request = _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine._get_transcoded_request( + http_options, request + ) + + body = _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineExecutionServiceRestTransport._BaseCancelAsyncQueryReasoningEngine._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.CancelAsyncQueryReasoningEngine", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService", + "rpcName": "CancelAsyncQueryReasoningEngine", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineExecutionServiceRestTransport._CancelAsyncQueryReasoningEngine._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 = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + pb_resp = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.pb( + resp + ) + content = await response.read() + json_format.Parse(content, pb_resp, ignore_unknown_fields=True) + resp = await self._interceptor.post_cancel_async_query_reasoning_engine( + resp + ) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + await self._interceptor.post_cancel_async_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.CancelAsyncQueryReasoningEngineResponse.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.ReasoningEngineExecutionServiceAsyncClient.cancel_async_query_reasoning_engine", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService", + "rpcName": "CancelAsyncQueryReasoningEngine", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + + return resp + class _QueryReasoningEngine( _BaseReasoningEngineExecutionServiceRestTransport._BaseQueryReasoningEngine, AsyncReasoningEngineExecutionServiceRestStub, @@ -1607,6 +1851,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2009,6 +2257,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2459,6 +2711,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2905,6 +3161,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3351,6 +3611,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", @@ -3442,6 +3706,15 @@ def async_query_reasoning_engine( ]: return self._AsyncQueryReasoningEngine(self._session, self._host, self._interceptor) # type: ignore + @property + def cancel_async_query_reasoning_engine( + self, + ) -> Callable[ + [reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest], + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ]: + return self._CancelAsyncQueryReasoningEngine(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 0684bac86e..793790da1f 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 @@ -162,6 +162,70 @@ def _get_query_params_json(transcoded_request): query_params["$alt"] = "json;enum-encoding=int" return query_params + class _BaseCancelAsyncQueryReasoningEngine: + 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/*}:cancelAsyncQuery", + "body": "*", + }, + { + "method": "post", + "uri": "/v1beta1/{name=reasoningEngines/*}:cancelAsyncQuery", + "body": "*", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest.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._BaseCancelAsyncQueryReasoningEngine._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.") @@ -184,6 +248,11 @@ def _get_http_options(): "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*}:query", "body": "*", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}:query", + "body": "*", + }, { "method": "post", "uri": "/v1beta1/{name=reasoningEngines/*}:query", @@ -250,6 +319,11 @@ def _get_http_options(): "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*}:streamQuery", "body": "*", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}:streamQuery", + "body": "*", + }, { "method": "post", "uri": "/v1beta1/{name=reasoningEngines/*}:streamQuery", @@ -1023,6 +1097,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1444,6 +1522,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1913,6 +1995,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2378,6 +2464,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2843,6 +2933,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/__init__.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/__init__.py new file mode 100644 index 0000000000..5da559020e --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_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 ReasoningEngineRuntimeRevisionServiceClient +from .async_client import ReasoningEngineRuntimeRevisionServiceAsyncClient + +__all__ = ( + "ReasoningEngineRuntimeRevisionServiceClient", + "ReasoningEngineRuntimeRevisionServiceAsyncClient", +) diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/async_client.py new file mode 100644 index 0000000000..81a6aff980 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/async_client.py @@ -0,0 +1,1476 @@ +# -*- 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.reasoning_engine_runtime_revision_service import ( + pagers, +) +from google.cloud.aiplatform_v1beta1.types import reasoning_engine +from google.cloud.aiplatform_v1beta1.types import reasoning_engine_runtime_revision +from google.cloud.aiplatform_v1beta1.types import ( + reasoning_engine_runtime_revision_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.timestamp_pb2 as timestamp_pb2 # type: ignore +from .transports.base import ( + ReasoningEngineRuntimeRevisionServiceTransport, + DEFAULT_CLIENT_INFO, +) +from .transports.grpc_asyncio import ( + ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, +) +from .client import ReasoningEngineRuntimeRevisionServiceClient + +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 ReasoningEngineRuntimeRevisionServiceAsyncClient: + """Manages Vertex AI's Reasoning Engine Revisions.""" + + _client: ReasoningEngineRuntimeRevisionServiceClient + + # Copy defaults from the synchronous client for use here. + # Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead. + DEFAULT_ENDPOINT = ReasoningEngineRuntimeRevisionServiceClient.DEFAULT_ENDPOINT + DEFAULT_MTLS_ENDPOINT = ( + ReasoningEngineRuntimeRevisionServiceClient.DEFAULT_MTLS_ENDPOINT + ) + _DEFAULT_ENDPOINT_TEMPLATE = ( + ReasoningEngineRuntimeRevisionServiceClient._DEFAULT_ENDPOINT_TEMPLATE + ) + _DEFAULT_UNIVERSE = ReasoningEngineRuntimeRevisionServiceClient._DEFAULT_UNIVERSE + + git_repository_link_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.git_repository_link_path + ) + parse_git_repository_link_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.parse_git_repository_link_path + ) + network_attachment_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.network_attachment_path + ) + parse_network_attachment_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.parse_network_attachment_path + ) + reasoning_engine_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.reasoning_engine_path + ) + parse_reasoning_engine_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.parse_reasoning_engine_path + ) + reasoning_engine_runtime_revision_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.reasoning_engine_runtime_revision_path + ) + parse_reasoning_engine_runtime_revision_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.parse_reasoning_engine_runtime_revision_path + ) + common_billing_account_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.common_billing_account_path + ) + parse_common_billing_account_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.parse_common_billing_account_path + ) + common_folder_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.common_folder_path + ) + parse_common_folder_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.parse_common_folder_path + ) + common_organization_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.common_organization_path + ) + parse_common_organization_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.parse_common_organization_path + ) + common_project_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.common_project_path + ) + parse_common_project_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.parse_common_project_path + ) + common_location_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.common_location_path + ) + parse_common_location_path = staticmethod( + ReasoningEngineRuntimeRevisionServiceClient.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: + ReasoningEngineRuntimeRevisionServiceAsyncClient: The constructed client. + """ + sa_info_func = ( + ReasoningEngineRuntimeRevisionServiceClient.from_service_account_info.__func__ # type: ignore + ) + return sa_info_func( + ReasoningEngineRuntimeRevisionServiceAsyncClient, 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: + ReasoningEngineRuntimeRevisionServiceAsyncClient: The constructed client. + """ + sa_file_func = ( + ReasoningEngineRuntimeRevisionServiceClient.from_service_account_file.__func__ # type: ignore + ) + return sa_file_func( + ReasoningEngineRuntimeRevisionServiceAsyncClient, 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 ReasoningEngineRuntimeRevisionServiceClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore + + @property + def transport(self) -> ReasoningEngineRuntimeRevisionServiceTransport: + """Returns the transport used by the client instance. + + Returns: + ReasoningEngineRuntimeRevisionServiceTransport: 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 = ( + ReasoningEngineRuntimeRevisionServiceClient.get_transport_class + ) + + def __init__( + self, + *, + credentials: Optional[ga_credentials.Credentials] = None, + transport: Optional[ + Union[ + str, + ReasoningEngineRuntimeRevisionServiceTransport, + Callable[..., ReasoningEngineRuntimeRevisionServiceTransport], + ] + ] = "grpc_asyncio", + client_options: Optional[ClientOptions] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + ) -> None: + """Instantiates the reasoning engine runtime revision 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,ReasoningEngineRuntimeRevisionServiceTransport,Callable[..., ReasoningEngineRuntimeRevisionServiceTransport]]]): + 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 ReasoningEngineRuntimeRevisionServiceTransport 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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.ReasoningEngineRuntimeRevisionServiceAsyncClient`.", + extra=( + { + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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.ReasoningEngineRuntimeRevisionService", + "credentialsType": None, + } + ), + ) + + async def get_reasoning_engine_runtime_revision( + self, + request: Optional[ + Union[ + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, + 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]]] = (), + ) -> reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision: + r"""Gets a reasoning engine runtime revision. + + .. 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_reasoning_engine_runtime_revision(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.GetReasoningEngineRuntimeRevisionRequest( + name="name_value", + ) + + # Make the request + response = await client.get_reasoning_engine_runtime_revision(request=request) + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.cloud.aiplatform_v1beta1.types.GetReasoningEngineRuntimeRevisionRequest, dict]]): + The request object. Request message for + [ReasoningEngineRuntimeRevisionService.GetReasoningEngineRuntimeRevision][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.GetReasoningEngineRuntimeRevision]. + name (:class:`str`): + Required. The name of the ReasoningEngineRuntimeRevision + resource. Format: + ``projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/runtimeRevisions/{runtimeRevision}`` + + 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.ReasoningEngineRuntimeRevision: + ReasoningEngineRuntimeRevision is a + specific version of the runtime related + part of ReasoningEngine. Contains only + the fields that are revision specific. + + """ + # 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, + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, + ): + request = reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest( + 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_reasoning_engine_runtime_revision + ] + + # 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_reasoning_engine_runtime_revisions( + self, + request: Optional[ + Union[ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, + 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.ListReasoningEngineRuntimeRevisionsAsyncPager: + r"""Lists runtime revisions in 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_list_reasoning_engine_runtime_revisions(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.ListReasoningEngineRuntimeRevisionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_reasoning_engine_runtime_revisions(request=request) + + # Handle the response + async for response in page_result: + print(response) + + Args: + request (Optional[Union[google.cloud.aiplatform_v1beta1.types.ListReasoningEngineRuntimeRevisionsRequest, dict]]): + The request object. Request message for + [ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions]. + parent (:class:`str`): + Required. The resource name of the ReasoningEngine to + list the ReasoningEngineRuntimeRevisions from. Format: + ``projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`` + + 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.reasoning_engine_runtime_revision_service.pagers.ListReasoningEngineRuntimeRevisionsAsyncPager: + Response message for + [ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions] + + 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, + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, + ): + request = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest( + 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_reasoning_engine_runtime_revisions + ] + + # 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.ListReasoningEngineRuntimeRevisionsAsyncPager( + method=rpc, + request=request, + response=response, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def delete_reasoning_engine_runtime_revision( + self, + request: Optional[ + Union[ + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, + 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 a reasoning engine revision. + + .. 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_reasoning_engine_runtime_revision(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.DeleteReasoningEngineRuntimeRevisionRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_reasoning_engine_runtime_revision(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.DeleteReasoningEngineRuntimeRevisionRequest, dict]]): + The request object. Request message for + [ReasoningEngineRuntimeRevisionService.DeleteReasoningEngineRuntimeRevision][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.DeleteReasoningEngineRuntimeRevision]. + name (:class:`str`): + Required. The name of the ReasoningEngineRuntimeRevision + resource to be deleted. Format: + ``projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/runtimeRevisions/{runtime_revision}`` + + 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, + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, + ): + request = reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest( + 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_reasoning_engine_runtime_revision + ] + + # 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=reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionOperationMetadata, + ) + + # 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) -> "ReasoningEngineRuntimeRevisionServiceAsyncClient": + 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__ = ("ReasoningEngineRuntimeRevisionServiceAsyncClient",) diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/client.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/client.py new file mode 100644 index 0000000000..023d694c61 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/client.py @@ -0,0 +1,2044 @@ +# -*- 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.reasoning_engine_runtime_revision_service import ( + pagers, +) +from google.cloud.aiplatform_v1beta1.types import reasoning_engine +from google.cloud.aiplatform_v1beta1.types import reasoning_engine_runtime_revision +from google.cloud.aiplatform_v1beta1.types import ( + reasoning_engine_runtime_revision_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.timestamp_pb2 as timestamp_pb2 # type: ignore +from .transports.base import ( + ReasoningEngineRuntimeRevisionServiceTransport, + DEFAULT_CLIENT_INFO, +) +from .transports.grpc import ReasoningEngineRuntimeRevisionServiceGrpcTransport +from .transports.grpc_asyncio import ( + ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, +) +from .transports.rest import ReasoningEngineRuntimeRevisionServiceRestTransport + +try: + from .transports.rest_asyncio import ( + AsyncReasoningEngineRuntimeRevisionServiceRestTransport, + ) + + HAS_ASYNC_REST_DEPENDENCIES = True +except ImportError as e: # pragma: NO COVER + HAS_ASYNC_REST_DEPENDENCIES = False + ASYNC_REST_EXCEPTION = e + + +class ReasoningEngineRuntimeRevisionServiceClientMeta(type): + """Metaclass for the ReasoningEngineRuntimeRevisionService 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[ReasoningEngineRuntimeRevisionServiceTransport]] + _transport_registry["grpc"] = ReasoningEngineRuntimeRevisionServiceGrpcTransport + _transport_registry["grpc_asyncio"] = ( + ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport + ) + _transport_registry["rest"] = ReasoningEngineRuntimeRevisionServiceRestTransport + if HAS_ASYNC_REST_DEPENDENCIES: # pragma: NO COVER + _transport_registry["rest_asyncio"] = ( + AsyncReasoningEngineRuntimeRevisionServiceRestTransport + ) + + def get_transport_class( + cls, + label: Optional[str] = None, + ) -> Type[ReasoningEngineRuntimeRevisionServiceTransport]: + """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 ReasoningEngineRuntimeRevisionServiceClient( + metaclass=ReasoningEngineRuntimeRevisionServiceClientMeta +): + """Manages Vertex AI's Reasoning Engine Revisions.""" + + @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: + ReasoningEngineRuntimeRevisionServiceClient: 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: + ReasoningEngineRuntimeRevisionServiceClient: 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) -> ReasoningEngineRuntimeRevisionServiceTransport: + """Returns the transport used by the client instance. + + Returns: + ReasoningEngineRuntimeRevisionServiceTransport: The transport used by the client + instance. + """ + return self._transport + + @staticmethod + def git_repository_link_path( + project: str, + location: str, + connection: str, + git_repository_link: str, + ) -> str: + """Returns a fully-qualified git_repository_link string.""" + return "projects/{project}/locations/{location}/connections/{connection}/gitRepositoryLinks/{git_repository_link}".format( + project=project, + location=location, + connection=connection, + git_repository_link=git_repository_link, + ) + + @staticmethod + def parse_git_repository_link_path(path: str) -> Dict[str, str]: + """Parses a git_repository_link path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/connections/(?P.+?)/gitRepositoryLinks/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def network_attachment_path( + project: str, + region: str, + networkattachment: str, + ) -> str: + """Returns a fully-qualified network_attachment string.""" + return "projects/{project}/regions/{region}/networkAttachments/{networkattachment}".format( + project=project, + region=region, + networkattachment=networkattachment, + ) + + @staticmethod + def parse_network_attachment_path(path: str) -> Dict[str, str]: + """Parses a network_attachment path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/regions/(?P.+?)/networkAttachments/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def reasoning_engine_path( + project: str, + location: str, + reasoning_engine: str, + ) -> str: + """Returns a fully-qualified reasoning_engine string.""" + return "projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}".format( + project=project, + location=location, + reasoning_engine=reasoning_engine, + ) + + @staticmethod + def parse_reasoning_engine_path(path: str) -> Dict[str, str]: + """Parses a reasoning_engine path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/reasoningEngines/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def reasoning_engine_runtime_revision_path( + project: str, + location: str, + reasoning_engine: str, + runtime_revision: str, + ) -> str: + """Returns a fully-qualified reasoning_engine_runtime_revision string.""" + return "projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/runtimeRevisions/{runtime_revision}".format( + project=project, + location=location, + reasoning_engine=reasoning_engine, + runtime_revision=runtime_revision, + ) + + @staticmethod + def parse_reasoning_engine_runtime_revision_path(path: str) -> Dict[str, str]: + """Parses a reasoning_engine_runtime_revision path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/reasoningEngines/(?P.+?)/runtimeRevisions/(?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 = ( + ReasoningEngineRuntimeRevisionServiceClient._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 = ( + ReasoningEngineRuntimeRevisionServiceClient._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 = ( + ReasoningEngineRuntimeRevisionServiceClient._DEFAULT_UNIVERSE + ) + if universe_domain != _default_universe: + raise MutualTLSChannelError( + f"mTLS is not supported in any universe other than {_default_universe}." + ) + api_endpoint = ( + ReasoningEngineRuntimeRevisionServiceClient.DEFAULT_MTLS_ENDPOINT + ) + else: + api_endpoint = ReasoningEngineRuntimeRevisionServiceClient._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 = ReasoningEngineRuntimeRevisionServiceClient._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, + ReasoningEngineRuntimeRevisionServiceTransport, + Callable[..., ReasoningEngineRuntimeRevisionServiceTransport], + ] + ] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + ) -> None: + """Instantiates the reasoning engine runtime revision 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,ReasoningEngineRuntimeRevisionServiceTransport,Callable[..., ReasoningEngineRuntimeRevisionServiceTransport]]]): + 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 ReasoningEngineRuntimeRevisionServiceTransport 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 = ( + ReasoningEngineRuntimeRevisionServiceClient._read_environment_variables() + ) + self._client_cert_source = ( + ReasoningEngineRuntimeRevisionServiceClient._get_client_cert_source( + self._client_options.client_cert_source, self._use_client_cert + ) + ) + self._universe_domain = ( + ReasoningEngineRuntimeRevisionServiceClient._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, ReasoningEngineRuntimeRevisionServiceTransport + ) + if transport_provided: + # transport is a ReasoningEngineRuntimeRevisionServiceTransport 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( + ReasoningEngineRuntimeRevisionServiceTransport, transport + ) + self._api_endpoint = self._transport.host + + self._api_endpoint = ( + self._api_endpoint + or ReasoningEngineRuntimeRevisionServiceClient._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[ReasoningEngineRuntimeRevisionServiceTransport], + Callable[..., ReasoningEngineRuntimeRevisionServiceTransport], + ] = ( + ReasoningEngineRuntimeRevisionServiceClient.get_transport_class( + transport + ) + if isinstance(transport, str) or transport is None + else cast( + Callable[..., ReasoningEngineRuntimeRevisionServiceTransport], + 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.ReasoningEngineRuntimeRevisionServiceClient`.", + extra=( + { + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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.ReasoningEngineRuntimeRevisionService", + "credentialsType": None, + } + ), + ) + + def get_reasoning_engine_runtime_revision( + self, + request: Optional[ + Union[ + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, + 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]]] = (), + ) -> reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision: + r"""Gets a reasoning engine runtime revision. + + .. 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_reasoning_engine_runtime_revision(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.GetReasoningEngineRuntimeRevisionRequest( + name="name_value", + ) + + # Make the request + response = client.get_reasoning_engine_runtime_revision(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.GetReasoningEngineRuntimeRevisionRequest, dict]): + The request object. Request message for + [ReasoningEngineRuntimeRevisionService.GetReasoningEngineRuntimeRevision][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.GetReasoningEngineRuntimeRevision]. + name (str): + Required. The name of the ReasoningEngineRuntimeRevision + resource. Format: + ``projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/runtimeRevisions/{runtimeRevision}`` + + 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.ReasoningEngineRuntimeRevision: + ReasoningEngineRuntimeRevision is a + specific version of the runtime related + part of ReasoningEngine. Contains only + the fields that are revision specific. + + """ + # 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, + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, + ): + request = reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest( + 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_reasoning_engine_runtime_revision + ] + + # 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 list_reasoning_engine_runtime_revisions( + self, + request: Optional[ + Union[ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, + 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.ListReasoningEngineRuntimeRevisionsPager: + r"""Lists runtime revisions in 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_list_reasoning_engine_runtime_revisions(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.ListReasoningEngineRuntimeRevisionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_reasoning_engine_runtime_revisions(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.ListReasoningEngineRuntimeRevisionsRequest, dict]): + The request object. Request message for + [ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions]. + parent (str): + Required. The resource name of the ReasoningEngine to + list the ReasoningEngineRuntimeRevisions from. Format: + ``projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`` + + 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.reasoning_engine_runtime_revision_service.pagers.ListReasoningEngineRuntimeRevisionsPager: + Response message for + [ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions] + + 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, + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, + ): + request = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest( + 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_reasoning_engine_runtime_revisions + ] + + # 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.ListReasoningEngineRuntimeRevisionsPager( + method=rpc, + request=request, + response=response, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def delete_reasoning_engine_runtime_revision( + self, + request: Optional[ + Union[ + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, + 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 a reasoning engine revision. + + .. 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_reasoning_engine_runtime_revision(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.DeleteReasoningEngineRuntimeRevisionRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_reasoning_engine_runtime_revision(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.DeleteReasoningEngineRuntimeRevisionRequest, dict]): + The request object. Request message for + [ReasoningEngineRuntimeRevisionService.DeleteReasoningEngineRuntimeRevision][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.DeleteReasoningEngineRuntimeRevision]. + name (str): + Required. The name of the ReasoningEngineRuntimeRevision + resource to be deleted. Format: + ``projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/runtimeRevisions/{runtime_revision}`` + + 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, + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, + ): + request = reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest( + 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_reasoning_engine_runtime_revision + ] + + # 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=reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionOperationMetadata, + ) + + # Done; return the response. + return response + + def __enter__(self) -> "ReasoningEngineRuntimeRevisionServiceClient": + 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__ = ("ReasoningEngineRuntimeRevisionServiceClient",) diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/pagers.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/pagers.py new file mode 100644 index 0000000000..8dde57b3e9 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/pagers.py @@ -0,0 +1,225 @@ +# -*- 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 reasoning_engine_runtime_revision +from google.cloud.aiplatform_v1beta1.types import ( + reasoning_engine_runtime_revision_service, +) + + +class ListReasoningEngineRuntimeRevisionsPager: + """A pager for iterating through ``list_reasoning_engine_runtime_revisions`` requests. + + This class thinly wraps an initial + :class:`google.cloud.aiplatform_v1beta1.types.ListReasoningEngineRuntimeRevisionsResponse` object, and + provides an ``__iter__`` method to iterate through its + ``reasoning_engine_runtime_revisions`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``ListReasoningEngineRuntimeRevisions`` requests and continue to iterate + through the ``reasoning_engine_runtime_revisions`` field on the + corresponding responses. + + All the usual :class:`google.cloud.aiplatform_v1beta1.types.ListReasoningEngineRuntimeRevisionsResponse` + 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[ + ..., + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse, + ], + request: reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, + response: reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse, + *, + 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.ListReasoningEngineRuntimeRevisionsRequest): + The initial request object. + response (google.cloud.aiplatform_v1beta1.types.ListReasoningEngineRuntimeRevisionsResponse): + 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 = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest( + 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[ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse + ]: + 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[reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision]: + for page in self.pages: + yield from page.reasoning_engine_runtime_revisions + + def __repr__(self) -> str: + return "{0}<{1!r}>".format(self.__class__.__name__, self._response) + + +class ListReasoningEngineRuntimeRevisionsAsyncPager: + """A pager for iterating through ``list_reasoning_engine_runtime_revisions`` requests. + + This class thinly wraps an initial + :class:`google.cloud.aiplatform_v1beta1.types.ListReasoningEngineRuntimeRevisionsResponse` object, and + provides an ``__aiter__`` method to iterate through its + ``reasoning_engine_runtime_revisions`` field. + + If there are more pages, the ``__aiter__`` method will make additional + ``ListReasoningEngineRuntimeRevisions`` requests and continue to iterate + through the ``reasoning_engine_runtime_revisions`` field on the + corresponding responses. + + All the usual :class:`google.cloud.aiplatform_v1beta1.types.ListReasoningEngineRuntimeRevisionsResponse` + 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[ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse + ], + ], + request: reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, + response: reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse, + *, + 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.ListReasoningEngineRuntimeRevisionsRequest): + The initial request object. + response (google.cloud.aiplatform_v1beta1.types.ListReasoningEngineRuntimeRevisionsResponse): + 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 = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest( + 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[ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse + ]: + 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[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision + ]: + async def async_generator(): + async for page in self.pages: + for response in page.reasoning_engine_runtime_revisions: + 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/reasoning_engine_runtime_revision_service/transports/README.rst b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/README.rst new file mode 100644 index 0000000000..4dc8f57943 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/README.rst @@ -0,0 +1,9 @@ + +transport inheritance structure +_______________________________ + +`ReasoningEngineRuntimeRevisionServiceTransport` is the ABC for all transports. +- public child `ReasoningEngineRuntimeRevisionServiceGrpcTransport` for sync gRPC transport (defined in `grpc.py`). +- public child `ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). +- private child `_BaseReasoningEngineRuntimeRevisionServiceRestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). +- public child `ReasoningEngineRuntimeRevisionServiceRestTransport` 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/reasoning_engine_runtime_revision_service/transports/__init__.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/__init__.py new file mode 100644 index 0000000000..70420e9602 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/__init__.py @@ -0,0 +1,60 @@ +# -*- 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 ReasoningEngineRuntimeRevisionServiceTransport +from .grpc import ReasoningEngineRuntimeRevisionServiceGrpcTransport +from .grpc_asyncio import ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport +from .rest import ReasoningEngineRuntimeRevisionServiceRestTransport +from .rest import ReasoningEngineRuntimeRevisionServiceRestInterceptor + +ASYNC_REST_CLASSES: Tuple[str, ...] +try: + from .rest_asyncio import AsyncReasoningEngineRuntimeRevisionServiceRestTransport + from .rest_asyncio import AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor + + ASYNC_REST_CLASSES = ( + "AsyncReasoningEngineRuntimeRevisionServiceRestTransport", + "AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor", + ) + 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[ReasoningEngineRuntimeRevisionServiceTransport]] +_transport_registry["grpc"] = ReasoningEngineRuntimeRevisionServiceGrpcTransport +_transport_registry["grpc_asyncio"] = ( + ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport +) +_transport_registry["rest"] = ReasoningEngineRuntimeRevisionServiceRestTransport +if HAS_REST_ASYNC: # pragma: NO COVER + _transport_registry["rest_asyncio"] = ( + AsyncReasoningEngineRuntimeRevisionServiceRestTransport + ) + +__all__ = ( + "ReasoningEngineRuntimeRevisionServiceTransport", + "ReasoningEngineRuntimeRevisionServiceGrpcTransport", + "ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport", + "ReasoningEngineRuntimeRevisionServiceRestTransport", + "ReasoningEngineRuntimeRevisionServiceRestInterceptor", +) + ASYNC_REST_CLASSES diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/base.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/base.py new file mode 100644 index 0000000000..a2d1238856 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/base.py @@ -0,0 +1,374 @@ +# -*- 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 reasoning_engine_runtime_revision +from google.cloud.aiplatform_v1beta1.types import ( + reasoning_engine_runtime_revision_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 ReasoningEngineRuntimeRevisionServiceTransport(abc.ABC): + """Abstract transport class for ReasoningEngineRuntimeRevisionService.""" + + 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.get_reasoning_engine_runtime_revision: gapic_v1.method.wrap_method( + self.get_reasoning_engine_runtime_revision, + default_timeout=None, + client_info=client_info, + ), + self.list_reasoning_engine_runtime_revisions: gapic_v1.method.wrap_method( + self.list_reasoning_engine_runtime_revisions, + default_timeout=None, + client_info=client_info, + ), + self.delete_reasoning_engine_runtime_revision: gapic_v1.method.wrap_method( + self.delete_reasoning_engine_runtime_revision, + 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 get_reasoning_engine_runtime_revision( + self, + ) -> Callable[ + [ + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest + ], + Union[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision, + Awaitable[reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision], + ], + ]: + raise NotImplementedError() + + @property + def list_reasoning_engine_runtime_revisions( + self, + ) -> Callable[ + [ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest + ], + Union[ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse, + Awaitable[ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse + ], + ], + ]: + raise NotImplementedError() + + @property + def delete_reasoning_engine_runtime_revision( + self, + ) -> Callable[ + [ + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest + ], + 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__ = ("ReasoningEngineRuntimeRevisionServiceTransport",) diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/grpc.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/grpc.py new file mode 100644 index 0000000000..09e0b7ef83 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/grpc.py @@ -0,0 +1,665 @@ +# -*- 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 reasoning_engine_runtime_revision +from google.cloud.aiplatform_v1beta1.types import ( + reasoning_engine_runtime_revision_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 ReasoningEngineRuntimeRevisionServiceTransport, 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.ReasoningEngineRuntimeRevisionService", + "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.ReasoningEngineRuntimeRevisionService", + "rpcName": client_call_details.method, + "response": grpc_response, + "metadata": grpc_response["metadata"], + }, + ) + return response + + +class ReasoningEngineRuntimeRevisionServiceGrpcTransport( + ReasoningEngineRuntimeRevisionServiceTransport +): + """gRPC backend transport for ReasoningEngineRuntimeRevisionService. + + Manages Vertex AI's Reasoning Engine Revisions. + + 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 get_reasoning_engine_runtime_revision( + self, + ) -> Callable[ + [ + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest + ], + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision, + ]: + r"""Return a callable for the get reasoning engine runtime + revision method over gRPC. + + Gets a reasoning engine runtime revision. + + Returns: + Callable[[~.GetReasoningEngineRuntimeRevisionRequest], + ~.ReasoningEngineRuntimeRevision]: + 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_reasoning_engine_runtime_revision" not in self._stubs: + self._stubs["get_reasoning_engine_runtime_revision"] = ( + self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService/GetReasoningEngineRuntimeRevision", + request_serializer=reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest.serialize, + response_deserializer=reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.deserialize, + ) + ) + return self._stubs["get_reasoning_engine_runtime_revision"] + + @property + def list_reasoning_engine_runtime_revisions( + self, + ) -> Callable[ + [ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest + ], + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse, + ]: + r"""Return a callable for the list reasoning engine runtime + revisions method over gRPC. + + Lists runtime revisions in a reasoning engine. + + Returns: + Callable[[~.ListReasoningEngineRuntimeRevisionsRequest], + ~.ListReasoningEngineRuntimeRevisionsResponse]: + 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_reasoning_engine_runtime_revisions" not in self._stubs: + self._stubs["list_reasoning_engine_runtime_revisions"] = ( + self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService/ListReasoningEngineRuntimeRevisions", + request_serializer=reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest.serialize, + response_deserializer=reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse.deserialize, + ) + ) + return self._stubs["list_reasoning_engine_runtime_revisions"] + + @property + def delete_reasoning_engine_runtime_revision( + self, + ) -> Callable[ + [ + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest + ], + operations_pb2.Operation, + ]: + r"""Return a callable for the delete reasoning engine + runtime revision method over gRPC. + + Deletes a reasoning engine revision. + + Returns: + Callable[[~.DeleteReasoningEngineRuntimeRevisionRequest], + ~.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_reasoning_engine_runtime_revision" not in self._stubs: + self._stubs["delete_reasoning_engine_runtime_revision"] = ( + self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService/DeleteReasoningEngineRuntimeRevision", + request_serializer=reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + ) + return self._stubs["delete_reasoning_engine_runtime_revision"] + + 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__ = ("ReasoningEngineRuntimeRevisionServiceGrpcTransport",) diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/grpc_asyncio.py new file mode 100644 index 0000000000..30c5d3621d --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/grpc_asyncio.py @@ -0,0 +1,750 @@ +# -*- 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 reasoning_engine_runtime_revision +from google.cloud.aiplatform_v1beta1.types import ( + reasoning_engine_runtime_revision_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 ReasoningEngineRuntimeRevisionServiceTransport, DEFAULT_CLIENT_INFO +from .grpc import ReasoningEngineRuntimeRevisionServiceGrpcTransport + +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.ReasoningEngineRuntimeRevisionService", + "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.ReasoningEngineRuntimeRevisionService", + "rpcName": str(client_call_details.method), + "response": grpc_response, + "metadata": grpc_response["metadata"], + }, + ) + return response + + +class ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport( + ReasoningEngineRuntimeRevisionServiceTransport +): + """gRPC AsyncIO backend transport for ReasoningEngineRuntimeRevisionService. + + Manages Vertex AI's Reasoning Engine Revisions. + + 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 get_reasoning_engine_runtime_revision( + self, + ) -> Callable[ + [ + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest + ], + Awaitable[reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision], + ]: + r"""Return a callable for the get reasoning engine runtime + revision method over gRPC. + + Gets a reasoning engine runtime revision. + + Returns: + Callable[[~.GetReasoningEngineRuntimeRevisionRequest], + Awaitable[~.ReasoningEngineRuntimeRevision]]: + 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_reasoning_engine_runtime_revision" not in self._stubs: + self._stubs["get_reasoning_engine_runtime_revision"] = ( + self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService/GetReasoningEngineRuntimeRevision", + request_serializer=reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest.serialize, + response_deserializer=reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.deserialize, + ) + ) + return self._stubs["get_reasoning_engine_runtime_revision"] + + @property + def list_reasoning_engine_runtime_revisions( + self, + ) -> Callable[ + [ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest + ], + Awaitable[ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse + ], + ]: + r"""Return a callable for the list reasoning engine runtime + revisions method over gRPC. + + Lists runtime revisions in a reasoning engine. + + Returns: + Callable[[~.ListReasoningEngineRuntimeRevisionsRequest], + Awaitable[~.ListReasoningEngineRuntimeRevisionsResponse]]: + 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_reasoning_engine_runtime_revisions" not in self._stubs: + self._stubs["list_reasoning_engine_runtime_revisions"] = ( + self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService/ListReasoningEngineRuntimeRevisions", + request_serializer=reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest.serialize, + response_deserializer=reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse.deserialize, + ) + ) + return self._stubs["list_reasoning_engine_runtime_revisions"] + + @property + def delete_reasoning_engine_runtime_revision( + self, + ) -> Callable[ + [ + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest + ], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the delete reasoning engine + runtime revision method over gRPC. + + Deletes a reasoning engine revision. + + Returns: + Callable[[~.DeleteReasoningEngineRuntimeRevisionRequest], + 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_reasoning_engine_runtime_revision" not in self._stubs: + self._stubs["delete_reasoning_engine_runtime_revision"] = ( + self._logged_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService/DeleteReasoningEngineRuntimeRevision", + request_serializer=reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + ) + return self._stubs["delete_reasoning_engine_runtime_revision"] + + def _prep_wrapped_messages(self, client_info): + """Precompute the wrapped methods, overriding the base class method to use async wrappers.""" + self._wrapped_methods = { + self.get_reasoning_engine_runtime_revision: self._wrap_method( + self.get_reasoning_engine_runtime_revision, + default_timeout=None, + client_info=client_info, + ), + self.list_reasoning_engine_runtime_revisions: self._wrap_method( + self.list_reasoning_engine_runtime_revisions, + default_timeout=None, + client_info=client_info, + ), + self.delete_reasoning_engine_runtime_revision: self._wrap_method( + self.delete_reasoning_engine_runtime_revision, + 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__ = ("ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport",) diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/rest.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/rest.py new file mode 100644 index 0000000000..f6aa96f178 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/rest.py @@ -0,0 +1,4783 @@ +# -*- 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 reasoning_engine_runtime_revision +from google.cloud.aiplatform_v1beta1.types import ( + reasoning_engine_runtime_revision_service, +) +from google.longrunning import operations_pb2 # type: ignore + + +from .rest_base import _BaseReasoningEngineRuntimeRevisionServiceRestTransport +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 ReasoningEngineRuntimeRevisionServiceRestInterceptor: + """Interceptor for ReasoningEngineRuntimeRevisionService. + + 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 ReasoningEngineRuntimeRevisionServiceRestTransport. + + .. code-block:: python + class MyCustomReasoningEngineRuntimeRevisionServiceInterceptor(ReasoningEngineRuntimeRevisionServiceRestInterceptor): + def pre_delete_reasoning_engine_runtime_revision(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_delete_reasoning_engine_runtime_revision(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_get_reasoning_engine_runtime_revision(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_get_reasoning_engine_runtime_revision(self, response): + logging.log(f"Received response: {response}") + return response + + def pre_list_reasoning_engine_runtime_revisions(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + def post_list_reasoning_engine_runtime_revisions(self, response): + logging.log(f"Received response: {response}") + return response + + transport = ReasoningEngineRuntimeRevisionServiceRestTransport(interceptor=MyCustomReasoningEngineRuntimeRevisionServiceInterceptor()) + client = ReasoningEngineRuntimeRevisionServiceClient(transport=transport) + + + """ + + def pre_delete_reasoning_engine_runtime_revision( + self, + request: reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for delete_reasoning_engine_runtime_revision + + Override in a subclass to manipulate the request or metadata + before they are sent to the ReasoningEngineRuntimeRevisionService server. + """ + return request, metadata + + def post_delete_reasoning_engine_runtime_revision( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for delete_reasoning_engine_runtime_revision + + DEPRECATED. Please use the `post_delete_reasoning_engine_runtime_revision_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the ReasoningEngineRuntimeRevisionService server but before + it is returned to user code. This `post_delete_reasoning_engine_runtime_revision` interceptor runs + before the `post_delete_reasoning_engine_runtime_revision_with_metadata` interceptor. + """ + return response + + def post_delete_reasoning_engine_runtime_revision_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_reasoning_engine_runtime_revision + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the ReasoningEngineRuntimeRevisionService server but before it is returned to user code. + + We recommend only using this `post_delete_reasoning_engine_runtime_revision_with_metadata` + interceptor in new development instead of the `post_delete_reasoning_engine_runtime_revision` interceptor. + When both interceptors are used, this `post_delete_reasoning_engine_runtime_revision_with_metadata` interceptor runs after the + `post_delete_reasoning_engine_runtime_revision` interceptor. The (possibly modified) response returned by + `post_delete_reasoning_engine_runtime_revision` will be passed to + `post_delete_reasoning_engine_runtime_revision_with_metadata`. + """ + return response, metadata + + def pre_get_reasoning_engine_runtime_revision( + self, + request: reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for get_reasoning_engine_runtime_revision + + Override in a subclass to manipulate the request or metadata + before they are sent to the ReasoningEngineRuntimeRevisionService server. + """ + return request, metadata + + def post_get_reasoning_engine_runtime_revision( + self, response: reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision + ) -> reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision: + """Post-rpc interceptor for get_reasoning_engine_runtime_revision + + DEPRECATED. Please use the `post_get_reasoning_engine_runtime_revision_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the ReasoningEngineRuntimeRevisionService server but before + it is returned to user code. This `post_get_reasoning_engine_runtime_revision` interceptor runs + before the `post_get_reasoning_engine_runtime_revision_with_metadata` interceptor. + """ + return response + + def post_get_reasoning_engine_runtime_revision_with_metadata( + self, + response: reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Post-rpc interceptor for get_reasoning_engine_runtime_revision + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the ReasoningEngineRuntimeRevisionService server but before it is returned to user code. + + We recommend only using this `post_get_reasoning_engine_runtime_revision_with_metadata` + interceptor in new development instead of the `post_get_reasoning_engine_runtime_revision` interceptor. + When both interceptors are used, this `post_get_reasoning_engine_runtime_revision_with_metadata` interceptor runs after the + `post_get_reasoning_engine_runtime_revision` interceptor. The (possibly modified) response returned by + `post_get_reasoning_engine_runtime_revision` will be passed to + `post_get_reasoning_engine_runtime_revision_with_metadata`. + """ + return response, metadata + + def pre_list_reasoning_engine_runtime_revisions( + self, + request: reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for list_reasoning_engine_runtime_revisions + + Override in a subclass to manipulate the request or metadata + before they are sent to the ReasoningEngineRuntimeRevisionService server. + """ + return request, metadata + + def post_list_reasoning_engine_runtime_revisions( + self, + response: reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse, + ) -> ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse + ): + """Post-rpc interceptor for list_reasoning_engine_runtime_revisions + + DEPRECATED. Please use the `post_list_reasoning_engine_runtime_revisions_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the ReasoningEngineRuntimeRevisionService server but before + it is returned to user code. This `post_list_reasoning_engine_runtime_revisions` interceptor runs + before the `post_list_reasoning_engine_runtime_revisions_with_metadata` interceptor. + """ + return response + + def post_list_reasoning_engine_runtime_revisions_with_metadata( + self, + response: reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Post-rpc interceptor for list_reasoning_engine_runtime_revisions + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the ReasoningEngineRuntimeRevisionService server but before it is returned to user code. + + We recommend only using this `post_list_reasoning_engine_runtime_revisions_with_metadata` + interceptor in new development instead of the `post_list_reasoning_engine_runtime_revisions` interceptor. + When both interceptors are used, this `post_list_reasoning_engine_runtime_revisions_with_metadata` interceptor runs after the + `post_list_reasoning_engine_runtime_revisions` interceptor. The (possibly modified) response returned by + `post_list_reasoning_engine_runtime_revisions` will be passed to + `post_list_reasoning_engine_runtime_revisions_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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService server but before + it is returned to user code. + """ + return response + + +@dataclasses.dataclass +class ReasoningEngineRuntimeRevisionServiceRestStub: + _session: AuthorizedSession + _host: str + _interceptor: ReasoningEngineRuntimeRevisionServiceRestInterceptor + + +class ReasoningEngineRuntimeRevisionServiceRestTransport( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport +): + """REST backend synchronous transport for ReasoningEngineRuntimeRevisionService. + + Manages Vertex AI's Reasoning Engine Revisions. + + 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[ + ReasoningEngineRuntimeRevisionServiceRestInterceptor + ] = 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 ReasoningEngineRuntimeRevisionServiceRestInterceptor() + ) + 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/*/reasoningEngines/*/runtimeRevisions/*/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/*/reasoningEngines/*/runtimeRevisions/*/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/*/reasoningEngines/*/runtimeRevisions/*/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/*/reasoningEngines/*/runtimeRevisions/*}/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/*/reasoningEngines/*/runtimeRevisions/*/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 _DeleteReasoningEngineRuntimeRevision( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseDeleteReasoningEngineRuntimeRevision, + ReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineRuntimeRevisionServiceRestTransport.DeleteReasoningEngineRuntimeRevision" + ) + + @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: reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the delete reasoning engine + runtime revision method over HTTP. + + Args: + request (~.reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest): + The request object. Request message for + [ReasoningEngineRuntimeRevisionService.DeleteReasoningEngineRuntimeRevision][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.DeleteReasoningEngineRuntimeRevision]. + 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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseDeleteReasoningEngineRuntimeRevision._get_http_options() + ) + + request, metadata = ( + self._interceptor.pre_delete_reasoning_engine_runtime_revision( + request, metadata + ) + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseDeleteReasoningEngineRuntimeRevision._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseDeleteReasoningEngineRuntimeRevision._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.ReasoningEngineRuntimeRevisionServiceClient.DeleteReasoningEngineRuntimeRevision", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "DeleteReasoningEngineRuntimeRevision", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineRuntimeRevisionServiceRestTransport._DeleteReasoningEngineRuntimeRevision._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_reasoning_engine_runtime_revision(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + self._interceptor.post_delete_reasoning_engine_runtime_revision_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.ReasoningEngineRuntimeRevisionServiceClient.delete_reasoning_engine_runtime_revision", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "DeleteReasoningEngineRuntimeRevision", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _GetReasoningEngineRuntimeRevision( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetReasoningEngineRuntimeRevision, + ReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineRuntimeRevisionServiceRestTransport.GetReasoningEngineRuntimeRevision" + ) + + @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: reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision: + r"""Call the get reasoning engine + runtime revision method over HTTP. + + Args: + request (~.reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest): + The request object. Request message for + [ReasoningEngineRuntimeRevisionService.GetReasoningEngineRuntimeRevision][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.GetReasoningEngineRuntimeRevision]. + 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_runtime_revision.ReasoningEngineRuntimeRevision: + ReasoningEngineRuntimeRevision is a + specific version of the runtime related + part of ReasoningEngine. Contains only + the fields that are revision specific. + + """ + + http_options = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetReasoningEngineRuntimeRevision._get_http_options() + ) + + request, metadata = ( + self._interceptor.pre_get_reasoning_engine_runtime_revision( + request, metadata + ) + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetReasoningEngineRuntimeRevision._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetReasoningEngineRuntimeRevision._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.ReasoningEngineRuntimeRevisionServiceClient.GetReasoningEngineRuntimeRevision", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "GetReasoningEngineRuntimeRevision", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineRuntimeRevisionServiceRestTransport._GetReasoningEngineRuntimeRevision._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 = reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision() + pb_resp = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.pb( + resp + ) + ) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_get_reasoning_engine_runtime_revision(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + self._interceptor.post_get_reasoning_engine_runtime_revision_with_metadata( + resp, response_metadata + ) + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.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.ReasoningEngineRuntimeRevisionServiceClient.get_reasoning_engine_runtime_revision", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "GetReasoningEngineRuntimeRevision", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + class _ListReasoningEngineRuntimeRevisions( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListReasoningEngineRuntimeRevisions, + ReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineRuntimeRevisionServiceRestTransport.ListReasoningEngineRuntimeRevisions" + ) + + @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: reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse + ): + r"""Call the list reasoning engine + runtime revisions method over HTTP. + + Args: + request (~.reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest): + The request object. Request message for + [ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions]. + 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_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse: + Response message for + [ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions] + + """ + + http_options = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListReasoningEngineRuntimeRevisions._get_http_options() + ) + + request, metadata = ( + self._interceptor.pre_list_reasoning_engine_runtime_revisions( + request, metadata + ) + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListReasoningEngineRuntimeRevisions._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListReasoningEngineRuntimeRevisions._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.ReasoningEngineRuntimeRevisionServiceClient.ListReasoningEngineRuntimeRevisions", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "ListReasoningEngineRuntimeRevisions", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineRuntimeRevisionServiceRestTransport._ListReasoningEngineRuntimeRevisions._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 = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse() + ) + pb_resp = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse.pb( + resp + ) + + json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True) + + resp = self._interceptor.post_list_reasoning_engine_runtime_revisions(resp) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + self._interceptor.post_list_reasoning_engine_runtime_revisions_with_metadata( + resp, response_metadata + ) + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse.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.ReasoningEngineRuntimeRevisionServiceClient.list_reasoning_engine_runtime_revisions", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "ListReasoningEngineRuntimeRevisions", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + return resp + + @property + def delete_reasoning_engine_runtime_revision( + self, + ) -> Callable[ + [ + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest + ], + 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._DeleteReasoningEngineRuntimeRevision(self._session, self._host, self._interceptor) # type: ignore + + @property + def get_reasoning_engine_runtime_revision( + self, + ) -> Callable[ + [ + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest + ], + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision, + ]: + # 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._GetReasoningEngineRuntimeRevision(self._session, self._host, self._interceptor) # type: ignore + + @property + def list_reasoning_engine_runtime_revisions( + self, + ) -> Callable[ + [ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest + ], + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse, + ]: + # 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._ListReasoningEngineRuntimeRevisions(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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetLocation, + ReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetLocation._get_http_options() + ) + + request, metadata = self._interceptor.pre_get_location(request, metadata) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetLocation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.GetLocation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "GetLocation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceAsyncClient.GetLocation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListLocations, + ReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListLocations._get_http_options() + ) + + request, metadata = self._interceptor.pre_list_locations(request, metadata) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListLocations._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.ListLocations", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "ListLocations", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceAsyncClient.ListLocations", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetIamPolicy, + ReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetIamPolicy._get_http_options() + ) + + request, metadata = self._interceptor.pre_get_iam_policy(request, metadata) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetIamPolicy._get_transcoded_request( + http_options, request + ) + + body = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetIamPolicy._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.GetIamPolicy", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "GetIamPolicy", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceAsyncClient.GetIamPolicy", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseSetIamPolicy, + ReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseSetIamPolicy._get_http_options() + ) + + request, metadata = self._interceptor.pre_set_iam_policy(request, metadata) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseSetIamPolicy._get_transcoded_request( + http_options, request + ) + + body = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseSetIamPolicy._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.SetIamPolicy", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "SetIamPolicy", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceAsyncClient.SetIamPolicy", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseTestIamPermissions, + ReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseTestIamPermissions._get_http_options() + ) + + request, metadata = self._interceptor.pre_test_iam_permissions( + request, metadata + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseTestIamPermissions._get_transcoded_request( + http_options, request + ) + + body = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseTestIamPermissions._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.TestIamPermissions", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "TestIamPermissions", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceAsyncClient.TestIamPermissions", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseCancelOperation, + ReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseCancelOperation._get_http_options() + ) + + request, metadata = self._interceptor.pre_cancel_operation( + request, metadata + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseCancelOperation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.CancelOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "CancelOperation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineRuntimeRevisionServiceRestTransport._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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseDeleteOperation, + ReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseDeleteOperation._get_http_options() + ) + + request, metadata = self._interceptor.pre_delete_operation( + request, metadata + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseDeleteOperation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.DeleteOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "DeleteOperation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineRuntimeRevisionServiceRestTransport._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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetOperation, + ReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetOperation._get_http_options() + ) + + request, metadata = self._interceptor.pre_get_operation(request, metadata) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetOperation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.GetOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "GetOperation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceAsyncClient.GetOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListOperations, + ReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListOperations._get_http_options() + ) + + request, metadata = self._interceptor.pre_list_operations(request, metadata) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListOperations._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.ListOperations", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "ListOperations", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceAsyncClient.ListOperations", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseWaitOperation, + ReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "ReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseWaitOperation._get_http_options() + ) + + request, metadata = self._interceptor.pre_wait_operation(request, metadata) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseWaitOperation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.WaitOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "WaitOperation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = ReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceAsyncClient.WaitOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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__ = ("ReasoningEngineRuntimeRevisionServiceRestTransport",) diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/rest_asyncio.py new file mode 100644 index 0000000000..4aeb8362fd --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/rest_asyncio.py @@ -0,0 +1,4947 @@ +# -*- 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 reasoning_engine_runtime_revision +from google.cloud.aiplatform_v1beta1.types import ( + reasoning_engine_runtime_revision_service, +) +from google.longrunning import operations_pb2 # type: ignore + + +from .rest_base import _BaseReasoningEngineRuntimeRevisionServiceRestTransport + +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 AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor: + """Asynchronous Interceptor for ReasoningEngineRuntimeRevisionService. + + 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 AsyncReasoningEngineRuntimeRevisionServiceRestTransport. + + .. code-block:: python + class MyCustomReasoningEngineRuntimeRevisionServiceInterceptor(ReasoningEngineRuntimeRevisionServiceRestInterceptor): + async def pre_delete_reasoning_engine_runtime_revision(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + async def post_delete_reasoning_engine_runtime_revision(self, response): + logging.log(f"Received response: {response}") + return response + + async def pre_get_reasoning_engine_runtime_revision(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + async def post_get_reasoning_engine_runtime_revision(self, response): + logging.log(f"Received response: {response}") + return response + + async def pre_list_reasoning_engine_runtime_revisions(self, request, metadata): + logging.log(f"Received request: {request}") + return request, metadata + + async def post_list_reasoning_engine_runtime_revisions(self, response): + logging.log(f"Received response: {response}") + return response + + transport = AsyncReasoningEngineRuntimeRevisionServiceRestTransport(interceptor=MyCustomReasoningEngineRuntimeRevisionServiceInterceptor()) + client = async ReasoningEngineRuntimeRevisionServiceClient(transport=transport) + + + """ + + async def pre_delete_reasoning_engine_runtime_revision( + self, + request: reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for delete_reasoning_engine_runtime_revision + + Override in a subclass to manipulate the request or metadata + before they are sent to the ReasoningEngineRuntimeRevisionService server. + """ + return request, metadata + + async def post_delete_reasoning_engine_runtime_revision( + self, response: operations_pb2.Operation + ) -> operations_pb2.Operation: + """Post-rpc interceptor for delete_reasoning_engine_runtime_revision + + DEPRECATED. Please use the `post_delete_reasoning_engine_runtime_revision_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the ReasoningEngineRuntimeRevisionService server but before + it is returned to user code. This `post_delete_reasoning_engine_runtime_revision` interceptor runs + before the `post_delete_reasoning_engine_runtime_revision_with_metadata` interceptor. + """ + return response + + async def post_delete_reasoning_engine_runtime_revision_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_reasoning_engine_runtime_revision + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the ReasoningEngineRuntimeRevisionService server but before it is returned to user code. + + We recommend only using this `post_delete_reasoning_engine_runtime_revision_with_metadata` + interceptor in new development instead of the `post_delete_reasoning_engine_runtime_revision` interceptor. + When both interceptors are used, this `post_delete_reasoning_engine_runtime_revision_with_metadata` interceptor runs after the + `post_delete_reasoning_engine_runtime_revision` interceptor. The (possibly modified) response returned by + `post_delete_reasoning_engine_runtime_revision` will be passed to + `post_delete_reasoning_engine_runtime_revision_with_metadata`. + """ + return response, metadata + + async def pre_get_reasoning_engine_runtime_revision( + self, + request: reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for get_reasoning_engine_runtime_revision + + Override in a subclass to manipulate the request or metadata + before they are sent to the ReasoningEngineRuntimeRevisionService server. + """ + return request, metadata + + async def post_get_reasoning_engine_runtime_revision( + self, response: reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision + ) -> reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision: + """Post-rpc interceptor for get_reasoning_engine_runtime_revision + + DEPRECATED. Please use the `post_get_reasoning_engine_runtime_revision_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the ReasoningEngineRuntimeRevisionService server but before + it is returned to user code. This `post_get_reasoning_engine_runtime_revision` interceptor runs + before the `post_get_reasoning_engine_runtime_revision_with_metadata` interceptor. + """ + return response + + async def post_get_reasoning_engine_runtime_revision_with_metadata( + self, + response: reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Post-rpc interceptor for get_reasoning_engine_runtime_revision + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the ReasoningEngineRuntimeRevisionService server but before it is returned to user code. + + We recommend only using this `post_get_reasoning_engine_runtime_revision_with_metadata` + interceptor in new development instead of the `post_get_reasoning_engine_runtime_revision` interceptor. + When both interceptors are used, this `post_get_reasoning_engine_runtime_revision_with_metadata` interceptor runs after the + `post_get_reasoning_engine_runtime_revision` interceptor. The (possibly modified) response returned by + `post_get_reasoning_engine_runtime_revision` will be passed to + `post_get_reasoning_engine_runtime_revision_with_metadata`. + """ + return response, metadata + + async def pre_list_reasoning_engine_runtime_revisions( + self, + request: reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Pre-rpc interceptor for list_reasoning_engine_runtime_revisions + + Override in a subclass to manipulate the request or metadata + before they are sent to the ReasoningEngineRuntimeRevisionService server. + """ + return request, metadata + + async def post_list_reasoning_engine_runtime_revisions( + self, + response: reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse, + ) -> ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse + ): + """Post-rpc interceptor for list_reasoning_engine_runtime_revisions + + DEPRECATED. Please use the `post_list_reasoning_engine_runtime_revisions_with_metadata` + interceptor instead. + + Override in a subclass to read or manipulate the response + after it is returned by the ReasoningEngineRuntimeRevisionService server but before + it is returned to user code. This `post_list_reasoning_engine_runtime_revisions` interceptor runs + before the `post_list_reasoning_engine_runtime_revisions_with_metadata` interceptor. + """ + return response + + async def post_list_reasoning_engine_runtime_revisions_with_metadata( + self, + response: reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse, + metadata: Sequence[Tuple[str, Union[str, bytes]]], + ) -> Tuple[ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse, + Sequence[Tuple[str, Union[str, bytes]]], + ]: + """Post-rpc interceptor for list_reasoning_engine_runtime_revisions + + Override in a subclass to read or manipulate the response or metadata after it + is returned by the ReasoningEngineRuntimeRevisionService server but before it is returned to user code. + + We recommend only using this `post_list_reasoning_engine_runtime_revisions_with_metadata` + interceptor in new development instead of the `post_list_reasoning_engine_runtime_revisions` interceptor. + When both interceptors are used, this `post_list_reasoning_engine_runtime_revisions_with_metadata` interceptor runs after the + `post_list_reasoning_engine_runtime_revisions` interceptor. The (possibly modified) response returned by + `post_list_reasoning_engine_runtime_revisions` will be passed to + `post_list_reasoning_engine_runtime_revisions_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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService 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 ReasoningEngineRuntimeRevisionService server but before + it is returned to user code. + """ + return response + + +@dataclasses.dataclass +class AsyncReasoningEngineRuntimeRevisionServiceRestStub: + _session: AsyncAuthorizedSession + _host: str + _interceptor: AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor + + +class AsyncReasoningEngineRuntimeRevisionServiceRestTransport( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport +): + """Asynchronous REST backend transport for ReasoningEngineRuntimeRevisionService. + + Manages Vertex AI's Reasoning Engine Revisions. + + 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[ + AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor + ] = 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 AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor() + ) + 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.get_reasoning_engine_runtime_revision: self._wrap_method( + self.get_reasoning_engine_runtime_revision, + default_timeout=None, + client_info=client_info, + ), + self.list_reasoning_engine_runtime_revisions: self._wrap_method( + self.list_reasoning_engine_runtime_revisions, + default_timeout=None, + client_info=client_info, + ), + self.delete_reasoning_engine_runtime_revision: self._wrap_method( + self.delete_reasoning_engine_runtime_revision, + 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 _DeleteReasoningEngineRuntimeRevision( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseDeleteReasoningEngineRuntimeRevision, + AsyncReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineRuntimeRevisionServiceRestTransport.DeleteReasoningEngineRuntimeRevision" + ) + + @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: reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> operations_pb2.Operation: + r"""Call the delete reasoning engine + runtime revision method over HTTP. + + Args: + request (~.reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest): + The request object. Request message for + [ReasoningEngineRuntimeRevisionService.DeleteReasoningEngineRuntimeRevision][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.DeleteReasoningEngineRuntimeRevision]. + 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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseDeleteReasoningEngineRuntimeRevision._get_http_options() + ) + + request, metadata = ( + await self._interceptor.pre_delete_reasoning_engine_runtime_revision( + request, metadata + ) + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseDeleteReasoningEngineRuntimeRevision._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseDeleteReasoningEngineRuntimeRevision._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.ReasoningEngineRuntimeRevisionServiceClient.DeleteReasoningEngineRuntimeRevision", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "DeleteReasoningEngineRuntimeRevision", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineRuntimeRevisionServiceRestTransport._DeleteReasoningEngineRuntimeRevision._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_reasoning_engine_runtime_revision( + resp + ) + ) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + await self._interceptor.post_delete_reasoning_engine_runtime_revision_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.ReasoningEngineRuntimeRevisionServiceAsyncClient.delete_reasoning_engine_runtime_revision", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "DeleteReasoningEngineRuntimeRevision", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + + return resp + + class _GetReasoningEngineRuntimeRevision( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetReasoningEngineRuntimeRevision, + AsyncReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineRuntimeRevisionServiceRestTransport.GetReasoningEngineRuntimeRevision" + ) + + @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: reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision: + r"""Call the get reasoning engine + runtime revision method over HTTP. + + Args: + request (~.reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest): + The request object. Request message for + [ReasoningEngineRuntimeRevisionService.GetReasoningEngineRuntimeRevision][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.GetReasoningEngineRuntimeRevision]. + 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: + ~.reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision: + ReasoningEngineRuntimeRevision is a + specific version of the runtime related + part of ReasoningEngine. Contains only + the fields that are revision specific. + + """ + + http_options = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetReasoningEngineRuntimeRevision._get_http_options() + ) + + request, metadata = ( + await self._interceptor.pre_get_reasoning_engine_runtime_revision( + request, metadata + ) + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetReasoningEngineRuntimeRevision._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetReasoningEngineRuntimeRevision._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.ReasoningEngineRuntimeRevisionServiceClient.GetReasoningEngineRuntimeRevision", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "GetReasoningEngineRuntimeRevision", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineRuntimeRevisionServiceRestTransport._GetReasoningEngineRuntimeRevision._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 = reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision() + pb_resp = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.pb( + resp + ) + ) + content = await response.read() + json_format.Parse(content, pb_resp, ignore_unknown_fields=True) + resp = await self._interceptor.post_get_reasoning_engine_runtime_revision( + resp + ) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + await self._interceptor.post_get_reasoning_engine_runtime_revision_with_metadata( + resp, response_metadata + ) + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.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.ReasoningEngineRuntimeRevisionServiceAsyncClient.get_reasoning_engine_runtime_revision", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "GetReasoningEngineRuntimeRevision", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) + + return resp + + class _ListReasoningEngineRuntimeRevisions( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListReasoningEngineRuntimeRevisions, + AsyncReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineRuntimeRevisionServiceRestTransport.ListReasoningEngineRuntimeRevisions" + ) + + @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: reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse + ): + r"""Call the list reasoning engine + runtime revisions method over HTTP. + + Args: + request (~.reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest): + The request object. Request message for + [ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions]. + 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: + ~.reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse: + Response message for + [ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions] + + """ + + http_options = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListReasoningEngineRuntimeRevisions._get_http_options() + ) + + request, metadata = ( + await self._interceptor.pre_list_reasoning_engine_runtime_revisions( + request, metadata + ) + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListReasoningEngineRuntimeRevisions._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListReasoningEngineRuntimeRevisions._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.ReasoningEngineRuntimeRevisionServiceClient.ListReasoningEngineRuntimeRevisions", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "ListReasoningEngineRuntimeRevisions", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineRuntimeRevisionServiceRestTransport._ListReasoningEngineRuntimeRevisions._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 = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse() + ) + pb_resp = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse.pb( + resp + ) + content = await response.read() + json_format.Parse(content, pb_resp, ignore_unknown_fields=True) + resp = await self._interceptor.post_list_reasoning_engine_runtime_revisions( + resp + ) + response_metadata = [(k, str(v)) for k, v in response.headers.items()] + resp, _ = ( + await self._interceptor.post_list_reasoning_engine_runtime_revisions_with_metadata( + resp, response_metadata + ) + ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + try: + response_payload = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse.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.ReasoningEngineRuntimeRevisionServiceAsyncClient.list_reasoning_engine_runtime_revisions", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "ListReasoningEngineRuntimeRevisions", + "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/*/reasoningEngines/*/runtimeRevisions/*/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/*/reasoningEngines/*/runtimeRevisions/*/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/*/reasoningEngines/*/runtimeRevisions/*/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/*/reasoningEngines/*/runtimeRevisions/*}/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/*/reasoningEngines/*/runtimeRevisions/*/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 delete_reasoning_engine_runtime_revision( + self, + ) -> Callable[ + [ + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest + ], + operations_pb2.Operation, + ]: + return self._DeleteReasoningEngineRuntimeRevision(self._session, self._host, self._interceptor) # type: ignore + + @property + def get_reasoning_engine_runtime_revision( + self, + ) -> Callable[ + [ + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest + ], + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision, + ]: + return self._GetReasoningEngineRuntimeRevision(self._session, self._host, self._interceptor) # type: ignore + + @property + def list_reasoning_engine_runtime_revisions( + self, + ) -> Callable[ + [ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest + ], + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse, + ]: + return self._ListReasoningEngineRuntimeRevisions(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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetLocation, + AsyncReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetLocation._get_http_options() + ) + + request, metadata = await self._interceptor.pre_get_location( + request, metadata + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetLocation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.GetLocation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "GetLocation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceAsyncClient.GetLocation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListLocations, + AsyncReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListLocations._get_http_options() + ) + + request, metadata = await self._interceptor.pre_list_locations( + request, metadata + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListLocations._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.ListLocations", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "ListLocations", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceAsyncClient.ListLocations", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetIamPolicy, + AsyncReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetIamPolicy._get_http_options() + ) + + request, metadata = await self._interceptor.pre_get_iam_policy( + request, metadata + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetIamPolicy._get_transcoded_request( + http_options, request + ) + + body = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetIamPolicy._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.GetIamPolicy", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "GetIamPolicy", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceAsyncClient.GetIamPolicy", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseSetIamPolicy, + AsyncReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseSetIamPolicy._get_http_options() + ) + + request, metadata = await self._interceptor.pre_set_iam_policy( + request, metadata + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseSetIamPolicy._get_transcoded_request( + http_options, request + ) + + body = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseSetIamPolicy._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.SetIamPolicy", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "SetIamPolicy", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceAsyncClient.SetIamPolicy", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseTestIamPermissions, + AsyncReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseTestIamPermissions._get_http_options() + ) + + request, metadata = await self._interceptor.pre_test_iam_permissions( + request, metadata + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseTestIamPermissions._get_transcoded_request( + http_options, request + ) + + body = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseTestIamPermissions._get_request_body_json( + transcoded_request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.TestIamPermissions", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "TestIamPermissions", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceAsyncClient.TestIamPermissions", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseCancelOperation, + AsyncReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseCancelOperation._get_http_options() + ) + + request, metadata = await self._interceptor.pre_cancel_operation( + request, metadata + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseCancelOperation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.CancelOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "CancelOperation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineRuntimeRevisionServiceRestTransport._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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseDeleteOperation, + AsyncReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseDeleteOperation._get_http_options() + ) + + request, metadata = await self._interceptor.pre_delete_operation( + request, metadata + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseDeleteOperation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.DeleteOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "DeleteOperation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineRuntimeRevisionServiceRestTransport._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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetOperation, + AsyncReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetOperation._get_http_options() + ) + + request, metadata = await self._interceptor.pre_get_operation( + request, metadata + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetOperation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.GetOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "GetOperation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceAsyncClient.GetOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListOperations, + AsyncReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListOperations._get_http_options() + ) + + request, metadata = await self._interceptor.pre_list_operations( + request, metadata + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListOperations._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.ListOperations", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "ListOperations", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceAsyncClient.ListOperations", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseWaitOperation, + AsyncReasoningEngineRuntimeRevisionServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncReasoningEngineRuntimeRevisionServiceRestTransport.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 = ( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseWaitOperation._get_http_options() + ) + + request, metadata = await self._interceptor.pre_wait_operation( + request, metadata + ) + transcoded_request = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseWaitOperation._get_transcoded_request( + http_options, request + ) + + # Jsonify the query params + query_params = _BaseReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceClient.WaitOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "rpcName": "WaitOperation", + "httpRequest": http_request, + "metadata": http_request["headers"], + }, + ) + + # Send the request + response = await AsyncReasoningEngineRuntimeRevisionServiceRestTransport._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.ReasoningEngineRuntimeRevisionServiceAsyncClient.WaitOperation", + extra={ + "serviceName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "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/reasoning_engine_runtime_revision_service/transports/rest_base.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/rest_base.py new file mode 100644 index 0000000000..53644079a7 --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_runtime_revision_service/transports/rest_base.py @@ -0,0 +1,2896 @@ +# -*- 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 ReasoningEngineRuntimeRevisionServiceTransport, DEFAULT_CLIENT_INFO + +import re +from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union + + +from google.cloud.aiplatform_v1beta1.types import reasoning_engine_runtime_revision +from google.cloud.aiplatform_v1beta1.types import ( + reasoning_engine_runtime_revision_service, +) +from google.longrunning import operations_pb2 # type: ignore + + +class _BaseReasoningEngineRuntimeRevisionServiceRestTransport( + ReasoningEngineRuntimeRevisionServiceTransport +): + """Base REST backend transport for ReasoningEngineRuntimeRevisionService. + + 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 _BaseDeleteReasoningEngineRuntimeRevision: + 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/*/reasoningEngines/*/runtimeRevisions/*}", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest.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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseDeleteReasoningEngineRuntimeRevision._get_unset_required_fields( + query_params + ) + ) + + query_params["$alt"] = "json;enum-encoding=int" + return query_params + + class _BaseGetReasoningEngineRuntimeRevision: + 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/*/reasoningEngines/*/runtimeRevisions/*}", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest.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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseGetReasoningEngineRuntimeRevision._get_unset_required_fields( + query_params + ) + ) + + query_params["$alt"] = "json;enum-encoding=int" + return query_params + + class _BaseListReasoningEngineRuntimeRevisions: + 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/*/reasoningEngines/*}/runtimeRevisions", + }, + ] + return http_options + + @staticmethod + def _get_transcoded_request(http_options, request): + pb_request = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest.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( + _BaseReasoningEngineRuntimeRevisionServiceRestTransport._BaseListReasoningEngineRuntimeRevisions._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/*/reasoningEngines/*/runtimeRevisions/*/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/*/reasoningEngines/*/runtimeRevisions/*/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/*/reasoningEngines/*/runtimeRevisions/*/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/*/reasoningEngines/*/runtimeRevisions/*}/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/*/reasoningEngines/*/runtimeRevisions/*/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__ = ("_BaseReasoningEngineRuntimeRevisionServiceRestTransport",) diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/async_client.py index 3ec9cb9c9e..ff5ad16671 100644 --- a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/async_client.py @@ -108,6 +108,12 @@ class ReasoningEngineServiceAsyncClient: parse_reasoning_engine_path = staticmethod( ReasoningEngineServiceClient.parse_reasoning_engine_path ) + reasoning_engine_runtime_revision_path = staticmethod( + ReasoningEngineServiceClient.reasoning_engine_runtime_revision_path + ) + parse_reasoning_engine_runtime_revision_path = staticmethod( + ReasoningEngineServiceClient.parse_reasoning_engine_runtime_revision_path + ) common_billing_account_path = staticmethod( ReasoningEngineServiceClient.common_billing_account_path ) diff --git a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/client.py b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/client.py index 9f2c11589d..d8141b7d9e 100644 --- a/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/reasoning_engine_service/client.py @@ -342,6 +342,30 @@ def parse_reasoning_engine_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def reasoning_engine_runtime_revision_path( + project: str, + location: str, + reasoning_engine: str, + runtime_revision: str, + ) -> str: + """Returns a fully-qualified reasoning_engine_runtime_revision string.""" + return "projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/runtimeRevisions/{runtime_revision}".format( + project=project, + location=location, + reasoning_engine=reasoning_engine, + runtime_revision=runtime_revision, + ) + + @staticmethod + def parse_reasoning_engine_runtime_revision_path(path: str) -> Dict[str, str]: + """Parses a reasoning_engine_runtime_revision path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/reasoningEngines/(?P.+?)/runtimeRevisions/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def common_billing_account_path( billing_account: str, 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 46cf41c439..35925b1020 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 @@ -1091,6 +1091,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1493,6 +1497,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1943,6 +1951,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2389,6 +2401,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2835,6 +2851,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 34151786cd..d7e31a0b89 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 @@ -1995,6 +1995,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2397,6 +2401,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2847,6 +2855,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3293,6 +3305,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3739,6 +3755,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 087adce853..2bf5f13c50 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 @@ -1108,6 +1108,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1529,6 +1533,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1998,6 +2006,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2463,6 +2475,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2928,6 +2944,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 fabe89a820..0ca5b9a957 100644 --- a/google/cloud/aiplatform_v1beta1/services/schedule_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/schedule_service/transports/rest.py @@ -1121,6 +1121,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1523,6 +1527,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1973,6 +1981,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2419,6 +2431,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2865,6 +2881,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 564d042c94..d1e603b408 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 @@ -2278,6 +2278,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2680,6 +2684,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3130,6 +3138,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3576,6 +3588,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -4022,6 +4038,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 4a9b71eb0e..8288a8bfd9 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 @@ -1196,6 +1196,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1617,6 +1621,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2086,6 +2094,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2551,6 +2563,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3016,6 +3032,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 b411864017..f108027dd5 100644 --- a/google/cloud/aiplatform_v1beta1/services/session_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/session_service/transports/rest.py @@ -1196,6 +1196,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1598,6 +1602,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2048,6 +2056,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2494,6 +2506,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2940,6 +2956,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 08e596f8af..441aaaabaa 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 @@ -2422,6 +2422,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2824,6 +2828,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3274,6 +3282,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3720,6 +3732,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -4166,6 +4182,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 d1dc7cfd32..937b3dd4e6 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 @@ -1214,6 +1214,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1635,6 +1639,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2104,6 +2112,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2569,6 +2581,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3034,6 +3050,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 78119861e7..b8c4646724 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 @@ -1094,6 +1094,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1496,6 +1500,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1946,6 +1954,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2392,6 +2404,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2838,6 +2854,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 3b4a8f0b40..494a47b627 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 @@ -1990,6 +1990,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2392,6 +2396,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2842,6 +2850,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3288,6 +3300,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3734,6 +3750,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 1356064d85..3017af8ed7 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 @@ -1080,6 +1080,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1501,6 +1505,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1970,6 +1978,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2435,6 +2447,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2900,6 +2916,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 14df86aa43..7b59adba43 100644 --- a/google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/tensorboard_service/transports/rest.py @@ -2584,6 +2584,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2986,6 +2990,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3436,6 +3444,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3882,6 +3894,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -4328,6 +4344,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 235ec627fa..1860d4e462 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 @@ -7784,6 +7784,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -8186,6 +8190,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -8636,6 +8644,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -9082,6 +9094,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -9528,6 +9544,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 cdbf4ff196..1b0740d6ee 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 @@ -2417,6 +2417,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2838,6 +2842,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3307,6 +3315,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3772,6 +3784,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -4237,6 +4253,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 99e66b9a8c..5f70c11927 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 @@ -2168,6 +2168,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2570,6 +2574,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3020,6 +3028,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3466,6 +3478,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3912,6 +3928,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 2cd1a7359c..6c8c427314 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 @@ -6312,6 +6312,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -6714,6 +6718,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -7164,6 +7172,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -7610,6 +7622,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -8056,6 +8072,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 b8967f39c2..ac7e9d2fb7 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 @@ -2129,6 +2129,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2550,6 +2554,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3019,6 +3027,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3484,6 +3496,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3949,6 +3965,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 0a1b3dded6..1c42ea5d1d 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 @@ -1094,6 +1094,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1496,6 +1500,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1946,6 +1954,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2392,6 +2404,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2838,6 +2854,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 25bff4bf40..51595d1899 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 @@ -2003,6 +2003,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2405,6 +2409,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2855,6 +2863,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -3301,6 +3313,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3747,6 +3763,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 96d72c4ad2..90d7121a1e 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 @@ -1107,6 +1107,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1528,6 +1532,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -1997,6 +2005,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2462,6 +2474,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -2927,6 +2943,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", 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 ac26c79a27..f5a1fe8e4e 100644 --- a/google/cloud/aiplatform_v1beta1/services/vizier_service/transports/rest.py +++ b/google/cloud/aiplatform_v1beta1/services/vizier_service/transports/rest.py @@ -1546,6 +1546,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -1948,6 +1952,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2398,6 +2406,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2844,6 +2856,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3290,6 +3306,10 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 3ed7a4d36d..703bf61472 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 @@ -4055,6 +4055,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -4457,6 +4461,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -4907,6 +4915,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -5353,6 +5365,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -5799,6 +5815,10 @@ def operations_client(self) -> AsyncOperationsRestClient: "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/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 06843caaea..78a337af8c 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 @@ -1620,6 +1620,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:cancel", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:cancel", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel", @@ -2041,6 +2045,10 @@ def _get_http_options(): "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "delete", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "delete", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2510,6 +2518,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}", @@ -2975,6 +2987,10 @@ def _get_http_options(): "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*}/operations", }, + { + "method": "get", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*}/operations", + }, { "method": "get", "uri": "/v1beta1/{name=projects/*/locations/*/solvers/*}/operations", @@ -3440,6 +3456,10 @@ def _get_http_options(): "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/sessions/*/operations/*}:wait", }, + { + "method": "post", + "uri": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/runtimeRevisions/*/operations/*}:wait", + }, { "method": "post", "uri": "/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait", diff --git a/google/cloud/aiplatform_v1beta1/types/__init__.py b/google/cloud/aiplatform_v1beta1/types/__init__.py index 58d1fece91..c1fea16e77 100644 --- a/google/cloud/aiplatform_v1beta1/types/__init__.py +++ b/google/cloud/aiplatform_v1beta1/types/__init__.py @@ -1221,10 +1221,22 @@ AsyncQueryReasoningEngineOperationMetadata, AsyncQueryReasoningEngineRequest, AsyncQueryReasoningEngineResponse, + CancelAsyncQueryReasoningEngineRequest, + CancelAsyncQueryReasoningEngineResponse, QueryReasoningEngineRequest, QueryReasoningEngineResponse, StreamQueryReasoningEngineRequest, ) +from .reasoning_engine_runtime_revision import ( + ReasoningEngineRuntimeRevision, +) +from .reasoning_engine_runtime_revision_service import ( + DeleteReasoningEngineRuntimeRevisionOperationMetadata, + DeleteReasoningEngineRuntimeRevisionRequest, + GetReasoningEngineRuntimeRevisionRequest, + ListReasoningEngineRuntimeRevisionsRequest, + ListReasoningEngineRuntimeRevisionsResponse, +) from .reasoning_engine_service import ( CreateReasoningEngineOperationMetadata, CreateReasoningEngineRequest, @@ -2540,9 +2552,17 @@ "AsyncQueryReasoningEngineOperationMetadata", "AsyncQueryReasoningEngineRequest", "AsyncQueryReasoningEngineResponse", + "CancelAsyncQueryReasoningEngineRequest", + "CancelAsyncQueryReasoningEngineResponse", "QueryReasoningEngineRequest", "QueryReasoningEngineResponse", "StreamQueryReasoningEngineRequest", + "ReasoningEngineRuntimeRevision", + "DeleteReasoningEngineRuntimeRevisionOperationMetadata", + "DeleteReasoningEngineRuntimeRevisionRequest", + "GetReasoningEngineRuntimeRevisionRequest", + "ListReasoningEngineRuntimeRevisionsRequest", + "ListReasoningEngineRuntimeRevisionsResponse", "CreateReasoningEngineOperationMetadata", "CreateReasoningEngineRequest", "DeleteReasoningEngineRequest", diff --git a/google/cloud/aiplatform_v1beta1/types/reasoning_engine.py b/google/cloud/aiplatform_v1beta1/types/reasoning_engine.py index 6fb291563f..27b992c6f6 100644 --- a/google/cloud/aiplatform_v1beta1/types/reasoning_engine.py +++ b/google/cloud/aiplatform_v1beta1/types/reasoning_engine.py @@ -495,8 +495,103 @@ class ReasoningEngine(proto.Message): will be secured by this key. labels (MutableMapping[str, str]): Labels for the ReasoningEngine. + traffic_config (google.cloud.aiplatform_v1beta1.types.ReasoningEngine.TrafficConfig): + Optional. Traffic distribution configuration + for the Reasoning Engine. """ + class TrafficConfig(proto.Message): + r"""Traffic distribution configuration. + + 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: + traffic_split_manual (google.cloud.aiplatform_v1beta1.types.ReasoningEngine.TrafficConfig.TrafficSplitManual): + Optional. Manual traffic distribution + configuration, where the user specifies the + Runtime Revision IDs and the percentage of + traffic to send to each. + + This field is a member of `oneof`_ ``traffic_split``. + traffic_split_always_latest (google.cloud.aiplatform_v1beta1.types.ReasoningEngine.TrafficConfig.TrafficSplitAlwaysLatest): + Optional. Traffic distribution configuration, + where all traffic is sent to the latest Runtime + Revision. + + This field is a member of `oneof`_ ``traffic_split``. + """ + + class TrafficSplitManual(proto.Message): + r"""Manual traffic distribution configuration, where the user + specifies the Runtime Revision IDs and the percentage of traffic + to send to each. + + Attributes: + targets (MutableSequence[google.cloud.aiplatform_v1beta1.types.ReasoningEngine.TrafficConfig.TrafficSplitManual.Target]): + A list of traffic targets for the Runtimes + Revisions. The sum of percentages must equal to + 100. + """ + + class Target(proto.Message): + r"""A single target for the traffic split, specifying a Runtime + Revision and the percentage of traffic to send to it. + + Attributes: + runtime_revision_name (str): + Required. The Runtime Revision name to which + to send this portion of traffic, if traffic + allocation is by Runtime Revision. + percent (int): + Required. Specifies percent of the traffic to + this Runtime Revision. + """ + + runtime_revision_name: str = proto.Field( + proto.STRING, + number=1, + ) + percent: int = proto.Field( + proto.INT32, + number=2, + ) + + targets: MutableSequence[ + "ReasoningEngine.TrafficConfig.TrafficSplitManual.Target" + ] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message="ReasoningEngine.TrafficConfig.TrafficSplitManual.Target", + ) + + class TrafficSplitAlwaysLatest(proto.Message): + r"""Traffic distribution configuration, where all traffic is sent + to the latest Runtime Revision. + + """ + + traffic_split_manual: "ReasoningEngine.TrafficConfig.TrafficSplitManual" = ( + proto.Field( + proto.MESSAGE, + number=18, + oneof="traffic_split", + message="ReasoningEngine.TrafficConfig.TrafficSplitManual", + ) + ) + traffic_split_always_latest: ( + "ReasoningEngine.TrafficConfig.TrafficSplitAlwaysLatest" + ) = proto.Field( + proto.MESSAGE, + number=19, + oneof="traffic_split", + message="ReasoningEngine.TrafficConfig.TrafficSplitAlwaysLatest", + ) + name: str = proto.Field( proto.STRING, number=1, @@ -543,6 +638,11 @@ class ReasoningEngine(proto.Message): proto.STRING, number=17, ) + traffic_config: TrafficConfig = proto.Field( + proto.MESSAGE, + number=20, + message=TrafficConfig, + ) class ReasoningEngineContextSpec(proto.Message): 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 7560198ed4..a2a71a6586 100644 --- a/google/cloud/aiplatform_v1beta1/types/reasoning_engine_execution_service.py +++ b/google/cloud/aiplatform_v1beta1/types/reasoning_engine_execution_service.py @@ -32,6 +32,8 @@ "AsyncQueryReasoningEngineRequest", "AsyncQueryReasoningEngineOperationMetadata", "AsyncQueryReasoningEngineResponse", + "CancelAsyncQueryReasoningEngineRequest", + "CancelAsyncQueryReasoningEngineResponse", }, ) @@ -179,4 +181,36 @@ class AsyncQueryReasoningEngineResponse(proto.Message): ) +class CancelAsyncQueryReasoningEngineRequest(proto.Message): + r"""Request message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + + Attributes: + name (str): + Required. The name of the ReasoningEngine resource to use. + Format: + ``projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`` + operation_name (str): + Required. The name of the longrunning operation returned + from AsyncQueryReasoningEngine. Format: + ``projects/{project}/locations/{location}/operations/{operation}`` + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + operation_name: str = proto.Field( + proto.STRING, + number=2, + ) + + +class CancelAsyncQueryReasoningEngineResponse(proto.Message): + r"""Response message for + [ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine][google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine]. + + """ + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1beta1/types/reasoning_engine_runtime_revision.py b/google/cloud/aiplatform_v1beta1/types/reasoning_engine_runtime_revision.py new file mode 100644 index 0000000000..f9154eed2a --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/types/reasoning_engine_runtime_revision.py @@ -0,0 +1,93 @@ +# -*- 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 reasoning_engine +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore + + +__protobuf__ = proto.module( + package="google.cloud.aiplatform.v1beta1", + manifest={ + "ReasoningEngineRuntimeRevision", + }, +) + + +class ReasoningEngineRuntimeRevision(proto.Message): + r"""ReasoningEngineRuntimeRevision is a specific version of the + runtime related part of ReasoningEngine. Contains only the + fields that are revision specific. + + Attributes: + name (str): + Identifier. The resource name of the + ReasoningEngineRuntimeRevision. Format: + ``projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/runtimeRevisions/{runtime_revision}`` + spec (google.cloud.aiplatform_v1beta1.types.ReasoningEngineSpec): + Immutable. Configurations of the + ReasoningEngineRuntimeRevision. Contains only + revision specific fields. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. Timestamp when this + ReasoningEngineRuntimeRevision was created. + state (google.cloud.aiplatform_v1beta1.types.ReasoningEngineRuntimeRevision.State): + Output only. The state of the revision. + """ + + class State(proto.Enum): + r"""Possible values of the state of the revision. + + Values: + STATE_UNSPECIFIED (0): + The unspecified state. + ACTIVE (1): + Is deployed and ready to be used. + DEPRECATED (2): + Is deprecated, may not be used, only + preserved for historical purposes. + """ + + STATE_UNSPECIFIED = 0 + ACTIVE = 1 + DEPRECATED = 2 + + name: str = proto.Field( + proto.STRING, + number=1, + ) + spec: reasoning_engine.ReasoningEngineSpec = proto.Field( + proto.MESSAGE, + number=3, + message=reasoning_engine.ReasoningEngineSpec, + ) + create_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=4, + message=timestamp_pb2.Timestamp, + ) + state: State = proto.Field( + proto.ENUM, + number=5, + enum=State, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1beta1/types/reasoning_engine_runtime_revision_service.py b/google/cloud/aiplatform_v1beta1/types/reasoning_engine_runtime_revision_service.py new file mode 100644 index 0000000000..444c59252f --- /dev/null +++ b/google/cloud/aiplatform_v1beta1/types/reasoning_engine_runtime_revision_service.py @@ -0,0 +1,163 @@ +# -*- 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 operation +from google.cloud.aiplatform_v1beta1.types import reasoning_engine_runtime_revision + + +__protobuf__ = proto.module( + package="google.cloud.aiplatform.v1beta1", + manifest={ + "DeleteReasoningEngineRuntimeRevisionOperationMetadata", + "GetReasoningEngineRuntimeRevisionRequest", + "ListReasoningEngineRuntimeRevisionsRequest", + "ListReasoningEngineRuntimeRevisionsResponse", + "DeleteReasoningEngineRuntimeRevisionRequest", + }, +) + + +class DeleteReasoningEngineRuntimeRevisionOperationMetadata(proto.Message): + r"""Metadata associated with DeleteReasoningEngineRuntimeRevision + operation. + + 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 GetReasoningEngineRuntimeRevisionRequest(proto.Message): + r"""Request message for + [ReasoningEngineRuntimeRevisionService.GetReasoningEngineRuntimeRevision][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.GetReasoningEngineRuntimeRevision]. + + Attributes: + name (str): + Required. The name of the ReasoningEngineRuntimeRevision + resource. Format: + ``projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/runtimeRevisions/{runtimeRevision}`` + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + + +class ListReasoningEngineRuntimeRevisionsRequest(proto.Message): + r"""Request message for + [ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions]. + + Attributes: + parent (str): + Required. The resource name of the ReasoningEngine to list + the ReasoningEngineRuntimeRevisions from. Format: + ``projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`` + filter (str): + Optional. The standard list filter. More detail in + `AIP-160 `__. + page_size (int): + Optional. The maximum number of + ReasoningEngineRuntimeRevisions to return. The + service may return fewer than this value. + + If unspecified, at most 50 revisions will be + returned. + + The maximum value is 100; values above 100 will + be coerced to 100. + page_token (str): + Optional. The standard list page token. + """ + + parent: str = proto.Field( + proto.STRING, + number=1, + ) + filter: str = proto.Field( + proto.STRING, + number=2, + ) + page_size: int = proto.Field( + proto.INT32, + number=3, + ) + page_token: str = proto.Field( + proto.STRING, + number=4, + ) + + +class ListReasoningEngineRuntimeRevisionsResponse(proto.Message): + r"""Response message for + [ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions] + + Attributes: + reasoning_engine_runtime_revisions (MutableSequence[google.cloud.aiplatform_v1beta1.types.ReasoningEngineRuntimeRevision]): + List of ReasoningEngineRuntimeRevisions in + the requested page. + next_page_token (str): + A token to retrieve the next page of results. Pass to + [ListReasoningEngineRuntimeRevisionsRequest.page_token][google.cloud.aiplatform.v1beta1.ListReasoningEngineRuntimeRevisionsRequest.page_token] + to obtain that page. + """ + + @property + def raw_page(self): + return self + + reasoning_engine_runtime_revisions: MutableSequence[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision + ] = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision, + ) + next_page_token: str = proto.Field( + proto.STRING, + number=2, + ) + + +class DeleteReasoningEngineRuntimeRevisionRequest(proto.Message): + r"""Request message for + [ReasoningEngineRuntimeRevisionService.DeleteReasoningEngineRuntimeRevision][google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.DeleteReasoningEngineRuntimeRevision]. + + Attributes: + name (str): + Required. The name of the ReasoningEngineRuntimeRevision + resource to be deleted. Format: + ``projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/runtimeRevisions/{runtime_revision}`` + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1beta1/types/tool.py b/google/cloud/aiplatform_v1beta1/types/tool.py index 3f06b93484..dbdd997b8a 100644 --- a/google/cloud/aiplatform_v1beta1/types/tool.py +++ b/google/cloud/aiplatform_v1beta1/types/tool.py @@ -97,6 +97,12 @@ class Tool(proto.Message): Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. + parallel_ai_search (google.cloud.aiplatform_v1beta1.types.Tool.ParallelAiSearch): + Optional. If specified, Vertex AI will use + Parallel.ai to search for information to answer + user queries. The search results will be + grounded on Parallel.ai and presented to the + model for response generation code_execution (google.cloud.aiplatform_v1beta1.types.Tool.CodeExecution): Optional. CodeExecution tool type. Enables the model to execute code as part of @@ -179,6 +185,44 @@ class GoogleSearch(proto.Message): enum="Tool.PhishBlockThreshold", ) + class ParallelAiSearch(proto.Message): + r"""ParallelAiSearch tool type. + A tool that uses the Parallel.ai search engine for grounding. + + Attributes: + api_key (str): + Optional. The API key for ParallelAiSearch. + If an API key is not provided, the system will + attempt to verify access by checking for an + active Parallel.ai subscription through the + Google Cloud Marketplace. + See + https://docs.parallel.ai/search/search-quickstart + for more details. + custom_configs (google.protobuf.struct_pb2.Struct): + Optional. Custom configs for ParallelAiSearch. This field + can be used to pass any parameter from the Parallel.ai + Search API. See the Parallel.ai documentation for the full + list of available parameters and their usage: + https://docs.parallel.ai/api-reference/search-beta/search + Currently only ``source_policy``, ``excerpts``, + ``max_results``, ``mode``, ``fetch_policy`` can be set via + this field. For example: { "source_policy": { + "include_domains": ["google.com", "wikipedia.org"], + "exclude_domains": ["example.com"] }, "fetch_policy": { + "max_age_seconds": 3600 } } + """ + + api_key: str = proto.Field( + proto.STRING, + number=1, + ) + custom_configs: struct_pb2.Struct = proto.Field( + proto.MESSAGE, + number=3, + message=struct_pb2.Struct, + ) + class CodeExecution(proto.Message): r"""Tool that executes code generated by the model, and automatically returns the result to the model. @@ -260,6 +304,11 @@ class Environment(proto.Enum): number=6, message="EnterpriseWebSearch", ) + parallel_ai_search: ParallelAiSearch = proto.Field( + proto.MESSAGE, + number=13, + message=ParallelAiSearch, + ) code_execution: CodeExecution = proto.Field( proto.MESSAGE, number=4, diff --git a/samples/generated_samples/aiplatform_v1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_async.py b/samples/generated_samples/aiplatform_v1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_async.py new file mode 100644 index 0000000000..71abc5490f --- /dev/null +++ b/samples/generated_samples/aiplatform_v1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_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 CancelAsyncQueryReasoningEngine +# 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_CancelAsyncQueryReasoningEngine_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_cancel_async_query_reasoning_engine(): + # Create a client + client = aiplatform_v1.ReasoningEngineExecutionServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1.CancelAsyncQueryReasoningEngineRequest( + name="name_value", + operation_name="operation_name_value", + ) + + # Make the request + response = await client.cancel_async_query_reasoning_engine(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1_generated_ReasoningEngineExecutionService_CancelAsyncQueryReasoningEngine_async] diff --git a/samples/generated_samples/aiplatform_v1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_sync.py b/samples/generated_samples/aiplatform_v1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_sync.py new file mode 100644 index 0000000000..887965b043 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_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 CancelAsyncQueryReasoningEngine +# 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_CancelAsyncQueryReasoningEngine_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_cancel_async_query_reasoning_engine(): + # Create a client + client = aiplatform_v1.ReasoningEngineExecutionServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1.CancelAsyncQueryReasoningEngineRequest( + name="name_value", + operation_name="operation_name_value", + ) + + # Make the request + response = client.cancel_async_query_reasoning_engine(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1_generated_ReasoningEngineExecutionService_CancelAsyncQueryReasoningEngine_sync] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_async.py b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_async.py new file mode 100644 index 0000000000..9894435fc9 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_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 CancelAsyncQueryReasoningEngine +# 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_CancelAsyncQueryReasoningEngine_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_cancel_async_query_reasoning_engine(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineExecutionServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.CancelAsyncQueryReasoningEngineRequest( + name="name_value", + operation_name="operation_name_value", + ) + + # Make the request + response = await client.cancel_async_query_reasoning_engine(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_ReasoningEngineExecutionService_CancelAsyncQueryReasoningEngine_async] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_sync.py b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_sync.py new file mode 100644 index 0000000000..54467fe46a --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_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 CancelAsyncQueryReasoningEngine +# 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_CancelAsyncQueryReasoningEngine_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_cancel_async_query_reasoning_engine(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineExecutionServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.CancelAsyncQueryReasoningEngineRequest( + name="name_value", + operation_name="operation_name_value", + ) + + # Make the request + response = client.cancel_async_query_reasoning_engine(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_ReasoningEngineExecutionService_CancelAsyncQueryReasoningEngine_sync] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_delete_reasoning_engine_runtime_revision_async.py b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_delete_reasoning_engine_runtime_revision_async.py new file mode 100644 index 0000000000..931e6cd9b0 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_delete_reasoning_engine_runtime_revision_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 DeleteReasoningEngineRuntimeRevision +# 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_ReasoningEngineRuntimeRevisionService_DeleteReasoningEngineRuntimeRevision_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_reasoning_engine_runtime_revision(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.DeleteReasoningEngineRuntimeRevisionRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_reasoning_engine_runtime_revision(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_ReasoningEngineRuntimeRevisionService_DeleteReasoningEngineRuntimeRevision_async] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_delete_reasoning_engine_runtime_revision_sync.py b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_delete_reasoning_engine_runtime_revision_sync.py new file mode 100644 index 0000000000..4ce8d594a5 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_delete_reasoning_engine_runtime_revision_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 DeleteReasoningEngineRuntimeRevision +# 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_ReasoningEngineRuntimeRevisionService_DeleteReasoningEngineRuntimeRevision_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_reasoning_engine_runtime_revision(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.DeleteReasoningEngineRuntimeRevisionRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_reasoning_engine_runtime_revision(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_ReasoningEngineRuntimeRevisionService_DeleteReasoningEngineRuntimeRevision_sync] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_get_reasoning_engine_runtime_revision_async.py b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_get_reasoning_engine_runtime_revision_async.py new file mode 100644 index 0000000000..3fa870c2aa --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_get_reasoning_engine_runtime_revision_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 GetReasoningEngineRuntimeRevision +# 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_ReasoningEngineRuntimeRevisionService_GetReasoningEngineRuntimeRevision_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_reasoning_engine_runtime_revision(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.GetReasoningEngineRuntimeRevisionRequest( + name="name_value", + ) + + # Make the request + response = await client.get_reasoning_engine_runtime_revision(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_ReasoningEngineRuntimeRevisionService_GetReasoningEngineRuntimeRevision_async] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_get_reasoning_engine_runtime_revision_sync.py b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_get_reasoning_engine_runtime_revision_sync.py new file mode 100644 index 0000000000..888cb6e90e --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_get_reasoning_engine_runtime_revision_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 GetReasoningEngineRuntimeRevision +# 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_ReasoningEngineRuntimeRevisionService_GetReasoningEngineRuntimeRevision_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_reasoning_engine_runtime_revision(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.GetReasoningEngineRuntimeRevisionRequest( + name="name_value", + ) + + # Make the request + response = client.get_reasoning_engine_runtime_revision(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_ReasoningEngineRuntimeRevisionService_GetReasoningEngineRuntimeRevision_sync] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_list_reasoning_engine_runtime_revisions_async.py b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_list_reasoning_engine_runtime_revisions_async.py new file mode 100644 index 0000000000..5889650822 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_list_reasoning_engine_runtime_revisions_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 ListReasoningEngineRuntimeRevisions +# 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_ReasoningEngineRuntimeRevisionService_ListReasoningEngineRuntimeRevisions_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_reasoning_engine_runtime_revisions(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.ListReasoningEngineRuntimeRevisionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_reasoning_engine_runtime_revisions(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END aiplatform_v1beta1_generated_ReasoningEngineRuntimeRevisionService_ListReasoningEngineRuntimeRevisions_async] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_list_reasoning_engine_runtime_revisions_sync.py b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_list_reasoning_engine_runtime_revisions_sync.py new file mode 100644 index 0000000000..57ac53b84a --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_list_reasoning_engine_runtime_revisions_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 ListReasoningEngineRuntimeRevisions +# 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_ReasoningEngineRuntimeRevisionService_ListReasoningEngineRuntimeRevisions_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_reasoning_engine_runtime_revisions(): + # Create a client + client = aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.ListReasoningEngineRuntimeRevisionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_reasoning_engine_runtime_revisions(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END aiplatform_v1beta1_generated_ReasoningEngineRuntimeRevisionService_ListReasoningEngineRuntimeRevisions_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 0f9b93fdac..53753f28da 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.149.0" + "version": "0.0.0" }, "snippets": [ { @@ -41985,6 +41985,159 @@ ], "title": "aiplatform_v1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_sync.py" }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1.ReasoningEngineExecutionServiceAsyncClient", + "shortName": "ReasoningEngineExecutionServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1.ReasoningEngineExecutionServiceAsyncClient.cancel_async_query_reasoning_engine", + "method": { + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine", + "service": { + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService", + "shortName": "ReasoningEngineExecutionService" + }, + "shortName": "CancelAsyncQueryReasoningEngine" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1.types.CancelAsyncQueryReasoningEngineRequest" + }, + { + "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_v1.types.CancelAsyncQueryReasoningEngineResponse", + "shortName": "cancel_async_query_reasoning_engine" + }, + "description": "Sample for CancelAsyncQueryReasoningEngine", + "file": "aiplatform_v1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1_generated_ReasoningEngineExecutionService_CancelAsyncQueryReasoningEngine_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1.ReasoningEngineExecutionServiceClient", + "shortName": "ReasoningEngineExecutionServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1.ReasoningEngineExecutionServiceClient.cancel_async_query_reasoning_engine", + "method": { + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine", + "service": { + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService", + "shortName": "ReasoningEngineExecutionService" + }, + "shortName": "CancelAsyncQueryReasoningEngine" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1.types.CancelAsyncQueryReasoningEngineRequest" + }, + { + "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_v1.types.CancelAsyncQueryReasoningEngineResponse", + "shortName": "cancel_async_query_reasoning_engine" + }, + "description": "Sample for CancelAsyncQueryReasoningEngine", + "file": "aiplatform_v1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1_generated_ReasoningEngineExecutionService_CancelAsyncQueryReasoningEngine_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1_generated_reasoning_engine_execution_service_cancel_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 81c49fac12..bb8afa1c8f 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.149.0" + "version": "0.0.0" }, "snippets": [ { @@ -52216,6 +52216,159 @@ ], "title": "aiplatform_v1beta1_generated_reasoning_engine_execution_service_async_query_reasoning_engine_sync.py" }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineExecutionServiceAsyncClient", + "shortName": "ReasoningEngineExecutionServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineExecutionServiceAsyncClient.cancel_async_query_reasoning_engine", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService", + "shortName": "ReasoningEngineExecutionService" + }, + "shortName": "CancelAsyncQueryReasoningEngine" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.CancelAsyncQueryReasoningEngineRequest" + }, + { + "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.CancelAsyncQueryReasoningEngineResponse", + "shortName": "cancel_async_query_reasoning_engine" + }, + "description": "Sample for CancelAsyncQueryReasoningEngine", + "file": "aiplatform_v1beta1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_ReasoningEngineExecutionService_CancelAsyncQueryReasoningEngine_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineExecutionServiceClient", + "shortName": "ReasoningEngineExecutionServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineExecutionServiceClient.cancel_async_query_reasoning_engine", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.CancelAsyncQueryReasoningEngine", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService", + "shortName": "ReasoningEngineExecutionService" + }, + "shortName": "CancelAsyncQueryReasoningEngine" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.CancelAsyncQueryReasoningEngineRequest" + }, + { + "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.CancelAsyncQueryReasoningEngineResponse", + "shortName": "cancel_async_query_reasoning_engine" + }, + "description": "Sample for CancelAsyncQueryReasoningEngine", + "file": "aiplatform_v1beta1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_ReasoningEngineExecutionService_CancelAsyncQueryReasoningEngine_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_reasoning_engine_execution_service_cancel_async_query_reasoning_engine_sync.py" + }, { "canonical": true, "clientMethod": { @@ -52522,6 +52675,489 @@ ], "title": "aiplatform_v1beta1_generated_reasoning_engine_execution_service_stream_query_reasoning_engine_sync.py" }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceAsyncClient", + "shortName": "ReasoningEngineRuntimeRevisionServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceAsyncClient.delete_reasoning_engine_runtime_revision", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.DeleteReasoningEngineRuntimeRevision", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "shortName": "ReasoningEngineRuntimeRevisionService" + }, + "shortName": "DeleteReasoningEngineRuntimeRevision" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.DeleteReasoningEngineRuntimeRevisionRequest" + }, + { + "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_reasoning_engine_runtime_revision" + }, + "description": "Sample for DeleteReasoningEngineRuntimeRevision", + "file": "aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_delete_reasoning_engine_runtime_revision_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_ReasoningEngineRuntimeRevisionService_DeleteReasoningEngineRuntimeRevision_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_runtime_revision_service_delete_reasoning_engine_runtime_revision_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceClient", + "shortName": "ReasoningEngineRuntimeRevisionServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceClient.delete_reasoning_engine_runtime_revision", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.DeleteReasoningEngineRuntimeRevision", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "shortName": "ReasoningEngineRuntimeRevisionService" + }, + "shortName": "DeleteReasoningEngineRuntimeRevision" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.DeleteReasoningEngineRuntimeRevisionRequest" + }, + { + "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_reasoning_engine_runtime_revision" + }, + "description": "Sample for DeleteReasoningEngineRuntimeRevision", + "file": "aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_delete_reasoning_engine_runtime_revision_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_ReasoningEngineRuntimeRevisionService_DeleteReasoningEngineRuntimeRevision_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_runtime_revision_service_delete_reasoning_engine_runtime_revision_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceAsyncClient", + "shortName": "ReasoningEngineRuntimeRevisionServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceAsyncClient.get_reasoning_engine_runtime_revision", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.GetReasoningEngineRuntimeRevision", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "shortName": "ReasoningEngineRuntimeRevisionService" + }, + "shortName": "GetReasoningEngineRuntimeRevision" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.GetReasoningEngineRuntimeRevisionRequest" + }, + { + "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.ReasoningEngineRuntimeRevision", + "shortName": "get_reasoning_engine_runtime_revision" + }, + "description": "Sample for GetReasoningEngineRuntimeRevision", + "file": "aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_get_reasoning_engine_runtime_revision_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_ReasoningEngineRuntimeRevisionService_GetReasoningEngineRuntimeRevision_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_reasoning_engine_runtime_revision_service_get_reasoning_engine_runtime_revision_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceClient", + "shortName": "ReasoningEngineRuntimeRevisionServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceClient.get_reasoning_engine_runtime_revision", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.GetReasoningEngineRuntimeRevision", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "shortName": "ReasoningEngineRuntimeRevisionService" + }, + "shortName": "GetReasoningEngineRuntimeRevision" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.GetReasoningEngineRuntimeRevisionRequest" + }, + { + "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.ReasoningEngineRuntimeRevision", + "shortName": "get_reasoning_engine_runtime_revision" + }, + "description": "Sample for GetReasoningEngineRuntimeRevision", + "file": "aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_get_reasoning_engine_runtime_revision_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_ReasoningEngineRuntimeRevisionService_GetReasoningEngineRuntimeRevision_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_reasoning_engine_runtime_revision_service_get_reasoning_engine_runtime_revision_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceAsyncClient", + "shortName": "ReasoningEngineRuntimeRevisionServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceAsyncClient.list_reasoning_engine_runtime_revisions", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "shortName": "ReasoningEngineRuntimeRevisionService" + }, + "shortName": "ListReasoningEngineRuntimeRevisions" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.ListReasoningEngineRuntimeRevisionsRequest" + }, + { + "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.reasoning_engine_runtime_revision_service.pagers.ListReasoningEngineRuntimeRevisionsAsyncPager", + "shortName": "list_reasoning_engine_runtime_revisions" + }, + "description": "Sample for ListReasoningEngineRuntimeRevisions", + "file": "aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_list_reasoning_engine_runtime_revisions_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_ReasoningEngineRuntimeRevisionService_ListReasoningEngineRuntimeRevisions_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_reasoning_engine_runtime_revision_service_list_reasoning_engine_runtime_revisions_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceClient", + "shortName": "ReasoningEngineRuntimeRevisionServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.ReasoningEngineRuntimeRevisionServiceClient.list_reasoning_engine_runtime_revisions", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService.ListReasoningEngineRuntimeRevisions", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineRuntimeRevisionService", + "shortName": "ReasoningEngineRuntimeRevisionService" + }, + "shortName": "ListReasoningEngineRuntimeRevisions" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.ListReasoningEngineRuntimeRevisionsRequest" + }, + { + "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.reasoning_engine_runtime_revision_service.pagers.ListReasoningEngineRuntimeRevisionsPager", + "shortName": "list_reasoning_engine_runtime_revisions" + }, + "description": "Sample for ListReasoningEngineRuntimeRevisions", + "file": "aiplatform_v1beta1_generated_reasoning_engine_runtime_revision_service_list_reasoning_engine_runtime_revisions_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_ReasoningEngineRuntimeRevisionService_ListReasoningEngineRuntimeRevisions_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_reasoning_engine_runtime_revision_service_list_reasoning_engine_runtime_revisions_sync.py" + }, { "canonical": true, "clientMethod": { diff --git a/tests/unit/gapic/aiplatform_v1/test_gen_ai_cache_service.py b/tests/unit/gapic/aiplatform_v1/test_gen_ai_cache_service.py index 06afa35eb4..2e1ab2bab4 100644 --- a/tests/unit/gapic/aiplatform_v1/test_gen_ai_cache_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_gen_ai_cache_service.py @@ -4962,6 +4962,10 @@ def test_create_cached_content_rest_call_success(request_type): ], "blocking_confidence": 30, }, + "parallel_ai_search": { + "api_key": "api_key_value", + "custom_configs": {}, + }, "code_execution": {}, "url_context": {}, "computer_use": { @@ -5512,6 +5516,10 @@ def test_update_cached_content_rest_call_success(request_type): ], "blocking_confidence": 30, }, + "parallel_ai_search": { + "api_key": "api_key_value", + "custom_configs": {}, + }, "code_execution": {}, "url_context": {}, "computer_use": { @@ -6924,6 +6932,10 @@ async def test_create_cached_content_rest_asyncio_call_success(request_type): ], "blocking_confidence": 30, }, + "parallel_ai_search": { + "api_key": "api_key_value", + "custom_configs": {}, + }, "code_execution": {}, "url_context": {}, "computer_use": { @@ -7510,6 +7522,10 @@ async def test_update_cached_content_rest_asyncio_call_success(request_type): ], "blocking_confidence": 30, }, + "parallel_ai_search": { + "api_key": "api_key_value", + "custom_configs": {}, + }, "code_execution": {}, "url_context": {}, "computer_use": { diff --git a/tests/unit/gapic/aiplatform_v1/test_migration_service.py b/tests/unit/gapic/aiplatform_v1/test_migration_service.py index 1aa93934c0..751e0e57ae 100644 --- a/tests/unit/gapic/aiplatform_v1/test_migration_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_migration_service.py @@ -5597,22 +5597,19 @@ def test_parse_annotated_dataset_path(): def test_dataset_path(): project = "cuttlefish" - location = "mussel" - dataset = "winkle" - expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( + dataset = "mussel" + expected = "projects/{project}/datasets/{dataset}".format( project=project, - location=location, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, location, dataset) + actual = MigrationServiceClient.dataset_path(project, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "nautilus", - "location": "scallop", - "dataset": "abalone", + "project": "winkle", + "dataset": "nautilus", } path = MigrationServiceClient.dataset_path(**expected) @@ -5622,19 +5619,22 @@ def test_parse_dataset_path(): def test_dataset_path(): - project = "squid" - dataset = "clam" - expected = "projects/{project}/datasets/{dataset}".format( + project = "scallop" + location = "abalone" + dataset = "squid" + expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, + location=location, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, dataset) + actual = MigrationServiceClient.dataset_path(project, location, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "whelk", + "project": "clam", + "location": "whelk", "dataset": "octopus", } path = MigrationServiceClient.dataset_path(**expected) 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 2aee96606c..98a062bc25 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 @@ -2249,6 +2249,279 @@ async def test_async_query_reasoning_engine_field_headers_async(): ) in kw["metadata"] +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, + dict, + ], +) +def test_cancel_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.cancel_async_query_reasoning_engine), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + response = client.cancel_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.CancelAsyncQueryReasoningEngineRequest() + ) + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance( + response, + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ) + + +def test_cancel_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.CancelAsyncQueryReasoningEngineRequest( + name="name_value", + operation_name="operation_name_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.cancel_async_query_reasoning_engine), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.cancel_async_query_reasoning_engine(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[ + 0 + ] == reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest( + name="name_value", + operation_name="operation_name_value", + ) + + +def test_cancel_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.cancel_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.cancel_async_query_reasoning_engine + ] = mock_rpc + request = {} + client.cancel_async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.cancel_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_cancel_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.cancel_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.cancel_async_query_reasoning_engine + ] = mock_rpc + + request = {} + await client.cancel_async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + await client.cancel_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_cancel_async_query_reasoning_engine_async( + transport: str = "grpc_asyncio", + request_type=reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, +): + 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.cancel_async_query_reasoning_engine), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + response = await client.cancel_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.CancelAsyncQueryReasoningEngineRequest() + ) + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance( + response, + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ) + + +@pytest.mark.asyncio +async def test_cancel_async_query_reasoning_engine_async_from_dict(): + await test_cancel_async_query_reasoning_engine_async(request_type=dict) + + +def test_cancel_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.CancelAsyncQueryReasoningEngineRequest() + ) + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.cancel_async_query_reasoning_engine), "__call__" + ) as call: + call.return_value = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + client.cancel_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_cancel_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.CancelAsyncQueryReasoningEngineRequest() + ) + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.cancel_async_query_reasoning_engine), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + await client.cancel_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 @@ -2351,35 +2624,164 @@ def test_query_reasoning_engine_rest_required_fields( response_value = Response() response_value.status_code = 200 - # Convert return value to protobuf type - return_value = ( - reasoning_engine_execution_service.QueryReasoningEngineResponse.pb( - return_value - ) - ) + # Convert return value to protobuf type + return_value = ( + reasoning_engine_execution_service.QueryReasoningEngineResponse.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.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_query_reasoning_engine_rest_unset_required_fields(): + transport = transports.ReasoningEngineExecutionServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.query_reasoning_engine._get_unset_required_fields({}) + assert set(unset_fields) == (set(()) & set(("name",))) + + +def test_stream_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.stream_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.stream_query_reasoning_engine + ] = mock_rpc + + request = {} + client.stream_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.stream_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_stream_query_reasoning_engine_rest_required_fields( + request_type=reasoning_engine_execution_service.StreamQueryReasoningEngineRequest, +): + 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() + ).stream_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() + ).stream_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 = httpbody_pb2.HttpBody() + # 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) + json_return_value = "[{}]".format(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.query_reasoning_engine(request) + with mock.patch.object(response_value, "iter_content") as iter_content: + iter_content.return_value = iter(json_return_value) + response = client.stream_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_query_reasoning_engine_rest_unset_required_fields(): +def test_stream_query_reasoning_engine_rest_unset_required_fields(): transport = transports.ReasoningEngineExecutionServiceRestTransport( credentials=ga_credentials.AnonymousCredentials ) - unset_fields = transport.query_reasoning_engine._get_unset_required_fields({}) + unset_fields = transport.stream_query_reasoning_engine._get_unset_required_fields( + {} + ) assert set(unset_fields) == (set(()) & set(("name",))) -def test_stream_query_reasoning_engine_rest_use_cached_wrapped_rpc(): +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: @@ -2394,7 +2796,7 @@ def test_stream_query_reasoning_engine_rest_use_cached_wrapped_rpc(): # Ensure method has been cached assert ( - client._transport.stream_query_reasoning_engine + client._transport.async_query_reasoning_engine in client._transport._wrapped_methods ) @@ -2404,24 +2806,28 @@ def test_stream_query_reasoning_engine_rest_use_cached_wrapped_rpc(): "foo" # operation_request.operation in compute client(s) expect a string. ) client._transport._wrapped_methods[ - client._transport.stream_query_reasoning_engine + client._transport.async_query_reasoning_engine ] = mock_rpc request = {} - client.stream_query_reasoning_engine(request) + client.async_query_reasoning_engine(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 - client.stream_query_reasoning_engine(request) + # 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_stream_query_reasoning_engine_rest_required_fields( - request_type=reasoning_engine_execution_service.StreamQueryReasoningEngineRequest, +def test_async_query_reasoning_engine_rest_required_fields( + request_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, ): transport_class = transports.ReasoningEngineExecutionServiceRestTransport @@ -2437,7 +2843,7 @@ def test_stream_query_reasoning_engine_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).stream_query_reasoning_engine._get_unset_required_fields(jsonified_request) + ).async_query_reasoning_engine._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present @@ -2446,7 +2852,7 @@ def test_stream_query_reasoning_engine_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).stream_query_reasoning_engine._get_unset_required_fields(jsonified_request) + ).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 @@ -2460,7 +2866,7 @@ def test_stream_query_reasoning_engine_rest_required_fields( request = request_type(**request_init) # Designate an appropriate value for the returned response. - return_value = httpbody_pb2.HttpBody() + 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 @@ -2480,35 +2886,29 @@ def test_stream_query_reasoning_engine_rest_required_fields( response_value = Response() response_value.status_code = 200 - json_return_value = json_format.MessageToJson(return_value) - json_return_value = "[{}]".format(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"} - with mock.patch.object(response_value, "iter_content") as iter_content: - iter_content.return_value = iter(json_return_value) - response = client.stream_query_reasoning_engine(request) + 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_stream_query_reasoning_engine_rest_unset_required_fields(): +def test_async_query_reasoning_engine_rest_unset_required_fields(): transport = transports.ReasoningEngineExecutionServiceRestTransport( credentials=ga_credentials.AnonymousCredentials ) - unset_fields = transport.stream_query_reasoning_engine._get_unset_required_fields( - {} - ) + unset_fields = transport.async_query_reasoning_engine._get_unset_required_fields({}) assert set(unset_fields) == (set(()) & set(("name",))) -def test_async_query_reasoning_engine_rest_use_cached_wrapped_rpc(): +def test_cancel_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: @@ -2523,7 +2923,7 @@ def test_async_query_reasoning_engine_rest_use_cached_wrapped_rpc(): # Ensure method has been cached assert ( - client._transport.async_query_reasoning_engine + client._transport.cancel_async_query_reasoning_engine in client._transport._wrapped_methods ) @@ -2533,33 +2933,30 @@ def test_async_query_reasoning_engine_rest_use_cached_wrapped_rpc(): "foo" # operation_request.operation in compute client(s) expect a string. ) client._transport._wrapped_methods[ - client._transport.async_query_reasoning_engine + client._transport.cancel_async_query_reasoning_engine ] = mock_rpc request = {} - client.async_query_reasoning_engine(request) + client.cancel_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) + client.cancel_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, +def test_cancel_async_query_reasoning_engine_rest_required_fields( + request_type=reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, ): transport_class = transports.ReasoningEngineExecutionServiceRestTransport request_init = {} request_init["name"] = "" + request_init["operation_name"] = "" request = request_type(**request_init) pb_request = request_type.pb(request) jsonified_request = json.loads( @@ -2570,21 +2967,24 @@ def test_async_query_reasoning_engine_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).async_query_reasoning_engine._get_unset_required_fields(jsonified_request) + ).cancel_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" + jsonified_request["operationName"] = "operation_name_value" unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).async_query_reasoning_engine._get_unset_required_fields(jsonified_request) + ).cancel_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" + assert "operationName" in jsonified_request + assert jsonified_request["operationName"] == "operation_name_value" client = ReasoningEngineExecutionServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -2593,7 +2993,9 @@ def test_async_query_reasoning_engine_rest_required_fields( request = request_type(**request_init) # Designate an appropriate value for the returned response. - return_value = operations_pb2.Operation(name="operations/spam") + return_value = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) # 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 @@ -2613,26 +3015,41 @@ def test_async_query_reasoning_engine_rest_required_fields( response_value = Response() response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.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.async_query_reasoning_engine(request) + response = client.cancel_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(): +def test_cancel_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",))) + unset_fields = ( + transport.cancel_async_query_reasoning_engine._get_unset_required_fields({}) + ) + assert set(unset_fields) == ( + set(()) + & set( + ( + "name", + "operationName", + ) + ) + ) def test_credentials_transport_error(): @@ -2816,6 +3233,33 @@ def test_async_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_cancel_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.cancel_async_query_reasoning_engine), "__call__" + ) as call: + call.return_value = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + client.cancel_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.CancelAsyncQueryReasoningEngineRequest() + ) + + assert args[0] == request_msg + + def test_transport_kind_grpc_asyncio(): transport = ReasoningEngineExecutionServiceAsyncClient.get_transport_class( "grpc_asyncio" @@ -2914,6 +3358,35 @@ async def test_async_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_cancel_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.cancel_async_query_reasoning_engine), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + await client.cancel_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.CancelAsyncQueryReasoningEngineRequest() + ) + + assert args[0] == request_msg + + def test_transport_kind_rest(): transport = ReasoningEngineExecutionServiceClient.get_transport_class("rest")( credentials=ga_credentials.AnonymousCredentials() @@ -3142,7 +3615,139 @@ def test_stream_query_reasoning_engine_rest_call_success(request_type): @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_stream_query_reasoning_engine_rest_interceptors(null_interceptor): +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"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_async_query_reasoning_engine_rest_bad_request( + request_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, +): + 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.async_query_reasoning_engine(request) + + +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + dict, + ], +) +def test_async_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 = 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.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.parametrize("null_interceptor", [True, False]) +def test_async_query_reasoning_engine_rest_interceptors(null_interceptor): transport = transports.ReasoningEngineExecutionServiceRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=( @@ -3158,21 +3763,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 = { @@ -3185,19 +3792,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"), @@ -3210,8 +3817,8 @@ def test_stream_query_reasoning_engine_rest_interceptors(null_interceptor): post_with_metadata.assert_called_once() -def test_async_query_reasoning_engine_rest_bad_request( - request_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, +def test_cancel_async_query_reasoning_engine_rest_bad_request( + request_type=reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, ): client = ReasoningEngineExecutionServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" @@ -3234,17 +3841,17 @@ def test_async_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.async_query_reasoning_engine(request) + client.cancel_async_query_reasoning_engine(request) @pytest.mark.parametrize( "request_type", [ - reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, dict, ], ) -def test_async_query_reasoning_engine_rest_call_success(request_type): +def test_cancel_async_query_reasoning_engine_rest_call_success(request_type): client = ReasoningEngineExecutionServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3258,23 +3865,33 @@ def test_async_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 = operations_pb2.Operation(name="operations/spam") + return_value = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) # 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 = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.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.async_query_reasoning_engine(request) + response = client.cancel_async_query_reasoning_engine(request) # Establish that the response is the type that we expect. - json_return_value = json_format.MessageToJson(return_value) + assert isinstance( + response, + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ) @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_async_query_reasoning_engine_rest_interceptors(null_interceptor): +def test_cancel_async_query_reasoning_engine_rest_interceptors(null_interceptor): transport = transports.ReasoningEngineExecutionServiceRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=( @@ -3290,24 +3907,20 @@ def test_async_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_async_query_reasoning_engine", + "post_cancel_async_query_reasoning_engine", ) as post, mock.patch.object( transports.ReasoningEngineExecutionServiceRestInterceptor, - "post_async_query_reasoning_engine_with_metadata", + "post_cancel_async_query_reasoning_engine_with_metadata", ) as post_with_metadata, mock.patch.object( transports.ReasoningEngineExecutionServiceRestInterceptor, - "pre_async_query_reasoning_engine", + "pre_cancel_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() - ) + pb_message = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest.pb( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest() ) transcode.return_value = { "method": "post", @@ -3319,19 +3932,28 @@ def test_async_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(operations_pb2.Operation()) + return_value = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.to_json( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) req.return_value.content = return_value - request = reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + request = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest() + ) 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 = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + post_with_metadata.return_value = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse(), + metadata, + ) - client.async_query_reasoning_engine( + client.cancel_async_query_reasoning_engine( request, metadata=[ ("key", "val"), @@ -4046,6 +4668,30 @@ def test_async_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_cancel_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.cancel_async_query_reasoning_engine), "__call__" + ) as call: + client.cancel_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.CancelAsyncQueryReasoningEngineRequest() + ) + + assert args[0] == request_msg + + def test_reasoning_engine_execution_service_rest_lro_client(): client = ReasoningEngineExecutionServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -4545,6 +5191,175 @@ async def test_async_query_reasoning_engine_rest_asyncio_interceptors(null_inter post_with_metadata.assert_called_once() +@pytest.mark.asyncio +async def test_cancel_async_query_reasoning_engine_rest_asyncio_bad_request( + request_type=reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, +): + 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.cancel_async_query_reasoning_engine(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, + dict, + ], +) +async def test_cancel_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 = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + + # 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 = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.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.cancel_async_query_reasoning_engine(request) + + # Establish that the response is the type that we expect. + assert isinstance( + response, + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("null_interceptor", [True, False]) +async def test_cancel_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( + transports.AsyncReasoningEngineExecutionServiceRestInterceptor, + "post_cancel_async_query_reasoning_engine", + ) as post, mock.patch.object( + transports.AsyncReasoningEngineExecutionServiceRestInterceptor, + "post_cancel_async_query_reasoning_engine_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.AsyncReasoningEngineExecutionServiceRestInterceptor, + "pre_cancel_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.CancelAsyncQueryReasoningEngineRequest.pb( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest() + ) + 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 = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.to_json( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + req.return_value.read = mock.AsyncMock(return_value=return_value) + + request = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest() + ) + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + post_with_metadata.return_value = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse(), + metadata, + ) + + await client.cancel_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, @@ -5378,6 +6193,35 @@ async def test_async_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_cancel_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.cancel_async_query_reasoning_engine), "__call__" + ) as call: + await client.cancel_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.CancelAsyncQueryReasoningEngineRequest() + ) + + assert args[0] == request_msg + + def test_reasoning_engine_execution_service_rest_asyncio_lro_client(): if not HAS_ASYNC_REST_EXTRA: pytest.skip( @@ -5449,6 +6293,7 @@ def test_reasoning_engine_execution_service_base_transport(): "query_reasoning_engine", "stream_query_reasoning_engine", "async_query_reasoning_engine", + "cancel_async_query_reasoning_engine", "set_iam_policy", "get_iam_policy", "test_iam_permissions", @@ -5742,6 +6587,9 @@ def test_reasoning_engine_execution_service_client_transport_session_collision( session1 = client1.transport.async_query_reasoning_engine._session session2 = client2.transport.async_query_reasoning_engine._session assert session1 != session2 + session1 = client1.transport.cancel_async_query_reasoning_engine._session + session2 = client2.transport.cancel_async_query_reasoning_engine._session + assert session1 != session2 def test_reasoning_engine_execution_service_grpc_transport_channel(): diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_gen_ai_cache_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_gen_ai_cache_service.py index c3006d90fe..09c7da9b92 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_gen_ai_cache_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_gen_ai_cache_service.py @@ -4962,6 +4962,10 @@ def test_create_cached_content_rest_call_success(request_type): ], "blocking_confidence": 30, }, + "parallel_ai_search": { + "api_key": "api_key_value", + "custom_configs": {}, + }, "code_execution": {}, "url_context": {}, "computer_use": { @@ -5512,6 +5516,10 @@ def test_update_cached_content_rest_call_success(request_type): ], "blocking_confidence": 30, }, + "parallel_ai_search": { + "api_key": "api_key_value", + "custom_configs": {}, + }, "code_execution": {}, "url_context": {}, "computer_use": { @@ -6924,6 +6932,10 @@ async def test_create_cached_content_rest_asyncio_call_success(request_type): ], "blocking_confidence": 30, }, + "parallel_ai_search": { + "api_key": "api_key_value", + "custom_configs": {}, + }, "code_execution": {}, "url_context": {}, "computer_use": { @@ -7510,6 +7522,10 @@ async def test_update_cached_content_rest_asyncio_call_success(request_type): ], "blocking_confidence": 30, }, + "parallel_ai_search": { + "api_key": "api_key_value", + "custom_configs": {}, + }, "code_execution": {}, "url_context": {}, "computer_use": { 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 6f95c89654..75136f666f 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 @@ -2249,6 +2249,279 @@ async def test_async_query_reasoning_engine_field_headers_async(): ) in kw["metadata"] +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, + dict, + ], +) +def test_cancel_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.cancel_async_query_reasoning_engine), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + response = client.cancel_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.CancelAsyncQueryReasoningEngineRequest() + ) + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance( + response, + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ) + + +def test_cancel_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.CancelAsyncQueryReasoningEngineRequest( + name="name_value", + operation_name="operation_name_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.cancel_async_query_reasoning_engine), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.cancel_async_query_reasoning_engine(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[ + 0 + ] == reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest( + name="name_value", + operation_name="operation_name_value", + ) + + +def test_cancel_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.cancel_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.cancel_async_query_reasoning_engine + ] = mock_rpc + request = {} + client.cancel_async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.cancel_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_cancel_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.cancel_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.cancel_async_query_reasoning_engine + ] = mock_rpc + + request = {} + await client.cancel_async_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + await client.cancel_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_cancel_async_query_reasoning_engine_async( + transport: str = "grpc_asyncio", + request_type=reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, +): + 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.cancel_async_query_reasoning_engine), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + response = await client.cancel_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.CancelAsyncQueryReasoningEngineRequest() + ) + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance( + response, + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ) + + +@pytest.mark.asyncio +async def test_cancel_async_query_reasoning_engine_async_from_dict(): + await test_cancel_async_query_reasoning_engine_async(request_type=dict) + + +def test_cancel_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.CancelAsyncQueryReasoningEngineRequest() + ) + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.cancel_async_query_reasoning_engine), "__call__" + ) as call: + call.return_value = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + client.cancel_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_cancel_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.CancelAsyncQueryReasoningEngineRequest() + ) + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.cancel_async_query_reasoning_engine), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + await client.cancel_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 @@ -2351,35 +2624,164 @@ def test_query_reasoning_engine_rest_required_fields( response_value = Response() response_value.status_code = 200 - # Convert return value to protobuf type - return_value = ( - reasoning_engine_execution_service.QueryReasoningEngineResponse.pb( - return_value - ) - ) + # Convert return value to protobuf type + return_value = ( + reasoning_engine_execution_service.QueryReasoningEngineResponse.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.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_query_reasoning_engine_rest_unset_required_fields(): + transport = transports.ReasoningEngineExecutionServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = transport.query_reasoning_engine._get_unset_required_fields({}) + assert set(unset_fields) == (set(()) & set(("name",))) + + +def test_stream_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.stream_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.stream_query_reasoning_engine + ] = mock_rpc + + request = {} + client.stream_query_reasoning_engine(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.stream_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_stream_query_reasoning_engine_rest_required_fields( + request_type=reasoning_engine_execution_service.StreamQueryReasoningEngineRequest, +): + 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() + ).stream_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() + ).stream_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 = httpbody_pb2.HttpBody() + # 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) + json_return_value = "[{}]".format(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.query_reasoning_engine(request) + with mock.patch.object(response_value, "iter_content") as iter_content: + iter_content.return_value = iter(json_return_value) + response = client.stream_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_query_reasoning_engine_rest_unset_required_fields(): +def test_stream_query_reasoning_engine_rest_unset_required_fields(): transport = transports.ReasoningEngineExecutionServiceRestTransport( credentials=ga_credentials.AnonymousCredentials ) - unset_fields = transport.query_reasoning_engine._get_unset_required_fields({}) + unset_fields = transport.stream_query_reasoning_engine._get_unset_required_fields( + {} + ) assert set(unset_fields) == (set(()) & set(("name",))) -def test_stream_query_reasoning_engine_rest_use_cached_wrapped_rpc(): +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: @@ -2394,7 +2796,7 @@ def test_stream_query_reasoning_engine_rest_use_cached_wrapped_rpc(): # Ensure method has been cached assert ( - client._transport.stream_query_reasoning_engine + client._transport.async_query_reasoning_engine in client._transport._wrapped_methods ) @@ -2404,24 +2806,28 @@ def test_stream_query_reasoning_engine_rest_use_cached_wrapped_rpc(): "foo" # operation_request.operation in compute client(s) expect a string. ) client._transport._wrapped_methods[ - client._transport.stream_query_reasoning_engine + client._transport.async_query_reasoning_engine ] = mock_rpc request = {} - client.stream_query_reasoning_engine(request) + client.async_query_reasoning_engine(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 - client.stream_query_reasoning_engine(request) + # 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_stream_query_reasoning_engine_rest_required_fields( - request_type=reasoning_engine_execution_service.StreamQueryReasoningEngineRequest, +def test_async_query_reasoning_engine_rest_required_fields( + request_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, ): transport_class = transports.ReasoningEngineExecutionServiceRestTransport @@ -2437,7 +2843,7 @@ def test_stream_query_reasoning_engine_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).stream_query_reasoning_engine._get_unset_required_fields(jsonified_request) + ).async_query_reasoning_engine._get_unset_required_fields(jsonified_request) jsonified_request.update(unset_fields) # verify required fields with default values are now present @@ -2446,7 +2852,7 @@ def test_stream_query_reasoning_engine_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).stream_query_reasoning_engine._get_unset_required_fields(jsonified_request) + ).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 @@ -2460,7 +2866,7 @@ def test_stream_query_reasoning_engine_rest_required_fields( request = request_type(**request_init) # Designate an appropriate value for the returned response. - return_value = httpbody_pb2.HttpBody() + 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 @@ -2480,35 +2886,29 @@ def test_stream_query_reasoning_engine_rest_required_fields( response_value = Response() response_value.status_code = 200 - json_return_value = json_format.MessageToJson(return_value) - json_return_value = "[{}]".format(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"} - with mock.patch.object(response_value, "iter_content") as iter_content: - iter_content.return_value = iter(json_return_value) - response = client.stream_query_reasoning_engine(request) + 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_stream_query_reasoning_engine_rest_unset_required_fields(): +def test_async_query_reasoning_engine_rest_unset_required_fields(): transport = transports.ReasoningEngineExecutionServiceRestTransport( credentials=ga_credentials.AnonymousCredentials ) - unset_fields = transport.stream_query_reasoning_engine._get_unset_required_fields( - {} - ) + unset_fields = transport.async_query_reasoning_engine._get_unset_required_fields({}) assert set(unset_fields) == (set(()) & set(("name",))) -def test_async_query_reasoning_engine_rest_use_cached_wrapped_rpc(): +def test_cancel_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: @@ -2523,7 +2923,7 @@ def test_async_query_reasoning_engine_rest_use_cached_wrapped_rpc(): # Ensure method has been cached assert ( - client._transport.async_query_reasoning_engine + client._transport.cancel_async_query_reasoning_engine in client._transport._wrapped_methods ) @@ -2533,33 +2933,30 @@ def test_async_query_reasoning_engine_rest_use_cached_wrapped_rpc(): "foo" # operation_request.operation in compute client(s) expect a string. ) client._transport._wrapped_methods[ - client._transport.async_query_reasoning_engine + client._transport.cancel_async_query_reasoning_engine ] = mock_rpc request = {} - client.async_query_reasoning_engine(request) + client.cancel_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) + client.cancel_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, +def test_cancel_async_query_reasoning_engine_rest_required_fields( + request_type=reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, ): transport_class = transports.ReasoningEngineExecutionServiceRestTransport request_init = {} request_init["name"] = "" + request_init["operation_name"] = "" request = request_type(**request_init) pb_request = request_type.pb(request) jsonified_request = json.loads( @@ -2570,21 +2967,24 @@ def test_async_query_reasoning_engine_rest_required_fields( unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).async_query_reasoning_engine._get_unset_required_fields(jsonified_request) + ).cancel_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" + jsonified_request["operationName"] = "operation_name_value" unset_fields = transport_class( credentials=ga_credentials.AnonymousCredentials() - ).async_query_reasoning_engine._get_unset_required_fields(jsonified_request) + ).cancel_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" + assert "operationName" in jsonified_request + assert jsonified_request["operationName"] == "operation_name_value" client = ReasoningEngineExecutionServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -2593,7 +2993,9 @@ def test_async_query_reasoning_engine_rest_required_fields( request = request_type(**request_init) # Designate an appropriate value for the returned response. - return_value = operations_pb2.Operation(name="operations/spam") + return_value = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) # 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 @@ -2613,26 +3015,41 @@ def test_async_query_reasoning_engine_rest_required_fields( response_value = Response() response_value.status_code = 200 + + # Convert return value to protobuf type + return_value = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.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.async_query_reasoning_engine(request) + response = client.cancel_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(): +def test_cancel_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",))) + unset_fields = ( + transport.cancel_async_query_reasoning_engine._get_unset_required_fields({}) + ) + assert set(unset_fields) == ( + set(()) + & set( + ( + "name", + "operationName", + ) + ) + ) def test_credentials_transport_error(): @@ -2816,6 +3233,33 @@ def test_async_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_cancel_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.cancel_async_query_reasoning_engine), "__call__" + ) as call: + call.return_value = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + client.cancel_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.CancelAsyncQueryReasoningEngineRequest() + ) + + assert args[0] == request_msg + + def test_transport_kind_grpc_asyncio(): transport = ReasoningEngineExecutionServiceAsyncClient.get_transport_class( "grpc_asyncio" @@ -2914,6 +3358,35 @@ async def test_async_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_cancel_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.cancel_async_query_reasoning_engine), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + await client.cancel_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.CancelAsyncQueryReasoningEngineRequest() + ) + + assert args[0] == request_msg + + def test_transport_kind_rest(): transport = ReasoningEngineExecutionServiceClient.get_transport_class("rest")( credentials=ga_credentials.AnonymousCredentials() @@ -3142,7 +3615,139 @@ def test_stream_query_reasoning_engine_rest_call_success(request_type): @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_stream_query_reasoning_engine_rest_interceptors(null_interceptor): +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"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_async_query_reasoning_engine_rest_bad_request( + request_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, +): + 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.async_query_reasoning_engine(request) + + +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + dict, + ], +) +def test_async_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 = 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.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.parametrize("null_interceptor", [True, False]) +def test_async_query_reasoning_engine_rest_interceptors(null_interceptor): transport = transports.ReasoningEngineExecutionServiceRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=( @@ -3158,21 +3763,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 = { @@ -3185,19 +3792,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"), @@ -3210,8 +3817,8 @@ def test_stream_query_reasoning_engine_rest_interceptors(null_interceptor): post_with_metadata.assert_called_once() -def test_async_query_reasoning_engine_rest_bad_request( - request_type=reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, +def test_cancel_async_query_reasoning_engine_rest_bad_request( + request_type=reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, ): client = ReasoningEngineExecutionServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" @@ -3234,17 +3841,17 @@ def test_async_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.async_query_reasoning_engine(request) + client.cancel_async_query_reasoning_engine(request) @pytest.mark.parametrize( "request_type", [ - reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest, + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, dict, ], ) -def test_async_query_reasoning_engine_rest_call_success(request_type): +def test_cancel_async_query_reasoning_engine_rest_call_success(request_type): client = ReasoningEngineExecutionServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -3258,23 +3865,33 @@ def test_async_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 = operations_pb2.Operation(name="operations/spam") + return_value = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) # 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 = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.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.async_query_reasoning_engine(request) + response = client.cancel_async_query_reasoning_engine(request) # Establish that the response is the type that we expect. - json_return_value = json_format.MessageToJson(return_value) + assert isinstance( + response, + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ) @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_async_query_reasoning_engine_rest_interceptors(null_interceptor): +def test_cancel_async_query_reasoning_engine_rest_interceptors(null_interceptor): transport = transports.ReasoningEngineExecutionServiceRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=( @@ -3290,24 +3907,20 @@ def test_async_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_async_query_reasoning_engine", + "post_cancel_async_query_reasoning_engine", ) as post, mock.patch.object( transports.ReasoningEngineExecutionServiceRestInterceptor, - "post_async_query_reasoning_engine_with_metadata", + "post_cancel_async_query_reasoning_engine_with_metadata", ) as post_with_metadata, mock.patch.object( transports.ReasoningEngineExecutionServiceRestInterceptor, - "pre_async_query_reasoning_engine", + "pre_cancel_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() - ) + pb_message = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest.pb( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest() ) transcode.return_value = { "method": "post", @@ -3319,19 +3932,28 @@ def test_async_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(operations_pb2.Operation()) + return_value = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.to_json( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) req.return_value.content = return_value - request = reasoning_engine_execution_service.AsyncQueryReasoningEngineRequest() + request = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest() + ) 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 = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + post_with_metadata.return_value = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse(), + metadata, + ) - client.async_query_reasoning_engine( + client.cancel_async_query_reasoning_engine( request, metadata=[ ("key", "val"), @@ -4046,6 +4668,30 @@ def test_async_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_cancel_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.cancel_async_query_reasoning_engine), "__call__" + ) as call: + client.cancel_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.CancelAsyncQueryReasoningEngineRequest() + ) + + assert args[0] == request_msg + + def test_reasoning_engine_execution_service_rest_lro_client(): client = ReasoningEngineExecutionServiceClient( credentials=ga_credentials.AnonymousCredentials(), @@ -4545,6 +5191,175 @@ async def test_async_query_reasoning_engine_rest_asyncio_interceptors(null_inter post_with_metadata.assert_called_once() +@pytest.mark.asyncio +async def test_cancel_async_query_reasoning_engine_rest_asyncio_bad_request( + request_type=reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, +): + 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.cancel_async_query_reasoning_engine(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest, + dict, + ], +) +async def test_cancel_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 = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + + # 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 = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.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.cancel_async_query_reasoning_engine(request) + + # Establish that the response is the type that we expect. + assert isinstance( + response, + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse, + ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("null_interceptor", [True, False]) +async def test_cancel_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( + transports.AsyncReasoningEngineExecutionServiceRestInterceptor, + "post_cancel_async_query_reasoning_engine", + ) as post, mock.patch.object( + transports.AsyncReasoningEngineExecutionServiceRestInterceptor, + "post_cancel_async_query_reasoning_engine_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.AsyncReasoningEngineExecutionServiceRestInterceptor, + "pre_cancel_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.CancelAsyncQueryReasoningEngineRequest.pb( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest() + ) + 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 = reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse.to_json( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + req.return_value.read = mock.AsyncMock(return_value=return_value) + + request = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineRequest() + ) + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse() + ) + post_with_metadata.return_value = ( + reasoning_engine_execution_service.CancelAsyncQueryReasoningEngineResponse(), + metadata, + ) + + await client.cancel_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, @@ -5378,6 +6193,35 @@ async def test_async_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_cancel_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.cancel_async_query_reasoning_engine), "__call__" + ) as call: + await client.cancel_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.CancelAsyncQueryReasoningEngineRequest() + ) + + assert args[0] == request_msg + + def test_reasoning_engine_execution_service_rest_asyncio_lro_client(): if not HAS_ASYNC_REST_EXTRA: pytest.skip( @@ -5449,6 +6293,7 @@ def test_reasoning_engine_execution_service_base_transport(): "query_reasoning_engine", "stream_query_reasoning_engine", "async_query_reasoning_engine", + "cancel_async_query_reasoning_engine", "set_iam_policy", "get_iam_policy", "test_iam_permissions", @@ -5742,6 +6587,9 @@ def test_reasoning_engine_execution_service_client_transport_session_collision( session1 = client1.transport.async_query_reasoning_engine._session session2 = client2.transport.async_query_reasoning_engine._session assert session1 != session2 + session1 = client1.transport.cancel_async_query_reasoning_engine._session + session2 = client2.transport.cancel_async_query_reasoning_engine._session + assert session1 != session2 def test_reasoning_engine_execution_service_grpc_transport_channel(): diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_reasoning_engine_runtime_revision_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_reasoning_engine_runtime_revision_service.py new file mode 100644 index 0000000000..e523336c73 --- /dev/null +++ b/tests/unit/gapic/aiplatform_v1beta1/test_reasoning_engine_runtime_revision_service.py @@ -0,0 +1,8705 @@ +# -*- 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.reasoning_engine_runtime_revision_service import ( + ReasoningEngineRuntimeRevisionServiceAsyncClient, +) +from google.cloud.aiplatform_v1beta1.services.reasoning_engine_runtime_revision_service import ( + ReasoningEngineRuntimeRevisionServiceClient, +) +from google.cloud.aiplatform_v1beta1.services.reasoning_engine_runtime_revision_service import ( + pagers, +) +from google.cloud.aiplatform_v1beta1.services.reasoning_engine_runtime_revision_service import ( + transports, +) +from google.cloud.aiplatform_v1beta1.types import reasoning_engine +from google.cloud.aiplatform_v1beta1.types import reasoning_engine_runtime_revision +from google.cloud.aiplatform_v1beta1.types import ( + reasoning_engine_runtime_revision_service, +) +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.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 ( + ReasoningEngineRuntimeRevisionServiceClient._get_default_mtls_endpoint(None) + is None + ) + assert ( + ReasoningEngineRuntimeRevisionServiceClient._get_default_mtls_endpoint( + api_endpoint + ) + == api_mtls_endpoint + ) + assert ( + ReasoningEngineRuntimeRevisionServiceClient._get_default_mtls_endpoint( + api_mtls_endpoint + ) + == api_mtls_endpoint + ) + assert ( + ReasoningEngineRuntimeRevisionServiceClient._get_default_mtls_endpoint( + sandbox_endpoint + ) + == sandbox_mtls_endpoint + ) + assert ( + ReasoningEngineRuntimeRevisionServiceClient._get_default_mtls_endpoint( + sandbox_mtls_endpoint + ) + == sandbox_mtls_endpoint + ) + assert ( + ReasoningEngineRuntimeRevisionServiceClient._get_default_mtls_endpoint( + non_googleapi + ) + == non_googleapi + ) + + +def test__read_environment_variables(): + assert ( + ReasoningEngineRuntimeRevisionServiceClient._read_environment_variables() + == (False, "auto", None) + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + assert ( + ReasoningEngineRuntimeRevisionServiceClient._read_environment_variables() + == (True, "auto", None) + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + assert ( + ReasoningEngineRuntimeRevisionServiceClient._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: + ReasoningEngineRuntimeRevisionServiceClient._read_environment_variables() + assert ( + str(excinfo.value) + == "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + else: + assert ReasoningEngineRuntimeRevisionServiceClient._read_environment_variables() == ( + False, + "auto", + None, + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + assert ( + ReasoningEngineRuntimeRevisionServiceClient._read_environment_variables() + == (False, "never", None) + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + assert ( + ReasoningEngineRuntimeRevisionServiceClient._read_environment_variables() + == (False, "always", None) + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}): + assert ( + ReasoningEngineRuntimeRevisionServiceClient._read_environment_variables() + == (False, "auto", None) + ) + + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError) as excinfo: + ReasoningEngineRuntimeRevisionServiceClient._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 ( + ReasoningEngineRuntimeRevisionServiceClient._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 ( + ReasoningEngineRuntimeRevisionServiceClient._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 ( + ReasoningEngineRuntimeRevisionServiceClient._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 ( + ReasoningEngineRuntimeRevisionServiceClient._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 ( + ReasoningEngineRuntimeRevisionServiceClient._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 ( + ReasoningEngineRuntimeRevisionServiceClient._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 ( + ReasoningEngineRuntimeRevisionServiceClient._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 ( + ReasoningEngineRuntimeRevisionServiceClient._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 ( + ReasoningEngineRuntimeRevisionServiceClient._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 ( + ReasoningEngineRuntimeRevisionServiceClient._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): + ReasoningEngineRuntimeRevisionServiceClient._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 ( + ReasoningEngineRuntimeRevisionServiceClient._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 ( + ReasoningEngineRuntimeRevisionServiceClient._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 ( + ReasoningEngineRuntimeRevisionServiceClient._get_client_cert_source(None, False) + is None + ) + assert ( + ReasoningEngineRuntimeRevisionServiceClient._get_client_cert_source( + mock_provided_cert_source, False + ) + is None + ) + assert ( + ReasoningEngineRuntimeRevisionServiceClient._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 ( + ReasoningEngineRuntimeRevisionServiceClient._get_client_cert_source( + None, True + ) + is mock_default_cert_source + ) + assert ( + ReasoningEngineRuntimeRevisionServiceClient._get_client_cert_source( + mock_provided_cert_source, "true" + ) + is mock_provided_cert_source + ) + + +@mock.patch.object( + ReasoningEngineRuntimeRevisionServiceClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(ReasoningEngineRuntimeRevisionServiceClient), +) +@mock.patch.object( + ReasoningEngineRuntimeRevisionServiceAsyncClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(ReasoningEngineRuntimeRevisionServiceAsyncClient), +) +def test__get_api_endpoint(): + api_override = "foo.com" + mock_client_cert_source = mock.Mock() + default_universe = ReasoningEngineRuntimeRevisionServiceClient._DEFAULT_UNIVERSE + default_endpoint = ( + ReasoningEngineRuntimeRevisionServiceClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=default_universe + ) + ) + mock_universe = "bar.com" + mock_endpoint = ( + ReasoningEngineRuntimeRevisionServiceClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=mock_universe + ) + ) + + assert ( + ReasoningEngineRuntimeRevisionServiceClient._get_api_endpoint( + api_override, mock_client_cert_source, default_universe, "always" + ) + == api_override + ) + assert ( + ReasoningEngineRuntimeRevisionServiceClient._get_api_endpoint( + None, mock_client_cert_source, default_universe, "auto" + ) + == ReasoningEngineRuntimeRevisionServiceClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + ReasoningEngineRuntimeRevisionServiceClient._get_api_endpoint( + None, None, default_universe, "auto" + ) + == default_endpoint + ) + assert ( + ReasoningEngineRuntimeRevisionServiceClient._get_api_endpoint( + None, None, default_universe, "always" + ) + == ReasoningEngineRuntimeRevisionServiceClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + ReasoningEngineRuntimeRevisionServiceClient._get_api_endpoint( + None, mock_client_cert_source, default_universe, "always" + ) + == ReasoningEngineRuntimeRevisionServiceClient.DEFAULT_MTLS_ENDPOINT + ) + assert ( + ReasoningEngineRuntimeRevisionServiceClient._get_api_endpoint( + None, None, mock_universe, "never" + ) + == mock_endpoint + ) + assert ( + ReasoningEngineRuntimeRevisionServiceClient._get_api_endpoint( + None, None, default_universe, "never" + ) + == default_endpoint + ) + + with pytest.raises(MutualTLSChannelError) as excinfo: + ReasoningEngineRuntimeRevisionServiceClient._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 ( + ReasoningEngineRuntimeRevisionServiceClient._get_universe_domain( + client_universe_domain, universe_domain_env + ) + == client_universe_domain + ) + assert ( + ReasoningEngineRuntimeRevisionServiceClient._get_universe_domain( + None, universe_domain_env + ) + == universe_domain_env + ) + assert ( + ReasoningEngineRuntimeRevisionServiceClient._get_universe_domain(None, None) + == ReasoningEngineRuntimeRevisionServiceClient._DEFAULT_UNIVERSE + ) + + with pytest.raises(ValueError) as excinfo: + ReasoningEngineRuntimeRevisionServiceClient._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 = ReasoningEngineRuntimeRevisionServiceClient(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 = ReasoningEngineRuntimeRevisionServiceClient(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", + [ + (ReasoningEngineRuntimeRevisionServiceClient, "grpc"), + (ReasoningEngineRuntimeRevisionServiceAsyncClient, "grpc_asyncio"), + (ReasoningEngineRuntimeRevisionServiceClient, "rest"), + ], +) +def test_reasoning_engine_runtime_revision_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.ReasoningEngineRuntimeRevisionServiceGrpcTransport, "grpc"), + ( + transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, + "grpc_asyncio", + ), + (transports.ReasoningEngineRuntimeRevisionServiceRestTransport, "rest"), + ], +) +def test_reasoning_engine_runtime_revision_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", + [ + (ReasoningEngineRuntimeRevisionServiceClient, "grpc"), + (ReasoningEngineRuntimeRevisionServiceAsyncClient, "grpc_asyncio"), + (ReasoningEngineRuntimeRevisionServiceClient, "rest"), + ], +) +def test_reasoning_engine_runtime_revision_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_reasoning_engine_runtime_revision_service_client_get_transport_class(): + transport = ReasoningEngineRuntimeRevisionServiceClient.get_transport_class() + available_transports = [ + transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport, + transports.ReasoningEngineRuntimeRevisionServiceRestTransport, + ] + assert transport in available_transports + + transport = ReasoningEngineRuntimeRevisionServiceClient.get_transport_class("grpc") + assert transport == transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + ( + ReasoningEngineRuntimeRevisionServiceClient, + transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport, + "grpc", + ), + ( + ReasoningEngineRuntimeRevisionServiceAsyncClient, + transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, + "grpc_asyncio", + ), + ( + ReasoningEngineRuntimeRevisionServiceClient, + transports.ReasoningEngineRuntimeRevisionServiceRestTransport, + "rest", + ), + ], +) +@mock.patch.object( + ReasoningEngineRuntimeRevisionServiceClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(ReasoningEngineRuntimeRevisionServiceClient), +) +@mock.patch.object( + ReasoningEngineRuntimeRevisionServiceAsyncClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(ReasoningEngineRuntimeRevisionServiceAsyncClient), +) +def test_reasoning_engine_runtime_revision_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( + ReasoningEngineRuntimeRevisionServiceClient, "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( + ReasoningEngineRuntimeRevisionServiceClient, "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", + [ + ( + ReasoningEngineRuntimeRevisionServiceClient, + transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport, + "grpc", + "true", + ), + ( + ReasoningEngineRuntimeRevisionServiceAsyncClient, + transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, + "grpc_asyncio", + "true", + ), + ( + ReasoningEngineRuntimeRevisionServiceClient, + transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport, + "grpc", + "false", + ), + ( + ReasoningEngineRuntimeRevisionServiceAsyncClient, + transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, + "grpc_asyncio", + "false", + ), + ( + ReasoningEngineRuntimeRevisionServiceClient, + transports.ReasoningEngineRuntimeRevisionServiceRestTransport, + "rest", + "true", + ), + ( + ReasoningEngineRuntimeRevisionServiceClient, + transports.ReasoningEngineRuntimeRevisionServiceRestTransport, + "rest", + "false", + ), + ], +) +@mock.patch.object( + ReasoningEngineRuntimeRevisionServiceClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(ReasoningEngineRuntimeRevisionServiceClient), +) +@mock.patch.object( + ReasoningEngineRuntimeRevisionServiceAsyncClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(ReasoningEngineRuntimeRevisionServiceAsyncClient), +) +@mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}) +def test_reasoning_engine_runtime_revision_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", + [ + ReasoningEngineRuntimeRevisionServiceClient, + ReasoningEngineRuntimeRevisionServiceAsyncClient, + ], +) +@mock.patch.object( + ReasoningEngineRuntimeRevisionServiceClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(ReasoningEngineRuntimeRevisionServiceClient), +) +@mock.patch.object( + ReasoningEngineRuntimeRevisionServiceAsyncClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(ReasoningEngineRuntimeRevisionServiceAsyncClient), +) +def test_reasoning_engine_runtime_revision_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", + [ + ReasoningEngineRuntimeRevisionServiceClient, + ReasoningEngineRuntimeRevisionServiceAsyncClient, + ], +) +@mock.patch.object( + ReasoningEngineRuntimeRevisionServiceClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(ReasoningEngineRuntimeRevisionServiceClient), +) +@mock.patch.object( + ReasoningEngineRuntimeRevisionServiceAsyncClient, + "_DEFAULT_ENDPOINT_TEMPLATE", + modify_default_endpoint_template(ReasoningEngineRuntimeRevisionServiceAsyncClient), +) +def test_reasoning_engine_runtime_revision_service_client_client_api_endpoint( + client_class, +): + mock_client_cert_source = client_cert_source_callback + api_override = "foo.com" + default_universe = ReasoningEngineRuntimeRevisionServiceClient._DEFAULT_UNIVERSE + default_endpoint = ( + ReasoningEngineRuntimeRevisionServiceClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=default_universe + ) + ) + mock_universe = "bar.com" + mock_endpoint = ( + ReasoningEngineRuntimeRevisionServiceClient._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", + [ + ( + ReasoningEngineRuntimeRevisionServiceClient, + transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport, + "grpc", + ), + ( + ReasoningEngineRuntimeRevisionServiceAsyncClient, + transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, + "grpc_asyncio", + ), + ( + ReasoningEngineRuntimeRevisionServiceClient, + transports.ReasoningEngineRuntimeRevisionServiceRestTransport, + "rest", + ), + ], +) +def test_reasoning_engine_runtime_revision_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", + [ + ( + ReasoningEngineRuntimeRevisionServiceClient, + transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport, + "grpc", + grpc_helpers, + ), + ( + ReasoningEngineRuntimeRevisionServiceAsyncClient, + transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ( + ReasoningEngineRuntimeRevisionServiceClient, + transports.ReasoningEngineRuntimeRevisionServiceRestTransport, + "rest", + None, + ), + ], +) +def test_reasoning_engine_runtime_revision_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_reasoning_engine_runtime_revision_service_client_client_options_from_dict(): + with mock.patch( + "google.cloud.aiplatform_v1beta1.services.reasoning_engine_runtime_revision_service.transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport.__init__" + ) as grpc_transport: + grpc_transport.return_value = None + client = ReasoningEngineRuntimeRevisionServiceClient( + 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", + [ + ( + ReasoningEngineRuntimeRevisionServiceClient, + transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport, + "grpc", + grpc_helpers, + ), + ( + ReasoningEngineRuntimeRevisionServiceAsyncClient, + transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_reasoning_engine_runtime_revision_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", + [ + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, + dict, + ], +) +def test_get_reasoning_engine_runtime_revision(request_type, transport: str = "grpc"): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revision), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision( + name="name_value", + state=reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.State.ACTIVE, + ) + response = client.get_reasoning_engine_runtime_revision(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + request = ( + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest() + ) + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance( + response, reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision + ) + assert response.name == "name_value" + assert ( + response.state + == reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.State.ACTIVE + ) + + +def test_get_reasoning_engine_runtime_revision_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 = ReasoningEngineRuntimeRevisionServiceClient( + 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_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest( + name="name_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_reasoning_engine_runtime_revision), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.get_reasoning_engine_runtime_revision(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[ + 0 + ] == reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest( + name="name_value", + ) + + +def test_get_reasoning_engine_runtime_revision_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 = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revision + 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_reasoning_engine_runtime_revision + ] = mock_rpc + request = {} + client.get_reasoning_engine_runtime_revision(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.get_reasoning_engine_runtime_revision(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_reasoning_engine_runtime_revision_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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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_reasoning_engine_runtime_revision + 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_reasoning_engine_runtime_revision + ] = mock_rpc + + request = {} + await client.get_reasoning_engine_runtime_revision(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + await client.get_reasoning_engine_runtime_revision(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_reasoning_engine_runtime_revision_async( + transport: str = "grpc_asyncio", + request_type=reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, +): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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_reasoning_engine_runtime_revision), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision( + name="name_value", + state=reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.State.ACTIVE, + ) + ) + response = await client.get_reasoning_engine_runtime_revision(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + request = ( + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest() + ) + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance( + response, reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision + ) + assert response.name == "name_value" + assert ( + response.state + == reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.State.ACTIVE + ) + + +@pytest.mark.asyncio +async def test_get_reasoning_engine_runtime_revision_async_from_dict(): + await test_get_reasoning_engine_runtime_revision_async(request_type=dict) + + +def test_get_reasoning_engine_runtime_revision_field_headers(): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest() + ) + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_reasoning_engine_runtime_revision), "__call__" + ) as call: + call.return_value = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision() + ) + client.get_reasoning_engine_runtime_revision(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_reasoning_engine_runtime_revision_field_headers_async(): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest() + ) + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_reasoning_engine_runtime_revision), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision() + ) + await client.get_reasoning_engine_runtime_revision(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_reasoning_engine_runtime_revision_flattened(): + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_reasoning_engine_runtime_revision), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.get_reasoning_engine_runtime_revision( + 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_reasoning_engine_runtime_revision_flattened_error(): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revision( + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest(), + name="name_value", + ) + + +@pytest.mark.asyncio +async def test_get_reasoning_engine_runtime_revision_flattened_async(): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_reasoning_engine_runtime_revision), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision() + ) + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.get_reasoning_engine_runtime_revision( + 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_reasoning_engine_runtime_revision_flattened_error_async(): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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_reasoning_engine_runtime_revision( + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest(), + name="name_value", + ) + + +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, + dict, + ], +) +def test_list_reasoning_engine_runtime_revisions(request_type, transport: str = "grpc"): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revisions), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + next_page_token="next_page_token_value", + ) + response = client.list_reasoning_engine_runtime_revisions(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + request = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest() + ) + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListReasoningEngineRuntimeRevisionsPager) + assert response.next_page_token == "next_page_token_value" + + +def test_list_reasoning_engine_runtime_revisions_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 = ReasoningEngineRuntimeRevisionServiceClient( + 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_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest( + parent="parent_value", + filter="filter_value", + page_token="page_token_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_reasoning_engine_runtime_revisions), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.list_reasoning_engine_runtime_revisions(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[ + 0 + ] == reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest( + parent="parent_value", + filter="filter_value", + page_token="page_token_value", + ) + + +def test_list_reasoning_engine_runtime_revisions_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 = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revisions + 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_reasoning_engine_runtime_revisions + ] = mock_rpc + request = {} + client.list_reasoning_engine_runtime_revisions(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.list_reasoning_engine_runtime_revisions(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_reasoning_engine_runtime_revisions_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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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_reasoning_engine_runtime_revisions + 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_reasoning_engine_runtime_revisions + ] = mock_rpc + + request = {} + await client.list_reasoning_engine_runtime_revisions(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + await client.list_reasoning_engine_runtime_revisions(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_reasoning_engine_runtime_revisions_async( + transport: str = "grpc_asyncio", + request_type=reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, +): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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_reasoning_engine_runtime_revisions), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + next_page_token="next_page_token_value", + ) + ) + response = await client.list_reasoning_engine_runtime_revisions(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + request = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest() + ) + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListReasoningEngineRuntimeRevisionsAsyncPager) + assert response.next_page_token == "next_page_token_value" + + +@pytest.mark.asyncio +async def test_list_reasoning_engine_runtime_revisions_async_from_dict(): + await test_list_reasoning_engine_runtime_revisions_async(request_type=dict) + + +def test_list_reasoning_engine_runtime_revisions_field_headers(): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest() + ) + + request.parent = "parent_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_reasoning_engine_runtime_revisions), "__call__" + ) as call: + call.return_value = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse() + ) + client.list_reasoning_engine_runtime_revisions(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_reasoning_engine_runtime_revisions_field_headers_async(): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest() + ) + + request.parent = "parent_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_reasoning_engine_runtime_revisions), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse() + ) + await client.list_reasoning_engine_runtime_revisions(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_reasoning_engine_runtime_revisions_flattened(): + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_reasoning_engine_runtime_revisions), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.list_reasoning_engine_runtime_revisions( + 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_reasoning_engine_runtime_revisions_flattened_error(): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revisions( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest(), + parent="parent_value", + ) + + +@pytest.mark.asyncio +async def test_list_reasoning_engine_runtime_revisions_flattened_async(): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_reasoning_engine_runtime_revisions), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse() + ) + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.list_reasoning_engine_runtime_revisions( + 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_reasoning_engine_runtime_revisions_flattened_error_async(): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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_reasoning_engine_runtime_revisions( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest(), + parent="parent_value", + ) + + +def test_list_reasoning_engine_runtime_revisions_pager(transport_name: str = "grpc"): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revisions), "__call__" + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + ], + next_page_token="abc", + ), + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[], + next_page_token="def", + ), + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + ], + next_page_token="ghi", + ), + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + ], + ), + RuntimeError, + ) + + expected_metadata = () + retry = retries.Retry() + timeout = 5 + expected_metadata = tuple(expected_metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", ""),)), + ) + pager = client.list_reasoning_engine_runtime_revisions( + 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, reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision + ) + for i in results + ) + + +def test_list_reasoning_engine_runtime_revisions_pages(transport_name: str = "grpc"): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revisions), "__call__" + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + ], + next_page_token="abc", + ), + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[], + next_page_token="def", + ), + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + ], + next_page_token="ghi", + ), + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + ], + ), + RuntimeError, + ) + pages = list(client.list_reasoning_engine_runtime_revisions(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_reasoning_engine_runtime_revisions_async_pager(): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_reasoning_engine_runtime_revisions), + "__call__", + new_callable=mock.AsyncMock, + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + ], + next_page_token="abc", + ), + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[], + next_page_token="def", + ), + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + ], + next_page_token="ghi", + ), + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + ], + ), + RuntimeError, + ) + async_pager = await client.list_reasoning_engine_runtime_revisions( + 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, reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision + ) + for i in responses + ) + + +@pytest.mark.asyncio +async def test_list_reasoning_engine_runtime_revisions_async_pages(): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_reasoning_engine_runtime_revisions), + "__call__", + new_callable=mock.AsyncMock, + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + ], + next_page_token="abc", + ), + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[], + next_page_token="def", + ), + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + ], + next_page_token="ghi", + ), + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + ], + ), + 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_reasoning_engine_runtime_revisions(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", + [ + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, + dict, + ], +) +def test_delete_reasoning_engine_runtime_revision( + request_type, transport: str = "grpc" +): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revision), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.delete_reasoning_engine_runtime_revision(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + request = ( + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest() + ) + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_delete_reasoning_engine_runtime_revision_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 = ReasoningEngineRuntimeRevisionServiceClient( + 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_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest( + name="name_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_reasoning_engine_runtime_revision), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.delete_reasoning_engine_runtime_revision(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[ + 0 + ] == reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest( + name="name_value", + ) + + +def test_delete_reasoning_engine_runtime_revision_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 = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revision + 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_reasoning_engine_runtime_revision + ] = mock_rpc + request = {} + client.delete_reasoning_engine_runtime_revision(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_reasoning_engine_runtime_revision(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_reasoning_engine_runtime_revision_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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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_reasoning_engine_runtime_revision + 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_reasoning_engine_runtime_revision + ] = mock_rpc + + request = {} + await client.delete_reasoning_engine_runtime_revision(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_reasoning_engine_runtime_revision(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_reasoning_engine_runtime_revision_async( + transport: str = "grpc_asyncio", + request_type=reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, +): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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_reasoning_engine_runtime_revision), "__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_reasoning_engine_runtime_revision(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + request = ( + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest() + ) + 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_reasoning_engine_runtime_revision_async_from_dict(): + await test_delete_reasoning_engine_runtime_revision_async(request_type=dict) + + +def test_delete_reasoning_engine_runtime_revision_field_headers(): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest() + ) + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_reasoning_engine_runtime_revision), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.delete_reasoning_engine_runtime_revision(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_reasoning_engine_runtime_revision_field_headers_async(): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest() + ) + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_reasoning_engine_runtime_revision), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.delete_reasoning_engine_runtime_revision(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_reasoning_engine_runtime_revision_flattened(): + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_reasoning_engine_runtime_revision), "__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_reasoning_engine_runtime_revision( + 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_reasoning_engine_runtime_revision_flattened_error(): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revision( + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest(), + name="name_value", + ) + + +@pytest.mark.asyncio +async def test_delete_reasoning_engine_runtime_revision_flattened_async(): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_reasoning_engine_runtime_revision), "__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_reasoning_engine_runtime_revision( + 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_reasoning_engine_runtime_revision_flattened_error_async(): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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_reasoning_engine_runtime_revision( + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest(), + name="name_value", + ) + + +def test_get_reasoning_engine_runtime_revision_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 = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revision + 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_reasoning_engine_runtime_revision + ] = mock_rpc + + request = {} + client.get_reasoning_engine_runtime_revision(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.get_reasoning_engine_runtime_revision(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_reasoning_engine_runtime_revision_rest_required_fields( + request_type=reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, +): + transport_class = transports.ReasoningEngineRuntimeRevisionServiceRestTransport + + 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_reasoning_engine_runtime_revision._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_reasoning_engine_runtime_revision._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 = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision() + # 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 = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.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_reasoning_engine_runtime_revision(request) + + expected_params = [("$alt", "json;enum-encoding=int")] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_get_reasoning_engine_runtime_revision_rest_unset_required_fields(): + transport = transports.ReasoningEngineRuntimeRevisionServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = ( + transport.get_reasoning_engine_runtime_revision._get_unset_required_fields({}) + ) + assert set(unset_fields) == (set(()) & set(("name",))) + + +def test_get_reasoning_engine_runtime_revision_rest_flattened(): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision() + ) + + # get arguments that satisfy an http rule for this method + sample_request = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3/runtimeRevisions/sample4" + } + + # 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 = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.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_reasoning_engine_runtime_revision(**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/*/reasoningEngines/*/runtimeRevisions/*}" + % client.transport._host, + args[1], + ) + + +def test_get_reasoning_engine_runtime_revision_rest_flattened_error( + transport: str = "rest", +): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revision( + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest(), + name="name_value", + ) + + +def test_list_reasoning_engine_runtime_revisions_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 = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revisions + 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_reasoning_engine_runtime_revisions + ] = mock_rpc + + request = {} + client.list_reasoning_engine_runtime_revisions(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.list_reasoning_engine_runtime_revisions(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_reasoning_engine_runtime_revisions_rest_required_fields( + request_type=reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, +): + transport_class = transports.ReasoningEngineRuntimeRevisionServiceRestTransport + + 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_reasoning_engine_runtime_revisions._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_reasoning_engine_runtime_revisions._get_unset_required_fields( + jsonified_request + ) + # Check that path parameters and body parameters are not mixing in. + assert not set(unset_fields) - set( + ( + "filter", + "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 = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + request = request_type(**request_init) + + # Designate an appropriate value for the returned response. + return_value = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse() + ) + # 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 = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse.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_reasoning_engine_runtime_revisions(request) + + expected_params = [("$alt", "json;enum-encoding=int")] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_list_reasoning_engine_runtime_revisions_rest_unset_required_fields(): + transport = transports.ReasoningEngineRuntimeRevisionServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = ( + transport.list_reasoning_engine_runtime_revisions._get_unset_required_fields({}) + ) + assert set(unset_fields) == ( + set( + ( + "filter", + "pageSize", + "pageToken", + ) + ) + & set(("parent",)) + ) + + +def test_list_reasoning_engine_runtime_revisions_rest_flattened(): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse() + ) + + # get arguments that satisfy an http rule for this method + sample_request = { + "parent": "projects/sample1/locations/sample2/reasoningEngines/sample3" + } + + # 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 = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse.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_reasoning_engine_runtime_revisions(**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/*/reasoningEngines/*}/runtimeRevisions" + % client.transport._host, + args[1], + ) + + +def test_list_reasoning_engine_runtime_revisions_rest_flattened_error( + transport: str = "rest", +): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revisions( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest(), + parent="parent_value", + ) + + +def test_list_reasoning_engine_runtime_revisions_rest_pager(transport: str = "rest"): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + ], + next_page_token="abc", + ), + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[], + next_page_token="def", + ), + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + ], + next_page_token="ghi", + ), + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + reasoning_engine_runtime_revisions=[ + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + ], + ), + ) + # Two responses for two calls + response = response + response + + # Wrap the values into proper Response objs + response = tuple( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse.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/reasoningEngines/sample3" + } + + pager = client.list_reasoning_engine_runtime_revisions(request=sample_request) + + results = list(pager) + assert len(results) == 6 + assert all( + isinstance( + i, reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision + ) + for i in results + ) + + pages = list( + client.list_reasoning_engine_runtime_revisions(request=sample_request).pages + ) + for page_, token in zip(pages, ["abc", "def", "ghi", ""]): + assert page_.raw_page.next_page_token == token + + +def test_delete_reasoning_engine_runtime_revision_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 = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revision + 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_reasoning_engine_runtime_revision + ] = mock_rpc + + request = {} + client.delete_reasoning_engine_runtime_revision(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_reasoning_engine_runtime_revision(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_reasoning_engine_runtime_revision_rest_required_fields( + request_type=reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, +): + transport_class = transports.ReasoningEngineRuntimeRevisionServiceRestTransport + + 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_reasoning_engine_runtime_revision._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_reasoning_engine_runtime_revision._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 = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revision(request) + + expected_params = [("$alt", "json;enum-encoding=int")] + actual_params = req.call_args.kwargs["params"] + assert expected_params == actual_params + + +def test_delete_reasoning_engine_runtime_revision_rest_unset_required_fields(): + transport = transports.ReasoningEngineRuntimeRevisionServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials + ) + + unset_fields = ( + transport.delete_reasoning_engine_runtime_revision._get_unset_required_fields( + {} + ) + ) + assert set(unset_fields) == (set(()) & set(("name",))) + + +def test_delete_reasoning_engine_runtime_revision_rest_flattened(): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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/reasoningEngines/sample3/runtimeRevisions/sample4" + } + + # 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_reasoning_engine_runtime_revision(**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/*/reasoningEngines/*/runtimeRevisions/*}" + % client.transport._host, + args[1], + ) + + +def test_delete_reasoning_engine_runtime_revision_rest_flattened_error( + transport: str = "rest", +): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revision( + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest(), + name="name_value", + ) + + +def test_credentials_transport_error(): + # It is an error to provide credentials and a transport instance. + transport = transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # It is an error to provide a credentials file and a transport instance. + transport = transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = ReasoningEngineRuntimeRevisionServiceClient( + client_options={"credentials_file": "credentials.json"}, + transport=transport, + ) + + # It is an error to provide an api_key and a transport instance. + transport = transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + + # It is an error to provide scopes and a transport instance. + transport = transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = ReasoningEngineRuntimeRevisionServiceClient( + client_options={"scopes": ["1", "2"]}, + transport=transport, + ) + + +def test_transport_instance(): + # A client may be instantiated with a custom transport instance. + transport = transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + client = ReasoningEngineRuntimeRevisionServiceClient(transport=transport) + assert client.transport is transport + + +def test_transport_get_channel(): + # A client may be instantiated with a custom transport instance. + transport = transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + channel = transport.grpc_channel + assert channel + + transport = transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + channel = transport.grpc_channel + assert channel + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport, + transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, + transports.ReasoningEngineRuntimeRevisionServiceRestTransport, + ], +) +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 = ReasoningEngineRuntimeRevisionServiceClient.get_transport_class("grpc")( + credentials=ga_credentials.AnonymousCredentials() + ) + assert transport.kind == "grpc" + + +def test_initialize_client_w_grpc(): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_get_reasoning_engine_runtime_revision_empty_call_grpc(): + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.get_reasoning_engine_runtime_revision), "__call__" + ) as call: + call.return_value = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision() + ) + client.get_reasoning_engine_runtime_revision(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest() + ) + + 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_reasoning_engine_runtime_revisions_empty_call_grpc(): + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.list_reasoning_engine_runtime_revisions), "__call__" + ) as call: + call.return_value = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse() + ) + client.list_reasoning_engine_runtime_revisions(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest() + ) + + 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_reasoning_engine_runtime_revision_empty_call_grpc(): + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.delete_reasoning_engine_runtime_revision), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.delete_reasoning_engine_runtime_revision(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest() + ) + + assert args[0] == request_msg + + +def test_transport_kind_grpc_asyncio(): + transport = ReasoningEngineRuntimeRevisionServiceAsyncClient.get_transport_class( + "grpc_asyncio" + )(credentials=async_anonymous_credentials()) + assert transport.kind == "grpc_asyncio" + + +def test_initialize_client_w_grpc_asyncio(): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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_get_reasoning_engine_runtime_revision_empty_call_grpc_asyncio(): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.get_reasoning_engine_runtime_revision), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision( + name="name_value", + state=reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.State.ACTIVE, + ) + ) + await client.get_reasoning_engine_runtime_revision(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest() + ) + + 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_reasoning_engine_runtime_revisions_empty_call_grpc_asyncio(): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.list_reasoning_engine_runtime_revisions), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + next_page_token="next_page_token_value", + ) + ) + await client.list_reasoning_engine_runtime_revisions(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest() + ) + + 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_reasoning_engine_runtime_revision_empty_call_grpc_asyncio(): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.delete_reasoning_engine_runtime_revision), "__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_reasoning_engine_runtime_revision(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest() + ) + + assert args[0] == request_msg + + +def test_transport_kind_rest(): + transport = ReasoningEngineRuntimeRevisionServiceClient.get_transport_class("rest")( + credentials=ga_credentials.AnonymousCredentials() + ) + assert transport.kind == "rest" + + +def test_get_reasoning_engine_runtime_revision_rest_bad_request( + request_type=reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, +): + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3/runtimeRevisions/sample4" + } + 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_reasoning_engine_runtime_revision(request) + + +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, + dict, + ], +) +def test_get_reasoning_engine_runtime_revision_rest_call_success(request_type): + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3/runtimeRevisions/sample4" + } + 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 = reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision( + name="name_value", + state=reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.State.ACTIVE, + ) + + # 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 = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.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_reasoning_engine_runtime_revision(request) + + # Establish that the response is the type that we expect. + assert isinstance( + response, reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision + ) + assert response.name == "name_value" + assert ( + response.state + == reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.State.ACTIVE + ) + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_get_reasoning_engine_runtime_revision_rest_interceptors(null_interceptor): + transport = transports.ReasoningEngineRuntimeRevisionServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=( + None + if null_interceptor + else transports.ReasoningEngineRuntimeRevisionServiceRestInterceptor() + ), + ) + client = ReasoningEngineRuntimeRevisionServiceClient(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.ReasoningEngineRuntimeRevisionServiceRestInterceptor, + "post_get_reasoning_engine_runtime_revision", + ) as post, mock.patch.object( + transports.ReasoningEngineRuntimeRevisionServiceRestInterceptor, + "post_get_reasoning_engine_runtime_revision_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.ReasoningEngineRuntimeRevisionServiceRestInterceptor, + "pre_get_reasoning_engine_runtime_revision", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest.pb( + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest() + ) + 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 = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.to_json( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision() + ) + ) + req.return_value.content = return_value + + request = ( + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest() + ) + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision() + ) + post_with_metadata.return_value = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + metadata, + ) + + client.get_reasoning_engine_runtime_revision( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_list_reasoning_engine_runtime_revisions_rest_bad_request( + request_type=reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, +): + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = { + "parent": "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.list_reasoning_engine_runtime_revisions(request) + + +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, + dict, + ], +) +def test_list_reasoning_engine_runtime_revisions_rest_call_success(request_type): + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = { + "parent": "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 = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + 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 = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse.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_reasoning_engine_runtime_revisions(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListReasoningEngineRuntimeRevisionsPager) + assert response.next_page_token == "next_page_token_value" + + +@pytest.mark.parametrize("null_interceptor", [True, False]) +def test_list_reasoning_engine_runtime_revisions_rest_interceptors(null_interceptor): + transport = transports.ReasoningEngineRuntimeRevisionServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=( + None + if null_interceptor + else transports.ReasoningEngineRuntimeRevisionServiceRestInterceptor() + ), + ) + client = ReasoningEngineRuntimeRevisionServiceClient(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.ReasoningEngineRuntimeRevisionServiceRestInterceptor, + "post_list_reasoning_engine_runtime_revisions", + ) as post, mock.patch.object( + transports.ReasoningEngineRuntimeRevisionServiceRestInterceptor, + "post_list_reasoning_engine_runtime_revisions_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.ReasoningEngineRuntimeRevisionServiceRestInterceptor, + "pre_list_reasoning_engine_runtime_revisions", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest.pb( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest() + ) + 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 = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse.to_json( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse() + ) + req.return_value.content = return_value + + request = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest() + ) + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse() + ) + post_with_metadata.return_value = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse(), + metadata, + ) + + client.list_reasoning_engine_runtime_revisions( + request, + metadata=[ + ("key", "val"), + ("cephalopod", "squid"), + ], + ) + + pre.assert_called_once() + post.assert_called_once() + post_with_metadata.assert_called_once() + + +def test_delete_reasoning_engine_runtime_revision_rest_bad_request( + request_type=reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, +): + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3/runtimeRevisions/sample4" + } + 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_reasoning_engine_runtime_revision(request) + + +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, + dict, + ], +) +def test_delete_reasoning_engine_runtime_revision_rest_call_success(request_type): + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), transport="rest" + ) + + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3/runtimeRevisions/sample4" + } + 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_reasoning_engine_runtime_revision(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_reasoning_engine_runtime_revision_rest_interceptors(null_interceptor): + transport = transports.ReasoningEngineRuntimeRevisionServiceRestTransport( + credentials=ga_credentials.AnonymousCredentials(), + interceptor=( + None + if null_interceptor + else transports.ReasoningEngineRuntimeRevisionServiceRestInterceptor() + ), + ) + client = ReasoningEngineRuntimeRevisionServiceClient(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.ReasoningEngineRuntimeRevisionServiceRestInterceptor, + "post_delete_reasoning_engine_runtime_revision", + ) as post, mock.patch.object( + transports.ReasoningEngineRuntimeRevisionServiceRestInterceptor, + "post_delete_reasoning_engine_runtime_revision_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.ReasoningEngineRuntimeRevisionServiceRestInterceptor, + "pre_delete_reasoning_engine_runtime_revision", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest.pb( + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest() + ) + 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 = ( + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest() + ) + 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_reasoning_engine_runtime_revision( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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_get_reasoning_engine_runtime_revision_empty_call_rest(): + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.get_reasoning_engine_runtime_revision), "__call__" + ) as call: + client.get_reasoning_engine_runtime_revision(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest() + ) + + 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_reasoning_engine_runtime_revisions_empty_call_rest(): + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.list_reasoning_engine_runtime_revisions), "__call__" + ) as call: + client.list_reasoning_engine_runtime_revisions(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest() + ) + + 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_reasoning_engine_runtime_revision_empty_call_rest(): + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="rest", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.delete_reasoning_engine_runtime_revision), "__call__" + ) as call: + client.delete_reasoning_engine_runtime_revision(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest() + ) + + assert args[0] == request_msg + + +def test_reasoning_engine_runtime_revision_service_rest_lro_client(): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient.get_transport_class( + "rest_asyncio" + )(credentials=async_anonymous_credentials()) + assert transport.kind == "rest_asyncio" + + +@pytest.mark.asyncio +async def test_get_reasoning_engine_runtime_revision_rest_asyncio_bad_request( + request_type=reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3/runtimeRevisions/sample4" + } + 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_reasoning_engine_runtime_revision(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest, + dict, + ], +) +async def test_get_reasoning_engine_runtime_revision_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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3/runtimeRevisions/sample4" + } + 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 = reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision( + name="name_value", + state=reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.State.ACTIVE, + ) + + # 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 = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.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_reasoning_engine_runtime_revision(request) + + # Establish that the response is the type that we expect. + assert isinstance( + response, reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision + ) + assert response.name == "name_value" + assert ( + response.state + == reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.State.ACTIVE + ) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("null_interceptor", [True, False]) +async def test_get_reasoning_engine_runtime_revision_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.AsyncReasoningEngineRuntimeRevisionServiceRestTransport( + credentials=async_anonymous_credentials(), + interceptor=( + None + if null_interceptor + else transports.AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor() + ), + ) + client = ReasoningEngineRuntimeRevisionServiceAsyncClient(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.AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor, + "post_get_reasoning_engine_runtime_revision", + ) as post, mock.patch.object( + transports.AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor, + "post_get_reasoning_engine_runtime_revision_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor, + "pre_get_reasoning_engine_runtime_revision", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest.pb( + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest() + ) + 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 = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision.to_json( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision() + ) + ) + req.return_value.read = mock.AsyncMock(return_value=return_value) + + request = ( + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest() + ) + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision() + ) + post_with_metadata.return_value = ( + reasoning_engine_runtime_revision.ReasoningEngineRuntimeRevision(), + metadata, + ) + + await client.get_reasoning_engine_runtime_revision( + 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_reasoning_engine_runtime_revisions_rest_asyncio_bad_request( + request_type=reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + # send a request that will satisfy transcoding + request_init = { + "parent": "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.list_reasoning_engine_runtime_revisions(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest, + dict, + ], +) +async def test_list_reasoning_engine_runtime_revisions_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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + + # send a request that will satisfy transcoding + request_init = { + "parent": "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 = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse( + 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 = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse.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_reasoning_engine_runtime_revisions(request) + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListReasoningEngineRuntimeRevisionsAsyncPager) + assert response.next_page_token == "next_page_token_value" + + +@pytest.mark.asyncio +@pytest.mark.parametrize("null_interceptor", [True, False]) +async def test_list_reasoning_engine_runtime_revisions_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.AsyncReasoningEngineRuntimeRevisionServiceRestTransport( + credentials=async_anonymous_credentials(), + interceptor=( + None + if null_interceptor + else transports.AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor() + ), + ) + client = ReasoningEngineRuntimeRevisionServiceAsyncClient(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.AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor, + "post_list_reasoning_engine_runtime_revisions", + ) as post, mock.patch.object( + transports.AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor, + "post_list_reasoning_engine_runtime_revisions_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor, + "pre_list_reasoning_engine_runtime_revisions", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest.pb( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest() + ) + 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 = reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse.to_json( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse() + ) + req.return_value.read = mock.AsyncMock(return_value=return_value) + + request = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest() + ) + metadata = [ + ("key", "val"), + ("cephalopod", "squid"), + ] + pre.return_value = request, metadata + post.return_value = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse() + ) + post_with_metadata.return_value = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsResponse(), + metadata, + ) + + await client.list_reasoning_engine_runtime_revisions( + 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_reasoning_engine_runtime_revision_rest_asyncio_bad_request( + request_type=reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, +): + if not HAS_ASYNC_REST_EXTRA: + pytest.skip( + "the library must be installed with the `async_rest` extra to test this feature." + ) + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3/runtimeRevisions/sample4" + } + 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_reasoning_engine_runtime_revision(request) + + +@pytest.mark.asyncio +@pytest.mark.parametrize( + "request_type", + [ + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest, + dict, + ], +) +async def test_delete_reasoning_engine_runtime_revision_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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), transport="rest_asyncio" + ) + + # send a request that will satisfy transcoding + request_init = { + "name": "projects/sample1/locations/sample2/reasoningEngines/sample3/runtimeRevisions/sample4" + } + 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_reasoning_engine_runtime_revision(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_reasoning_engine_runtime_revision_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.AsyncReasoningEngineRuntimeRevisionServiceRestTransport( + credentials=async_anonymous_credentials(), + interceptor=( + None + if null_interceptor + else transports.AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor() + ), + ) + client = ReasoningEngineRuntimeRevisionServiceAsyncClient(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.AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor, + "post_delete_reasoning_engine_runtime_revision", + ) as post, mock.patch.object( + transports.AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor, + "post_delete_reasoning_engine_runtime_revision_with_metadata", + ) as post_with_metadata, mock.patch.object( + transports.AsyncReasoningEngineRuntimeRevisionServiceRestInterceptor, + "pre_delete_reasoning_engine_runtime_revision", + ) as pre: + pre.assert_not_called() + post.assert_not_called() + post_with_metadata.assert_not_called() + pb_message = reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest.pb( + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest() + ) + 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_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest() + ) + 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_reasoning_engine_runtime_revision( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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_get_reasoning_engine_runtime_revision_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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.get_reasoning_engine_runtime_revision), "__call__" + ) as call: + await client.get_reasoning_engine_runtime_revision(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_runtime_revision_service.GetReasoningEngineRuntimeRevisionRequest() + ) + + 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_reasoning_engine_runtime_revisions_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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.list_reasoning_engine_runtime_revisions), "__call__" + ) as call: + await client.list_reasoning_engine_runtime_revisions(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_runtime_revision_service.ListReasoningEngineRuntimeRevisionsRequest() + ) + + 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_reasoning_engine_runtime_revision_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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + credentials=async_anonymous_credentials(), + transport="rest_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.delete_reasoning_engine_runtime_revision), "__call__" + ) as call: + await client.delete_reasoning_engine_runtime_revision(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = ( + reasoning_engine_runtime_revision_service.DeleteReasoningEngineRuntimeRevisionRequest() + ) + + assert args[0] == request_msg + + +def test_reasoning_engine_runtime_revision_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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport, + ) + + +def test_reasoning_engine_runtime_revision_service_base_transport_error(): + # Passing both a credentials object and credentials_file should raise an error + with pytest.raises(core_exceptions.DuplicateCredentialArgs): + transport = transports.ReasoningEngineRuntimeRevisionServiceTransport( + credentials=ga_credentials.AnonymousCredentials(), + credentials_file="credentials.json", + ) + + +def test_reasoning_engine_runtime_revision_service_base_transport(): + # Instantiate the base transport. + with mock.patch( + "google.cloud.aiplatform_v1beta1.services.reasoning_engine_runtime_revision_service.transports.ReasoningEngineRuntimeRevisionServiceTransport.__init__" + ) as Transport: + Transport.return_value = None + transport = transports.ReasoningEngineRuntimeRevisionServiceTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Every method on the transport should just blindly + # raise NotImplementedError. + methods = ( + "get_reasoning_engine_runtime_revision", + "list_reasoning_engine_runtime_revisions", + "delete_reasoning_engine_runtime_revision", + "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_reasoning_engine_runtime_revision_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.reasoning_engine_runtime_revision_service.transports.ReasoningEngineRuntimeRevisionServiceTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.ReasoningEngineRuntimeRevisionServiceTransport( + 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_reasoning_engine_runtime_revision_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.reasoning_engine_runtime_revision_service.transports.ReasoningEngineRuntimeRevisionServiceTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.ReasoningEngineRuntimeRevisionServiceTransport() + adc.assert_called_once() + + +def test_reasoning_engine_runtime_revision_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) + ReasoningEngineRuntimeRevisionServiceClient() + 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.ReasoningEngineRuntimeRevisionServiceGrpcTransport, + transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, + ], +) +def test_reasoning_engine_runtime_revision_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.ReasoningEngineRuntimeRevisionServiceGrpcTransport, + transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, + transports.ReasoningEngineRuntimeRevisionServiceRestTransport, + ], +) +def test_reasoning_engine_runtime_revision_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.ReasoningEngineRuntimeRevisionServiceGrpcTransport, grpc_helpers), + ( + transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, + grpc_helpers_async, + ), + ], +) +def test_reasoning_engine_runtime_revision_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.ReasoningEngineRuntimeRevisionServiceGrpcTransport, + transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, + ], +) +def test_reasoning_engine_runtime_revision_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_reasoning_engine_runtime_revision_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.ReasoningEngineRuntimeRevisionServiceRestTransport( + 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_reasoning_engine_runtime_revision_service_host_no_port(transport_name): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revision_service_host_with_port(transport_name): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_reasoning_engine_runtime_revision_service_client_transport_session_collision( + transport_name, +): + creds1 = ga_credentials.AnonymousCredentials() + creds2 = ga_credentials.AnonymousCredentials() + client1 = ReasoningEngineRuntimeRevisionServiceClient( + credentials=creds1, + transport=transport_name, + ) + client2 = ReasoningEngineRuntimeRevisionServiceClient( + credentials=creds2, + transport=transport_name, + ) + session1 = client1.transport.get_reasoning_engine_runtime_revision._session + session2 = client2.transport.get_reasoning_engine_runtime_revision._session + assert session1 != session2 + session1 = client1.transport.list_reasoning_engine_runtime_revisions._session + session2 = client2.transport.list_reasoning_engine_runtime_revisions._session + assert session1 != session2 + session1 = client1.transport.delete_reasoning_engine_runtime_revision._session + session2 = client2.transport.delete_reasoning_engine_runtime_revision._session + assert session1 != session2 + + +def test_reasoning_engine_runtime_revision_service_grpc_transport_channel(): + channel = grpc.secure_channel("http://localhost/", grpc.local_channel_credentials()) + + # Check that channel is used if provided. + transport = transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport( + 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_reasoning_engine_runtime_revision_service_grpc_asyncio_transport_channel(): + channel = aio.secure_channel("http://localhost/", grpc.local_channel_credentials()) + + # Check that channel is used if provided. + transport = transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport( + 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.ReasoningEngineRuntimeRevisionServiceGrpcTransport, + transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, + ], +) +def test_reasoning_engine_runtime_revision_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.ReasoningEngineRuntimeRevisionServiceGrpcTransport, + transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, + ], +) +def test_reasoning_engine_runtime_revision_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_reasoning_engine_runtime_revision_service_grpc_lro_client(): + client = ReasoningEngineRuntimeRevisionServiceClient( + 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_runtime_revision_service_grpc_lro_async_client(): + client = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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_git_repository_link_path(): + project = "squid" + location = "clam" + connection = "whelk" + git_repository_link = "octopus" + expected = "projects/{project}/locations/{location}/connections/{connection}/gitRepositoryLinks/{git_repository_link}".format( + project=project, + location=location, + connection=connection, + git_repository_link=git_repository_link, + ) + actual = ReasoningEngineRuntimeRevisionServiceClient.git_repository_link_path( + project, location, connection, git_repository_link + ) + assert expected == actual + + +def test_parse_git_repository_link_path(): + expected = { + "project": "oyster", + "location": "nudibranch", + "connection": "cuttlefish", + "git_repository_link": "mussel", + } + path = ReasoningEngineRuntimeRevisionServiceClient.git_repository_link_path( + **expected + ) + + # Check that the path construction is reversible. + actual = ReasoningEngineRuntimeRevisionServiceClient.parse_git_repository_link_path( + path + ) + assert expected == actual + + +def test_network_attachment_path(): + project = "winkle" + region = "nautilus" + networkattachment = "scallop" + expected = "projects/{project}/regions/{region}/networkAttachments/{networkattachment}".format( + project=project, + region=region, + networkattachment=networkattachment, + ) + actual = ReasoningEngineRuntimeRevisionServiceClient.network_attachment_path( + project, region, networkattachment + ) + assert expected == actual + + +def test_parse_network_attachment_path(): + expected = { + "project": "abalone", + "region": "squid", + "networkattachment": "clam", + } + path = ReasoningEngineRuntimeRevisionServiceClient.network_attachment_path( + **expected + ) + + # Check that the path construction is reversible. + actual = ReasoningEngineRuntimeRevisionServiceClient.parse_network_attachment_path( + path + ) + assert expected == actual + + +def test_reasoning_engine_path(): + project = "whelk" + location = "octopus" + reasoning_engine = "oyster" + expected = "projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}".format( + project=project, + location=location, + reasoning_engine=reasoning_engine, + ) + actual = ReasoningEngineRuntimeRevisionServiceClient.reasoning_engine_path( + project, location, reasoning_engine + ) + assert expected == actual + + +def test_parse_reasoning_engine_path(): + expected = { + "project": "nudibranch", + "location": "cuttlefish", + "reasoning_engine": "mussel", + } + path = ReasoningEngineRuntimeRevisionServiceClient.reasoning_engine_path(**expected) + + # Check that the path construction is reversible. + actual = ReasoningEngineRuntimeRevisionServiceClient.parse_reasoning_engine_path( + path + ) + assert expected == actual + + +def test_reasoning_engine_runtime_revision_path(): + project = "winkle" + location = "nautilus" + reasoning_engine = "scallop" + runtime_revision = "abalone" + expected = "projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/runtimeRevisions/{runtime_revision}".format( + project=project, + location=location, + reasoning_engine=reasoning_engine, + runtime_revision=runtime_revision, + ) + actual = ReasoningEngineRuntimeRevisionServiceClient.reasoning_engine_runtime_revision_path( + project, location, reasoning_engine, runtime_revision + ) + assert expected == actual + + +def test_parse_reasoning_engine_runtime_revision_path(): + expected = { + "project": "squid", + "location": "clam", + "reasoning_engine": "whelk", + "runtime_revision": "octopus", + } + path = ReasoningEngineRuntimeRevisionServiceClient.reasoning_engine_runtime_revision_path( + **expected + ) + + # Check that the path construction is reversible. + actual = ReasoningEngineRuntimeRevisionServiceClient.parse_reasoning_engine_runtime_revision_path( + path + ) + assert expected == actual + + +def test_common_billing_account_path(): + billing_account = "oyster" + expected = "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + actual = ReasoningEngineRuntimeRevisionServiceClient.common_billing_account_path( + billing_account + ) + assert expected == actual + + +def test_parse_common_billing_account_path(): + expected = { + "billing_account": "nudibranch", + } + path = ReasoningEngineRuntimeRevisionServiceClient.common_billing_account_path( + **expected + ) + + # Check that the path construction is reversible. + actual = ( + ReasoningEngineRuntimeRevisionServiceClient.parse_common_billing_account_path( + path + ) + ) + assert expected == actual + + +def test_common_folder_path(): + folder = "cuttlefish" + expected = "folders/{folder}".format( + folder=folder, + ) + actual = ReasoningEngineRuntimeRevisionServiceClient.common_folder_path(folder) + assert expected == actual + + +def test_parse_common_folder_path(): + expected = { + "folder": "mussel", + } + path = ReasoningEngineRuntimeRevisionServiceClient.common_folder_path(**expected) + + # Check that the path construction is reversible. + actual = ReasoningEngineRuntimeRevisionServiceClient.parse_common_folder_path(path) + assert expected == actual + + +def test_common_organization_path(): + organization = "winkle" + expected = "organizations/{organization}".format( + organization=organization, + ) + actual = ReasoningEngineRuntimeRevisionServiceClient.common_organization_path( + organization + ) + assert expected == actual + + +def test_parse_common_organization_path(): + expected = { + "organization": "nautilus", + } + path = ReasoningEngineRuntimeRevisionServiceClient.common_organization_path( + **expected + ) + + # Check that the path construction is reversible. + actual = ReasoningEngineRuntimeRevisionServiceClient.parse_common_organization_path( + path + ) + assert expected == actual + + +def test_common_project_path(): + project = "scallop" + expected = "projects/{project}".format( + project=project, + ) + actual = ReasoningEngineRuntimeRevisionServiceClient.common_project_path(project) + assert expected == actual + + +def test_parse_common_project_path(): + expected = { + "project": "abalone", + } + path = ReasoningEngineRuntimeRevisionServiceClient.common_project_path(**expected) + + # Check that the path construction is reversible. + actual = ReasoningEngineRuntimeRevisionServiceClient.parse_common_project_path(path) + assert expected == actual + + +def test_common_location_path(): + project = "squid" + location = "clam" + expected = "projects/{project}/locations/{location}".format( + project=project, + location=location, + ) + actual = ReasoningEngineRuntimeRevisionServiceClient.common_location_path( + project, location + ) + assert expected == actual + + +def test_parse_common_location_path(): + expected = { + "project": "whelk", + "location": "octopus", + } + path = ReasoningEngineRuntimeRevisionServiceClient.common_location_path(**expected) + + # Check that the path construction is reversible. + actual = ReasoningEngineRuntimeRevisionServiceClient.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.ReasoningEngineRuntimeRevisionServiceTransport, + "_prep_wrapped_messages", + ) as prep: + client = ReasoningEngineRuntimeRevisionServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, + ) + prep.assert_called_once_with(client_info) + + with mock.patch.object( + transports.ReasoningEngineRuntimeRevisionServiceTransport, + "_prep_wrapped_messages", + ) as prep: + transport_class = ( + ReasoningEngineRuntimeRevisionServiceClient.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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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 = ReasoningEngineRuntimeRevisionServiceAsyncClient( + 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 = ReasoningEngineRuntimeRevisionServiceClient( + 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", + [ + ( + ReasoningEngineRuntimeRevisionServiceClient, + transports.ReasoningEngineRuntimeRevisionServiceGrpcTransport, + ), + ( + ReasoningEngineRuntimeRevisionServiceAsyncClient, + transports.ReasoningEngineRuntimeRevisionServiceGrpcAsyncIOTransport, + ), + ], +) +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_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_reasoning_engine_service.py index 1c866fde76..19144a0008 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_reasoning_engine_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_reasoning_engine_service.py @@ -4887,6 +4887,17 @@ def test_create_reasoning_engine_rest_call_success(request_type): }, "encryption_spec": {"kms_key_name": "kms_key_name_value"}, "labels": {}, + "traffic_config": { + "traffic_split_manual": { + "targets": [ + { + "runtime_revision_name": "runtime_revision_name_value", + "percent": 753, + } + ] + }, + "traffic_split_always_latest": {}, + }, } # 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 @@ -5450,6 +5461,17 @@ def test_update_reasoning_engine_rest_call_success(request_type): }, "encryption_spec": {"kms_key_name": "kms_key_name_value"}, "labels": {}, + "traffic_config": { + "traffic_split_manual": { + "targets": [ + { + "runtime_revision_name": "runtime_revision_name_value", + "percent": 753, + } + ] + }, + "traffic_split_always_latest": {}, + }, } # 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 @@ -6635,6 +6657,17 @@ async def test_create_reasoning_engine_rest_asyncio_call_success(request_type): }, "encryption_spec": {"kms_key_name": "kms_key_name_value"}, "labels": {}, + "traffic_config": { + "traffic_split_manual": { + "targets": [ + { + "runtime_revision_name": "runtime_revision_name_value", + "percent": 753, + } + ] + }, + "traffic_split_always_latest": {}, + }, } # 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 @@ -7252,6 +7285,17 @@ async def test_update_reasoning_engine_rest_asyncio_call_success(request_type): }, "encryption_spec": {"kms_key_name": "kms_key_name_value"}, "labels": {}, + "traffic_config": { + "traffic_split_manual": { + "targets": [ + { + "runtime_revision_name": "runtime_revision_name_value", + "percent": 753, + } + ] + }, + "traffic_split_always_latest": {}, + }, } # 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 @@ -9090,8 +9134,43 @@ def test_parse_reasoning_engine_path(): assert expected == actual +def test_reasoning_engine_runtime_revision_path(): + project = "whelk" + location = "octopus" + reasoning_engine = "oyster" + runtime_revision = "nudibranch" + expected = "projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/runtimeRevisions/{runtime_revision}".format( + project=project, + location=location, + reasoning_engine=reasoning_engine, + runtime_revision=runtime_revision, + ) + actual = ReasoningEngineServiceClient.reasoning_engine_runtime_revision_path( + project, location, reasoning_engine, runtime_revision + ) + assert expected == actual + + +def test_parse_reasoning_engine_runtime_revision_path(): + expected = { + "project": "cuttlefish", + "location": "mussel", + "reasoning_engine": "winkle", + "runtime_revision": "nautilus", + } + path = ReasoningEngineServiceClient.reasoning_engine_runtime_revision_path( + **expected + ) + + # Check that the path construction is reversible. + actual = ReasoningEngineServiceClient.parse_reasoning_engine_runtime_revision_path( + path + ) + assert expected == actual + + def test_common_billing_account_path(): - billing_account = "whelk" + billing_account = "scallop" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -9101,7 +9180,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "octopus", + "billing_account": "abalone", } path = ReasoningEngineServiceClient.common_billing_account_path(**expected) @@ -9111,7 +9190,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "oyster" + folder = "squid" expected = "folders/{folder}".format( folder=folder, ) @@ -9121,7 +9200,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "nudibranch", + "folder": "clam", } path = ReasoningEngineServiceClient.common_folder_path(**expected) @@ -9131,7 +9210,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "cuttlefish" + organization = "whelk" expected = "organizations/{organization}".format( organization=organization, ) @@ -9141,7 +9220,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "mussel", + "organization": "octopus", } path = ReasoningEngineServiceClient.common_organization_path(**expected) @@ -9151,7 +9230,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "winkle" + project = "oyster" expected = "projects/{project}".format( project=project, ) @@ -9161,7 +9240,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "nautilus", + "project": "nudibranch", } path = ReasoningEngineServiceClient.common_project_path(**expected) @@ -9171,8 +9250,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "scallop" - location = "abalone" + project = "cuttlefish" + location = "mussel" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -9183,8 +9262,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "squid", - "location": "clam", + "project": "winkle", + "location": "nautilus", } path = ReasoningEngineServiceClient.common_location_path(**expected)