pub struct ProjectMethods<'a, S>
where S: 'a,
{ /* private fields */ }
Expand description

A builder providing access to all methods supported on project resources. It is not used directly, but through the Vision hub.

§Example

Instantiate a resource builder

extern crate hyper;
extern crate hyper_rustls;
extern crate google_vision1 as vision1;
 
use std::default::Default;
use vision1::{Vision, oauth2, hyper, hyper_rustls, chrono, FieldMask};
 
let secret: oauth2::ApplicationSecret = Default::default();
let auth = oauth2::InstalledFlowAuthenticator::builder(
        secret,
        oauth2::InstalledFlowReturnMethod::HTTPRedirect,
    ).build().await.unwrap();
let mut hub = Vision::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `files_annotate(...)`, `files_async_batch_annotate(...)`, `images_annotate(...)`, `images_async_batch_annotate(...)`, `locations_files_annotate(...)`, `locations_files_async_batch_annotate(...)`, `locations_images_annotate(...)`, `locations_images_async_batch_annotate(...)`, `locations_operations_get(...)`, `locations_product_sets_add_product(...)`, `locations_product_sets_create(...)`, `locations_product_sets_delete(...)`, `locations_product_sets_get(...)`, `locations_product_sets_import(...)`, `locations_product_sets_list(...)`, `locations_product_sets_patch(...)`, `locations_product_sets_products_list(...)`, `locations_product_sets_remove_product(...)`, `locations_products_create(...)`, `locations_products_delete(...)`, `locations_products_get(...)`, `locations_products_list(...)`, `locations_products_patch(...)`, `locations_products_purge(...)`, `locations_products_reference_images_create(...)`, `locations_products_reference_images_delete(...)`, `locations_products_reference_images_get(...)`, `locations_products_reference_images_list(...)` and `operations_get(...)`
// to build up your call.
let rb = hub.projects();

Implementations§

source§

impl<'a, S> ProjectMethods<'a, S>

source

pub fn files_annotate( &self, request: BatchAnnotateFilesRequest, parent: &str ) -> ProjectFileAnnotateCall<'a, S>

Create a builder to help you perform the following task:

Service that performs image detection and annotation for a batch of files. Now only “application/pdf”, “image/tiff” and “image/gif” are supported. This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted.

§Arguments
  • request - No description provided.
  • parent - Optional. Target project and location to make a call. Format: projects/{project-id}/locations/{location-id}. If no parent is specified, a region will be chosen automatically. Supported location-ids: us: USA country only, asia: East asia areas, like Japan, Taiwan, eu: The European Union. Example: projects/project-A/locations/eu.
source

pub fn files_async_batch_annotate( &self, request: AsyncBatchAnnotateFilesRequest, parent: &str ) -> ProjectFileAsyncBatchAnnotateCall<'a, S>

Create a builder to help you perform the following task:

Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the google.longrunning.Operations interface. Operation.metadata contains OperationMetadata (metadata). Operation.response contains AsyncBatchAnnotateFilesResponse (results).

§Arguments
  • request - No description provided.
  • parent - Optional. Target project and location to make a call. Format: projects/{project-id}/locations/{location-id}. If no parent is specified, a region will be chosen automatically. Supported location-ids: us: USA country only, asia: East asia areas, like Japan, Taiwan, eu: The European Union. Example: projects/project-A/locations/eu.
source

pub fn images_annotate( &self, request: BatchAnnotateImagesRequest, parent: &str ) -> ProjectImageAnnotateCall<'a, S>

Create a builder to help you perform the following task:

Run image detection and annotation for a batch of images.

§Arguments
  • request - No description provided.
  • parent - Optional. Target project and location to make a call. Format: projects/{project-id}/locations/{location-id}. If no parent is specified, a region will be chosen automatically. Supported location-ids: us: USA country only, asia: East asia areas, like Japan, Taiwan, eu: The European Union. Example: projects/project-A/locations/eu.
source

pub fn images_async_batch_annotate( &self, request: AsyncBatchAnnotateImagesRequest, parent: &str ) -> ProjectImageAsyncBatchAnnotateCall<'a, S>

