diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 9435c23b27..bf7f5a3939 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -24,6 +24,7 @@ branchProtectionRules: - 'Presubmit - Unit Tests Ray 2.33.0' - 'Presubmit - Unit Tests Ray 2.42.0 (Python 3.10)' - 'Presubmit - Unit Tests Ray 2.42.0 (Python 3.11)' + - 'Presubmit - Unit Tests Ray 2.47.1 (Python 3.11)' - 'Presubmit - Unit Tests LangChain (Python 3.9)' - 'Presubmit - Unit Tests LangChain (Python 3.10)' - 'Presubmit - Unit Tests LangChain (Python 3.11)' \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 73d6c7bbfd..ea2a15e049 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.106.0" + ".": "1.107.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 1287fce014..06eefb9bf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Changelog +## [1.107.0](https://github.com/googleapis/python-aiplatform/compare/v1.106.0...v1.107.0) (2025-08-06) + + +### Features + +* A new value `NVIDIA_GB200` is added to enum `AcceleratorType` ([d682fac](https://github.com/googleapis/python-aiplatform/commit/d682fac54b2deb57ed54e4f82eca822a026d32ef)) +* Add `DeploymentStage` for CreateEndpointOperationMetadata and DeployModelOperationMetadata ([d682fac](https://github.com/googleapis/python-aiplatform/commit/d682fac54b2deb57ed54e4f82eca822a026d32ef)) +* Add a FooBar API ([d682fac](https://github.com/googleapis/python-aiplatform/commit/d682fac54b2deb57ed54e4f82eca822a026d32ef)) +* Add autoscaling metrics parameters for PrivateEndpoint class's model deployment API ([58880be](https://github.com/googleapis/python-aiplatform/commit/58880befdd2fdecb2e4c5711f7ffde7c39a335da)) +* Add embedding_metadata to google.cloud.aiplatform.v1.Index ([d682fac](https://github.com/googleapis/python-aiplatform/commit/d682fac54b2deb57ed54e4f82eca822a026d32ef)) +* Add enable_datapoint_upsert_logging to google.cloud.aiplatform.v1.DeployedIndex ([d682fac](https://github.com/googleapis/python-aiplatform/commit/d682fac54b2deb57ed54e4f82eca822a026d32ef)) +* Add exclude_domains for grounding with GoogleSearch and EnterpriseWebSearch ([d682fac](https://github.com/googleapis/python-aiplatform/commit/d682fac54b2deb57ed54e4f82eca822a026d32ef)) +* Add FeatureViewDirectWrite API in v1 ([d682fac](https://github.com/googleapis/python-aiplatform/commit/d682fac54b2deb57ed54e4f82eca822a026d32ef)) +* Add field ReasoningEngineSpec.service_account ([d682fac](https://github.com/googleapis/python-aiplatform/commit/d682fac54b2deb57ed54e4f82eca822a026d32ef)) +* Add ray 2.47 unit tests as required checks ([5445648](https://github.com/googleapis/python-aiplatform/commit/5445648eae51d56ab696ad670b825f47cd4d2c22)) +* Add the VeoTuningSpec ([d682fac](https://github.com/googleapis/python-aiplatform/commit/d682fac54b2deb57ed54e4f82eca822a026d32ef)) +* Added the ability to use the Model Armor service for content sanitization ([d682fac](https://github.com/googleapis/python-aiplatform/commit/d682fac54b2deb57ed54e4f82eca822a026d32ef)) +* Adds DWS and spot VM feature support to custom batch predictions 2.0 ([d682fac](https://github.com/googleapis/python-aiplatform/commit/d682fac54b2deb57ed54e4f82eca822a026d32ef)) +* GenAI SDK client - add zero-shot prompt optimizer: an option to quickly improve provided system instructions or a prompt, or generate new system instructions based on a prompt. ([bc2e8f4](https://github.com/googleapis/python-aiplatform/commit/bc2e8f4d5d74b425dc257cbc9403abaad1649367)) +* GenAI SDK client - Agent Engine Session SDK ([8f28c40](https://github.com/googleapis/python-aiplatform/commit/8f28c4015b9f2caa4a69f691a79524914c9c3258)) +* GenAI SDK client(evals) - add visualization support for rubric-based evaluation workflow ([299c44c](https://github.com/googleapis/python-aiplatform/commit/299c44ce70b4a8969390e6b46c6927eaae1019b0)) +* Online Prediction DeployModel API to support custom metrics based autoscaling ([d682fac](https://github.com/googleapis/python-aiplatform/commit/d682fac54b2deb57ed54e4f82eca822a026d32ef)) +* Remove private preview label from Model Armor protos ([d682fac](https://github.com/googleapis/python-aiplatform/commit/d682fac54b2deb57ed54e4f82eca822a026d32ef)) + + +### Documentation + +* Update comments for rpc BatchCreatePullRequestComments, ResolvePullRequestComments and UnresolvePullRequestComments ([d682fac](https://github.com/googleapis/python-aiplatform/commit/d682fac54b2deb57ed54e4f82eca822a026d32ef)) + ## [1.106.0](https://github.com/googleapis/python-aiplatform/compare/v1.105.0...v1.106.0) (2025-07-30) diff --git a/google/cloud/aiplatform/gapic_version.py b/google/cloud/aiplatform/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/gapic_version.py +++ b/google/cloud/aiplatform/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/models.py b/google/cloud/aiplatform/models.py index 1af30e2d05..49521ad6b3 100644 --- a/google/cloud/aiplatform/models.py +++ b/google/cloud/aiplatform/models.py @@ -4396,6 +4396,9 @@ def deploy( spot: bool = False, system_labels: Optional[Dict[str, str]] = None, required_replica_count: Optional[int] = 0, + autoscaling_target_cpu_utilization: Optional[int] = None, + autoscaling_target_accelerator_duty_cycle: Optional[int] = None, + autoscaling_target_request_count_per_minute: Optional[int] = None, ) -> None: """Deploys a Model to the PrivateEndpoint. @@ -4569,6 +4572,9 @@ def deploy( disable_container_logging=disable_container_logging, system_labels=system_labels, required_replica_count=required_replica_count, + autoscaling_target_cpu_utilization=autoscaling_target_cpu_utilization, + autoscaling_target_accelerator_duty_cycle=autoscaling_target_accelerator_duty_cycle, + autoscaling_target_request_count_per_minute=autoscaling_target_request_count_per_minute, ) def update( @@ -5802,6 +5808,18 @@ def deploy( set, the model deploy/mutate operation will succeed once available_replica_count reaches required_replica_count, and the rest of the replicas will be retried. + autoscaling_target_cpu_utilization (int): + Target CPU Utilization to use for Autoscaling Replicas. + A default value of 60 will be used if not specified. + autoscaling_target_accelerator_duty_cycle (int): + Target Accelerator Duty Cycle. + Must also set accelerator_type and accelerator_count if specified. + A default value of 60 will be used if not specified. + autoscaling_target_request_count_per_minute (int): + Optional. The target number of requests per minute for autoscaling. + If set, the model will be scaled based on the number of requests it receives. + available_replica_count reaches required_replica_count, and the + rest of the replicas will be retried. Returns: endpoint (Union[Endpoint, PrivateEndpoint]): diff --git a/google/cloud/aiplatform/v1/schema/predict/instance/gapic_version.py b/google/cloud/aiplatform/v1/schema/predict/instance/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/v1/schema/predict/instance/gapic_version.py +++ b/google/cloud/aiplatform/v1/schema/predict/instance/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1/schema/predict/instance_v1/gapic_version.py b/google/cloud/aiplatform/v1/schema/predict/instance_v1/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/v1/schema/predict/instance_v1/gapic_version.py +++ b/google/cloud/aiplatform/v1/schema/predict/instance_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1/schema/predict/params/gapic_version.py b/google/cloud/aiplatform/v1/schema/predict/params/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/v1/schema/predict/params/gapic_version.py +++ b/google/cloud/aiplatform/v1/schema/predict/params/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1/schema/predict/params_v1/gapic_version.py b/google/cloud/aiplatform/v1/schema/predict/params_v1/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/v1/schema/predict/params_v1/gapic_version.py +++ b/google/cloud/aiplatform/v1/schema/predict/params_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1/schema/predict/prediction/gapic_version.py b/google/cloud/aiplatform/v1/schema/predict/prediction/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/v1/schema/predict/prediction/gapic_version.py +++ b/google/cloud/aiplatform/v1/schema/predict/prediction/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1/schema/predict/prediction_v1/gapic_version.py b/google/cloud/aiplatform/v1/schema/predict/prediction_v1/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/v1/schema/predict/prediction_v1/gapic_version.py +++ b/google/cloud/aiplatform/v1/schema/predict/prediction_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1/schema/trainingjob/definition/gapic_version.py b/google/cloud/aiplatform/v1/schema/trainingjob/definition/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/v1/schema/trainingjob/definition/gapic_version.py +++ b/google/cloud/aiplatform/v1/schema/trainingjob/definition/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/gapic_version.py b/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/gapic_version.py +++ b/google/cloud/aiplatform/v1/schema/trainingjob/definition_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1beta1/schema/predict/instance/gapic_version.py b/google/cloud/aiplatform/v1beta1/schema/predict/instance/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/v1beta1/schema/predict/instance/gapic_version.py +++ b/google/cloud/aiplatform/v1beta1/schema/predict/instance/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1beta1/schema/predict/instance_v1beta1/gapic_version.py b/google/cloud/aiplatform/v1beta1/schema/predict/instance_v1beta1/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/v1beta1/schema/predict/instance_v1beta1/gapic_version.py +++ b/google/cloud/aiplatform/v1beta1/schema/predict/instance_v1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1beta1/schema/predict/params/gapic_version.py b/google/cloud/aiplatform/v1beta1/schema/predict/params/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/v1beta1/schema/predict/params/gapic_version.py +++ b/google/cloud/aiplatform/v1beta1/schema/predict/params/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1beta1/schema/predict/params_v1beta1/gapic_version.py b/google/cloud/aiplatform/v1beta1/schema/predict/params_v1beta1/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/v1beta1/schema/predict/params_v1beta1/gapic_version.py +++ b/google/cloud/aiplatform/v1beta1/schema/predict/params_v1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1beta1/schema/predict/prediction/gapic_version.py b/google/cloud/aiplatform/v1beta1/schema/predict/prediction/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/v1beta1/schema/predict/prediction/gapic_version.py +++ b/google/cloud/aiplatform/v1beta1/schema/predict/prediction/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/gapic_version.py b/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/gapic_version.py +++ b/google/cloud/aiplatform/v1beta1/schema/predict/prediction_v1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/gapic_version.py b/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/gapic_version.py +++ b/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition_v1beta1/gapic_version.py b/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition_v1beta1/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition_v1beta1/gapic_version.py +++ b/google/cloud/aiplatform/v1beta1/schema/trainingjob/definition_v1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} diff --git a/google/cloud/aiplatform/version.py b/google/cloud/aiplatform/version.py index 6500505a2a..a82ab3f92d 100644 --- a/google/cloud/aiplatform/version.py +++ b/google/cloud/aiplatform/version.py @@ -15,4 +15,4 @@ # limitations under the License. # -__version__ = "1.106.0" +__version__ = "1.107.0" diff --git a/google/cloud/aiplatform_v1/__init__.py b/google/cloud/aiplatform_v1/__init__.py index 6f8b197242..5f3c7dc347 100644 --- a/google/cloud/aiplatform_v1/__init__.py +++ b/google/cloud/aiplatform_v1/__init__.py @@ -119,6 +119,7 @@ from .types.content import GroundingSupport from .types.content import LogprobsResult from .types.content import ModalityTokenCount +from .types.content import ModelArmorConfig from .types.content import Part from .types.content import RetrievalMetadata from .types.content import SafetyRating @@ -198,6 +199,7 @@ UpdateDeploymentResourcePoolOperationMetadata, ) from .types.deployment_resource_pool_service import UpdateDeploymentResourcePoolRequest +from .types.deployment_stage import DeploymentStage from .types.encryption_spec import EncryptionSpec from .types.endpoint import ClientConnectionConfig from .types.endpoint import DeployedModel @@ -393,6 +395,8 @@ from .types.feature_online_store_admin_service import UpdateFeatureViewOperationMetadata from .types.feature_online_store_admin_service import UpdateFeatureViewRequest from .types.feature_online_store_service import FeatureViewDataKey +from .types.feature_online_store_service import FeatureViewDirectWriteRequest +from .types.feature_online_store_service import FeatureViewDirectWriteResponse from .types.feature_online_store_service import FetchFeatureValuesRequest from .types.feature_online_store_service import FetchFeatureValuesResponse from .types.feature_online_store_service import NearestNeighborQuery @@ -1319,6 +1323,7 @@ "DeployedModelRef", "DeploymentResourcePool", "DeploymentResourcePoolServiceClient", + "DeploymentStage", "DestinationFeatureSetting", "DirectPredictRequest", "DirectPredictResponse", @@ -1392,6 +1397,8 @@ "FeatureView", "FeatureViewDataFormat", "FeatureViewDataKey", + "FeatureViewDirectWriteRequest", + "FeatureViewDirectWriteResponse", "FeatureViewSync", "Featurestore", "FeaturestoreMonitoringConfig", @@ -1644,6 +1651,7 @@ "Modality", "ModalityTokenCount", "Model", + "ModelArmorConfig", "ModelContainerSpec", "ModelDeploymentMonitoringBigQueryTable", "ModelDeploymentMonitoringJob", diff --git a/google/cloud/aiplatform_v1/gapic_metadata.json b/google/cloud/aiplatform_v1/gapic_metadata.json index 4c5d095878..7b59587a9d 100644 --- a/google/cloud/aiplatform_v1/gapic_metadata.json +++ b/google/cloud/aiplatform_v1/gapic_metadata.json @@ -825,6 +825,11 @@ "grpc": { "libraryClient": "FeatureOnlineStoreServiceClient", "rpcs": { + "FeatureViewDirectWrite": { + "methods": [ + "feature_view_direct_write" + ] + }, "FetchFeatureValues": { "methods": [ "fetch_feature_values" @@ -840,6 +845,11 @@ "grpc-async": { "libraryClient": "FeatureOnlineStoreServiceAsyncClient", "rpcs": { + "FeatureViewDirectWrite": { + "methods": [ + "feature_view_direct_write" + ] + }, "FetchFeatureValues": { "methods": [ "fetch_feature_values" @@ -855,6 +865,11 @@ "rest": { "libraryClient": "FeatureOnlineStoreServiceClient", "rpcs": { + "FeatureViewDirectWrite": { + "methods": [ + "feature_view_direct_write" + ] + }, "FetchFeatureValues": { "methods": [ "fetch_feature_values" diff --git a/google/cloud/aiplatform_v1/gapic_version.py b/google/cloud/aiplatform_v1/gapic_version.py index 0540202ce4..e78c276de7 100644 --- a/google/cloud/aiplatform_v1/gapic_version.py +++ b/google/cloud/aiplatform_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.106.0" # {x-release-please-version} +__version__ = "1.107.0" # {x-release-please-version} 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 0c80bc2f29..7841ada5b0 100644 --- a/google/cloud/aiplatform_v1/services/endpoint_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/endpoint_service/async_client.py @@ -1460,8 +1460,9 @@ async def mutate_deployed_model( ) -> operation_async.AsyncOperation: r"""Updates an existing deployed model. Updatable fields include ``min_replica_count``, ``max_replica_count``, - ``autoscaling_metric_specs``, ``disable_container_logging`` (v1 - only), and ``enable_container_logging`` (v1beta1 only). + ``required_replica_count``, ``autoscaling_metric_specs``, + ``disable_container_logging`` (v1 only), and + ``enable_container_logging`` (v1beta1 only). .. code-block:: python @@ -1521,6 +1522,8 @@ async def sample_mutate_deployed_model(): [DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources] or [AutomaticResources][google.cloud.aiplatform.v1.AutomaticResources] + - ``required_replica_count`` in + [DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources] - [autoscaling_metric_specs][google.cloud.aiplatform.v1.DedicatedResources.autoscaling_metric_specs] - ``disable_container_logging`` (v1 only) - ``enable_container_logging`` (v1beta1 only) diff --git a/google/cloud/aiplatform_v1/services/endpoint_service/client.py b/google/cloud/aiplatform_v1/services/endpoint_service/client.py index 84dd2944fd..687f55e2f5 100644 --- a/google/cloud/aiplatform_v1/services/endpoint_service/client.py +++ b/google/cloud/aiplatform_v1/services/endpoint_service/client.py @@ -1986,8 +1986,9 @@ def mutate_deployed_model( ) -> gac_operation.Operation: r"""Updates an existing deployed model. Updatable fields include ``min_replica_count``, ``max_replica_count``, - ``autoscaling_metric_specs``, ``disable_container_logging`` (v1 - only), and ``enable_container_logging`` (v1beta1 only). + ``required_replica_count``, ``autoscaling_metric_specs``, + ``disable_container_logging`` (v1 only), and + ``enable_container_logging`` (v1beta1 only). .. code-block:: python @@ -2047,6 +2048,8 @@ def sample_mutate_deployed_model(): [DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources] or [AutomaticResources][google.cloud.aiplatform.v1.AutomaticResources] + - ``required_replica_count`` in + [DedicatedResources][google.cloud.aiplatform.v1.DedicatedResources] - [autoscaling_metric_specs][google.cloud.aiplatform.v1.DedicatedResources.autoscaling_metric_specs] - ``disable_container_logging`` (v1 only) - ``enable_container_logging`` (v1beta1 only) diff --git a/google/cloud/aiplatform_v1/services/endpoint_service/transports/grpc.py b/google/cloud/aiplatform_v1/services/endpoint_service/transports/grpc.py index cd689931ff..bda1059494 100644 --- a/google/cloud/aiplatform_v1/services/endpoint_service/transports/grpc.py +++ b/google/cloud/aiplatform_v1/services/endpoint_service/transports/grpc.py @@ -571,8 +571,9 @@ def mutate_deployed_model( Updates an existing deployed model. Updatable fields include ``min_replica_count``, ``max_replica_count``, - ``autoscaling_metric_specs``, ``disable_container_logging`` (v1 - only), and ``enable_container_logging`` (v1beta1 only). + ``required_replica_count``, ``autoscaling_metric_specs``, + ``disable_container_logging`` (v1 only), and + ``enable_container_logging`` (v1beta1 only). Returns: Callable[[~.MutateDeployedModelRequest], diff --git a/google/cloud/aiplatform_v1/services/endpoint_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1/services/endpoint_service/transports/grpc_asyncio.py index d361e45d63..d0e292e983 100644 --- a/google/cloud/aiplatform_v1/services/endpoint_service/transports/grpc_asyncio.py +++ b/google/cloud/aiplatform_v1/services/endpoint_service/transports/grpc_asyncio.py @@ -592,8 +592,9 @@ def mutate_deployed_model( Updates an existing deployed model. Updatable fields include ``min_replica_count``, ``max_replica_count``, - ``autoscaling_metric_specs``, ``disable_container_logging`` (v1 - only), and ``enable_container_logging`` (v1beta1 only). + ``required_replica_count``, ``autoscaling_metric_specs``, + ``disable_container_logging`` (v1 only), and + ``enable_container_logging`` (v1beta1 only). Returns: Callable[[~.MutateDeployedModelRequest], 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 bd63b3afee..c2afee5444 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 @@ -23,6 +23,9 @@ MutableMapping, MutableSequence, Optional, + AsyncIterable, + Awaitable, + AsyncIterator, Sequence, Tuple, Type, @@ -51,6 +54,7 @@ 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.rpc import status_pb2 # type: ignore from .transports.base import FeatureOnlineStoreServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import FeatureOnlineStoreServiceGrpcAsyncIOTransport from .client import FeatureOnlineStoreServiceClient @@ -533,6 +537,102 @@ async def sample_search_nearest_entities(): # Done; return the response. return response + def feature_view_direct_write( + self, + requests: Optional[ + AsyncIterator[feature_online_store_service.FeatureViewDirectWriteRequest] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> Awaitable[ + AsyncIterable[feature_online_store_service.FeatureViewDirectWriteResponse] + ]: + r"""Bidirectional streaming RPC to directly write to + feature values in a feature view. Requests may not have + a one-to-one mapping to responses and responses may be + returned out-of-order to reduce latency. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1 + + async def sample_feature_view_direct_write(): + # Create a client + client = aiplatform_v1.FeatureOnlineStoreServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1.FeatureViewDirectWriteRequest( + ) + + # This method expects an iterator which contains + # 'aiplatform_v1.FeatureViewDirectWriteRequest' objects + # Here we create a generator that yields a single `request` for + # demonstrative purposes. + requests = [request] + + def request_generator(): + for request in requests: + yield request + + # Make the request + stream = await client.feature_view_direct_write(requests=request_generator()) + + # Handle the response + async for response in stream: + print(response) + + Args: + requests (AsyncIterator[`google.cloud.aiplatform_v1.types.FeatureViewDirectWriteRequest`]): + The request object AsyncIterator. Request message for + [FeatureOnlineStoreService.FeatureViewDirectWrite][google.cloud.aiplatform.v1.FeatureOnlineStoreService.FeatureViewDirectWrite]. + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + AsyncIterable[google.cloud.aiplatform_v1.types.FeatureViewDirectWriteResponse]: + Response message for + [FeatureOnlineStoreService.FeatureViewDirectWrite][google.cloud.aiplatform.v1.FeatureOnlineStoreService.FeatureViewDirectWrite]. + + """ + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._client._transport._wrapped_methods[ + self._client._transport.feature_view_direct_write + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + (gapic_v1.routing_header.to_grpc_metadata(()),) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = rpc( + requests, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + async def list_operations( self, request: Optional[operations_pb2.ListOperationsRequest] = None, diff --git a/google/cloud/aiplatform_v1/services/feature_online_store_service/client.py b/google/cloud/aiplatform_v1/services/feature_online_store_service/client.py index 9dc110dc8c..dcfd2cd10b 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 @@ -26,6 +26,8 @@ MutableMapping, MutableSequence, Optional, + Iterable, + Iterator, Sequence, Tuple, Type, @@ -67,6 +69,7 @@ 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.rpc import status_pb2 # type: ignore from .transports.base import FeatureOnlineStoreServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import FeatureOnlineStoreServiceGrpcTransport from .transports.grpc_asyncio import FeatureOnlineStoreServiceGrpcAsyncIOTransport @@ -988,6 +991,100 @@ def sample_search_nearest_entities(): # Done; return the response. return response + def feature_view_direct_write( + self, + requests: Optional[ + Iterator[feature_online_store_service.FeatureViewDirectWriteRequest] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> Iterable[feature_online_store_service.FeatureViewDirectWriteResponse]: + r"""Bidirectional streaming RPC to directly write to + feature values in a feature view. Requests may not have + a one-to-one mapping to responses and responses may be + returned out-of-order to reduce latency. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import aiplatform_v1 + + def sample_feature_view_direct_write(): + # Create a client + client = aiplatform_v1.FeatureOnlineStoreServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1.FeatureViewDirectWriteRequest( + ) + + # This method expects an iterator which contains + # 'aiplatform_v1.FeatureViewDirectWriteRequest' objects + # Here we create a generator that yields a single `request` for + # demonstrative purposes. + requests = [request] + + def request_generator(): + for request in requests: + yield request + + # Make the request + stream = client.feature_view_direct_write(requests=request_generator()) + + # Handle the response + for response in stream: + print(response) + + Args: + requests (Iterator[google.cloud.aiplatform_v1.types.FeatureViewDirectWriteRequest]): + The request object iterator. Request message for + [FeatureOnlineStoreService.FeatureViewDirectWrite][google.cloud.aiplatform.v1.FeatureOnlineStoreService.FeatureViewDirectWrite]. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + Iterable[google.cloud.aiplatform_v1.types.FeatureViewDirectWriteResponse]: + Response message for + [FeatureOnlineStoreService.FeatureViewDirectWrite][google.cloud.aiplatform.v1.FeatureOnlineStoreService.FeatureViewDirectWrite]. + + """ + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.feature_view_direct_write + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + (gapic_v1.routing_header.to_grpc_metadata(()),) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + requests, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + def __enter__(self) -> "FeatureOnlineStoreServiceClient": return self 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 9978b5d261..f988549423 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 @@ -147,6 +147,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.feature_view_direct_write: gapic_v1.method.wrap_method( + self.feature_view_direct_write, + default_timeout=None, + client_info=client_info, + ), self.get_location: gapic_v1.method.wrap_method( self.get_location, default_timeout=None, @@ -232,6 +237,18 @@ def search_nearest_entities( ]: raise NotImplementedError() + @property + def feature_view_direct_write( + self, + ) -> Callable[ + [feature_online_store_service.FeatureViewDirectWriteRequest], + Union[ + feature_online_store_service.FeatureViewDirectWriteResponse, + Awaitable[feature_online_store_service.FeatureViewDirectWriteResponse], + ], + ]: + raise NotImplementedError() + @property def list_operations( self, diff --git a/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/grpc.py b/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/grpc.py index ea1fef89e9..3f78e087eb 100644 --- a/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/grpc.py +++ b/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/grpc.py @@ -385,6 +385,40 @@ def search_nearest_entities( ) return self._stubs["search_nearest_entities"] + @property + def feature_view_direct_write( + self, + ) -> Callable[ + [feature_online_store_service.FeatureViewDirectWriteRequest], + feature_online_store_service.FeatureViewDirectWriteResponse, + ]: + r"""Return a callable for the feature view direct write method over gRPC. + + Bidirectional streaming RPC to directly write to + feature values in a feature view. Requests may not have + a one-to-one mapping to responses and responses may be + returned out-of-order to reduce latency. + + Returns: + Callable[[~.FeatureViewDirectWriteRequest], + ~.FeatureViewDirectWriteResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "feature_view_direct_write" not in self._stubs: + self._stubs[ + "feature_view_direct_write" + ] = self._logged_channel.stream_stream( + "/google.cloud.aiplatform.v1.FeatureOnlineStoreService/FeatureViewDirectWrite", + request_serializer=feature_online_store_service.FeatureViewDirectWriteRequest.serialize, + response_deserializer=feature_online_store_service.FeatureViewDirectWriteResponse.deserialize, + ) + return self._stubs["feature_view_direct_write"] + def close(self): self._logged_channel.close() diff --git a/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/grpc_asyncio.py index 4ed531ad5a..cf00a43b3b 100644 --- a/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/grpc_asyncio.py +++ b/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/grpc_asyncio.py @@ -393,6 +393,40 @@ def search_nearest_entities( ) return self._stubs["search_nearest_entities"] + @property + def feature_view_direct_write( + self, + ) -> Callable[ + [feature_online_store_service.FeatureViewDirectWriteRequest], + Awaitable[feature_online_store_service.FeatureViewDirectWriteResponse], + ]: + r"""Return a callable for the feature view direct write method over gRPC. + + Bidirectional streaming RPC to directly write to + feature values in a feature view. Requests may not have + a one-to-one mapping to responses and responses may be + returned out-of-order to reduce latency. + + Returns: + Callable[[~.FeatureViewDirectWriteRequest], + Awaitable[~.FeatureViewDirectWriteResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "feature_view_direct_write" not in self._stubs: + self._stubs[ + "feature_view_direct_write" + ] = self._logged_channel.stream_stream( + "/google.cloud.aiplatform.v1.FeatureOnlineStoreService/FeatureViewDirectWrite", + request_serializer=feature_online_store_service.FeatureViewDirectWriteRequest.serialize, + response_deserializer=feature_online_store_service.FeatureViewDirectWriteResponse.deserialize, + ) + return self._stubs["feature_view_direct_write"] + def _prep_wrapped_messages(self, client_info): """Precompute the wrapped methods, overriding the base class method to use async wrappers.""" self._wrapped_methods = { @@ -406,6 +440,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.feature_view_direct_write: self._wrap_method( + self.feature_view_direct_write, + default_timeout=None, + client_info=client_info, + ), self.get_location: self._wrap_method( self.get_location, default_timeout=None, diff --git a/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/rest.py b/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/rest.py index 08e1b1a772..aed52824f2 100644 --- a/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/rest.py +++ b/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/rest.py @@ -540,6 +540,25 @@ def __init__( self._interceptor = interceptor or FeatureOnlineStoreServiceRestInterceptor() self._prep_wrapped_messages(client_info) + class _FeatureViewDirectWrite( + _BaseFeatureOnlineStoreServiceRestTransport._BaseFeatureViewDirectWrite, + FeatureOnlineStoreServiceRestStub, + ): + def __hash__(self): + return hash("FeatureOnlineStoreServiceRestTransport.FeatureViewDirectWrite") + + def __call__( + self, + request: feature_online_store_service.FeatureViewDirectWriteRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> rest_streaming.ResponseIterator: + raise NotImplementedError( + "Method FeatureViewDirectWrite is not available over REST transport" + ) + class _FetchFeatureValues( _BaseFeatureOnlineStoreServiceRestTransport._BaseFetchFeatureValues, FeatureOnlineStoreServiceRestStub, @@ -864,6 +883,17 @@ def __call__( ) return resp + @property + def feature_view_direct_write( + self, + ) -> Callable[ + [feature_online_store_service.FeatureViewDirectWriteRequest], + feature_online_store_service.FeatureViewDirectWriteResponse, + ]: + # The return type is fine, but mypy isn't sophisticated enough to determine what's going on here. + # In C++ this would require a dynamic_cast + return self._FeatureViewDirectWrite(self._session, self._host, self._interceptor) # type: ignore + @property def fetch_feature_values( self, diff --git a/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/rest_asyncio.py b/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/rest_asyncio.py index 02772e06e2..e9df507e65 100644 --- a/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/rest_asyncio.py +++ b/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/rest_asyncio.py @@ -550,6 +550,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.feature_view_direct_write: self._wrap_method( + self.feature_view_direct_write, + default_timeout=None, + client_info=client_info, + ), self.get_location: self._wrap_method( self.get_location, default_timeout=None, @@ -607,6 +612,27 @@ def _wrap_method(self, func, *args, **kwargs): kwargs["kind"] = self.kind return gapic_v1.method_async.wrap_method(func, *args, **kwargs) + class _FeatureViewDirectWrite( + _BaseFeatureOnlineStoreServiceRestTransport._BaseFeatureViewDirectWrite, + AsyncFeatureOnlineStoreServiceRestStub, + ): + def __hash__(self): + return hash( + "AsyncFeatureOnlineStoreServiceRestTransport.FeatureViewDirectWrite" + ) + + async def __call__( + self, + request: feature_online_store_service.FeatureViewDirectWriteRequest, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Optional[float] = None, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> rest_streaming_async.AsyncResponseIterator: + raise NotImplementedError( + "Method FeatureViewDirectWrite is not available over REST transport" + ) + class _FetchFeatureValues( _BaseFeatureOnlineStoreServiceRestTransport._BaseFetchFeatureValues, AsyncFeatureOnlineStoreServiceRestStub, @@ -950,6 +976,15 @@ async def __call__( return resp + @property + def feature_view_direct_write( + self, + ) -> Callable[ + [feature_online_store_service.FeatureViewDirectWriteRequest], + feature_online_store_service.FeatureViewDirectWriteResponse, + ]: + return self._FeatureViewDirectWrite(self._session, self._host, self._interceptor) # type: ignore + @property def fetch_feature_values( self, diff --git a/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/rest_base.py b/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/rest_base.py index 81075f0bf9..d13a0cb99f 100644 --- a/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/rest_base.py +++ b/google/cloud/aiplatform_v1/services/feature_online_store_service/transports/rest_base.py @@ -93,6 +93,10 @@ def __init__( api_audience=api_audience, ) + class _BaseFeatureViewDirectWrite: + def __hash__(self): # pragma: NO COVER + return NotImplementedError("__hash__ must be implemented.") + class _BaseFetchFeatureValues: def __hash__(self): # pragma: NO COVER return NotImplementedError("__hash__ must be implemented.") diff --git a/google/cloud/aiplatform_v1/services/migration_service/client.py b/google/cloud/aiplatform_v1/services/migration_service/client.py index 735b4d1655..aba8658b32 100644 --- a/google/cloud/aiplatform_v1/services/migration_service/client.py +++ b/google/cloud/aiplatform_v1/services/migration_service/client.py @@ -265,40 +265,40 @@ def parse_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/prediction_service/async_client.py b/google/cloud/aiplatform_v1/services/prediction_service/async_client.py index a536d88b46..c073417a1a 100644 --- a/google/cloud/aiplatform_v1/services/prediction_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/prediction_service/async_client.py @@ -96,6 +96,8 @@ class PredictionServiceAsyncClient: parse_model_path = staticmethod(PredictionServiceClient.parse_model_path) rag_corpus_path = staticmethod(PredictionServiceClient.rag_corpus_path) parse_rag_corpus_path = staticmethod(PredictionServiceClient.parse_rag_corpus_path) + template_path = staticmethod(PredictionServiceClient.template_path) + parse_template_path = staticmethod(PredictionServiceClient.parse_template_path) common_billing_account_path = staticmethod( PredictionServiceClient.common_billing_account_path ) diff --git a/google/cloud/aiplatform_v1/services/prediction_service/client.py b/google/cloud/aiplatform_v1/services/prediction_service/client.py index e6429efc6a..79955703ee 100644 --- a/google/cloud/aiplatform_v1/services/prediction_service/client.py +++ b/google/cloud/aiplatform_v1/services/prediction_service/client.py @@ -309,6 +309,28 @@ def parse_rag_corpus_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