#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourceAccessDecision {
#[prost(string, tag = "1")]
pub resource_rid: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub is_authorized: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourceWorkspace {
#[prost(string, tag = "1")]
pub resource_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub workspace_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCheckResourceAccessRequest {
#[prost(string, repeated, tag = "1")]
pub resource_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCheckResourceAccessResponse {
#[prost(message, repeated, tag = "1")]
pub decisions: ::prost::alloc::vec::Vec<ResourceAccessDecision>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetResourceWorkspacesRequest {
#[prost(string, repeated, tag = "1")]
pub resource_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetResourceWorkspacesResponse {
#[prost(message, repeated, tag = "1")]
pub resource_workspaces: ::prost::alloc::vec::Vec<ResourceWorkspace>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ResourceAccessError {
Unspecified = 0,
InvalidResourceRid = 1,
InvalidWorkspaceRid = 2,
}
impl ResourceAccessError {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "RESOURCE_ACCESS_ERROR_UNSPECIFIED",
Self::InvalidResourceRid => "RESOURCE_ACCESS_ERROR_INVALID_RESOURCE_RID",
Self::InvalidWorkspaceRid => "RESOURCE_ACCESS_ERROR_INVALID_WORKSPACE_RID",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RESOURCE_ACCESS_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
"RESOURCE_ACCESS_ERROR_INVALID_RESOURCE_RID" => {
Some(Self::InvalidResourceRid)
}
"RESOURCE_ACCESS_ERROR_INVALID_WORKSPACE_RID" => {
Some(Self::InvalidWorkspaceRid)
}
_ => None,
}
}
}
pub mod resource_access_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 ResourceAccessServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ResourceAccessServiceClient<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> ResourceAccessServiceClient<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,
) -> ResourceAccessServiceClient<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,
{
ResourceAccessServiceClient::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 batch_check_resource_access(
&mut self,
request: impl tonic::IntoRequest<super::BatchCheckResourceAccessRequest>,
) -> std::result::Result<
tonic::Response<super::BatchCheckResourceAccessResponse>,
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.authorization.resources.v1.ResourceAccessService/BatchCheckResourceAccess",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.authorization.resources.v1.ResourceAccessService",
"BatchCheckResourceAccess",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_get_resource_workspaces(
&mut self,
request: impl tonic::IntoRequest<super::BatchGetResourceWorkspacesRequest>,
) -> std::result::Result<
tonic::Response<super::BatchGetResourceWorkspacesResponse>,
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.authorization.resources.v1.ResourceAccessService/BatchGetResourceWorkspaces",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.authorization.resources.v1.ResourceAccessService",
"BatchGetResourceWorkspaces",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourceShareKey {
#[prost(string, tag = "1")]
pub resource_rid: ::prost::alloc::string::String,
#[prost(enumeration = "ResourceShareRole", tag = "2")]
pub role: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResourceShare {
#[prost(message, optional, tag = "1")]
pub key: ::core::option::Option<ResourceShareKey>,
#[prost(message, repeated, tag = "2")]
pub subjects: ::prost::alloc::vec::Vec<resource_share::ShareSubject>,
#[prost(message, optional, tag = "3")]
pub related_grants: ::core::option::Option<resource_share::RelatedResourceGrants>,
#[prost(string, tag = "4")]
pub last_updated_by: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub last_updated_at: ::core::option::Option<
super::super::super::super::google::protobuf::Timestamp,
>,
}
pub mod resource_share {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ShareSubject {
#[prost(oneof = "share_subject::Subject", tags = "1")]
pub subject: ::core::option::Option<share_subject::Subject>,
}
pub mod share_subject {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Subject {
#[prost(string, tag = "1")]
UserRid(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RelatedResourceGrants {
#[prost(message, repeated, tag = "1")]
pub run_grants: ::prost::alloc::vec::Vec<super::RunGrant>,
#[prost(message, repeated, tag = "2")]
pub asset_grants: ::prost::alloc::vec::Vec<super::AssetGrant>,
#[prost(message, repeated, tag = "3")]
pub datasource_grants: ::prost::alloc::vec::Vec<super::DatasourceGrant>,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RunGrant {
#[prost(string, tag = "1")]
pub rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AssetGrant {
#[prost(string, tag = "1")]
pub rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DatasourceGrant {
#[prost(string, tag = "1")]
pub rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateResourceShareRequest {
#[prost(message, optional, tag = "1")]
pub resource_share: ::core::option::Option<ResourceShare>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateResourceShareResponse {
#[prost(message, optional, tag = "1")]
pub resource_share: ::core::option::Option<ResourceShare>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetResourceSharesRequest {
#[prost(message, repeated, tag = "1")]
pub keys: ::prost::alloc::vec::Vec<ResourceShareKey>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetResourceSharesResponse {
#[prost(message, repeated, tag = "1")]
pub resource_shares: ::prost::alloc::vec::Vec<ResourceShare>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListResourceSharesRequest {
#[prost(string, tag = "1")]
pub resource_rid: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub page_size: i32,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListResourceSharesResponse {
#[prost(message, repeated, tag = "1")]
pub resource_shares: ::prost::alloc::vec::Vec<ResourceShare>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteResourceShareRequest {
#[prost(message, optional, tag = "1")]
pub key: ::core::option::Option<ResourceShareKey>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteResourceShareResponse {}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ResourceShareRole {
Unspecified = 0,
Viewer = 1,
}
impl ResourceShareRole {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "RESOURCE_SHARE_ROLE_UNSPECIFIED",
Self::Viewer => "RESOURCE_SHARE_ROLE_VIEWER",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RESOURCE_SHARE_ROLE_UNSPECIFIED" => Some(Self::Unspecified),
"RESOURCE_SHARE_ROLE_VIEWER" => Some(Self::Viewer),
_ => None,
}
}
}
pub mod resource_share_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 ResourceShareServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ResourceShareServiceClient<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> ResourceShareServiceClient<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,
) -> ResourceShareServiceClient<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,
{
ResourceShareServiceClient::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_resource_share(
&mut self,
request: impl tonic::IntoRequest<super::CreateResourceShareRequest>,
) -> std::result::Result<
tonic::Response<super::CreateResourceShareResponse>,
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.authorization.resources.v1.ResourceShareService/CreateResourceShare",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.authorization.resources.v1.ResourceShareService",
"CreateResourceShare",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_get_resource_shares(
&mut self,
request: impl tonic::IntoRequest<super::BatchGetResourceSharesRequest>,
) -> std::result::Result<
tonic::Response<super::BatchGetResourceSharesResponse>,
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.authorization.resources.v1.ResourceShareService/BatchGetResourceShares",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.authorization.resources.v1.ResourceShareService",
"BatchGetResourceShares",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_resource_shares(
&mut self,
request: impl tonic::IntoRequest<super::ListResourceSharesRequest>,
) -> std::result::Result<
tonic::Response<super::ListResourceSharesResponse>,
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.authorization.resources.v1.ResourceShareService/ListResourceShares",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.authorization.resources.v1.ResourceShareService",
"ListResourceShares",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_resource_share(
&mut self,
request: impl tonic::IntoRequest<super::DeleteResourceShareRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteResourceShareResponse>,
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.authorization.resources.v1.ResourceShareService/DeleteResourceShare",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.authorization.resources.v1.ResourceShareService",
"DeleteResourceShare",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCreateResourceWorkspacesRequest {
#[prost(string, tag = "1")]
pub workspace_rid: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub resource_workspaces: ::prost::alloc::vec::Vec<ResourceWorkspace>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchCreateResourceWorkspacesResponse {
#[prost(message, repeated, tag = "1")]
pub resource_workspaces: ::prost::alloc::vec::Vec<ResourceWorkspace>,
}
pub mod resource_workspace_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 ResourceWorkspaceServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ResourceWorkspaceServiceClient<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> ResourceWorkspaceServiceClient<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,
) -> ResourceWorkspaceServiceClient<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,
{
ResourceWorkspaceServiceClient::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 batch_create_resource_workspaces(
&mut self,
request: impl tonic::IntoRequest<super::BatchCreateResourceWorkspacesRequest>,
) -> std::result::Result<
tonic::Response<super::BatchCreateResourceWorkspacesResponse>,
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.authorization.resources.v1.ResourceWorkspaceService/BatchCreateResourceWorkspaces",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.authorization.resources.v1.ResourceWorkspaceService",
"BatchCreateResourceWorkspaces",
),
);
self.inner.unary(req, path, codec).await
}
}
}