#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListBasinsRequest {
#[prost(string, tag = "1")]
pub prefix: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub start_after: ::prost::alloc::string::String,
#[prost(uint64, optional, tag = "3")]
pub limit: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBasinsResponse {
#[prost(message, repeated, tag = "1")]
pub basins: ::prost::alloc::vec::Vec<BasinInfo>,
#[prost(bool, tag = "2")]
pub has_more: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateBasinRequest {
#[prost(string, tag = "1")]
pub basin: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub config: ::core::option::Option<BasinConfig>,
#[prost(enumeration = "BasinScope", tag = "3")]
pub scope: i32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateBasinResponse {
#[prost(message, optional, tag = "1")]
pub info: ::core::option::Option<BasinInfo>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteBasinRequest {
#[prost(string, tag = "1")]
pub basin: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteBasinResponse {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetBasinConfigRequest {
#[prost(string, tag = "1")]
pub basin: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetBasinConfigResponse {
#[prost(message, optional, tag = "1")]
pub config: ::core::option::Option<BasinConfig>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReconfigureBasinRequest {
#[prost(string, tag = "1")]
pub basin: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub config: ::core::option::Option<BasinConfig>,
#[prost(message, optional, tag = "3")]
pub mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReconfigureBasinResponse {
#[prost(message, optional, tag = "1")]
pub config: ::core::option::Option<BasinConfig>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct IssueAccessTokenRequest {
#[prost(message, optional, tag = "1")]
pub info: ::core::option::Option<AccessTokenInfo>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadWritePermissions {
#[prost(bool, tag = "1")]
pub read: bool,
#[prost(bool, tag = "2")]
pub write: bool,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PermittedOperationGroups {
#[prost(message, optional, tag = "1")]
pub account: ::core::option::Option<ReadWritePermissions>,
#[prost(message, optional, tag = "2")]
pub basin: ::core::option::Option<ReadWritePermissions>,
#[prost(message, optional, tag = "3")]
pub stream: ::core::option::Option<ReadWritePermissions>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RevokeAccessTokenRequest {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RevokeAccessTokenResponse {
#[prost(message, optional, tag = "1")]
pub info: ::core::option::Option<AccessTokenInfo>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListAccessTokensRequest {
#[prost(string, tag = "1")]
pub prefix: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub start_after: ::prost::alloc::string::String,
#[prost(uint64, optional, tag = "3")]
pub limit: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListAccessTokensResponse {
#[prost(message, repeated, tag = "1")]
pub access_tokens: ::prost::alloc::vec::Vec<AccessTokenInfo>,
#[prost(bool, tag = "2")]
pub has_more: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AccessTokenInfo {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(uint32, optional, tag = "2")]
pub expires_at: ::core::option::Option<u32>,
#[prost(bool, tag = "3")]
pub auto_prefix_streams: bool,
#[prost(message, optional, tag = "4")]
pub scope: ::core::option::Option<AccessTokenScope>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AccessTokenScope {
#[prost(message, optional, tag = "1")]
pub basins: ::core::option::Option<ResourceSet>,
#[prost(message, optional, tag = "2")]
pub streams: ::core::option::Option<ResourceSet>,
#[prost(message, optional, tag = "3")]
pub access_tokens: ::core::option::Option<ResourceSet>,
#[prost(message, optional, tag = "4")]
pub op_groups: ::core::option::Option<PermittedOperationGroups>,
#[prost(enumeration = "Operation", repeated, tag = "5")]
pub ops: ::prost::alloc::vec::Vec<i32>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ResourceSet {
#[prost(oneof = "resource_set::Matching", tags = "1, 2")]
pub matching: ::core::option::Option<resource_set::Matching>,
}
pub mod resource_set {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Matching {
#[prost(string, tag = "1")]
Exact(::prost::alloc::string::String),
#[prost(string, tag = "2")]
Prefix(::prost::alloc::string::String),
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct IssueAccessTokenResponse {
#[prost(string, tag = "1")]
pub access_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StreamInfo {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(uint32, tag = "2")]
pub created_at: u32,
#[prost(uint32, optional, tag = "3")]
pub deleted_at: ::core::option::Option<u32>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListStreamsRequest {
#[prost(string, tag = "1")]
pub prefix: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub start_after: ::prost::alloc::string::String,
#[prost(uint64, optional, tag = "3")]
pub limit: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListStreamsResponse {
#[prost(message, repeated, tag = "1")]
pub streams: ::prost::alloc::vec::Vec<StreamInfo>,
#[prost(bool, tag = "2")]
pub has_more: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateStreamRequest {
#[prost(string, tag = "1")]
pub stream: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub config: ::core::option::Option<StreamConfig>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateStreamResponse {
#[prost(message, optional, tag = "1")]
pub info: ::core::option::Option<StreamInfo>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteStreamRequest {
#[prost(string, tag = "1")]
pub stream: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteStreamResponse {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetStreamConfigRequest {
#[prost(string, tag = "1")]
pub stream: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetStreamConfigResponse {
#[prost(message, optional, tag = "1")]
pub config: ::core::option::Option<StreamConfig>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReconfigureStreamRequest {
#[prost(string, tag = "1")]
pub stream: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub config: ::core::option::Option<StreamConfig>,
#[prost(message, optional, tag = "3")]
pub mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReconfigureStreamResponse {
#[prost(message, optional, tag = "1")]
pub config: ::core::option::Option<StreamConfig>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CheckTailRequest {
#[prost(string, tag = "1")]
pub stream: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CheckTailResponse {
#[prost(uint64, tag = "1")]
pub next_seq_num: u64,
#[prost(uint64, tag = "2")]
pub last_timestamp: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppendInput {
#[prost(string, tag = "1")]
pub stream: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub records: ::prost::alloc::vec::Vec<AppendRecord>,
#[prost(uint64, optional, tag = "3")]
pub match_seq_num: ::core::option::Option<u64>,
#[prost(string, optional, tag = "4")]
pub fencing_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AppendOutput {
#[prost(uint64, tag = "1")]
pub start_seq_num: u64,
#[prost(uint64, tag = "4")]
pub start_timestamp: u64,
#[prost(uint64, tag = "2")]
pub end_seq_num: u64,
#[prost(uint64, tag = "5")]
pub end_timestamp: u64,
#[prost(uint64, tag = "3")]
pub next_seq_num: u64,
#[prost(uint64, tag = "6")]
pub last_timestamp: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppendRequest {
#[prost(message, optional, tag = "1")]
pub input: ::core::option::Option<AppendInput>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AppendResponse {
#[prost(message, optional, tag = "1")]
pub output: ::core::option::Option<AppendOutput>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppendSessionRequest {
#[prost(message, optional, tag = "1")]
pub input: ::core::option::Option<AppendInput>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AppendSessionResponse {
#[prost(message, optional, tag = "1")]
pub output: ::core::option::Option<AppendOutput>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadOutput {
#[prost(oneof = "read_output::Output", tags = "1, 3")]
pub output: ::core::option::Option<read_output::Output>,
}
pub mod read_output {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Output {
#[prost(message, tag = "1")]
Batch(super::SequencedRecordBatch),
#[prost(uint64, tag = "3")]
NextSeqNum(u64),
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadRequest {
#[prost(string, tag = "1")]
pub stream: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub limit: ::core::option::Option<ReadLimit>,
#[prost(uint64, optional, tag = "6")]
pub until: ::core::option::Option<u64>,
#[prost(bool, tag = "7")]
pub clamp: bool,
#[prost(oneof = "read_request::Start", tags = "2, 4, 5")]
pub start: ::core::option::Option<read_request::Start>,
}
pub mod read_request {
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Start {
#[prost(uint64, tag = "2")]
SeqNum(u64),
#[prost(uint64, tag = "4")]
Timestamp(u64),
#[prost(uint64, tag = "5")]
TailOffset(u64),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadResponse {
#[prost(message, optional, tag = "1")]
pub output: ::core::option::Option<ReadOutput>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadLimit {
#[prost(uint64, optional, tag = "1")]
pub count: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "2")]
pub bytes: ::core::option::Option<u64>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReadSessionRequest {
#[prost(string, tag = "1")]
pub stream: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub limit: ::core::option::Option<ReadLimit>,
#[prost(bool, tag = "4")]
pub heartbeats: bool,
#[prost(uint64, optional, tag = "7")]
pub until: ::core::option::Option<u64>,
#[prost(bool, tag = "8")]
pub clamp: bool,
#[prost(oneof = "read_session_request::Start", tags = "2, 5, 6")]
pub start: ::core::option::Option<read_session_request::Start>,
}
pub mod read_session_request {
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum Start {
#[prost(uint64, tag = "2")]
SeqNum(u64),
#[prost(uint64, tag = "5")]
Timestamp(u64),
#[prost(uint64, tag = "6")]
TailOffset(u64),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadSessionResponse {
#[prost(message, optional, tag = "1")]
pub output: ::core::option::Option<ReadOutput>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StreamConfig {
#[prost(enumeration = "StorageClass", tag = "1")]
pub storage_class: i32,
#[prost(message, optional, tag = "5")]
pub timestamping: ::core::option::Option<stream_config::Timestamping>,
#[prost(message, optional, tag = "6")]
pub delete_on_empty: ::core::option::Option<stream_config::DeleteOnEmpty>,
#[prost(oneof = "stream_config::RetentionPolicy", tags = "2, 7")]
pub retention_policy: ::core::option::Option<stream_config::RetentionPolicy>,
}
pub mod stream_config {
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Timestamping {
#[prost(enumeration = "super::TimestampingMode", tag = "1")]
pub mode: i32,
#[prost(bool, optional, tag = "2")]
pub uncapped: ::core::option::Option<bool>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteOnEmpty {
#[prost(uint64, tag = "1")]
pub min_age_secs: u64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct InfiniteRetention {}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum RetentionPolicy {
#[prost(uint64, tag = "2")]
Age(u64),
#[prost(message, tag = "7")]
Infinite(InfiniteRetention),
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BasinConfig {
#[prost(message, optional, tag = "1")]
pub default_stream_config: ::core::option::Option<StreamConfig>,
#[prost(bool, tag = "2")]
pub create_stream_on_append: bool,
#[prost(bool, tag = "3")]
pub create_stream_on_read: bool,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BasinInfo {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(enumeration = "BasinScope", tag = "5")]
pub scope: i32,
#[prost(enumeration = "BasinState", tag = "4")]
pub state: i32,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Header {
#[prost(bytes = "bytes", tag = "1")]
pub name: ::prost::bytes::Bytes,
#[prost(bytes = "bytes", tag = "2")]
pub value: ::prost::bytes::Bytes,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppendRecord {
#[prost(uint64, optional, tag = "3")]
pub timestamp: ::core::option::Option<u64>,
#[prost(message, repeated, tag = "1")]
pub headers: ::prost::alloc::vec::Vec<Header>,
#[prost(bytes = "bytes", tag = "2")]
pub body: ::prost::bytes::Bytes,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SequencedRecord {
#[prost(uint64, tag = "1")]
pub seq_num: u64,
#[prost(uint64, tag = "4")]
pub timestamp: u64,
#[prost(message, repeated, tag = "2")]
pub headers: ::prost::alloc::vec::Vec<Header>,
#[prost(bytes = "bytes", tag = "3")]
pub body: ::prost::bytes::Bytes,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SequencedRecordBatch {
#[prost(message, repeated, tag = "1")]
pub records: ::prost::alloc::vec::Vec<SequencedRecord>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BasinScope {
Unspecified = 0,
AwsUsEast1 = 1,
}
impl BasinScope {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "BASIN_SCOPE_UNSPECIFIED",
Self::AwsUsEast1 => "BASIN_SCOPE_AWS_US_EAST_1",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BASIN_SCOPE_UNSPECIFIED" => Some(Self::Unspecified),
"BASIN_SCOPE_AWS_US_EAST_1" => Some(Self::AwsUsEast1),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Operation {
Unspecified = 0,
ListBasins = 1,
CreateBasin = 2,
DeleteBasin = 3,
ReconfigureBasin = 4,
GetBasinConfig = 5,
IssueAccessToken = 6,
RevokeAccessToken = 7,
ListAccessTokens = 8,
ListStreams = 9,
CreateStream = 10,
DeleteStream = 11,
GetStreamConfig = 12,
ReconfigureStream = 13,
CheckTail = 14,
Append = 15,
Read = 16,
Trim = 17,
Fence = 18,
AccountMetrics = 19,
BasinMetrics = 20,
StreamMetrics = 21,
}
impl Operation {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "OPERATION_UNSPECIFIED",
Self::ListBasins => "OPERATION_LIST_BASINS",
Self::CreateBasin => "OPERATION_CREATE_BASIN",
Self::DeleteBasin => "OPERATION_DELETE_BASIN",
Self::ReconfigureBasin => "OPERATION_RECONFIGURE_BASIN",
Self::GetBasinConfig => "OPERATION_GET_BASIN_CONFIG",
Self::IssueAccessToken => "OPERATION_ISSUE_ACCESS_TOKEN",
Self::RevokeAccessToken => "OPERATION_REVOKE_ACCESS_TOKEN",
Self::ListAccessTokens => "OPERATION_LIST_ACCESS_TOKENS",
Self::ListStreams => "OPERATION_LIST_STREAMS",
Self::CreateStream => "OPERATION_CREATE_STREAM",
Self::DeleteStream => "OPERATION_DELETE_STREAM",
Self::GetStreamConfig => "OPERATION_GET_STREAM_CONFIG",
Self::ReconfigureStream => "OPERATION_RECONFIGURE_STREAM",
Self::CheckTail => "OPERATION_CHECK_TAIL",
Self::Append => "OPERATION_APPEND",
Self::Read => "OPERATION_READ",
Self::Trim => "OPERATION_TRIM",
Self::Fence => "OPERATION_FENCE",
Self::AccountMetrics => "OPERATION_ACCOUNT_METRICS",
Self::BasinMetrics => "OPERATION_BASIN_METRICS",
Self::StreamMetrics => "OPERATION_STREAM_METRICS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"OPERATION_UNSPECIFIED" => Some(Self::Unspecified),
"OPERATION_LIST_BASINS" => Some(Self::ListBasins),
"OPERATION_CREATE_BASIN" => Some(Self::CreateBasin),
"OPERATION_DELETE_BASIN" => Some(Self::DeleteBasin),
"OPERATION_RECONFIGURE_BASIN" => Some(Self::ReconfigureBasin),
"OPERATION_GET_BASIN_CONFIG" => Some(Self::GetBasinConfig),
"OPERATION_ISSUE_ACCESS_TOKEN" => Some(Self::IssueAccessToken),
"OPERATION_REVOKE_ACCESS_TOKEN" => Some(Self::RevokeAccessToken),
"OPERATION_LIST_ACCESS_TOKENS" => Some(Self::ListAccessTokens),
"OPERATION_LIST_STREAMS" => Some(Self::ListStreams),
"OPERATION_CREATE_STREAM" => Some(Self::CreateStream),
"OPERATION_DELETE_STREAM" => Some(Self::DeleteStream),
"OPERATION_GET_STREAM_CONFIG" => Some(Self::GetStreamConfig),
"OPERATION_RECONFIGURE_STREAM" => Some(Self::ReconfigureStream),
"OPERATION_CHECK_TAIL" => Some(Self::CheckTail),
"OPERATION_APPEND" => Some(Self::Append),
"OPERATION_READ" => Some(Self::Read),
"OPERATION_TRIM" => Some(Self::Trim),
"OPERATION_FENCE" => Some(Self::Fence),
"OPERATION_ACCOUNT_METRICS" => Some(Self::AccountMetrics),
"OPERATION_BASIN_METRICS" => Some(Self::BasinMetrics),
"OPERATION_STREAM_METRICS" => Some(Self::StreamMetrics),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum StorageClass {
Unspecified = 0,
Standard = 1,
Express = 2,
}
impl StorageClass {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "STORAGE_CLASS_UNSPECIFIED",
Self::Standard => "STORAGE_CLASS_STANDARD",
Self::Express => "STORAGE_CLASS_EXPRESS",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"STORAGE_CLASS_UNSPECIFIED" => Some(Self::Unspecified),
"STORAGE_CLASS_STANDARD" => Some(Self::Standard),
"STORAGE_CLASS_EXPRESS" => Some(Self::Express),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TimestampingMode {
Unspecified = 0,
ClientPrefer = 1,
ClientRequire = 2,
Arrival = 3,
}
impl TimestampingMode {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "TIMESTAMPING_MODE_UNSPECIFIED",
Self::ClientPrefer => "TIMESTAMPING_MODE_CLIENT_PREFER",
Self::ClientRequire => "TIMESTAMPING_MODE_CLIENT_REQUIRE",
Self::Arrival => "TIMESTAMPING_MODE_ARRIVAL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TIMESTAMPING_MODE_UNSPECIFIED" => Some(Self::Unspecified),
"TIMESTAMPING_MODE_CLIENT_PREFER" => Some(Self::ClientPrefer),
"TIMESTAMPING_MODE_CLIENT_REQUIRE" => Some(Self::ClientRequire),
"TIMESTAMPING_MODE_ARRIVAL" => Some(Self::Arrival),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BasinState {
Unspecified = 0,
Active = 1,
Creating = 2,
Deleting = 3,
}
impl BasinState {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "BASIN_STATE_UNSPECIFIED",
Self::Active => "BASIN_STATE_ACTIVE",
Self::Creating => "BASIN_STATE_CREATING",
Self::Deleting => "BASIN_STATE_DELETING",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"BASIN_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"BASIN_STATE_ACTIVE" => Some(Self::Active),
"BASIN_STATE_CREATING" => Some(Self::Creating),
"BASIN_STATE_DELETING" => Some(Self::Deleting),
_ => None,
}
}
}
pub mod account_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 AccountServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl AccountServiceClient<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> AccountServiceClient<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,
) -> AccountServiceClient<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,
{
AccountServiceClient::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 list_basins(
&mut self,
request: impl tonic::IntoRequest<super::ListBasinsRequest>,
) -> std::result::Result<
tonic::Response<super::ListBasinsResponse>,
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(
"/s2.v1alpha.AccountService/ListBasins",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("s2.v1alpha.AccountService", "ListBasins"));
self.inner.unary(req, path, codec).await
}
pub async fn create_basin(
&mut self,
request: impl tonic::IntoRequest<super::CreateBasinRequest>,
) -> std::result::Result<
tonic::Response<super::CreateBasinResponse>,
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(
"/s2.v1alpha.AccountService/CreateBasin",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("s2.v1alpha.AccountService", "CreateBasin"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_basin(
&mut self,
request: impl tonic::IntoRequest<super::DeleteBasinRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteBasinResponse>,
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(
"/s2.v1alpha.AccountService/DeleteBasin",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("s2.v1alpha.AccountService", "DeleteBasin"));
self.inner.unary(req, path, codec).await
}
pub async fn reconfigure_basin(
&mut self,
request: impl tonic::IntoRequest<super::ReconfigureBasinRequest>,
) -> std::result::Result<
tonic::Response<super::ReconfigureBasinResponse>,
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(
"/s2.v1alpha.AccountService/ReconfigureBasin",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("s2.v1alpha.AccountService", "ReconfigureBasin"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_basin_config(
&mut self,
request: impl tonic::IntoRequest<super::GetBasinConfigRequest>,
) -> std::result::Result<
tonic::Response<super::GetBasinConfigResponse>,
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(
"/s2.v1alpha.AccountService/GetBasinConfig",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("s2.v1alpha.AccountService", "GetBasinConfig"));
self.inner.unary(req, path, codec).await
}
pub async fn issue_access_token(
&mut self,
request: impl tonic::IntoRequest<super::IssueAccessTokenRequest>,
) -> std::result::Result<
tonic::Response<super::IssueAccessTokenResponse>,
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(
"/s2.v1alpha.AccountService/IssueAccessToken",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("s2.v1alpha.AccountService", "IssueAccessToken"),
);
self.inner.unary(req, path, codec).await
}
pub async fn revoke_access_token(
&mut self,
request: impl tonic::IntoRequest<super::RevokeAccessTokenRequest>,
) -> std::result::Result<
tonic::Response<super::RevokeAccessTokenResponse>,
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(
"/s2.v1alpha.AccountService/RevokeAccessToken",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("s2.v1alpha.AccountService", "RevokeAccessToken"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_access_tokens(
&mut self,
request: impl tonic::IntoRequest<super::ListAccessTokensRequest>,
) -> std::result::Result<
tonic::Response<super::ListAccessTokensResponse>,
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(
"/s2.v1alpha.AccountService/ListAccessTokens",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("s2.v1alpha.AccountService", "ListAccessTokens"),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod account_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait AccountService: std::marker::Send + std::marker::Sync + 'static {
async fn list_basins(
&self,
request: tonic::Request<super::ListBasinsRequest>,
) -> std::result::Result<
tonic::Response<super::ListBasinsResponse>,
tonic::Status,
>;
async fn create_basin(
&self,
request: tonic::Request<super::CreateBasinRequest>,
) -> std::result::Result<
tonic::Response<super::CreateBasinResponse>,
tonic::Status,
>;
async fn delete_basin(
&self,
request: tonic::Request<super::DeleteBasinRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteBasinResponse>,
tonic::Status,
>;
async fn reconfigure_basin(
&self,
request: tonic::Request<super::ReconfigureBasinRequest>,
) -> std::result::Result<
tonic::Response<super::ReconfigureBasinResponse>,
tonic::Status,
>;
async fn get_basin_config(
&self,
request: tonic::Request<super::GetBasinConfigRequest>,
) -> std::result::Result<
tonic::Response<super::GetBasinConfigResponse>,
tonic::Status,
>;
async fn issue_access_token(
&self,
request: tonic::Request<super::IssueAccessTokenRequest>,
) -> std::result::Result<
tonic::Response<super::IssueAccessTokenResponse>,
tonic::Status,
>;
async fn revoke_access_token(
&self,
request: tonic::Request<super::RevokeAccessTokenRequest>,
) -> std::result::Result<
tonic::Response<super::RevokeAccessTokenResponse>,
tonic::Status,
>;
async fn list_access_tokens(
&self,
request: tonic::Request<super::ListAccessTokensRequest>,
) -> std::result::Result<
tonic::Response<super::ListAccessTokensResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct AccountServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> AccountServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for AccountServiceServer<T>
where
T: AccountService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/s2.v1alpha.AccountService/ListBasins" => {
#[allow(non_camel_case_types)]
struct ListBasinsSvc<T: AccountService>(pub Arc<T>);
impl<
T: AccountService,
> tonic::server::UnaryService<super::ListBasinsRequest>
for ListBasinsSvc<T> {
type Response = super::ListBasinsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListBasinsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AccountService>::list_basins(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListBasinsSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/s2.v1alpha.AccountService/CreateBasin" => {
#[allow(non_camel_case_types)]
struct CreateBasinSvc<T: AccountService>(pub Arc<T>);
impl<
T: AccountService,
> tonic::server::UnaryService<super::CreateBasinRequest>
for CreateBasinSvc<T> {
type Response = super::CreateBasinResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateBasinRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AccountService>::create_basin(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = CreateBasinSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/s2.v1alpha.AccountService/DeleteBasin" => {
#[allow(non_camel_case_types)]
struct DeleteBasinSvc<T: AccountService>(pub Arc<T>);
impl<
T: AccountService,
> tonic::server::UnaryService<super::DeleteBasinRequest>
for DeleteBasinSvc<T> {
type Response = super::DeleteBasinResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteBasinRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AccountService>::delete_basin(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DeleteBasinSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/s2.v1alpha.AccountService/ReconfigureBasin" => {
#[allow(non_camel_case_types)]
struct ReconfigureBasinSvc<T: AccountService>(pub Arc<T>);
impl<
T: AccountService,
> tonic::server::UnaryService<super::ReconfigureBasinRequest>
for ReconfigureBasinSvc<T> {
type Response = super::ReconfigureBasinResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ReconfigureBasinRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AccountService>::reconfigure_basin(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ReconfigureBasinSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/s2.v1alpha.AccountService/GetBasinConfig" => {
#[allow(non_camel_case_types)]
struct GetBasinConfigSvc<T: AccountService>(pub Arc<T>);
impl<
T: AccountService,
> tonic::server::UnaryService<super::GetBasinConfigRequest>
for GetBasinConfigSvc<T> {
type Response = super::GetBasinConfigResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetBasinConfigRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AccountService>::get_basin_config(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetBasinConfigSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/s2.v1alpha.AccountService/IssueAccessToken" => {
#[allow(non_camel_case_types)]
struct IssueAccessTokenSvc<T: AccountService>(pub Arc<T>);
impl<
T: AccountService,
> tonic::server::UnaryService<super::IssueAccessTokenRequest>
for IssueAccessTokenSvc<T> {
type Response = super::IssueAccessTokenResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::IssueAccessTokenRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AccountService>::issue_access_token(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = IssueAccessTokenSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/s2.v1alpha.AccountService/RevokeAccessToken" => {
#[allow(non_camel_case_types)]
struct RevokeAccessTokenSvc<T: AccountService>(pub Arc<T>);
impl<
T: AccountService,
> tonic::server::UnaryService<super::RevokeAccessTokenRequest>
for RevokeAccessTokenSvc<T> {
type Response = super::RevokeAccessTokenResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::RevokeAccessTokenRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AccountService>::revoke_access_token(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = RevokeAccessTokenSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/s2.v1alpha.AccountService/ListAccessTokens" => {
#[allow(non_camel_case_types)]
struct ListAccessTokensSvc<T: AccountService>(pub Arc<T>);
impl<
T: AccountService,
> tonic::server::UnaryService<super::ListAccessTokensRequest>
for ListAccessTokensSvc<T> {
type Response = super::ListAccessTokensResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListAccessTokensRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as AccountService>::list_access_tokens(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListAccessTokensSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for AccountServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "s2.v1alpha.AccountService";
impl<T> tonic::server::NamedService for AccountServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod basin_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 BasinServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl BasinServiceClient<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> BasinServiceClient<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,
) -> BasinServiceClient<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,
{
BasinServiceClient::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 list_streams(
&mut self,
request: impl tonic::IntoRequest<super::ListStreamsRequest>,
) -> std::result::Result<
tonic::Response<super::ListStreamsResponse>,
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(
"/s2.v1alpha.BasinService/ListStreams",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("s2.v1alpha.BasinService", "ListStreams"));
self.inner.unary(req, path, codec).await
}
pub async fn create_stream(
&mut self,
request: impl tonic::IntoRequest<super::CreateStreamRequest>,
) -> std::result::Result<
tonic::Response<super::CreateStreamResponse>,
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(
"/s2.v1alpha.BasinService/CreateStream",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("s2.v1alpha.BasinService", "CreateStream"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_stream(
&mut self,
request: impl tonic::IntoRequest<super::DeleteStreamRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteStreamResponse>,
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(
"/s2.v1alpha.BasinService/DeleteStream",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("s2.v1alpha.BasinService", "DeleteStream"));
self.inner.unary(req, path, codec).await
}
pub async fn get_stream_config(
&mut self,
request: impl tonic::IntoRequest<super::GetStreamConfigRequest>,
) -> std::result::Result<
tonic::Response<super::GetStreamConfigResponse>,
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(
"/s2.v1alpha.BasinService/GetStreamConfig",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("s2.v1alpha.BasinService", "GetStreamConfig"));
self.inner.unary(req, path, codec).await
}
pub async fn reconfigure_stream(
&mut self,
request: impl tonic::IntoRequest<super::ReconfigureStreamRequest>,
) -> std::result::Result<
tonic::Response<super::ReconfigureStreamResponse>,
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(
"/s2.v1alpha.BasinService/ReconfigureStream",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("s2.v1alpha.BasinService", "ReconfigureStream"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod basin_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait BasinService: std::marker::Send + std::marker::Sync + 'static {
async fn list_streams(
&self,
request: tonic::Request<super::ListStreamsRequest>,
) -> std::result::Result<
tonic::Response<super::ListStreamsResponse>,
tonic::Status,
>;
async fn create_stream(
&self,
request: tonic::Request<super::CreateStreamRequest>,
) -> std::result::Result<
tonic::Response<super::CreateStreamResponse>,
tonic::Status,
>;
async fn delete_stream(
&self,
request: tonic::Request<super::DeleteStreamRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteStreamResponse>,
tonic::Status,
>;
async fn get_stream_config(
&self,
request: tonic::Request<super::GetStreamConfigRequest>,
) -> std::result::Result<
tonic::Response<super::GetStreamConfigResponse>,
tonic::Status,
>;
async fn reconfigure_stream(
&self,
request: tonic::Request<super::ReconfigureStreamRequest>,
) -> std::result::Result<
tonic::Response<super::ReconfigureStreamResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct BasinServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> BasinServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for BasinServiceServer<T>
where
T: BasinService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/s2.v1alpha.BasinService/ListStreams" => {
#[allow(non_camel_case_types)]
struct ListStreamsSvc<T: BasinService>(pub Arc<T>);
impl<
T: BasinService,
> tonic::server::UnaryService<super::ListStreamsRequest>
for ListStreamsSvc<T> {
type Response = super::ListStreamsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListStreamsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as BasinService>::list_streams(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ListStreamsSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/s2.v1alpha.BasinService/CreateStream" => {
#[allow(non_camel_case_types)]
struct CreateStreamSvc<T: BasinService>(pub Arc<T>);
impl<
T: BasinService,
> tonic::server::UnaryService<super::CreateStreamRequest>
for CreateStreamSvc<T> {
type Response = super::CreateStreamResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CreateStreamRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as BasinService>::create_stream(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = CreateStreamSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/s2.v1alpha.BasinService/DeleteStream" => {
#[allow(non_camel_case_types)]
struct DeleteStreamSvc<T: BasinService>(pub Arc<T>);
impl<
T: BasinService,
> tonic::server::UnaryService<super::DeleteStreamRequest>
for DeleteStreamSvc<T> {
type Response = super::DeleteStreamResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteStreamRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as BasinService>::delete_stream(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = DeleteStreamSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/s2.v1alpha.BasinService/GetStreamConfig" => {
#[allow(non_camel_case_types)]
struct GetStreamConfigSvc<T: BasinService>(pub Arc<T>);
impl<
T: BasinService,
> tonic::server::UnaryService<super::GetStreamConfigRequest>
for GetStreamConfigSvc<T> {
type Response = super::GetStreamConfigResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetStreamConfigRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as BasinService>::get_stream_config(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = GetStreamConfigSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/s2.v1alpha.BasinService/ReconfigureStream" => {
#[allow(non_camel_case_types)]
struct ReconfigureStreamSvc<T: BasinService>(pub Arc<T>);
impl<
T: BasinService,
> tonic::server::UnaryService<super::ReconfigureStreamRequest>
for ReconfigureStreamSvc<T> {
type Response = super::ReconfigureStreamResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ReconfigureStreamRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as BasinService>::reconfigure_stream(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ReconfigureStreamSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for BasinServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "s2.v1alpha.BasinService";
impl<T> tonic::server::NamedService for BasinServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
pub mod stream_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 StreamServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl StreamServiceClient<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> StreamServiceClient<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,
) -> StreamServiceClient<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,
{
StreamServiceClient::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 check_tail(
&mut self,
request: impl tonic::IntoRequest<super::CheckTailRequest>,
) -> std::result::Result<
tonic::Response<super::CheckTailResponse>,
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(
"/s2.v1alpha.StreamService/CheckTail",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("s2.v1alpha.StreamService", "CheckTail"));
self.inner.unary(req, path, codec).await
}
pub async fn append(
&mut self,
request: impl tonic::IntoRequest<super::AppendRequest>,
) -> std::result::Result<tonic::Response<super::AppendResponse>, 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(
"/s2.v1alpha.StreamService/Append",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("s2.v1alpha.StreamService", "Append"));
self.inner.unary(req, path, codec).await
}
pub async fn append_session(
&mut self,
request: impl tonic::IntoStreamingRequest<
Message = super::AppendSessionRequest,
>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::AppendSessionResponse>>,
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(
"/s2.v1alpha.StreamService/AppendSession",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(GrpcMethod::new("s2.v1alpha.StreamService", "AppendSession"));
self.inner.streaming(req, path, codec).await
}
pub async fn read(
&mut self,
request: impl tonic::IntoRequest<super::ReadRequest>,
) -> std::result::Result<tonic::Response<super::ReadResponse>, 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(
"/s2.v1alpha.StreamService/Read",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("s2.v1alpha.StreamService", "Read"));
self.inner.unary(req, path, codec).await
}
pub async fn read_session(
&mut self,
request: impl tonic::IntoRequest<super::ReadSessionRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ReadSessionResponse>>,
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(
"/s2.v1alpha.StreamService/ReadSession",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("s2.v1alpha.StreamService", "ReadSession"));
self.inner.server_streaming(req, path, codec).await
}
}
}
pub mod stream_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait StreamService: std::marker::Send + std::marker::Sync + 'static {
async fn check_tail(
&self,
request: tonic::Request<super::CheckTailRequest>,
) -> std::result::Result<
tonic::Response<super::CheckTailResponse>,
tonic::Status,
>;
async fn append(
&self,
request: tonic::Request<super::AppendRequest>,
) -> std::result::Result<tonic::Response<super::AppendResponse>, tonic::Status>;
type AppendSessionStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::AppendSessionResponse, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn append_session(
&self,
request: tonic::Request<tonic::Streaming<super::AppendSessionRequest>>,
) -> std::result::Result<
tonic::Response<Self::AppendSessionStream>,
tonic::Status,
>;
async fn read(
&self,
request: tonic::Request<super::ReadRequest>,
) -> std::result::Result<tonic::Response<super::ReadResponse>, tonic::Status>;
type ReadSessionStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::ReadSessionResponse, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn read_session(
&self,
request: tonic::Request<super::ReadSessionRequest>,
) -> std::result::Result<
tonic::Response<Self::ReadSessionStream>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct StreamServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> StreamServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for StreamServiceServer<T>
where
T: StreamService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/s2.v1alpha.StreamService/CheckTail" => {
#[allow(non_camel_case_types)]
struct CheckTailSvc<T: StreamService>(pub Arc<T>);
impl<
T: StreamService,
> tonic::server::UnaryService<super::CheckTailRequest>
for CheckTailSvc<T> {
type Response = super::CheckTailResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::CheckTailRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as StreamService>::check_tail(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = CheckTailSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/s2.v1alpha.StreamService/Append" => {
#[allow(non_camel_case_types)]
struct AppendSvc<T: StreamService>(pub Arc<T>);
impl<
T: StreamService,
> tonic::server::UnaryService<super::AppendRequest>
for AppendSvc<T> {
type Response = super::AppendResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AppendRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as StreamService>::append(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = AppendSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/s2.v1alpha.StreamService/AppendSession" => {
#[allow(non_camel_case_types)]
struct AppendSessionSvc<T: StreamService>(pub Arc<T>);
impl<
T: StreamService,
> tonic::server::StreamingService<super::AppendSessionRequest>
for AppendSessionSvc<T> {
type Response = super::AppendSessionResponse;
type ResponseStream = T::AppendSessionStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
tonic::Streaming<super::AppendSessionRequest>,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as StreamService>::append_session(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = AppendSessionSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/s2.v1alpha.StreamService/Read" => {
#[allow(non_camel_case_types)]
struct ReadSvc<T: StreamService>(pub Arc<T>);
impl<
T: StreamService,
> tonic::server::UnaryService<super::ReadRequest> for ReadSvc<T> {
type Response = super::ReadResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ReadRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as StreamService>::read(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ReadSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/s2.v1alpha.StreamService/ReadSession" => {
#[allow(non_camel_case_types)]
struct ReadSessionSvc<T: StreamService>(pub Arc<T>);
impl<
T: StreamService,
> tonic::server::ServerStreamingService<super::ReadSessionRequest>
for ReadSessionSvc<T> {
type Response = super::ReadSessionResponse;
type ResponseStream = T::ReadSessionStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ReadSessionRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as StreamService>::read_session(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ReadSessionSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.server_streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for StreamServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "s2.v1alpha.StreamService";
impl<T> tonic::server::NamedService for StreamServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}