diff --git a/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/image_object_detection.py b/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/image_object_detection.py index f157bc3c69..30a57c1c07 100644 --- a/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/image_object_detection.py +++ b/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/image_object_detection.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.protobuf import struct_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/video_action_recognition.py b/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/video_action_recognition.py index b868dd605d..6bd702b541 100644 --- a/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/video_action_recognition.py +++ b/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/video_action_recognition.py @@ -19,8 +19,8 @@ import proto # type: ignore -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import wrappers_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.wrappers_pb2 as wrappers_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/video_classification.py b/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/video_classification.py index 0bdfcf7759..263b8858d7 100644 --- a/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/video_classification.py +++ b/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/video_classification.py @@ -19,8 +19,8 @@ import proto # type: ignore -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import wrappers_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.wrappers_pb2 as wrappers_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/video_object_tracking.py b/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/video_object_tracking.py index 480d78450f..ff14cbd3a8 100644 --- a/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/video_object_tracking.py +++ b/google/cloud/aiplatform/v1/schema/predict/prediction_v1/types/video_object_tracking.py @@ -19,8 +19,8 @@ import proto # type: ignore -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import wrappers_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.wrappers_pb2 as wrappers_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/image_object_detection.py b/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/image_object_detection.py index b79ff794a5..78de47da0f 100644 --- a/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/image_object_detection.py +++ b/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/image_object_detection.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.protobuf import struct_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/video_action_recognition.py b/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/video_action_recognition.py index c43e63609b..e1245a4f71 100644 --- a/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/video_action_recognition.py +++ b/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/video_action_recognition.py @@ -19,8 +19,8 @@ import proto # type: ignore -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import wrappers_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.wrappers_pb2 as wrappers_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/video_classification.py b/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/video_classification.py index 69ee6dad2e..451e2d993c 100644 --- a/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/video_classification.py +++ b/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/video_classification.py @@ -19,8 +19,8 @@ import proto # type: ignore -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import wrappers_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.wrappers_pb2 as wrappers_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/video_object_tracking.py b/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/video_object_tracking.py index 9d0a6ef308..c31fff397e 100644 --- a/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/video_object_tracking.py +++ b/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/types/video_object_tracking.py @@ -19,8 +19,8 @@ import proto # type: ignore -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import wrappers_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.wrappers_pb2 as wrappers_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/__init__.py b/google/cloud/aiplatform_v1/__init__.py index 9c54ee4c48..79d0422665 100644 --- a/google/cloud/aiplatform_v1/__init__.py +++ b/google/cloud/aiplatform_v1/__init__.py @@ -563,6 +563,8 @@ from .types.io import SharePointSources from .types.io import SlackSource from .types.io import TFRecordDestination +from .types.io import VertexMultimodalDatasetDestination +from .types.io import VertexMultimodalDatasetSource from .types.job_service import CancelBatchPredictionJobRequest from .types.job_service import CancelCustomJobRequest from .types.job_service import CancelDataLabelingJobRequest @@ -2198,6 +2200,8 @@ def _get_version(dependency_name): "Value", "VertexAISearch", "VertexAiSearchConfig", + "VertexMultimodalDatasetDestination", + "VertexMultimodalDatasetSource", "VertexRagDataServiceClient", "VertexRagServiceClient", "VertexRagStore", diff --git a/google/cloud/aiplatform_v1/services/data_foundry_service/async_client.py b/google/cloud/aiplatform_v1/services/data_foundry_service/async_client.py index f300d40ada..dd0b97ffd2 100644 --- a/google/cloud/aiplatform_v1/services/data_foundry_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/data_foundry_service/async_client.py @@ -116,7 +116,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: DataFoundryServiceAsyncClient: The constructed client. """ - return DataFoundryServiceClient.from_service_account_info.__func__(DataFoundryServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = DataFoundryServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(DataFoundryServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -132,7 +133,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: DataFoundryServiceAsyncClient: The constructed client. """ - return DataFoundryServiceClient.from_service_account_file.__func__(DataFoundryServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = DataFoundryServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(DataFoundryServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/data_foundry_service/transports/base.py b/google/cloud/aiplatform_v1/services/data_foundry_service/transports/base.py index f932ec50d3..0f6ab84fbe 100644 --- a/google/cloud/aiplatform_v1/services/data_foundry_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/data_foundry_service/transports/base.py @@ -87,8 +87,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -103,11 +101,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/dataset_service/async_client.py b/google/cloud/aiplatform_v1/services/dataset_service/async_client.py index f321aca6be..9545f9ad93 100644 --- a/google/cloud/aiplatform_v1/services/dataset_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/dataset_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.dataset_service import pagers from google.cloud.aiplatform_v1.types import annotation from google.cloud.aiplatform_v1.types import annotation_spec @@ -63,10 +61,12 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import DatasetServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import DatasetServiceGrpcAsyncIOTransport from .client import DatasetServiceClient @@ -149,7 +149,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: DatasetServiceAsyncClient: The constructed client. """ - return DatasetServiceClient.from_service_account_info.__func__(DatasetServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = DatasetServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(DatasetServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -165,7 +166,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: DatasetServiceAsyncClient: The constructed client. """ - return DatasetServiceClient.from_service_account_file.__func__(DatasetServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = DatasetServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(DatasetServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file @@ -507,7 +509,6 @@ async def sample_get_dataset(): request (Optional[Union[google.cloud.aiplatform_v1.types.GetDatasetRequest, dict]]): The request object. Request message for [DatasetService.GetDataset][google.cloud.aiplatform.v1.DatasetService.GetDataset]. - Next ID: 4 name (:class:`str`): Required. The name of the Dataset resource. @@ -1704,7 +1705,6 @@ async def sample_get_dataset_version(): request (Optional[Union[google.cloud.aiplatform_v1.types.GetDatasetVersionRequest, dict]]): The request object. Request message for [DatasetService.GetDatasetVersion][google.cloud.aiplatform.v1.DatasetService.GetDatasetVersion]. - Next ID: 4 name (:class:`str`): Required. The resource name of the Dataset version to delete. Format: @@ -2643,10 +2643,7 @@ async def list_annotations( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListAnnotationsAsyncPager: - r"""Lists Annotations belongs to a dataitem - This RPC is only available in InternalDatasetService. It - is only used for exporting conversation data to CCAI - Insights. + r"""Lists Annotations belongs to a dataitem. .. code-block:: python diff --git a/google/cloud/aiplatform_v1/services/dataset_service/client.py b/google/cloud/aiplatform_v1/services/dataset_service/client.py index 9e0e03ff4f..ec2ffcab17 100644 --- a/google/cloud/aiplatform_v1/services/dataset_service/client.py +++ b/google/cloud/aiplatform_v1/services/dataset_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.dataset_service import pagers from google.cloud.aiplatform_v1.types import annotation from google.cloud.aiplatform_v1.types import annotation_spec @@ -79,10 +77,12 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import DatasetServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import DatasetServiceGrpcTransport from .transports.grpc_asyncio import DatasetServiceGrpcAsyncIOTransport @@ -1091,7 +1091,6 @@ def sample_get_dataset(): request (Union[google.cloud.aiplatform_v1.types.GetDatasetRequest, dict]): The request object. Request message for [DatasetService.GetDataset][google.cloud.aiplatform.v1.DatasetService.GetDataset]. - Next ID: 4 name (str): Required. The name of the Dataset resource. @@ -2261,7 +2260,6 @@ def sample_get_dataset_version(): request (Union[google.cloud.aiplatform_v1.types.GetDatasetVersionRequest, dict]): The request object. Request message for [DatasetService.GetDatasetVersion][google.cloud.aiplatform.v1.DatasetService.GetDatasetVersion]. - Next ID: 4 name (str): Required. The resource name of the Dataset version to delete. Format: @@ -3177,10 +3175,7 @@ def list_annotations( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> pagers.ListAnnotationsPager: - r"""Lists Annotations belongs to a dataitem - This RPC is only available in InternalDatasetService. It - is only used for exporting conversation data to CCAI - Insights. + r"""Lists Annotations belongs to a dataitem. .. code-block:: python diff --git a/google/cloud/aiplatform_v1/services/dataset_service/transports/base.py b/google/cloud/aiplatform_v1/services/dataset_service/transports/base.py index f68e3f97cb..6d63373ac0 100644 --- a/google/cloud/aiplatform_v1/services/dataset_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/dataset_service/transports/base.py @@ -93,8 +93,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -109,11 +107,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/dataset_service/transports/grpc.py b/google/cloud/aiplatform_v1/services/dataset_service/transports/grpc.py index 8410f7f790..baa6b4d9ba 100644 --- a/google/cloud/aiplatform_v1/services/dataset_service/transports/grpc.py +++ b/google/cloud/aiplatform_v1/services/dataset_service/transports/grpc.py @@ -853,10 +853,7 @@ def list_annotations( ]: r"""Return a callable for the list annotations method over gRPC. - Lists Annotations belongs to a dataitem - This RPC is only available in InternalDatasetService. It - is only used for exporting conversation data to CCAI - Insights. + Lists Annotations belongs to a dataitem. Returns: Callable[[~.ListAnnotationsRequest], diff --git a/google/cloud/aiplatform_v1/services/dataset_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1/services/dataset_service/transports/grpc_asyncio.py index 1cdabd6e2f..4ecd09f9ff 100644 --- a/google/cloud/aiplatform_v1/services/dataset_service/transports/grpc_asyncio.py +++ b/google/cloud/aiplatform_v1/services/dataset_service/transports/grpc_asyncio.py @@ -880,10 +880,7 @@ def list_annotations( ]: r"""Return a callable for the list annotations method over gRPC. - Lists Annotations belongs to a dataitem - This RPC is only available in InternalDatasetService. It - is only used for exporting conversation data to CCAI - Insights. + Lists Annotations belongs to a dataitem. Returns: Callable[[~.ListAnnotationsRequest], diff --git a/google/cloud/aiplatform_v1/services/dataset_service/transports/rest.py b/google/cloud/aiplatform_v1/services/dataset_service/transports/rest.py index e084918200..025938452b 100644 --- a/google/cloud/aiplatform_v1/services/dataset_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/dataset_service/transports/rest.py @@ -3550,7 +3550,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3706,7 +3706,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3854,7 +3854,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4004,7 +4004,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4153,7 +4153,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4309,7 +4309,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4569,7 +4569,6 @@ def __call__( request (~.dataset_service.GetDatasetRequest): The request object. Request message for [DatasetService.GetDataset][google.cloud.aiplatform.v1.DatasetService.GetDataset]. - Next ID: 4 retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -4720,7 +4719,6 @@ def __call__( request (~.dataset_service.GetDatasetVersionRequest): The request object. Request message for [DatasetService.GetDatasetVersion][google.cloud.aiplatform.v1.DatasetService.GetDatasetVersion]. - Next ID: 4 retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -4916,7 +4914,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5824,7 +5822,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/dataset_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/dataset_service/transports/rest_asyncio.py index ddc755b15b..58dff0acd6 100644 --- a/google/cloud/aiplatform_v1/services/dataset_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/dataset_service/transports/rest_asyncio.py @@ -1752,7 +1752,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1918,7 +1918,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2076,7 +2076,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2236,7 +2236,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2394,7 +2394,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2562,7 +2562,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2839,7 +2839,6 @@ async def __call__( request (~.dataset_service.GetDatasetRequest): The request object. Request message for [DatasetService.GetDataset][google.cloud.aiplatform.v1.DatasetService.GetDataset]. - Next ID: 4 retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2999,7 +2998,6 @@ async def __call__( request (~.dataset_service.GetDatasetVersionRequest): The request object. Request message for [DatasetService.GetDatasetVersion][google.cloud.aiplatform.v1.DatasetService.GetDatasetVersion]. - Next ID: 4 retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3205,7 +3203,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4165,7 +4163,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/async_client.py b/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/async_client.py index c8d84733bd..bfe52c990d 100644 --- a/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.deployment_resource_pool_service import pagers from google.cloud.aiplatform_v1.types import deployment_resource_pool from google.cloud.aiplatform_v1.types import ( @@ -61,9 +59,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import DeploymentResourcePoolServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import DeploymentResourcePoolServiceGrpcAsyncIOTransport from .client import DeploymentResourcePoolServiceClient @@ -156,7 +156,10 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: DeploymentResourcePoolServiceAsyncClient: The constructed client. """ - return DeploymentResourcePoolServiceClient.from_service_account_info.__func__(DeploymentResourcePoolServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = DeploymentResourcePoolServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func( + DeploymentResourcePoolServiceAsyncClient, info, *args, **kwargs + ) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -172,7 +175,10 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: DeploymentResourcePoolServiceAsyncClient: The constructed client. """ - return DeploymentResourcePoolServiceClient.from_service_account_file.__func__(DeploymentResourcePoolServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = DeploymentResourcePoolServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func( + DeploymentResourcePoolServiceAsyncClient, filename, *args, **kwargs + ) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/client.py b/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/client.py index 40ef2a4fb4..9c59404b0b 100644 --- a/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/client.py +++ b/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.deployment_resource_pool_service import pagers from google.cloud.aiplatform_v1.types import deployment_resource_pool from google.cloud.aiplatform_v1.types import ( @@ -77,9 +75,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import DeploymentResourcePoolServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import DeploymentResourcePoolServiceGrpcTransport from .transports.grpc_asyncio import DeploymentResourcePoolServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/transports/base.py b/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/transports/base.py index 5421fd8c1f..678831a458 100644 --- a/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/transports/base.py @@ -89,8 +89,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -105,11 +103,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/transports/rest.py b/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/transports/rest.py index 85e22e88ca..bb37e681c3 100644 --- a/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/transports/rest.py @@ -2824,7 +2824,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2980,7 +2980,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3621,7 +3621,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/transports/rest_asyncio.py index 31a3fa2932..222bbcd158 100644 --- a/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/deployment_resource_pool_service/transports/rest_asyncio.py @@ -959,7 +959,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1125,7 +1125,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1800,7 +1800,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/endpoint_service/async_client.py b/google/cloud/aiplatform_v1/services/endpoint_service/async_client.py index 2d85152337..3471468394 100644 --- a/google/cloud/aiplatform_v1/services/endpoint_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/endpoint_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.endpoint_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import endpoint @@ -58,9 +56,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import EndpointServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import EndpointServiceGrpcAsyncIOTransport from .client import EndpointServiceClient @@ -145,7 +145,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: EndpointServiceAsyncClient: The constructed client. """ - return EndpointServiceClient.from_service_account_info.__func__(EndpointServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = EndpointServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(EndpointServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -161,7 +162,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: EndpointServiceAsyncClient: The constructed client. """ - return EndpointServiceClient.from_service_account_file.__func__(EndpointServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = EndpointServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(EndpointServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/endpoint_service/client.py b/google/cloud/aiplatform_v1/services/endpoint_service/client.py index d312180cbb..766cf26442 100644 --- a/google/cloud/aiplatform_v1/services/endpoint_service/client.py +++ b/google/cloud/aiplatform_v1/services/endpoint_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.endpoint_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import endpoint @@ -74,9 +72,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import EndpointServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import EndpointServiceGrpcTransport from .transports.grpc_asyncio import EndpointServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/endpoint_service/transports/base.py b/google/cloud/aiplatform_v1/services/endpoint_service/transports/base.py index e014eef1fa..901393d915 100644 --- a/google/cloud/aiplatform_v1/services/endpoint_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/endpoint_service/transports/base.py @@ -90,8 +90,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -106,11 +104,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/endpoint_service/transports/rest.py b/google/cloud/aiplatform_v1/services/endpoint_service/transports/rest.py index 6f423f8ea1..40b9d29439 100644 --- a/google/cloud/aiplatform_v1/services/endpoint_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/endpoint_service/transports/rest.py @@ -2969,7 +2969,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3117,7 +3117,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3269,7 +3269,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3724,7 +3724,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3877,7 +3877,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4189,7 +4189,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/endpoint_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/endpoint_service/transports/rest_asyncio.py index 7de4beb77f..e8c8cb436f 100644 --- a/google/cloud/aiplatform_v1/services/endpoint_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/endpoint_service/transports/rest_asyncio.py @@ -1120,7 +1120,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1281,7 +1281,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1445,7 +1445,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1931,7 +1931,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2095,7 +2095,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2430,7 +2430,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/evaluation_service/async_client.py b/google/cloud/aiplatform_v1/services/evaluation_service/async_client.py index c7449e2df5..09ba2fc37a 100644 --- a/google/cloud/aiplatform_v1/services/evaluation_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/evaluation_service/async_client.py @@ -114,7 +114,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: EvaluationServiceAsyncClient: The constructed client. """ - return EvaluationServiceClient.from_service_account_info.__func__(EvaluationServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = EvaluationServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(EvaluationServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -130,7 +131,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: EvaluationServiceAsyncClient: The constructed client. """ - return EvaluationServiceClient.from_service_account_file.__func__(EvaluationServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = EvaluationServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(EvaluationServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/evaluation_service/transports/base.py b/google/cloud/aiplatform_v1/services/evaluation_service/transports/base.py index aabc3400c6..ea412bc6f7 100644 --- a/google/cloud/aiplatform_v1/services/evaluation_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/evaluation_service/transports/base.py @@ -87,8 +87,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -103,11 +101,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/async_client.py b/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/async_client.py index 7d4818f6b4..2b21f9097a 100644 --- a/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.feature_online_store_admin_service import ( pagers, ) @@ -64,11 +62,13 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore -from google.type import interval_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore +import google.type.interval_pb2 as interval_pb2 # type: ignore from .transports.base import ( FeatureOnlineStoreAdminServiceTransport, DEFAULT_CLIENT_INFO, @@ -164,7 +164,10 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: FeatureOnlineStoreAdminServiceAsyncClient: The constructed client. """ - return FeatureOnlineStoreAdminServiceClient.from_service_account_info.__func__(FeatureOnlineStoreAdminServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = FeatureOnlineStoreAdminServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func( + FeatureOnlineStoreAdminServiceAsyncClient, info, *args, **kwargs + ) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -180,7 +183,10 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: FeatureOnlineStoreAdminServiceAsyncClient: The constructed client. """ - return FeatureOnlineStoreAdminServiceClient.from_service_account_file.__func__(FeatureOnlineStoreAdminServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = FeatureOnlineStoreAdminServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func( + FeatureOnlineStoreAdminServiceAsyncClient, filename, *args, **kwargs + ) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/client.py b/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/client.py index fbb24c0d6a..df47e201ba 100644 --- a/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/client.py +++ b/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.feature_online_store_admin_service import ( pagers, ) @@ -80,11 +78,13 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore -from google.type import interval_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore +import google.type.interval_pb2 as interval_pb2 # type: ignore from .transports.base import ( FeatureOnlineStoreAdminServiceTransport, DEFAULT_CLIENT_INFO, diff --git a/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/transports/base.py b/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/transports/base.py index 3209eaf102..74e8bb4e92 100644 --- a/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/transports/base.py @@ -91,8 +91,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -107,11 +105,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/transports/rest.py b/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/transports/rest.py index f213a082f7..4692f2e07b 100644 --- a/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/transports/rest.py @@ -3233,7 +3233,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3389,7 +3389,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3543,7 +3543,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3693,7 +3693,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4951,7 +4951,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5107,7 +5107,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/transports/rest_asyncio.py index d8d8852e98..e6298f2c03 100644 --- a/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/feature_online_store_admin_service/transports/rest_asyncio.py @@ -1403,7 +1403,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1571,7 +1571,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1733,7 +1733,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1895,7 +1895,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3215,7 +3215,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3383,7 +3383,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/feature_online_store_service/async_client.py b/google/cloud/aiplatform_v1/services/feature_online_store_service/async_client.py index 122de33a09..6b7e1ec2ec 100644 --- a/google/cloud/aiplatform_v1/services/feature_online_store_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/feature_online_store_service/async_client.py @@ -53,9 +53,9 @@ 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 google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore from .transports.base import FeatureOnlineStoreServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import FeatureOnlineStoreServiceGrpcAsyncIOTransport from .client import FeatureOnlineStoreServiceClient @@ -132,7 +132,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: FeatureOnlineStoreServiceAsyncClient: The constructed client. """ - return FeatureOnlineStoreServiceClient.from_service_account_info.__func__(FeatureOnlineStoreServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = FeatureOnlineStoreServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(FeatureOnlineStoreServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -148,7 +149,10 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: FeatureOnlineStoreServiceAsyncClient: The constructed client. """ - return FeatureOnlineStoreServiceClient.from_service_account_file.__func__(FeatureOnlineStoreServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = FeatureOnlineStoreServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func( + FeatureOnlineStoreServiceAsyncClient, filename, *args, **kwargs + ) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/feature_online_store_service/client.py b/google/cloud/aiplatform_v1/services/feature_online_store_service/client.py index dc1658b327..5aa62489c2 100644 --- a/google/cloud/aiplatform_v1/services/feature_online_store_service/client.py +++ b/google/cloud/aiplatform_v1/services/feature_online_store_service/client.py @@ -68,9 +68,9 @@ 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 google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore from .transports.base import FeatureOnlineStoreServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import FeatureOnlineStoreServiceGrpcTransport from .transports.grpc_asyncio import FeatureOnlineStoreServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/base.py b/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/base.py index dfc348b556..71052c78ed 100644 --- a/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/base.py @@ -87,8 +87,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -103,11 +101,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/feature_registry_service/async_client.py b/google/cloud/aiplatform_v1/services/feature_registry_service/async_client.py index c2fd1c0f47..cfc6cfb5b8 100644 --- a/google/cloud/aiplatform_v1/services/feature_registry_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/feature_registry_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.feature_registry_service import pagers from google.cloud.aiplatform_v1.types import feature from google.cloud.aiplatform_v1.types import feature as gca_feature @@ -59,9 +57,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import FeatureRegistryServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import FeatureRegistryServiceGrpcAsyncIOTransport from .client import FeatureRegistryServiceClient @@ -136,7 +136,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: FeatureRegistryServiceAsyncClient: The constructed client. """ - return FeatureRegistryServiceClient.from_service_account_info.__func__(FeatureRegistryServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = FeatureRegistryServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(FeatureRegistryServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -152,7 +153,10 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: FeatureRegistryServiceAsyncClient: The constructed client. """ - return FeatureRegistryServiceClient.from_service_account_file.__func__(FeatureRegistryServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = FeatureRegistryServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func( + FeatureRegistryServiceAsyncClient, filename, *args, **kwargs + ) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/feature_registry_service/client.py b/google/cloud/aiplatform_v1/services/feature_registry_service/client.py index 732b9a2c5a..113ca24a8f 100644 --- a/google/cloud/aiplatform_v1/services/feature_registry_service/client.py +++ b/google/cloud/aiplatform_v1/services/feature_registry_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.feature_registry_service import pagers from google.cloud.aiplatform_v1.types import feature from google.cloud.aiplatform_v1.types import feature as gca_feature @@ -75,9 +73,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import FeatureRegistryServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import FeatureRegistryServiceGrpcTransport from .transports.grpc_asyncio import FeatureRegistryServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/feature_registry_service/transports/base.py b/google/cloud/aiplatform_v1/services/feature_registry_service/transports/base.py index e011126828..5a3217c8c8 100644 --- a/google/cloud/aiplatform_v1/services/feature_registry_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/feature_registry_service/transports/base.py @@ -91,8 +91,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -107,11 +105,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/feature_registry_service/transports/rest.py b/google/cloud/aiplatform_v1/services/feature_registry_service/transports/rest.py index 685e3875ce..a089f19985 100644 --- a/google/cloud/aiplatform_v1/services/feature_registry_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/feature_registry_service/transports/rest.py @@ -3100,7 +3100,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3258,7 +3258,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3414,7 +3414,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3567,7 +3567,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3717,7 +3717,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4489,7 +4489,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4645,7 +4645,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/feature_registry_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/feature_registry_service/transports/rest_asyncio.py index 3f0bdc8e3d..de28fda74c 100644 --- a/google/cloud/aiplatform_v1/services/feature_registry_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/feature_registry_service/transports/rest_asyncio.py @@ -1260,7 +1260,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1426,7 +1426,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1590,7 +1590,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1751,7 +1751,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1909,7 +1909,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2713,7 +2713,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2877,7 +2877,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/async_client.py b/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/async_client.py index 06211d9ea6..ce752c90d5 100644 --- a/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/async_client.py @@ -135,7 +135,10 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: FeaturestoreOnlineServingServiceAsyncClient: The constructed client. """ - return FeaturestoreOnlineServingServiceClient.from_service_account_info.__func__(FeaturestoreOnlineServingServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = FeaturestoreOnlineServingServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func( + FeaturestoreOnlineServingServiceAsyncClient, info, *args, **kwargs + ) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -151,7 +154,10 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: FeaturestoreOnlineServingServiceAsyncClient: The constructed client. """ - return FeaturestoreOnlineServingServiceClient.from_service_account_file.__func__(FeaturestoreOnlineServingServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = FeaturestoreOnlineServingServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func( + FeaturestoreOnlineServingServiceAsyncClient, filename, *args, **kwargs + ) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/transports/base.py b/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/transports/base.py index cd8d16436f..3a28268832 100644 --- a/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/transports/base.py @@ -87,8 +87,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -103,11 +101,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/featurestore_service/async_client.py b/google/cloud/aiplatform_v1/services/featurestore_service/async_client.py index a35ba31d84..755962189e 100644 --- a/google/cloud/aiplatform_v1/services/featurestore_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/featurestore_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.featurestore_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import entity_type @@ -62,9 +60,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import FeaturestoreServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import FeaturestoreServiceGrpcAsyncIOTransport from .client import FeaturestoreServiceClient @@ -141,7 +141,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: FeaturestoreServiceAsyncClient: The constructed client. """ - return FeaturestoreServiceClient.from_service_account_info.__func__(FeaturestoreServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = FeaturestoreServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(FeaturestoreServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -157,7 +158,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: FeaturestoreServiceAsyncClient: The constructed client. """ - return FeaturestoreServiceClient.from_service_account_file.__func__(FeaturestoreServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = FeaturestoreServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(FeaturestoreServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/featurestore_service/client.py b/google/cloud/aiplatform_v1/services/featurestore_service/client.py index 4d1f9103bb..dcf1e51c1b 100644 --- a/google/cloud/aiplatform_v1/services/featurestore_service/client.py +++ b/google/cloud/aiplatform_v1/services/featurestore_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.featurestore_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import entity_type @@ -78,9 +76,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import FeaturestoreServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import FeaturestoreServiceGrpcTransport from .transports.grpc_asyncio import FeaturestoreServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/featurestore_service/transports/base.py b/google/cloud/aiplatform_v1/services/featurestore_service/transports/base.py index 5b96eaaea8..c6c97f20ae 100644 --- a/google/cloud/aiplatform_v1/services/featurestore_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/featurestore_service/transports/base.py @@ -93,8 +93,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -109,11 +107,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/featurestore_service/transports/rest.py b/google/cloud/aiplatform_v1/services/featurestore_service/transports/rest.py index 8e95a8724d..6455fa0677 100644 --- a/google/cloud/aiplatform_v1/services/featurestore_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/featurestore_service/transports/rest.py @@ -3676,7 +3676,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3834,7 +3834,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3992,7 +3992,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4148,7 +4148,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4304,7 +4304,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4457,7 +4457,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4607,7 +4607,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4757,7 +4757,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4914,7 +4914,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5072,7 +5072,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5689,7 +5689,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -6780,7 +6780,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/featurestore_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/featurestore_service/transports/rest_asyncio.py index 9602b1526f..d9f2980443 100644 --- a/google/cloud/aiplatform_v1/services/featurestore_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/featurestore_service/transports/rest_asyncio.py @@ -1886,7 +1886,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2050,7 +2050,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2216,7 +2216,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2382,7 +2382,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2546,7 +2546,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2705,7 +2705,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2865,7 +2865,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3023,7 +3023,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3186,7 +3186,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3350,7 +3350,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3997,7 +3997,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5136,7 +5136,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/gen_ai_cache_service/async_client.py b/google/cloud/aiplatform_v1/services/gen_ai_cache_service/async_client.py index 8dd9d772a7..153628013e 100644 --- a/google/cloud/aiplatform_v1/services/gen_ai_cache_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/gen_ai_cache_service/async_client.py @@ -56,9 +56,9 @@ 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 google.protobuf import duration_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import GenAiCacheServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import GenAiCacheServiceGrpcAsyncIOTransport from .client import GenAiCacheServiceClient @@ -129,7 +129,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: GenAiCacheServiceAsyncClient: The constructed client. """ - return GenAiCacheServiceClient.from_service_account_info.__func__(GenAiCacheServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = GenAiCacheServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(GenAiCacheServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -145,7 +146,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: GenAiCacheServiceAsyncClient: The constructed client. """ - return GenAiCacheServiceClient.from_service_account_file.__func__(GenAiCacheServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = GenAiCacheServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(GenAiCacheServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/gen_ai_cache_service/client.py b/google/cloud/aiplatform_v1/services/gen_ai_cache_service/client.py index 66f50c8052..8deb96e615 100644 --- a/google/cloud/aiplatform_v1/services/gen_ai_cache_service/client.py +++ b/google/cloud/aiplatform_v1/services/gen_ai_cache_service/client.py @@ -72,9 +72,9 @@ 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 google.protobuf import duration_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import GenAiCacheServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import GenAiCacheServiceGrpcTransport from .transports.grpc_asyncio import GenAiCacheServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/base.py b/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/base.py index bd50ff336f..5068713a23 100644 --- a/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/base.py @@ -34,7 +34,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( gapic_version=package_version.__version__ @@ -90,8 +90,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -106,11 +104,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/grpc.py b/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/grpc.py index a88322b11d..6b25fa58d3 100644 --- a/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/grpc.py +++ b/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/grpc.py @@ -37,7 +37,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from .base import GenAiCacheServiceTransport, DEFAULT_CLIENT_INFO try: diff --git a/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/grpc_asyncio.py index f0ccb0c644..bc940698ae 100644 --- a/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/grpc_asyncio.py +++ b/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/grpc_asyncio.py @@ -40,7 +40,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from .base import GenAiCacheServiceTransport, DEFAULT_CLIENT_INFO from .grpc import GenAiCacheServiceGrpcTransport diff --git a/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/rest.py b/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/rest.py index 9f6bccd99c..99a1195f05 100644 --- a/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/rest.py @@ -39,7 +39,7 @@ from google.cloud.aiplatform_v1.types import cached_content from google.cloud.aiplatform_v1.types import cached_content as gca_cached_content from google.cloud.aiplatform_v1.types import gen_ai_cache_service -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -915,7 +915,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/rest_asyncio.py index 774842c79f..1dbc81be84 100644 --- a/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/rest_asyncio.py @@ -51,7 +51,7 @@ from google.cloud.aiplatform_v1.types import cached_content from google.cloud.aiplatform_v1.types import cached_content as gca_cached_content from google.cloud.aiplatform_v1.types import gen_ai_cache_service -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -998,7 +998,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/rest_base.py b/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/rest_base.py index 723bd93d46..e877392ae9 100644 --- a/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1/services/gen_ai_cache_service/transports/rest_base.py @@ -30,7 +30,7 @@ from google.cloud.aiplatform_v1.types import cached_content from google.cloud.aiplatform_v1.types import cached_content as gca_cached_content from google.cloud.aiplatform_v1.types import gen_ai_cache_service -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore diff --git a/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/async_client.py b/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/async_client.py index 9b5f7149bf..192b6d8aea 100644 --- a/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.gen_ai_tuning_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import genai_tuning_service @@ -57,8 +55,10 @@ 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 google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_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.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore from .transports.base import GenAiTuningServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import GenAiTuningServiceGrpcAsyncIOTransport from .client import GenAiTuningServiceClient @@ -135,7 +135,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: GenAiTuningServiceAsyncClient: The constructed client. """ - return GenAiTuningServiceClient.from_service_account_info.__func__(GenAiTuningServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = GenAiTuningServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(GenAiTuningServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -151,7 +152,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: GenAiTuningServiceAsyncClient: The constructed client. """ - return GenAiTuningServiceClient.from_service_account_file.__func__(GenAiTuningServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = GenAiTuningServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(GenAiTuningServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/client.py b/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/client.py index 7e7a8d9dd5..a7dba1e309 100644 --- a/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/client.py +++ b/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.gen_ai_tuning_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import genai_tuning_service @@ -73,8 +71,10 @@ 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 google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_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.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore from .transports.base import GenAiTuningServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import GenAiTuningServiceGrpcTransport from .transports.grpc_asyncio import GenAiTuningServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/base.py b/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/base.py index 029e02166c..901c5b262f 100644 --- a/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/base.py @@ -35,7 +35,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( gapic_version=package_version.__version__ @@ -91,8 +91,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -107,11 +105,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/grpc.py b/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/grpc.py index b9e44709cb..d27e9ee313 100644 --- a/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/grpc.py +++ b/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/grpc.py @@ -38,7 +38,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from .base import GenAiTuningServiceTransport, DEFAULT_CLIENT_INFO try: diff --git a/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/grpc_asyncio.py index 1fb040f1f6..7b27f6ab7a 100644 --- a/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/grpc_asyncio.py +++ b/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/grpc_asyncio.py @@ -41,7 +41,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from .base import GenAiTuningServiceTransport, DEFAULT_CLIENT_INFO from .grpc import GenAiTuningServiceGrpcTransport diff --git a/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/rest.py b/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/rest.py index 97eddac109..d588d1e49f 100644 --- a/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/rest.py @@ -40,7 +40,7 @@ from google.cloud.aiplatform_v1.types import genai_tuning_service from google.cloud.aiplatform_v1.types import tuning_job from google.cloud.aiplatform_v1.types import tuning_job as gca_tuning_job -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -2710,7 +2710,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3293,7 +3293,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/rest_asyncio.py index 0a02725785..19a6fd98a2 100644 --- a/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/rest_asyncio.py @@ -53,7 +53,7 @@ from google.cloud.aiplatform_v1.types import genai_tuning_service from google.cloud.aiplatform_v1.types import tuning_job from google.cloud.aiplatform_v1.types import tuning_job as gca_tuning_job -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -838,7 +838,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1449,7 +1449,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/rest_base.py b/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/rest_base.py index 167712cb6f..0c7f2a4258 100644 --- a/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1/services/gen_ai_tuning_service/transports/rest_base.py @@ -30,7 +30,7 @@ from google.cloud.aiplatform_v1.types import genai_tuning_service from google.cloud.aiplatform_v1.types import tuning_job from google.cloud.aiplatform_v1.types import tuning_job as gca_tuning_job -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore diff --git a/google/cloud/aiplatform_v1/services/index_endpoint_service/async_client.py b/google/cloud/aiplatform_v1/services/index_endpoint_service/async_client.py index ac47a2e3ae..483ba318f5 100644 --- a/google/cloud/aiplatform_v1/services/index_endpoint_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/index_endpoint_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.index_endpoint_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import index_endpoint @@ -58,9 +56,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import IndexEndpointServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import IndexEndpointServiceGrpcAsyncIOTransport from .client import IndexEndpointServiceClient @@ -135,7 +135,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: IndexEndpointServiceAsyncClient: The constructed client. """ - return IndexEndpointServiceClient.from_service_account_info.__func__(IndexEndpointServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = IndexEndpointServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(IndexEndpointServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -151,7 +152,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: IndexEndpointServiceAsyncClient: The constructed client. """ - return IndexEndpointServiceClient.from_service_account_file.__func__(IndexEndpointServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = IndexEndpointServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(IndexEndpointServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/index_endpoint_service/client.py b/google/cloud/aiplatform_v1/services/index_endpoint_service/client.py index eee8a381c8..b67a668a9f 100644 --- a/google/cloud/aiplatform_v1/services/index_endpoint_service/client.py +++ b/google/cloud/aiplatform_v1/services/index_endpoint_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.index_endpoint_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import index_endpoint @@ -74,9 +72,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import IndexEndpointServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import IndexEndpointServiceGrpcTransport from .transports.grpc_asyncio import IndexEndpointServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/index_endpoint_service/transports/base.py b/google/cloud/aiplatform_v1/services/index_endpoint_service/transports/base.py index df060fc90e..02a248601e 100644 --- a/google/cloud/aiplatform_v1/services/index_endpoint_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/index_endpoint_service/transports/base.py @@ -90,8 +90,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -106,11 +104,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/index_endpoint_service/transports/rest.py b/google/cloud/aiplatform_v1/services/index_endpoint_service/transports/rest.py index afbda0a6df..8ed9f96c93 100644 --- a/google/cloud/aiplatform_v1/services/index_endpoint_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/index_endpoint_service/transports/rest.py @@ -2927,7 +2927,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3080,7 +3080,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3235,7 +3235,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3702,7 +3702,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3858,7 +3858,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/index_endpoint_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/index_endpoint_service/transports/rest_asyncio.py index de9cb8d2ad..b7325b5677 100644 --- a/google/cloud/aiplatform_v1/services/index_endpoint_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/index_endpoint_service/transports/rest_asyncio.py @@ -1070,7 +1070,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1229,7 +1229,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1392,7 +1392,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1877,7 +1877,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2041,7 +2041,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/index_service/async_client.py b/google/cloud/aiplatform_v1/services/index_service/async_client.py index 16ac0bd21f..2407f62cfd 100644 --- a/google/cloud/aiplatform_v1/services/index_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/index_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.index_service import pagers from google.cloud.aiplatform_v1.types import deployed_index_ref from google.cloud.aiplatform_v1.types import encryption_spec @@ -58,10 +56,12 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import IndexServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import IndexServiceGrpcAsyncIOTransport from .client import IndexServiceClient @@ -130,7 +130,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: IndexServiceAsyncClient: The constructed client. """ - return IndexServiceClient.from_service_account_info.__func__(IndexServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = IndexServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(IndexServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -146,7 +147,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: IndexServiceAsyncClient: The constructed client. """ - return IndexServiceClient.from_service_account_file.__func__(IndexServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = IndexServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(IndexServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/index_service/client.py b/google/cloud/aiplatform_v1/services/index_service/client.py index 615e55f164..09b22de5d9 100644 --- a/google/cloud/aiplatform_v1/services/index_service/client.py +++ b/google/cloud/aiplatform_v1/services/index_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.index_service import pagers from google.cloud.aiplatform_v1.types import deployed_index_ref from google.cloud.aiplatform_v1.types import encryption_spec @@ -74,10 +72,12 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import IndexServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import IndexServiceGrpcTransport from .transports.grpc_asyncio import IndexServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/index_service/transports/base.py b/google/cloud/aiplatform_v1/services/index_service/transports/base.py index 314ea5b852..5dd9cd7775 100644 --- a/google/cloud/aiplatform_v1/services/index_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/index_service/transports/base.py @@ -89,8 +89,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -105,11 +103,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/index_service/transports/rest.py b/google/cloud/aiplatform_v1/services/index_service/transports/rest.py index 70bc71c92f..12ff24e855 100644 --- a/google/cloud/aiplatform_v1/services/index_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/index_service/transports/rest.py @@ -2861,7 +2861,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3013,7 +3013,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3635,7 +3635,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/index_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/index_service/transports/rest_asyncio.py index 79eff3f107..f931153b22 100644 --- a/google/cloud/aiplatform_v1/services/index_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/index_service/transports/rest_asyncio.py @@ -1001,7 +1001,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1163,7 +1163,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1819,7 +1819,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/job_service/async_client.py b/google/cloud/aiplatform_v1/services/job_service/async_client.py index 7925344a65..b25f1b107d 100644 --- a/google/cloud/aiplatform_v1/services/job_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/job_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.job_service import pagers from google.cloud.aiplatform_v1.types import batch_prediction_job from google.cloud.aiplatform_v1.types import ( @@ -82,13 +80,15 @@ 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 google.protobuf import duration_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore -from google.type import money_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore +import google.type.money_pb2 as money_pb2 # type: ignore from .transports.base import JobServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import JobServiceGrpcAsyncIOTransport from .client import JobServiceClient @@ -203,7 +203,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: JobServiceAsyncClient: The constructed client. """ - return JobServiceClient.from_service_account_info.__func__(JobServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = JobServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(JobServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -219,7 +220,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: JobServiceAsyncClient: The constructed client. """ - return JobServiceClient.from_service_account_file.__func__(JobServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = JobServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(JobServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/job_service/client.py b/google/cloud/aiplatform_v1/services/job_service/client.py index 4f571d0735..da26b8089b 100644 --- a/google/cloud/aiplatform_v1/services/job_service/client.py +++ b/google/cloud/aiplatform_v1/services/job_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.job_service import pagers from google.cloud.aiplatform_v1.types import batch_prediction_job from google.cloud.aiplatform_v1.types import ( @@ -98,13 +96,15 @@ 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 google.protobuf import duration_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore -from google.type import money_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore +import google.type.money_pb2 as money_pb2 # type: ignore from .transports.base import JobServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import JobServiceGrpcTransport from .transports.grpc_asyncio import JobServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/job_service/transports/base.py b/google/cloud/aiplatform_v1/services/job_service/transports/base.py index d83b39ee67..bafd938625 100644 --- a/google/cloud/aiplatform_v1/services/job_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/job_service/transports/base.py @@ -51,7 +51,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( gapic_version=package_version.__version__ @@ -110,8 +110,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -126,11 +124,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/job_service/transports/grpc.py b/google/cloud/aiplatform_v1/services/job_service/transports/grpc.py index c94adeb1e0..2149526426 100644 --- a/google/cloud/aiplatform_v1/services/job_service/transports/grpc.py +++ b/google/cloud/aiplatform_v1/services/job_service/transports/grpc.py @@ -54,7 +54,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from .base import JobServiceTransport, DEFAULT_CLIENT_INFO try: diff --git a/google/cloud/aiplatform_v1/services/job_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1/services/job_service/transports/grpc_asyncio.py index 745ff1261a..8d19d6ac71 100644 --- a/google/cloud/aiplatform_v1/services/job_service/transports/grpc_asyncio.py +++ b/google/cloud/aiplatform_v1/services/job_service/transports/grpc_asyncio.py @@ -57,7 +57,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from .base import JobServiceTransport, DEFAULT_CLIENT_INFO from .grpc import JobServiceGrpcTransport diff --git a/google/cloud/aiplatform_v1/services/job_service/transports/rest.py b/google/cloud/aiplatform_v1/services/job_service/transports/rest.py index d871ff127f..9d28848377 100644 --- a/google/cloud/aiplatform_v1/services/job_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/job_service/transports/rest.py @@ -56,7 +56,7 @@ ) from google.cloud.aiplatform_v1.types import nas_job from google.cloud.aiplatform_v1.types import nas_job as gca_nas_job -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -4226,7 +4226,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4342,7 +4342,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4458,7 +4458,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4576,7 +4576,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4698,7 +4698,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5801,7 +5801,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5950,7 +5950,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -6099,7 +6099,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -6250,7 +6250,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -6407,7 +6407,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -6560,7 +6560,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -8890,7 +8890,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -9010,7 +9010,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -9309,7 +9309,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/job_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/job_service/transports/rest_asyncio.py index 78efe15f0b..30b3c179fd 100644 --- a/google/cloud/aiplatform_v1/services/job_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/job_service/transports/rest_asyncio.py @@ -69,7 +69,7 @@ ) from google.cloud.aiplatform_v1.types import nas_job from google.cloud.aiplatform_v1.types import nas_job as gca_nas_job -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -2507,7 +2507,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2629,7 +2629,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2753,7 +2753,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2881,7 +2881,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3009,7 +3009,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4170,7 +4170,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4329,7 +4329,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4488,7 +4488,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4653,7 +4653,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4818,7 +4818,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4983,7 +4983,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -7437,7 +7437,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -7565,7 +7565,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -7878,7 +7878,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/job_service/transports/rest_base.py b/google/cloud/aiplatform_v1/services/job_service/transports/rest_base.py index fe67301f48..fa8bc8b7d6 100644 --- a/google/cloud/aiplatform_v1/services/job_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1/services/job_service/transports/rest_base.py @@ -46,7 +46,7 @@ ) from google.cloud.aiplatform_v1.types import nas_job from google.cloud.aiplatform_v1.types import nas_job as gca_nas_job -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore diff --git a/google/cloud/aiplatform_v1/services/llm_utility_service/async_client.py b/google/cloud/aiplatform_v1/services/llm_utility_service/async_client.py index 73fe6e03eb..3fbb708fcb 100644 --- a/google/cloud/aiplatform_v1/services/llm_utility_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/llm_utility_service/async_client.py @@ -52,7 +52,7 @@ 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 google.protobuf import struct_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore from .transports.base import LlmUtilityServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import LlmUtilityServiceGrpcAsyncIOTransport from .client import LlmUtilityServiceClient @@ -121,7 +121,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: LlmUtilityServiceAsyncClient: The constructed client. """ - return LlmUtilityServiceClient.from_service_account_info.__func__(LlmUtilityServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = LlmUtilityServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(LlmUtilityServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -137,7 +138,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: LlmUtilityServiceAsyncClient: The constructed client. """ - return LlmUtilityServiceClient.from_service_account_file.__func__(LlmUtilityServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = LlmUtilityServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(LlmUtilityServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/llm_utility_service/client.py b/google/cloud/aiplatform_v1/services/llm_utility_service/client.py index cfad479023..19c9bd9c4e 100644 --- a/google/cloud/aiplatform_v1/services/llm_utility_service/client.py +++ b/google/cloud/aiplatform_v1/services/llm_utility_service/client.py @@ -68,7 +68,7 @@ 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 google.protobuf import struct_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore from .transports.base import LlmUtilityServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import LlmUtilityServiceGrpcTransport from .transports.grpc_asyncio import LlmUtilityServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/llm_utility_service/transports/base.py b/google/cloud/aiplatform_v1/services/llm_utility_service/transports/base.py index 8877c0d32e..c89f5d4401 100644 --- a/google/cloud/aiplatform_v1/services/llm_utility_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/llm_utility_service/transports/base.py @@ -88,8 +88,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -104,11 +102,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/match_service/async_client.py b/google/cloud/aiplatform_v1/services/match_service/async_client.py index 090175ebc5..749739b5a3 100644 --- a/google/cloud/aiplatform_v1/services/match_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/match_service/async_client.py @@ -117,7 +117,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: MatchServiceAsyncClient: The constructed client. """ - return MatchServiceClient.from_service_account_info.__func__(MatchServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = MatchServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(MatchServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -133,7 +134,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: MatchServiceAsyncClient: The constructed client. """ - return MatchServiceClient.from_service_account_file.__func__(MatchServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = MatchServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(MatchServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/match_service/transports/base.py b/google/cloud/aiplatform_v1/services/match_service/transports/base.py index 8b8fa430a8..189946f8be 100644 --- a/google/cloud/aiplatform_v1/services/match_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/match_service/transports/base.py @@ -87,8 +87,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -103,11 +101,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/metadata_service/async_client.py b/google/cloud/aiplatform_v1/services/metadata_service/async_client.py index df01b930c4..65065c7d36 100644 --- a/google/cloud/aiplatform_v1/services/metadata_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/metadata_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.metadata_service import pagers from google.cloud.aiplatform_v1.types import artifact from google.cloud.aiplatform_v1.types import artifact as gca_artifact @@ -67,10 +65,12 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import MetadataServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import MetadataServiceGrpcAsyncIOTransport from .client import MetadataServiceClient @@ -149,7 +149,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: MetadataServiceAsyncClient: The constructed client. """ - return MetadataServiceClient.from_service_account_info.__func__(MetadataServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = MetadataServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(MetadataServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -165,7 +166,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: MetadataServiceAsyncClient: The constructed client. """ - return MetadataServiceClient.from_service_account_file.__func__(MetadataServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = MetadataServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(MetadataServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/metadata_service/client.py b/google/cloud/aiplatform_v1/services/metadata_service/client.py index 349082c75b..182efc1aa2 100644 --- a/google/cloud/aiplatform_v1/services/metadata_service/client.py +++ b/google/cloud/aiplatform_v1/services/metadata_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.metadata_service import pagers from google.cloud.aiplatform_v1.types import artifact from google.cloud.aiplatform_v1.types import artifact as gca_artifact @@ -83,10 +81,12 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import MetadataServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import MetadataServiceGrpcTransport from .transports.grpc_asyncio import MetadataServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/metadata_service/transports/base.py b/google/cloud/aiplatform_v1/services/metadata_service/transports/base.py index 62e6931cdb..d481046adb 100644 --- a/google/cloud/aiplatform_v1/services/metadata_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/metadata_service/transports/base.py @@ -98,8 +98,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -114,11 +112,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/metadata_service/transports/rest.py b/google/cloud/aiplatform_v1/services/metadata_service/transports/rest.py index 415d5bb318..2d2bf72264 100644 --- a/google/cloud/aiplatform_v1/services/metadata_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/metadata_service/transports/rest.py @@ -5399,7 +5399,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5547,7 +5547,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5694,7 +5694,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5843,7 +5843,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5993,7 +5993,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -7639,7 +7639,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -7792,7 +7792,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -7947,7 +7947,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/metadata_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/metadata_service/transports/rest_asyncio.py index 7c84da6537..fa287122e2 100644 --- a/google/cloud/aiplatform_v1/services/metadata_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/metadata_service/transports/rest_asyncio.py @@ -3727,7 +3727,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3886,7 +3886,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4046,7 +4046,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4206,7 +4206,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4366,7 +4366,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -6114,7 +6114,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -6280,7 +6280,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -6446,7 +6446,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/migration_service/async_client.py b/google/cloud/aiplatform_v1/services/migration_service/async_client.py index c65632e548..744a30796d 100644 --- a/google/cloud/aiplatform_v1/services/migration_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/migration_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.migration_service import pagers from google.cloud.aiplatform_v1.types import migratable_resource from google.cloud.aiplatform_v1.types import migration_service @@ -54,6 +52,8 @@ 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 from .transports.base import MigrationServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import MigrationServiceGrpcAsyncIOTransport from .client import MigrationServiceClient @@ -136,7 +136,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: MigrationServiceAsyncClient: The constructed client. """ - return MigrationServiceClient.from_service_account_info.__func__(MigrationServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = MigrationServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(MigrationServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -152,7 +153,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: MigrationServiceAsyncClient: The constructed client. """ - return MigrationServiceClient.from_service_account_file.__func__(MigrationServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = MigrationServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(MigrationServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/migration_service/client.py b/google/cloud/aiplatform_v1/services/migration_service/client.py index e626e873a0..074244583d 100644 --- a/google/cloud/aiplatform_v1/services/migration_service/client.py +++ b/google/cloud/aiplatform_v1/services/migration_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.migration_service import pagers from google.cloud.aiplatform_v1.types import migratable_resource from google.cloud.aiplatform_v1.types import migration_service @@ -70,6 +68,8 @@ 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 from .transports.base import MigrationServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import MigrationServiceGrpcTransport from .transports.grpc_asyncio import MigrationServiceGrpcAsyncIOTransport @@ -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}/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 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 diff --git a/google/cloud/aiplatform_v1/services/migration_service/transports/base.py b/google/cloud/aiplatform_v1/services/migration_service/transports/base.py index fe4ef89772..3e22c2cce3 100644 --- a/google/cloud/aiplatform_v1/services/migration_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/migration_service/transports/base.py @@ -88,8 +88,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -104,11 +102,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/migration_service/transports/rest.py b/google/cloud/aiplatform_v1/services/migration_service/transports/rest.py index 449e145eb9..5c0c30fde1 100644 --- a/google/cloud/aiplatform_v1/services/migration_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/migration_service/transports/rest.py @@ -2582,7 +2582,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/migration_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/migration_service/transports/rest_asyncio.py index 998dba0ab2..020b2d1938 100644 --- a/google/cloud/aiplatform_v1/services/migration_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/migration_service/transports/rest_asyncio.py @@ -695,7 +695,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/model_garden_service/async_client.py b/google/cloud/aiplatform_v1/services/model_garden_service/async_client.py index bdee217361..9790558cb6 100644 --- a/google/cloud/aiplatform_v1/services/model_garden_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/model_garden_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.types import model from google.cloud.aiplatform_v1.types import model_garden_service from google.cloud.aiplatform_v1.types import publisher_model @@ -54,6 +52,8 @@ 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 from .transports.base import ModelGardenServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import ModelGardenServiceGrpcAsyncIOTransport from .client import ModelGardenServiceClient @@ -130,7 +130,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: ModelGardenServiceAsyncClient: The constructed client. """ - return ModelGardenServiceClient.from_service_account_info.__func__(ModelGardenServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = ModelGardenServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(ModelGardenServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -146,7 +147,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: ModelGardenServiceAsyncClient: The constructed client. """ - return ModelGardenServiceClient.from_service_account_file.__func__(ModelGardenServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = ModelGardenServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(ModelGardenServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/model_garden_service/client.py b/google/cloud/aiplatform_v1/services/model_garden_service/client.py index a73e492398..65e8390682 100644 --- a/google/cloud/aiplatform_v1/services/model_garden_service/client.py +++ b/google/cloud/aiplatform_v1/services/model_garden_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.types import model from google.cloud.aiplatform_v1.types import model_garden_service from google.cloud.aiplatform_v1.types import publisher_model @@ -70,6 +68,8 @@ 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 from .transports.base import ModelGardenServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import ModelGardenServiceGrpcTransport from .transports.grpc_asyncio import ModelGardenServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/model_garden_service/transports/base.py b/google/cloud/aiplatform_v1/services/model_garden_service/transports/base.py index 65f3b3e3e8..7650417275 100644 --- a/google/cloud/aiplatform_v1/services/model_garden_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/model_garden_service/transports/base.py @@ -89,8 +89,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -105,11 +103,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/model_garden_service/transports/rest.py b/google/cloud/aiplatform_v1/services/model_garden_service/transports/rest.py index 2abde21882..4872f34af5 100644 --- a/google/cloud/aiplatform_v1/services/model_garden_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/model_garden_service/transports/rest.py @@ -2579,7 +2579,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/model_garden_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/model_garden_service/transports/rest_asyncio.py index cf2802589e..100d7ecfd0 100644 --- a/google/cloud/aiplatform_v1/services/model_garden_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/model_garden_service/transports/rest_asyncio.py @@ -693,7 +693,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/model_service/async_client.py b/google/cloud/aiplatform_v1/services/model_service/async_client.py index ff619028f0..626f7ef931 100644 --- a/google/cloud/aiplatform_v1/services/model_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/model_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.model_service import pagers from google.cloud.aiplatform_v1.types import deployed_model_ref from google.cloud.aiplatform_v1.types import encryption_spec @@ -63,10 +61,12 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import ModelServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import ModelServiceGrpcAsyncIOTransport from .client import ModelServiceClient @@ -147,7 +147,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: ModelServiceAsyncClient: The constructed client. """ - return ModelServiceClient.from_service_account_info.__func__(ModelServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = ModelServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(ModelServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -163,7 +164,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: ModelServiceAsyncClient: The constructed client. """ - return ModelServiceClient.from_service_account_file.__func__(ModelServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = ModelServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(ModelServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/model_service/client.py b/google/cloud/aiplatform_v1/services/model_service/client.py index d04b2a5d7b..92a1184722 100644 --- a/google/cloud/aiplatform_v1/services/model_service/client.py +++ b/google/cloud/aiplatform_v1/services/model_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.model_service import pagers from google.cloud.aiplatform_v1.types import deployed_model_ref from google.cloud.aiplatform_v1.types import encryption_spec @@ -79,10 +77,12 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import ModelServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import ModelServiceGrpcTransport from .transports.grpc_asyncio import ModelServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/model_service/transports/base.py b/google/cloud/aiplatform_v1/services/model_service/transports/base.py index aa84cd1f14..df84dcbee4 100644 --- a/google/cloud/aiplatform_v1/services/model_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/model_service/transports/base.py @@ -93,8 +93,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -109,11 +107,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/model_service/transports/rest.py b/google/cloud/aiplatform_v1/services/model_service/transports/rest.py index 6818422422..b1cf03fe75 100644 --- a/google/cloud/aiplatform_v1/services/model_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/model_service/transports/rest.py @@ -3887,7 +3887,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4039,7 +4039,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4188,7 +4188,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4346,7 +4346,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -6051,7 +6051,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -6370,7 +6370,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/model_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/model_service/transports/rest_asyncio.py index 64604b4df7..4bc942ad8d 100644 --- a/google/cloud/aiplatform_v1/services/model_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/model_service/transports/rest_asyncio.py @@ -2105,7 +2105,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2267,7 +2267,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2425,7 +2425,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2595,7 +2595,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4388,7 +4388,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4725,7 +4725,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/notebook_service/async_client.py b/google/cloud/aiplatform_v1/services/notebook_service/async_client.py index 270a0fef05..cf70a06602 100644 --- a/google/cloud/aiplatform_v1/services/notebook_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/notebook_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.notebook_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import job_state @@ -68,11 +66,13 @@ 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 google.protobuf import duration_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore from .transports.base import NotebookServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import NotebookServiceGrpcAsyncIOTransport from .client import NotebookServiceClient @@ -163,7 +163,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: NotebookServiceAsyncClient: The constructed client. """ - return NotebookServiceClient.from_service_account_info.__func__(NotebookServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = NotebookServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(NotebookServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -179,7 +180,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: NotebookServiceAsyncClient: The constructed client. """ - return NotebookServiceClient.from_service_account_file.__func__(NotebookServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = NotebookServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(NotebookServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/notebook_service/client.py b/google/cloud/aiplatform_v1/services/notebook_service/client.py index 29444def29..3ea2d02333 100644 --- a/google/cloud/aiplatform_v1/services/notebook_service/client.py +++ b/google/cloud/aiplatform_v1/services/notebook_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.notebook_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import job_state @@ -84,11 +82,13 @@ 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 google.protobuf import duration_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore from .transports.base import NotebookServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import NotebookServiceGrpcTransport from .transports.grpc_asyncio import NotebookServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/notebook_service/transports/base.py b/google/cloud/aiplatform_v1/services/notebook_service/transports/base.py index 37dc9d3342..2816915af9 100644 --- a/google/cloud/aiplatform_v1/services/notebook_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/notebook_service/transports/base.py @@ -90,8 +90,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -106,11 +104,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/notebook_service/transports/rest.py b/google/cloud/aiplatform_v1/services/notebook_service/transports/rest.py index c3cf1353a3..69eb7e6ee7 100644 --- a/google/cloud/aiplatform_v1/services/notebook_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/notebook_service/transports/rest.py @@ -3399,7 +3399,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3558,7 +3558,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3719,7 +3719,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3873,7 +3873,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4027,7 +4027,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4180,7 +4180,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5281,7 +5281,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5437,7 +5437,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5758,7 +5758,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/notebook_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/notebook_service/transports/rest_asyncio.py index 9b81e30eaf..ce0799b28b 100644 --- a/google/cloud/aiplatform_v1/services/notebook_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/notebook_service/transports/rest_asyncio.py @@ -1582,7 +1582,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1751,7 +1751,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1922,7 +1922,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2086,7 +2086,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2246,7 +2246,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2411,7 +2411,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3562,7 +3562,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3726,7 +3726,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4065,7 +4065,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/persistent_resource_service/async_client.py b/google/cloud/aiplatform_v1/services/persistent_resource_service/async_client.py index bb0ea15a2f..3779f91091 100644 --- a/google/cloud/aiplatform_v1/services/persistent_resource_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/persistent_resource_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.persistent_resource_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import operation as gca_operation @@ -60,10 +58,12 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore from .transports.base import PersistentResourceServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import PersistentResourceServiceGrpcAsyncIOTransport from .client import PersistentResourceServiceClient @@ -158,7 +158,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: PersistentResourceServiceAsyncClient: The constructed client. """ - return PersistentResourceServiceClient.from_service_account_info.__func__(PersistentResourceServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = PersistentResourceServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(PersistentResourceServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -174,7 +175,10 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: PersistentResourceServiceAsyncClient: The constructed client. """ - return PersistentResourceServiceClient.from_service_account_file.__func__(PersistentResourceServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = PersistentResourceServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func( + PersistentResourceServiceAsyncClient, filename, *args, **kwargs + ) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/persistent_resource_service/client.py b/google/cloud/aiplatform_v1/services/persistent_resource_service/client.py index 38a057184e..7e3bd46feb 100644 --- a/google/cloud/aiplatform_v1/services/persistent_resource_service/client.py +++ b/google/cloud/aiplatform_v1/services/persistent_resource_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.persistent_resource_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import operation as gca_operation @@ -76,10 +74,12 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore from .transports.base import PersistentResourceServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import PersistentResourceServiceGrpcTransport from .transports.grpc_asyncio import PersistentResourceServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/persistent_resource_service/transports/base.py b/google/cloud/aiplatform_v1/services/persistent_resource_service/transports/base.py index 1a22146607..7d6abdf7ed 100644 --- a/google/cloud/aiplatform_v1/services/persistent_resource_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/persistent_resource_service/transports/base.py @@ -89,8 +89,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -105,11 +103,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/persistent_resource_service/transports/rest.py b/google/cloud/aiplatform_v1/services/persistent_resource_service/transports/rest.py index 0218dd77b8..62abceb243 100644 --- a/google/cloud/aiplatform_v1/services/persistent_resource_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/persistent_resource_service/transports/rest.py @@ -2818,7 +2818,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2972,7 +2972,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3443,7 +3443,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3602,7 +3602,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/persistent_resource_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/persistent_resource_service/transports/rest_asyncio.py index 03627cfd7e..ae4c42b6be 100644 --- a/google/cloud/aiplatform_v1/services/persistent_resource_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/persistent_resource_service/transports/rest_asyncio.py @@ -953,7 +953,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1117,7 +1117,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1616,7 +1616,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1785,7 +1785,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/pipeline_service/async_client.py b/google/cloud/aiplatform_v1/services/pipeline_service/async_client.py index 48bc855dc4..4317799cfd 100644 --- a/google/cloud/aiplatform_v1/services/pipeline_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/pipeline_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.pipeline_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import model @@ -62,10 +60,12 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.api_core.operation as gac_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.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore from .transports.base import PipelineServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import PipelineServiceGrpcAsyncIOTransport from .client import PipelineServiceClient @@ -162,7 +162,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: PipelineServiceAsyncClient: The constructed client. """ - return PipelineServiceClient.from_service_account_info.__func__(PipelineServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = PipelineServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(PipelineServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -178,7 +179,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: PipelineServiceAsyncClient: The constructed client. """ - return PipelineServiceClient.from_service_account_file.__func__(PipelineServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = PipelineServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(PipelineServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/pipeline_service/client.py b/google/cloud/aiplatform_v1/services/pipeline_service/client.py index 7701c0f0ce..627654278f 100644 --- a/google/cloud/aiplatform_v1/services/pipeline_service/client.py +++ b/google/cloud/aiplatform_v1/services/pipeline_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.pipeline_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import model @@ -78,10 +76,12 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.api_core.operation as gac_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.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore from .transports.base import PipelineServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import PipelineServiceGrpcTransport from .transports.grpc_asyncio import PipelineServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/pipeline_service/transports/base.py b/google/cloud/aiplatform_v1/services/pipeline_service/transports/base.py index fb56b71b9f..07c8cea588 100644 --- a/google/cloud/aiplatform_v1/services/pipeline_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/pipeline_service/transports/base.py @@ -37,7 +37,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( gapic_version=package_version.__version__ @@ -93,8 +93,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -109,11 +107,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/pipeline_service/transports/grpc.py b/google/cloud/aiplatform_v1/services/pipeline_service/transports/grpc.py index 52b3590290..f550576884 100644 --- a/google/cloud/aiplatform_v1/services/pipeline_service/transports/grpc.py +++ b/google/cloud/aiplatform_v1/services/pipeline_service/transports/grpc.py @@ -40,7 +40,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from .base import PipelineServiceTransport, DEFAULT_CLIENT_INFO try: diff --git a/google/cloud/aiplatform_v1/services/pipeline_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1/services/pipeline_service/transports/grpc_asyncio.py index ba6abaad55..220b305912 100644 --- a/google/cloud/aiplatform_v1/services/pipeline_service/transports/grpc_asyncio.py +++ b/google/cloud/aiplatform_v1/services/pipeline_service/transports/grpc_asyncio.py @@ -43,7 +43,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from .base import PipelineServiceTransport, DEFAULT_CLIENT_INFO from .grpc import PipelineServiceGrpcTransport diff --git a/google/cloud/aiplatform_v1/services/pipeline_service/transports/rest.py b/google/cloud/aiplatform_v1/services/pipeline_service/transports/rest.py index a4807da723..808d5c362e 100644 --- a/google/cloud/aiplatform_v1/services/pipeline_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/pipeline_service/transports/rest.py @@ -42,7 +42,7 @@ from google.cloud.aiplatform_v1.types import pipeline_service from google.cloud.aiplatform_v1.types import training_pipeline from google.cloud.aiplatform_v1.types import training_pipeline as gca_training_pipeline -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -3090,7 +3090,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3249,7 +3249,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3400,7 +3400,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3517,7 +3517,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3960,7 +3960,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4110,7 +4110,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/pipeline_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/pipeline_service/transports/rest_asyncio.py index aef88c7cff..0fe4d08e8c 100644 --- a/google/cloud/aiplatform_v1/services/pipeline_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/pipeline_service/transports/rest_asyncio.py @@ -55,7 +55,7 @@ from google.cloud.aiplatform_v1.types import pipeline_service from google.cloud.aiplatform_v1.types import training_pipeline from google.cloud.aiplatform_v1.types import training_pipeline as gca_training_pipeline -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -1253,7 +1253,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1420,7 +1420,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1579,7 +1579,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1702,7 +1702,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2161,7 +2161,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2319,7 +2319,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/pipeline_service/transports/rest_base.py b/google/cloud/aiplatform_v1/services/pipeline_service/transports/rest_base.py index 5c9d04114e..b99e43cf5b 100644 --- a/google/cloud/aiplatform_v1/services/pipeline_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1/services/pipeline_service/transports/rest_base.py @@ -32,7 +32,7 @@ from google.cloud.aiplatform_v1.types import pipeline_service from google.cloud.aiplatform_v1.types import training_pipeline from google.cloud.aiplatform_v1.types import training_pipeline as gca_training_pipeline -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore diff --git a/google/cloud/aiplatform_v1/services/prediction_service/async_client.py b/google/cloud/aiplatform_v1/services/prediction_service/async_client.py index 222909f14b..57e79a4c84 100644 --- a/google/cloud/aiplatform_v1/services/prediction_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/prediction_service/async_client.py @@ -48,7 +48,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import content from google.cloud.aiplatform_v1.types import content as gca_content from google.cloud.aiplatform_v1.types import explanation @@ -59,9 +58,10 @@ 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 google.protobuf import any_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore +import google.protobuf.any_pb2 as any_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import PredictionServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import PredictionServiceGrpcAsyncIOTransport from .client import PredictionServiceClient @@ -138,7 +138,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: PredictionServiceAsyncClient: The constructed client. """ - return PredictionServiceClient.from_service_account_info.__func__(PredictionServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = PredictionServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(PredictionServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -154,7 +155,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: PredictionServiceAsyncClient: The constructed client. """ - return PredictionServiceClient.from_service_account_file.__func__(PredictionServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = PredictionServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(PredictionServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/prediction_service/client.py b/google/cloud/aiplatform_v1/services/prediction_service/client.py index 367386e7dc..c78d5cc33d 100644 --- a/google/cloud/aiplatform_v1/services/prediction_service/client.py +++ b/google/cloud/aiplatform_v1/services/prediction_service/client.py @@ -63,7 +63,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import content from google.cloud.aiplatform_v1.types import content as gca_content from google.cloud.aiplatform_v1.types import explanation @@ -74,9 +73,10 @@ 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 google.protobuf import any_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore +import google.protobuf.any_pb2 as any_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import PredictionServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import PredictionServiceGrpcTransport from .transports.grpc_asyncio import PredictionServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/prediction_service/transports/base.py b/google/cloud/aiplatform_v1/services/prediction_service/transports/base.py index b7e61ae977..fc440cfa44 100644 --- a/google/cloud/aiplatform_v1/services/prediction_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/prediction_service/transports/base.py @@ -27,12 +27,12 @@ from google.oauth2 import service_account # type: ignore import google.protobuf -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import prediction_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.httpbody_pb2 as httpbody_pb2 # type: ignore DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( gapic_version=package_version.__version__ @@ -91,8 +91,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -107,11 +105,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/prediction_service/transports/grpc.py b/google/cloud/aiplatform_v1/services/prediction_service/transports/grpc.py index 0857a8e2e1..cb8051d284 100644 --- a/google/cloud/aiplatform_v1/services/prediction_service/transports/grpc.py +++ b/google/cloud/aiplatform_v1/services/prediction_service/transports/grpc.py @@ -30,12 +30,12 @@ import grpc # type: ignore import proto # type: ignore -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import prediction_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.httpbody_pb2 as httpbody_pb2 # type: ignore from .base import PredictionServiceTransport, DEFAULT_CLIENT_INFO try: diff --git a/google/cloud/aiplatform_v1/services/prediction_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1/services/prediction_service/transports/grpc_asyncio.py index 81ed9c6e8a..1d75fb3093 100644 --- a/google/cloud/aiplatform_v1/services/prediction_service/transports/grpc_asyncio.py +++ b/google/cloud/aiplatform_v1/services/prediction_service/transports/grpc_asyncio.py @@ -33,12 +33,12 @@ import proto # type: ignore from grpc.experimental import aio # type: ignore -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import prediction_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.httpbody_pb2 as httpbody_pb2 # type: ignore from .base import PredictionServiceTransport, DEFAULT_CLIENT_INFO from .grpc import PredictionServiceGrpcTransport diff --git a/google/cloud/aiplatform_v1/services/prediction_service/transports/rest.py b/google/cloud/aiplatform_v1/services/prediction_service/transports/rest.py index f1031919b7..30bce45186 100644 --- a/google/cloud/aiplatform_v1/services/prediction_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/prediction_service/transports/rest.py @@ -36,8 +36,8 @@ import warnings -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import prediction_service +import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -2088,7 +2088,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2681,7 +2681,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/prediction_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/prediction_service/transports/rest_asyncio.py index 043f3368ba..1aea553507 100644 --- a/google/cloud/aiplatform_v1/services/prediction_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/prediction_service/transports/rest_asyncio.py @@ -48,8 +48,8 @@ from typing import Any, Dict, List, Callable, Tuple, Optional, Sequence, Union -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import prediction_service +import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -2263,7 +2263,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2873,7 +2873,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/prediction_service/transports/rest_base.py b/google/cloud/aiplatform_v1/services/prediction_service/transports/rest_base.py index 24399ee420..4bdd5d6f17 100644 --- a/google/cloud/aiplatform_v1/services/prediction_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1/services/prediction_service/transports/rest_base.py @@ -27,8 +27,8 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import prediction_service +import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore 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 4d36c2d70d..f2c48404a5 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 @@ -47,14 +47,14 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import reasoning_engine_execution_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 google.protobuf import any_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore +import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore +import google.protobuf.any_pb2 as any_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore from .transports.base import ( ReasoningEngineExecutionServiceTransport, DEFAULT_CLIENT_INFO, @@ -136,7 +136,10 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: ReasoningEngineExecutionServiceAsyncClient: The constructed client. """ - return ReasoningEngineExecutionServiceClient.from_service_account_info.__func__(ReasoningEngineExecutionServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = ReasoningEngineExecutionServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func( + ReasoningEngineExecutionServiceAsyncClient, info, *args, **kwargs + ) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -152,7 +155,10 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: ReasoningEngineExecutionServiceAsyncClient: The constructed client. """ - return ReasoningEngineExecutionServiceClient.from_service_account_file.__func__(ReasoningEngineExecutionServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = ReasoningEngineExecutionServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func( + ReasoningEngineExecutionServiceAsyncClient, filename, *args, **kwargs + ) from_service_account_json = from_service_account_file 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 fd7b86d7cf..cb3e3883b5 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 @@ -62,14 +62,14 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import reasoning_engine_execution_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 google.protobuf import any_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore +import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore +import google.protobuf.any_pb2 as any_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore from .transports.base import ( ReasoningEngineExecutionServiceTransport, DEFAULT_CLIENT_INFO, 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 09a6cfa7aa..a428817640 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 @@ -27,12 +27,12 @@ from google.oauth2 import service_account # type: ignore import google.protobuf -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import reasoning_engine_execution_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.httpbody_pb2 as httpbody_pb2 # type: ignore DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( gapic_version=package_version.__version__ @@ -88,8 +88,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -104,11 +102,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): 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 b94153e5bd..2f584f47d4 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 @@ -30,12 +30,12 @@ import grpc # type: ignore import proto # type: ignore -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import reasoning_engine_execution_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.httpbody_pb2 as httpbody_pb2 # type: ignore from .base import ReasoningEngineExecutionServiceTransport, DEFAULT_CLIENT_INFO try: 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 223649c529..9368b9a7ac 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 @@ -33,12 +33,12 @@ import proto # type: ignore from grpc.experimental import aio # type: ignore -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import reasoning_engine_execution_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.httpbody_pb2 as httpbody_pb2 # type: ignore from .base import ReasoningEngineExecutionServiceTransport, DEFAULT_CLIENT_INFO from .grpc import ReasoningEngineExecutionServiceGrpcTransport 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 fbdf192a45..f5277110eb 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 @@ -36,8 +36,8 @@ import warnings -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import reasoning_engine_execution_service +import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -845,7 +845,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { 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 f488bb6e2e..b5494db031 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 @@ -48,8 +48,8 @@ from typing import Any, Dict, List, Callable, Tuple, Optional, Sequence, Union -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import reasoning_engine_execution_service +import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -919,7 +919,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { 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 135bdf8a2b..3da5b4d865 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 @@ -27,8 +27,8 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import reasoning_engine_execution_service +import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore diff --git a/google/cloud/aiplatform_v1/services/reasoning_engine_service/async_client.py b/google/cloud/aiplatform_v1/services/reasoning_engine_service/async_client.py index d0382eba25..dbeb7aa7e3 100644 --- a/google/cloud/aiplatform_v1/services/reasoning_engine_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/reasoning_engine_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.reasoning_engine_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import operation as gca_operation @@ -57,9 +55,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import ReasoningEngineServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import ReasoningEngineServiceGrpcAsyncIOTransport from .client import ReasoningEngineServiceClient @@ -144,7 +144,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: ReasoningEngineServiceAsyncClient: The constructed client. """ - return ReasoningEngineServiceClient.from_service_account_info.__func__(ReasoningEngineServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = ReasoningEngineServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(ReasoningEngineServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -160,7 +161,10 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: ReasoningEngineServiceAsyncClient: The constructed client. """ - return ReasoningEngineServiceClient.from_service_account_file.__func__(ReasoningEngineServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = ReasoningEngineServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func( + ReasoningEngineServiceAsyncClient, filename, *args, **kwargs + ) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/reasoning_engine_service/client.py b/google/cloud/aiplatform_v1/services/reasoning_engine_service/client.py index 3db110fe60..22ac44992f 100644 --- a/google/cloud/aiplatform_v1/services/reasoning_engine_service/client.py +++ b/google/cloud/aiplatform_v1/services/reasoning_engine_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.reasoning_engine_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import operation as gca_operation @@ -73,9 +71,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import ReasoningEngineServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import ReasoningEngineServiceGrpcTransport from .transports.grpc_asyncio import ReasoningEngineServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/reasoning_engine_service/transports/base.py b/google/cloud/aiplatform_v1/services/reasoning_engine_service/transports/base.py index edddab0c7a..aafa4cbbdd 100644 --- a/google/cloud/aiplatform_v1/services/reasoning_engine_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/reasoning_engine_service/transports/base.py @@ -89,8 +89,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -105,11 +103,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/reasoning_engine_service/transports/rest.py b/google/cloud/aiplatform_v1/services/reasoning_engine_service/transports/rest.py index 39197853f6..2cfe62f1c8 100644 --- a/google/cloud/aiplatform_v1/services/reasoning_engine_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/reasoning_engine_service/transports/rest.py @@ -2755,7 +2755,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2906,7 +2906,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3375,7 +3375,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/reasoning_engine_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/reasoning_engine_service/transports/rest_asyncio.py index 72b5c9872e..1690bec685 100644 --- a/google/cloud/aiplatform_v1/services/reasoning_engine_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/reasoning_engine_service/transports/rest_asyncio.py @@ -887,7 +887,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1050,7 +1050,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1539,7 +1539,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/schedule_service/async_client.py b/google/cloud/aiplatform_v1/services/schedule_service/async_client.py index dd8ea75c90..3c8a67b52b 100644 --- a/google/cloud/aiplatform_v1/services/schedule_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/schedule_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.schedule_service import pagers from google.cloud.aiplatform_v1.types import notebook_service from google.cloud.aiplatform_v1.types import operation as gca_operation @@ -58,9 +56,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import ScheduleServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import ScheduleServiceGrpcAsyncIOTransport from .client import ScheduleServiceClient @@ -166,7 +166,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: ScheduleServiceAsyncClient: The constructed client. """ - return ScheduleServiceClient.from_service_account_info.__func__(ScheduleServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = ScheduleServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(ScheduleServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -182,7 +183,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: ScheduleServiceAsyncClient: The constructed client. """ - return ScheduleServiceClient.from_service_account_file.__func__(ScheduleServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = ScheduleServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(ScheduleServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/schedule_service/client.py b/google/cloud/aiplatform_v1/services/schedule_service/client.py index e47bffea2b..f985b8d614 100644 --- a/google/cloud/aiplatform_v1/services/schedule_service/client.py +++ b/google/cloud/aiplatform_v1/services/schedule_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.schedule_service import pagers from google.cloud.aiplatform_v1.types import notebook_service from google.cloud.aiplatform_v1.types import operation as gca_operation @@ -74,9 +72,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import ScheduleServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import ScheduleServiceGrpcTransport from .transports.grpc_asyncio import ScheduleServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/schedule_service/transports/base.py b/google/cloud/aiplatform_v1/services/schedule_service/transports/base.py index 35d9fa1302..d56e7d10c0 100644 --- a/google/cloud/aiplatform_v1/services/schedule_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/schedule_service/transports/base.py @@ -35,7 +35,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( gapic_version=package_version.__version__ @@ -91,8 +91,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -107,11 +105,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/schedule_service/transports/grpc.py b/google/cloud/aiplatform_v1/services/schedule_service/transports/grpc.py index 2ccf51ccd7..96768d6925 100644 --- a/google/cloud/aiplatform_v1/services/schedule_service/transports/grpc.py +++ b/google/cloud/aiplatform_v1/services/schedule_service/transports/grpc.py @@ -38,7 +38,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from .base import ScheduleServiceTransport, DEFAULT_CLIENT_INFO try: diff --git a/google/cloud/aiplatform_v1/services/schedule_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1/services/schedule_service/transports/grpc_asyncio.py index eb72dc735b..f8cb44558b 100644 --- a/google/cloud/aiplatform_v1/services/schedule_service/transports/grpc_asyncio.py +++ b/google/cloud/aiplatform_v1/services/schedule_service/transports/grpc_asyncio.py @@ -41,7 +41,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from .base import ScheduleServiceTransport, DEFAULT_CLIENT_INFO from .grpc import ScheduleServiceGrpcTransport diff --git a/google/cloud/aiplatform_v1/services/schedule_service/transports/rest.py b/google/cloud/aiplatform_v1/services/schedule_service/transports/rest.py index bf2912f3c8..d330afb336 100644 --- a/google/cloud/aiplatform_v1/services/schedule_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/schedule_service/transports/rest.py @@ -40,7 +40,7 @@ from google.cloud.aiplatform_v1.types import schedule from google.cloud.aiplatform_v1.types import schedule as gca_schedule from google.cloud.aiplatform_v1.types import schedule_service -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -2933,7 +2933,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3378,7 +3378,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3492,7 +3492,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/schedule_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/schedule_service/transports/rest_asyncio.py index 81614a3fdb..05209f0619 100644 --- a/google/cloud/aiplatform_v1/services/schedule_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/schedule_service/transports/rest_asyncio.py @@ -53,7 +53,7 @@ from google.cloud.aiplatform_v1.types import schedule from google.cloud.aiplatform_v1.types import schedule as gca_schedule from google.cloud.aiplatform_v1.types import schedule_service -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -1085,7 +1085,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1564,7 +1564,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1689,7 +1689,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/schedule_service/transports/rest_base.py b/google/cloud/aiplatform_v1/services/schedule_service/transports/rest_base.py index d4f238c4bf..0970942e13 100644 --- a/google/cloud/aiplatform_v1/services/schedule_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1/services/schedule_service/transports/rest_base.py @@ -30,7 +30,7 @@ from google.cloud.aiplatform_v1.types import schedule from google.cloud.aiplatform_v1.types import schedule as gca_schedule from google.cloud.aiplatform_v1.types import schedule_service -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore diff --git a/google/cloud/aiplatform_v1/services/specialist_pool_service/async_client.py b/google/cloud/aiplatform_v1/services/specialist_pool_service/async_client.py index 1f781cc082..5c9d3c59a3 100644 --- a/google/cloud/aiplatform_v1/services/specialist_pool_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/specialist_pool_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.specialist_pool_service import pagers from google.cloud.aiplatform_v1.types import operation as gca_operation from google.cloud.aiplatform_v1.types import specialist_pool @@ -56,8 +54,10 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore from .transports.base import SpecialistPoolServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import SpecialistPoolServiceGrpcAsyncIOTransport from .client import SpecialistPoolServiceClient @@ -136,7 +136,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: SpecialistPoolServiceAsyncClient: The constructed client. """ - return SpecialistPoolServiceClient.from_service_account_info.__func__(SpecialistPoolServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = SpecialistPoolServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(SpecialistPoolServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -152,7 +153,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: SpecialistPoolServiceAsyncClient: The constructed client. """ - return SpecialistPoolServiceClient.from_service_account_file.__func__(SpecialistPoolServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = SpecialistPoolServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(SpecialistPoolServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/specialist_pool_service/client.py b/google/cloud/aiplatform_v1/services/specialist_pool_service/client.py index e19c4eb33e..1a6f5e7585 100644 --- a/google/cloud/aiplatform_v1/services/specialist_pool_service/client.py +++ b/google/cloud/aiplatform_v1/services/specialist_pool_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.specialist_pool_service import pagers from google.cloud.aiplatform_v1.types import operation as gca_operation from google.cloud.aiplatform_v1.types import specialist_pool @@ -72,8 +70,10 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore from .transports.base import SpecialistPoolServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import SpecialistPoolServiceGrpcTransport from .transports.grpc_asyncio import SpecialistPoolServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/specialist_pool_service/transports/base.py b/google/cloud/aiplatform_v1/services/specialist_pool_service/transports/base.py index 798be2aa5a..4d55620222 100644 --- a/google/cloud/aiplatform_v1/services/specialist_pool_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/specialist_pool_service/transports/base.py @@ -89,8 +89,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -105,11 +103,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/specialist_pool_service/transports/rest.py b/google/cloud/aiplatform_v1/services/specialist_pool_service/transports/rest.py index c4a355cff5..4cd51c10cd 100644 --- a/google/cloud/aiplatform_v1/services/specialist_pool_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/specialist_pool_service/transports/rest.py @@ -2758,7 +2758,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2911,7 +2911,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3388,7 +3388,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/specialist_pool_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/specialist_pool_service/transports/rest_asyncio.py index 83ded27d45..fa427d1f4f 100644 --- a/google/cloud/aiplatform_v1/services/specialist_pool_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/specialist_pool_service/transports/rest_asyncio.py @@ -886,7 +886,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1045,7 +1045,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1536,7 +1536,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/tensorboard_service/async_client.py b/google/cloud/aiplatform_v1/services/tensorboard_service/async_client.py index a2e74b1084..24d3432bf0 100644 --- a/google/cloud/aiplatform_v1/services/tensorboard_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/tensorboard_service/async_client.py @@ -47,8 +47,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.tensorboard_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import operation as gca_operation @@ -70,9 +68,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import TensorboardServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import TensorboardServiceGrpcAsyncIOTransport from .client import TensorboardServiceClient @@ -157,7 +157,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: TensorboardServiceAsyncClient: The constructed client. """ - return TensorboardServiceClient.from_service_account_info.__func__(TensorboardServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = TensorboardServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(TensorboardServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -173,7 +174,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: TensorboardServiceAsyncClient: The constructed client. """ - return TensorboardServiceClient.from_service_account_file.__func__(TensorboardServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = TensorboardServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(TensorboardServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/tensorboard_service/client.py b/google/cloud/aiplatform_v1/services/tensorboard_service/client.py index 63e8b7f29e..d492ebd0c5 100644 --- a/google/cloud/aiplatform_v1/services/tensorboard_service/client.py +++ b/google/cloud/aiplatform_v1/services/tensorboard_service/client.py @@ -62,8 +62,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.tensorboard_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import operation as gca_operation @@ -85,9 +83,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import TensorboardServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import TensorboardServiceGrpcTransport from .transports.grpc_asyncio import TensorboardServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/tensorboard_service/transports/base.py b/google/cloud/aiplatform_v1/services/tensorboard_service/transports/base.py index b14dcde411..0454a91bbb 100644 --- a/google/cloud/aiplatform_v1/services/tensorboard_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/tensorboard_service/transports/base.py @@ -102,8 +102,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -118,11 +116,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/tensorboard_service/transports/rest.py b/google/cloud/aiplatform_v1/services/tensorboard_service/transports/rest.py index a76d03ccc7..809dbdbe55 100644 --- a/google/cloud/aiplatform_v1/services/tensorboard_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/tensorboard_service/transports/rest.py @@ -4742,7 +4742,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5386,7 +5386,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5537,7 +5537,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5689,7 +5689,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5842,7 +5842,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -8028,7 +8028,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/tensorboard_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/tensorboard_service/transports/rest_asyncio.py index 708ec9bbbe..5b084f8804 100644 --- a/google/cloud/aiplatform_v1/services/tensorboard_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/tensorboard_service/transports/rest_asyncio.py @@ -3022,7 +3022,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3698,7 +3698,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3861,7 +3861,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4021,7 +4021,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4184,7 +4184,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -6469,7 +6469,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/vertex_rag_data_service/async_client.py b/google/cloud/aiplatform_v1/services/vertex_rag_data_service/async_client.py index 555449aa61..d39f9f8822 100644 --- a/google/cloud/aiplatform_v1/services/vertex_rag_data_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/vertex_rag_data_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.vertex_rag_data_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import io @@ -57,9 +55,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.api_core.operation as gac_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 +import google.rpc.status_pb2 as status_pb2 # type: ignore from .transports.base import VertexRagDataServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import VertexRagDataServiceGrpcAsyncIOTransport from .client import VertexRagDataServiceClient @@ -144,7 +144,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: VertexRagDataServiceAsyncClient: The constructed client. """ - return VertexRagDataServiceClient.from_service_account_info.__func__(VertexRagDataServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = VertexRagDataServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(VertexRagDataServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -160,7 +161,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: VertexRagDataServiceAsyncClient: The constructed client. """ - return VertexRagDataServiceClient.from_service_account_file.__func__(VertexRagDataServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = VertexRagDataServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(VertexRagDataServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/vertex_rag_data_service/client.py b/google/cloud/aiplatform_v1/services/vertex_rag_data_service/client.py index 51264e5e9c..d5b30bb8b5 100644 --- a/google/cloud/aiplatform_v1/services/vertex_rag_data_service/client.py +++ b/google/cloud/aiplatform_v1/services/vertex_rag_data_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.vertex_rag_data_service import pagers from google.cloud.aiplatform_v1.types import encryption_spec from google.cloud.aiplatform_v1.types import io @@ -73,9 +71,11 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.api_core.operation as gac_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 +import google.rpc.status_pb2 as status_pb2 # type: ignore from .transports.base import VertexRagDataServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import VertexRagDataServiceGrpcTransport from .transports.grpc_asyncio import VertexRagDataServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/vertex_rag_data_service/transports/base.py b/google/cloud/aiplatform_v1/services/vertex_rag_data_service/transports/base.py index 79b9750011..e4eee4a8ee 100644 --- a/google/cloud/aiplatform_v1/services/vertex_rag_data_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/vertex_rag_data_service/transports/base.py @@ -89,8 +89,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -105,11 +103,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/vertex_rag_data_service/transports/rest.py b/google/cloud/aiplatform_v1/services/vertex_rag_data_service/transports/rest.py index 58602cb228..5c6edcfecb 100644 --- a/google/cloud/aiplatform_v1/services/vertex_rag_data_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/vertex_rag_data_service/transports/rest.py @@ -3160,7 +3160,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3311,7 +3311,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3459,7 +3459,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4064,7 +4064,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4524,7 +4524,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4680,7 +4680,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/vertex_rag_data_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/vertex_rag_data_service/transports/rest_asyncio.py index e3a9b5a35b..5c6b61ccdc 100644 --- a/google/cloud/aiplatform_v1/services/vertex_rag_data_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/vertex_rag_data_service/transports/rest_asyncio.py @@ -1323,7 +1323,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1482,7 +1482,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -1640,7 +1640,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2275,7 +2275,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2757,7 +2757,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2921,7 +2921,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/vertex_rag_service/async_client.py b/google/cloud/aiplatform_v1/services/vertex_rag_service/async_client.py index 6379b7a254..5e31321882 100644 --- a/google/cloud/aiplatform_v1/services/vertex_rag_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/vertex_rag_service/async_client.py @@ -119,7 +119,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: VertexRagServiceAsyncClient: The constructed client. """ - return VertexRagServiceClient.from_service_account_info.__func__(VertexRagServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = VertexRagServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(VertexRagServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -135,7 +136,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: VertexRagServiceAsyncClient: The constructed client. """ - return VertexRagServiceClient.from_service_account_file.__func__(VertexRagServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = VertexRagServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(VertexRagServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/vertex_rag_service/transports/base.py b/google/cloud/aiplatform_v1/services/vertex_rag_service/transports/base.py index c876edee3a..ab8c4abadb 100644 --- a/google/cloud/aiplatform_v1/services/vertex_rag_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/vertex_rag_service/transports/base.py @@ -87,8 +87,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -103,11 +101,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/vizier_service/async_client.py b/google/cloud/aiplatform_v1/services/vizier_service/async_client.py index ff6b8c5b96..79ec5ee824 100644 --- a/google/cloud/aiplatform_v1/services/vizier_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/vizier_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.vizier_service import pagers from google.cloud.aiplatform_v1.types import study from google.cloud.aiplatform_v1.types import study as gca_study @@ -55,7 +53,9 @@ 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 google.protobuf import timestamp_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.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import VizierServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import VizierServiceGrpcAsyncIOTransport from .client import VizierServiceClient @@ -131,7 +131,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: VizierServiceAsyncClient: The constructed client. """ - return VizierServiceClient.from_service_account_info.__func__(VizierServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = VizierServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(VizierServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -147,7 +148,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: VizierServiceAsyncClient: The constructed client. """ - return VizierServiceClient.from_service_account_file.__func__(VizierServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = VizierServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(VizierServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1/services/vizier_service/client.py b/google/cloud/aiplatform_v1/services/vizier_service/client.py index c80c043566..8fbd0780a5 100644 --- a/google/cloud/aiplatform_v1/services/vizier_service/client.py +++ b/google/cloud/aiplatform_v1/services/vizier_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1.services.vizier_service import pagers from google.cloud.aiplatform_v1.types import study from google.cloud.aiplatform_v1.types import study as gca_study @@ -71,7 +69,9 @@ 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 google.protobuf import timestamp_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.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import VizierServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import VizierServiceGrpcTransport from .transports.grpc_asyncio import VizierServiceGrpcAsyncIOTransport diff --git a/google/cloud/aiplatform_v1/services/vizier_service/transports/base.py b/google/cloud/aiplatform_v1/services/vizier_service/transports/base.py index d6ba7a88c8..73c991c508 100644 --- a/google/cloud/aiplatform_v1/services/vizier_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/vizier_service/transports/base.py @@ -35,7 +35,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( gapic_version=package_version.__version__ @@ -91,8 +91,6 @@ def __init__( be used for service account credentials. """ - scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} - # Save the scopes. self._scopes = scopes if not hasattr(self, "_ignore_credentials"): @@ -107,11 +105,16 @@ def __init__( if credentials_file is not None: credentials, _ = google.auth.load_credentials_from_file( - credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + 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_kwargs, quota_project_id=quota_project_id + 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"): diff --git a/google/cloud/aiplatform_v1/services/vizier_service/transports/grpc.py b/google/cloud/aiplatform_v1/services/vizier_service/transports/grpc.py index 9c5c98f3f6..140b876c90 100644 --- a/google/cloud/aiplatform_v1/services/vizier_service/transports/grpc.py +++ b/google/cloud/aiplatform_v1/services/vizier_service/transports/grpc.py @@ -38,7 +38,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from .base import VizierServiceTransport, DEFAULT_CLIENT_INFO try: diff --git a/google/cloud/aiplatform_v1/services/vizier_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1/services/vizier_service/transports/grpc_asyncio.py index b4e05094f3..110d7f34fb 100644 --- a/google/cloud/aiplatform_v1/services/vizier_service/transports/grpc_asyncio.py +++ b/google/cloud/aiplatform_v1/services/vizier_service/transports/grpc_asyncio.py @@ -41,7 +41,7 @@ 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 google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from .base import VizierServiceTransport, DEFAULT_CLIENT_INFO from .grpc import VizierServiceGrpcTransport diff --git a/google/cloud/aiplatform_v1/services/vizier_service/transports/rest.py b/google/cloud/aiplatform_v1/services/vizier_service/transports/rest.py index f2e156ef2f..30cbb8c428 100644 --- a/google/cloud/aiplatform_v1/services/vizier_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/vizier_service/transports/rest.py @@ -40,7 +40,7 @@ from google.cloud.aiplatform_v1.types import study from google.cloud.aiplatform_v1.types import study as gca_study from google.cloud.aiplatform_v1.types import vizier_service -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -3370,7 +3370,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3991,7 +3991,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -4101,7 +4101,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -5309,7 +5309,7 @@ def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/vizier_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/vizier_service/transports/rest_asyncio.py index 024f75a244..c7803b0de4 100644 --- a/google/cloud/aiplatform_v1/services/vizier_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/vizier_service/transports/rest_asyncio.py @@ -53,7 +53,7 @@ from google.cloud.aiplatform_v1.types import study from google.cloud.aiplatform_v1.types import study as gca_study from google.cloud.aiplatform_v1.types import vizier_service -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -1557,7 +1557,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2212,7 +2212,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -2330,7 +2330,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { @@ -3599,7 +3599,7 @@ async def __call__( ) method = transcoded_request["method"] try: - request_payload = json_format.MessageToJson(request) + request_payload = type(request).to_json(request) except: request_payload = None http_request = { diff --git a/google/cloud/aiplatform_v1/services/vizier_service/transports/rest_base.py b/google/cloud/aiplatform_v1/services/vizier_service/transports/rest_base.py index d77459d301..45b0fdd8f1 100644 --- a/google/cloud/aiplatform_v1/services/vizier_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1/services/vizier_service/transports/rest_base.py @@ -30,7 +30,7 @@ from google.cloud.aiplatform_v1.types import study from google.cloud.aiplatform_v1.types import study as gca_study from google.cloud.aiplatform_v1.types import vizier_service -from google.protobuf import empty_pb2 # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore diff --git a/google/cloud/aiplatform_v1/types/__init__.py b/google/cloud/aiplatform_v1/types/__init__.py index 0bfadf9248..4f2c8b83bd 100644 --- a/google/cloud/aiplatform_v1/types/__init__.py +++ b/google/cloud/aiplatform_v1/types/__init__.py @@ -566,6 +566,8 @@ SharePointSources, SlackSource, TFRecordDestination, + VertexMultimodalDatasetDestination, + VertexMultimodalDatasetSource, ) from .job_service import ( CancelBatchPredictionJobRequest, @@ -1665,6 +1667,8 @@ "SharePointSources", "SlackSource", "TFRecordDestination", + "VertexMultimodalDatasetDestination", + "VertexMultimodalDatasetSource", "CancelBatchPredictionJobRequest", "CancelCustomJobRequest", "CancelDataLabelingJobRequest", diff --git a/google/cloud/aiplatform_v1/types/annotation.py b/google/cloud/aiplatform_v1/types/annotation.py index 61ed851b98..8bc946506d 100644 --- a/google/cloud/aiplatform_v1/types/annotation.py +++ b/google/cloud/aiplatform_v1/types/annotation.py @@ -20,8 +20,8 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import user_action_reference -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/annotation_spec.py b/google/cloud/aiplatform_v1/types/annotation_spec.py index 2bcf72cb39..a9cc4c6434 100644 --- a/google/cloud/aiplatform_v1/types/annotation_spec.py +++ b/google/cloud/aiplatform_v1/types/annotation_spec.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/artifact.py b/google/cloud/aiplatform_v1/types/artifact.py index f8de1d6c6a..8ef8c96c41 100644 --- a/google/cloud/aiplatform_v1/types/artifact.py +++ b/google/cloud/aiplatform_v1/types/artifact.py @@ -19,8 +19,8 @@ import proto # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/batch_prediction_job.py b/google/cloud/aiplatform_v1/types/batch_prediction_job.py index e1c263e295..4914cd3cd8 100644 --- a/google/cloud/aiplatform_v1/types/batch_prediction_job.py +++ b/google/cloud/aiplatform_v1/types/batch_prediction_job.py @@ -31,9 +31,9 @@ from google.cloud.aiplatform_v1.types import ( unmanaged_container_model as gca_unmanaged_container_model, ) -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore __protobuf__ = proto.module( @@ -273,6 +273,11 @@ class InputConfig(proto.Message): additional columns that are not described by the schema, and they will be ignored. + This field is a member of `oneof`_ ``source``. + vertex_multimodal_dataset_source (google.cloud.aiplatform_v1.types.VertexMultimodalDatasetSource): + A Vertex Managed Dataset. Currently, only + datasets of type Multimodal are supported. + This field is a member of `oneof`_ ``source``. instances_format (str): Required. The format in which instances are given, must be @@ -293,6 +298,14 @@ class InputConfig(proto.Message): oneof="source", message=io.BigQuerySource, ) + vertex_multimodal_dataset_source: io.VertexMultimodalDatasetSource = ( + proto.Field( + proto.MESSAGE, + number=4, + oneof="source", + message=io.VertexMultimodalDatasetSource, + ) + ) instances_format: str = proto.Field( proto.STRING, number=1, @@ -489,6 +502,11 @@ class OutputConfig(proto.Message): [google.rpc.Status][google.rpc.Status] represented as a STRUCT, and containing only ``code`` and ``message``. + This field is a member of `oneof`_ ``destination``. + vertex_multimodal_dataset_destination (google.cloud.aiplatform_v1.types.VertexMultimodalDatasetDestination): + The details for a Vertex Multimodal Dataset + that will be created for the output. + This field is a member of `oneof`_ ``destination``. predictions_format (str): Required. The format in which Vertex AI gives the @@ -509,6 +527,14 @@ class OutputConfig(proto.Message): oneof="destination", message=io.BigQueryDestination, ) + vertex_multimodal_dataset_destination: io.VertexMultimodalDatasetDestination = ( + proto.Field( + proto.MESSAGE, + number=6, + oneof="destination", + message=io.VertexMultimodalDatasetDestination, + ) + ) predictions_format: str = proto.Field( proto.STRING, number=1, @@ -537,6 +563,13 @@ class OutputInfo(proto.Message): ``bq://projectId.bqDatasetId`` format, into which the prediction output is written. + This field is a member of `oneof`_ ``output_location``. + vertex_multimodal_dataset_name (str): + Output only. The resource name of the Vertex Managed Dataset + created, into which the prediction output is written. + Format: + ``projects/{project}/locations/{location}/datasets/{dataset}`` + This field is a member of `oneof`_ ``output_location``. bigquery_output_table (str): Output only. The name of the BigQuery table created, in @@ -555,6 +588,11 @@ class OutputInfo(proto.Message): number=2, oneof="output_location", ) + vertex_multimodal_dataset_name: str = proto.Field( + proto.STRING, + number=5, + oneof="output_location", + ) bigquery_output_table: str = proto.Field( proto.STRING, number=4, diff --git a/google/cloud/aiplatform_v1/types/cached_content.py b/google/cloud/aiplatform_v1/types/cached_content.py index f3fb112609..172b1f8807 100644 --- a/google/cloud/aiplatform_v1/types/cached_content.py +++ b/google/cloud/aiplatform_v1/types/cached_content.py @@ -22,8 +22,8 @@ from google.cloud.aiplatform_v1.types import content from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec from google.cloud.aiplatform_v1.types import tool -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/content.py b/google/cloud/aiplatform_v1/types/content.py index 8cb833aa6f..101c10147d 100644 --- a/google/cloud/aiplatform_v1/types/content.py +++ b/google/cloud/aiplatform_v1/types/content.py @@ -22,9 +22,9 @@ from google.cloud.aiplatform_v1.types import openapi from google.cloud.aiplatform_v1.types import tool from google.cloud.aiplatform_v1.types import vertex_rag_data -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.type import date_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.type.date_pb2 as date_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/context.py b/google/cloud/aiplatform_v1/types/context.py index 16cb31a43c..2565866942 100644 --- a/google/cloud/aiplatform_v1/types/context.py +++ b/google/cloud/aiplatform_v1/types/context.py @@ -19,8 +19,8 @@ import proto # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/custom_job.py b/google/cloud/aiplatform_v1/types/custom_job.py index 828af16172..ac4840216b 100644 --- a/google/cloud/aiplatform_v1/types/custom_job.py +++ b/google/cloud/aiplatform_v1/types/custom_job.py @@ -25,9 +25,9 @@ from google.cloud.aiplatform_v1.types import job_state from google.cloud.aiplatform_v1.types import machine_resources from google.cloud.aiplatform_v1.types import service_networking -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/data_item.py b/google/cloud/aiplatform_v1/types/data_item.py index 510e3deb4f..41dff36c0e 100644 --- a/google/cloud/aiplatform_v1/types/data_item.py +++ b/google/cloud/aiplatform_v1/types/data_item.py @@ -19,8 +19,8 @@ import proto # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/data_labeling_job.py b/google/cloud/aiplatform_v1/types/data_labeling_job.py index 2ea0ec2c65..c65d5e03dd 100644 --- a/google/cloud/aiplatform_v1/types/data_labeling_job.py +++ b/google/cloud/aiplatform_v1/types/data_labeling_job.py @@ -21,10 +21,10 @@ from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec from google.cloud.aiplatform_v1.types import job_state -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore -from google.type import money_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore +import google.type.money_pb2 as money_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/dataset.py b/google/cloud/aiplatform_v1/types/dataset.py index c810b9997b..6545e56438 100644 --- a/google/cloud/aiplatform_v1/types/dataset.py +++ b/google/cloud/aiplatform_v1/types/dataset.py @@ -22,8 +22,8 @@ from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec from google.cloud.aiplatform_v1.types import io from google.cloud.aiplatform_v1.types import saved_query -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( @@ -43,8 +43,9 @@ class Dataset(proto.Message): Attributes: name (str): - Output only. Identifier. The resource name of - the Dataset. + Output only. Identifier. The resource name of the Dataset. + Format: + ``projects/{project}/locations/{location}/datasets/{dataset}`` display_name (str): Required. The user-defined name of the Dataset. The name can be up to 128 characters diff --git a/google/cloud/aiplatform_v1/types/dataset_service.py b/google/cloud/aiplatform_v1/types/dataset_service.py index aa594f5304..6c490b5049 100644 --- a/google/cloud/aiplatform_v1/types/dataset_service.py +++ b/google/cloud/aiplatform_v1/types/dataset_service.py @@ -26,7 +26,7 @@ from google.cloud.aiplatform_v1.types import model from google.cloud.aiplatform_v1.types import operation from google.cloud.aiplatform_v1.types import saved_query as gca_saved_query -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( @@ -112,7 +112,6 @@ class CreateDatasetOperationMetadata(proto.Message): class GetDatasetRequest(proto.Message): r"""Request message for [DatasetService.GetDataset][google.cloud.aiplatform.v1.DatasetService.GetDataset]. - Next ID: 4 Attributes: name (str): @@ -489,7 +488,6 @@ class DeleteDatasetVersionRequest(proto.Message): class GetDatasetVersionRequest(proto.Message): r"""Request message for [DatasetService.GetDatasetVersion][google.cloud.aiplatform.v1.DatasetService.GetDatasetVersion]. - Next ID: 4 Attributes: name (str): diff --git a/google/cloud/aiplatform_v1/types/dataset_version.py b/google/cloud/aiplatform_v1/types/dataset_version.py index 5a03fe5aa8..771bc1714d 100644 --- a/google/cloud/aiplatform_v1/types/dataset_version.py +++ b/google/cloud/aiplatform_v1/types/dataset_version.py @@ -19,8 +19,8 @@ import proto # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( @@ -36,8 +36,9 @@ class DatasetVersion(proto.Message): Attributes: name (str): - Output only. Identifier. The resource name of - the DatasetVersion. + Output only. Identifier. The resource name of the + DatasetVersion. Format: + ``projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}`` create_time (google.protobuf.timestamp_pb2.Timestamp): Output only. Timestamp when this DatasetVersion was created. diff --git a/google/cloud/aiplatform_v1/types/deployment_resource_pool.py b/google/cloud/aiplatform_v1/types/deployment_resource_pool.py index 991c9a6a6d..be316e5c06 100644 --- a/google/cloud/aiplatform_v1/types/deployment_resource_pool.py +++ b/google/cloud/aiplatform_v1/types/deployment_resource_pool.py @@ -21,7 +21,7 @@ from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec from google.cloud.aiplatform_v1.types import machine_resources -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/deployment_resource_pool_service.py b/google/cloud/aiplatform_v1/types/deployment_resource_pool_service.py index 1325565ba4..689b3265ae 100644 --- a/google/cloud/aiplatform_v1/types/deployment_resource_pool_service.py +++ b/google/cloud/aiplatform_v1/types/deployment_resource_pool_service.py @@ -25,7 +25,7 @@ ) from google.cloud.aiplatform_v1.types import endpoint from google.cloud.aiplatform_v1.types import operation -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/endpoint.py b/google/cloud/aiplatform_v1/types/endpoint.py index c149a18242..51593479c9 100644 --- a/google/cloud/aiplatform_v1/types/endpoint.py +++ b/google/cloud/aiplatform_v1/types/endpoint.py @@ -24,8 +24,8 @@ from google.cloud.aiplatform_v1.types import io from google.cloud.aiplatform_v1.types import machine_resources from google.cloud.aiplatform_v1.types import service_networking -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/endpoint_service.py b/google/cloud/aiplatform_v1/types/endpoint_service.py index b4b9bd99c0..06c6306e92 100644 --- a/google/cloud/aiplatform_v1/types/endpoint_service.py +++ b/google/cloud/aiplatform_v1/types/endpoint_service.py @@ -22,7 +22,7 @@ from google.cloud.aiplatform_v1.types import deployment_stage as gca_deployment_stage from google.cloud.aiplatform_v1.types import endpoint as gca_endpoint from google.cloud.aiplatform_v1.types import operation -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/entity_type.py b/google/cloud/aiplatform_v1/types/entity_type.py index b289d9fe08..75fb6a684a 100644 --- a/google/cloud/aiplatform_v1/types/entity_type.py +++ b/google/cloud/aiplatform_v1/types/entity_type.py @@ -20,7 +20,7 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import featurestore_monitoring -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/evaluated_annotation.py b/google/cloud/aiplatform_v1/types/evaluated_annotation.py index 2bbced800a..b621c4b806 100644 --- a/google/cloud/aiplatform_v1/types/evaluated_annotation.py +++ b/google/cloud/aiplatform_v1/types/evaluated_annotation.py @@ -20,7 +20,7 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import explanation as gca_explanation -from google.protobuf import struct_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/event.py b/google/cloud/aiplatform_v1/types/event.py index 2f4081629b..e3b4c350d2 100644 --- a/google/cloud/aiplatform_v1/types/event.py +++ b/google/cloud/aiplatform_v1/types/event.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/execution.py b/google/cloud/aiplatform_v1/types/execution.py index 390e185410..2b70eeba02 100644 --- a/google/cloud/aiplatform_v1/types/execution.py +++ b/google/cloud/aiplatform_v1/types/execution.py @@ -19,8 +19,8 @@ import proto # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/explanation.py b/google/cloud/aiplatform_v1/types/explanation.py index 024e9dc839..3d0e509734 100644 --- a/google/cloud/aiplatform_v1/types/explanation.py +++ b/google/cloud/aiplatform_v1/types/explanation.py @@ -21,7 +21,7 @@ from google.cloud.aiplatform_v1.types import explanation_metadata from google.cloud.aiplatform_v1.types import io -from google.protobuf import struct_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/explanation_metadata.py b/google/cloud/aiplatform_v1/types/explanation_metadata.py index b4be565e37..a903a48841 100644 --- a/google/cloud/aiplatform_v1/types/explanation_metadata.py +++ b/google/cloud/aiplatform_v1/types/explanation_metadata.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.protobuf import struct_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/feature.py b/google/cloud/aiplatform_v1/types/feature.py index a124df4924..0bd1c4dece 100644 --- a/google/cloud/aiplatform_v1/types/feature.py +++ b/google/cloud/aiplatform_v1/types/feature.py @@ -20,7 +20,7 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import feature_monitoring_stats -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/feature_group.py b/google/cloud/aiplatform_v1/types/feature_group.py index 63eee4ce43..e85b0f8afd 100644 --- a/google/cloud/aiplatform_v1/types/feature_group.py +++ b/google/cloud/aiplatform_v1/types/feature_group.py @@ -20,7 +20,7 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import io -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/feature_monitoring_stats.py b/google/cloud/aiplatform_v1/types/feature_monitoring_stats.py index 804bbd6cfe..d7ef8832c5 100644 --- a/google/cloud/aiplatform_v1/types/feature_monitoring_stats.py +++ b/google/cloud/aiplatform_v1/types/feature_monitoring_stats.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/feature_online_store.py b/google/cloud/aiplatform_v1/types/feature_online_store.py index e021bcb506..4a7face2a6 100644 --- a/google/cloud/aiplatform_v1/types/feature_online_store.py +++ b/google/cloud/aiplatform_v1/types/feature_online_store.py @@ -21,7 +21,7 @@ from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec from google.cloud.aiplatform_v1.types import service_networking -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/feature_online_store_admin_service.py b/google/cloud/aiplatform_v1/types/feature_online_store_admin_service.py index 4199faa2a5..bb8692d36b 100644 --- a/google/cloud/aiplatform_v1/types/feature_online_store_admin_service.py +++ b/google/cloud/aiplatform_v1/types/feature_online_store_admin_service.py @@ -25,7 +25,7 @@ from google.cloud.aiplatform_v1.types import feature_view as gca_feature_view from google.cloud.aiplatform_v1.types import feature_view_sync as gca_feature_view_sync from google.cloud.aiplatform_v1.types import operation -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/feature_online_store_service.py b/google/cloud/aiplatform_v1/types/feature_online_store_service.py index 2690fafe35..65b7491e4e 100644 --- a/google/cloud/aiplatform_v1/types/feature_online_store_service.py +++ b/google/cloud/aiplatform_v1/types/feature_online_store_service.py @@ -20,9 +20,9 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import featurestore_online_service -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/feature_registry_service.py b/google/cloud/aiplatform_v1/types/feature_registry_service.py index 0665b4d086..ad133bd881 100644 --- a/google/cloud/aiplatform_v1/types/feature_registry_service.py +++ b/google/cloud/aiplatform_v1/types/feature_registry_service.py @@ -21,7 +21,7 @@ from google.cloud.aiplatform_v1.types import feature_group as gca_feature_group from google.cloud.aiplatform_v1.types import operation -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/feature_view.py b/google/cloud/aiplatform_v1/types/feature_view.py index 41822f6ec2..20a6c2cf0d 100644 --- a/google/cloud/aiplatform_v1/types/feature_view.py +++ b/google/cloud/aiplatform_v1/types/feature_view.py @@ -20,7 +20,7 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import machine_resources -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/feature_view_sync.py b/google/cloud/aiplatform_v1/types/feature_view_sync.py index 0177035cf2..b299a87425 100644 --- a/google/cloud/aiplatform_v1/types/feature_view_sync.py +++ b/google/cloud/aiplatform_v1/types/feature_view_sync.py @@ -19,9 +19,9 @@ import proto # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore -from google.type import interval_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore +import google.type.interval_pb2 as interval_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/featurestore.py b/google/cloud/aiplatform_v1/types/featurestore.py index 11e1c37276..e7313c4a95 100644 --- a/google/cloud/aiplatform_v1/types/featurestore.py +++ b/google/cloud/aiplatform_v1/types/featurestore.py @@ -20,7 +20,7 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/featurestore_online_service.py b/google/cloud/aiplatform_v1/types/featurestore_online_service.py index 705be0c60d..94e6eb9484 100644 --- a/google/cloud/aiplatform_v1/types/featurestore_online_service.py +++ b/google/cloud/aiplatform_v1/types/featurestore_online_service.py @@ -21,7 +21,7 @@ from google.cloud.aiplatform_v1.types import feature_selector as gca_feature_selector from google.cloud.aiplatform_v1.types import types -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/featurestore_service.py b/google/cloud/aiplatform_v1/types/featurestore_service.py index cfe75e7a5b..6bcf06d1e1 100644 --- a/google/cloud/aiplatform_v1/types/featurestore_service.py +++ b/google/cloud/aiplatform_v1/types/featurestore_service.py @@ -25,9 +25,9 @@ from google.cloud.aiplatform_v1.types import featurestore as gca_featurestore from google.cloud.aiplatform_v1.types import io from google.cloud.aiplatform_v1.types import operation -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.type import interval_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.type.interval_pb2 as interval_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/gen_ai_cache_service.py b/google/cloud/aiplatform_v1/types/gen_ai_cache_service.py index 3c702e7173..68e9f42de6 100644 --- a/google/cloud/aiplatform_v1/types/gen_ai_cache_service.py +++ b/google/cloud/aiplatform_v1/types/gen_ai_cache_service.py @@ -20,7 +20,7 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import cached_content as gca_cached_content -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/hyperparameter_tuning_job.py b/google/cloud/aiplatform_v1/types/hyperparameter_tuning_job.py index e5eaee7b18..a3f75710c7 100644 --- a/google/cloud/aiplatform_v1/types/hyperparameter_tuning_job.py +++ b/google/cloud/aiplatform_v1/types/hyperparameter_tuning_job.py @@ -23,8 +23,8 @@ from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec from google.cloud.aiplatform_v1.types import job_state from google.cloud.aiplatform_v1.types import study -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/index.py b/google/cloud/aiplatform_v1/types/index.py index 3c306c4428..162e64b501 100644 --- a/google/cloud/aiplatform_v1/types/index.py +++ b/google/cloud/aiplatform_v1/types/index.py @@ -21,8 +21,8 @@ from google.cloud.aiplatform_v1.types import deployed_index_ref from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/index_endpoint.py b/google/cloud/aiplatform_v1/types/index_endpoint.py index bfbea76141..27b892bea5 100644 --- a/google/cloud/aiplatform_v1/types/index_endpoint.py +++ b/google/cloud/aiplatform_v1/types/index_endpoint.py @@ -22,7 +22,7 @@ from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec from google.cloud.aiplatform_v1.types import machine_resources from google.cloud.aiplatform_v1.types import service_networking -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/index_endpoint_service.py b/google/cloud/aiplatform_v1/types/index_endpoint_service.py index b5e81434ba..305868f3b1 100644 --- a/google/cloud/aiplatform_v1/types/index_endpoint_service.py +++ b/google/cloud/aiplatform_v1/types/index_endpoint_service.py @@ -21,7 +21,7 @@ from google.cloud.aiplatform_v1.types import index_endpoint as gca_index_endpoint from google.cloud.aiplatform_v1.types import operation -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/index_service.py b/google/cloud/aiplatform_v1/types/index_service.py index e252eab49b..363850bd87 100644 --- a/google/cloud/aiplatform_v1/types/index_service.py +++ b/google/cloud/aiplatform_v1/types/index_service.py @@ -21,7 +21,7 @@ from google.cloud.aiplatform_v1.types import index as gca_index from google.cloud.aiplatform_v1.types import operation -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/io.py b/google/cloud/aiplatform_v1/types/io.py index 07d89f0bea..ac11ade652 100644 --- a/google/cloud/aiplatform_v1/types/io.py +++ b/google/cloud/aiplatform_v1/types/io.py @@ -20,7 +20,7 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import api_auth -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( @@ -32,6 +32,8 @@ "GcsDestination", "BigQuerySource", "BigQueryDestination", + "VertexMultimodalDatasetSource", + "VertexMultimodalDatasetDestination", "CsvDestination", "TFRecordDestination", "ContainerRegistryDestination", @@ -152,6 +154,46 @@ class BigQueryDestination(proto.Message): ) +class VertexMultimodalDatasetSource(proto.Message): + r"""The Vertex Multimodal Dataset for the input content. + + Attributes: + dataset_name (str): + Required. The resource name of the Vertex Dataset. Format: + ``projects/{project}/locations/{location}/datasets/{dataset}`` + """ + + dataset_name: str = proto.Field( + proto.STRING, + number=1, + ) + + +class VertexMultimodalDatasetDestination(proto.Message): + r"""The details for a Vertex Multimodal Dataset output. + + Attributes: + bigquery_destination (google.cloud.aiplatform_v1.types.BigQueryDestination): + Optional. The destination of the underlying + BigQuery table that will be created for the + output Multimodal Dataset. If not specified, the + BigQuery table will be created in a default + BigQuery dataset. + display_name (str): + Optional. Display name of the output dataset. + """ + + bigquery_destination: "BigQueryDestination" = proto.Field( + proto.MESSAGE, + number=1, + message="BigQueryDestination", + ) + display_name: str = proto.Field( + proto.STRING, + number=2, + ) + + class CsvDestination(proto.Message): r"""The storage details for CSV output content. diff --git a/google/cloud/aiplatform_v1/types/job_service.py b/google/cloud/aiplatform_v1/types/job_service.py index 1cb3b7f5a2..c4fa5aca2a 100644 --- a/google/cloud/aiplatform_v1/types/job_service.py +++ b/google/cloud/aiplatform_v1/types/job_service.py @@ -32,8 +32,8 @@ ) from google.cloud.aiplatform_v1.types import nas_job as gca_nas_job from google.cloud.aiplatform_v1.types import operation -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/llm_utility_service.py b/google/cloud/aiplatform_v1/types/llm_utility_service.py index 5109a57d22..a959b86270 100644 --- a/google/cloud/aiplatform_v1/types/llm_utility_service.py +++ b/google/cloud/aiplatform_v1/types/llm_utility_service.py @@ -20,7 +20,7 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import content -from google.protobuf import struct_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/metadata_schema.py b/google/cloud/aiplatform_v1/types/metadata_schema.py index a5043d3113..92f58013b2 100644 --- a/google/cloud/aiplatform_v1/types/metadata_schema.py +++ b/google/cloud/aiplatform_v1/types/metadata_schema.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/metadata_service.py b/google/cloud/aiplatform_v1/types/metadata_service.py index 4726b19685..9a46a6307f 100644 --- a/google/cloud/aiplatform_v1/types/metadata_service.py +++ b/google/cloud/aiplatform_v1/types/metadata_service.py @@ -26,7 +26,7 @@ from google.cloud.aiplatform_v1.types import metadata_schema as gca_metadata_schema from google.cloud.aiplatform_v1.types import metadata_store as gca_metadata_store from google.cloud.aiplatform_v1.types import operation -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/metadata_store.py b/google/cloud/aiplatform_v1/types/metadata_store.py index eed1cc747c..270712a984 100644 --- a/google/cloud/aiplatform_v1/types/metadata_store.py +++ b/google/cloud/aiplatform_v1/types/metadata_store.py @@ -20,7 +20,7 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/migratable_resource.py b/google/cloud/aiplatform_v1/types/migratable_resource.py index 72d369b3c4..cfbdc67237 100644 --- a/google/cloud/aiplatform_v1/types/migratable_resource.py +++ b/google/cloud/aiplatform_v1/types/migratable_resource.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/migration_service.py b/google/cloud/aiplatform_v1/types/migration_service.py index 9d19366134..0a5a9182fc 100644 --- a/google/cloud/aiplatform_v1/types/migration_service.py +++ b/google/cloud/aiplatform_v1/types/migration_service.py @@ -23,7 +23,7 @@ migratable_resource as gca_migratable_resource, ) from google.cloud.aiplatform_v1.types import operation -from google.rpc import status_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/model.py b/google/cloud/aiplatform_v1/types/model.py index 60315bc23e..80453ee31d 100644 --- a/google/cloud/aiplatform_v1/types/model.py +++ b/google/cloud/aiplatform_v1/types/model.py @@ -23,9 +23,9 @@ from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec from google.cloud.aiplatform_v1.types import env_var from google.cloud.aiplatform_v1.types import explanation -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/model_deployment_monitoring_job.py b/google/cloud/aiplatform_v1/types/model_deployment_monitoring_job.py index f725cbdb3f..3b84bfbcd0 100644 --- a/google/cloud/aiplatform_v1/types/model_deployment_monitoring_job.py +++ b/google/cloud/aiplatform_v1/types/model_deployment_monitoring_job.py @@ -24,10 +24,10 @@ from google.cloud.aiplatform_v1.types import io from google.cloud.aiplatform_v1.types import job_state from google.cloud.aiplatform_v1.types import model_monitoring -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/model_evaluation.py b/google/cloud/aiplatform_v1/types/model_evaluation.py index 80485ab2c3..a7c7d49738 100644 --- a/google/cloud/aiplatform_v1/types/model_evaluation.py +++ b/google/cloud/aiplatform_v1/types/model_evaluation.py @@ -20,8 +20,8 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import explanation -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/model_evaluation_slice.py b/google/cloud/aiplatform_v1/types/model_evaluation_slice.py index 6ce7041641..98cbcda3ba 100644 --- a/google/cloud/aiplatform_v1/types/model_evaluation_slice.py +++ b/google/cloud/aiplatform_v1/types/model_evaluation_slice.py @@ -20,9 +20,9 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import explanation -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.protobuf import wrappers_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.protobuf.wrappers_pb2 as wrappers_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/model_service.py b/google/cloud/aiplatform_v1/types/model_service.py index 32ba35a7dc..75f76d80f7 100644 --- a/google/cloud/aiplatform_v1/types/model_service.py +++ b/google/cloud/aiplatform_v1/types/model_service.py @@ -27,7 +27,7 @@ from google.cloud.aiplatform_v1.types import model_evaluation as gca_model_evaluation from google.cloud.aiplatform_v1.types import model_evaluation_slice from google.cloud.aiplatform_v1.types import operation -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/nas_job.py b/google/cloud/aiplatform_v1/types/nas_job.py index 13fa3b82cc..a52163a0ff 100644 --- a/google/cloud/aiplatform_v1/types/nas_job.py +++ b/google/cloud/aiplatform_v1/types/nas_job.py @@ -23,8 +23,8 @@ from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec from google.cloud.aiplatform_v1.types import job_state from google.cloud.aiplatform_v1.types import study -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/notebook_execution_job.py b/google/cloud/aiplatform_v1/types/notebook_execution_job.py index fd39bd3c92..cd6ea579f9 100644 --- a/google/cloud/aiplatform_v1/types/notebook_execution_job.py +++ b/google/cloud/aiplatform_v1/types/notebook_execution_job.py @@ -23,9 +23,9 @@ from google.cloud.aiplatform_v1.types import job_state as gca_job_state from google.cloud.aiplatform_v1.types import machine_resources from google.cloud.aiplatform_v1.types import network_spec as gca_network_spec -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/notebook_idle_shutdown_config.py b/google/cloud/aiplatform_v1/types/notebook_idle_shutdown_config.py index f1fbb5595e..03e22e6bc7 100644 --- a/google/cloud/aiplatform_v1/types/notebook_idle_shutdown_config.py +++ b/google/cloud/aiplatform_v1/types/notebook_idle_shutdown_config.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.protobuf import duration_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/notebook_runtime.py b/google/cloud/aiplatform_v1/types/notebook_runtime.py index 8f030fb1bc..d26993a462 100644 --- a/google/cloud/aiplatform_v1/types/notebook_runtime.py +++ b/google/cloud/aiplatform_v1/types/notebook_runtime.py @@ -28,7 +28,7 @@ notebook_runtime_template_ref as gca_notebook_runtime_template_ref, ) from google.cloud.aiplatform_v1.types import notebook_software_config -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/notebook_service.py b/google/cloud/aiplatform_v1/types/notebook_service.py index 6cf9ed2394..240967ca9d 100644 --- a/google/cloud/aiplatform_v1/types/notebook_service.py +++ b/google/cloud/aiplatform_v1/types/notebook_service.py @@ -24,7 +24,7 @@ ) from google.cloud.aiplatform_v1.types import notebook_runtime as gca_notebook_runtime from google.cloud.aiplatform_v1.types import operation -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/openapi.py b/google/cloud/aiplatform_v1/types/openapi.py index 4ea820593b..c184c6fb02 100644 --- a/google/cloud/aiplatform_v1/types/openapi.py +++ b/google/cloud/aiplatform_v1/types/openapi.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.protobuf import struct_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/operation.py b/google/cloud/aiplatform_v1/types/operation.py index f1adddb4ed..f0c0cd9fb9 100644 --- a/google/cloud/aiplatform_v1/types/operation.py +++ b/google/cloud/aiplatform_v1/types/operation.py @@ -19,8 +19,8 @@ import proto # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/persistent_resource.py b/google/cloud/aiplatform_v1/types/persistent_resource.py index 1b5e2f1cd8..350896324d 100644 --- a/google/cloud/aiplatform_v1/types/persistent_resource.py +++ b/google/cloud/aiplatform_v1/types/persistent_resource.py @@ -22,8 +22,8 @@ from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec from google.cloud.aiplatform_v1.types import machine_resources from google.cloud.aiplatform_v1.types import service_networking -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/persistent_resource_service.py b/google/cloud/aiplatform_v1/types/persistent_resource_service.py index 8bf56c058f..56a48a2b77 100644 --- a/google/cloud/aiplatform_v1/types/persistent_resource_service.py +++ b/google/cloud/aiplatform_v1/types/persistent_resource_service.py @@ -23,7 +23,7 @@ from google.cloud.aiplatform_v1.types import ( persistent_resource as gca_persistent_resource, ) -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/pipeline_job.py b/google/cloud/aiplatform_v1/types/pipeline_job.py index 4dcca2448d..57101cb2af 100644 --- a/google/cloud/aiplatform_v1/types/pipeline_job.py +++ b/google/cloud/aiplatform_v1/types/pipeline_job.py @@ -27,9 +27,9 @@ from google.cloud.aiplatform_v1.types import pipeline_state from google.cloud.aiplatform_v1.types import service_networking from google.cloud.aiplatform_v1.types import value as gca_value -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/pipeline_service.py b/google/cloud/aiplatform_v1/types/pipeline_service.py index ce8ab51284..697af698bd 100644 --- a/google/cloud/aiplatform_v1/types/pipeline_service.py +++ b/google/cloud/aiplatform_v1/types/pipeline_service.py @@ -22,7 +22,7 @@ from google.cloud.aiplatform_v1.types import operation from google.cloud.aiplatform_v1.types import pipeline_job as gca_pipeline_job from google.cloud.aiplatform_v1.types import training_pipeline as gca_training_pipeline -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/prediction_service.py b/google/cloud/aiplatform_v1/types/prediction_service.py index 54d45d99b7..b929c7114c 100644 --- a/google/cloud/aiplatform_v1/types/prediction_service.py +++ b/google/cloud/aiplatform_v1/types/prediction_service.py @@ -19,14 +19,14 @@ import proto # type: ignore -from google.api import httpbody_pb2 # type: ignore from google.cloud.aiplatform_v1.types import content as gca_content from google.cloud.aiplatform_v1.types import explanation from google.cloud.aiplatform_v1.types import tool from google.cloud.aiplatform_v1.types import types from google.cloud.aiplatform_v1.types import usage_metadata as gca_usage_metadata -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api.httpbody_pb2 as httpbody_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/reasoning_engine.py b/google/cloud/aiplatform_v1/types/reasoning_engine.py index 31e7daaf12..22d9b55121 100644 --- a/google/cloud/aiplatform_v1/types/reasoning_engine.py +++ b/google/cloud/aiplatform_v1/types/reasoning_engine.py @@ -22,8 +22,8 @@ from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec from google.cloud.aiplatform_v1.types import env_var from google.cloud.aiplatform_v1.types import service_networking -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( 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 471fcad7eb..fa0427ba45 100644 --- a/google/cloud/aiplatform_v1/types/reasoning_engine_execution_service.py +++ b/google/cloud/aiplatform_v1/types/reasoning_engine_execution_service.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.protobuf import struct_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/reasoning_engine_service.py b/google/cloud/aiplatform_v1/types/reasoning_engine_service.py index 6b6685ea09..f4741ad41d 100644 --- a/google/cloud/aiplatform_v1/types/reasoning_engine_service.py +++ b/google/cloud/aiplatform_v1/types/reasoning_engine_service.py @@ -21,7 +21,7 @@ from google.cloud.aiplatform_v1.types import operation from google.cloud.aiplatform_v1.types import reasoning_engine as gca_reasoning_engine -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/saved_query.py b/google/cloud/aiplatform_v1/types/saved_query.py index fa9727a5da..16f51156c9 100644 --- a/google/cloud/aiplatform_v1/types/saved_query.py +++ b/google/cloud/aiplatform_v1/types/saved_query.py @@ -19,8 +19,8 @@ import proto # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/schedule.py b/google/cloud/aiplatform_v1/types/schedule.py index cdb61246d4..6009b3614e 100644 --- a/google/cloud/aiplatform_v1/types/schedule.py +++ b/google/cloud/aiplatform_v1/types/schedule.py @@ -21,7 +21,7 @@ from google.cloud.aiplatform_v1.types import notebook_service from google.cloud.aiplatform_v1.types import pipeline_service -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( @@ -119,6 +119,14 @@ class Schedule(proto.Message): the limit for starting the scheduled requests and not the execution of the operations/jobs created by the requests (if applicable). + max_concurrent_active_run_count (int): + Optional. Specifies the maximum number of + active runs that can be executed concurrently + for this Schedule. This limits the number of + runs that can be in a non-terminal state at the + same time. + Currently, this field is only supported for + requests of type CreatePipelineJobRequest. allow_queueing (bool): Optional. Whether new scheduled runs can be queued when max_concurrent_runs limit is reached. If set to true, new @@ -265,6 +273,10 @@ class RunResponse(proto.Message): proto.INT64, number=11, ) + max_concurrent_active_run_count: int = proto.Field( + proto.INT64, + number=21, + ) allow_queueing: bool = proto.Field( proto.BOOL, number=12, diff --git a/google/cloud/aiplatform_v1/types/schedule_service.py b/google/cloud/aiplatform_v1/types/schedule_service.py index cfa8414c73..87888576eb 100644 --- a/google/cloud/aiplatform_v1/types/schedule_service.py +++ b/google/cloud/aiplatform_v1/types/schedule_service.py @@ -20,7 +20,7 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import schedule as gca_schedule -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/specialist_pool_service.py b/google/cloud/aiplatform_v1/types/specialist_pool_service.py index b3e0533e83..7facfbf1d8 100644 --- a/google/cloud/aiplatform_v1/types/specialist_pool_service.py +++ b/google/cloud/aiplatform_v1/types/specialist_pool_service.py @@ -21,7 +21,7 @@ from google.cloud.aiplatform_v1.types import operation from google.cloud.aiplatform_v1.types import specialist_pool as gca_specialist_pool -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/study.py b/google/cloud/aiplatform_v1/types/study.py index dac41d5f1f..02dca81529 100644 --- a/google/cloud/aiplatform_v1/types/study.py +++ b/google/cloud/aiplatform_v1/types/study.py @@ -19,10 +19,10 @@ import proto # type: ignore -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.protobuf import wrappers_pb2 # type: ignore +import google.protobuf.duration_pb2 as duration_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.protobuf.wrappers_pb2 as wrappers_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/tensorboard.py b/google/cloud/aiplatform_v1/types/tensorboard.py index 23dad29b79..8507cd9de9 100644 --- a/google/cloud/aiplatform_v1/types/tensorboard.py +++ b/google/cloud/aiplatform_v1/types/tensorboard.py @@ -20,7 +20,7 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/tensorboard_data.py b/google/cloud/aiplatform_v1/types/tensorboard_data.py index 6d9e6dab90..23dff191b0 100644 --- a/google/cloud/aiplatform_v1/types/tensorboard_data.py +++ b/google/cloud/aiplatform_v1/types/tensorboard_data.py @@ -20,7 +20,7 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import tensorboard_time_series -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/tensorboard_experiment.py b/google/cloud/aiplatform_v1/types/tensorboard_experiment.py index dea6536f6d..43f634a0d4 100644 --- a/google/cloud/aiplatform_v1/types/tensorboard_experiment.py +++ b/google/cloud/aiplatform_v1/types/tensorboard_experiment.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/tensorboard_run.py b/google/cloud/aiplatform_v1/types/tensorboard_run.py index c12ca46c30..d220ff56e6 100644 --- a/google/cloud/aiplatform_v1/types/tensorboard_run.py +++ b/google/cloud/aiplatform_v1/types/tensorboard_run.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/tensorboard_service.py b/google/cloud/aiplatform_v1/types/tensorboard_service.py index bbcb49f0e2..1aba2adfa6 100644 --- a/google/cloud/aiplatform_v1/types/tensorboard_service.py +++ b/google/cloud/aiplatform_v1/types/tensorboard_service.py @@ -29,7 +29,7 @@ from google.cloud.aiplatform_v1.types import ( tensorboard_time_series as gca_tensorboard_time_series, ) -from google.protobuf import field_mask_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/tensorboard_time_series.py b/google/cloud/aiplatform_v1/types/tensorboard_time_series.py index 834269dfea..9ebd98aacc 100644 --- a/google/cloud/aiplatform_v1/types/tensorboard_time_series.py +++ b/google/cloud/aiplatform_v1/types/tensorboard_time_series.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/tool.py b/google/cloud/aiplatform_v1/types/tool.py index 7ee7ca9d91..26561cf22f 100644 --- a/google/cloud/aiplatform_v1/types/tool.py +++ b/google/cloud/aiplatform_v1/types/tool.py @@ -20,8 +20,8 @@ import proto # type: ignore from google.cloud.aiplatform_v1.types import openapi -from google.protobuf import struct_pb2 # type: ignore -from google.type import latlng_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.type.latlng_pb2 as latlng_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/training_pipeline.py b/google/cloud/aiplatform_v1/types/training_pipeline.py index 690c31494b..1c21eaca55 100644 --- a/google/cloud/aiplatform_v1/types/training_pipeline.py +++ b/google/cloud/aiplatform_v1/types/training_pipeline.py @@ -23,9 +23,9 @@ from google.cloud.aiplatform_v1.types import io from google.cloud.aiplatform_v1.types import model from google.cloud.aiplatform_v1.types import pipeline_state -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/tuning_job.py b/google/cloud/aiplatform_v1/types/tuning_job.py index 80a35c9992..49d71ba0de 100644 --- a/google/cloud/aiplatform_v1/types/tuning_job.py +++ b/google/cloud/aiplatform_v1/types/tuning_job.py @@ -22,8 +22,8 @@ from google.cloud.aiplatform_v1.types import content from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec from google.cloud.aiplatform_v1.types import job_state -from google.protobuf import timestamp_pb2 # type: ignore -from google.rpc import status_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/vertex_rag_data.py b/google/cloud/aiplatform_v1/types/vertex_rag_data.py index 67c9ae3810..d739d44a1b 100644 --- a/google/cloud/aiplatform_v1/types/vertex_rag_data.py +++ b/google/cloud/aiplatform_v1/types/vertex_rag_data.py @@ -22,7 +22,7 @@ from google.cloud.aiplatform_v1.types import api_auth as gca_api_auth from google.cloud.aiplatform_v1.types import encryption_spec as gca_encryption_spec from google.cloud.aiplatform_v1.types import io -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/vertex_rag_data_service.py b/google/cloud/aiplatform_v1/types/vertex_rag_data_service.py index bb1f3336f0..003164b00c 100644 --- a/google/cloud/aiplatform_v1/types/vertex_rag_data_service.py +++ b/google/cloud/aiplatform_v1/types/vertex_rag_data_service.py @@ -21,7 +21,7 @@ from google.cloud.aiplatform_v1.types import operation from google.cloud.aiplatform_v1.types import vertex_rag_data -from google.rpc import status_pb2 # type: ignore +import google.rpc.status_pb2 as status_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1/types/vizier_service.py b/google/cloud/aiplatform_v1/types/vizier_service.py index 6ad50e4af1..523522e2fd 100644 --- a/google/cloud/aiplatform_v1/types/vizier_service.py +++ b/google/cloud/aiplatform_v1/types/vizier_service.py @@ -21,7 +21,7 @@ from google.cloud.aiplatform_v1.types import operation from google.cloud.aiplatform_v1.types import study as gca_study -from google.protobuf import timestamp_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore __protobuf__ = proto.module( diff --git a/google/cloud/aiplatform_v1beta1/__init__.py b/google/cloud/aiplatform_v1beta1/__init__.py index 759601dc07..cef7b426de 100644 --- a/google/cloud/aiplatform_v1beta1/__init__.py +++ b/google/cloud/aiplatform_v1beta1/__init__.py @@ -292,6 +292,7 @@ from .types.evaluation_service import CometInstance from .types.evaluation_service import CometResult from .types.evaluation_service import CometSpec +from .types.evaluation_service import ComputationBasedMetricSpec from .types.evaluation_service import ContentMap from .types.evaluation_service import CustomOutput from .types.evaluation_service import CustomOutputFormatConfig @@ -318,7 +319,9 @@ from .types.evaluation_service import GroundednessInstance from .types.evaluation_service import GroundednessResult from .types.evaluation_service import GroundednessSpec +from .types.evaluation_service import LLMBasedMetricSpec from .types.evaluation_service import Metric +from .types.evaluation_service import MetricResult from .types.evaluation_service import MetricxInput from .types.evaluation_service import MetricxInstance from .types.evaluation_service import MetricxResult @@ -341,6 +344,7 @@ from .types.evaluation_service import PointwiseMetricInstance from .types.evaluation_service import PointwiseMetricResult from .types.evaluation_service import PointwiseMetricSpec +from .types.evaluation_service import PredefinedMetricSpec from .types.evaluation_service import QuestionAnsweringCorrectnessInput from .types.evaluation_service import QuestionAnsweringCorrectnessInstance from .types.evaluation_service import QuestionAnsweringCorrectnessResult @@ -697,6 +701,8 @@ from .types.io import SharePointSources from .types.io import SlackSource from .types.io import TFRecordDestination +from .types.io import VertexMultimodalDatasetDestination +from .types.io import VertexMultimodalDatasetSource from .types.job_service import CancelBatchPredictionJobRequest from .types.job_service import CancelCustomJobRequest from .types.job_service import CancelDataLabelingJobRequest @@ -1560,6 +1566,7 @@ def _get_version(dependency_name): "CometSpec", "CompleteTrialRequest", "CompletionStats", + "ComputationBasedMetricSpec", "ComputeTokensRequest", "ComputeTokensResponse", "ContainerRegistryDestination", @@ -2003,6 +2010,7 @@ def _get_version(dependency_name): "JiraSource", "JobServiceClient", "JobState", + "LLMBasedMetricSpec", "LargeModelReference", "LineageSubgraph", "ListAnnotationsRequest", @@ -2146,6 +2154,7 @@ def _get_version(dependency_name): "MetadataServiceClient", "MetadataStore", "Metric", + "MetricResult", "MetricxInput", "MetricxInstance", "MetricxResult", @@ -2262,6 +2271,7 @@ def _get_version(dependency_name): "PostStartupScriptConfig", "PreTunedModel", "PrebuiltVoiceConfig", + "PredefinedMetricSpec", "PredefinedSplit", "PredictLongRunningMetadata", "PredictLongRunningResponse", @@ -2664,6 +2674,8 @@ def _get_version(dependency_name): "VeoTuningSpec", "VertexAISearch", "VertexAiSearchConfig", + "VertexMultimodalDatasetDestination", + "VertexMultimodalDatasetSource", "VertexRagDataServiceClient", "VertexRagServiceClient", "VertexRagStore", diff --git a/google/cloud/aiplatform_v1beta1/services/dataset_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/dataset_service/async_client.py index c69e57edea..a3b6824634 100644 --- a/google/cloud/aiplatform_v1beta1/services/dataset_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/dataset_service/async_client.py @@ -45,8 +45,6 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1beta1.services.dataset_service import pagers from google.cloud.aiplatform_v1beta1.types import annotation from google.cloud.aiplatform_v1beta1.types import annotation_spec @@ -63,10 +61,12 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import DatasetServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import DatasetServiceGrpcAsyncIOTransport from .client import DatasetServiceClient @@ -119,6 +119,8 @@ class DatasetServiceAsyncClient: parse_rag_corpus_path = staticmethod(DatasetServiceClient.parse_rag_corpus_path) saved_query_path = staticmethod(DatasetServiceClient.saved_query_path) parse_saved_query_path = staticmethod(DatasetServiceClient.parse_saved_query_path) + template_path = staticmethod(DatasetServiceClient.template_path) + parse_template_path = staticmethod(DatasetServiceClient.parse_template_path) common_billing_account_path = staticmethod( DatasetServiceClient.common_billing_account_path ) @@ -157,7 +159,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): Returns: DatasetServiceAsyncClient: The constructed client. """ - return DatasetServiceClient.from_service_account_info.__func__(DatasetServiceAsyncClient, info, *args, **kwargs) # type: ignore + sa_info_func = DatasetServiceClient.from_service_account_info.__func__ # type: ignore + return sa_info_func(DatasetServiceAsyncClient, info, *args, **kwargs) @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -173,7 +176,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): Returns: DatasetServiceAsyncClient: The constructed client. """ - return DatasetServiceClient.from_service_account_file.__func__(DatasetServiceAsyncClient, filename, *args, **kwargs) # type: ignore + sa_file_func = DatasetServiceClient.from_service_account_file.__func__ # type: ignore + return sa_file_func(DatasetServiceAsyncClient, filename, *args, **kwargs) from_service_account_json = from_service_account_file diff --git a/google/cloud/aiplatform_v1beta1/services/dataset_service/client.py b/google/cloud/aiplatform_v1beta1/services/dataset_service/client.py index fa2c36195d..d1a653e595 100644 --- a/google/cloud/aiplatform_v1beta1/services/dataset_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/dataset_service/client.py @@ -61,8 +61,6 @@ _LOGGER = std_logging.getLogger(__name__) -from google.api_core import operation as gac_operation # type: ignore -from google.api_core import operation_async # type: ignore from google.cloud.aiplatform_v1beta1.services.dataset_service import pagers from google.cloud.aiplatform_v1beta1.types import annotation from google.cloud.aiplatform_v1beta1.types import annotation_spec @@ -79,10 +77,12 @@ 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 google.protobuf import empty_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import struct_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore +import google.api_core.operation as gac_operation # type: ignore +import google.api_core.operation_async as operation_async # type: ignore +import google.protobuf.empty_pb2 as empty_pb2 # type: ignore +import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.struct_pb2 as struct_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from .transports.base import DatasetServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import DatasetServiceGrpcTransport from .transports.grpc_asyncio import DatasetServiceGrpcAsyncIOTransport @@ -469,6 +469,28 @@ def parse_saved_query_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def template_path( + project: str, + location: str, + template: str, + ) -> str: + """Returns a fully-qualified template string.""" + return "projects/{project}/locations/{location}/templates/{template}".format( + project=project, + location=location, + template=template, + ) + + @staticmethod + def parse_template_path(path: str) -> Dict[str, str]: + """Parses a template path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/templates/(?P