pub struct WarehouseClient<T> { /* private fields */ }
Expand description

Service that manages media content + metadata for streaming.

Implementations§

source§

impl<T> WarehouseClient<T>
where T: GrpcService<BoxBody>, T::Error: Into<StdError>, T::ResponseBody: Body<Data = Bytes> + Send + 'static, <T::ResponseBody as Body>::Error: Into<StdError> + Send,

source

pub fn new(inner: T) -> Self

source

pub fn with_origin(inner: T, origin: Uri) -> Self

source

pub fn with_interceptor<F>( inner: T, interceptor: F, ) -> WarehouseClient<InterceptedService<T, F>>
where F: Interceptor, T::ResponseBody: Default, T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>, <T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,

source

pub fn send_compressed(self, encoding: CompressionEncoding) -> Self

Compress requests with the given encoding.

This requires the server to support it otherwise it might respond with an error.

source

pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self

Enable decompressing responses.

source

pub fn max_decoding_message_size(self, limit: usize) -> Self

Limits the maximum size of a decoded message.

Default: 4MB

source

pub fn max_encoding_message_size(self, limit: usize) -> Self

Limits the maximum size of an encoded message.

Default: usize::MAX

source

pub async fn create_asset( &mut self, request: impl IntoRequest<CreateAssetRequest>, ) -> Result<Response<Asset>, Status>

Creates an asset inside corpus.

source

pub async fn update_asset( &mut self, request: impl IntoRequest<UpdateAssetRequest>, ) -> Result<Response<Asset>, Status>

Updates an asset inside corpus.

source

pub async fn get_asset( &mut self, request: impl IntoRequest<GetAssetRequest>, ) -> Result<Response<Asset>, Status>

Reads an asset inside corpus.

source

pub async fn list_assets( &mut self, request: impl IntoRequest<ListAssetsRequest>, ) -> Result<Response<ListAssetsResponse>, Status>

Lists an list of assets inside corpus.

source

pub async fn delete_asset( &mut self, request: impl IntoRequest<DeleteAssetRequest>, ) -> Result<Response<Operation>, Status>

Deletes asset inside corpus.

source

pub async fn upload_asset( &mut self, request: impl IntoRequest<UploadAssetRequest>, ) -> Result<Response<Operation>, Status>

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.

source

pub async fn generate_retrieval_url( &mut self, request: impl IntoRequest<GenerateRetrievalUrlRequest>, ) -> Result<Response<GenerateRetrievalUrlResponse>, Status>

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.

source

pub async fn analyze_asset( &mut self, request: impl IntoRequest<AnalyzeAssetRequest>, ) -> Result<Response<Operation>, Status>

Analyze asset to power search capability.

source

pub async fn index_asset( &mut self, request: impl IntoRequest<IndexAssetRequest>, ) -> Result<Response<Operation>, Status>

Index one asset for search. Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND

source

pub async fn remove_index_asset( &mut self, request: impl IntoRequest<RemoveIndexAssetRequest>, ) -> Result<Response<Operation>, Status>

Remove one asset’s index data for search. Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND

source

pub async fn view_indexed_assets( &mut self, request: impl IntoRequest<ViewIndexedAssetsRequest>, ) -> Result<Response<ViewIndexedAssetsResponse>, Status>

Lists assets inside an index.

source

pub async fn create_index( &mut self, request: impl IntoRequest<CreateIndexRequest>, ) -> Result<Response<Operation>, Status>

Creates an Index under the corpus.

source

pub async fn update_index( &mut self, request: impl IntoRequest<UpdateIndexRequest>, ) -> Result<Response<Operation>, Status>

Updates an Index under the corpus. Users can perform a metadata-only update or trigger a full index rebuild with different update_mask values.

source

pub async fn get_index( &mut self, request: impl IntoRequest<GetIndexRequest>, ) -> Result<Response<Index>, Status>

Gets the details of a single Index under a Corpus.