Create a builder to help you perform the following task:

Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the google.longrunning.Operations interface. Operation.metadata contains OperationMetadata (metadata). Operation.response contains AsyncBatchAnnotateImagesResponse (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto.

§Arguments
  • request - No description provided.
  • parent - Optional. Target project and location to make a call. Format: projects/{project-id}/locations/{location-id}. If no parent is specified, a region will be chosen automatically. Supported location-ids: us: USA country only, asia: East asia areas, like Japan, Taiwan, eu: The European Union. Example: projects/project-A/locations/eu.
source

pub fn locations_files_annotate( &self, request: BatchAnnotateFilesRequest, parent: &str ) -> ProjectLocationFileAnnotateCall<'a, S>

Create a builder to help you perform the following task:

Service that performs image detection and annotation for a batch of files. Now only “application/pdf”, “image/tiff” and “image/gif” are supported. This service will extract at most 5 (customers can specify which 5 in AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each file provided and perform detection and annotation for each image extracted.

§Arguments
  • request - No description provided.
  • parent - Optional. Target project and location to make a call. Format: projects/{project-id}/locations/{location-id}. If no parent is specified, a region will be chosen automatically. Supported location-ids: us: USA country only, asia: East asia areas, like Japan, Taiwan, eu: The European Union. Example: projects/project-A/locations/eu.
source

pub fn locations_files_async_batch_annotate( &self, request: AsyncBatchAnnotateFilesRequest, parent: &str ) -> ProjectLocationFileAsyncBatchAnnotateCall<'a, S>

Create a builder to help you perform the following task:

Run asynchronous image detection and annotation for a list of generic files, such as PDF files, which may contain multiple pages and multiple images per page. Progress and results can be retrieved through the google.longrunning.Operations interface. Operation.metadata contains OperationMetadata (metadata). Operation.response contains AsyncBatchAnnotateFilesResponse (results).

§Arguments
  • request - No description provided.
  • parent - Optional. Target project and location to make a call. Format: projects/{project-id}/locations/{location-id}. If no parent is specified, a region will be chosen automatically. Supported location-ids: us: USA country only, asia: East asia areas, like Japan, Taiwan, eu: The European Union. Example: projects/project-A/locations/eu.
source

pub fn locations_images_annotate( &self, request: BatchAnnotateImagesRequest, parent: &str ) -> ProjectLocationImageAnnotateCall<'a, S>

Create a builder to help you perform the following task:

Run image detection and annotation for a batch of images.

§Arguments
  • request - No description provided.
  • parent - Optional. Target project and location to make a call. Format: projects/{project-id}/locations/{location-id}. If no parent is specified, a region will be chosen automatically. Supported location-ids: us: USA country only, asia: East asia areas, like Japan, Taiwan, eu: The European Union. Example: projects/project-A/locations/eu.
source

pub fn locations_images_async_batch_annotate( &self, request: AsyncBatchAnnotateImagesRequest, parent: &str ) -> ProjectLocationImageAsyncBatchAnnotateCall<'a, S>

Create a builder to help you perform the following task:

Run asynchronous image detection and annotation for a list of images. Progress and results can be retrieved through the google.longrunning.Operations interface. Operation.metadata contains OperationMetadata (metadata). Operation.response contains AsyncBatchAnnotateImagesResponse (results). This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse proto.

§Arguments
  • request - No description provided.
  • parent - Optional. Target project and location to make a call. Format: projects/{project-id}/locations/{location-id}. If no parent is specified, a region will be chosen automatically. Supported location-ids: us: USA country only, asia: East asia areas, like Japan, Taiwan, eu: The European Union. Example: projects/project-A/locations/eu.
source

pub fn locations_operations_get( &self, name: &str ) -> ProjectLocationOperationGetCall<'a, S>

Create a builder to help you perform the following task:

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

§Arguments
  • name - The name of the operation resource.
source

pub fn locations_product_sets_products_list( &self, name: &str ) -> ProjectLocationProductSetProductListCall<'a, S>

Create a builder to help you perform the following task:

Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, the products field of the response will be empty. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.

§Arguments
  • name - Required. The ProductSet resource for which to retrieve Products. Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID
source

pub fn locations_product_sets_add_product( &self, request: AddProductToProductSetRequest, name: &str ) -> ProjectLocationProductSetAddProductCall<'a, S>

Create a builder to help you perform the following task:

Adds a Product to the specified ProductSet. If the Product is already present, no change is made. One Product can be added to at most 100 ProductSets. Possible errors: * Returns NOT_FOUND if the Product or the ProductSet doesn’t exist.

§Arguments
  • request - No description provided.
  • name - Required. The resource name for the ProductSet to modify. Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID
source

pub fn locations_product_sets_create( &self, request: ProductSet, parent: &str ) -> ProjectLocationProductSetCreateCall<'a, S>

Create a builder to help you perform the following task:

Creates and returns a new ProductSet resource. Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.

§Arguments
  • request - No description provided.
  • parent - Required. The project in which the ProductSet should be created. Format is projects/PROJECT_ID/locations/LOC_ID.
source

pub fn locations_product_sets_delete( &self, name: &str ) -> ProjectLocationProductSetDeleteCall<'a, S>

Create a builder to help you perform the following task:

Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted. The actual image files are not deleted from Google Cloud Storage.

§Arguments
  • name - Required. Resource name of the ProductSet to delete. Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID
source

pub fn locations_product_sets_get( &self, name: &str ) -> ProjectLocationProductSetGetCall<'a, S>

Create a builder to help you perform the following task:

Gets information associated with a ProductSet. Possible errors: * Returns NOT_FOUND if the ProductSet does not exist.

§Arguments
  • name - Required. Resource name of the ProductSet to get. Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID
source

pub fn locations_product_sets_import( &self, request: ImportProductSetsRequest, parent: &str ) -> ProjectLocationProductSetImportCall<'a, S>

Create a builder to help you perform the following task:

Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. The google.longrunning.Operation API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress) Operation.response contains ImportProductSetsResponse. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see ImportProductSetsGcsSource.csv_file_uri.

§Arguments
  • request - No description provided.
  • parent - Required. The project in which the ProductSets should be imported. Format is projects/PROJECT_ID/locations/LOC_ID.
source

pub fn locations_product_sets_list( &self, parent: &str ) -> ProjectLocationProductSetListCall<'a, S>

Create a builder to help you perform the following task:

Lists ProductSets in an unspecified order. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.

§Arguments
  • parent - Required. The project from which ProductSets should be listed. Format is projects/PROJECT_ID/locations/LOC_ID.
source

pub fn locations_product_sets_patch( &self, request: ProductSet, name: &str ) -> ProjectLocationProductSetPatchCall<'a, S>

Create a builder to help you perform the following task:

Makes changes to a ProductSet resource. Only display_name can be updated currently. Possible errors: * Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but missing from the request or longer than 4096 characters.

§Arguments
  • request - No description provided.
  • name - The resource name of the ProductSet. Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID. This field is ignored when creating a ProductSet.
source

pub fn locations_product_sets_remove_product( &self, request: RemoveProductFromProductSetRequest, name: &str ) -> ProjectLocationProductSetRemoveProductCall<'a, S>

Create a builder to help you perform the following task:

Removes a Product from the specified ProductSet.

§Arguments
  • request - No description provided.
  • name - Required. The resource name for the ProductSet to modify. Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID
source

pub fn locations_products_reference_images_create( &self, request: ReferenceImage, parent: &str ) -> ProjectLocationProductReferenceImageCreateCall<'a, S>

Create a builder to help you perform the following task:

Creates and returns a new ReferenceImage resource. The bounding_poly field is optional. If bounding_poly is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). Possible errors: * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if the product does not exist. * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product’s product_category is detected. * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.

