WarehouseAsyncClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.visionai_v1.services.warehouse.transports.base.WarehouseTransport, typing.Callable[[...], google.cloud.visionai_v1.services.warehouse.transports.base.WarehouseTransport]]] = 'grpc_asyncio', client_options: typing.Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)
Service that manages media content + metadata for streaming.
Properties
api_endpoint
Return the API endpoint used by the client instance.
Returns | |
---|---|
Type | Description |
str |
The API endpoint used by the client instance. |
transport
Returns the transport used by the client instance.
Returns | |
---|---|
Type | Description |
WarehouseTransport |
The transport used by the client instance. |
universe_domain
Return the universe domain used by the client instance.
Returns | |
---|---|
Type | Description |
str |
The universe domain used by the client instance. |
Methods
WarehouseAsyncClient
WarehouseAsyncClient(*, credentials: typing.Optional[google.auth.credentials.Credentials] = None, transport: typing.Optional[typing.Union[str, google.cloud.visionai_v1.services.warehouse.transports.base.WarehouseTransport, typing.Callable[[...], google.cloud.visionai_v1.services.warehouse.transports.base.WarehouseTransport]]] = 'grpc_asyncio', client_options: typing.Optional[google.api_core.client_options.ClientOptions] = None, client_info: google.api_core.gapic_v1.client_info.ClientInfo = <google.api_core.gapic_v1.client_info.ClientInfo object>)
Instantiates the warehouse async client.
Parameters | |
---|---|
Name | Description |
credentials |
Optional[google.auth.credentials.Credentials]
The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment. |
transport |
Optional[Union[str,WarehouseTransport,Callable[..., WarehouseTransport]]]
The transport to use, or a Callable that constructs and returns a new transport to use. If a Callable is given, it will be called with the same set of initialization arguments as used in the WarehouseTransport constructor. If set to None, a transport is chosen automatically. |
client_options |
Optional[Union[google.api_core.client_options.ClientOptions, dict]]
Custom options for the client. 1. The |
client_info |
google.api_core.gapic_v1.client_info.ClientInfo
The client info used to send a user-agent string along with API requests. If |
Exceptions | |
---|---|
Type | Description |
google.auth.exceptions.MutualTlsChannelError |
If mutual TLS transport creation failed for any reason. |
add_collection_item
add_collection_item(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.AddCollectionItemRequest, dict
]
] = None,
*,
item: typing.Optional[
google.cloud.visionai_v1.types.warehouse.CollectionItem
] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.AddCollectionItemResponse
Adds an item into a Collection.
# 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 visionai_v1
async def sample_add_collection_item():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
item = visionai_v1.CollectionItem()
item.collection = "collection_value"
item.type_ = "ASSET"
item.item_resource = "item_resource_value"
request = visionai_v1.AddCollectionItemRequest(
item=item,
)
# Make the request
response = await client.add_collection_item(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.AddCollectionItemRequest, dict]]
The request object. Request message for AddCollectionItem. |
item |
CollectionItem
Required. The item to be added. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.AddCollectionItemResponse |
Response message for AddCollectionItem. |
analyze_asset
analyze_asset(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.AnalyzeAssetRequest, dict]
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Analyze asset to power search capability.
# 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 visionai_v1
async def sample_analyze_asset():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.AnalyzeAssetRequest(
name="name_value",
)
# Make the request
operation = client.analyze_asset(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.AnalyzeAssetRequest, dict]]
The request object. Request message for AnalyzeAsset. |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be AnalyzeAssetResponse Response message for AnalyzeAsset. |
analyze_corpus
analyze_corpus(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.AnalyzeCorpusRequest, dict
]
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Analyzes a corpus.
# 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 visionai_v1
async def sample_analyze_corpus():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.AnalyzeCorpusRequest(
name="name_value",
)
# Make the request
operation = client.analyze_corpus(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.AnalyzeCorpusRequest, dict]]
The request object. Request message for AnalyzeCorpus. |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be AnalyzeCorpusResponse The response message for AnalyzeCorpus LRO. |
annotation_path
annotation_path(
project_number: str, location: str, corpus: str, asset: str, annotation: str
) -> str
Returns a fully-qualified annotation string.
asset_path
asset_path(project_number: str, location: str, corpus: str, asset: str) -> str
Returns a fully-qualified asset string.
cancel_operation
cancel_operation(
request: typing.Optional[
google.longrunning.operations_pb2.CancelOperationRequest
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None
Starts asynchronous cancellation on a long-running operation.
The server makes a best effort to cancel the operation, but success
is not guaranteed. If the server doesn't support this method, it returns
google.rpc.Code.UNIMPLEMENTED
.
Parameters | |
---|---|
Name | Description |
request |
The request object. Request message for |
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, str]]
Strings which should be sent along with the request as metadata. |
clip_asset
clip_asset(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.ClipAssetRequest, dict]
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.ClipAssetResponse
Generates clips for downloading. The api takes in a time range, and generates a clip of the first content available after start_time and before end_time, which may overflow beyond these bounds. Returned clips are truncated if the total size of the clips are larger than 100MB.
# 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 visionai_v1
async def sample_clip_asset():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.ClipAssetRequest(
name="name_value",
)
# Make the request
response = await client.clip_asset(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.ClipAssetRequest, dict]]
The request object. Request message for ClipAsset API. |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.ClipAssetResponse |
Response message for ClipAsset API. |
collection_path
collection_path(
project_number: str, location: str, corpus: str, collection: str
) -> str
Returns a fully-qualified collection string.
common_billing_account_path
common_billing_account_path(billing_account: str) -> str
Returns a fully-qualified billing_account string.
common_folder_path
common_folder_path(folder: str) -> str
Returns a fully-qualified folder string.
common_location_path
common_location_path(project: str, location: str) -> str
Returns a fully-qualified location string.
common_organization_path
common_organization_path(organization: str) -> str
Returns a fully-qualified organization string.
common_project_path
common_project_path(project: str) -> str
Returns a fully-qualified project string.
corpus_path
corpus_path(project_number: str, location: str, corpus: str) -> str
Returns a fully-qualified corpus string.
create_annotation
create_annotation(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.CreateAnnotationRequest, dict
]
] = None,
*,
parent: typing.Optional[str] = None,
annotation: typing.Optional[
google.cloud.visionai_v1.types.warehouse.Annotation
] = None,
annotation_id: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.Annotation
Creates annotation inside asset.
# 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 visionai_v1
async def sample_create_annotation():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.CreateAnnotationRequest(
parent="parent_value",
)
# Make the request
response = await client.create_annotation(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.CreateAnnotationRequest, dict]]
The request object. Request message for CreateAnnotation. |
parent |
Required. The parent resource where this annotation will be created. Format: |
annotation |
Annotation
Required. The annotation to create. This corresponds to the |
annotation_id |
Optional. The ID to use for the annotation, which will become the final component of the annotation's resource name if user choose to specify. Otherwise, annotation id will be generated by system. This value should be up to 63 characters, and valid characters are / |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.Annotation |
An annotation is a resource in asset. It represents a key-value mapping of content in asset. |
create_asset
create_asset(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.CreateAssetRequest, dict]
] = None,
*,
parent: typing.Optional[str] = None,
asset: typing.Optional[google.cloud.visionai_v1.types.warehouse.Asset] = None,
asset_id: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.Asset
Creates an asset inside corpus.
# 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 visionai_v1
async def sample_create_asset():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.CreateAssetRequest(
parent="parent_value",
)
# Make the request
response = await client.create_asset(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.CreateAssetRequest, dict]]
The request object. Request message for CreateAssetRequest. |
parent |
Required. The parent resource where this asset will be created. Format: |
asset |
Asset
Required. The asset to create. This corresponds to the |
asset_id |
Optional. The ID to use for the asset, which will become the final component of the asset's resource name if user choose to specify. Otherwise, asset id will be generated by system. This value should be up to 63 characters, and valid characters are / |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.Asset |
An asset is a resource in corpus. It represents a media object inside corpus, contains metadata and another resource annotation. Different feature could be applied to the asset to generate annotations. User could specified annotation related to the target asset. |
create_collection
create_collection(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.CreateCollectionRequest, dict
]
] = None,
*,
parent: typing.Optional[str] = None,
collection: typing.Optional[
google.cloud.visionai_v1.types.warehouse.Collection
] = None,
collection_id: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Creates a collection.
# 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 visionai_v1
async def sample_create_collection():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.CreateCollectionRequest(
parent="parent_value",
)
# Make the request
operation = client.create_collection(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.CreateCollectionRequest, dict]]
The request object. Request message for CreateCollection. |
parent |
Required. The parent resource where this collection will be created. Format: |
collection |
Collection
Required. The collection resource to be created. This corresponds to the |
collection_id |
Optional. The ID to use for the collection, which will become the final component of the resource name if user choose to specify. Otherwise, collection id will be generated by system. This value should be up to 55 characters, and valid characters are / |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be Collection A collection is a resource in a corpus. It serves as a container of references to original resources. |
create_corpus
create_corpus(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.CreateCorpusRequest, dict]
] = None,
*,
parent: typing.Optional[str] = None,
corpus: typing.Optional[google.cloud.visionai_v1.types.warehouse.Corpus] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Creates a corpus inside a project.
# 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 visionai_v1
async def sample_create_corpus():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
corpus = visionai_v1.Corpus()
corpus.display_name = "display_name_value"
request = visionai_v1.CreateCorpusRequest(
parent="parent_value",
corpus=corpus,
)
# Make the request
operation = client.create_corpus(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.CreateCorpusRequest, dict]]
The request object. Request message of CreateCorpus API. |
parent |
Required. Form: |
corpus |
Corpus
Required. The corpus to be created. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be Corpus Corpus is a set of media contents for management. Within a corpus, media shares the same data schema. Search is also restricted within a single corpus. |
create_data_schema
create_data_schema(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.CreateDataSchemaRequest, dict
]
] = None,
*,
parent: typing.Optional[str] = None,
data_schema: typing.Optional[
google.cloud.visionai_v1.types.warehouse.DataSchema
] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.DataSchema
Creates data schema inside corpus.
# 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 visionai_v1
async def sample_create_data_schema():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
data_schema = visionai_v1.DataSchema()
data_schema.key = "key_value"
request = visionai_v1.CreateDataSchemaRequest(
parent="parent_value",
data_schema=data_schema,
)
# Make the request
response = await client.create_data_schema(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.CreateDataSchemaRequest, dict]]
The request object. Request message for CreateDataSchema. |
parent |
Required. The parent resource where this data schema will be created. Format: |
data_schema |
DataSchema
Required. The data schema to create. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.DataSchema |
Data schema indicates how the user specified annotation is interpreted in the system. |
create_index
create_index(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.CreateIndexRequest, dict]
] = None,
*,
parent: typing.Optional[str] = None,
index: typing.Optional[google.cloud.visionai_v1.types.warehouse.Index] = None,
index_id: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Creates an Index under the corpus.
# 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 visionai_v1
async def sample_create_index():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
index = visionai_v1.Index()
index.entire_corpus = True
request = visionai_v1.CreateIndexRequest(
parent="parent_value",
index=index,
)
# Make the request
operation = client.create_index(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.CreateIndexRequest, dict]]
The request object. Message for creating an Index. |
parent |
Required. Value for the parent. The resource name of the Corpus under which this index is created. Format: |
index |
Index
Required. The index being created. This corresponds to the |
index_id |
Optional. The ID for the index. This will become the final resource name for the index. If the user does not specify this value, it will be generated by system. This value should be up to 63 characters, and valid characters are / |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be Index An Index is a resource in Corpus. It contains an indexed version of the assets and annotations. When deployed to an endpoint, it will allow users to search the Index. |
create_index_endpoint
create_index_endpoint(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.CreateIndexEndpointRequest, dict
]
] = None,
*,
parent: typing.Optional[str] = None,
index_endpoint: typing.Optional[
google.cloud.visionai_v1.types.warehouse.IndexEndpoint
] = None,
index_endpoint_id: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Creates an IndexEndpoint.
# 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 visionai_v1
async def sample_create_index_endpoint():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.CreateIndexEndpointRequest(
parent="parent_value",
)
# Make the request
operation = client.create_index_endpoint(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.CreateIndexEndpointRequest, dict]]
The request object. Request message for CreateIndexEndpoint. |
parent |
Required. Format: |
index_endpoint |
IndexEndpoint
Required. The resource being created. This corresponds to the |
index_endpoint_id |
Optional. The ID to use for the IndexEndpoint, which will become the final component of the IndexEndpoint's resource name if the user specifies it. Otherwise, IndexEndpoint id will be autogenerated. This value should be up to 63 characters, and valid characters are a-z, 0-9 and dash (-). The first character must be a letter, the last must be a letter or a number. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be IndexEndpoint Message representing IndexEndpoint resource. Indexes are deployed into it. |
create_search_config
create_search_config(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.CreateSearchConfigRequest, dict
]
] = None,
*,
parent: typing.Optional[str] = None,
search_config: typing.Optional[
google.cloud.visionai_v1.types.warehouse.SearchConfig
] = None,
search_config_id: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.SearchConfig
Creates a search configuration inside a corpus.
Please follow the rules below to create a valid CreateSearchConfigRequest. --- General Rules ---
- Request.search_config_id must not be associated with an existing SearchConfig.
- Request must contain at least one non-empty search_criteria_property or facet_property.
- mapped_fields must not be empty, and must map to existing UGA keys.
- All mapped_fields must be of the same type.
- All mapped_fields must share the same granularity.
- All mapped_fields must share the same semantic SearchConfig match options. For property-specific rules, please reference the comments for FacetProperty and SearchCriteriaProperty.
# 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 visionai_v1
async def sample_create_search_config():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.CreateSearchConfigRequest(
parent="parent_value",
search_config_id="search_config_id_value",
)
# Make the request
response = await client.create_search_config(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.CreateSearchConfigRequest, dict]]
The request object. Request message for CreateSearchConfig. |
parent |
Required. The parent resource where this search configuration will be created. Format: |
search_config |
SearchConfig
Required. The search config to create. This corresponds to the |
search_config_id |
Required. ID to use for the new search config. Will become the final component of the SearchConfig's resource name. This value should be up to 63 characters, and valid characters are / |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.SearchConfig |
SearchConfig stores different properties that will affect search behaviors and search results. |
create_search_hypernym
create_search_hypernym(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.CreateSearchHypernymRequest, dict
]
] = None,
*,
parent: typing.Optional[str] = None,
search_hypernym: typing.Optional[
google.cloud.visionai_v1.types.warehouse.SearchHypernym
] = None,
search_hypernym_id: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.SearchHypernym
Creates a SearchHypernym inside a corpus.
# 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 visionai_v1
async def sample_create_search_hypernym():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.CreateSearchHypernymRequest(
parent="parent_value",
)
# Make the request
response = await client.create_search_hypernym(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.CreateSearchHypernymRequest, dict]]
The request object. Request message for creating SearchHypernym. |
parent |
Required. The parent resource where this SearchHypernym will be created. Format: |
search_hypernym |
SearchHypernym
Required. The SearchHypernym to create. This corresponds to the |
search_hypernym_id |
Optional. The search hypernym id. If omitted, a random UUID will be generated. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.SearchHypernym |
Search resource: SearchHypernym. For example, { hypernym: "vehicle" hyponyms: ["sedan", "truck"] } This means in SMART_SEARCH mode, searching for "vehicle" will also return results with "sedan" or "truck" as annotations. |
data_schema_path
data_schema_path(
project_number: str, location: str, corpus: str, data_schema: str
) -> str
Returns a fully-qualified data_schema string.
delete_annotation
delete_annotation(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.DeleteAnnotationRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None
Deletes annotation inside asset.
# 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 visionai_v1
async def sample_delete_annotation():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.DeleteAnnotationRequest(
name="name_value",
)
# Make the request
await client.delete_annotation(request=request)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.DeleteAnnotationRequest, dict]]
The request object. Request message for DeleteAnnotation API. |
name |
Required. The name of the annotation to delete. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
delete_asset
delete_asset(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.DeleteAssetRequest, dict]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Deletes asset inside corpus.
# 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 visionai_v1
async def sample_delete_asset():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.DeleteAssetRequest(
name="name_value",
)
# Make the request
operation = client.delete_asset(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.DeleteAssetRequest, dict]]
The request object. Request message for DeleteAsset. |
name |
Required. The name of the asset to delete. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be google.protobuf.empty_pb2.Empty A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } |
delete_collection
delete_collection(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.DeleteCollectionRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Deletes a collection.
# 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 visionai_v1
async def sample_delete_collection():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.DeleteCollectionRequest(
name="name_value",
)
# Make the request
operation = client.delete_collection(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.DeleteCollectionRequest, dict]]
The request object. Request message for DeleteCollectionRequest. |
name |
Required. The name of the collection to delete. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be google.protobuf.empty_pb2.Empty A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } |
delete_corpus
delete_corpus(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.DeleteCorpusRequest, dict]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None
Deletes a corpus only if its empty. Returns empty response.
# 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 visionai_v1
async def sample_delete_corpus():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.DeleteCorpusRequest(
name="name_value",
)
# Make the request
await client.delete_corpus(request=request)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.DeleteCorpusRequest, dict]]
The request object. Request message for DeleteCorpus. |
name |
Required. The resource name of the corpus to delete. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
delete_data_schema
delete_data_schema(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.DeleteDataSchemaRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None
Deletes data schema inside corpus.
# 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 visionai_v1
async def sample_delete_data_schema():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.DeleteDataSchemaRequest(
name="name_value",
)
# Make the request
await client.delete_data_schema(request=request)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.DeleteDataSchemaRequest, dict]]
The request object. Request message for DeleteDataSchema. |
name |
Required. The name of the data schema to delete. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
delete_index
delete_index(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.DeleteIndexRequest, dict]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Delete a single Index. In order to delete an index, the caller must make sure that it is not deployed to any index endpoint.
# 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 visionai_v1
async def sample_delete_index():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.DeleteIndexRequest(
name="name_value",
)
# Make the request
operation = client.delete_index(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.DeleteIndexRequest, dict]]
The request object. Request message for DeleteIndex. |
name |
Required. The name of the index to delete. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be google.protobuf.empty_pb2.Empty A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } |
delete_index_endpoint
delete_index_endpoint(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.DeleteIndexEndpointRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Deletes an IndexEndpoint.
# 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 visionai_v1
async def sample_delete_index_endpoint():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.DeleteIndexEndpointRequest(
name="name_value",
)
# Make the request
operation = client.delete_index_endpoint(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.DeleteIndexEndpointRequest, dict]]
The request object. Request message for DeleteIndexEndpoint. |
name |
Required. Name of the resource. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be google.protobuf.empty_pb2.Empty A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } |
delete_operation
delete_operation(
request: typing.Optional[
google.longrunning.operations_pb2.DeleteOperationRequest
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None
Deletes a long-running operation.
This method indicates that the client is no longer interested
in the operation result. It does not cancel the operation.
If the server doesn't support this method, it returns
google.rpc.Code.UNIMPLEMENTED
.
Parameters | |
---|---|
Name | Description |
request |
The request object. Request message for |
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, str]]
Strings which should be sent along with the request as metadata. |
delete_search_config
delete_search_config(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.DeleteSearchConfigRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None
Deletes a search configuration inside a corpus.
For a DeleteSearchConfigRequest to be valid, Request.search_configuration.name must already exist.
# 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 visionai_v1
async def sample_delete_search_config():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.DeleteSearchConfigRequest(
name="name_value",
)
# Make the request
await client.delete_search_config(request=request)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.DeleteSearchConfigRequest, dict]]
The request object. Request message for DeleteSearchConfig. |
name |
Required. The name of the search configuration to delete. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
delete_search_hypernym
delete_search_hypernym(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.DeleteSearchHypernymRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> None
Deletes a SearchHypernym inside a corpus.
# 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 visionai_v1
async def sample_delete_search_hypernym():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.DeleteSearchHypernymRequest(
name="name_value",
)
# Make the request
await client.delete_search_hypernym(request=request)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.DeleteSearchHypernymRequest, dict]]
The request object. Request message for deleting SearchHypernym. |
name |
Required. The name of the SearchHypernym to delete. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
deploy_index
deploy_index(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.DeployIndexRequest, dict]
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Deploys an Index to IndexEndpoint.
# 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 visionai_v1
async def sample_deploy_index():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
deployed_index = visionai_v1.DeployedIndex()
deployed_index.index = "index_value"
request = visionai_v1.DeployIndexRequest(
index_endpoint="index_endpoint_value",
deployed_index=deployed_index,
)
# Make the request
operation = client.deploy_index(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.DeployIndexRequest, dict]]
The request object. Request message for DeployIndex. |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be DeployIndexResponse DeployIndex response once the operation is done. |
from_service_account_file
from_service_account_file(filename: str, *args, **kwargs)
Creates an instance of this client using the provided credentials file.
Parameter | |
---|---|
Name | Description |
filename |
str
The path to the service account private key json file. |
Returns | |
---|---|
Type | Description |
WarehouseAsyncClient |
The constructed client. |
from_service_account_info
from_service_account_info(info: dict, *args, **kwargs)
Creates an instance of this client using the provided credentials info.
Parameter | |
---|---|
Name | Description |
info |
dict
The service account private key info. |
Returns | |
---|---|
Type | Description |
WarehouseAsyncClient |
The constructed client. |
from_service_account_json
from_service_account_json(filename: str, *args, **kwargs)
Creates an instance of this client using the provided credentials file.
Parameter | |
---|---|
Name | Description |
filename |
str
The path to the service account private key json file. |
Returns | |
---|---|
Type | Description |
WarehouseAsyncClient |
The constructed client. |
generate_hls_uri
generate_hls_uri(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.GenerateHlsUriRequest, dict
]
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.GenerateHlsUriResponse
Generates a uri for an HLS manifest. The api takes in a collection of time ranges, and generates a URI for an HLS manifest that covers all the requested time ranges.
# 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 visionai_v1
async def sample_generate_hls_uri():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.GenerateHlsUriRequest(
name="name_value",
)
# Make the request
response = await client.generate_hls_uri(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.GenerateHlsUriRequest, dict]]
The request object. Request message for GenerateHlsUri API. |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.GenerateHlsUriResponse |
Response message for GenerateHlsUri API. |
generate_retrieval_url
generate_retrieval_url(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.GenerateRetrievalUrlRequest, dict
]
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.GenerateRetrievalUrlResponse
Generates a signed url for downloading the asset. For video warehouse, please see comment of UploadAsset about how to allow retrieval of cloud storage files in a different project.
# 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 visionai_v1
async def sample_generate_retrieval_url():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.GenerateRetrievalUrlRequest(
name="name_value",
)
# Make the request
response = await client.generate_retrieval_url(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.GenerateRetrievalUrlRequest, dict]]
The request object. Request message for GenerateRetrievalUrl API. |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.GenerateRetrievalUrlResponse |
Response message for GenerateRetrievalUrl API. |
get_annotation
get_annotation(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.GetAnnotationRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.Annotation
Reads annotation inside asset.
# 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 visionai_v1
async def sample_get_annotation():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.GetAnnotationRequest(
name="name_value",
)
# Make the request
response = await client.get_annotation(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.GetAnnotationRequest, dict]]
The request object. Request message for GetAnnotation API. |
name |
Required. The name of the annotation to retrieve. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.Annotation |
An annotation is a resource in asset. It represents a key-value mapping of content in asset. |
get_asset
get_asset(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.GetAssetRequest, dict]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.Asset
Reads an asset inside corpus.
# 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 visionai_v1
async def sample_get_asset():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.GetAssetRequest(
name="name_value",
)
# Make the request
response = await client.get_asset(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.GetAssetRequest, dict]]
The request object. Request message for GetAsset. |
name |
Required. The name of the asset to retrieve. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset} This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.Asset |
An asset is a resource in corpus. It represents a media object inside corpus, contains metadata and another resource annotation. Different feature could be applied to the asset to generate annotations. User could specified annotation related to the target asset. |
get_collection
get_collection(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.GetCollectionRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.Collection
Gets a collection.
# 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 visionai_v1
async def sample_get_collection():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.GetCollectionRequest(
name="name_value",
)
# Make the request
response = await client.get_collection(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.GetCollectionRequest, dict]]
The request object. Request message for GetCollectionRequest. |
name |
Required. The name of the collection to retrieve. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.Collection |
A collection is a resource in a corpus. It serves as a container of references to original resources. |
get_corpus
get_corpus(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.GetCorpusRequest, dict]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.Corpus
Gets corpus details inside a project.
# 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 visionai_v1
async def sample_get_corpus():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.GetCorpusRequest(
name="name_value",
)
# Make the request
response = await client.get_corpus(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.GetCorpusRequest, dict]]
The request object. Request message for GetCorpus. |
name |
Required. The resource name of the corpus to retrieve. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.Corpus |
Corpus is a set of media contents for management. Within a corpus, media shares the same data schema. Search is also restricted within a single corpus. |
get_data_schema
get_data_schema(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.GetDataSchemaRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.DataSchema
Gets data schema inside corpus.
# 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 visionai_v1
async def sample_get_data_schema():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.GetDataSchemaRequest(
name="name_value",
)
# Make the request
response = await client.get_data_schema(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.GetDataSchemaRequest, dict]]
The request object. Request message for GetDataSchema. |
name |
Required. The name of the data schema to retrieve. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.DataSchema |
Data schema indicates how the user specified annotation is interpreted in the system. |
get_index
get_index(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.GetIndexRequest, dict]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.Index
Gets the details of a single Index under a Corpus.
# 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 visionai_v1
async def sample_get_index():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.GetIndexRequest(
name="name_value",
)
# Make the request
response = await client.get_index(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.GetIndexRequest, dict]]
The request object. Request message for getting an Index. |
name |
Required. Name of the Index resource. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.Index |
An Index is a resource in Corpus. It contains an indexed version of the assets and annotations. When deployed to an endpoint, it will allow users to search the Index. |
get_index_endpoint
get_index_endpoint(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.GetIndexEndpointRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.IndexEndpoint
Gets an IndexEndpoint.
# 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 visionai_v1
async def sample_get_index_endpoint():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.GetIndexEndpointRequest(
name="name_value",
)
# Make the request
response = await client.get_index_endpoint(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.GetIndexEndpointRequest, dict]]
The request object. Request message for GetIndexEndpoint. |
name |
Required. Name of the IndexEndpoint resource. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.IndexEndpoint |
Message representing IndexEndpoint resource. Indexes are deployed into it. |
get_mtls_endpoint_and_cert_source
get_mtls_endpoint_and_cert_source(
client_options: typing.Optional[
google.api_core.client_options.ClientOptions
] = None,
)
Return the API endpoint and client cert source for mutual TLS.
The client cert source is determined in the following order:
(1) if GOOGLE_API_USE_CLIENT_CERTIFICATE
environment variable is not "true", the
client cert source is None.
(2) if client_options.client_cert_source
is provided, use the provided one; if the
default client cert source exists, use the default one; otherwise the client cert
source is None.
The API endpoint is determined in the following order:
(1) if client_options.api_endpoint
if provided, use the provided one.
(2) if GOOGLE_API_USE_CLIENT_CERTIFICATE
environment variable is "always", use the
default mTLS endpoint; if the environment variable is "never", use the default API
endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise
use the default API endpoint.
More details can be found at https://google.aip.dev/auth/4114.
Parameter | |
---|---|
Name | Description |
client_options |
google.api_core.client_options.ClientOptions
Custom options for the client. Only the |
Exceptions | |
---|---|
Type | Description |
google.auth.exceptions.MutualTLSChannelError |
If any errors happen. |
Returns | |
---|---|
Type | Description |
Tuple[str, Callable[[], Tuple[bytes, bytes]]] |
returns the API endpoint and the client cert source to use. |
get_operation
get_operation(
request: typing.Optional[
google.longrunning.operations_pb2.GetOperationRequest
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.longrunning.operations_pb2.Operation
Gets the latest state of a long-running operation.
Parameters | |
---|---|
Name | Description |
request |
The request object. Request message for |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
|
An Operation object. |
get_search_config
get_search_config(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.GetSearchConfigRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.SearchConfig
Gets a search configuration inside a corpus.
# 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 visionai_v1
async def sample_get_search_config():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.GetSearchConfigRequest(
name="name_value",
)
# Make the request
response = await client.get_search_config(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.GetSearchConfigRequest, dict]]
The request object. Request message for GetSearchConfig. |
name |
Required. The name of the search configuration to retrieve. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.SearchConfig |
SearchConfig stores different properties that will affect search behaviors and search results. |
get_search_hypernym
get_search_hypernym(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.GetSearchHypernymRequest, dict
]
] = None,
*,
name: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.SearchHypernym
Gets a SearchHypernym inside a corpus.
# 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 visionai_v1
async def sample_get_search_hypernym():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.GetSearchHypernymRequest(
name="name_value",
)
# Make the request
response = await client.get_search_hypernym(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.GetSearchHypernymRequest, dict]]
The request object. Request message for getting SearchHypernym. |
name |
Required. The name of the SearchHypernym to retrieve. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.SearchHypernym |
Search resource: SearchHypernym. For example, { hypernym: "vehicle" hyponyms: ["sedan", "truck"] } This means in SMART_SEARCH mode, searching for "vehicle" will also return results with "sedan" or "truck" as annotations. |
get_transport_class
get_transport_class() -> (
typing.Type[
google.cloud.visionai_v1.services.warehouse.transports.base.WarehouseTransport
]
)
Returns an appropriate transport class.
Parameter | |
---|---|
Name | Description |
label |
typing.Optional[str]
The name of the desired transport. If none is provided, then the first transport in the registry is used. |
import_assets
import_assets(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.ImportAssetsRequest, dict]
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Imports assets (images plus annotations) from a meta file on cloud storage. Each row in the meta file is corresponding to an image (specified by a cloud storage uri) and its annotations.
# 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 visionai_v1
async def sample_import_assets():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.ImportAssetsRequest(
assets_gcs_uri="assets_gcs_uri_value",
parent="parent_value",
)
# Make the request
operation = client.import_assets(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.ImportAssetsRequest, dict]]
The request object. The request message for ImportAssets. |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be ImportAssetsResponse The response message for ImportAssets LRO. |
index_asset
index_asset(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.IndexAssetRequest, dict]
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Index one asset for search. Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND
# 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 visionai_v1
async def sample_index_asset():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.IndexAssetRequest(
name="name_value",
)
# Make the request
operation = client.index_asset(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.IndexAssetRequest, dict]]
The request object. Request message for IndexAsset. |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be IndexAssetResponse Response message for IndexAsset. |
index_endpoint_path
index_endpoint_path(project: str, location: str, index_endpoint: str) -> str
Returns a fully-qualified index_endpoint string.
index_path
index_path(project_number: str, location: str, corpus: str, index: str) -> str
Returns a fully-qualified index string.
ingest_asset
ingest_asset(
requests: typing.Optional[
typing.AsyncIterator[
google.cloud.visionai_v1.types.warehouse.IngestAssetRequest
]
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> typing.Awaitable[
typing.AsyncIterable[google.cloud.visionai_v1.types.warehouse.IngestAssetResponse]
]
Ingests data for the asset. It is not allowed to ingest a data chunk which is already expired according to TTL. This method is only available via the gRPC API (not HTTP since bi-directional streaming is not supported via HTTP).
# 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 visionai_v1
async def sample_ingest_asset():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
config = visionai_v1.Config()
config.asset = "asset_value"
request = visionai_v1.IngestAssetRequest(
config=config,
)
# This method expects an iterator which contains
# 'visionai_v1.IngestAssetRequest' 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.ingest_asset(requests=request_generator())
# Handle the response
async for response in stream:
print(response)
Parameters | |
---|---|
Name | Description |
requests |
AsyncIterator[
The request object AsyncIterator. Request message for IngestAsset API. |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
AsyncIterable[google.cloud.visionai_v1.types.IngestAssetResponse] |
Response message for IngestAsset API. |
list_annotations
list_annotations(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.ListAnnotationsRequest, dict
]
] = None,
*,
parent: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.services.warehouse.pagers.ListAnnotationsAsyncPager
Lists a list of annotations inside asset.
# 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 visionai_v1
async def sample_list_annotations():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.ListAnnotationsRequest(
)
# Make the request
page_result = client.list_annotations(request=request)
# Handle the response
async for response in page_result:
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.ListAnnotationsRequest, dict]]
The request object. Request message for GetAnnotation API. |
parent |
The parent, which owns this collection of annotations. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.services.warehouse.pagers.ListAnnotationsAsyncPager |
Request message for ListAnnotations API. Iterating over this object will yield results and resolve additional pages automatically. |
list_assets
list_assets(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.ListAssetsRequest, dict]
] = None,
*,
parent: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.services.warehouse.pagers.ListAssetsAsyncPager
Lists an list of assets inside corpus.
# 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 visionai_v1
async def sample_list_assets():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.ListAssetsRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_assets(request=request)
# Handle the response
async for response in page_result:
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.ListAssetsRequest, dict]]
The request object. Request message for ListAssets. |
parent |
Required. The parent, which owns this collection of assets. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.services.warehouse.pagers.ListAssetsAsyncPager |
Response message for ListAssets. Iterating over this object will yield results and resolve additional pages automatically. |
list_collections
list_collections(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.ListCollectionsRequest, dict
]
] = None,
*,
parent: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.services.warehouse.pagers.ListCollectionsAsyncPager
Lists collections inside a corpus.
# 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 visionai_v1
async def sample_list_collections():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.ListCollectionsRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_collections(request=request)
# Handle the response
async for response in page_result:
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.ListCollectionsRequest, dict]]
The request object. Request message for ListCollections. |
parent |
Required. The parent corpus. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.services.warehouse.pagers.ListCollectionsAsyncPager |
Response message for ListCollections. Iterating over this object will yield results and resolve additional pages automatically. |
list_corpora
list_corpora(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.ListCorporaRequest, dict]
] = None,
*,
parent: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.services.warehouse.pagers.ListCorporaAsyncPager
Lists all corpora in a project.
# 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 visionai_v1
async def sample_list_corpora():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.ListCorporaRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_corpora(request=request)
# Handle the response
async for response in page_result:
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.ListCorporaRequest, dict]]
The request object. Request message for ListCorpora. |
parent |
Required. The resource name of the project from which to list corpora. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.services.warehouse.pagers.ListCorporaAsyncPager |
Response message for ListCorpora. Iterating over this object will yield results and resolve additional pages automatically. |
list_data_schemas
list_data_schemas(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.ListDataSchemasRequest, dict
]
] = None,
*,
parent: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.services.warehouse.pagers.ListDataSchemasAsyncPager
Lists a list of data schemas inside corpus.
# 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 visionai_v1
async def sample_list_data_schemas():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.ListDataSchemasRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_data_schemas(request=request)
# Handle the response
async for response in page_result:
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.ListDataSchemasRequest, dict]]
The request object. Request message for ListDataSchemas. |
parent |
Required. The parent, which owns this collection of data schemas. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.services.warehouse.pagers.ListDataSchemasAsyncPager |
Response message for ListDataSchemas. Iterating over this object will yield results and resolve additional pages automatically. |
list_index_endpoints
list_index_endpoints(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.ListIndexEndpointsRequest, dict
]
] = None,
*,
parent: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.services.warehouse.pagers.ListIndexEndpointsAsyncPager
Lists all IndexEndpoints in a project.
# 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 visionai_v1
async def sample_list_index_endpoints():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.ListIndexEndpointsRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_index_endpoints(request=request)
# Handle the response
async for response in page_result:
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.ListIndexEndpointsRequest, dict]]
The request object. Request message for ListIndexEndpoints. |
parent |
Required. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.services.warehouse.pagers.ListIndexEndpointsAsyncPager |
Response message for ListIndexEndpoints. Iterating over this object will yield results and resolve additional pages automatically. |
list_indexes
list_indexes(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.ListIndexesRequest, dict]
] = None,
*,
parent: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.services.warehouse.pagers.ListIndexesAsyncPager
List all Indexes in a given Corpus.
# 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 visionai_v1
async def sample_list_indexes():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.ListIndexesRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_indexes(request=request)
# Handle the response
async for response in page_result:
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.ListIndexesRequest, dict]]
The request object. Request message for listing Indexes. |
parent |
Required. The parent corpus that owns this collection of indexes. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.services.warehouse.pagers.ListIndexesAsyncPager |
Response message for ListIndexes. Iterating over this object will yield results and resolve additional pages automatically. |
list_operations
list_operations(
request: typing.Optional[
google.longrunning.operations_pb2.ListOperationsRequest
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.longrunning.operations_pb2.ListOperationsResponse
Lists operations that match the specified filter in the request.
Parameters | |
---|---|
Name | Description |
request |
The request object. Request message for |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
|
Response message for ListOperations method. |
list_search_configs
list_search_configs(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.ListSearchConfigsRequest, dict
]
] = None,
*,
parent: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.services.warehouse.pagers.ListSearchConfigsAsyncPager
Lists all search configurations inside a corpus.
# 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 visionai_v1
async def sample_list_search_configs():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.ListSearchConfigsRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_search_configs(request=request)
# Handle the response
async for response in page_result:
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.ListSearchConfigsRequest, dict]]
The request object. Request message for ListSearchConfigs. |
parent |
Required. The parent, which owns this collection of search configurations. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.services.warehouse.pagers.ListSearchConfigsAsyncPager |
Response message for ListSearchConfigs. Iterating over this object will yield results and resolve additional pages automatically. |
list_search_hypernyms
list_search_hypernyms(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.ListSearchHypernymsRequest, dict
]
] = None,
*,
parent: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.services.warehouse.pagers.ListSearchHypernymsAsyncPager
Lists SearchHypernyms inside a corpus.
# 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 visionai_v1
async def sample_list_search_hypernyms():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.ListSearchHypernymsRequest(
parent="parent_value",
)
# Make the request
page_result = client.list_search_hypernyms(request=request)
# Handle the response
async for response in page_result:
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.ListSearchHypernymsRequest, dict]]
The request object. Request message for listing SearchHypernyms. |
parent |
Required. The parent, which owns this collection of SearchHypernyms. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.services.warehouse.pagers.ListSearchHypernymsAsyncPager |
Response message for listing SearchHypernyms. Iterating over this object will yield results and resolve additional pages automatically. |
parse_annotation_path
parse_annotation_path(path: str) -> typing.Dict[str, str]
Parses a annotation path into its component segments.
parse_asset_path
parse_asset_path(path: str) -> typing.Dict[str, str]
Parses a asset path into its component segments.
parse_collection_path
parse_collection_path(path: str) -> typing.Dict[str, str]
Parses a collection path into its component segments.
parse_common_billing_account_path
parse_common_billing_account_path(path: str) -> typing.Dict[str, str]
Parse a billing_account path into its component segments.
parse_common_folder_path
parse_common_folder_path(path: str) -> typing.Dict[str, str]
Parse a folder path into its component segments.
parse_common_location_path
parse_common_location_path(path: str) -> typing.Dict[str, str]
Parse a location path into its component segments.
parse_common_organization_path
parse_common_organization_path(path: str) -> typing.Dict[str, str]
Parse a organization path into its component segments.
parse_common_project_path
parse_common_project_path(path: str) -> typing.Dict[str, str]
Parse a project path into its component segments.
parse_corpus_path
parse_corpus_path(path: str) -> typing.Dict[str, str]
Parses a corpus path into its component segments.
parse_data_schema_path
parse_data_schema_path(path: str) -> typing.Dict[str, str]
Parses a data_schema path into its component segments.
parse_index_endpoint_path
parse_index_endpoint_path(path: str) -> typing.Dict[str, str]
Parses a index_endpoint path into its component segments.
parse_index_path
parse_index_path(path: str) -> typing.Dict[str, str]
Parses a index path into its component segments.
parse_search_config_path
parse_search_config_path(path: str) -> typing.Dict[str, str]
Parses a search_config path into its component segments.
parse_search_hypernym_path
parse_search_hypernym_path(path: str) -> typing.Dict[str, str]
Parses a search_hypernym path into its component segments.
remove_collection_item
remove_collection_item(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.RemoveCollectionItemRequest, dict
]
] = None,
*,
item: typing.Optional[
google.cloud.visionai_v1.types.warehouse.CollectionItem
] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.RemoveCollectionItemResponse
Removes an item from a collection.
# 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 visionai_v1
async def sample_remove_collection_item():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
item = visionai_v1.CollectionItem()
item.collection = "collection_value"
item.type_ = "ASSET"
item.item_resource = "item_resource_value"
request = visionai_v1.RemoveCollectionItemRequest(
item=item,
)
# Make the request
response = await client.remove_collection_item(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.RemoveCollectionItemRequest, dict]]
The request object. Request message for RemoveCollectionItem. |
item |
CollectionItem
Required. The item to be removed. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.RemoveCollectionItemResponse |
Request message for RemoveCollectionItem. |
remove_index_asset
remove_index_asset(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.RemoveIndexAssetRequest, dict
]
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Remove one asset's index data for search. Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND
# 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 visionai_v1
async def sample_remove_index_asset():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.RemoveIndexAssetRequest(
name="name_value",
)
# Make the request
operation = client.remove_index_asset(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.RemoveIndexAssetRequest, dict]]
The request object. Request message for RemoveIndexAsset. |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be RemoveIndexAssetResponse Response message for RemoveIndexAsset. |
search_assets
search_assets(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.SearchAssetsRequest, dict]
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.services.warehouse.pagers.SearchAssetsAsyncPager
Search media asset.
# 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 visionai_v1
async def sample_search_assets():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.SearchAssetsRequest(
corpus="corpus_value",
)
# Make the request
page_result = client.search_assets(request=request)
# Handle the response
async for response in page_result:
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.SearchAssetsRequest, dict]]
The request object. Request message for SearchAssets. |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.services.warehouse.pagers.SearchAssetsAsyncPager |
Response message for SearchAssets. Iterating over this object will yield results and resolve additional pages automatically. |
search_config_path
search_config_path(
project_number: str, location: str, corpus: str, search_config: str
) -> str
Returns a fully-qualified search_config string.
search_hypernym_path
search_hypernym_path(
project_number: str, location: str, corpus: str, search_hypernym: str
) -> str
Returns a fully-qualified search_hypernym string.
search_index_endpoint
search_index_endpoint(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.SearchIndexEndpointRequest, dict
]
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.services.warehouse.pagers.SearchIndexEndpointAsyncPager
Search a deployed index endpoint (IMAGE corpus type only).
# 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 visionai_v1
async def sample_search_index_endpoint():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
image_query = visionai_v1.ImageQuery()
image_query.input_image = b'input_image_blob'
request = visionai_v1.SearchIndexEndpointRequest(
image_query=image_query,
index_endpoint="index_endpoint_value",
)
# Make the request
page_result = client.search_index_endpoint(request=request)
# Handle the response
async for response in page_result:
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.SearchIndexEndpointRequest, dict]]
The request object. Request message for SearchIndexEndpoint. |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.services.warehouse.pagers.SearchIndexEndpointAsyncPager |
Response message for SearchIndexEndpoint. Iterating over this object will yield results and resolve additional pages automatically. |
undeploy_index
undeploy_index(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.UndeployIndexRequest, dict
]
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Undeploys an Index from IndexEndpoint.
# 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 visionai_v1
async def sample_undeploy_index():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.UndeployIndexRequest(
index_endpoint="index_endpoint_value",
)
# Make the request
operation = client.undeploy_index(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.UndeployIndexRequest, dict]]
The request object. Request message for UndeployIndexEndpoint. |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be UndeployIndexResponse UndeployIndex response once the operation is done. |
update_annotation
update_annotation(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.UpdateAnnotationRequest, dict
]
] = None,
*,
annotation: typing.Optional[
google.cloud.visionai_v1.types.warehouse.Annotation
] = None,
update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.Annotation
Updates annotation inside asset.
# 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 visionai_v1
async def sample_update_annotation():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.UpdateAnnotationRequest(
)
# Make the request
response = await client.update_annotation(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.UpdateAnnotationRequest, dict]]
The request object. Request message for UpdateAnnotation API. |
annotation |
Annotation
Required. The annotation to update. The annotation's |
update_mask |
The list of fields to be updated. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.Annotation |
An annotation is a resource in asset. It represents a key-value mapping of content in asset. |
update_asset
update_asset(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.UpdateAssetRequest, dict]
] = None,
*,
asset: typing.Optional[google.cloud.visionai_v1.types.warehouse.Asset] = None,
update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.Asset
Updates an asset inside corpus.
# 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 visionai_v1
async def sample_update_asset():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.UpdateAssetRequest(
)
# Make the request
response = await client.update_asset(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.UpdateAssetRequest, dict]]
The request object. Request message for UpdateAsset. |
asset |
Asset
Required. The asset to update. The asset's |
update_mask |
The list of fields to be updated. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.Asset |
An asset is a resource in corpus. It represents a media object inside corpus, contains metadata and another resource annotation. Different feature could be applied to the asset to generate annotations. User could specified annotation related to the target asset. |
update_collection
update_collection(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.UpdateCollectionRequest, dict
]
] = None,
*,
collection: typing.Optional[
google.cloud.visionai_v1.types.warehouse.Collection
] = None,
update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.Collection
Updates a collection.
# 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 visionai_v1
async def sample_update_collection():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.UpdateCollectionRequest(
)
# Make the request
response = await client.update_collection(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.UpdateCollectionRequest, dict]]
The request object. Request message for UpdateCollectionRequest. |
collection |
Collection
Required. The collection to update. The collection's |
update_mask |
The list of fields to be updated. - Unset |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.Collection |
A collection is a resource in a corpus. It serves as a container of references to original resources. |
update_corpus
update_corpus(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.UpdateCorpusRequest, dict]
] = None,
*,
corpus: typing.Optional[google.cloud.visionai_v1.types.warehouse.Corpus] = None,
update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.Corpus
Updates a corpus in a project.
# 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 visionai_v1
async def sample_update_corpus():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
corpus = visionai_v1.Corpus()
corpus.display_name = "display_name_value"
request = visionai_v1.UpdateCorpusRequest(
corpus=corpus,
)
# Make the request
response = await client.update_corpus(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.UpdateCorpusRequest, dict]]
The request object. Request message for UpdateCorpus. |
corpus |
Corpus
Required. The corpus which replaces the resource on the server. This corresponds to the |
update_mask |
The list of fields to be updated. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.Corpus |
Corpus is a set of media contents for management. Within a corpus, media shares the same data schema. Search is also restricted within a single corpus. |
update_data_schema
update_data_schema(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.UpdateDataSchemaRequest, dict
]
] = None,
*,
data_schema: typing.Optional[
google.cloud.visionai_v1.types.warehouse.DataSchema
] = None,
update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.DataSchema
Updates data schema inside corpus.
# 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 visionai_v1
async def sample_update_data_schema():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
data_schema = visionai_v1.DataSchema()
data_schema.key = "key_value"
request = visionai_v1.UpdateDataSchemaRequest(
data_schema=data_schema,
)
# Make the request
response = await client.update_data_schema(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.UpdateDataSchemaRequest, dict]]
The request object. Request message for UpdateDataSchema. |
data_schema |
DataSchema
Required. The data schema's |
update_mask |
The list of fields to be updated. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.DataSchema |
Data schema indicates how the user specified annotation is interpreted in the system. |
update_index
update_index(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.UpdateIndexRequest, dict]
] = None,
*,
index: typing.Optional[google.cloud.visionai_v1.types.warehouse.Index] = None,
update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Updates an Index under the corpus. Users can perform a metadata-only update or trigger a full index rebuild with different update_mask values.
# 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 visionai_v1
async def sample_update_index():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
index = visionai_v1.Index()
index.entire_corpus = True
request = visionai_v1.UpdateIndexRequest(
index=index,
)
# Make the request
operation = client.update_index(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.UpdateIndexRequest, dict]]
The request object. Request message for UpdateIndex. |
index |
Index
Required. The resource being updated. This corresponds to the |
update_mask |
Required. Field mask is used to specify the fields to be overwritten in the Index resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field of the resource will be overwritten if it is in the mask. Empty field mask is not allowed. If the mask is "*", it triggers a full update of the index, and also a whole rebuild of index data. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be Index An Index is a resource in Corpus. It contains an indexed version of the assets and annotations. When deployed to an endpoint, it will allow users to search the Index. |
update_index_endpoint
update_index_endpoint(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.UpdateIndexEndpointRequest, dict
]
] = None,
*,
index_endpoint: typing.Optional[
google.cloud.visionai_v1.types.warehouse.IndexEndpoint
] = None,
update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Updates an IndexEndpoint.
# 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 visionai_v1
async def sample_update_index_endpoint():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.UpdateIndexEndpointRequest(
)
# Make the request
operation = client.update_index_endpoint(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.UpdateIndexEndpointRequest, dict]]
The request object. Request message for UpdateIndexEndpoint. |
index_endpoint |
IndexEndpoint
Required. The resource being updated. This corresponds to the |
update_mask |
Required. Field mask is used to specify the fields to be overwritten in the IndexEndpoint resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field of the resource will be overwritten if it is in the mask. Empty field mask is not allowed. If the mask is "*", then this is a full replacement of the resource. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be IndexEndpoint Message representing IndexEndpoint resource. Indexes are deployed into it. |
update_search_config
update_search_config(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.UpdateSearchConfigRequest, dict
]
] = None,
*,
search_config: typing.Optional[
google.cloud.visionai_v1.types.warehouse.SearchConfig
] = None,
update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.SearchConfig
Updates a search configuration inside a corpus.
Please follow the rules below to create a valid UpdateSearchConfigRequest. --- General Rules ---
- Request.search_configuration.name must already exist.
- Request must contain at least one non-empty search_criteria_property or facet_property.
- mapped_fields must not be empty, and must map to existing UGA keys.
- All mapped_fields must be of the same type.
- All mapped_fields must share the same granularity.
- All mapped_fields must share the same semantic SearchConfig match options. For property-specific rules, please reference the comments for FacetProperty and SearchCriteriaProperty.
# 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 visionai_v1
async def sample_update_search_config():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.UpdateSearchConfigRequest(
)
# Make the request
response = await client.update_search_config(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.UpdateSearchConfigRequest, dict]]
The request object. Request message for UpdateSearchConfig. |
search_config |
SearchConfig
Required. The search configuration to update. The search configuration's |
update_mask |
The list of fields to be updated. If left unset, all field paths will be updated/overwritten. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.SearchConfig |
SearchConfig stores different properties that will affect search behaviors and search results. |
update_search_hypernym
update_search_hypernym(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.UpdateSearchHypernymRequest, dict
]
] = None,
*,
search_hypernym: typing.Optional[
google.cloud.visionai_v1.types.warehouse.SearchHypernym
] = None,
update_mask: typing.Optional[google.protobuf.field_mask_pb2.FieldMask] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.types.warehouse.SearchHypernym
Updates a SearchHypernym inside a corpus.
# 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 visionai_v1
async def sample_update_search_hypernym():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.UpdateSearchHypernymRequest(
)
# Make the request
response = await client.update_search_hypernym(request=request)
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.UpdateSearchHypernymRequest, dict]]
The request object. Request message for updating SearchHypernym. |
search_hypernym |
SearchHypernym
Required. The SearchHypernym to update. The search hypernym's |
update_mask |
The list of fields to be updated. If left unset, all field paths will be updated/overwritten. This corresponds to the |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.types.SearchHypernym |
Search resource: SearchHypernym. For example, { hypernym: "vehicle" hyponyms: ["sedan", "truck"] } This means in SMART_SEARCH mode, searching for "vehicle" will also return results with "sedan" or "truck" as annotations. |
upload_asset
upload_asset(
request: typing.Optional[
typing.Union[google.cloud.visionai_v1.types.warehouse.UploadAssetRequest, dict]
] = None,
*,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.api_core.operation_async.AsyncOperation
Upload asset by specifing the asset Cloud Storage uri. For video warehouse, it requires users who call this API have read access to the cloud storage file. Once it is uploaded, it can be retrieved by GenerateRetrievalUrl API which by default, only can retrieve cloud storage files from the same project of the warehouse. To allow retrieval cloud storage files that are in a separate project, it requires to find the vision ai service account (Go to IAM, check checkbox to show "Include Google-provided role grants", search for "Cloud Vision AI Service Agent") and grant the read access of the cloud storage files to that service account.
# 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 visionai_v1
async def sample_upload_asset():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.UploadAssetRequest(
name="name_value",
)
# Make the request
operation = client.upload_asset(request=request)
print("Waiting for operation to complete...")
response = (await operation).result()
# Handle the response
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.UploadAssetRequest, dict]]
The request object. Request message for UploadAsset. |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.api_core.operation_async.AsyncOperation |
An object representing a long-running operation. The result type for the operation will be UploadAssetResponse Response message for UploadAsset. |
view_collection_items
view_collection_items(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.ViewCollectionItemsRequest, dict
]
] = None,
*,
collection: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.services.warehouse.pagers.ViewCollectionItemsAsyncPager
View items inside a collection.
# 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 visionai_v1
async def sample_view_collection_items():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.ViewCollectionItemsRequest(
collection="collection_value",
)
# Make the request
page_result = client.view_collection_items(request=request)
# Handle the response
async for response in page_result:
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.ViewCollectionItemsRequest, dict]]
The request object. Request message for ViewCollectionItems. |
collection |
Required. The collection to view. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.services.warehouse.pagers.ViewCollectionItemsAsyncPager |
Response message for ViewCollectionItems. Iterating over this object will yield results and resolve additional pages automatically. |
view_indexed_assets
view_indexed_assets(
request: typing.Optional[
typing.Union[
google.cloud.visionai_v1.types.warehouse.ViewIndexedAssetsRequest, dict
]
] = None,
*,
index: typing.Optional[str] = None,
retry: typing.Optional[
typing.Union[
google.api_core.retry.retry_unary_async.AsyncRetry,
google.api_core.gapic_v1.method._MethodDefault,
]
] = _MethodDefault._DEFAULT_VALUE,
timeout: typing.Union[float, object] = _MethodDefault._DEFAULT_VALUE,
metadata: typing.Sequence[typing.Tuple[str, str]] = ()
) -> google.cloud.visionai_v1.services.warehouse.pagers.ViewIndexedAssetsAsyncPager
Lists assets inside an index.
# 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 visionai_v1
async def sample_view_indexed_assets():
# Create a client
client = visionai_v1.WarehouseAsyncClient()
# Initialize request argument(s)
request = visionai_v1.ViewIndexedAssetsRequest(
index="index_value",
)
# Make the request
page_result = client.view_indexed_assets(request=request)
# Handle the response
async for response in page_result:
print(response)
Parameters | |
---|---|
Name | Description |
request |
Optional[Union[google.cloud.visionai_v1.types.ViewIndexedAssetsRequest, dict]]
The request object. Request message for ViewIndexedAssets. |
index |
Required. The index that owns this collection of assets. Format: |
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, str]]
Strings which should be sent along with the request as metadata. |
Returns | |
---|---|
Type | Description |
google.cloud.visionai_v1.services.warehouse.pagers.ViewIndexedAssetsAsyncPager |
Response message for ViewIndexedAssets. Iterating over this object will yield results and resolve additional pages automatically. |