#[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>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateAppRequest {
#[prost(message, optional, tag = "1")]
pub app: ::core::option::Option<App>,
}
#[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>,
}
#[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 LabsError {
AppNotFound = 0,
AppNameTaken = 1,
AppNameImmutable = 2,
ServerAssignedFieldSet = 3,
InvalidPageToken = 4,
}
impl LabsError {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::AppNotFound => "LABS_ERROR_APP_NOT_FOUND",
Self::AppNameTaken => "LABS_ERROR_APP_NAME_TAKEN",
Self::AppNameImmutable => "LABS_ERROR_APP_NAME_IMMUTABLE",
Self::ServerAssignedFieldSet => "LABS_ERROR_SERVER_ASSIGNED_FIELD_SET",
Self::InvalidPageToken => "LABS_ERROR_INVALID_PAGE_TOKEN",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LABS_ERROR_APP_NOT_FOUND" => Some(Self::AppNotFound),
"LABS_ERROR_APP_NAME_TAKEN" => Some(Self::AppNameTaken),
"LABS_ERROR_APP_NAME_IMMUTABLE" => Some(Self::AppNameImmutable),
"LABS_ERROR_SERVER_ASSIGNED_FIELD_SET" => Some(Self::ServerAssignedFieldSet),
"LABS_ERROR_INVALID_PAGE_TOKEN" => Some(Self::InvalidPageToken),
_ => 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 labs_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 LabsServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl LabsServiceClient<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> LabsServiceClient<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,
) -> LabsServiceClient<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,
{
LabsServiceClient::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.labs.v1.LabsService/CreateApp",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("nominal.labs.v1.LabsService", "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.labs.v1.LabsService/GetApp",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("nominal.labs.v1.LabsService", "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.labs.v1.LabsService/UpdateApp",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("nominal.labs.v1.LabsService", "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.labs.v1.LabsService/DeleteApp",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("nominal.labs.v1.LabsService", "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.labs.v1.LabsService/SearchApps",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("nominal.labs.v1.LabsService", "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.labs.v1.LabsService/SearchAppLabels",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.labs.v1.LabsService", "SearchAppLabels"),
);
self.inner.unary(req, path, codec).await
}
}
}