#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApiProxy {
#[prost(string, tag = "1")]
pub rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub base_url: ::prost::alloc::string::String,
#[prost(enumeration = "ApiProxyProtocol", tag = "5")]
pub protocol: i32,
#[prost(enumeration = "ApiProxyInteraction", tag = "6")]
pub interaction: i32,
#[prost(enumeration = "ApiProxyBodyFormat", tag = "7")]
pub body_format: i32,
#[prost(enumeration = "ApiProxyAuthKind", tag = "8")]
pub auth_kind: i32,
#[prost(string, tag = "9")]
pub created_by_user_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "10")]
pub created_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "11")]
pub updated_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateApiProxyRequest {
#[prost(string, tag = "1")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub base_url: ::prost::alloc::string::String,
#[prost(enumeration = "ApiProxyProtocol", tag = "4")]
pub protocol: i32,
#[prost(enumeration = "ApiProxyInteraction", tag = "5")]
pub interaction: i32,
#[prost(enumeration = "ApiProxyBodyFormat", tag = "6")]
pub body_format: i32,
#[prost(enumeration = "ApiProxyAuthKind", tag = "7")]
pub auth_kind: i32,
#[prost(string, optional, tag = "8")]
pub auth_secret_rid: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateApiProxyResponse {
#[prost(message, optional, tag = "1")]
pub api_proxy: ::core::option::Option<ApiProxy>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetApiProxyRequest {
#[prost(string, tag = "1")]
pub api_proxy_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetApiProxyResponse {
#[prost(message, optional, tag = "1")]
pub api_proxy: ::core::option::Option<ApiProxy>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteApiProxyRequest {
#[prost(string, tag = "1")]
pub api_proxy_rid: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteApiProxyResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListApiProxiesRequest {
#[prost(string, tag = "1")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(int32, optional, tag = "2")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, optional, tag = "3")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListApiProxiesResponse {
#[prost(message, repeated, tag = "1")]
pub api_proxies: ::prost::alloc::vec::Vec<ApiProxy>,
#[prost(string, optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ApiProxyProtocol {
Unspecified = 0,
Http = 1,
}
impl ApiProxyProtocol {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "API_PROXY_PROTOCOL_UNSPECIFIED",
Self::Http => "API_PROXY_PROTOCOL_HTTP",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"API_PROXY_PROTOCOL_UNSPECIFIED" => Some(Self::Unspecified),
"API_PROXY_PROTOCOL_HTTP" => Some(Self::Http),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ApiProxyInteraction {
Unspecified = 0,
Unary = 1,
}
impl ApiProxyInteraction {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "API_PROXY_INTERACTION_UNSPECIFIED",
Self::Unary => "API_PROXY_INTERACTION_UNARY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"API_PROXY_INTERACTION_UNSPECIFIED" => Some(Self::Unspecified),
"API_PROXY_INTERACTION_UNARY" => Some(Self::Unary),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ApiProxyBodyFormat {
Unspecified = 0,
Json = 1,
}
impl ApiProxyBodyFormat {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "API_PROXY_BODY_FORMAT_UNSPECIFIED",
Self::Json => "API_PROXY_BODY_FORMAT_JSON",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"API_PROXY_BODY_FORMAT_UNSPECIFIED" => Some(Self::Unspecified),
"API_PROXY_BODY_FORMAT_JSON" => Some(Self::Json),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ApiProxyAuthKind {
Unspecified = 0,
None = 1,
BearerToken = 2,
}
impl ApiProxyAuthKind {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "API_PROXY_AUTH_KIND_UNSPECIFIED",
Self::None => "API_PROXY_AUTH_KIND_NONE",
Self::BearerToken => "API_PROXY_AUTH_KIND_BEARER_TOKEN",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"API_PROXY_AUTH_KIND_UNSPECIFIED" => Some(Self::Unspecified),
"API_PROXY_AUTH_KIND_NONE" => Some(Self::None),
"API_PROXY_AUTH_KIND_BEARER_TOKEN" => Some(Self::BearerToken),
_ => None,
}
}
}
pub mod api_proxy_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ApiProxyServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ApiProxyServiceClient<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> ApiProxyServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> ApiProxyServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
ApiProxyServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn create_api_proxy(
&mut self,
request: impl tonic::IntoRequest<super::CreateApiProxyRequest>,
) -> std::result::Result<
tonic::Response<super::CreateApiProxyResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.ApiProxyService/CreateApiProxy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.nova.v1.ApiProxyService", "CreateApiProxy"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_api_proxy(
&mut self,
request: impl tonic::IntoRequest<super::GetApiProxyRequest>,
) -> std::result::Result<
tonic::Response<super::GetApiProxyResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.ApiProxyService/GetApiProxy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.nova.v1.ApiProxyService", "GetApiProxy"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_api_proxies(
&mut self,
request: impl tonic::IntoRequest<super::ListApiProxiesRequest>,
) -> std::result::Result<
tonic::Response<super::ListApiProxiesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.ApiProxyService/ListApiProxies",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.nova.v1.ApiProxyService", "ListApiProxies"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_api_proxy(
&mut self,
request: impl tonic::IntoRequest<super::DeleteApiProxyRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteApiProxyResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.ApiProxyService/DeleteApiProxy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.nova.v1.ApiProxyService", "DeleteApiProxy"),
);
self.inner.unary(req, path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct App {
#[prost(string, tag = "1")]
pub rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub title: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub description: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "6")]
pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "7")]
pub properties: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(string, tag = "8")]
pub created_by_user_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "9")]
pub created_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "10")]
pub updated_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(bool, optional, tag = "11")]
pub is_archived: ::core::option::Option<bool>,
#[prost(string, optional, tag = "12")]
pub embed_path: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "13")]
pub archive_sha256: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BundleSignature {
#[prost(string, tag = "1")]
pub key_id: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub signature: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SignedAppBundle {
#[prost(string, tag = "1")]
pub upload_object_key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub signature: ::core::option::Option<BundleSignature>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateAppRequest {
#[prost(message, optional, tag = "1")]
pub app: ::core::option::Option<App>,
#[prost(message, optional, tag = "2")]
pub signed_bundle: ::core::option::Option<SignedAppBundle>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateAppResponse {
#[prost(message, optional, tag = "1")]
pub app: ::core::option::Option<App>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAppRequest {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAppResponse {
#[prost(message, optional, tag = "1")]
pub app: ::core::option::Option<App>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateAppRequest {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub app: ::core::option::Option<App>,
#[prost(message, optional, tag = "3")]
pub signed_bundle: ::core::option::Option<SignedAppBundle>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateAppResponse {
#[prost(message, optional, tag = "1")]
pub app: ::core::option::Option<App>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteAppRequest {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteAppResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppSearchFilter {
#[prost(string, optional, tag = "1")]
pub name_contains: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bool, optional, tag = "2")]
pub include_archived: ::core::option::Option<bool>,
#[prost(string, repeated, tag = "3")]
pub created_by_user_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "4")]
pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchAppsRequest {
#[prost(string, tag = "1")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub filter: ::core::option::Option<AppSearchFilter>,
#[prost(enumeration = "SearchAppsSortField", tag = "3")]
pub sort_field: i32,
#[prost(bool, tag = "4")]
pub descending: bool,
#[prost(int32, optional, tag = "5")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, optional, tag = "6")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchAppsResponse {
#[prost(message, repeated, tag = "1")]
pub apps: ::prost::alloc::vec::Vec<App>,
#[prost(string, optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchAppLabelsRequest {
#[prost(string, tag = "1")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(int32, optional, tag = "2")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, optional, tag = "3")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchAppLabelsResponse {
#[prost(string, repeated, tag = "1")]
pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum NovaError {
AppNotFound = 0,
AppNameTaken = 1,
AppNameImmutable = 2,
ServerAssignedFieldSet = 3,
InvalidPageToken = 4,
InvalidBundle = 5,
BundleVerificationFailed = 6,
AppUpdateConflict = 7,
ApiProxyNotFound = 8,
ApiProxyNameTaken = 9,
ApiProxyInUse = 10,
AppProxyExists = 11,
AppArchived = 12,
}
impl NovaError {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::AppNotFound => "NOVA_ERROR_APP_NOT_FOUND",
Self::AppNameTaken => "NOVA_ERROR_APP_NAME_TAKEN",
Self::AppNameImmutable => "NOVA_ERROR_APP_NAME_IMMUTABLE",
Self::ServerAssignedFieldSet => "NOVA_ERROR_SERVER_ASSIGNED_FIELD_SET",
Self::InvalidPageToken => "NOVA_ERROR_INVALID_PAGE_TOKEN",
Self::InvalidBundle => "NOVA_ERROR_INVALID_BUNDLE",
Self::BundleVerificationFailed => "NOVA_ERROR_BUNDLE_VERIFICATION_FAILED",
Self::AppUpdateConflict => "NOVA_ERROR_APP_UPDATE_CONFLICT",
Self::ApiProxyNotFound => "NOVA_ERROR_API_PROXY_NOT_FOUND",
Self::ApiProxyNameTaken => "NOVA_ERROR_API_PROXY_NAME_TAKEN",
Self::ApiProxyInUse => "NOVA_ERROR_API_PROXY_IN_USE",
Self::AppProxyExists => "NOVA_ERROR_APP_PROXY_EXISTS",
Self::AppArchived => "NOVA_ERROR_APP_ARCHIVED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NOVA_ERROR_APP_NOT_FOUND" => Some(Self::AppNotFound),
"NOVA_ERROR_APP_NAME_TAKEN" => Some(Self::AppNameTaken),
"NOVA_ERROR_APP_NAME_IMMUTABLE" => Some(Self::AppNameImmutable),
"NOVA_ERROR_SERVER_ASSIGNED_FIELD_SET" => Some(Self::ServerAssignedFieldSet),
"NOVA_ERROR_INVALID_PAGE_TOKEN" => Some(Self::InvalidPageToken),
"NOVA_ERROR_INVALID_BUNDLE" => Some(Self::InvalidBundle),
"NOVA_ERROR_BUNDLE_VERIFICATION_FAILED" => {
Some(Self::BundleVerificationFailed)
}
"NOVA_ERROR_APP_UPDATE_CONFLICT" => Some(Self::AppUpdateConflict),
"NOVA_ERROR_API_PROXY_NOT_FOUND" => Some(Self::ApiProxyNotFound),
"NOVA_ERROR_API_PROXY_NAME_TAKEN" => Some(Self::ApiProxyNameTaken),
"NOVA_ERROR_API_PROXY_IN_USE" => Some(Self::ApiProxyInUse),
"NOVA_ERROR_APP_PROXY_EXISTS" => Some(Self::AppProxyExists),
"NOVA_ERROR_APP_ARCHIVED" => Some(Self::AppArchived),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SearchAppsSortField {
Unspecified = 0,
Title = 1,
CreatedAt = 2,
UpdatedAt = 3,
}
impl SearchAppsSortField {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SEARCH_APPS_SORT_FIELD_UNSPECIFIED",
Self::Title => "SEARCH_APPS_SORT_FIELD_TITLE",
Self::CreatedAt => "SEARCH_APPS_SORT_FIELD_CREATED_AT",
Self::UpdatedAt => "SEARCH_APPS_SORT_FIELD_UPDATED_AT",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SEARCH_APPS_SORT_FIELD_UNSPECIFIED" => Some(Self::Unspecified),
"SEARCH_APPS_SORT_FIELD_TITLE" => Some(Self::Title),
"SEARCH_APPS_SORT_FIELD_CREATED_AT" => Some(Self::CreatedAt),
"SEARCH_APPS_SORT_FIELD_UPDATED_AT" => Some(Self::UpdatedAt),
_ => None,
}
}
}
pub mod nova_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct NovaServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl NovaServiceClient<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> NovaServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> NovaServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
NovaServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn create_app(
&mut self,
request: impl tonic::IntoRequest<super::CreateAppRequest>,
) -> std::result::Result<
tonic::Response<super::CreateAppResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.NovaService/CreateApp",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("nominal.nova.v1.NovaService", "CreateApp"));
self.inner.unary(req, path, codec).await
}
pub async fn get_app(
&mut self,
request: impl tonic::IntoRequest<super::GetAppRequest>,
) -> std::result::Result<tonic::Response<super::GetAppResponse>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.NovaService/GetApp",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("nominal.nova.v1.NovaService", "GetApp"));
self.inner.unary(req, path, codec).await
}
pub async fn update_app(
&mut self,
request: impl tonic::IntoRequest<super::UpdateAppRequest>,
) -> std::result::Result<
tonic::Response<super::UpdateAppResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.NovaService/UpdateApp",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("nominal.nova.v1.NovaService", "UpdateApp"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_app(
&mut self,
request: impl tonic::IntoRequest<super::DeleteAppRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteAppResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.NovaService/DeleteApp",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("nominal.nova.v1.NovaService", "DeleteApp"));
self.inner.unary(req, path, codec).await
}
pub async fn search_apps(
&mut self,
request: impl tonic::IntoRequest<super::SearchAppsRequest>,
) -> std::result::Result<
tonic::Response<super::SearchAppsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.NovaService/SearchApps",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("nominal.nova.v1.NovaService", "SearchApps"));
self.inner.unary(req, path, codec).await
}
pub async fn search_app_labels(
&mut self,
request: impl tonic::IntoRequest<super::SearchAppLabelsRequest>,
) -> std::result::Result<
tonic::Response<super::SearchAppLabelsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.NovaService/SearchAppLabels",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.nova.v1.NovaService", "SearchAppLabels"),
);
self.inner.unary(req, path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppProxy {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub api_proxy_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub created_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateAppProxyRequest {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub api_proxy_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateAppProxyResponse {
#[prost(message, optional, tag = "1")]
pub app_proxy: ::core::option::Option<AppProxy>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteAppProxyRequest {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub api_proxy_rid: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteAppProxyResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAppProxiesRequest {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
#[prost(int32, optional, tag = "2")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, optional, tag = "3")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAppProxiesResponse {
#[prost(message, repeated, tag = "1")]
pub app_proxies: ::prost::alloc::vec::Vec<AppProxy>,
#[prost(string, optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
pub mod app_proxy_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct AppProxyServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl AppProxyServiceClient<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> AppProxyServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> AppProxyServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
AppProxyServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn create_app_proxy(
&mut self,
request: impl tonic::IntoRequest<super::CreateAppProxyRequest>,
) -> std::result::Result<
tonic::Response<super::CreateAppProxyResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.AppProxyService/CreateAppProxy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.nova.v1.AppProxyService", "CreateAppProxy"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_app_proxy(
&mut self,
request: impl tonic::IntoRequest<super::DeleteAppProxyRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteAppProxyResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.AppProxyService/DeleteAppProxy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.nova.v1.AppProxyService", "DeleteAppProxy"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_app_proxies(
&mut self,
request: impl tonic::IntoRequest<super::ListAppProxiesRequest>,
) -> std::result::Result<
tonic::Response<super::ListAppProxiesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.AppProxyService/ListAppProxies",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.nova.v1.AppProxyService", "ListAppProxies"),
);
self.inner.unary(req, path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KeyValueEntry {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub value: ::core::option::Option<super::super::super::google::protobuf::Value>,
#[prost(message, optional, tag = "4")]
pub created_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "5")]
pub updated_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(int64, tag = "6")]
pub version: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateKeyValueEntryRequest {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub value: ::core::option::Option<super::super::super::google::protobuf::Value>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateKeyValueEntryResponse {
#[prost(message, optional, tag = "1")]
pub key_value_entry: ::core::option::Option<KeyValueEntry>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateKeyValueEntryRequest {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub value: ::core::option::Option<super::super::super::google::protobuf::Value>,
#[prost(int64, optional, tag = "4")]
pub expected_version: ::core::option::Option<i64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateKeyValueEntryResponse {
#[prost(message, optional, tag = "1")]
pub key_value_entry: ::core::option::Option<KeyValueEntry>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetKeyValueEntryRequest {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub key: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetKeyValueEntryResponse {
#[prost(message, optional, tag = "1")]
pub key_value_entry: ::core::option::Option<KeyValueEntry>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteKeyValueEntryRequest {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub key: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteKeyValueEntryResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetKeyValueEntriesRequest {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetKeyValueEntriesResponse {
#[prost(message, repeated, tag = "1")]
pub key_value_entries: ::prost::alloc::vec::Vec<KeyValueEntry>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCreateKeyValueEntriesRequest {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub writes: ::prost::alloc::vec::Vec<KeyValueEntryWrite>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCreateKeyValueEntriesResponse {
#[prost(message, repeated, tag = "1")]
pub key_value_entries: ::prost::alloc::vec::Vec<KeyValueEntry>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KeyValueEntryWrite {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub value: ::core::option::Option<super::super::super::google::protobuf::Value>,
#[prost(int64, optional, tag = "3")]
pub expected_version: ::core::option::Option<i64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpdateKeyValueEntriesRequest {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub writes: ::prost::alloc::vec::Vec<KeyValueEntryWrite>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpdateKeyValueEntriesResponse {
#[prost(message, repeated, tag = "1")]
pub key_value_entries: ::prost::alloc::vec::Vec<KeyValueEntry>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchDeleteKeyValueEntriesRequest {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct BatchDeleteKeyValueEntriesResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchKeyValueEntriesRequest {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub key_prefix: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int32, optional, tag = "3")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, optional, tag = "4")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchKeyValueEntriesResponse {
#[prost(message, repeated, tag = "1")]
pub key_value_entries: ::prost::alloc::vec::Vec<KeyValueEntry>,
#[prost(string, optional, tag = "2")]
pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum NovaKeyValueError {
VersionConflict = 0,
QuotaExceeded = 1,
RateLimited = 2,
AppArchived = 3,
ValueTooLarge = 4,
EntryAlreadyExists = 6,
EntryNotFound = 5,
}
impl NovaKeyValueError {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::VersionConflict => "NOVA_KEY_VALUE_ERROR_VERSION_CONFLICT",
Self::QuotaExceeded => "NOVA_KEY_VALUE_ERROR_QUOTA_EXCEEDED",
Self::RateLimited => "NOVA_KEY_VALUE_ERROR_RATE_LIMITED",
Self::AppArchived => "NOVA_KEY_VALUE_ERROR_APP_ARCHIVED",
Self::ValueTooLarge => "NOVA_KEY_VALUE_ERROR_VALUE_TOO_LARGE",
Self::EntryAlreadyExists => "NOVA_KEY_VALUE_ERROR_ENTRY_ALREADY_EXISTS",
Self::EntryNotFound => "NOVA_KEY_VALUE_ERROR_ENTRY_NOT_FOUND",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NOVA_KEY_VALUE_ERROR_VERSION_CONFLICT" => Some(Self::VersionConflict),
"NOVA_KEY_VALUE_ERROR_QUOTA_EXCEEDED" => Some(Self::QuotaExceeded),
"NOVA_KEY_VALUE_ERROR_RATE_LIMITED" => Some(Self::RateLimited),
"NOVA_KEY_VALUE_ERROR_APP_ARCHIVED" => Some(Self::AppArchived),
"NOVA_KEY_VALUE_ERROR_VALUE_TOO_LARGE" => Some(Self::ValueTooLarge),
"NOVA_KEY_VALUE_ERROR_ENTRY_ALREADY_EXISTS" => Some(Self::EntryAlreadyExists),
"NOVA_KEY_VALUE_ERROR_ENTRY_NOT_FOUND" => Some(Self::EntryNotFound),
_ => None,
}
}
}
pub mod nova_key_value_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct NovaKeyValueServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl NovaKeyValueServiceClient<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> NovaKeyValueServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> NovaKeyValueServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
NovaKeyValueServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn create_key_value_entry(
&mut self,
request: impl tonic::IntoRequest<super::CreateKeyValueEntryRequest>,
) -> std::result::Result<
tonic::Response<super::CreateKeyValueEntryResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.NovaKeyValueService/CreateKeyValueEntry",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.nova.v1.NovaKeyValueService",
"CreateKeyValueEntry",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_key_value_entry(
&mut self,
request: impl tonic::IntoRequest<super::UpdateKeyValueEntryRequest>,
) -> std::result::Result<
tonic::Response<super::UpdateKeyValueEntryResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.NovaKeyValueService/UpdateKeyValueEntry",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.nova.v1.NovaKeyValueService",
"UpdateKeyValueEntry",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_key_value_entry(
&mut self,
request: impl tonic::IntoRequest<super::GetKeyValueEntryRequest>,
) -> std::result::Result<
tonic::Response<super::GetKeyValueEntryResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.NovaKeyValueService/GetKeyValueEntry",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.nova.v1.NovaKeyValueService",
"GetKeyValueEntry",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_key_value_entry(
&mut self,
request: impl tonic::IntoRequest<super::DeleteKeyValueEntryRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteKeyValueEntryResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.NovaKeyValueService/DeleteKeyValueEntry",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.nova.v1.NovaKeyValueService",
"DeleteKeyValueEntry",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_get_key_value_entries(
&mut self,
request: impl tonic::IntoRequest<super::BatchGetKeyValueEntriesRequest>,
) -> std::result::Result<
tonic::Response<super::BatchGetKeyValueEntriesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.NovaKeyValueService/BatchGetKeyValueEntries",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.nova.v1.NovaKeyValueService",
"BatchGetKeyValueEntries",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_create_key_value_entries(
&mut self,
request: impl tonic::IntoRequest<super::BatchCreateKeyValueEntriesRequest>,
) -> std::result::Result<
tonic::Response<super::BatchCreateKeyValueEntriesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.NovaKeyValueService/BatchCreateKeyValueEntries",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.nova.v1.NovaKeyValueService",
"BatchCreateKeyValueEntries",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_update_key_value_entries(
&mut self,
request: impl tonic::IntoRequest<super::BatchUpdateKeyValueEntriesRequest>,
) -> std::result::Result<
tonic::Response<super::BatchUpdateKeyValueEntriesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.NovaKeyValueService/BatchUpdateKeyValueEntries",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.nova.v1.NovaKeyValueService",
"BatchUpdateKeyValueEntries",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_delete_key_value_entries(
&mut self,
request: impl tonic::IntoRequest<super::BatchDeleteKeyValueEntriesRequest>,
) -> std::result::Result<
tonic::Response<super::BatchDeleteKeyValueEntriesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.NovaKeyValueService/BatchDeleteKeyValueEntries",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.nova.v1.NovaKeyValueService",
"BatchDeleteKeyValueEntries",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn search_key_value_entries(
&mut self,
request: impl tonic::IntoRequest<super::SearchKeyValueEntriesRequest>,
) -> std::result::Result<
tonic::Response<super::SearchKeyValueEntriesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.NovaKeyValueService/SearchKeyValueEntries",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.nova.v1.NovaKeyValueService",
"SearchKeyValueEntries",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProxyHeader {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CallApiProxyRequest {
#[prost(string, tag = "1")]
pub app_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub api_proxy_rid: ::prost::alloc::string::String,
#[prost(enumeration = "ProxyHttpMethod", tag = "3")]
pub method: i32,
#[prost(string, tag = "4")]
pub path: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub query: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "6")]
pub headers: ::prost::alloc::vec::Vec<ProxyHeader>,
#[prost(bytes = "vec", tag = "7")]
pub body: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CallApiProxyResponse {
#[prost(int32, tag = "1")]
pub status_code: i32,
#[prost(message, repeated, tag = "2")]
pub headers: ::prost::alloc::vec::Vec<ProxyHeader>,
#[prost(bytes = "vec", tag = "3")]
pub body: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProxyHttpMethod {
Unspecified = 0,
Get = 1,
Head = 2,
Post = 3,
Put = 4,
Patch = 5,
Delete = 6,
}
impl ProxyHttpMethod {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "PROXY_HTTP_METHOD_UNSPECIFIED",
Self::Get => "PROXY_HTTP_METHOD_GET",
Self::Head => "PROXY_HTTP_METHOD_HEAD",
Self::Post => "PROXY_HTTP_METHOD_POST",
Self::Put => "PROXY_HTTP_METHOD_PUT",
Self::Patch => "PROXY_HTTP_METHOD_PATCH",
Self::Delete => "PROXY_HTTP_METHOD_DELETE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PROXY_HTTP_METHOD_UNSPECIFIED" => Some(Self::Unspecified),
"PROXY_HTTP_METHOD_GET" => Some(Self::Get),
"PROXY_HTTP_METHOD_HEAD" => Some(Self::Head),
"PROXY_HTTP_METHOD_POST" => Some(Self::Post),
"PROXY_HTTP_METHOD_PUT" => Some(Self::Put),
"PROXY_HTTP_METHOD_PATCH" => Some(Self::Patch),
"PROXY_HTTP_METHOD_DELETE" => Some(Self::Delete),
_ => None,
}
}
}
pub mod nova_proxy_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct NovaProxyServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl NovaProxyServiceClient<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> NovaProxyServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> NovaProxyServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
NovaProxyServiceClient::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 call_api_proxy(
&mut self,
request: impl tonic::IntoRequest<super::CallApiProxyRequest>,
) -> std::result::Result<
tonic::Response<super::CallApiProxyResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.nova.v1.NovaProxyService/CallApiProxy",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.nova.v1.NovaProxyService", "CallApiProxy"),
);
self.inner.unary(req, path, codec).await
}
}
}