source

pub async fn list_indexes( &mut self, request: impl IntoRequest<ListIndexesRequest>, ) -> Result<Response<ListIndexesResponse>, Status>

List all Indexes in a given Corpus.

source

pub async fn delete_index( &mut self, request: impl IntoRequest<DeleteIndexRequest>, ) -> Result<Response<Operation>, Status>

Delete a single Index. In order to delete an index, the caller must make sure that it is not deployed to any index endpoint.

source

pub async fn create_corpus( &mut self, request: impl IntoRequest<CreateCorpusRequest>, ) -> Result<Response<Operation>, Status>

Creates a corpus inside a project.

source

pub async fn get_corpus( &mut self, request: impl IntoRequest<GetCorpusRequest>, ) -> Result<Response<Corpus>, Status>

Gets corpus details inside a project.

source

pub async fn update_corpus( &mut self, request: impl IntoRequest<UpdateCorpusRequest>, ) -> Result<Response<Corpus>, Status>

Updates a corpus in a project.

source

pub async fn list_corpora( &mut self, request: impl IntoRequest<ListCorporaRequest>, ) -> Result<Response<ListCorporaResponse>, Status>

Lists all corpora in a project.

source

pub async fn delete_corpus( &mut self, request: impl IntoRequest<DeleteCorpusRequest>, ) -> Result<Response<()>, Status>

Deletes a corpus only if its empty. Returns empty response.

source

pub async fn analyze_corpus( &mut self, request: impl IntoRequest<AnalyzeCorpusRequest>, ) -> Result<Response<Operation>, Status>

Analyzes a corpus.

source

pub async fn create_data_schema( &mut self, request: impl IntoRequest<CreateDataSchemaRequest>, ) -> Result<Response<DataSchema>, Status>

Creates data schema inside corpus.

source

pub async fn update_data_schema( &mut self, request: impl IntoRequest<UpdateDataSchemaRequest>, ) -> Result<Response<DataSchema>, Status>

Updates data schema inside corpus.

source

pub async fn get_data_schema( &mut self, request: impl IntoRequest<GetDataSchemaRequest>, ) -> Result<Response<DataSchema>, Status>

Gets data schema inside corpus.

source

pub async fn delete_data_schema( &mut self, request: impl IntoRequest<DeleteDataSchemaRequest>, ) -> Result<Response<()>, Status>

Deletes data schema inside corpus.

source

pub async fn list_data_schemas( &mut self, request: impl IntoRequest<ListDataSchemasRequest>, ) -> Result<Response<ListDataSchemasResponse>, Status>

Lists a list of data schemas inside corpus.

source

pub async fn create_annotation( &mut self, request: impl IntoRequest<CreateAnnotationRequest>, ) -> Result<Response<Annotation>, Status>

Creates annotation inside asset.

source

pub async fn get_annotation( &mut self, request: impl IntoRequest<GetAnnotationRequest>, ) -> Result<Response<Annotation>, Status>

Reads annotation inside asset.

source

pub async fn list_annotations( &mut self, request: impl IntoRequest<ListAnnotationsRequest>, ) -> Result<Response<ListAnnotationsResponse>, Status>

Lists a list of annotations inside asset.

source

pub async fn update_annotation( &mut self, request: impl IntoRequest<UpdateAnnotationRequest>, ) -> Result<Response<Annotation>, Status>

Updates annotation inside asset.

source

pub async fn delete_annotation( &mut self, request: impl IntoRequest<DeleteAnnotationRequest>, ) -> Result<Response<()>, Status>

Deletes annotation inside asset.

source

pub async fn ingest_asset( &mut self, request: impl IntoStreamingRequest<Message = IngestAssetRequest>, ) -> Result<Response<Streaming<IngestAssetResponse>>, Status>

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).

source

pub async fn clip_asset( &mut self, request: impl IntoRequest<ClipAssetRequest>, ) -> Result<Response<ClipAssetResponse>, Status>

