#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Lock {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub instance_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub resource_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "5")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "6")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "7")]
pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "lock::State", tag = "8")]
pub state: i32,
#[prost(string, tag = "9")]
pub template_id: ::prost::alloc::string::String,
}
pub mod lock {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Unlocked = 1,
Locked = 2,
Deleted = 3,
}
impl State {
pub fn as_str_name(&self) -> &'static str {
match self {
State::Unspecified => "STATE_UNSPECIFIED",
State::Unlocked => "UNLOCKED",
State::Locked => "LOCKED",
State::Deleted => "DELETED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATE_UNSPECIFIED" => Some(Self::Unspecified),
"UNLOCKED" => Some(Self::Unlocked),
"LOCKED" => Some(Self::Locked),
"DELETED" => Some(Self::Deleted),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Template {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub version_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub publisher_id: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub product_id: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub tariff_id: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub license_sku_id: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub period: ::prost::alloc::string::String,
#[prost(message, optional, tag = "9")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "10")]
pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "template::State", tag = "11")]
pub state: i32,
}
pub mod template {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Pending = 1,
Active = 2,
Deprecated = 3,
Deleted = 4,
}
impl State {
pub fn as_str_name(&self) -> &'static str {
match self {
State::Unspecified => "STATE_UNSPECIFIED",
State::Pending => "PENDING",
State::Active => "ACTIVE",
State::Deprecated => "DEPRECATED",
State::Deleted => "DELETED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATE_UNSPECIFIED" => Some(Self::Unspecified),
"PENDING" => Some(Self::Pending),
"ACTIVE" => Some(Self::Active),
"DEPRECATED" => Some(Self::Deprecated),
"DELETED" => Some(Self::Deleted),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Instance {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub cloud_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub folder_id: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub template_id: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub template_version_id: ::prost::alloc::string::String,
#[prost(string, tag = "14")]
pub description: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub start_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "8")]
pub end_time: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "9")]
pub created_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag = "10")]
pub updated_at: ::core::option::Option<::prost_types::Timestamp>,
#[prost(enumeration = "instance::State", tag = "11")]
pub state: i32,
#[prost(message, repeated, tag = "12")]
pub locks: ::prost::alloc::vec::Vec<Lock>,
#[prost(message, optional, tag = "13")]
pub license_template: ::core::option::Option<Template>,
}
pub mod instance {
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[repr(i32)]
pub enum State {
Unspecified = 0,
Pending = 1,
Active = 2,
Cancelled = 3,
Expired = 4,
Deprecated = 5,
Deleted = 6,
}
impl State {
pub fn as_str_name(&self) -> &'static str {
match self {
State::Unspecified => "STATE_UNSPECIFIED",
State::Pending => "PENDING",
State::Active => "ACTIVE",
State::Cancelled => "CANCELLED",
State::Expired => "EXPIRED",
State::Deprecated => "DEPRECATED",
State::Deleted => "DELETED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STATE_UNSPECIFIED" => Some(Self::Unspecified),
"PENDING" => Some(Self::Pending),
"ACTIVE" => Some(Self::Active),
"CANCELLED" => Some(Self::Cancelled),
"EXPIRED" => Some(Self::Expired),
"DEPRECATED" => Some(Self::Deprecated),
"DELETED" => Some(Self::Deleted),
_ => None,
}
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UserInfo {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub inn: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub kpp: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetInstanceRequest {
#[prost(string, tag = "1")]
pub instance_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListInstancesRequest {
#[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,
#[prost(string, tag = "5")]
pub order_by: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListInstancesResponse {
#[prost(message, repeated, tag = "1")]
pub instances: ::prost::alloc::vec::Vec<Instance>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
pub mod instance_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 InstanceServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl InstanceServiceClient<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> InstanceServiceClient<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,
) -> InstanceServiceClient<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,
{
InstanceServiceClient::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::GetInstanceRequest>,
) -> std::result::Result<tonic::Response<super::Instance>, 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.marketplace.licensemanager.v1.InstanceService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.marketplace.licensemanager.v1.InstanceService",
"Get",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListInstancesRequest>,
) -> std::result::Result<
tonic::Response<super::ListInstancesResponse>,
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.marketplace.licensemanager.v1.InstanceService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.marketplace.licensemanager.v1.InstanceService",
"List",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLockRequest {
#[prost(string, tag = "1")]
pub lock_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateLockRequest {
#[prost(string, tag = "1")]
pub instance_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub resource_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EnsureLockRequest {
#[prost(string, tag = "1")]
pub instance_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub resource_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateLockMetadata {
#[prost(string, tag = "1")]
pub lock_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EnsureLockMetadata {
#[prost(string, tag = "1")]
pub lock_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteLockRequest {
#[prost(string, tag = "1")]
pub lock_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteLockMetadata {
#[prost(string, tag = "1")]
pub lock_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLockByInstanceAndResourceRequest {
#[prost(string, tag = "1")]
pub instance_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub resource_id: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListLocksRequest {
#[prost(string, tag = "1")]
pub resource_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
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,
#[prost(string, tag = "6")]
pub order_by: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListLocksResponse {
#[prost(message, repeated, tag = "1")]
pub locks: ::prost::alloc::vec::Vec<Lock>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
pub mod lock_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 LockServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl LockServiceClient<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> LockServiceClient<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,
) -> LockServiceClient<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,
{
LockServiceClient::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::GetLockRequest>,
) -> std::result::Result<tonic::Response<super::Lock>, 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.marketplace.licensemanager.v1.LockService/Get",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.marketplace.licensemanager.v1.LockService",
"Get",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_by_instance_and_resource(
&mut self,
request: impl tonic::IntoRequest<super::GetLockByInstanceAndResourceRequest>,
) -> std::result::Result<tonic::Response<super::Lock>, 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.marketplace.licensemanager.v1.LockService/GetByInstanceAndResource",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.marketplace.licensemanager.v1.LockService",
"GetByInstanceAndResource",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<super::ListLocksRequest>,
) -> std::result::Result<
tonic::Response<super::ListLocksResponse>,
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.marketplace.licensemanager.v1.LockService/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.marketplace.licensemanager.v1.LockService",
"List",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateLockRequest>,
) -> std::result::Result<
tonic::Response<super::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.marketplace.licensemanager.v1.LockService/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.marketplace.licensemanager.v1.LockService",
"Create",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn ensure(
&mut self,
request: impl tonic::IntoRequest<super::EnsureLockRequest>,
) -> std::result::Result<
tonic::Response<super::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.marketplace.licensemanager.v1.LockService/Ensure",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.marketplace.licensemanager.v1.LockService",
"Ensure",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteLockRequest>,
) -> std::result::Result<
tonic::Response<super::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.marketplace.licensemanager.v1.LockService/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"yandex.cloud.marketplace.licensemanager.v1.LockService",
"Delete",
),
);
self.inner.unary(req, path, codec).await
}
}
}