#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClassificationAnnotation {
#[prost(float, tag = "1")]
pub score: f32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClassificationEvaluationMetrics {
#[prost(float, tag = "1")]
pub au_prc: f32,
#[prost(float, tag = "6")]
pub au_roc: f32,
#[prost(float, tag = "7")]
pub log_loss: f32,
#[prost(message, repeated, tag = "3")]
pub confidence_metrics_entry:
::prost::alloc::vec::Vec<classification_evaluation_metrics::ConfidenceMetricsEntry>,
#[prost(message, optional, tag = "4")]
pub confusion_matrix:
::core::option::Option<classification_evaluation_metrics::ConfusionMatrix>,
#[prost(string, repeated, tag = "5")]
pub annotation_spec_id: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
pub mod classification_evaluation_metrics {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfidenceMetricsEntry {
#[prost(float, tag = "1")]
pub confidence_threshold: f32,
#[prost(int32, tag = "14")]
pub position_threshold: i32,
#[prost(float, tag = "2")]
pub recall: f32,
#[prost(float, tag = "3")]
pub precision: f32,
#[prost(float, tag = "8")]
pub false_positive_rate: f32,
#[prost(float, tag = "4")]
pub f1_score: f32,
#[prost(float, tag = "5")]
pub recall_at1: f32,
#[prost(float, tag = "6")]
pub precision_at1: f32,
#[prost(float, tag = "9")]
pub false_positive_rate_at1: f32,
#[prost(float, tag = "7")]
pub f1_score_at1: f32,
#[prost(int64, tag = "10")]
pub true_positive_count: i64,
#[prost(int64, tag = "11")]
pub false_positive_count: i64,
#[prost(int64, tag = "12")]
pub false_negative_count: i64,
#[prost(int64, tag = "13")]
pub true_negative_count: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfusionMatrix {
#[prost(string, repeated, tag = "1")]
pub annotation_spec_id: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "3")]
pub display_name: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, repeated, tag = "2")]
pub row: ::prost::alloc::vec::Vec<confusion_matrix::Row>,
}
pub mod confusion_matrix {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Row {
#[prost(int32, repeated, tag = "1")]
pub example_count: ::prost::alloc::vec::Vec<i32>,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ClassificationType {
Unspecified = 0,
Multiclass = 1,
Multilabel = 2,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NormalizedVertex {
#[prost(float, tag = "1")]
pub x: f32,
#[prost(float, tag = "2")]
pub y: f32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BoundingPoly {
#[prost(message, repeated, tag = "2")]
pub normalized_vertices: ::prost::alloc::vec::Vec<NormalizedVertex>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImageObjectDetectionAnnotation {
#[prost(message, optional, tag = "1")]
pub bounding_box: ::core::option::Option<BoundingPoly>,
#[prost(float, tag = "2")]
pub score: f32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BoundingBoxMetricsEntry {
#[prost(float, tag = "1")]
pub iou_threshold: f32,
#[prost(float, tag = "2")]
pub mean_average_precision: f32,
#[prost(message, repeated, tag = "3")]
pub confidence_metrics_entries:
::prost::alloc::vec::Vec<bounding_box_metrics_entry::ConfidenceMetricsEntry>,
}
pub mod bounding_box_metrics_entry {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfidenceMetricsEntry {
#[prost(float, tag = "1")]
pub confidence_threshold: f32,
#[prost(float, tag = "2")]
pub recall: f32,
#[prost(float, tag = "3")]
pub precision: f32,
#[prost(float, tag = "4")]
pub f1_score: f32,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImageObjectDetectionEvaluationMetrics {
#[prost(int32, tag = "1")]
pub evaluated_bounding_box_count: i32,
#[prost(message, repeated, tag = "2")]
pub bounding_box_metrics_entries: ::prost::alloc::vec::Vec<BoundingBoxMetricsEntry>,
#[prost(float, tag = "3")]
pub bounding_box_mean_average_precision: f32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextSegment {
#[prost(string, tag = "3")]
pub content: ::prost::alloc::string::String,
#[prost(int64, tag = "1")]
pub start_offset: i64,
#[prost(int64, tag = "2")]
pub end_offset: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextExtractionAnnotation {
#[prost(float, tag = "1")]
pub score: f32,
#[prost(oneof = "text_extraction_annotation::Annotation", tags = "3")]
pub annotation: ::core::option::Option<text_extraction_annotation::Annotation>,
}
pub mod text_extraction_annotation {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Annotation {
#[prost(message, tag = "3")]
TextSegment(super::TextSegment),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextExtractionEvaluationMetrics {
#[prost(float, tag = "1")]
pub au_prc: f32,
#[prost(message, repeated, tag = "2")]
pub confidence_metrics_entries:
::prost::alloc::vec::Vec<text_extraction_evaluation_metrics::ConfidenceMetricsEntry>,
}
pub mod text_extraction_evaluation_metrics {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfidenceMetricsEntry {
#[prost(float, tag = "1")]
pub confidence_threshold: f32,
#[prost(float, tag = "3")]
pub recall: f32,
#[prost(float, tag = "4")]
pub precision: f32,
#[prost(float, tag = "5")]
pub f1_score: f32,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextSentimentAnnotation {
#[prost(int32, tag = "1")]
pub sentiment: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextSentimentEvaluationMetrics {
#[prost(float, tag = "1")]
pub precision: f32,
#[prost(float, tag = "2")]
pub recall: f32,
#[prost(float, tag = "3")]
pub f1_score: f32,
#[prost(float, tag = "4")]
pub mean_absolute_error: f32,
#[prost(float, tag = "5")]
pub mean_squared_error: f32,
#[prost(float, tag = "6")]
pub linear_kappa: f32,
#[prost(float, tag = "7")]
pub quadratic_kappa: f32,
#[prost(message, optional, tag = "8")]
pub confusion_matrix:
::core::option::Option<classification_evaluation_metrics::ConfusionMatrix>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InputConfig {
#[prost(map = "string, string", tag = "2")]
pub params:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(oneof = "input_config::Source", tags = "1")]
pub source: ::core::option::Option<input_config::Source>,
}
pub mod input_config {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Source {
#[prost(message, tag = "1")]
GcsSource(super::GcsSource),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchPredictInputConfig {
#[prost(oneof = "batch_predict_input_config::Source", tags = "1")]
pub source: ::core::option::Option<batch_predict_input_config::Source>,
}
pub mod batch_predict_input_config {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Source {
#[prost(message, tag = "1")]
GcsSource(super::GcsSource),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DocumentInputConfig {
#[prost(message, optional, tag = "1")]
pub gcs_source: ::core::option::Option<GcsSource>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutputConfig {
#[prost(oneof = "output_config::Destination", tags = "1")]
pub destination: ::core::option::Option<output_config::Destination>,
}
pub mod output_config {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Destination {
#[prost(message, tag = "1")]
GcsDestination(super::GcsDestination),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchPredictOutputConfig {
#[prost(oneof = "batch_predict_output_config::Destination", tags = "1")]
pub destination: ::core::option::Option<batch_predict_output_config::Destination>,
}
pub mod batch_predict_output_config {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Destination {
#[prost(message, tag = "1")]
GcsDestination(super::GcsDestination),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ModelExportOutputConfig {
#[prost(string, tag = "4")]
pub model_format: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "2")]
pub params:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(oneof = "model_export_output_config::Destination", tags = "1")]
pub destination: ::core::option::Option<model_export_output_config::Destination>,
}
pub mod model_export_output_config {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Destination {
#[prost(message, tag = "1")]
GcsDestination(super::GcsDestination),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GcsSource {
#[prost(string, repeated, tag = "1")]
pub input_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GcsDestination {
#[prost(string, tag = "1")]
pub output_uri_prefix: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Image {
#[prost(string, tag = "4")]
pub thumbnail_uri: ::prost::alloc::string::String,
#[prost(oneof = "image::Data", tags = "1")]
pub data: ::core::option::Option<image::Data>,
}
pub mod image {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Data {
#[prost(bytes, tag = "1")]
ImageBytes(::prost::alloc::vec::Vec<u8>),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextSnippet {
#[prost(string, tag = "1")]
pub content: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub mime_type: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub content_uri: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DocumentDimensions {
#[prost(enumeration = "document_dimensions::DocumentDimensionUnit", tag = "1")]
pub unit: i32,
#[prost(float, tag = "2")]
pub width: f32,
#[prost(float, tag = "3")]
pub height: f32,
}
pub mod document_dimensions {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DocumentDimensionUnit {
Unspecified = 0,
Inch = 1,
Centimeter = 2,
Point = 3,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Document {
#[prost(message, optional, tag = "1")]
pub input_config: ::core::option::Option<DocumentInputConfig>,
#[prost(message, optional, tag = "2")]
pub document_text: ::core::option::Option<TextSnippet>,
#[prost(message, repeated, tag = "3")]
pub layout: ::prost::alloc::vec::Vec<document::Layout>,
#[prost(message, optional, tag = "4")]
pub document_dimensions: ::core::option::Option<DocumentDimensions>,
#[prost(int32, tag = "5")]
pub page_count: i32,
}
pub mod document {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Layout {
#[prost(message, optional, tag = "1")]
pub text_segment: ::core::option::Option<super::TextSegment>,
#[prost(int32, tag = "2")]
pub page_number: i32,
#[prost(message, optional, tag = "3")]
pub bounding_poly: ::core::option::Option<super::BoundingPoly>,
#[prost(enumeration = "layout::TextSegmentType", tag = "4")]
pub text_segment_type: i32,
}
pub mod layout {
#[derive(
Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration,
)]
#[repr(i32)]
pub enum TextSegmentType {
Unspecified = 0,
Token = 1,
Paragraph = 2,
FormField = 3,
FormFieldName = 4,
FormFieldContents = 5,
Table = 6,
TableHeader = 7,
TableRow = 8,
TableCell = 9,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExamplePayload {
#[prost(oneof = "example_payload::Payload", tags = "1, 2, 4")]
pub payload: ::core::option::Option<example_payload::Payload>,
}
pub mod example_payload {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "1")]
Image(super::Image),
#[prost(message, tag = "2")]
TextSnippet(super::TextSnippet),
#[prost(message, tag = "4")]
Document(super::Document),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TranslationDatasetMetadata {
#[prost(string, tag = "1")]
pub source_language_code: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub target_language_code: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TranslationEvaluationMetrics {
#[prost(double, tag = "1")]
pub bleu_score: f64,
#[prost(double, tag = "2")]
pub base_bleu_score: f64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TranslationModelMetadata {
#[prost(string, tag = "1")]
pub base_model: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub source_language_code: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub target_language_code: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TranslationAnnotation {
#[prost(message, optional, tag = "1")]
pub translated_content: ::core::option::Option<TextSnippet>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnnotationPayload {
#[prost(string, tag = "1")]
pub annotation_spec_id: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub display_name: ::prost::alloc::string::String,
#[prost(oneof = "annotation_payload::Detail", tags = "2, 3, 4, 6, 7")]
pub detail: ::core::option::Option<annotation_payload::Detail>,
}
pub mod annotation_payload {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Detail {
#[prost(message, tag = "2")]
Translation(super::TranslationAnnotation),
#[prost(message, tag = "3")]
Classification(super::ClassificationAnnotation),
#[prost(message, tag = "4")]
ImageObjectDetection(super::ImageObjectDetectionAnnotation),
#[prost(message, tag = "6")]
TextExtraction(super::TextExtractionAnnotation),
#[prost(message, tag = "7")]
TextSentiment(super::TextSentimentAnnotation),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnnotationSpec {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
#[prost(int32, tag = "9")]
pub example_count: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImageClassificationDatasetMetadata {
#[prost(enumeration = "ClassificationType", tag = "1")]
pub classification_type: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImageObjectDetectionDatasetMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImageClassificationModelMetadata {
#[prost(string, tag = "1")]
pub base_model_id: ::prost::alloc::string::String,
#[prost(int64, tag = "16")]
pub train_budget_milli_node_hours: i64,
#[prost(int64, tag = "17")]
pub train_cost_milli_node_hours: i64,
#[prost(string, tag = "5")]
pub stop_reason: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub model_type: ::prost::alloc::string::String,
#[prost(double, tag = "13")]
pub node_qps: f64,
#[prost(int64, tag = "14")]
pub node_count: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImageObjectDetectionModelMetadata {
#[prost(string, tag = "1")]
pub model_type: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub node_count: i64,
#[prost(double, tag = "4")]
pub node_qps: f64,
#[prost(string, tag = "5")]
pub stop_reason: ::prost::alloc::string::String,
#[prost(int64, tag = "6")]
pub train_budget_milli_node_hours: i64,
#[prost(int64, tag = "7")]
pub train_cost_milli_node_hours: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImageClassificationModelDeploymentMetadata {
#[prost(int64, tag = "1")]
pub node_count: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImageObjectDetectionModelDeploymentMetadata {
#[prost(int64, tag = "1")]
pub node_count: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextClassificationDatasetMetadata {
#[prost(enumeration = "ClassificationType", tag = "1")]
pub classification_type: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextClassificationModelMetadata {
#[prost(enumeration = "ClassificationType", tag = "3")]
pub classification_type: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextExtractionDatasetMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextExtractionModelMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextSentimentDatasetMetadata {
#[prost(int32, tag = "1")]
pub sentiment_max: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextSentimentModelMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Dataset {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
#[prost(int32, tag = "21")]
pub example_count: i32,
#[prost(message, optional, tag = "14")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "17")]
pub etag: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "39")]
pub labels:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(oneof = "dataset::DatasetMetadata", tags = "23, 24, 25, 26, 28, 30")]
pub dataset_metadata: ::core::option::Option<dataset::DatasetMetadata>,
}
pub mod dataset {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum DatasetMetadata {
#[prost(message, tag = "23")]
TranslationDatasetMetadata(super::TranslationDatasetMetadata),
#[prost(message, tag = "24")]
ImageClassificationDatasetMetadata(super::ImageClassificationDatasetMetadata),
#[prost(message, tag = "25")]
TextClassificationDatasetMetadata(super::TextClassificationDatasetMetadata),
#[prost(message, tag = "26")]
ImageObjectDetectionDatasetMetadata(super::ImageObjectDetectionDatasetMetadata),
#[prost(message, tag = "28")]
TextExtractionDatasetMetadata(super::TextExtractionDatasetMetadata),
#[prost(message, tag = "30")]
TextSentimentDatasetMetadata(super::TextSentimentDatasetMetadata),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Model {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub display_name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub dataset_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "11")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "model::DeploymentState", tag = "8")]
pub deployment_state: i32,
#[prost(string, tag = "10")]
pub etag: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "34")]
pub labels:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(oneof = "model::ModelMetadata", tags = "15, 13, 14, 20, 19, 22")]
pub model_metadata: ::core::option::Option<model::ModelMetadata>,
}
pub mod model {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DeploymentState {
Unspecified = 0,
Deployed = 1,
Undeployed = 2,
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ModelMetadata {
#[prost(message, tag = "15")]
TranslationModelMetadata(super::TranslationModelMetadata),
#[prost(message, tag = "13")]
ImageClassificationModelMetadata(super::ImageClassificationModelMetadata),
#[prost(message, tag = "14")]
TextClassificationModelMetadata(super::TextClassificationModelMetadata),
#[prost(message, tag = "20")]
ImageObjectDetectionModelMetadata(super::ImageObjectDetectionModelMetadata),
#[prost(message, tag = "19")]
TextExtractionModelMetadata(super::TextExtractionModelMetadata),
#[prost(message, tag = "22")]
TextSentimentModelMetadata(super::TextSentimentModelMetadata),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ModelEvaluation {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub annotation_spec_id: ::prost::alloc::string::String,
#[prost(string, tag = "15")]
pub display_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(int32, tag = "6")]
pub evaluated_example_count: i32,
#[prost(oneof = "model_evaluation::Metrics", tags = "8, 9, 12, 11, 13")]
pub metrics: ::core::option::Option<model_evaluation::Metrics>,
}
pub mod model_evaluation {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Metrics {
#[prost(message, tag = "8")]
ClassificationEvaluationMetrics(super::ClassificationEvaluationMetrics),
#[prost(message, tag = "9")]
TranslationEvaluationMetrics(super::TranslationEvaluationMetrics),
#[prost(message, tag = "12")]
ImageObjectDetectionEvaluationMetrics(super::ImageObjectDetectionEvaluationMetrics),
#[prost(message, tag = "11")]
TextSentimentEvaluationMetrics(super::TextSentimentEvaluationMetrics),
#[prost(message, tag = "13")]
TextExtractionEvaluationMetrics(super::TextExtractionEvaluationMetrics),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OperationMetadata {
#[prost(int32, tag = "13")]
pub progress_percent: i32,
#[prost(message, repeated, tag = "2")]
pub partial_failures: ::prost::alloc::vec::Vec<super::super::super::rpc::Status>,
#[prost(message, optional, tag = "3")]
pub create_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "4")]
pub update_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(oneof = "operation_metadata::Details", tags = "8, 24, 25, 10, 30, 15, 16, 21, 22")]
pub details: ::core::option::Option<operation_metadata::Details>,
}
pub mod operation_metadata {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Details {
#[prost(message, tag = "8")]
DeleteDetails(super::DeleteOperationMetadata),
#[prost(message, tag = "24")]
DeployModelDetails(super::DeployModelOperationMetadata),
#[prost(message, tag = "25")]
UndeployModelDetails(super::UndeployModelOperationMetadata),
#[prost(message, tag = "10")]
CreateModelDetails(super::CreateModelOperationMetadata),
#[prost(message, tag = "30")]
CreateDatasetDetails(super::CreateDatasetOperationMetadata),
#[prost(message, tag = "15")]
ImportDataDetails(super::ImportDataOperationMetadata),
#[prost(message, tag = "16")]
BatchPredictDetails(super::BatchPredictOperationMetadata),
#[prost(message, tag = "21")]
ExportDataDetails(super::ExportDataOperationMetadata),
#[prost(message, tag = "22")]
ExportModelDetails(super::ExportModelOperationMetadata),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteOperationMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeployModelOperationMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UndeployModelOperationMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateDatasetOperationMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateModelOperationMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImportDataOperationMetadata {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportDataOperationMetadata {
#[prost(message, optional, tag = "1")]
pub output_info: ::core::option::Option<export_data_operation_metadata::ExportDataOutputInfo>,
}
pub mod export_data_operation_metadata {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportDataOutputInfo {
#[prost(oneof = "export_data_output_info::OutputLocation", tags = "1")]
pub output_location: ::core::option::Option<export_data_output_info::OutputLocation>,
}
pub mod export_data_output_info {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum OutputLocation {
#[prost(string, tag = "1")]
GcsOutputDirectory(::prost::alloc::string::String),
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchPredictOperationMetadata {
#[prost(message, optional, tag = "1")]
pub input_config: ::core::option::Option<BatchPredictInputConfig>,
#[prost(message, optional, tag = "2")]
pub output_info:
::core::option::Option<batch_predict_operation_metadata::BatchPredictOutputInfo>,
}
pub mod batch_predict_operation_metadata {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchPredictOutputInfo {
#[prost(oneof = "batch_predict_output_info::OutputLocation", tags = "1")]
pub output_location: ::core::option::Option<batch_predict_output_info::OutputLocation>,
}
pub mod batch_predict_output_info {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum OutputLocation {
#[prost(string, tag = "1")]
GcsOutputDirectory(::prost::alloc::string::String),
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportModelOperationMetadata {
#[prost(message, optional, tag = "2")]
pub output_info: ::core::option::Option<export_model_operation_metadata::ExportModelOutputInfo>,
}
pub mod export_model_operation_metadata {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportModelOutputInfo {
#[prost(string, tag = "1")]
pub gcs_output_directory: ::prost::alloc::string::String,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PredictRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub payload: ::core::option::Option<ExamplePayload>,
#[prost(map = "string, string", tag = "3")]
pub params:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PredictResponse {
#[prost(message, repeated, tag = "1")]
pub payload: ::prost::alloc::vec::Vec<AnnotationPayload>,
#[prost(message, optional, tag = "3")]
pub preprocessed_input: ::core::option::Option<ExamplePayload>,
#[prost(map = "string, string", tag = "2")]
pub metadata:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchPredictRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub input_config: ::core::option::Option<BatchPredictInputConfig>,
#[prost(message, optional, tag = "4")]
pub output_config: ::core::option::Option<BatchPredictOutputConfig>,
#[prost(map = "string, string", tag = "5")]
pub params:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchPredictResult {
#[prost(map = "string, string", tag = "1")]
pub metadata:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
#[doc = r" Generated client implementations."]
pub mod prediction_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " AutoML Prediction API."]
#[doc = ""]
#[doc = " On any input that is documented to expect a string parameter in"]
#[doc = " snake_case or kebab-case, either of those cases is accepted."]
#[derive(Debug, Clone)]
pub struct PredictionServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> PredictionServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> PredictionServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
Into<StdError> + Send + Sync,
{
PredictionServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Perform an online prediction. The prediction result is directly"]
#[doc = " returned in the response."]
#[doc = " Available for following ML scenarios, and their expected request payloads:"]
#[doc = ""]
#[doc = " AutoML Vision Classification"]
#[doc = ""]
#[doc = " * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB."]
#[doc = ""]
#[doc = " AutoML Vision Object Detection"]
#[doc = ""]
#[doc = " * An image in .JPEG, .GIF or .PNG format, image_bytes up to 30MB."]
#[doc = ""]
#[doc = " AutoML Natural Language Classification"]
#[doc = ""]
#[doc = " * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in"]
#[doc = " .PDF, .TIF or .TIFF format with size upto 2MB."]
#[doc = ""]
#[doc = " AutoML Natural Language Entity Extraction"]
#[doc = ""]
#[doc = " * A TextSnippet up to 10,000 characters, UTF-8 NFC encoded or a document"]
#[doc = " in .PDF, .TIF or .TIFF format with size upto 20MB."]
#[doc = ""]
#[doc = " AutoML Natural Language Sentiment Analysis"]
#[doc = ""]
#[doc = " * A TextSnippet up to 60,000 characters, UTF-8 encoded or a document in"]
#[doc = " .PDF, .TIF or .TIFF format with size upto 2MB."]
#[doc = ""]
#[doc = " AutoML Translation"]
#[doc = ""]
#[doc = " * A TextSnippet up to 25,000 characters, UTF-8 encoded."]
#[doc = ""]
#[doc = " AutoML Tables"]
#[doc = ""]
#[doc = " * A row with column values matching"]
#[doc = " the columns of the model, up to 5MB. Not available for FORECASTING"]
#[doc = " `prediction_type`."]
pub async fn predict(
&mut self,
request: impl tonic::IntoRequest<super::PredictRequest>,
) -> Result<tonic::Response<super::PredictResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.automl.v1.PredictionService/Predict",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Perform a batch prediction. Unlike the online [Predict][google.cloud.automl.v1.PredictionService.Predict], batch"]
#[doc = " prediction result won't be immediately available in the response. Instead,"]
#[doc = " a long running operation object is returned. User can poll the operation"]
#[doc = " result via [GetOperation][google.longrunning.Operations.GetOperation]"]
#[doc = " method. Once the operation is done, [BatchPredictResult][google.cloud.automl.v1.BatchPredictResult] is returned in"]
#[doc = " the [response][google.longrunning.Operation.response] field."]
#[doc = " Available for following ML scenarios:"]
#[doc = ""]
#[doc = " * AutoML Vision Classification"]
#[doc = " * AutoML Vision Object Detection"]
#[doc = " * AutoML Video Intelligence Classification"]
#[doc = " * AutoML Video Intelligence Object Tracking * AutoML Natural Language Classification"]
#[doc = " * AutoML Natural Language Entity Extraction"]
#[doc = " * AutoML Natural Language Sentiment Analysis"]
#[doc = " * AutoML Tables"]
pub async fn batch_predict(
&mut self,
request: impl tonic::IntoRequest<super::BatchPredictRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.automl.v1.PredictionService/BatchPredict",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateDatasetRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub dataset: ::core::option::Option<Dataset>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDatasetRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDatasetsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub filter: ::prost::alloc::string::String,
#[prost(int32, tag = "4")]
pub page_size: i32,
#[prost(string, tag = "6")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDatasetsResponse {
#[prost(message, repeated, tag = "1")]
pub datasets: ::prost::alloc::vec::Vec<Dataset>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateDatasetRequest {
#[prost(message, optional, tag = "1")]
pub dataset: ::core::option::Option<Dataset>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteDatasetRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImportDataRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub input_config: ::core::option::Option<InputConfig>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportDataRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub output_config: ::core::option::Option<OutputConfig>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAnnotationSpecRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateModelRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub model: ::core::option::Option<Model>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetModelRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListModelsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub filter: ::prost::alloc::string::String,
#[prost(int32, tag = "4")]
pub page_size: i32,
#[prost(string, tag = "6")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListModelsResponse {
#[prost(message, repeated, tag = "1")]
pub model: ::prost::alloc::vec::Vec<Model>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteModelRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateModelRequest {
#[prost(message, optional, tag = "1")]
pub model: ::core::option::Option<Model>,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeployModelRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(oneof = "deploy_model_request::ModelDeploymentMetadata", tags = "2, 4")]
pub model_deployment_metadata:
::core::option::Option<deploy_model_request::ModelDeploymentMetadata>,
}
pub mod deploy_model_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ModelDeploymentMetadata {
#[prost(message, tag = "2")]
ImageObjectDetectionModelDeploymentMetadata(
super::ImageObjectDetectionModelDeploymentMetadata,
),
#[prost(message, tag = "4")]
ImageClassificationModelDeploymentMetadata(
super::ImageClassificationModelDeploymentMetadata,
),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UndeployModelRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportModelRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub output_config: ::core::option::Option<ModelExportOutputConfig>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetModelEvaluationRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListModelEvaluationsRequest {
#[prost(string, tag = "1")]
pub parent: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub filter: ::prost::alloc::string::String,
#[prost(int32, tag = "4")]
pub page_size: i32,
#[prost(string, tag = "6")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListModelEvaluationsResponse {
#[prost(message, repeated, tag = "1")]
pub model_evaluation: ::prost::alloc::vec::Vec<ModelEvaluation>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[doc = r" Generated client implementations."]
pub mod auto_ml_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[doc = " AutoML Server API."]
#[doc = ""]
#[doc = " The resource names are assigned by the server."]
#[doc = " The server never reuses names that it has created after the resources with"]
#[doc = " those names are deleted."]
#[doc = ""]
#[doc = " An ID of a resource is the last element of the item's resource name. For"]
#[doc = " `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}`, then"]
#[doc = " the id for the item is `{dataset_id}`."]
#[doc = ""]
#[doc = " Currently the only supported `location_id` is \"us-central1\"."]
#[doc = ""]
#[doc = " On any input that is documented to expect a string parameter in"]
#[doc = " snake_case or kebab-case, either of those cases is accepted."]
#[derive(Debug, Clone)]
pub struct AutoMlClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> AutoMlClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> AutoMlClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
Into<StdError> + Send + Sync,
{
AutoMlClient::new(InterceptedService::new(inner, interceptor))
}
#[doc = r" Compress requests with `gzip`."]
#[doc = r""]
#[doc = r" This requires the server to support it otherwise it might respond with an"]
#[doc = r" error."]
pub fn send_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[doc = r" Enable decompressing responses with `gzip`."]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
self
}
#[doc = " Creates a dataset."]
pub async fn create_dataset(
&mut self,
request: impl tonic::IntoRequest<super::CreateDatasetRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.automl.v1.AutoMl/CreateDataset",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets a dataset."]
pub async fn get_dataset(
&mut self,
request: impl tonic::IntoRequest<super::GetDatasetRequest>,
) -> Result<tonic::Response<super::Dataset>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/google.cloud.automl.v1.AutoMl/GetDataset");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists datasets in a project."]
pub async fn list_datasets(
&mut self,
request: impl tonic::IntoRequest<super::ListDatasetsRequest>,
) -> Result<tonic::Response<super::ListDatasetsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/google.cloud.automl.v1.AutoMl/ListDatasets");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates a dataset."]
pub async fn update_dataset(
&mut self,
request: impl tonic::IntoRequest<super::UpdateDatasetRequest>,
) -> Result<tonic::Response<super::Dataset>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.automl.v1.AutoMl/UpdateDataset",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes a dataset and all of its contents."]
#[doc = " Returns empty response in the"]
#[doc = " [response][google.longrunning.Operation.response] field when it completes,"]
#[doc = " and `delete_details` in the"]
#[doc = " [metadata][google.longrunning.Operation.metadata] field."]
pub async fn delete_dataset(
&mut self,
request: impl tonic::IntoRequest<super::DeleteDatasetRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.automl.v1.AutoMl/DeleteDataset",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Imports data into a dataset."]
#[doc = " For Tables this method can only be called on an empty Dataset."]
#[doc = ""]
#[doc = " For Tables:"]
#[doc = " * A"]
#[doc = " [schema_inference_version][google.cloud.automl.v1.InputConfig.params]"]
#[doc = " parameter must be explicitly set."]
#[doc = " Returns an empty response in the"]
#[doc = " [response][google.longrunning.Operation.response] field when it completes."]
pub async fn import_data(
&mut self,
request: impl tonic::IntoRequest<super::ImportDataRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/google.cloud.automl.v1.AutoMl/ImportData");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Exports dataset's data to the provided output location."]
#[doc = " Returns an empty response in the"]
#[doc = " [response][google.longrunning.Operation.response] field when it completes."]
pub async fn export_data(
&mut self,
request: impl tonic::IntoRequest<super::ExportDataRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/google.cloud.automl.v1.AutoMl/ExportData");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets an annotation spec."]
pub async fn get_annotation_spec(
&mut self,
request: impl tonic::IntoRequest<super::GetAnnotationSpecRequest>,
) -> Result<tonic::Response<super::AnnotationSpec>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.automl.v1.AutoMl/GetAnnotationSpec",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Creates a model."]
#[doc = " Returns a Model in the [response][google.longrunning.Operation.response]"]
#[doc = " field when it completes."]
#[doc = " When you create a model, several model evaluations are created for it:"]
#[doc = " a global evaluation, and one evaluation for each annotation spec."]
pub async fn create_model(
&mut self,
request: impl tonic::IntoRequest<super::CreateModelRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/google.cloud.automl.v1.AutoMl/CreateModel");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets a model."]
pub async fn get_model(
&mut self,
request: impl tonic::IntoRequest<super::GetModelRequest>,
) -> Result<tonic::Response<super::Model>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/google.cloud.automl.v1.AutoMl/GetModel");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists models."]
pub async fn list_models(
&mut self,
request: impl tonic::IntoRequest<super::ListModelsRequest>,
) -> Result<tonic::Response<super::ListModelsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/google.cloud.automl.v1.AutoMl/ListModels");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deletes a model."]
#[doc = " Returns `google.protobuf.Empty` in the"]
#[doc = " [response][google.longrunning.Operation.response] field when it completes,"]
#[doc = " and `delete_details` in the"]
#[doc = " [metadata][google.longrunning.Operation.metadata] field."]
pub async fn delete_model(
&mut self,
request: impl tonic::IntoRequest<super::DeleteModelRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/google.cloud.automl.v1.AutoMl/DeleteModel");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Updates a model."]
pub async fn update_model(
&mut self,
request: impl tonic::IntoRequest<super::UpdateModelRequest>,
) -> Result<tonic::Response<super::Model>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/google.cloud.automl.v1.AutoMl/UpdateModel");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Deploys a model. If a model is already deployed, deploying it with the"]
#[doc = " same parameters has no effect. Deploying with different parametrs"]
#[doc = " (as e.g. changing"]
#[doc = ""]
#[doc = " [node_number][google.cloud.automl.v1p1beta.ImageObjectDetectionModelDeploymentMetadata.node_number])"]
#[doc = " will reset the deployment state without pausing the model's availability."]
#[doc = ""]
#[doc = " Only applicable for Text Classification, Image Object Detection , Tables, and Image Segmentation; all other domains manage"]
#[doc = " deployment automatically."]
#[doc = ""]
#[doc = " Returns an empty response in the"]
#[doc = " [response][google.longrunning.Operation.response] field when it completes."]
pub async fn deploy_model(
&mut self,
request: impl tonic::IntoRequest<super::DeployModelRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/google.cloud.automl.v1.AutoMl/DeployModel");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Undeploys a model. If the model is not deployed this method has no effect."]
#[doc = ""]
#[doc = " Only applicable for Text Classification, Image Object Detection and Tables;"]
#[doc = " all other domains manage deployment automatically."]
#[doc = ""]
#[doc = " Returns an empty response in the"]
#[doc = " [response][google.longrunning.Operation.response] field when it completes."]
pub async fn undeploy_model(
&mut self,
request: impl tonic::IntoRequest<super::UndeployModelRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.automl.v1.AutoMl/UndeployModel",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Exports a trained, \"export-able\", model to a user specified Google Cloud"]
#[doc = " Storage location. A model is considered export-able if and only if it has"]
#[doc = " an export format defined for it in"]
#[doc = " [ModelExportOutputConfig][google.cloud.automl.v1.ModelExportOutputConfig]."]
#[doc = ""]
#[doc = " Returns an empty response in the"]
#[doc = " [response][google.longrunning.Operation.response] field when it completes."]
pub async fn export_model(
&mut self,
request: impl tonic::IntoRequest<super::ExportModelRequest>,
) -> Result<
tonic::Response<super::super::super::super::longrunning::Operation>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/google.cloud.automl.v1.AutoMl/ExportModel");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Gets a model evaluation."]
pub async fn get_model_evaluation(
&mut self,
request: impl tonic::IntoRequest<super::GetModelEvaluationRequest>,
) -> Result<tonic::Response<super::ModelEvaluation>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.automl.v1.AutoMl/GetModelEvaluation",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Lists model evaluations."]
pub async fn list_model_evaluations(
&mut self,
request: impl tonic::IntoRequest<super::ListModelEvaluationsRequest>,
) -> Result<tonic::Response<super::ListModelEvaluationsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/google.cloud.automl.v1.AutoMl/ListModelEvaluations",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}