Supported by STREAM_VIDEO corpus type. 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.

source

pub async fn generate_hls_uri( &mut self, request: impl IntoRequest<GenerateHlsUriRequest>, ) -> Result<Response<GenerateHlsUriResponse>, Status>

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.

source

pub async fn import_assets( &mut self, request: impl IntoRequest<ImportAssetsRequest>, ) -> Result<Response<Operation>, Status>

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.

source

pub async fn create_search_config( &mut self, request: impl IntoRequest<CreateSearchConfigRequest>, ) -> Result<Response<SearchConfig>, Status>

Creates a search configuration inside a corpus.

Please follow the rules below to create a valid CreateSearchConfigRequest. — General Rules —

  1. Request.search_config_id must not be associated with an existing SearchConfig.
  2. Request must contain at least one non-empty search_criteria_property or facet_property.
  3. mapped_fields must not be empty, and must map to existing UGA keys.
  4. All mapped_fields must be of the same type.
  5. All mapped_fields must share the same granularity.
  6. All mapped_fields must share the same semantic SearchConfig match options. For property-specific rules, please reference the comments for FacetProperty and SearchCriteriaProperty.
source

pub async fn update_search_config( &mut self, request: impl IntoRequest<UpdateSearchConfigRequest>, ) -> Result<Response<SearchConfig>, Status>

Updates a search configuration inside a corpus.

Please follow the rules below to create a valid UpdateSearchConfigRequest. — General Rules —

  1. Request.search_configuration.name must already exist.
  2. Request must contain at least one non-empty search_criteria_property or facet_property.
  3. mapped_fields must not be empty, and must map to existing UGA keys.
  4. All mapped_fields must be of the same type.
  5. All mapped_fields must share the same granularity.
  6. All mapped_fields must share the same semantic SearchConfig match options. For property-specific rules, please reference the comments for FacetProperty and SearchCriteriaProperty.
source

pub async fn get_search_config( &mut self, request: impl IntoRequest<GetSearchConfigRequest>, ) -> Result<Response<SearchConfig>, Status>

Gets a search configuration inside a corpus.

source

pub async fn delete_search_config( &mut self, request: impl IntoRequest<DeleteSearchConfigRequest>, ) -> Result<Response<()>, Status>

Deletes a search configuration inside a corpus.

For a DeleteSearchConfigRequest to be valid, Request.search_configuration.name must already exist.

source

pub async fn list_search_configs( &mut self, request: impl IntoRequest<ListSearchConfigsRequest>, ) -> Result<Response<ListSearchConfigsResponse>, Status>

Lists all search configurations inside a corpus.

source

pub async fn create_search_hypernym( &mut self, request: impl IntoRequest<CreateSearchHypernymRequest>, ) -> Result<Response<SearchHypernym>, Status>

Creates a SearchHypernym inside a corpus.

source

pub async fn update_search_hypernym( &mut self, request: impl IntoRequest<UpdateSearchHypernymRequest>, ) -> Result<Response<SearchHypernym>, Status>

Updates a SearchHypernym inside a corpus.

source

pub async fn get_search_hypernym( &mut self, request: impl IntoRequest<GetSearchHypernymRequest>, ) -> Result<Response<SearchHypernym>, Status>

Gets a SearchHypernym inside a corpus.

source

pub async fn delete_search_hypernym( &mut self, request: impl IntoRequest<DeleteSearchHypernymRequest>, ) -> Result<Response<()>, Status>

Deletes a SearchHypernym inside a corpus.

source

pub async fn list_search_hypernyms( &mut self, request: impl IntoRequest<ListSearchHypernymsRequest>, ) -> Result<Response<ListSearchHypernymsResponse>, Status>

Lists SearchHypernyms inside a corpus.

source

pub async fn search_assets( &mut self, request: impl IntoRequest<SearchAssetsRequest>, ) -> Result<Response<SearchAssetsResponse>, Status>