§Arguments
  • request - No description provided.
  • parent - Required. Resource name of the product in which to create the reference image. Format is projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.
source

pub fn locations_products_reference_images_delete( &self, name: &str ) -> ProjectLocationProductReferenceImageDeleteCall<'a, S>

Create a builder to help you perform the following task:

Permanently deletes a reference image. The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage.

§Arguments
  • name - Required. The resource name of the reference image to delete. Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID
source

pub fn locations_products_reference_images_get( &self, name: &str ) -> ProjectLocationProductReferenceImageGetCall<'a, S>

Create a builder to help you perform the following task:

Gets information associated with a ReferenceImage. Possible errors: * Returns NOT_FOUND if the specified image does not exist.

§Arguments
  • name - Required. The resource name of the ReferenceImage to get. Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID.
source

pub fn locations_products_reference_images_list( &self, parent: &str ) -> ProjectLocationProductReferenceImageListCall<'a, S>

Create a builder to help you perform the following task:

Lists reference images. Possible errors: * Returns NOT_FOUND if the parent product does not exist. * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1.

§Arguments
  • parent - Required. Resource name of the product containing the reference images. Format is projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.
source

pub fn locations_products_create( &self, request: Product, parent: &str ) -> ProjectLocationProductCreateCall<'a, S>

