#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct File {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub folder_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub description: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub mime_type: ::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 updated_by: ::prost::alloc::string::String,
#[prost(message, optional, tag = "9")]
pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "10")]
pub expiration_config: ::core::option::Option<
super::super::common::ExpirationConfig,
>,
#[prost(message, optional, tag = "11")]
pub expires_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(map = "string, string", tag = "12")]
pub labels: ::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 CreateFileRequest {
#[prost(string, tag = "1")]
pub folder_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,
#[prost(string, tag = "4")]
pub mime_type: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "5")]
pub content: ::prost::alloc::vec::Vec<u8>,
#[prost(map = "string, string", tag = "6")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "7")]
pub expiration_config: ::core::option::Option<
super::super::common::ExpirationConfig,
>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFileRequest {
#[prost(string, tag = "1")]
pub file_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFileUrlRequest {
#[prost(string, tag = "1")]
pub file_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFileUrlResponse {
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateFileRequest {
#[prost(string, tag = "1")]
pub file_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub description: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub expiration_config: ::core::option::Option<
super::super::common::ExpirationConfig,
>,
#[prost(map = "string, string", tag = "6")]
pub labels: ::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 DeleteFileRequest {
#[prost(string, tag = "1")]
pub file_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteFileResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFilesRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub page_size: i64,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFilesResponse {
#[prost(message, repeated, tag = "1")]
pub files: ::prost::alloc::vec::Vec<File>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
pub mod file_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 FileServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl FileServiceClient<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> FileServiceClient<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,
) -> FileServiceClient<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,
{
FileServiceClient::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::CreateFileRequest>,
) -> std::result::Result<tonic::Response<super::File>, 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.ai.files.v1.FileService/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ai.files.v1.FileService", "Create"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetFileRequest>,
) -> std::result::Result<tonic::Response<super::File>, 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.ai.files.v1.FileService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.ai.files.v1.FileService", "Get"));
self.inner.unary(req, path, codec).await
}
pub async fn get_url(
&mut self,
request: impl tonic::IntoRequest<super::GetFileUrlRequest>,
) -> std::result::Result<
tonic::Response<super::GetFileUrlResponse>,
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.ai.files.v1.FileService/GetUrl",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ai.files.v1.FileService", "GetUrl"),
);
self.inner.unary(req, path, codec).await
}
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateFileRequest>,
) -> std::result::Result<tonic::Response<super::File>, 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.ai.files.v1.FileService/Update",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ai.files.v1.FileService", "Update"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteFileRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteFileResponse>,
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.ai.files.v1.FileService/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.ai.files.v1.FileService", "Delete"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListFilesRequest>,
) -> std::result::Result<
tonic::Response<super::ListFilesResponse>,
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.ai.files.v1.FileService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.ai.files.v1.FileService", "List"));
self.inner.unary(req, path, codec).await
}
}
}