Search media asset.

source

pub async fn search_index_endpoint( &mut self, request: impl IntoRequest<SearchIndexEndpointRequest>, ) -> Result<Response<SearchIndexEndpointResponse>, Status>

Search a deployed index endpoint (IMAGE corpus type only).

source

pub async fn create_index_endpoint( &mut self, request: impl IntoRequest<CreateIndexEndpointRequest>, ) -> Result<Response<Operation>, Status>

Creates an IndexEndpoint.

source

pub async fn get_index_endpoint( &mut self, request: impl IntoRequest<GetIndexEndpointRequest>, ) -> Result<Response<IndexEndpoint>, Status>

Gets an IndexEndpoint.

source

pub async fn list_index_endpoints( &mut self, request: impl IntoRequest<ListIndexEndpointsRequest>, ) -> Result<Response<ListIndexEndpointsResponse>, Status>

Lists all IndexEndpoints in a project.

source

pub async fn update_index_endpoint( &mut self, request: impl IntoRequest<UpdateIndexEndpointRequest>, ) -> Result<Response<Operation>, Status>

Updates an IndexEndpoint.

source

pub async fn delete_index_endpoint( &mut self, request: impl IntoRequest<DeleteIndexEndpointRequest>, ) -> Result<Response<Operation>, Status>

Deletes an IndexEndpoint.

source

pub async fn deploy_index( &mut self, request: impl IntoRequest<DeployIndexRequest>, ) -> Result<Response<Operation>, Status>

Deploys an Index to IndexEndpoint.

source

pub async fn undeploy_index( &mut self, request: impl IntoRequest<UndeployIndexRequest>, ) -> Result<Response<Operation>, Status>

Undeploys an Index from IndexEndpoint.

source

pub async fn create_collection( &mut self, request: impl IntoRequest<CreateCollectionRequest>, ) -> Result<Response<Operation>, Status>

Creates a collection.

source

pub async fn delete_collection( &mut self, request: impl IntoRequest<DeleteCollectionRequest>, ) -> Result<Response<Operation>, Status>

Deletes a collection.

source

pub async fn get_collection( &mut self, request: impl IntoRequest<GetCollectionRequest>, ) -> Result<Response<Collection>, Status>

Gets a collection.

source

pub async fn update_collection( &mut self, request: impl IntoRequest<UpdateCollectionRequest>, ) -> Result<Response<Collection>, Status>

Updates a collection.

source

pub async fn list_collections( &mut self, request: impl IntoRequest<ListCollectionsRequest>, ) -> Result<Response<ListCollectionsResponse>, Status>

Lists collections inside a corpus.

source

pub async fn add_collection_item( &mut self, request: impl IntoRequest<AddCollectionItemRequest>, ) -> Result<Response<AddCollectionItemResponse>, Status>

Adds an item into a Collection.

source

pub async fn remove_collection_item( &mut self, request: impl IntoRequest<RemoveCollectionItemRequest>, ) -> Result<Response<RemoveCollectionItemResponse>, Status>

Removes an item from a collection.

source

pub async fn view_collection_items( &mut self, request: impl IntoRequest<ViewCollectionItemsRequest>, ) -> Result<Response<ViewCollectionItemsResponse>, Status>

View items inside a collection.

Trait Implementations§

source§

impl<T: Clone> Clone for WarehouseClient<T>

source§

fn clone(&self) -> WarehouseClient<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for WarehouseClient<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for WarehouseClient<T>

§

impl<T> RefUnwindSafe for WarehouseClient<T>
where T: RefUnwindSafe,

§

impl<T> Send for WarehouseClient<T>
where T: Send,

§

impl<T> Sync for WarehouseClient<T>
where T: Sync,

§

impl<T> Unpin for WarehouseClient<T>
where T: Unpin,

§

impl<T> UnwindSafe for WarehouseClient<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more