Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Feb 6, 2025
1 parent b1e7db5 commit 32e25ea
Show file tree
Hide file tree
Showing 2,833 changed files with 11,910 additions and 2,502,084 deletions.
6 changes: 6 additions & 0 deletions google/cloud/aiplatform_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,12 @@
from .types.model_service import ListModelEvaluationsResponse
from .types.model_service import ListModelsRequest
from .types.model_service import ListModelsResponse
from .types.model_service import ListModelVersionCheckpointsRequest
from .types.model_service import ListModelVersionCheckpointsResponse
from .types.model_service import ListModelVersionsRequest
from .types.model_service import ListModelVersionsResponse
from .types.model_service import MergeVersionAliasesRequest
from .types.model_service import ModelVersionCheckpoint
from .types.model_service import UpdateExplanationDatasetOperationMetadata
from .types.model_service import UpdateExplanationDatasetRequest
from .types.model_service import UpdateExplanationDatasetResponse
Expand Down Expand Up @@ -1534,6 +1537,8 @@
"ListModelEvaluationSlicesResponse",
"ListModelEvaluationsRequest",
"ListModelEvaluationsResponse",
"ListModelVersionCheckpointsRequest",
"ListModelVersionCheckpointsResponse",
"ListModelVersionsRequest",
"ListModelVersionsResponse",
"ListModelsRequest",
Expand Down Expand Up @@ -1620,6 +1625,7 @@
"ModelMonitoringStatsAnomalies",
"ModelServiceClient",
"ModelSourceInfo",
"ModelVersionCheckpoint",
"MutateDeployedIndexOperationMetadata",
"MutateDeployedIndexRequest",
"MutateDeployedIndexResponse",
Expand Down
15 changes: 15 additions & 0 deletions google/cloud/aiplatform_v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3191,6 +3191,11 @@
"list_model_evaluations"
]
},
"ListModelVersionCheckpoints": {
"methods": [
"list_model_version_checkpoints"
]
},
"ListModelVersions": {
"methods": [
"list_model_versions"
Expand Down Expand Up @@ -3286,6 +3291,11 @@
"list_model_evaluations"
]
},
"ListModelVersionCheckpoints": {
"methods": [
"list_model_version_checkpoints"
]
},
"ListModelVersions": {
"methods": [
"list_model_versions"
Expand Down Expand Up @@ -3381,6 +3391,11 @@
"list_model_evaluations"
]
},
"ListModelVersionCheckpoints": {
"methods": [
"list_model_version_checkpoints"
]
},
"ListModelVersions": {
"methods": [
"list_model_versions"
Expand Down
132 changes: 132 additions & 0 deletions google/cloud/aiplatform_v1/services/model_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,138 @@ async def sample_list_model_versions():
# Done; return the response.
return response

async def list_model_version_checkpoints(
self,
request: Optional[
Union[model_service.ListModelVersionCheckpointsRequest, dict]
] = None,
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> pagers.ListModelVersionCheckpointsAsyncPager:
r"""Lists checkpoints of the specified model version.
.. 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_list_model_version_checkpoints():
# Create a client
client = aiplatform_v1.ModelServiceAsyncClient()
# Initialize request argument(s)
request = aiplatform_v1.ListModelVersionCheckpointsRequest(
name="name_value",
)
# Make the request
page_result = client.list_model_version_checkpoints(request=request)
# Handle the response
async for response in page_result:
print(response)
Args:
request (Optional[Union[google.cloud.aiplatform_v1.types.ListModelVersionCheckpointsRequest, dict]]):
The request object. Request message for
[ModelService.ListModelVersionCheckpoints][google.cloud.aiplatform.v1.ModelService.ListModelVersionCheckpoints].
name (:class:`str`):
Required. The name of the model version to list
checkpoints for.
``projects/{project}/locations/{location}/models/{model}@{version}``
Example:
``projects/{project}/locations/{location}/models/{model}@2``
or
``projects/{project}/locations/{location}/models/{model}@golden``
If no version ID or alias is specified, the latest
version will be used.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
Returns:
google.cloud.aiplatform_v1.services.model_service.pagers.ListModelVersionCheckpointsAsyncPager:
Response message for
[ModelService.ListModelVersionCheckpoints][google.cloud.aiplatform.v1.ModelService.ListModelVersionCheckpoints]
Iterating over this object will yield results and
resolve additional pages automatically.
"""
# Create or coerce a protobuf request object.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

# - Use the request object if provided (there's no risk of modifying the input as
# there are no flattened fields), or create one.
if not isinstance(request, model_service.ListModelVersionCheckpointsRequest):
request = model_service.ListModelVersionCheckpointsRequest(request)

# If we have keyword arguments corresponding to fields on the
# request, apply these.
if name is not None:
request.name = name

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._client._transport._wrapped_methods[
self._client._transport.list_model_version_checkpoints
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)

# Validate the universe domain.
self._client._validate_universe_domain()

# Send the request.
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# This method is paged; wrap the response in a pager, which provides
# an `__aiter__` convenience method.
response = pagers.ListModelVersionCheckpointsAsyncPager(
method=rpc,
request=request,
response=response,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response

async def update_model(
self,
request: Optional[Union[model_service.UpdateModelRequest, dict]] = None,
Expand Down
131 changes: 131 additions & 0 deletions google/cloud/aiplatform_v1/services/model_service/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,137 @@ def sample_list_model_versions():
# Done; return the response.
return response

def list_model_version_checkpoints(
self,
request: Optional[
Union[model_service.ListModelVersionCheckpointsRequest, dict]
] = None,
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
) -> pagers.ListModelVersionCheckpointsPager:
r"""Lists checkpoints of the specified model version.
.. 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_list_model_version_checkpoints():
# Create a client
client = aiplatform_v1.ModelServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.ListModelVersionCheckpointsRequest(
name="name_value",
)
# Make the request
page_result = client.list_model_version_checkpoints(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.aiplatform_v1.types.ListModelVersionCheckpointsRequest, dict]):
The request object. Request message for
[ModelService.ListModelVersionCheckpoints][google.cloud.aiplatform.v1.ModelService.ListModelVersionCheckpoints].
name (str):
Required. The name of the model version to list
checkpoints for.
``projects/{project}/locations/{location}/models/{model}@{version}``
Example:
``projects/{project}/locations/{location}/models/{model}@2``
or
``projects/{project}/locations/{location}/models/{model}@golden``
If no version ID or alias is specified, the latest
version will be used.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
sent along with the request as metadata. Normally, each value must be of type `str`,
but for metadata keys ending with the suffix `-bin`, the corresponding values must
be of type `bytes`.
Returns:
google.cloud.aiplatform_v1.services.model_service.pagers.ListModelVersionCheckpointsPager:
Response message for
[ModelService.ListModelVersionCheckpoints][google.cloud.aiplatform.v1.ModelService.ListModelVersionCheckpoints]
Iterating over this object will yield results and
resolve additional pages automatically.
"""
# Create or coerce a protobuf request object.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

# - Use the request object if provided (there's no risk of modifying the input as
# there are no flattened fields), or create one.
if not isinstance(request, model_service.ListModelVersionCheckpointsRequest):
request = model_service.ListModelVersionCheckpointsRequest(request)
# If we have keyword arguments corresponding to fields on the
# request, apply these.
if name is not None:
request.name = name

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[
self._transport.list_model_version_checkpoints
]

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
)

# Validate the universe domain.
self._validate_universe_domain()

# Send the request.
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# This method is paged; wrap the response in a pager, which provides
# an `__iter__` convenience method.
response = pagers.ListModelVersionCheckpointsPager(
method=rpc,
request=request,
response=response,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response

def update_model(
self,
request: Optional[Union[model_service.UpdateModelRequest, dict]] = None,
Expand Down
Loading

0 comments on commit 32e25ea

Please sign in to comment.