#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RawAudio {
#[prost(enumeration = "raw_audio::AudioEncoding", tag = "1")]
pub audio_encoding: i32,
#[prost(int64, tag = "2")]
pub sample_rate_hertz: i64,
#[prost(int64, tag = "3")]
pub audio_channel_count: i64,
}
pub mod raw_audio {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum AudioEncoding {
Unspecified = 0,
Linear16Pcm = 1,
}
impl AudioEncoding {
pub fn as_str_name(&self) -> &'static str {
match self {
AudioEncoding::Unspecified => "AUDIO_ENCODING_UNSPECIFIED",
AudioEncoding::Linear16Pcm => "AUDIO_ENCODING_LINEAR16_PCM",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"AUDIO_ENCODING_UNSPECIFIED" => Some(Self::Unspecified),
"AUDIO_ENCODING_LINEAR16_PCM" => Some(Self::Linear16Pcm),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContainerAudio {
#[prost(enumeration = "container_audio::ContainerAudioType", tag = "1")]
pub container_audio_type: i32,
}
pub mod container_audio {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum ContainerAudioType {
Unspecified = 0,
Wav = 1,
OggOpus = 2,
Mp3 = 3,
}
impl ContainerAudioType {
pub fn as_str_name(&self) -> &'static str {
match self {
ContainerAudioType::Unspecified => "CONTAINER_AUDIO_TYPE_UNSPECIFIED",
ContainerAudioType::Wav => "CONTAINER_AUDIO_TYPE_WAV",
ContainerAudioType::OggOpus => "CONTAINER_AUDIO_TYPE_OGG_OPUS",
ContainerAudioType::Mp3 => "CONTAINER_AUDIO_TYPE_MP3",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CONTAINER_AUDIO_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"CONTAINER_AUDIO_TYPE_WAV" => Some(Self::Wav),
"CONTAINER_AUDIO_TYPE_OGG_OPUS" => Some(Self::OggOpus),
"CONTAINER_AUDIO_TYPE_MP3" => Some(Self::Mp3),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AudioMetadata {
#[prost(oneof = "audio_metadata::AudioFormat", tags = "1, 2")]
pub audio_format: ::core::option::Option<audio_metadata::AudioFormat>,
}
pub mod audio_metadata {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum AudioFormat {
#[prost(message, tag = "1")]
RawAudio(super::RawAudio),
#[prost(message, tag = "2")]
ContainerAudio(super::ContainerAudio),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AudioChunk {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AudioStreamingRequest {
#[prost(oneof = "audio_streaming_request::AudioEvent", tags = "1, 2")]
pub audio_event: ::core::option::Option<audio_streaming_request::AudioEvent>,
}
pub mod audio_streaming_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum AudioEvent {
#[prost(message, tag = "1")]
AudioMetadata(super::AudioMetadata),
#[prost(message, tag = "2")]
Chunk(super::AudioChunk),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AudioRequest {
#[prost(message, optional, tag = "1")]
pub audio_metadata: ::core::option::Option<AudioMetadata>,
#[prost(message, optional, tag = "2")]
pub audio_data: ::core::option::Option<AudioChunk>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Classifier {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListClassifiersRequest {
#[prost(string, tag = "1")]
pub project_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListClassifiersResponse {
#[prost(message, repeated, tag = "1")]
pub classifiers: ::prost::alloc::vec::Vec<Classifier>,
}
pub mod classifiers_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ClassifiersServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ClassifiersServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> ClassifiersServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<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_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ClassifiersServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
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,
{
ClassifiersServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListClassifiersRequest>,
) -> std::result::Result<
tonic::Response<super::ListClassifiersResponse>,
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(
"/yandex.cloud.speechsense.v1.ClassifiersService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.speechsense.v1.ClassifiersService",
"List",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Project {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub connection_id: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub description: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub created_by: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "7")]
pub modified_by: ::prost::alloc::string::String,
#[prost(message, optional, tag = "8")]
pub modified_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, repeated, tag = "9")]
pub filters: ::prost::alloc::vec::Vec<FieldFilter>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FieldFilter {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub field_value: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateProjectRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub connection_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub description: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "4")]
pub filters: ::prost::alloc::vec::Vec<FieldFilter>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateProjectMetadata {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
}
pub mod project_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ProjectServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ProjectServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> ProjectServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<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_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ProjectServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
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,
{
ProjectServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateProjectRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::operation::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(
"/yandex.cloud.speechsense.v1.ProjectService/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.speechsense.v1.ProjectService",
"Create",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Filter {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(bool, tag = "7")]
pub inverse: bool,
#[prost(message, optional, tag = "8")]
pub channel_number: ::core::option::Option<i64>,
#[prost(oneof = "filter::Filter", tags = "2, 3, 4, 5, 6, 9")]
pub filter: ::core::option::Option<filter::Filter>,
}
pub mod filter {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Filter {
#[prost(message, tag = "2")]
AnyMatch(super::AnyMatchFilter),
#[prost(message, tag = "3")]
IntRange(super::IntRangeFilter),
#[prost(message, tag = "4")]
DoubleRange(super::DoubleRangeFilter),
#[prost(message, tag = "5")]
DateRange(super::DateRangeFilter),
#[prost(message, tag = "6")]
DurationRange(super::DurationRangeFilter),
#[prost(message, tag = "9")]
BooleanMatch(super::BooleanFilter),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Query {
#[prost(string, tag = "1")]
pub text: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub inverse: bool,
#[prost(message, optional, tag = "3")]
pub channel_number: ::core::option::Option<i64>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnyMatchFilter {
#[prost(string, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BoundsInclusive {
#[prost(bool, tag = "1")]
pub from_inclusive: bool,
#[prost(bool, tag = "2")]
pub to_inclusive: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IntRangeFilter {
#[prost(message, optional, tag = "1")]
pub from_value: ::core::option::Option<i64>,
#[prost(message, optional, tag = "2")]
pub to_value: ::core::option::Option<i64>,
#[prost(message, optional, tag = "3")]
pub bounds_inclusive: ::core::option::Option<BoundsInclusive>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DoubleRangeFilter {
#[prost(message, optional, tag = "1")]
pub from_value: ::core::option::Option<f64>,
#[prost(message, optional, tag = "2")]
pub to_value: ::core::option::Option<f64>,
#[prost(message, optional, tag = "3")]
pub bounds_inclusive: ::core::option::Option<BoundsInclusive>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DateRangeFilter {
#[prost(message, optional, tag = "1")]
pub from_value: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub to_value: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "3")]
pub bounds_inclusive: ::core::option::Option<BoundsInclusive>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DurationRangeFilter {
#[prost(message, optional, tag = "1")]
pub from_value: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "2")]
pub to_value: ::core::option::Option<::prost_types::Duration>,
#[prost(message, optional, tag = "3")]
pub bounds_inclusive: ::core::option::Option<BoundsInclusive>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BooleanFilter {
#[prost(bool, tag = "1")]
pub value: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SortData {
#[prost(message, repeated, tag = "1")]
pub fields: ::prost::alloc::vec::Vec<SortField>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SortField {
#[prost(string, tag = "1")]
pub field: ::prost::alloc::string::String,
#[prost(enumeration = "SortOrder", tag = "2")]
pub order: i32,
#[prost(int64, tag = "3")]
pub position: i64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SortOrder {
Unspecified = 0,
Asc = 1,
Desc = 2,
}
impl SortOrder {
pub fn as_str_name(&self) -> &'static str {
match self {
SortOrder::Unspecified => "SORT_ORDER_UNSPECIFIED",
SortOrder::Asc => "SORT_ORDER_ASC",
SortOrder::Desc => "SORT_ORDER_DESC",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SORT_ORDER_UNSPECIFIED" => Some(Self::Unspecified),
"SORT_ORDER_ASC" => Some(Self::Asc),
"SORT_ORDER_DESC" => Some(Self::Desc),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Talk {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub organization_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub space_id: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub connection_id: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "5")]
pub project_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "6")]
pub created_by: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "8")]
pub modified_by: ::prost::alloc::string::String,
#[prost(message, optional, tag = "9")]
pub modified_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, repeated, tag = "10")]
pub talk_fields: ::prost::alloc::vec::Vec<Field>,
#[prost(message, optional, tag = "11")]
pub transcription: ::core::option::Option<analysis::Transcription>,
#[prost(message, optional, tag = "12")]
pub speech_statistics: ::core::option::Option<analysis::SpeechStatistics>,
#[prost(message, optional, tag = "13")]
pub silence_statistics: ::core::option::Option<analysis::SilenceStatistics>,
#[prost(message, optional, tag = "14")]
pub interrupts_statistics: ::core::option::Option<analysis::InterruptsStatistics>,
#[prost(message, optional, tag = "15")]
pub conversation_statistics: ::core::option::Option<
analysis::ConversationStatistics,
>,
#[prost(message, optional, tag = "16")]
pub points: ::core::option::Option<analysis::Points>,
#[prost(message, optional, tag = "17")]
pub text_classifiers: ::core::option::Option<analysis::TextClassifiers>,
#[prost(message, optional, tag = "18")]
pub summarization: ::core::option::Option<analysis::Summarization>,
#[prost(message, optional, tag = "19")]
pub talk_state: ::core::option::Option<TalkState>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TalkState {
#[prost(enumeration = "ProcessingState", tag = "1")]
pub processing_state: i32,
#[prost(message, repeated, tag = "2")]
pub algorithm_processing_infos: ::prost::alloc::vec::Vec<AlgorithmProcessingInfo>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Field {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
#[prost(enumeration = "FieldType", tag = "3")]
pub r#type: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AlgorithmProcessingInfo {
#[prost(enumeration = "Algorithm", tag = "1")]
pub algorithm: i32,
#[prost(enumeration = "ProcessingState", tag = "2")]
pub processing_state: i32,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FieldType {
Unspecified = 0,
String = 1,
Number = 2,
Decimal = 3,
Boolean = 4,
Date = 5,
Json = 6,
}
impl FieldType {
pub fn as_str_name(&self) -> &'static str {
match self {
FieldType::Unspecified => "FIELD_TYPE_UNSPECIFIED",
FieldType::String => "FIELD_TYPE_STRING",
FieldType::Number => "FIELD_TYPE_NUMBER",
FieldType::Decimal => "FIELD_TYPE_DECIMAL",
FieldType::Boolean => "FIELD_TYPE_BOOLEAN",
FieldType::Date => "FIELD_TYPE_DATE",
FieldType::Json => "FIELD_TYPE_JSON",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"FIELD_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"FIELD_TYPE_STRING" => Some(Self::String),
"FIELD_TYPE_NUMBER" => Some(Self::Number),
"FIELD_TYPE_DECIMAL" => Some(Self::Decimal),
"FIELD_TYPE_BOOLEAN" => Some(Self::Boolean),
"FIELD_TYPE_DATE" => Some(Self::Date),
"FIELD_TYPE_JSON" => Some(Self::Json),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProcessingState {
Unspecified = 0,
NotStarted = 1,
Processing = 2,
Success = 3,
Failed = 4,
}
impl ProcessingState {
pub fn as_str_name(&self) -> &'static str {
match self {
ProcessingState::Unspecified => "PROCESSING_STATE_UNSPECIFIED",
ProcessingState::NotStarted => "PROCESSING_STATE_NOT_STARTED",
ProcessingState::Processing => "PROCESSING_STATE_PROCESSING",
ProcessingState::Success => "PROCESSING_STATE_SUCCESS",
ProcessingState::Failed => "PROCESSING_STATE_FAILED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PROCESSING_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"PROCESSING_STATE_NOT_STARTED" => Some(Self::NotStarted),
"PROCESSING_STATE_PROCESSING" => Some(Self::Processing),
"PROCESSING_STATE_SUCCESS" => Some(Self::Success),
"PROCESSING_STATE_FAILED" => Some(Self::Failed),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Algorithm {
Unspecified = 0,
Speechkit = 1,
Ygpt = 2,
Classifier = 3,
Summarization = 4,
Embedding = 5,
Statistics = 6,
}
impl Algorithm {
pub fn as_str_name(&self) -> &'static str {
match self {
Algorithm::Unspecified => "ALGORITHM_UNSPECIFIED",
Algorithm::Speechkit => "ALGORITHM_SPEECHKIT",
Algorithm::Ygpt => "ALGORITHM_YGPT",
Algorithm::Classifier => "ALGORITHM_CLASSIFIER",
Algorithm::Summarization => "ALGORITHM_SUMMARIZATION",
Algorithm::Embedding => "ALGORITHM_EMBEDDING",
Algorithm::Statistics => "ALGORITHM_STATISTICS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ALGORITHM_UNSPECIFIED" => Some(Self::Unspecified),
"ALGORITHM_SPEECHKIT" => Some(Self::Speechkit),
"ALGORITHM_YGPT" => Some(Self::Ygpt),
"ALGORITHM_CLASSIFIER" => Some(Self::Classifier),
"ALGORITHM_SUMMARIZATION" => Some(Self::Summarization),
"ALGORITHM_EMBEDDING" => Some(Self::Embedding),
"ALGORITHM_STATISTICS" => Some(Self::Statistics),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextContent {
#[prost(message, repeated, tag = "1")]
pub messages: ::prost::alloc::vec::Vec<Message>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Message {
#[prost(string, tag = "1")]
pub user_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(oneof = "message::Payload", tags = "3")]
pub payload: ::core::option::Option<message::Payload>,
}
pub mod message {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "3")]
Text(super::TextPayload),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TextPayload {
#[prost(string, tag = "1")]
pub text: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamTalkRequest {
#[prost(oneof = "stream_talk_request::Event", tags = "1, 2")]
pub event: ::core::option::Option<stream_talk_request::Event>,
}
pub mod stream_talk_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Event {
#[prost(message, tag = "1")]
Metadata(super::TalkMetadata),
#[prost(message, tag = "2")]
Audio(super::AudioStreamingRequest),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UploadTalkRequest {
#[prost(string, tag = "3")]
pub talk_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "1")]
pub metadata: ::core::option::Option<TalkMetadata>,
#[prost(message, optional, tag = "2")]
pub audio: ::core::option::Option<AudioRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UploadTalkResponse {
#[prost(string, tag = "1")]
pub talk_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UploadTextRequest {
#[prost(string, tag = "3")]
pub talk_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "1")]
pub metadata: ::core::option::Option<TalkMetadata>,
#[prost(message, optional, tag = "2")]
pub text_content: ::core::option::Option<TextContent>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UploadTextResponse {
#[prost(string, tag = "1")]
pub talk_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TalkMetadata {
#[prost(string, tag = "1")]
pub connection_id: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "2")]
pub fields: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, repeated, tag = "3")]
pub users: ::prost::alloc::vec::Vec<UserMetadata>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserMetadata {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(enumeration = "UserRole", tag = "2")]
pub role: i32,
#[prost(map = "string, string", tag = "3")]
pub fields: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchTalkRequest {
#[prost(string, tag = "1")]
pub organization_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub space_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub connection_id: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub project_id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "5")]
pub filters: ::prost::alloc::vec::Vec<Filter>,
#[prost(message, optional, tag = "6")]
pub query: ::core::option::Option<Query>,
#[prost(int64, tag = "7")]
pub page_size: i64,
#[prost(string, tag = "8")]
pub page_token: ::prost::alloc::string::String,
#[prost(message, optional, tag = "9")]
pub sort_data: ::core::option::Option<SortData>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchTalkResponse {
#[prost(string, repeated, tag = "1")]
pub talk_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(int64, tag = "2")]
pub talks_count: i64,
#[prost(string, tag = "3")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTalkRequest {
#[prost(string, tag = "1")]
pub organization_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub space_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub connection_id: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub project_id: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "5")]
pub talk_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub results_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTalkResponse {
#[prost(message, repeated, tag = "1")]
pub talk: ::prost::alloc::vec::Vec<Talk>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum UserRole {
Unspecified = 0,
Operator = 1,
Client = 2,
Bot = 3,
}
impl UserRole {
pub fn as_str_name(&self) -> &'static str {
match self {
UserRole::Unspecified => "USER_ROLE_UNSPECIFIED",
UserRole::Operator => "USER_ROLE_OPERATOR",
UserRole::Client => "USER_ROLE_CLIENT",
UserRole::Bot => "USER_ROLE_BOT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"USER_ROLE_UNSPECIFIED" => Some(Self::Unspecified),
"USER_ROLE_OPERATOR" => Some(Self::Operator),
"USER_ROLE_CLIENT" => Some(Self::Client),
"USER_ROLE_BOT" => Some(Self::Bot),
_ => None,
}
}
}
pub mod talk_service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct TalkServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl TalkServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> TalkServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<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_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> TalkServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
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,
{
TalkServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn upload_as_stream(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::StreamTalkRequest>,
) -> std::result::Result<
tonic::Response<super::UploadTalkResponse>,
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(
"/yandex.cloud.speechsense.v1.TalkService/UploadAsStream",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.speechsense.v1.TalkService",
"UploadAsStream",
),
);
self.inner.client_streaming(req, path, codec).await
}
pub async fn upload(
&mut self,
request: impl tonic::IntoRequest<super::UploadTalkRequest>,
) -> std::result::Result<
tonic::Response<super::UploadTalkResponse>,
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(
"/yandex.cloud.speechsense.v1.TalkService/Upload",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.speechsense.v1.TalkService", "Upload"),
);
self.inner.unary(req, path, codec).await
}
pub async fn upload_text(
&mut self,
request: impl tonic::IntoRequest<super::UploadTextRequest>,
) -> std::result::Result<
tonic::Response<super::UploadTextResponse>,
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(
"/yandex.cloud.speechsense.v1.TalkService/UploadText",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.speechsense.v1.TalkService",
"UploadText",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn search(
&mut self,
request: impl tonic::IntoRequest<super::SearchTalkRequest>,
) -> std::result::Result<
tonic::Response<super::SearchTalkResponse>,
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(
"/yandex.cloud.speechsense.v1.TalkService/Search",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.speechsense.v1.TalkService", "Search"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetTalkRequest>,
) -> std::result::Result<
tonic::Response<super::GetTalkResponse>,
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(
"/yandex.cloud.speechsense.v1.TalkService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.speechsense.v1.TalkService", "Get"),
);
self.inner.unary(req, path, codec).await
}
}
}