#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
extern crate google_cloud_rpc;
extern crate lazy_static;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AnnotateVideoRequest {
pub input_uri: std::string::String,
pub input_content: ::bytes::Bytes,
pub features: std::vec::Vec<crate::model::Feature>,
pub video_context: std::option::Option<crate::model::VideoContext>,
pub output_uri: std::string::String,
pub location_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AnnotateVideoRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_input_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.input_uri = v.into();
self
}
pub fn set_input_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.input_content = v.into();
self
}
pub fn set_features<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Feature>,
{
use std::iter::Iterator;
self.features = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_video_context<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VideoContext>,
{
self.video_context = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_video_context<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VideoContext>,
{
self.video_context = v.map(|x| x.into());
self
}
pub fn set_output_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.output_uri = v.into();
self
}
pub fn set_location_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.location_id = v.into();
self
}
}
impl wkt::message::Message for AnnotateVideoRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.AnnotateVideoRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VideoContext {
pub segments: std::vec::Vec<crate::model::VideoSegment>,
pub label_detection_config: std::option::Option<crate::model::LabelDetectionConfig>,
pub shot_change_detection_config: std::option::Option<crate::model::ShotChangeDetectionConfig>,
pub explicit_content_detection_config:
std::option::Option<crate::model::ExplicitContentDetectionConfig>,
pub face_detection_config: std::option::Option<crate::model::FaceDetectionConfig>,
pub speech_transcription_config: std::option::Option<crate::model::SpeechTranscriptionConfig>,
pub text_detection_config: std::option::Option<crate::model::TextDetectionConfig>,
pub person_detection_config: std::option::Option<crate::model::PersonDetectionConfig>,
pub object_tracking_config: std::option::Option<crate::model::ObjectTrackingConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VideoContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_segments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::VideoSegment>,
{
use std::iter::Iterator;
self.segments = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_label_detection_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LabelDetectionConfig>,
{
self.label_detection_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_label_detection_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LabelDetectionConfig>,
{
self.label_detection_config = v.map(|x| x.into());
self
}
pub fn set_shot_change_detection_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ShotChangeDetectionConfig>,
{
self.shot_change_detection_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_shot_change_detection_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ShotChangeDetectionConfig>,
{
self.shot_change_detection_config = v.map(|x| x.into());
self
}
pub fn set_explicit_content_detection_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ExplicitContentDetectionConfig>,
{
self.explicit_content_detection_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_explicit_content_detection_config<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::ExplicitContentDetectionConfig>,
{
self.explicit_content_detection_config = v.map(|x| x.into());
self
}
pub fn set_face_detection_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::FaceDetectionConfig>,
{
self.face_detection_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_face_detection_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::FaceDetectionConfig>,
{
self.face_detection_config = v.map(|x| x.into());
self
}
pub fn set_speech_transcription_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SpeechTranscriptionConfig>,
{
self.speech_transcription_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_speech_transcription_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SpeechTranscriptionConfig>,
{
self.speech_transcription_config = v.map(|x| x.into());
self
}
pub fn set_text_detection_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TextDetectionConfig>,
{
self.text_detection_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_text_detection_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TextDetectionConfig>,
{
self.text_detection_config = v.map(|x| x.into());
self
}
pub fn set_person_detection_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::PersonDetectionConfig>,
{
self.person_detection_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_person_detection_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::PersonDetectionConfig>,
{
self.person_detection_config = v.map(|x| x.into());
self
}
pub fn set_object_tracking_config<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ObjectTrackingConfig>,
{
self.object_tracking_config = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_object_tracking_config<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ObjectTrackingConfig>,
{
self.object_tracking_config = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for VideoContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.VideoContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LabelDetectionConfig {
pub label_detection_mode: crate::model::LabelDetectionMode,
pub stationary_camera: bool,
pub model: std::string::String,
pub frame_confidence_threshold: f32,
pub video_confidence_threshold: f32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LabelDetectionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_label_detection_mode<T: std::convert::Into<crate::model::LabelDetectionMode>>(
mut self,
v: T,
) -> Self {
self.label_detection_mode = v.into();
self
}
pub fn set_stationary_camera<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.stationary_camera = v.into();
self
}
pub fn set_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.model = v.into();
self
}
pub fn set_frame_confidence_threshold<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.frame_confidence_threshold = v.into();
self
}
pub fn set_video_confidence_threshold<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.video_confidence_threshold = v.into();
self
}
}
impl wkt::message::Message for LabelDetectionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.LabelDetectionConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ShotChangeDetectionConfig {
pub model: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ShotChangeDetectionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.model = v.into();
self
}
}
impl wkt::message::Message for ShotChangeDetectionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.ShotChangeDetectionConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ObjectTrackingConfig {
pub model: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ObjectTrackingConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.model = v.into();
self
}
}
impl wkt::message::Message for ObjectTrackingConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.ObjectTrackingConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FaceDetectionConfig {
pub model: std::string::String,
pub include_bounding_boxes: bool,
pub include_attributes: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FaceDetectionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.model = v.into();
self
}
pub fn set_include_bounding_boxes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.include_bounding_boxes = v.into();
self
}
pub fn set_include_attributes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.include_attributes = v.into();
self
}
}
impl wkt::message::Message for FaceDetectionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.FaceDetectionConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PersonDetectionConfig {
pub include_bounding_boxes: bool,
pub include_pose_landmarks: bool,
pub include_attributes: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PersonDetectionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_include_bounding_boxes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.include_bounding_boxes = v.into();
self
}
pub fn set_include_pose_landmarks<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.include_pose_landmarks = v.into();
self
}
pub fn set_include_attributes<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.include_attributes = v.into();
self
}
}
impl wkt::message::Message for PersonDetectionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.PersonDetectionConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExplicitContentDetectionConfig {
pub model: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExplicitContentDetectionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.model = v.into();
self
}
}
impl wkt::message::Message for ExplicitContentDetectionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.ExplicitContentDetectionConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TextDetectionConfig {
pub language_hints: std::vec::Vec<std::string::String>,
pub model: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TextDetectionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_language_hints<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.language_hints = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_model<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.model = v.into();
self
}
}
impl wkt::message::Message for TextDetectionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.TextDetectionConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VideoSegment {
pub start_time_offset: std::option::Option<wkt::Duration>,
pub end_time_offset: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VideoSegment {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_time_offset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.start_time_offset = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.start_time_offset = v.map(|x| x.into());
self
}
pub fn set_end_time_offset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.end_time_offset = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.end_time_offset = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for VideoSegment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.VideoSegment"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LabelSegment {
pub segment: std::option::Option<crate::model::VideoSegment>,
pub confidence: f32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LabelSegment {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_segment<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VideoSegment>,
{
self.segment = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_segment<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VideoSegment>,
{
self.segment = v.map(|x| x.into());
self
}
pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.confidence = v.into();
self
}
}
impl wkt::message::Message for LabelSegment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.LabelSegment"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LabelFrame {
pub time_offset: std::option::Option<wkt::Duration>,
pub confidence: f32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LabelFrame {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_time_offset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.time_offset = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.time_offset = v.map(|x| x.into());
self
}
pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.confidence = v.into();
self
}
}
impl wkt::message::Message for LabelFrame {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.LabelFrame"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Entity {
pub entity_id: std::string::String,
pub description: std::string::String,
pub language_code: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Entity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entity_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.entity_id = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.language_code = v.into();
self
}
}
impl wkt::message::Message for Entity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.Entity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LabelAnnotation {
pub entity: std::option::Option<crate::model::Entity>,
pub category_entities: std::vec::Vec<crate::model::Entity>,
pub segments: std::vec::Vec<crate::model::LabelSegment>,
pub frames: std::vec::Vec<crate::model::LabelFrame>,
pub version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LabelAnnotation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entity<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Entity>,
{
self.entity = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Entity>,
{
self.entity = v.map(|x| x.into());
self
}
pub fn set_category_entities<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Entity>,
{
use std::iter::Iterator;
self.category_entities = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_segments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LabelSegment>,
{
use std::iter::Iterator;
self.segments = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_frames<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LabelFrame>,
{
use std::iter::Iterator;
self.frames = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
}
impl wkt::message::Message for LabelAnnotation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.LabelAnnotation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExplicitContentFrame {
pub time_offset: std::option::Option<wkt::Duration>,
pub pornography_likelihood: crate::model::Likelihood,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExplicitContentFrame {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_time_offset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.time_offset = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.time_offset = v.map(|x| x.into());
self
}
pub fn set_pornography_likelihood<T: std::convert::Into<crate::model::Likelihood>>(
mut self,
v: T,
) -> Self {
self.pornography_likelihood = v.into();
self
}
}
impl wkt::message::Message for ExplicitContentFrame {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.ExplicitContentFrame"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ExplicitContentAnnotation {
pub frames: std::vec::Vec<crate::model::ExplicitContentFrame>,
pub version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ExplicitContentAnnotation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_frames<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ExplicitContentFrame>,
{
use std::iter::Iterator;
self.frames = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
}
impl wkt::message::Message for ExplicitContentAnnotation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.ExplicitContentAnnotation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NormalizedBoundingBox {
pub left: f32,
pub top: f32,
pub right: f32,
pub bottom: f32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NormalizedBoundingBox {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_left<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.left = v.into();
self
}
pub fn set_top<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.top = v.into();
self
}
pub fn set_right<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.right = v.into();
self
}
pub fn set_bottom<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.bottom = v.into();
self
}
}
impl wkt::message::Message for NormalizedBoundingBox {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.NormalizedBoundingBox"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FaceDetectionAnnotation {
pub tracks: std::vec::Vec<crate::model::Track>,
pub thumbnail: ::bytes::Bytes,
pub version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FaceDetectionAnnotation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tracks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Track>,
{
use std::iter::Iterator;
self.tracks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_thumbnail<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.thumbnail = v.into();
self
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
}
impl wkt::message::Message for FaceDetectionAnnotation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.FaceDetectionAnnotation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PersonDetectionAnnotation {
pub tracks: std::vec::Vec<crate::model::Track>,
pub version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PersonDetectionAnnotation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tracks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Track>,
{
use std::iter::Iterator;
self.tracks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
}
impl wkt::message::Message for PersonDetectionAnnotation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.PersonDetectionAnnotation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FaceSegment {
pub segment: std::option::Option<crate::model::VideoSegment>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FaceSegment {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_segment<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VideoSegment>,
{
self.segment = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_segment<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VideoSegment>,
{
self.segment = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for FaceSegment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.FaceSegment"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
#[deprecated]
pub struct FaceFrame {
pub normalized_bounding_boxes: std::vec::Vec<crate::model::NormalizedBoundingBox>,
pub time_offset: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FaceFrame {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_normalized_bounding_boxes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::NormalizedBoundingBox>,
{
use std::iter::Iterator;
self.normalized_bounding_boxes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_time_offset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.time_offset = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.time_offset = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for FaceFrame {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.FaceFrame"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
#[deprecated]
pub struct FaceAnnotation {
pub thumbnail: ::bytes::Bytes,
pub segments: std::vec::Vec<crate::model::FaceSegment>,
pub frames: std::vec::Vec<crate::model::FaceFrame>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FaceAnnotation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_thumbnail<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.thumbnail = v.into();
self
}
pub fn set_segments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FaceSegment>,
{
use std::iter::Iterator;
self.segments = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_frames<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FaceFrame>,
{
use std::iter::Iterator;
self.frames = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for FaceAnnotation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.FaceAnnotation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TimestampedObject {
pub normalized_bounding_box: std::option::Option<crate::model::NormalizedBoundingBox>,
pub time_offset: std::option::Option<wkt::Duration>,
pub attributes: std::vec::Vec<crate::model::DetectedAttribute>,
pub landmarks: std::vec::Vec<crate::model::DetectedLandmark>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TimestampedObject {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_normalized_bounding_box<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NormalizedBoundingBox>,
{
self.normalized_bounding_box = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_normalized_bounding_box<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NormalizedBoundingBox>,
{
self.normalized_bounding_box = v.map(|x| x.into());
self
}
pub fn set_time_offset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.time_offset = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.time_offset = v.map(|x| x.into());
self
}
pub fn set_attributes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DetectedAttribute>,
{
use std::iter::Iterator;
self.attributes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_landmarks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DetectedLandmark>,
{
use std::iter::Iterator;
self.landmarks = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for TimestampedObject {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.TimestampedObject"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Track {
pub segment: std::option::Option<crate::model::VideoSegment>,
pub timestamped_objects: std::vec::Vec<crate::model::TimestampedObject>,
pub attributes: std::vec::Vec<crate::model::DetectedAttribute>,
pub confidence: f32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Track {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_segment<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VideoSegment>,
{
self.segment = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_segment<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VideoSegment>,
{
self.segment = v.map(|x| x.into());
self
}
pub fn set_timestamped_objects<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TimestampedObject>,
{
use std::iter::Iterator;
self.timestamped_objects = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_attributes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DetectedAttribute>,
{
use std::iter::Iterator;
self.attributes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.confidence = v.into();
self
}
}
impl wkt::message::Message for Track {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.Track"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DetectedAttribute {
pub name: std::string::String,
pub confidence: f32,
pub value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DetectedAttribute {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.confidence = v.into();
self
}
pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for DetectedAttribute {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.DetectedAttribute"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DetectedLandmark {
pub name: std::string::String,
pub point: std::option::Option<crate::model::NormalizedVertex>,
pub confidence: f32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DetectedLandmark {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_point<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NormalizedVertex>,
{
self.point = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_point<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NormalizedVertex>,
{
self.point = v.map(|x| x.into());
self
}
pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.confidence = v.into();
self
}
}
impl wkt::message::Message for DetectedLandmark {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.DetectedLandmark"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VideoAnnotationResults {
pub input_uri: std::string::String,
pub segment: std::option::Option<crate::model::VideoSegment>,
pub segment_label_annotations: std::vec::Vec<crate::model::LabelAnnotation>,
pub segment_presence_label_annotations: std::vec::Vec<crate::model::LabelAnnotation>,
pub shot_label_annotations: std::vec::Vec<crate::model::LabelAnnotation>,
pub shot_presence_label_annotations: std::vec::Vec<crate::model::LabelAnnotation>,
pub frame_label_annotations: std::vec::Vec<crate::model::LabelAnnotation>,
#[deprecated]
pub face_annotations: std::vec::Vec<crate::model::FaceAnnotation>,
pub face_detection_annotations: std::vec::Vec<crate::model::FaceDetectionAnnotation>,
pub shot_annotations: std::vec::Vec<crate::model::VideoSegment>,
pub explicit_annotation: std::option::Option<crate::model::ExplicitContentAnnotation>,
pub speech_transcriptions: std::vec::Vec<crate::model::SpeechTranscription>,
pub text_annotations: std::vec::Vec<crate::model::TextAnnotation>,
pub object_annotations: std::vec::Vec<crate::model::ObjectTrackingAnnotation>,
pub logo_recognition_annotations: std::vec::Vec<crate::model::LogoRecognitionAnnotation>,
pub person_detection_annotations: std::vec::Vec<crate::model::PersonDetectionAnnotation>,
pub error: std::option::Option<google_cloud_rpc::model::Status>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VideoAnnotationResults {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_input_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.input_uri = v.into();
self
}
pub fn set_segment<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VideoSegment>,
{
self.segment = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_segment<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VideoSegment>,
{
self.segment = v.map(|x| x.into());
self
}
pub fn set_segment_label_annotations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LabelAnnotation>,
{
use std::iter::Iterator;
self.segment_label_annotations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_segment_presence_label_annotations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LabelAnnotation>,
{
use std::iter::Iterator;
self.segment_presence_label_annotations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_shot_label_annotations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LabelAnnotation>,
{
use std::iter::Iterator;
self.shot_label_annotations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_shot_presence_label_annotations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LabelAnnotation>,
{
use std::iter::Iterator;
self.shot_presence_label_annotations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_frame_label_annotations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LabelAnnotation>,
{
use std::iter::Iterator;
self.frame_label_annotations = v.into_iter().map(|i| i.into()).collect();
self
}
#[deprecated]
pub fn set_face_annotations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FaceAnnotation>,
{
use std::iter::Iterator;
self.face_annotations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_face_detection_annotations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::FaceDetectionAnnotation>,
{
use std::iter::Iterator;
self.face_detection_annotations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_shot_annotations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::VideoSegment>,
{
use std::iter::Iterator;
self.shot_annotations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_explicit_annotation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ExplicitContentAnnotation>,
{
self.explicit_annotation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_explicit_annotation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ExplicitContentAnnotation>,
{
self.explicit_annotation = v.map(|x| x.into());
self
}
pub fn set_speech_transcriptions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SpeechTranscription>,
{
use std::iter::Iterator;
self.speech_transcriptions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_text_annotations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TextAnnotation>,
{
use std::iter::Iterator;
self.text_annotations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_object_annotations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ObjectTrackingAnnotation>,
{
use std::iter::Iterator;
self.object_annotations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_logo_recognition_annotations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LogoRecognitionAnnotation>,
{
use std::iter::Iterator;
self.logo_recognition_annotations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_person_detection_annotations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::PersonDetectionAnnotation>,
{
use std::iter::Iterator;
self.person_detection_annotations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_error<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_rpc::model::Status>,
{
self.error = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for VideoAnnotationResults {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.VideoAnnotationResults"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AnnotateVideoResponse {
pub annotation_results: std::vec::Vec<crate::model::VideoAnnotationResults>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AnnotateVideoResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_annotation_results<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::VideoAnnotationResults>,
{
use std::iter::Iterator;
self.annotation_results = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AnnotateVideoResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.AnnotateVideoResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct VideoAnnotationProgress {
pub input_uri: std::string::String,
pub progress_percent: i32,
pub start_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub feature: crate::model::Feature,
pub segment: std::option::Option<crate::model::VideoSegment>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl VideoAnnotationProgress {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_input_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.input_uri = v.into();
self
}
pub fn set_progress_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.progress_percent = v.into();
self
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_feature<T: std::convert::Into<crate::model::Feature>>(mut self, v: T) -> Self {
self.feature = v.into();
self
}
pub fn set_segment<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VideoSegment>,
{
self.segment = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_segment<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VideoSegment>,
{
self.segment = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for VideoAnnotationProgress {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.VideoAnnotationProgress"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AnnotateVideoProgress {
pub annotation_progress: std::vec::Vec<crate::model::VideoAnnotationProgress>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AnnotateVideoProgress {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_annotation_progress<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::VideoAnnotationProgress>,
{
use std::iter::Iterator;
self.annotation_progress = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AnnotateVideoProgress {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.AnnotateVideoProgress"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpeechTranscriptionConfig {
pub language_code: std::string::String,
pub max_alternatives: i32,
pub filter_profanity: bool,
pub speech_contexts: std::vec::Vec<crate::model::SpeechContext>,
pub enable_automatic_punctuation: bool,
pub audio_tracks: std::vec::Vec<i32>,
pub enable_speaker_diarization: bool,
pub diarization_speaker_count: i32,
pub enable_word_confidence: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SpeechTranscriptionConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.language_code = v.into();
self
}
pub fn set_max_alternatives<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.max_alternatives = v.into();
self
}
pub fn set_filter_profanity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.filter_profanity = v.into();
self
}
pub fn set_speech_contexts<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SpeechContext>,
{
use std::iter::Iterator;
self.speech_contexts = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_enable_automatic_punctuation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_automatic_punctuation = v.into();
self
}
pub fn set_audio_tracks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<i32>,
{
use std::iter::Iterator;
self.audio_tracks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_enable_speaker_diarization<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_speaker_diarization = v.into();
self
}
pub fn set_diarization_speaker_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.diarization_speaker_count = v.into();
self
}
pub fn set_enable_word_confidence<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enable_word_confidence = v.into();
self
}
}
impl wkt::message::Message for SpeechTranscriptionConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.SpeechTranscriptionConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpeechContext {
pub phrases: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SpeechContext {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_phrases<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.phrases = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SpeechContext {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.SpeechContext"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpeechTranscription {
pub alternatives: std::vec::Vec<crate::model::SpeechRecognitionAlternative>,
pub language_code: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SpeechTranscription {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_alternatives<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SpeechRecognitionAlternative>,
{
use std::iter::Iterator;
self.alternatives = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.language_code = v.into();
self
}
}
impl wkt::message::Message for SpeechTranscription {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.SpeechTranscription"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpeechRecognitionAlternative {
pub transcript: std::string::String,
pub confidence: f32,
pub words: std::vec::Vec<crate::model::WordInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SpeechRecognitionAlternative {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_transcript<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.transcript = v.into();
self
}
pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.confidence = v.into();
self
}
pub fn set_words<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::WordInfo>,
{
use std::iter::Iterator;
self.words = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SpeechRecognitionAlternative {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.SpeechRecognitionAlternative"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WordInfo {
pub start_time: std::option::Option<wkt::Duration>,
pub end_time: std::option::Option<wkt::Duration>,
pub word: std::string::String,
pub confidence: f32,
pub speaker_tag: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WordInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_word<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.word = v.into();
self
}
pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.confidence = v.into();
self
}
pub fn set_speaker_tag<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.speaker_tag = v.into();
self
}
}
impl wkt::message::Message for WordInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.WordInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NormalizedVertex {
pub x: f32,
pub y: f32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NormalizedVertex {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_x<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.x = v.into();
self
}
pub fn set_y<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.y = v.into();
self
}
}
impl wkt::message::Message for NormalizedVertex {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.NormalizedVertex"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NormalizedBoundingPoly {
pub vertices: std::vec::Vec<crate::model::NormalizedVertex>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl NormalizedBoundingPoly {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_vertices<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::NormalizedVertex>,
{
use std::iter::Iterator;
self.vertices = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for NormalizedBoundingPoly {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.NormalizedBoundingPoly"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TextSegment {
pub segment: std::option::Option<crate::model::VideoSegment>,
pub confidence: f32,
pub frames: std::vec::Vec<crate::model::TextFrame>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TextSegment {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_segment<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::VideoSegment>,
{
self.segment = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_segment<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::VideoSegment>,
{
self.segment = v.map(|x| x.into());
self
}
pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.confidence = v.into();
self
}
pub fn set_frames<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TextFrame>,
{
use std::iter::Iterator;
self.frames = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for TextSegment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.TextSegment"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TextFrame {
pub rotated_bounding_box: std::option::Option<crate::model::NormalizedBoundingPoly>,
pub time_offset: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TextFrame {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rotated_bounding_box<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NormalizedBoundingPoly>,
{
self.rotated_bounding_box = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_rotated_bounding_box<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NormalizedBoundingPoly>,
{
self.rotated_bounding_box = v.map(|x| x.into());
self
}
pub fn set_time_offset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.time_offset = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.time_offset = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TextFrame {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.TextFrame"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TextAnnotation {
pub text: std::string::String,
pub segments: std::vec::Vec<crate::model::TextSegment>,
pub version: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TextAnnotation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.text = v.into();
self
}
pub fn set_segments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TextSegment>,
{
use std::iter::Iterator;
self.segments = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
}
impl wkt::message::Message for TextAnnotation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.TextAnnotation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ObjectTrackingFrame {
pub normalized_bounding_box: std::option::Option<crate::model::NormalizedBoundingBox>,
pub time_offset: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ObjectTrackingFrame {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_normalized_bounding_box<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::NormalizedBoundingBox>,
{
self.normalized_bounding_box = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_normalized_bounding_box<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::NormalizedBoundingBox>,
{
self.normalized_bounding_box = v.map(|x| x.into());
self
}
pub fn set_time_offset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.time_offset = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_time_offset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.time_offset = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ObjectTrackingFrame {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.ObjectTrackingFrame"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ObjectTrackingAnnotation {
pub entity: std::option::Option<crate::model::Entity>,
pub confidence: f32,
pub frames: std::vec::Vec<crate::model::ObjectTrackingFrame>,
pub version: std::string::String,
pub track_info: std::option::Option<crate::model::object_tracking_annotation::TrackInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ObjectTrackingAnnotation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entity<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Entity>,
{
self.entity = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Entity>,
{
self.entity = v.map(|x| x.into());
self
}
pub fn set_confidence<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.confidence = v.into();
self
}
pub fn set_frames<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ObjectTrackingFrame>,
{
use std::iter::Iterator;
self.frames = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
pub fn set_track_info<
T: std::convert::Into<
std::option::Option<crate::model::object_tracking_annotation::TrackInfo>,
>,
>(
mut self,
v: T,
) -> Self {
self.track_info = v.into();
self
}
pub fn segment(&self) -> std::option::Option<&std::boxed::Box<crate::model::VideoSegment>> {
#[allow(unreachable_patterns)]
self.track_info.as_ref().and_then(|v| match v {
crate::model::object_tracking_annotation::TrackInfo::Segment(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_segment<T: std::convert::Into<std::boxed::Box<crate::model::VideoSegment>>>(
mut self,
v: T,
) -> Self {
self.track_info = std::option::Option::Some(
crate::model::object_tracking_annotation::TrackInfo::Segment(v.into()),
);
self
}
pub fn track_id(&self) -> std::option::Option<&i64> {
#[allow(unreachable_patterns)]
self.track_info.as_ref().and_then(|v| match v {
crate::model::object_tracking_annotation::TrackInfo::TrackId(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_track_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.track_info = std::option::Option::Some(
crate::model::object_tracking_annotation::TrackInfo::TrackId(v.into()),
);
self
}
}
impl wkt::message::Message for ObjectTrackingAnnotation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.ObjectTrackingAnnotation"
}
}
pub mod object_tracking_annotation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum TrackInfo {
Segment(std::boxed::Box<crate::model::VideoSegment>),
TrackId(i64),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LogoRecognitionAnnotation {
pub entity: std::option::Option<crate::model::Entity>,
pub tracks: std::vec::Vec<crate::model::Track>,
pub segments: std::vec::Vec<crate::model::VideoSegment>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LogoRecognitionAnnotation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entity<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Entity>,
{
self.entity = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_entity<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Entity>,
{
self.entity = v.map(|x| x.into());
self
}
pub fn set_tracks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Track>,
{
use std::iter::Iterator;
self.tracks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_segments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::VideoSegment>,
{
use std::iter::Iterator;
self.segments = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for LogoRecognitionAnnotation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.videointelligence.v1.LogoRecognitionAnnotation"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Feature {
Unspecified,
LabelDetection,
ShotChangeDetection,
ExplicitContentDetection,
FaceDetection,
SpeechTranscription,
TextDetection,
ObjectTracking,
LogoRecognition,
PersonDetection,
UnknownValue(feature::UnknownValue),
}
#[doc(hidden)]
pub mod feature {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Feature {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::LabelDetection => std::option::Option::Some(1),
Self::ShotChangeDetection => std::option::Option::Some(2),
Self::ExplicitContentDetection => std::option::Option::Some(3),
Self::FaceDetection => std::option::Option::Some(4),
Self::SpeechTranscription => std::option::Option::Some(6),
Self::TextDetection => std::option::Option::Some(7),
Self::ObjectTracking => std::option::Option::Some(9),
Self::LogoRecognition => std::option::Option::Some(12),
Self::PersonDetection => std::option::Option::Some(14),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("FEATURE_UNSPECIFIED"),
Self::LabelDetection => std::option::Option::Some("LABEL_DETECTION"),
Self::ShotChangeDetection => std::option::Option::Some("SHOT_CHANGE_DETECTION"),
Self::ExplicitContentDetection => {
std::option::Option::Some("EXPLICIT_CONTENT_DETECTION")
}
Self::FaceDetection => std::option::Option::Some("FACE_DETECTION"),
Self::SpeechTranscription => std::option::Option::Some("SPEECH_TRANSCRIPTION"),
Self::TextDetection => std::option::Option::Some("TEXT_DETECTION"),
Self::ObjectTracking => std::option::Option::Some("OBJECT_TRACKING"),
Self::LogoRecognition => std::option::Option::Some("LOGO_RECOGNITION"),
Self::PersonDetection => std::option::Option::Some("PERSON_DETECTION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Feature {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Feature {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Feature {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::LabelDetection,
2 => Self::ShotChangeDetection,
3 => Self::ExplicitContentDetection,
4 => Self::FaceDetection,
6 => Self::SpeechTranscription,
7 => Self::TextDetection,
9 => Self::ObjectTracking,
12 => Self::LogoRecognition,
14 => Self::PersonDetection,
_ => Self::UnknownValue(feature::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Feature {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"FEATURE_UNSPECIFIED" => Self::Unspecified,
"LABEL_DETECTION" => Self::LabelDetection,
"SHOT_CHANGE_DETECTION" => Self::ShotChangeDetection,
"EXPLICIT_CONTENT_DETECTION" => Self::ExplicitContentDetection,
"FACE_DETECTION" => Self::FaceDetection,
"SPEECH_TRANSCRIPTION" => Self::SpeechTranscription,
"TEXT_DETECTION" => Self::TextDetection,
"OBJECT_TRACKING" => Self::ObjectTracking,
"LOGO_RECOGNITION" => Self::LogoRecognition,
"PERSON_DETECTION" => Self::PersonDetection,
_ => Self::UnknownValue(feature::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Feature {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::LabelDetection => serializer.serialize_i32(1),
Self::ShotChangeDetection => serializer.serialize_i32(2),
Self::ExplicitContentDetection => serializer.serialize_i32(3),
Self::FaceDetection => serializer.serialize_i32(4),
Self::SpeechTranscription => serializer.serialize_i32(6),
Self::TextDetection => serializer.serialize_i32(7),
Self::ObjectTracking => serializer.serialize_i32(9),
Self::LogoRecognition => serializer.serialize_i32(12),
Self::PersonDetection => serializer.serialize_i32(14),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Feature {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Feature>::new(
".google.cloud.videointelligence.v1.Feature",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LabelDetectionMode {
Unspecified,
ShotMode,
FrameMode,
ShotAndFrameMode,
UnknownValue(label_detection_mode::UnknownValue),
}
#[doc(hidden)]
pub mod label_detection_mode {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl LabelDetectionMode {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ShotMode => std::option::Option::Some(1),
Self::FrameMode => std::option::Option::Some(2),
Self::ShotAndFrameMode => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("LABEL_DETECTION_MODE_UNSPECIFIED"),
Self::ShotMode => std::option::Option::Some("SHOT_MODE"),
Self::FrameMode => std::option::Option::Some("FRAME_MODE"),
Self::ShotAndFrameMode => std::option::Option::Some("SHOT_AND_FRAME_MODE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for LabelDetectionMode {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for LabelDetectionMode {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for LabelDetectionMode {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ShotMode,
2 => Self::FrameMode,
3 => Self::ShotAndFrameMode,
_ => Self::UnknownValue(label_detection_mode::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for LabelDetectionMode {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"LABEL_DETECTION_MODE_UNSPECIFIED" => Self::Unspecified,
"SHOT_MODE" => Self::ShotMode,
"FRAME_MODE" => Self::FrameMode,
"SHOT_AND_FRAME_MODE" => Self::ShotAndFrameMode,
_ => Self::UnknownValue(label_detection_mode::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for LabelDetectionMode {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ShotMode => serializer.serialize_i32(1),
Self::FrameMode => serializer.serialize_i32(2),
Self::ShotAndFrameMode => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for LabelDetectionMode {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<LabelDetectionMode>::new(
".google.cloud.videointelligence.v1.LabelDetectionMode",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Likelihood {
Unspecified,
VeryUnlikely,
Unlikely,
Possible,
Likely,
VeryLikely,
UnknownValue(likelihood::UnknownValue),
}
#[doc(hidden)]
pub mod likelihood {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Likelihood {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::VeryUnlikely => std::option::Option::Some(1),
Self::Unlikely => std::option::Option::Some(2),
Self::Possible => std::option::Option::Some(3),
Self::Likely => std::option::Option::Some(4),
Self::VeryLikely => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("LIKELIHOOD_UNSPECIFIED"),
Self::VeryUnlikely => std::option::Option::Some("VERY_UNLIKELY"),
Self::Unlikely => std::option::Option::Some("UNLIKELY"),
Self::Possible => std::option::Option::Some("POSSIBLE"),
Self::Likely => std::option::Option::Some("LIKELY"),
Self::VeryLikely => std::option::Option::Some("VERY_LIKELY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Likelihood {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Likelihood {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Likelihood {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::VeryUnlikely,
2 => Self::Unlikely,
3 => Self::Possible,
4 => Self::Likely,
5 => Self::VeryLikely,
_ => Self::UnknownValue(likelihood::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Likelihood {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"LIKELIHOOD_UNSPECIFIED" => Self::Unspecified,
"VERY_UNLIKELY" => Self::VeryUnlikely,
"UNLIKELY" => Self::Unlikely,
"POSSIBLE" => Self::Possible,
"LIKELY" => Self::Likely,
"VERY_LIKELY" => Self::VeryLikely,
_ => Self::UnknownValue(likelihood::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Likelihood {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::VeryUnlikely => serializer.serialize_i32(1),
Self::Unlikely => serializer.serialize_i32(2),
Self::Possible => serializer.serialize_i32(3),
Self::Likely => serializer.serialize_i32(4),
Self::VeryLikely => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Likelihood {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Likelihood>::new(
".google.cloud.videointelligence.v1.Likelihood",
))
}
}