#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PurgeCacheRequest {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PurgeCacheMetadata {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PrefetchCacheRequest {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PrefetchCacheMetadata {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
}
pub mod cache_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 CacheServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl CacheServiceClient<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> CacheServiceClient<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,
) -> CacheServiceClient<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,
{
CacheServiceClient::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 purge(
&mut self,
request: impl tonic::IntoRequest<super::PurgeCacheRequest>,
) -> 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.cdn.v1.CacheService/Purge",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.cdn.v1.CacheService", "Purge"));
self.inner.unary(req, path, codec).await
}
pub async fn prefetch(
&mut self,
request: impl tonic::IntoRequest<super::PrefetchCacheRequest>,
) -> 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.cdn.v1.CacheService/Prefetch",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.cdn.v1.CacheService", "Prefetch"));
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Origin {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(int64, tag = "2")]
pub origin_group_id: i64,
#[prost(string, tag = "3")]
pub source: ::prost::alloc::string::String,
#[prost(bool, tag = "4")]
pub enabled: bool,
#[prost(bool, tag = "5")]
pub backup: bool,
#[prost(message, optional, tag = "6")]
pub meta: ::core::option::Option<OriginMeta>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OriginParams {
#[prost(string, tag = "1")]
pub source: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub enabled: bool,
#[prost(bool, tag = "3")]
pub backup: bool,
#[prost(message, optional, tag = "4")]
pub meta: ::core::option::Option<OriginMeta>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OriginMeta {
#[prost(oneof = "origin_meta::OriginMetaVariant", tags = "1, 2, 3, 4")]
pub origin_meta_variant: ::core::option::Option<origin_meta::OriginMetaVariant>,
}
pub mod origin_meta {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum OriginMetaVariant {
#[prost(message, tag = "1")]
Common(super::OriginNamedMeta),
#[prost(message, tag = "2")]
Bucket(super::OriginNamedMeta),
#[prost(message, tag = "3")]
Website(super::OriginNamedMeta),
#[prost(message, tag = "4")]
Balancer(super::OriginBalancerMeta),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OriginNamedMeta {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OriginBalancerMeta {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OriginGroup {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(string, tag = "2")]
pub folder_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
#[prost(bool, tag = "4")]
pub use_next: bool,
#[prost(message, repeated, tag = "5")]
pub origins: ::prost::alloc::vec::Vec<Origin>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOriginGroupRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub origin_group_id: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOriginGroupsRequest {
#[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 ListOriginGroupsResponse {
#[prost(message, repeated, tag = "1")]
pub origin_groups: ::prost::alloc::vec::Vec<OriginGroup>,
#[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 CreateOriginGroupRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub use_next: ::core::option::Option<bool>,
#[prost(message, repeated, tag = "4")]
pub origins: ::prost::alloc::vec::Vec<OriginParams>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateOriginGroupMetadata {
#[prost(int64, tag = "1")]
pub origin_group_id: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateOriginGroupRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub origin_group_id: i64,
#[prost(message, optional, tag = "3")]
pub group_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub use_next: ::core::option::Option<bool>,
#[prost(message, repeated, tag = "5")]
pub origins: ::prost::alloc::vec::Vec<OriginParams>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateOriginGroupMetadata {
#[prost(int64, tag = "1")]
pub origin_group_id: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteOriginGroupRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub origin_group_id: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteOriginGroupMetadata {
#[prost(int64, tag = "1")]
pub origin_group_id: i64,
}
pub mod origin_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 OriginGroupServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl OriginGroupServiceClient<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> OriginGroupServiceClient<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,
) -> OriginGroupServiceClient<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,
{
OriginGroupServiceClient::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::GetOriginGroupRequest>,
) -> std::result::Result<tonic::Response<super::OriginGroup>, 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.cdn.v1.OriginGroupService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.cdn.v1.OriginGroupService", "Get"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListOriginGroupsRequest>,
) -> std::result::Result<
tonic::Response<super::ListOriginGroupsResponse>,
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.cdn.v1.OriginGroupService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.cdn.v1.OriginGroupService", "List"),
);
self.inner.unary(req, path, codec).await
}
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateOriginGroupRequest>,
) -> 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.cdn.v1.OriginGroupService/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.cdn.v1.OriginGroupService", "Create"),
);
self.inner.unary(req, path, codec).await
}
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateOriginGroupRequest>,
) -> 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.cdn.v1.OriginGroupService/Update",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.cdn.v1.OriginGroupService", "Update"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteOriginGroupRequest>,
) -> 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.cdn.v1.OriginGroupService/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.cdn.v1.OriginGroupService", "Delete"),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOriginRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub origin_id: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOriginsRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub origin_group_id: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOriginsResponse {
#[prost(message, repeated, tag = "1")]
pub origins: ::prost::alloc::vec::Vec<Origin>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateOriginRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub origin_group_id: i64,
#[prost(string, tag = "3")]
pub source: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub enabled: ::core::option::Option<bool>,
#[prost(message, optional, tag = "5")]
pub backup: ::core::option::Option<bool>,
#[prost(message, optional, tag = "6")]
pub meta: ::core::option::Option<OriginMeta>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateOriginMetadata {
#[prost(int64, tag = "1")]
pub origin_id: i64,
#[prost(int64, tag = "2")]
pub origin_group_id: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateOriginRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub origin_id: i64,
#[prost(string, tag = "3")]
pub source: ::prost::alloc::string::String,
#[prost(bool, tag = "4")]
pub enabled: bool,
#[prost(bool, tag = "5")]
pub backup: bool,
#[prost(message, optional, tag = "6")]
pub meta: ::core::option::Option<OriginMeta>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateOriginMetadata {
#[prost(int64, tag = "1")]
pub origin_id: i64,
#[prost(int64, tag = "2")]
pub origin_group_id: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteOriginRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub origin_id: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteOriginMetadata {
#[prost(int64, tag = "1")]
pub origin_id: i64,
}
pub mod origin_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 OriginServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl OriginServiceClient<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> OriginServiceClient<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,
) -> OriginServiceClient<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,
{
OriginServiceClient::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::GetOriginRequest>,
) -> std::result::Result<tonic::Response<super::Origin>, 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.cdn.v1.OriginService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.cdn.v1.OriginService", "Get"));
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListOriginsRequest>,
) -> std::result::Result<
tonic::Response<super::ListOriginsResponse>,
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.cdn.v1.OriginService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.cdn.v1.OriginService", "List"));
self.inner.unary(req, path, codec).await
}
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateOriginRequest>,
) -> 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.cdn.v1.OriginService/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.cdn.v1.OriginService", "Create"));
self.inner.unary(req, path, codec).await
}
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateOriginRequest>,
) -> 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.cdn.v1.OriginService/Update",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.cdn.v1.OriginService", "Update"));
self.inner.unary(req, path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteOriginRequest>,
) -> 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.cdn.v1.OriginService/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.cdn.v1.OriginService", "Delete"));
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActivateProviderRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub provider_type: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActivateProviderMetadata {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListActivatedProvidersRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListActivatedProvidersResponse {
#[prost(string, repeated, tag = "1")]
pub providers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
pub mod provider_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 ProviderServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ProviderServiceClient<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> ProviderServiceClient<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,
) -> ProviderServiceClient<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,
{
ProviderServiceClient::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 activate(
&mut self,
request: impl tonic::IntoRequest<super::ActivateProviderRequest>,
) -> 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.cdn.v1.ProviderService/Activate",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.cdn.v1.ProviderService", "Activate"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_activated(
&mut self,
request: impl tonic::IntoRequest<super::ListActivatedProvidersRequest>,
) -> std::result::Result<
tonic::Response<super::ListActivatedProvidersResponse>,
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.cdn.v1.ProviderService/ListActivated",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.cdn.v1.ProviderService",
"ListActivated",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RawLogsSettings {
#[prost(string, tag = "1")]
pub bucket_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub bucket_region: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub file_prefix: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RawLogsStatus {
Unspecified = 0,
NotActivated = 1,
Ok = 2,
Failed = 3,
Pending = 4,
}
impl RawLogsStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
RawLogsStatus::Unspecified => "RAW_LOGS_STATUS_UNSPECIFIED",
RawLogsStatus::NotActivated => "RAW_LOGS_STATUS_NOT_ACTIVATED",
RawLogsStatus::Ok => "RAW_LOGS_STATUS_OK",
RawLogsStatus::Failed => "RAW_LOGS_STATUS_FAILED",
RawLogsStatus::Pending => "RAW_LOGS_STATUS_PENDING",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RAW_LOGS_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"RAW_LOGS_STATUS_NOT_ACTIVATED" => Some(Self::NotActivated),
"RAW_LOGS_STATUS_OK" => Some(Self::Ok),
"RAW_LOGS_STATUS_FAILED" => Some(Self::Failed),
"RAW_LOGS_STATUS_PENDING" => Some(Self::Pending),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActivateRawLogsRequest {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub settings: ::core::option::Option<RawLogsSettings>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActivateRawLogsMetadata {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActivateRawLogsResponse {
#[prost(enumeration = "RawLogsStatus", tag = "1")]
pub status: i32,
#[prost(message, optional, tag = "2")]
pub settings: ::core::option::Option<RawLogsSettings>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeactivateRawLogsRequest {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeactivateRawLogsMetadata {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetRawLogsRequest {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetRawLogsResponse {
#[prost(enumeration = "RawLogsStatus", tag = "1")]
pub status: i32,
#[prost(message, optional, tag = "2")]
pub settings: ::core::option::Option<RawLogsSettings>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateRawLogsRequest {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub settings: ::core::option::Option<RawLogsSettings>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateRawLogsResponse {
#[prost(enumeration = "RawLogsStatus", tag = "1")]
pub status: i32,
#[prost(message, optional, tag = "2")]
pub settings: ::core::option::Option<RawLogsSettings>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateRawLogsMetadata {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
}
pub mod raw_logs_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 RawLogsServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl RawLogsServiceClient<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> RawLogsServiceClient<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,
) -> RawLogsServiceClient<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,
{
RawLogsServiceClient::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 activate(
&mut self,
request: impl tonic::IntoRequest<super::ActivateRawLogsRequest>,
) -> 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.cdn.v1.RawLogsService/Activate",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.cdn.v1.RawLogsService", "Activate"),
);
self.inner.unary(req, path, codec).await
}
pub async fn deactivate(
&mut self,
request: impl tonic::IntoRequest<super::DeactivateRawLogsRequest>,
) -> 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.cdn.v1.RawLogsService/Deactivate",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.cdn.v1.RawLogsService", "Deactivate"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetRawLogsRequest>,
) -> std::result::Result<
tonic::Response<super::GetRawLogsResponse>,
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.cdn.v1.RawLogsService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.cdn.v1.RawLogsService", "Get"));
self.inner.unary(req, path, codec).await
}
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateRawLogsRequest>,
) -> 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.cdn.v1.RawLogsService/Update",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.cdn.v1.RawLogsService", "Update"));
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SecondaryHostnames {
#[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 Resource {
#[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 cname: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "5")]
pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bool, tag = "6")]
pub active: bool,
#[prost(message, optional, tag = "7")]
pub options: ::core::option::Option<ResourceOptions>,
#[prost(string, repeated, tag = "8")]
pub secondary_hostnames: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(int64, tag = "9")]
pub origin_group_id: i64,
#[prost(string, tag = "10")]
pub origin_group_name: ::prost::alloc::string::String,
#[prost(enumeration = "OriginProtocol", tag = "11")]
pub origin_protocol: i32,
#[prost(message, optional, tag = "12")]
pub ssl_certificate: ::core::option::Option<SslCertificate>,
#[prost(map = "string, string", tag = "13")]
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 ResourceOptions {
#[prost(message, optional, tag = "1")]
pub disable_cache: ::core::option::Option<resource_options::BoolOption>,
#[prost(message, optional, tag = "2")]
pub edge_cache_settings: ::core::option::Option<resource_options::EdgeCacheSettings>,
#[prost(message, optional, tag = "3")]
pub browser_cache_settings: ::core::option::Option<resource_options::Int64Option>,
#[prost(message, optional, tag = "4")]
pub cache_http_headers: ::core::option::Option<resource_options::StringsListOption>,
#[prost(message, optional, tag = "5")]
pub query_params_options: ::core::option::Option<
resource_options::QueryParamsOptions,
>,
#[prost(message, optional, tag = "6")]
pub slice: ::core::option::Option<resource_options::BoolOption>,
#[prost(message, optional, tag = "7")]
pub compression_options: ::core::option::Option<
resource_options::CompressionOptions,
>,
#[prost(message, optional, tag = "8")]
pub redirect_options: ::core::option::Option<resource_options::RedirectOptions>,
#[prost(message, optional, tag = "9")]
pub host_options: ::core::option::Option<resource_options::HostOptions>,
#[prost(message, optional, tag = "10")]
pub static_headers: ::core::option::Option<resource_options::StringsMapOption>,
#[prost(message, optional, tag = "11")]
pub cors: ::core::option::Option<resource_options::StringsListOption>,
#[prost(message, optional, tag = "12")]
pub stale: ::core::option::Option<resource_options::StringsListOption>,
#[prost(message, optional, tag = "13")]
pub allowed_http_methods: ::core::option::Option<
resource_options::StringsListOption,
>,
#[prost(message, optional, tag = "14")]
pub proxy_cache_methods_set: ::core::option::Option<resource_options::BoolOption>,
#[prost(message, optional, tag = "15")]
pub disable_proxy_force_ranges: ::core::option::Option<resource_options::BoolOption>,
#[prost(message, optional, tag = "16")]
pub static_request_headers: ::core::option::Option<
resource_options::StringsMapOption,
>,
#[prost(message, optional, tag = "17")]
pub custom_server_name: ::core::option::Option<resource_options::StringOption>,
#[prost(message, optional, tag = "18")]
pub ignore_cookie: ::core::option::Option<resource_options::BoolOption>,
#[prost(message, optional, tag = "19")]
pub rewrite: ::core::option::Option<resource_options::RewriteOption>,
#[prost(message, optional, tag = "20")]
pub secure_key: ::core::option::Option<resource_options::SecureKeyOption>,
#[prost(message, optional, tag = "21")]
pub ip_address_acl: ::core::option::Option<resource_options::IpAddressAclOption>,
}
pub mod resource_options {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BoolOption {
#[prost(bool, tag = "1")]
pub enabled: bool,
#[prost(bool, tag = "2")]
pub value: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StringOption {
#[prost(bool, tag = "1")]
pub enabled: bool,
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Int64Option {
#[prost(bool, tag = "1")]
pub enabled: bool,
#[prost(int64, tag = "2")]
pub value: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StringsListOption {
#[prost(bool, tag = "1")]
pub enabled: bool,
#[prost(string, repeated, tag = "2")]
pub value: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StringsMapOption {
#[prost(bool, tag = "1")]
pub enabled: bool,
#[prost(map = "string, string", tag = "2")]
pub value: ::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 CachingTimes {
#[prost(int64, tag = "1")]
pub simple_value: i64,
#[prost(map = "string, int64", tag = "2")]
pub custom_values: ::std::collections::HashMap<
::prost::alloc::string::String,
i64,
>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EdgeCacheSettings {
#[prost(bool, tag = "1")]
pub enabled: bool,
#[prost(oneof = "edge_cache_settings::ValuesVariant", tags = "2, 3")]
pub values_variant: ::core::option::Option<edge_cache_settings::ValuesVariant>,
}
pub mod edge_cache_settings {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ValuesVariant {
#[prost(message, tag = "2")]
Value(super::CachingTimes),
#[prost(int64, tag = "3")]
DefaultValue(i64),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StringVariableMapOption {
#[prost(bool, tag = "1")]
pub enabled: bool,
#[prost(map = "string, message", tag = "2")]
pub value: ::std::collections::HashMap<
::prost::alloc::string::String,
string_variable_map_option::OneofString,
>,
}
pub mod string_variable_map_option {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OneofString {
#[prost(oneof = "oneof_string::StringOption", tags = "1, 2")]
pub string_option: ::core::option::Option<oneof_string::StringOption>,
}
pub mod oneof_string {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum StringOption {
#[prost(message, tag = "1")]
Value(super::super::StringOption),
#[prost(message, tag = "2")]
Values(super::super::StringsListOption),
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsOptions {
#[prost(oneof = "query_params_options::QueryParamsVariant", tags = "1, 2, 3")]
pub query_params_variant: ::core::option::Option<
query_params_options::QueryParamsVariant,
>,
}
pub mod query_params_options {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum QueryParamsVariant {
#[prost(message, tag = "1")]
IgnoreQueryString(super::BoolOption),
#[prost(message, tag = "2")]
QueryParamsWhitelist(super::StringsListOption),
#[prost(message, tag = "3")]
QueryParamsBlacklist(super::StringsListOption),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RedirectOptions {
#[prost(oneof = "redirect_options::RedirectVariant", tags = "1, 2")]
pub redirect_variant: ::core::option::Option<redirect_options::RedirectVariant>,
}
pub mod redirect_options {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum RedirectVariant {
#[prost(message, tag = "1")]
RedirectHttpToHttps(super::BoolOption),
#[prost(message, tag = "2")]
RedirectHttpsToHttp(super::BoolOption),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HostOptions {
#[prost(oneof = "host_options::HostVariant", tags = "1, 2")]
pub host_variant: ::core::option::Option<host_options::HostVariant>,
}
pub mod host_options {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum HostVariant {
#[prost(message, tag = "1")]
Host(super::StringOption),
#[prost(message, tag = "2")]
ForwardHostHeader(super::BoolOption),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompressionOptions {
#[prost(oneof = "compression_options::CompressionVariant", tags = "1, 2, 3")]
pub compression_variant: ::core::option::Option<
compression_options::CompressionVariant,
>,
}
pub mod compression_options {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum CompressionVariant {
#[prost(message, tag = "1")]
FetchCompressed(super::BoolOption),
#[prost(message, tag = "2")]
GzipOn(super::BoolOption),
#[prost(message, tag = "3")]
BrotliCompression(super::StringsListOption),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RewriteOption {
#[prost(bool, tag = "1")]
pub enabled: bool,
#[prost(string, tag = "2")]
pub body: ::prost::alloc::string::String,
#[prost(enumeration = "super::RewriteFlag", tag = "3")]
pub flag: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SecureKeyOption {
#[prost(bool, tag = "1")]
pub enabled: bool,
#[prost(string, tag = "2")]
pub key: ::prost::alloc::string::String,
#[prost(enumeration = "super::SecureKeyUrlType", tag = "3")]
pub r#type: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IpAddressAclOption {
#[prost(bool, tag = "1")]
pub enabled: bool,
#[prost(enumeration = "super::PolicyType", tag = "2")]
pub policy_type: i32,
#[prost(string, repeated, tag = "3")]
pub excepted_values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SslTargetCertificate {
#[prost(enumeration = "SslCertificateType", tag = "1")]
pub r#type: i32,
#[prost(message, optional, tag = "2")]
pub data: ::core::option::Option<SslCertificateData>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SslCertificate {
#[prost(enumeration = "SslCertificateType", tag = "1")]
pub r#type: i32,
#[prost(enumeration = "SslCertificateStatus", tag = "2")]
pub status: i32,
#[prost(message, optional, tag = "3")]
pub data: ::core::option::Option<SslCertificateData>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SslCertificateData {
#[prost(oneof = "ssl_certificate_data::SslCertificateDataVariant", tags = "1")]
pub ssl_certificate_data_variant: ::core::option::Option<
ssl_certificate_data::SslCertificateDataVariant,
>,
}
pub mod ssl_certificate_data {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum SslCertificateDataVariant {
#[prost(message, tag = "1")]
Cm(super::SslCertificateCmData),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SslCertificateCmData {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OriginProtocol {
Unspecified = 0,
Http = 1,
Https = 2,
Match = 3,
}
impl OriginProtocol {
pub fn as_str_name(&self) -> &'static str {
match self {
OriginProtocol::Unspecified => "ORIGIN_PROTOCOL_UNSPECIFIED",
OriginProtocol::Http => "HTTP",
OriginProtocol::Https => "HTTPS",
OriginProtocol::Match => "MATCH",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ORIGIN_PROTOCOL_UNSPECIFIED" => Some(Self::Unspecified),
"HTTP" => Some(Self::Http),
"HTTPS" => Some(Self::Https),
"MATCH" => Some(Self::Match),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RewriteFlag {
Unspecified = 0,
Last = 1,
Break = 2,
Redirect = 3,
Permanent = 4,
}
impl RewriteFlag {
pub fn as_str_name(&self) -> &'static str {
match self {
RewriteFlag::Unspecified => "REWRITE_FLAG_UNSPECIFIED",
RewriteFlag::Last => "LAST",
RewriteFlag::Break => "BREAK",
RewriteFlag::Redirect => "REDIRECT",
RewriteFlag::Permanent => "PERMANENT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"REWRITE_FLAG_UNSPECIFIED" => Some(Self::Unspecified),
"LAST" => Some(Self::Last),
"BREAK" => Some(Self::Break),
"REDIRECT" => Some(Self::Redirect),
"PERMANENT" => Some(Self::Permanent),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SecureKeyUrlType {
Unspecified = 0,
EnableIpSigning = 1,
DisableIpSigning = 2,
}
impl SecureKeyUrlType {
pub fn as_str_name(&self) -> &'static str {
match self {
SecureKeyUrlType::Unspecified => "SECURE_KEY_URL_TYPE_UNSPECIFIED",
SecureKeyUrlType::EnableIpSigning => "ENABLE_IP_SIGNING",
SecureKeyUrlType::DisableIpSigning => "DISABLE_IP_SIGNING",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SECURE_KEY_URL_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"ENABLE_IP_SIGNING" => Some(Self::EnableIpSigning),
"DISABLE_IP_SIGNING" => Some(Self::DisableIpSigning),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PolicyType {
Unspecified = 0,
Allow = 1,
Deny = 2,
}
impl PolicyType {
pub fn as_str_name(&self) -> &'static str {
match self {
PolicyType::Unspecified => "POLICY_TYPE_UNSPECIFIED",
PolicyType::Allow => "POLICY_TYPE_ALLOW",
PolicyType::Deny => "POLICY_TYPE_DENY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"POLICY_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"POLICY_TYPE_ALLOW" => Some(Self::Allow),
"POLICY_TYPE_DENY" => Some(Self::Deny),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SslCertificateType {
Unspecified = 0,
DontUse = 1,
LetsEncryptGcore = 2,
Cm = 3,
}
impl SslCertificateType {
pub fn as_str_name(&self) -> &'static str {
match self {
SslCertificateType::Unspecified => "SSL_CERTIFICATE_TYPE_UNSPECIFIED",
SslCertificateType::DontUse => "DONT_USE",
SslCertificateType::LetsEncryptGcore => "LETS_ENCRYPT_GCORE",
SslCertificateType::Cm => "CM",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SSL_CERTIFICATE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"DONT_USE" => Some(Self::DontUse),
"LETS_ENCRYPT_GCORE" => Some(Self::LetsEncryptGcore),
"CM" => Some(Self::Cm),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SslCertificateStatus {
Unspecified = 0,
Ready = 1,
Creating = 2,
}
impl SslCertificateStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
SslCertificateStatus::Unspecified => "SSL_CERTIFICATE_STATUS_UNSPECIFIED",
SslCertificateStatus::Ready => "READY",
SslCertificateStatus::Creating => "CREATING",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SSL_CERTIFICATE_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"READY" => Some(Self::Ready),
"CREATING" => Some(Self::Creating),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetResourceRequest {
#[prost(string, tag = "1")]
pub resource_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 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 ListResourcesResponse {
#[prost(message, repeated, tag = "1")]
pub resources: ::prost::alloc::vec::Vec<Resource>,
#[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 CreateResourceRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub cname: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub origin: ::core::option::Option<create_resource_request::Origin>,
#[prost(message, optional, tag = "4")]
pub secondary_hostnames: ::core::option::Option<SecondaryHostnames>,
#[prost(enumeration = "OriginProtocol", tag = "5")]
pub origin_protocol: i32,
#[prost(message, optional, tag = "6")]
pub active: ::core::option::Option<bool>,
#[prost(message, optional, tag = "7")]
pub options: ::core::option::Option<ResourceOptions>,
#[prost(message, optional, tag = "8")]
pub ssl_certificate: ::core::option::Option<SslTargetCertificate>,
#[prost(map = "string, string", tag = "9")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
pub mod create_resource_request {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Origin {
#[prost(oneof = "origin::OriginVariant", tags = "1, 2, 3")]
pub origin_variant: ::core::option::Option<origin::OriginVariant>,
}
pub mod origin {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum OriginVariant {
#[prost(int64, tag = "1")]
OriginGroupId(i64),
#[prost(string, tag = "2")]
OriginSource(::prost::alloc::string::String),
#[prost(message, tag = "3")]
OriginSourceParams(super::super::ResourceOriginParams),
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourceOriginParams {
#[prost(string, tag = "1")]
pub source: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub meta: ::core::option::Option<OriginMeta>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateResourceMetadata {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateResourceRequest {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub origin_group_id: ::core::option::Option<i64>,
#[prost(message, optional, tag = "3")]
pub secondary_hostnames: ::core::option::Option<SecondaryHostnames>,
#[prost(message, optional, tag = "4")]
pub options: ::core::option::Option<ResourceOptions>,
#[prost(enumeration = "OriginProtocol", tag = "5")]
pub origin_protocol: i32,
#[prost(message, optional, tag = "6")]
pub active: ::core::option::Option<bool>,
#[prost(message, optional, tag = "7")]
pub ssl_certificate: ::core::option::Option<SslTargetCertificate>,
#[prost(map = "string, string", tag = "8")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(bool, tag = "9")]
pub remove_labels: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateResourceMetadata {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteResourceRequest {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteResourceMetadata {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetProviderCNameRequest {
#[prost(string, tag = "1")]
pub folder_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetProviderCNameResponse {
#[prost(string, tag = "1")]
pub cname: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub folder_id: ::prost::alloc::string::String,
}
pub mod resource_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 ResourceServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ResourceServiceClient<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> ResourceServiceClient<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,
) -> ResourceServiceClient<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,
{
ResourceServiceClient::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::GetResourceRequest>,
) -> std::result::Result<tonic::Response<super::Resource>, 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.cdn.v1.ResourceService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.cdn.v1.ResourceService", "Get"));
self.inner.unary(req, path, codec).await
}
pub async fn list(
&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.cdn.v1.ResourceService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("yandex.cloud.cdn.v1.ResourceService", "List"));
self.inner.unary(req, path, codec).await
}
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateResourceRequest>,
) -> 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.cdn.v1.ResourceService/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.cdn.v1.ResourceService", "Create"),
);
self.inner.unary(req, path, codec).await
}
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateResourceRequest>,
) -> 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.cdn.v1.ResourceService/Update",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.cdn.v1.ResourceService", "Update"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteResourceRequest>,
) -> 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.cdn.v1.ResourceService/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.cdn.v1.ResourceService", "Delete"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_provider_c_name(
&mut self,
request: impl tonic::IntoRequest<super::GetProviderCNameRequest>,
) -> std::result::Result<
tonic::Response<super::GetProviderCNameResponse>,
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.cdn.v1.ResourceService/GetProviderCName",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.cdn.v1.ResourceService",
"GetProviderCName",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Rule {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub rule_pattern: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub options: ::core::option::Option<ResourceOptions>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListResourceRulesRequest {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListResourceRulesResponse {
#[prost(message, repeated, tag = "1")]
pub rules: ::prost::alloc::vec::Vec<Rule>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateResourceRuleRequest {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub rule_pattern: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub options: ::core::option::Option<ResourceOptions>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateResourceRuleMetadata {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub rule_id: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetResourceRuleRequest {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub rule_id: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateResourceRuleRequest {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub rule_id: i64,
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub rule_pattern: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub options: ::core::option::Option<ResourceOptions>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateResourceRuleMetadata {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub rule_id: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteResourceRuleRequest {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub rule_id: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteResourceRuleMetadata {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub rule_id: i64,
}
pub mod resource_rules_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 ResourceRulesServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ResourceRulesServiceClient<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> ResourceRulesServiceClient<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,
) -> ResourceRulesServiceClient<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,
{
ResourceRulesServiceClient::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::ListResourceRulesRequest>,
) -> std::result::Result<
tonic::Response<super::ListResourceRulesResponse>,
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.cdn.v1.ResourceRulesService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.cdn.v1.ResourceRulesService", "List"),
);
self.inner.unary(req, path, codec).await
}
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateResourceRuleRequest>,
) -> 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.cdn.v1.ResourceRulesService/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.cdn.v1.ResourceRulesService", "Create"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get(
&mut self,
request: impl tonic::IntoRequest<super::GetResourceRuleRequest>,
) -> std::result::Result<tonic::Response<super::Rule>, 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.cdn.v1.ResourceRulesService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.cdn.v1.ResourceRulesService", "Get"),
);
self.inner.unary(req, path, codec).await
}
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateResourceRuleRequest>,
) -> 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.cdn.v1.ResourceRulesService/Update",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.cdn.v1.ResourceRulesService", "Update"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteResourceRuleRequest>,
) -> 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.cdn.v1.ResourceRulesService/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("yandex.cloud.cdn.v1.ResourceRulesService", "Delete"),
);
self.inner.unary(req, path, codec).await
}
}
}