Skip to content

Commit

Permalink
Merge branch 'main' into feat--Made-display_name-optional-for-most-calls
Browse files Browse the repository at this point in the history
  • Loading branch information
kweinmeister authored Feb 23, 2022
2 parents 54c658f + 09c2e8a commit 701bbbd
Show file tree
Hide file tree
Showing 832 changed files with 55,828 additions and 3,244 deletions.
229 changes: 229 additions & 0 deletions google/cloud/aiplatform_v1/services/dataset_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,35 @@ async def create_dataset(
) -> operation_async.AsyncOperation:
r"""Creates a Dataset.
.. code-block::
from google.cloud import aiplatform_v1
def sample_create_dataset():
# Create a client
client = aiplatform_v1.DatasetServiceClient()
# Initialize request argument(s)
dataset = aiplatform_v1.Dataset()
dataset.display_name = "display_name_value"
dataset.metadata_schema_uri = "metadata_schema_uri_value"
dataset.metadata.null_value = "NULL_VALUE"
request = aiplatform_v1.CreateDatasetRequest(
parent="parent_value",
dataset=dataset,
)
# Make the request
operation = client.create_dataset(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.aiplatform_v1.types.CreateDatasetRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -327,6 +356,25 @@ async def get_dataset(
) -> dataset.Dataset:
r"""Gets a Dataset.
.. code-block::
from google.cloud import aiplatform_v1
def sample_get_dataset():
# Create a client
client = aiplatform_v1.DatasetServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.GetDatasetRequest(
name="name_value",
)
# Make the request
response = client.get_dataset(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.aiplatform_v1.types.GetDatasetRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -399,6 +447,30 @@ async def update_dataset(
) -> gca_dataset.Dataset:
r"""Updates a Dataset.
.. code-block::
from google.cloud import aiplatform_v1
def sample_update_dataset():
# Create a client
client = aiplatform_v1.DatasetServiceClient()
# Initialize request argument(s)
dataset = aiplatform_v1.Dataset()
dataset.display_name = "display_name_value"
dataset.metadata_schema_uri = "metadata_schema_uri_value"
dataset.metadata.null_value = "NULL_VALUE"
request = aiplatform_v1.UpdateDatasetRequest(
dataset=dataset,
)
# Make the request
response = client.update_dataset(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.aiplatform_v1.types.UpdateDatasetRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -487,6 +559,26 @@ async def list_datasets(
) -> pagers.ListDatasetsAsyncPager:
r"""Lists Datasets in a Location.
.. code-block::
from google.cloud import aiplatform_v1
def sample_list_datasets():
# Create a client
client = aiplatform_v1.DatasetServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.ListDatasetsRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_datasets(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.aiplatform_v1.types.ListDatasetsRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -567,6 +659,29 @@ async def delete_dataset(
) -> operation_async.AsyncOperation:
r"""Deletes a Dataset.
.. code-block::
from google.cloud import aiplatform_v1
def sample_delete_dataset():
# Create a client
client = aiplatform_v1.DatasetServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.DeleteDatasetRequest(
name="name_value",
)
# Make the request
operation = client.delete_dataset(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.aiplatform_v1.types.DeleteDatasetRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -661,6 +776,34 @@ async def import_data(
) -> operation_async.AsyncOperation:
r"""Imports data into a Dataset.
.. code-block::
from google.cloud import aiplatform_v1
def sample_import_data():
# Create a client
client = aiplatform_v1.DatasetServiceClient()
# Initialize request argument(s)
import_configs = aiplatform_v1.ImportDataConfig()
import_configs.gcs_source.uris = ['uris_value_1', 'uris_value_2']
import_configs.import_schema_uri = "import_schema_uri_value"
request = aiplatform_v1.ImportDataRequest(
name="name_value",
import_configs=import_configs,
)
# Make the request
operation = client.import_data(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.aiplatform_v1.types.ImportDataRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -755,6 +898,33 @@ async def export_data(
) -> operation_async.AsyncOperation:
r"""Exports data from a Dataset.
.. code-block::
from google.cloud import aiplatform_v1
def sample_export_data():
# Create a client
client = aiplatform_v1.DatasetServiceClient()
# Initialize request argument(s)
export_config = aiplatform_v1.ExportDataConfig()
export_config.gcs_destination.output_uri_prefix = "output_uri_prefix_value"
request = aiplatform_v1.ExportDataRequest(
name="name_value",
export_config=export_config,
)
# Make the request
operation = client.export_data(request=request)
print("Waiting for operation to complete...")
response = operation.result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.aiplatform_v1.types.ExportDataRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -847,6 +1017,26 @@ async def list_data_items(
) -> pagers.ListDataItemsAsyncPager:
r"""Lists DataItems in a Dataset.
.. code-block::
from google.cloud import aiplatform_v1
def sample_list_data_items():
# Create a client
client = aiplatform_v1.DatasetServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.ListDataItemsRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_data_items(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.aiplatform_v1.types.ListDataItemsRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -928,6 +1118,25 @@ async def get_annotation_spec(
) -> annotation_spec.AnnotationSpec:
r"""Gets an AnnotationSpec.
.. code-block::
from google.cloud import aiplatform_v1
def sample_get_annotation_spec():
# Create a client
client = aiplatform_v1.DatasetServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.GetAnnotationSpecRequest(
name="name_value",
)
# Make the request
response = client.get_annotation_spec(request=request)
# Handle the response
print(response)
Args:
request (Union[google.cloud.aiplatform_v1.types.GetAnnotationSpecRequest, dict]):
The request object. Request message for
Expand Down Expand Up @@ -1000,6 +1209,26 @@ async def list_annotations(
) -> pagers.ListAnnotationsAsyncPager:
r"""Lists Annotations belongs to a dataitem
.. code-block::
from google.cloud import aiplatform_v1
def sample_list_annotations():
# Create a client
client = aiplatform_v1.DatasetServiceClient()
# Initialize request argument(s)
request = aiplatform_v1.ListAnnotationsRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_annotations(request=request)
# Handle the response
for response in page_result:
print(response)
Args:
request (Union[google.cloud.aiplatform_v1.types.ListAnnotationsRequest, dict]):
The request object. Request message for
Expand Down
Loading

0 comments on commit 701bbbd

Please sign in to comment.