#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogEntryResource {
#[prost(string, tag = "1")]
pub r#type: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogGroupResource {
#[prost(string, tag = "1")]
pub r#type: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogEntry {
#[prost(string, tag = "1")]
pub uid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub resource: ::core::option::Option<LogEntryResource>,
#[prost(message, optional, tag = "3")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "4")]
pub ingested_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "5")]
pub saved_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "log_level::Level", tag = "6")]
pub level: i32,
#[prost(string, tag = "7")]
pub message: ::prost::alloc::string::String,
#[prost(message, optional, tag = "8")]
pub json_payload: ::core::option::Option<::prost_types::Struct>,
#[prost(string, tag = "9")]
pub stream_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IncomingLogEntry {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "log_level::Level", tag = "2")]
pub level: i32,
#[prost(string, tag = "3")]
pub message: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub json_payload: ::core::option::Option<::prost_types::Struct>,
#[prost(string, tag = "5")]
pub stream_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogEntryDefaults {
#[prost(enumeration = "log_level::Level", tag = "2")]
pub level: i32,
#[prost(message, optional, tag = "4")]
pub json_payload: ::core::option::Option<::prost_types::Struct>,
#[prost(string, tag = "5")]
pub stream_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Destination {
#[prost(oneof = "destination::Destination", tags = "1, 2")]
pub destination: ::core::option::Option<destination::Destination>,
}
pub mod destination {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Destination {
#[prost(string, tag = "1")]
LogGroupId(::prost::alloc::string::String),
#[prost(string, tag = "2")]
FolderId(::prost::alloc::string::String),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogLevel {
#[prost(enumeration = "log_level::Level", tag = "1")]
pub level: i32,
}
pub mod log_level {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Level {
Unspecified = 0,
Trace = 1,
Debug = 2,
Info = 3,
Warn = 4,
Error = 5,
Fatal = 6,
}
impl Level {
pub fn as_str_name(&self) -> &'static str {
match self {
Level::Unspecified => "LEVEL_UNSPECIFIED",
Level::Trace => "TRACE",
Level::Debug => "DEBUG",
Level::Info => "INFO",
Level::Warn => "WARN",
Level::Error => "ERROR",
Level::Fatal => "FATAL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LEVEL_UNSPECIFIED" => Some(Self::Unspecified),
"TRACE" => Some(Self::Trace),
"DEBUG" => Some(Self::Debug),
"INFO" => Some(Self::Info),
"WARN" => Some(Self::Warn),
"ERROR" => Some(Self::Error),
"FATAL" => Some(Self::Fatal),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Export {
#[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 cloud_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub description: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "7")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(string, tag = "8")]
pub group_id: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub sink_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "10")]
pub params: ::core::option::Option<ExportParams>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportParams {
#[prost(string, repeated, tag = "1")]
pub resource_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "2")]
pub resource_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "3")]
pub stream_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(enumeration = "log_level::Level", repeated, packed = "false", tag = "4")]
pub levels: ::prost::alloc::vec::Vec<i32>,
#[prost(string, tag = "5")]
pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RunExportRequest {
#[prost(string, tag = "1")]
pub group_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub sink_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub params: ::core::option::Option<ExportParams>,
#[prost(string, tag = "4")]
pub result_filename: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub since: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "6")]
pub until: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RunExportDetails {
#[prost(string, tag = "1")]
pub group_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub sink_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub params: ::core::option::Option<ExportParams>,
#[prost(string, tag = "4")]
pub result_filename: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub since: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "6")]
pub until: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RunExportMetadata {
#[prost(string, tag = "1")]
pub group_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub sink_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub result_filename: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetExportRequest {
#[prost(string, tag = "1")]
pub export_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListExportsRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub page_size: i64,
#[prost(string, tag = "4")]
pub page_token: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListExportsResponse {
#[prost(message, repeated, tag = "1")]
pub exports: ::prost::alloc::vec::Vec<Export>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateExportRequest {
#[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(map = "string, string", tag = "4")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(string, tag = "5")]
pub group_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub sink_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub params: ::core::option::Option<ExportParams>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateExportMetadata {
#[prost(string, tag = "1")]
pub export_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateExportRequest {
#[prost(string, tag = "1")]
pub export_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(map = "string, string", tag = "5")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(string, tag = "6")]
pub group_id: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub sink_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "8")]
pub params: ::core::option::Option<ExportParams>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateExportMetadata {
#[prost(string, tag = "1")]
pub export_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteExportRequest {
#[prost(string, tag = "1")]
pub export_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteExportMetadata {
#[prost(string, tag = "1")]
pub export_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListExportOperationsRequest {
#[prost(string, tag = "1")]
pub export_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub page_size: i64,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListExportOperationsResponse {
#[prost(message, repeated, tag = "1")]
pub operations: ::prost::alloc::vec::Vec<super::super::operation::Operation>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
pub mod export_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 ExportServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ExportServiceClient<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> ExportServiceClient<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,
) -> ExportServiceClient<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,
{
ExportServiceClient::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 run(
&mut self,
request: impl tonic::IntoRequest<super::RunExportRequest>,
) -> 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.logging.v1.ExportService/Run",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.logging.v1.ExportService", "Run"));
self.inner.unary(req, path, codec).await
}
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetExportRequest>,
) -> std::result::Result<tonic::Response<super::Export>, 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.logging.v1.ExportService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.logging.v1.ExportService", "Get"));
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListExportsRequest>,
) -> std::result::Result<
tonic::Response<super::ListExportsResponse>,
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.logging.v1.ExportService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.logging.v1.ExportService", "List"),
);
self.inner.unary(req, path, codec).await
}
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateExportRequest>,
) -> 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.logging.v1.ExportService/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.logging.v1.ExportService", "Create"),
);
self.inner.unary(req, path, codec).await
}
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateExportRequest>,
) -> 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.logging.v1.ExportService/Update",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.logging.v1.ExportService", "Update"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteExportRequest>,
) -> 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.logging.v1.ExportService/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.logging.v1.ExportService", "Delete"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_operations(
&mut self,
request: impl tonic::IntoRequest<super::ListExportOperationsRequest>,
) -> std::result::Result<
tonic::Response<super::ListExportOperationsResponse>,
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.logging.v1.ExportService/ListOperations",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.logging.v1.ExportService",
"ListOperations",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_access_bindings(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::access::ListAccessBindingsRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::access::ListAccessBindingsResponse>,
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.logging.v1.ExportService/ListAccessBindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.logging.v1.ExportService",
"ListAccessBindings",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn set_access_bindings(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::access::SetAccessBindingsRequest,
>,
) -> 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.logging.v1.ExportService/SetAccessBindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.logging.v1.ExportService",
"SetAccessBindings",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_access_bindings(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::access::UpdateAccessBindingsRequest,
>,
) -> 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.logging.v1.ExportService/UpdateAccessBindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.logging.v1.ExportService",
"UpdateAccessBindings",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogGroup {
#[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 cloud_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub description: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "7")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(enumeration = "log_group::Status", tag = "8")]
pub status: i32,
#[prost(message, optional, tag = "9")]
pub retention_period: ::core::option::Option<::prost_types::Duration>,
#[prost(string, tag = "10")]
pub data_stream: ::prost::alloc::string::String,
}
pub mod log_group {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum Status {
Unspecified = 0,
Creating = 1,
Active = 2,
Deleting = 3,
Error = 4,
}
impl Status {
pub fn as_str_name(&self) -> &'static str {
match self {
Status::Unspecified => "STATUS_UNSPECIFIED",
Status::Creating => "CREATING",
Status::Active => "ACTIVE",
Status::Deleting => "DELETING",
Status::Error => "ERROR",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"CREATING" => Some(Self::Creating),
"ACTIVE" => Some(Self::Active),
"DELETING" => Some(Self::Deleting),
"ERROR" => Some(Self::Error),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLogGroupRequest {
#[prost(string, tag = "1")]
pub log_group_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLogGroupStatsRequest {
#[prost(string, tag = "1")]
pub log_group_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListLogGroupsRequest {
#[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,
#[prost(string, tag = "4")]
pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListLogGroupsResponse {
#[prost(message, repeated, tag = "1")]
pub groups: ::prost::alloc::vec::Vec<LogGroup>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateLogGroupRequest {
#[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(map = "string, string", tag = "4")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "5")]
pub retention_period: ::core::option::Option<::prost_types::Duration>,
#[prost(string, tag = "6")]
pub data_stream: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateLogGroupMetadata {
#[prost(string, tag = "1")]
pub log_group_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateLogGroupRequest {
#[prost(string, tag = "1")]
pub log_group_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(map = "string, string", tag = "5")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "6")]
pub retention_period: ::core::option::Option<::prost_types::Duration>,
#[prost(string, tag = "7")]
pub data_stream: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateLogGroupMetadata {
#[prost(string, tag = "1")]
pub log_group_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteLogGroupRequest {
#[prost(string, tag = "1")]
pub log_group_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteLogGroupMetadata {
#[prost(string, tag = "1")]
pub log_group_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListResourcesRequest {
#[prost(string, tag = "1")]
pub log_group_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub r#type: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListResourcesResponse {
#[prost(message, repeated, tag = "1")]
pub resources: ::prost::alloc::vec::Vec<LogGroupResource>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOperationsRequest {
#[prost(string, tag = "1")]
pub log_group_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub page_size: i64,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOperationsResponse {
#[prost(message, repeated, tag = "1")]
pub operations: ::prost::alloc::vec::Vec<super::super::operation::Operation>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLogGroupStatsResponse {
#[prost(string, tag = "1")]
pub log_group_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub bytes: i64,
#[prost(int64, tag = "3")]
pub records: i64,
}
pub mod log_group_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 LogGroupServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl LogGroupServiceClient<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> LogGroupServiceClient<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,
) -> LogGroupServiceClient<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,
{
LogGroupServiceClient::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 get(
&mut self,
request: impl tonic::IntoRequest<super::GetLogGroupRequest>,
) -> std::result::Result<tonic::Response<super::LogGroup>, 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.logging.v1.LogGroupService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.logging.v1.LogGroupService", "Get"),
);
self.inner.unary(req, path, codec).await
}
pub async fn stats(
&mut self,
request: impl tonic::IntoRequest<super::GetLogGroupStatsRequest>,
) -> std::result::Result<
tonic::Response<super::GetLogGroupStatsResponse>,
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.logging.v1.LogGroupService/Stats",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.logging.v1.LogGroupService", "Stats"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListLogGroupsRequest>,
) -> std::result::Result<
tonic::Response<super::ListLogGroupsResponse>,
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.logging.v1.LogGroupService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.logging.v1.LogGroupService", "List"),
);
self.inner.unary(req, path, codec).await
}
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateLogGroupRequest>,
) -> 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.logging.v1.LogGroupService/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.logging.v1.LogGroupService", "Create"),
);
self.inner.unary(req, path, codec).await
}
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateLogGroupRequest>,
) -> 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.logging.v1.LogGroupService/Update",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.logging.v1.LogGroupService", "Update"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteLogGroupRequest>,
) -> 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.logging.v1.LogGroupService/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.logging.v1.LogGroupService", "Delete"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_resources(
&mut self,
request: impl tonic::IntoRequest<super::ListResourcesRequest>,
) -> std::result::Result<
tonic::Response<super::ListResourcesResponse>,
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.logging.v1.LogGroupService/ListResources",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.logging.v1.LogGroupService",
"ListResources",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_operations(
&mut self,
request: impl tonic::IntoRequest<super::ListOperationsRequest>,
) -> std::result::Result<
tonic::Response<super::ListOperationsResponse>,
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.logging.v1.LogGroupService/ListOperations",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.logging.v1.LogGroupService",
"ListOperations",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_access_bindings(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::access::ListAccessBindingsRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::access::ListAccessBindingsResponse>,
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.logging.v1.LogGroupService/ListAccessBindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.logging.v1.LogGroupService",
"ListAccessBindings",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn set_access_bindings(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::access::SetAccessBindingsRequest,
>,
) -> 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.logging.v1.LogGroupService/SetAccessBindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.logging.v1.LogGroupService",
"SetAccessBindings",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_access_bindings(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::access::UpdateAccessBindingsRequest,
>,
) -> 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.logging.v1.LogGroupService/UpdateAccessBindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.logging.v1.LogGroupService",
"UpdateAccessBindings",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteRequest {
#[prost(message, optional, tag = "1")]
pub destination: ::core::option::Option<Destination>,
#[prost(message, optional, tag = "2")]
pub resource: ::core::option::Option<LogEntryResource>,
#[prost(message, repeated, tag = "3")]
pub entries: ::prost::alloc::vec::Vec<IncomingLogEntry>,
#[prost(message, optional, tag = "4")]
pub defaults: ::core::option::Option<LogEntryDefaults>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteResponse {
#[prost(map = "int64, message", tag = "1")]
pub errors: ::std::collections::HashMap<
i64,
super::super::super::super::google::rpc::Status,
>,
}
pub mod log_ingestion_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 LogIngestionServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl LogIngestionServiceClient<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> LogIngestionServiceClient<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,
) -> LogIngestionServiceClient<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,
{
LogIngestionServiceClient::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 write(
&mut self,
request: impl tonic::IntoRequest<super::WriteRequest>,
) -> std::result::Result<tonic::Response<super::WriteResponse>, 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.logging.v1.LogIngestionService/Write",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.logging.v1.LogIngestionService",
"Write",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadRequest {
#[prost(oneof = "read_request::Selector", tags = "1, 2")]
pub selector: ::core::option::Option<read_request::Selector>,
}
pub mod read_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Selector {
#[prost(string, tag = "1")]
PageToken(::prost::alloc::string::String),
#[prost(message, tag = "2")]
Criteria(super::Criteria),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadResponse {
#[prost(string, tag = "1")]
pub log_group_id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub entries: ::prost::alloc::vec::Vec<LogEntry>,
#[prost(string, tag = "3")]
pub next_page_token: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub previous_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Criteria {
#[prost(string, tag = "1")]
pub log_group_id: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub resource_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "3")]
pub resource_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub since: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "5")]
pub until: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "log_level::Level", repeated, packed = "false", tag = "6")]
pub levels: ::prost::alloc::vec::Vec<i32>,
#[prost(string, tag = "7")]
pub filter: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "10")]
pub stream_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(int64, tag = "8")]
pub page_size: i64,
#[prost(int64, tag = "9")]
pub max_response_size: i64,
}
pub mod log_reading_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 LogReadingServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl LogReadingServiceClient<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> LogReadingServiceClient<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,
) -> LogReadingServiceClient<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,
{
LogReadingServiceClient::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 read(
&mut self,
request: impl tonic::IntoRequest<super::ReadRequest>,
) -> std::result::Result<tonic::Response<super::ReadResponse>, 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.logging.v1.LogReadingService/Read",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.logging.v1.LogReadingService", "Read"),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Sink {
#[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 cloud_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "5")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub description: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "7")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(string, tag = "8")]
pub service_account_id: ::prost::alloc::string::String,
#[prost(oneof = "sink::Sink", tags = "9, 10")]
pub sink: ::core::option::Option<sink::Sink>,
}
pub mod sink {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Yds {
#[prost(string, tag = "1")]
pub stream_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct S3 {
#[prost(string, tag = "1")]
pub bucket: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub prefix: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Sink {
#[prost(message, tag = "9")]
Yds(Yds),
#[prost(message, tag = "10")]
S3(S3),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSinkRequest {
#[prost(string, tag = "1")]
pub sink_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSinksRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
pub page_size: i64,
#[prost(string, tag = "4")]
pub page_token: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSinksResponse {
#[prost(message, repeated, tag = "1")]
pub sinks: ::prost::alloc::vec::Vec<Sink>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSinkRequest {
#[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(map = "string, string", tag = "4")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(string, tag = "5")]
pub service_account_id: ::prost::alloc::string::String,
#[prost(oneof = "create_sink_request::Sink", tags = "6, 7")]
pub sink: ::core::option::Option<create_sink_request::Sink>,
}
pub mod create_sink_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Sink {
#[prost(message, tag = "6")]
Yds(super::sink::Yds),
#[prost(message, tag = "7")]
S3(super::sink::S3),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSinkMetadata {
#[prost(string, tag = "1")]
pub sink_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateSinkRequest {
#[prost(string, tag = "1")]
pub sink_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(map = "string, string", tag = "5")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(string, tag = "6")]
pub service_account_id: ::prost::alloc::string::String,
#[prost(oneof = "update_sink_request::Sink", tags = "7, 8")]
pub sink: ::core::option::Option<update_sink_request::Sink>,
}
pub mod update_sink_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Sink {
#[prost(message, tag = "7")]
Yds(super::sink::Yds),
#[prost(message, tag = "8")]
S3(super::sink::S3),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateSinkMetadata {
#[prost(string, tag = "1")]
pub sink_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteSinkRequest {
#[prost(string, tag = "1")]
pub sink_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteSinkMetadata {
#[prost(string, tag = "1")]
pub sink_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSinkOperationsRequest {
#[prost(string, tag = "1")]
pub sink_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub page_size: i64,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSinkOperationsResponse {
#[prost(message, repeated, tag = "1")]
pub operations: ::prost::alloc::vec::Vec<super::super::operation::Operation>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
pub mod sink_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 SinkServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SinkServiceClient<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> SinkServiceClient<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,
) -> SinkServiceClient<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,
{
SinkServiceClient::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 get(
&mut self,
request: impl tonic::IntoRequest<super::GetSinkRequest>,
) -> std::result::Result<tonic::Response<super::Sink>, 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.logging.v1.SinkService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.logging.v1.SinkService", "Get"));
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListSinksRequest>,
) -> std::result::Result<
tonic::Response<super::ListSinksResponse>,
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.logging.v1.SinkService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.logging.v1.SinkService", "List"));
self.inner.unary(req, path, codec).await
}
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateSinkRequest>,
) -> 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.logging.v1.SinkService/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.logging.v1.SinkService", "Create"),
);
self.inner.unary(req, path, codec).await
}
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateSinkRequest>,
) -> 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.logging.v1.SinkService/Update",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.logging.v1.SinkService", "Update"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteSinkRequest>,
) -> 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.logging.v1.SinkService/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.logging.v1.SinkService", "Delete"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_operations(
&mut self,
request: impl tonic::IntoRequest<super::ListSinkOperationsRequest>,
) -> std::result::Result<
tonic::Response<super::ListSinkOperationsResponse>,
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.logging.v1.SinkService/ListOperations",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.logging.v1.SinkService",
"ListOperations",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_access_bindings(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::access::ListAccessBindingsRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::access::ListAccessBindingsResponse>,
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.logging.v1.SinkService/ListAccessBindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.logging.v1.SinkService",
"ListAccessBindings",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn set_access_bindings(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::access::SetAccessBindingsRequest,
>,
) -> 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.logging.v1.SinkService/SetAccessBindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.logging.v1.SinkService",
"SetAccessBindings",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_access_bindings(
&mut self,
request: impl tonic::IntoRequest<
super::super::super::access::UpdateAccessBindingsRequest,
>,
) -> 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.logging.v1.SinkService/UpdateAccessBindings",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.logging.v1.SinkService",
"UpdateAccessBindings",
),
);
self.inner.unary(req, path, codec).await
}
}
}