#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EvaluateRequest {
#[prost(string, tag = "1")]
pub subject: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub resource: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub permission: ::prost::alloc::string::String,
#[prost(string, optional, tag = "4")]
pub context: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bool, optional, tag = "5")]
pub trace: ::core::option::Option<bool>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EvaluateResponse {
#[prost(enumeration = "Decision", tag = "1")]
pub decision: i32,
#[prost(uint32, tag = "2")]
pub index: u32,
#[prost(string, optional, tag = "3")]
pub error: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub trace: ::core::option::Option<DecisionTrace>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DecisionTrace {
#[prost(enumeration = "Decision", tag = "1")]
pub decision: i32,
#[prost(message, optional, tag = "2")]
pub root: ::core::option::Option<EvaluationNode>,
#[prost(uint64, tag = "3")]
pub duration_micros: u64,
#[prost(uint64, tag = "4")]
pub relationships_read: u64,
#[prost(uint64, tag = "5")]
pub relations_evaluated: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EvaluationNode {
#[prost(message, optional, tag = "1")]
pub node_type: ::core::option::Option<NodeType>,
#[prost(bool, tag = "2")]
pub result: bool,
#[prost(message, repeated, tag = "3")]
pub children: ::prost::alloc::vec::Vec<EvaluationNode>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NodeType {
#[prost(oneof = "node_type::Type", tags = "1, 2, 3, 4, 5, 6, 7")]
pub r#type: ::core::option::Option<node_type::Type>,
}
pub mod node_type {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Type {
#[prost(message, tag = "1")]
DirectCheck(super::DirectCheck),
#[prost(message, tag = "2")]
ComputedUserset(super::ComputedUserset),
#[prost(message, tag = "3")]
RelatedObjectUserset(super::RelatedObjectUserset),
#[prost(message, tag = "4")]
Union(super::Union),
#[prost(message, tag = "5")]
Intersection(super::Intersection),
#[prost(message, tag = "6")]
Exclusion(super::Exclusion),
#[prost(message, tag = "7")]
WasmModule(super::WasmModule),
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DirectCheck {
#[prost(string, tag = "1")]
pub resource: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub relation: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub subject: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ComputedUserset {
#[prost(string, tag = "1")]
pub relation: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub relationship: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RelatedObjectUserset {
#[prost(string, tag = "1")]
pub relationship: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub computed: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Union {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Intersection {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Exclusion {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WasmModule {
#[prost(string, tag = "1")]
pub module_name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExpandRequest {
#[prost(string, tag = "1")]
pub resource: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub relation: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpandResponse {
#[prost(oneof = "expand_response::Payload", tags = "1, 2")]
pub payload: ::core::option::Option<expand_response::Payload>,
}
pub mod expand_response {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(string, tag = "1")]
User(::prost::alloc::string::String),
#[prost(message, tag = "2")]
Summary(super::ExpandStreamSummary),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpandStreamSummary {
#[prost(message, optional, tag = "1")]
pub tree: ::core::option::Option<UsersetTree>,
#[prost(uint64, tag = "2")]
pub total_users: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UsersetTree {
#[prost(message, optional, tag = "1")]
pub node_type: ::core::option::Option<UsersetNodeType>,
#[prost(message, repeated, tag = "2")]
pub children: ::prost::alloc::vec::Vec<UsersetTree>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UsersetNodeType {
#[prost(oneof = "userset_node_type::Type", tags = "1, 2, 3, 4, 5, 6, 7")]
pub r#type: ::core::option::Option<userset_node_type::Type>,
}
pub mod userset_node_type {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Type {
#[prost(message, tag = "1")]
This(super::This),
#[prost(message, tag = "2")]
ComputedUserset(super::ComputedUsersetRef),
#[prost(message, tag = "3")]
RelatedObjectUserset(super::RelatedObjectUsersetRef),
#[prost(message, tag = "4")]
Union(super::UnionNode),
#[prost(message, tag = "5")]
Intersection(super::IntersectionNode),
#[prost(message, tag = "6")]
Exclusion(super::ExclusionNode),
#[prost(message, tag = "7")]
Leaf(super::Leaf),
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct This {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ComputedUsersetRef {
#[prost(string, tag = "1")]
pub relation: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RelatedObjectUsersetRef {
#[prost(string, tag = "1")]
pub relationship: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub computed: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UnionNode {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct IntersectionNode {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExclusionNode {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Leaf {
#[prost(string, repeated, tag = "1")]
pub users: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteRequest {
#[prost(message, repeated, tag = "1")]
pub relationships: ::prost::alloc::vec::Vec<Relationship>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WriteResponse {
#[prost(string, tag = "1")]
pub revision: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
pub relationships_written: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteFilter {
#[prost(string, optional, tag = "1")]
pub resource: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub relation: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub subject: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteRequest {
#[prost(message, optional, tag = "1")]
pub filter: ::core::option::Option<DeleteFilter>,
#[prost(message, repeated, tag = "2")]
pub relationships: ::prost::alloc::vec::Vec<Relationship>,
#[prost(uint32, optional, tag = "3")]
pub limit: ::core::option::Option<u32>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteResponse {
#[prost(string, tag = "1")]
pub revision: ::prost::alloc::string::String,
#[prost(uint64, tag = "2")]
pub relationships_deleted: u64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HealthRequest {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HealthResponse {
#[prost(string, tag = "1")]
pub status: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub service: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListResourcesRequest {
#[prost(string, tag = "1")]
pub subject: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub resource_type: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub permission: ::prost::alloc::string::String,
#[prost(uint32, optional, tag = "4")]
pub limit: ::core::option::Option<u32>,
#[prost(string, optional, tag = "5")]
pub cursor: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "6")]
pub resource_id_pattern: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListResourcesResponse {
#[prost(string, tag = "1")]
pub resource: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub cursor: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "3")]
pub total_count: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListRelationshipsRequest {
#[prost(string, optional, tag = "1")]
pub resource: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub relation: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub subject: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "4")]
pub limit: ::core::option::Option<u32>,
#[prost(string, optional, tag = "5")]
pub cursor: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Relationship {
#[prost(string, tag = "1")]
pub resource: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub relation: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub subject: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListRelationshipsResponse {
#[prost(message, optional, tag = "1")]
pub relationship: ::core::option::Option<Relationship>,
#[prost(string, optional, tag = "2")]
pub cursor: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "3")]
pub total_count: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListSubjectsRequest {
#[prost(string, tag = "1")]
pub resource: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub relation: ::prost::alloc::string::String,
#[prost(string, optional, tag = "3")]
pub subject_type: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "4")]
pub limit: ::core::option::Option<u32>,
#[prost(string, optional, tag = "5")]
pub cursor: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListSubjectsResponse {
#[prost(string, tag = "1")]
pub subject: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub cursor: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, optional, tag = "3")]
pub total_count: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WatchRequest {
#[prost(string, repeated, tag = "1")]
pub resource_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub cursor: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct WatchResponse {
#[prost(enumeration = "ChangeOperation", tag = "1")]
pub operation: i32,
#[prost(message, optional, tag = "2")]
pub relationship: ::core::option::Option<Relationship>,
#[prost(string, tag = "3")]
pub revision: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub timestamp: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SimulateRequest {
#[prost(message, repeated, tag = "1")]
pub context_relationships: ::prost::alloc::vec::Vec<Relationship>,
#[prost(message, optional, tag = "2")]
pub check: ::core::option::Option<SimulateCheck>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SimulateCheck {
#[prost(string, tag = "1")]
pub subject: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub resource: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub permission: ::prost::alloc::string::String,
#[prost(string, optional, tag = "4")]
pub context: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SimulateResponse {
#[prost(enumeration = "Decision", tag = "1")]
pub decision: i32,
#[prost(uint64, tag = "2")]
pub context_relationships_count: u64,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Decision {
Unspecified = 0,
Allow = 1,
Deny = 2,
}
impl Decision {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "DECISION_UNSPECIFIED",
Self::Allow => "DECISION_ALLOW",
Self::Deny => "DECISION_DENY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DECISION_UNSPECIFIED" => Some(Self::Unspecified),
"DECISION_ALLOW" => Some(Self::Allow),
"DECISION_DENY" => Some(Self::Deny),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ChangeOperation {
Unspecified = 0,
Create = 1,
Delete = 2,
}
impl ChangeOperation {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "CHANGE_OPERATION_UNSPECIFIED",
Self::Create => "CHANGE_OPERATION_CREATE",
Self::Delete => "CHANGE_OPERATION_DELETE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"CHANGE_OPERATION_UNSPECIFIED" => Some(Self::Unspecified),
"CHANGE_OPERATION_CREATE" => Some(Self::Create),
"CHANGE_OPERATION_DELETE" => Some(Self::Delete),
_ => None,
}
}
}
pub mod inferadb_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct InferadbServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl InferadbServiceClient<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> InferadbServiceClient<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,
) -> InferadbServiceClient<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,
{
InferadbServiceClient::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 evaluate(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::EvaluateRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::EvaluateResponse>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic_prost::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/inferadb.v1.InferadbService/Evaluate");
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(GrpcMethod::new("inferadb.v1.InferadbService", "Evaluate"));
self.inner.streaming(req, path, codec).await
}
pub async fn expand(
&mut self,
request: impl tonic::IntoRequest<super::ExpandRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ExpandResponse>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/inferadb.v1.InferadbService/Expand");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("inferadb.v1.InferadbService", "Expand"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn write_relationships(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::WriteRequest>,
) -> std::result::Result<tonic::Response<super::WriteResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/inferadb.v1.InferadbService/WriteRelationships",
);
let mut req = request.into_streaming_request();
req.extensions_mut().insert(GrpcMethod::new(
"inferadb.v1.InferadbService",
"WriteRelationships",
));
self.inner.client_streaming(req, path, codec).await
}
pub async fn delete_relationships(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::DeleteRequest>,
) -> std::result::Result<tonic::Response<super::DeleteResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/inferadb.v1.InferadbService/DeleteRelationships",
);
let mut req = request.into_streaming_request();
req.extensions_mut().insert(GrpcMethod::new(
"inferadb.v1.InferadbService",
"DeleteRelationships",
));
self.inner.client_streaming(req, path, codec).await
}
pub async fn health(
&mut self,
request: impl tonic::IntoRequest<super::HealthRequest>,
) -> std::result::Result<tonic::Response<super::HealthResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/inferadb.v1.InferadbService/Health");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("inferadb.v1.InferadbService", "Health"));
self.inner.unary(req, path, codec).await
}
pub async fn list_resources(
&mut self,
request: impl tonic::IntoRequest<super::ListResourcesRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ListResourcesResponse>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic_prost::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/inferadb.v1.InferadbService/ListResources");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new(
"inferadb.v1.InferadbService",
"ListResources",
));
self.inner.server_streaming(req, path, codec).await
}
pub async fn list_relationships(
&mut self,
request: impl tonic::IntoRequest<super::ListRelationshipsRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ListRelationshipsResponse>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/inferadb.v1.InferadbService/ListRelationships",
);
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new(
"inferadb.v1.InferadbService",
"ListRelationships",
));
self.inner.server_streaming(req, path, codec).await
}
pub async fn list_subjects(
&mut self,
request: impl tonic::IntoRequest<super::ListSubjectsRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ListSubjectsResponse>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic_prost::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/inferadb.v1.InferadbService/ListSubjects");
let mut req = request.into_request();
req.extensions_mut().insert(GrpcMethod::new(
"inferadb.v1.InferadbService",
"ListSubjects",
));
self.inner.server_streaming(req, path, codec).await
}
pub async fn watch(
&mut self,
request: impl tonic::IntoRequest<super::WatchRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::WatchResponse>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/inferadb.v1.InferadbService/Watch");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("inferadb.v1.InferadbService", "Watch"));
self.inner.server_streaming(req, path, codec).await
}
pub async fn simulate(
&mut self,
request: impl tonic::IntoRequest<super::SimulateRequest>,
) -> std::result::Result<tonic::Response<super::SimulateResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic_prost::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/inferadb.v1.InferadbService/Simulate");
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("inferadb.v1.InferadbService", "Simulate"));
self.inner.unary(req, path, codec).await
}
}
}