Skip to content

Commit 61d7cf5

Browse files
1 parent 1f1e8a4 commit 61d7cf5

File tree

1,659 files changed

+1443
-676490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,659 files changed

+1443
-676490
lines changed

google/cloud/aiplatform_v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
from .types.dataset_service import CreateDatasetRequest
8484
from .types.dataset_service import DataItemView
8585
from .types.dataset_service import DeleteDatasetRequest
86+
from .types.dataset_service import DeleteSavedQueryRequest
8687
from .types.dataset_service import ExportDataOperationMetadata
8788
from .types.dataset_service import ExportDataRequest
8889
from .types.dataset_service import ExportDataResponse
@@ -718,6 +719,7 @@
718719
"DeleteNasJobRequest",
719720
"DeleteOperationMetadata",
720721
"DeletePipelineJobRequest",
722+
"DeleteSavedQueryRequest",
721723
"DeleteSpecialistPoolRequest",
722724
"DeleteStudyRequest",
723725
"DeleteTensorboardExperimentRequest",

google/cloud/aiplatform_v1/gapic_metadata.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
"delete_dataset"
2121
]
2222
},
23+
"DeleteSavedQuery": {
24+
"methods": [
25+
"delete_saved_query"
26+
]
27+
},
2328
"ExportData": {
2429
"methods": [
2530
"export_data"
@@ -85,6 +90,11 @@
8590
"delete_dataset"
8691
]
8792
},
93+
"DeleteSavedQuery": {
94+
"methods": [
95+
"delete_saved_query"
96+
]
97+
},
8898
"ExportData": {
8999
"methods": [
90100
"export_data"

google/cloud/aiplatform_v1/services/dataset_service/async_client.py

Lines changed: 127 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868

6969

7070
class DatasetServiceAsyncClient:
71-
"""The service that handles the CRUD of Vertex AI Dataset and
72-
its child resources.
71+
"""The service that manages Vertex AI Dataset and its child
72+
resources.
7373
"""
7474

7575
_client: DatasetServiceClient
@@ -1430,6 +1430,131 @@ async def sample_list_saved_queries():
14301430
# Done; return the response.
14311431
return response
14321432

1433+
async def delete_saved_query(
1434+
self,
1435+
request: Optional[Union[dataset_service.DeleteSavedQueryRequest, dict]] = None,
1436+
*,
1437+
name: Optional[str] = None,
1438+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1439+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1440+
metadata: Sequence[Tuple[str, str]] = (),
1441+
) -> operation_async.AsyncOperation:
1442+
r"""Deletes a SavedQuery.
1443+
1444+
.. code-block:: python
1445+
1446+
# This snippet has been automatically generated and should be regarded as a
1447+
# code template only.
1448+
# It will require modifications to work:
1449+
# - It may require correct/in-range values for request initialization.
1450+
# - It may require specifying regional endpoints when creating the service
1451+
# client as shown in:
1452+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
1453+
from google.cloud import aiplatform_v1
1454+
1455+
async def sample_delete_saved_query():
1456+
# Create a client
1457+
client = aiplatform_v1.DatasetServiceAsyncClient()
1458+
1459+
# Initialize request argument(s)
1460+
request = aiplatform_v1.DeleteSavedQueryRequest(
1461+
name="name_value",
1462+
)
1463+
1464+
# Make the request
1465+
operation = client.delete_saved_query(request=request)
1466+
1467+
print("Waiting for operation to complete...")
1468+
1469+
response = (await operation).result()
1470+
1471+
# Handle the response
1472+
print(response)
1473+
1474+
Args:
1475+
request (Optional[Union[google.cloud.aiplatform_v1.types.DeleteSavedQueryRequest, dict]]):
1476+
The request object. Request message for
1477+
[DatasetService.DeleteSavedQuery][google.cloud.aiplatform.v1.DatasetService.DeleteSavedQuery].
1478+
name (:class:`str`):
1479+
Required. The resource name of the SavedQuery to delete.
1480+
Format:
1481+
``projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}``
1482+
1483+
This corresponds to the ``name`` field
1484+
on the ``request`` instance; if ``request`` is provided, this
1485+
should not be set.
1486+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1487+
should be retried.
1488+
timeout (float): The timeout for this request.
1489+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1490+
sent along with the request as metadata.
1491+
1492+
Returns:
1493+
google.api_core.operation_async.AsyncOperation:
1494+
An object representing a long-running operation.
1495+
1496+
The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated
1497+
empty messages in your APIs. A typical example is to
1498+
use it as the request or the response type of an API
1499+
method. For instance:
1500+
1501+
service Foo {
1502+
rpc Bar(google.protobuf.Empty) returns
1503+
(google.protobuf.Empty);
1504+
1505+
}
1506+
1507+
"""
1508+
# Create or coerce a protobuf request object.
1509+
# Quick check: If we got a request object, we should *not* have
1510+
# gotten any keyword arguments that map to the request.
1511+
has_flattened_params = any([name])
1512+
if request is not None and has_flattened_params:
1513+
raise ValueError(
1514+
"If the `request` argument is set, then none of "
1515+
"the individual field arguments should be set."
1516+
)
1517+
1518+
request = dataset_service.DeleteSavedQueryRequest(request)
1519+
1520+
# If we have keyword arguments corresponding to fields on the
1521+
# request, apply these.
1522+
if name is not None:
1523+
request.name = name
1524+
1525+
# Wrap the RPC method; this adds retry and timeout information,
1526+
# and friendly error handling.
1527+
rpc = gapic_v1.method_async.wrap_method(
1528+
self._client._transport.delete_saved_query,
1529+
default_timeout=None,
1530+
client_info=DEFAULT_CLIENT_INFO,
1531+
)
1532+
1533+
# Certain fields should be provided within the metadata header;
1534+
# add these here.
1535+
metadata = tuple(metadata) + (
1536+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1537+
)
1538+
1539+
# Send the request.
1540+
response = await rpc(
1541+
request,
1542+
retry=retry,
1543+
timeout=timeout,
1544+
metadata=metadata,
1545+
)
1546+
1547+
# Wrap the response in an operation future.
1548+
response = operation_async.from_gapic(
1549+
response,
1550+
self._client._transport.operations_client,
1551+
empty_pb2.Empty,
1552+
metadata_type=gca_operation.DeleteOperationMetadata,
1553+
)
1554+
1555+
# Done; return the response.
1556+
return response
1557+
14331558
async def get_annotation_spec(
14341559
self,
14351560
request: Optional[Union[dataset_service.GetAnnotationSpecRequest, dict]] = None,

google/cloud/aiplatform_v1/services/dataset_service/client.py

Lines changed: 127 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ def get_transport_class(
108108

109109

110110
class DatasetServiceClient(metaclass=DatasetServiceClientMeta):
111-
"""The service that handles the CRUD of Vertex AI Dataset and
112-
its child resources.
111+
"""The service that manages Vertex AI Dataset and its child
112+
resources.
113113
"""
114114

115115
@staticmethod
@@ -1746,6 +1746,131 @@ def sample_list_saved_queries():
17461746
# Done; return the response.
17471747
return response
17481748

1749+
def delete_saved_query(
1750+
self,
1751+
request: Optional[Union[dataset_service.DeleteSavedQueryRequest, dict]] = None,
1752+
*,
1753+
name: Optional[str] = None,
1754+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1755+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1756+
metadata: Sequence[Tuple[str, str]] = (),
1757+
) -> gac_operation.Operation:
1758+
r"""Deletes a SavedQuery.
1759+
1760+
.. code-block:: python
1761+
1762+
# This snippet has been automatically generated and should be regarded as a
1763+
# code template only.
1764+
# It will require modifications to work:
1765+
# - It may require correct/in-range values for request initialization.
1766+
# - It may require specifying regional endpoints when creating the service
1767+
# client as shown in:
1768+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
1769+
from google.cloud import aiplatform_v1
1770+
1771+
def sample_delete_saved_query():
1772+
# Create a client
1773+
client = aiplatform_v1.DatasetServiceClient()
1774+
1775+
# Initialize request argument(s)
1776+
request = aiplatform_v1.DeleteSavedQueryRequest(
1777+
name="name_value",
1778+
)
1779+
1780+
# Make the request
1781+
operation = client.delete_saved_query(request=request)
1782+
1783+
print("Waiting for operation to complete...")
1784+
1785+
response = operation.result()
1786+
1787+
# Handle the response
1788+
print(response)
1789+
1790+
Args:
1791+
request (Union[google.cloud.aiplatform_v1.types.DeleteSavedQueryRequest, dict]):
1792+
The request object. Request message for
1793+
[DatasetService.DeleteSavedQuery][google.cloud.aiplatform.v1.DatasetService.DeleteSavedQuery].
1794+
name (str):
1795+
Required. The resource name of the SavedQuery to delete.
1796+
Format:
1797+
``projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}``
1798+
1799+
This corresponds to the ``name`` field
1800+
on the ``request`` instance; if ``request`` is provided, this
1801+
should not be set.
1802+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1803+
should be retried.
1804+
timeout (float): The timeout for this request.
1805+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1806+
sent along with the request as metadata.
1807+
1808+
Returns:
1809+
google.api_core.operation.Operation:
1810+
An object representing a long-running operation.
1811+
1812+
The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated
1813+
empty messages in your APIs. A typical example is to
1814+
use it as the request or the response type of an API
1815+
method. For instance:
1816+
1817+
service Foo {
1818+
rpc Bar(google.protobuf.Empty) returns
1819+
(google.protobuf.Empty);
1820+
1821+
}
1822+
1823+
"""
1824+
# Create or coerce a protobuf request object.
1825+
# Quick check: If we got a request object, we should *not* have
1826+
# gotten any keyword arguments that map to the request.
1827+
has_flattened_params = any([name])
1828+
if request is not None and has_flattened_params:
1829+
raise ValueError(
1830+
"If the `request` argument is set, then none of "
1831+
"the individual field arguments should be set."
1832+
)
1833+
1834+
# Minor optimization to avoid making a copy if the user passes
1835+
# in a dataset_service.DeleteSavedQueryRequest.
1836+
# There's no risk of modifying the input as we've already verified
1837+
# there are no flattened fields.
1838+
if not isinstance(request, dataset_service.DeleteSavedQueryRequest):
1839+
request = dataset_service.DeleteSavedQueryRequest(request)
1840+
# If we have keyword arguments corresponding to fields on the
1841+
# request, apply these.
1842+
if name is not None:
1843+
request.name = name
1844+
1845+
# Wrap the RPC method; this adds retry and timeout information,
1846+
# and friendly error handling.
1847+
rpc = self._transport._wrapped_methods[self._transport.delete_saved_query]
1848+
1849+
# Certain fields should be provided within the metadata header;
1850+
# add these here.
1851+
metadata = tuple(metadata) + (
1852+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1853+
)
1854+
1855+
# Send the request.
1856+
response = rpc(
1857+
request,
1858+
retry=retry,
1859+
timeout=timeout,
1860+
metadata=metadata,
1861+
)
1862+
1863+
# Wrap the response in an operation future.
1864+
response = gac_operation.from_gapic(
1865+
response,
1866+
self._transport.operations_client,
1867+
empty_pb2.Empty,
1868+
metadata_type=gca_operation.DeleteOperationMetadata,
1869+
)
1870+
1871+
# Done; return the response.
1872+
return response
1873+
17491874
def get_annotation_spec(
17501875
self,
17511876
request: Optional[Union[dataset_service.GetAnnotationSpecRequest, dict]] = None,

google/cloud/aiplatform_v1/services/dataset_service/transports/base.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ def _prep_wrapped_messages(self, client_info):
182182
default_timeout=None,
183183
client_info=client_info,
184184
),
185+
self.delete_saved_query: gapic_v1.method.wrap_method(
186+
self.delete_saved_query,
187+
default_timeout=None,
188+
client_info=client_info,
189+
),
185190
self.get_annotation_spec: gapic_v1.method.wrap_method(
186191
self.get_annotation_spec,
187192
default_timeout=None,
@@ -310,6 +315,15 @@ def list_saved_queries(
310315
]:
311316
raise NotImplementedError()
312317

318+
@property
319+
def delete_saved_query(
320+
self,
321+
) -> Callable[
322+
[dataset_service.DeleteSavedQueryRequest],
323+
Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
324+
]:
325+
raise NotImplementedError()
326+
313327
@property
314328
def get_annotation_spec(
315329
self,

google/cloud/aiplatform_v1/services/dataset_service/transports/grpc.py

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
class DatasetServiceGrpcTransport(DatasetServiceTransport):
4141
"""gRPC backend transport for DatasetService.
4242
43-
The service that handles the CRUD of Vertex AI Dataset and
44-
its child resources.
43+
The service that manages Vertex AI Dataset and its child
44+
resources.
4545
4646
This class defines the same methods as the primary client, so the
4747
primary client can load the underlying transport implementation
@@ -524,6 +524,32 @@ def list_saved_queries(
524524
)
525525
return self._stubs["list_saved_queries"]
526526

527+
@property
528+
def delete_saved_query(
529+
self,
530+
) -> Callable[[dataset_service.DeleteSavedQueryRequest], operations_pb2.Operation]:
531+
r"""Return a callable for the delete saved query method over gRPC.
532+
533+
Deletes a SavedQuery.
534+
535+
Returns:
536+
Callable[[~.DeleteSavedQueryRequest],
537+
~.Operation]:
538+
A function that, when called, will call the underlying RPC
539+
on the server.
540+
"""
541+
# Generate a "stub function" on-the-fly which will actually make
542+
# the request.
543+
# gRPC handles serialization and deserialization, so we just need
544+
# to pass in the functions for each.
545+
if "delete_saved_query" not in self._stubs:
546+
self._stubs["delete_saved_query"] = self.grpc_channel.unary_unary(
547+
"/google.cloud.aiplatform.v1.DatasetService/DeleteSavedQuery",
548+
request_serializer=dataset_service.DeleteSavedQueryRequest.serialize,
549+
response_deserializer=operations_pb2.Operation.FromString,
550+
)
551+
return self._stubs["delete_saved_query"]
552+
527553
@property
528554
def get_annotation_spec(
529555
self,

0 commit comments

Comments
 (0)