Create a builder to help you perform the following task:

Creates and returns a new product resource. Possible errors: * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid.

§Arguments
  • request - No description provided.
  • parent - Required. The project in which the Product should be created. Format is projects/PROJECT_ID/locations/LOC_ID.
source

pub fn locations_products_delete( &self, name: &str ) -> ProjectLocationProductDeleteCall<'a, S>

Create a builder to help you perform the following task:

Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.

§Arguments
  • name - Required. Resource name of product to delete. Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID
source

pub fn locations_products_get( &self, name: &str ) -> ProjectLocationProductGetCall<'a, S>

Create a builder to help you perform the following task:

Gets information associated with a Product. Possible errors: * Returns NOT_FOUND if the Product does not exist.

§Arguments
  • name - Required. Resource name of the Product to get. Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID
source

pub fn locations_products_list( &self, parent: &str ) -> ProjectLocationProductListCall<'a, S>

Create a builder to help you perform the following task:

Lists products in an unspecified order. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.

§Arguments
  • parent - Required. The project OR ProductSet from which Products should be listed. Format: projects/PROJECT_ID/locations/LOC_ID
source

pub fn locations_products_patch( &self, request: Product, name: &str ) -> ProjectLocationProductPatchCall<'a, S>

Create a builder to help you perform the following task:

Makes changes to a Product resource. Only the display_name, description, and labels fields can be updated right now. If labels are updated, the change will not be reflected in queries until the next index time. Possible errors: * Returns NOT_FOUND if the Product does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but is missing from the request or longer than 4096 characters. * Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is present in update_mask.

§Arguments
  • request - No description provided.
  • name - The resource name of the product. Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID. This field is ignored when creating a product.
source

pub fn locations_products_purge( &self, request: PurgeProductsRequest, parent: &str ) -> ProjectLocationProductPurgeCall<'a, S>

Create a builder to help you perform the following task:

Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted. It’s not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. The google.longrunning.Operation API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress)

§Arguments
  • request - No description provided.
  • parent - Required. The project and location in which the Products should be deleted. Format is projects/PROJECT_ID/locations/LOC_ID.
source

pub fn operations_get(&self, name: &str) -> ProjectOperationGetCall<'a, S>

Create a builder to help you perform the following task:

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

§Arguments
  • name - The name of the operation resource.

Trait Implementations§

source§

impl<'a, S> MethodsBuilder for ProjectMethods<'a, S>

Auto Trait Implementations§

§

impl<'a, S> !RefUnwindSafe for ProjectMethods<'a, S>

§

impl<'a, S> Send for ProjectMethods<'a, S>
where S: Sync,

§

impl<'a, S> Sync for ProjectMethods<'a, S>
where S: Sync,

§

impl<'a, S> Unpin for ProjectMethods<'a, S>

§

impl<'a, S> !UnwindSafe for ProjectMethods<'a, S>

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.

source§

impl<T> Instrument for T

source§

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

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

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, 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.
source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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