// This file is @generated by prost-build. #[derive(Clone, PartialEq, ::prost::Message)] pub struct PostJournalRequest { #[prost(string, tag = "1")] pub profile_name: ::prost::alloc::string::String, /// Absent creates a new journal. Present must identify an existing journal; /// an unknown id is never treated as a request to create one. #[prost(int64, optional, tag = "2")] pub journal_id: ::core::option::Option, /// Required when creating. When appending, empty uses the journal currency; /// a supplied value must match it exactly. #[prost(string, tag = "3")] pub currency: ::prost::alloc::string::String, /// Applied when creating and required to be empty when appending. #[prost(string, tag = "4")] pub description: ::prost::alloc::string::String, /// At least one line is required. The lines are inserted atomically and the /// journal is allowed to remain unbalanced. #[prost(message, repeated, tag = "5")] pub lines: ::prost::alloc::vec::Vec, /// Required, unique within the profile, and at most 10 characters when /// creating. Must be empty when appending to an existing journal selected by /// journal_id. #[prost(string, tag = "6")] pub journal_name: ::prost::alloc::string::String, /// Accounting date in YYYY-MM-DD. Empty defaults to the current UTC date when /// creating. Must be empty when appending. Rejected when it falls at or before /// the latest closed or approved accounting boundary for the profile. #[prost(string, tag = "7")] pub accounting_date: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct JournalLineInput { #[prost(enumeration = "JournalSide", tag = "1")] pub side: i32, #[prost(string, tag = "2")] pub account_code: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub amount: ::prost::alloc::string::String, #[prost(string, tag = "4")] pub description: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CloseJournalRequest { #[prost(string, tag = "1")] pub profile_name: ::prost::alloc::string::String, #[prost(int64, tag = "2")] pub journal_id: i64, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ReopenJournalRequest { #[prost(string, tag = "1")] pub profile_name: ::prost::alloc::string::String, #[prost(int64, tag = "2")] pub journal_id: i64, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetJournalRequest { #[prost(string, tag = "1")] pub profile_name: ::prost::alloc::string::String, #[prost(int64, tag = "2")] pub journal_id: i64, /// False by default. True is reserved for a future Casbin permission granted /// only to superadmin and is rejected until that permission is implemented. #[prost(bool, tag = "3")] pub include_deleted: bool, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetAccountingStatusRequest { #[prost(string, tag = "1")] pub profile_name: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SearchJournalsRequest { #[prost(string, tag = "1")] pub profile_name: ::prost::alloc::string::String, /// Case-insensitive literal substring. Empty returns all profile journals. #[prost(string, tag = "2")] pub name_query: ::prost::alloc::string::String, /// Zero uses 50. The maximum is 500. #[prost(int32, tag = "3")] pub page_size: i32, /// Opaque cursor returned by the previous response. #[prost(string, tag = "4")] pub page_token: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct JournalSummary { #[prost(int64, tag = "1")] pub journal_id: i64, #[prost(string, tag = "2")] pub journal_name: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub currency: ::prost::alloc::string::String, #[prost(string, tag = "4")] pub description: ::prost::alloc::string::String, #[prost(string, tag = "5")] pub total_debit: ::prost::alloc::string::String, #[prost(string, tag = "6")] pub total_credit: ::prost::alloc::string::String, #[prost(string, tag = "7")] pub balance: ::prost::alloc::string::String, #[prost(int64, tag = "8")] pub active_line_count: i64, #[prost(bool, tag = "9")] pub closed: bool, #[prost(string, tag = "10")] pub created_at: ::prost::alloc::string::String, #[prost(string, tag = "11")] pub accounting_date: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct SearchJournalsResponse { #[prost(message, repeated, tag = "1")] pub journals: ::prost::alloc::vec::Vec, #[prost(int64, tag = "2")] pub total_count: i64, #[prost(string, tag = "3")] pub next_page_token: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AccountingStatus { #[prost(bool, tag = "1")] pub all_journals_balanced: bool, #[prost(int64, tag = "2")] pub journal_count: i64, #[prost(int64, tag = "3")] pub balanced_journal_count: i64, #[prost(int64, tag = "4")] pub unbalanced_journal_count: i64, #[prost(string, tag = "5")] pub calculated_at: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ListUnbalancedJournalsRequest { #[prost(string, tag = "1")] pub profile_name: ::prost::alloc::string::String, /// Zero uses 50. The maximum is 500. #[prost(int32, tag = "2")] pub page_size: i32, /// Opaque cursor returned by the previous response. Empty starts at the /// oldest unbalanced journal. #[prost(string, tag = "3")] pub page_token: ::prost::alloc::string::String, /// Optional ISO 4217 currency filter. Empty includes every currency. #[prost(string, tag = "4")] pub currency: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct UnbalancedJournalSummary { #[prost(int64, tag = "1")] pub journal_id: i64, #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub currency: ::prost::alloc::string::String, #[prost(string, tag = "4")] pub total_debit: ::prost::alloc::string::String, #[prost(string, tag = "5")] pub total_credit: ::prost::alloc::string::String, /// Signed credits-minus-debits difference. #[prost(string, tag = "6")] pub balance: ::prost::alloc::string::String, /// Side and positive amount needed to make the journal balance zero. #[prost(enumeration = "JournalSide", tag = "7")] pub missing_side: i32, #[prost(string, tag = "8")] pub missing_amount: ::prost::alloc::string::String, #[prost(int64, tag = "9")] pub active_line_count: i64, #[prost(string, tag = "10")] pub created_at: ::prost::alloc::string::String, #[prost(string, tag = "11")] pub journal_name: ::prost::alloc::string::String, #[prost(string, tag = "12")] pub accounting_date: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListUnbalancedJournalsResponse { #[prost(message, repeated, tag = "1")] pub journals: ::prost::alloc::vec::Vec, #[prost(int64, tag = "2")] pub total_unbalanced_count: i64, #[prost(string, tag = "3")] pub next_page_token: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct SoftDeleteJournalLineRequest { #[prost(string, tag = "1")] pub profile_name: ::prost::alloc::string::String, #[prost(int64, tag = "2")] pub journal_id: i64, #[prost(int64, tag = "3")] pub journal_line_id: i64, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct JournalLine { #[prost(int64, tag = "1")] pub id: i64, #[prost(int32, tag = "2")] pub line_number: i32, #[prost(enumeration = "JournalSide", tag = "3")] pub side: i32, #[prost(string, tag = "4")] pub account_code: ::prost::alloc::string::String, #[prost(string, tag = "5")] pub amount: ::prost::alloc::string::String, #[prost(string, tag = "6")] pub description: ::prost::alloc::string::String, #[prost(bool, tag = "7")] pub deleted: bool, #[prost(string, tag = "8")] pub created_at: ::prost::alloc::string::String, #[prost(string, tag = "9")] pub deleted_at: ::prost::alloc::string::String, #[prost(string, tag = "10")] pub source_table_name: ::prost::alloc::string::String, #[prost(int64, tag = "11")] pub source_record_id: i64, #[prost(int64, tag = "12")] pub source_row_revision: i64, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct Journal { #[prost(int64, tag = "1")] pub id: i64, #[prost(string, tag = "2")] pub profile_name: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub currency: ::prost::alloc::string::String, #[prost(string, tag = "4")] pub description: ::prost::alloc::string::String, #[prost(string, tag = "5")] pub created_at: ::prost::alloc::string::String, #[prost(message, repeated, tag = "6")] pub lines: ::prost::alloc::vec::Vec, #[prost(string, tag = "7")] pub total_debit: ::prost::alloc::string::String, #[prost(string, tag = "8")] pub total_credit: ::prost::alloc::string::String, /// Informational difference calculated as credits minus debits. #[prost(string, tag = "9")] pub balance: ::prost::alloc::string::String, #[prost(bool, tag = "10")] pub closed: bool, #[prost(string, tag = "11")] pub closed_at: ::prost::alloc::string::String, #[prost(string, tag = "12")] pub closed_by_user_id: ::prost::alloc::string::String, #[prost(string, tag = "13")] pub journal_name: ::prost::alloc::string::String, #[prost(string, tag = "14")] pub accounting_date: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ConfigureAccountingPeriodRequest { #[prost(string, tag = "1")] pub profile_name: ::prost::alloc::string::String, /// First day of the period, YYYY-MM-DD. Must be the first day of a month. #[prost(string, tag = "2")] pub period_start: ::prost::alloc::string::String, /// Optional link to the preceding period in a carry chain. #[prost(int64, optional, tag = "4")] pub previous_period_id: ::core::option::Option, /// Required. Decides the length of the period. #[prost(enumeration = "AccountingPeriodType", tag = "5")] pub period_type: i32, /// Last day of the period, YYYY-MM-DD. Required for PARTIAL and rejected for /// every other type, whose end follows from the start. #[prost(string, tag = "6")] pub period_end: ::prost::alloc::string::String, } #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct CloseAccountingPeriodRequest { #[prost(int64, tag = "1")] pub period_id: i64, } #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ReopenAccountingPeriodRequest { #[prost(int64, tag = "1")] pub period_id: i64, } #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ApproveAccountingPeriodRequest { #[prost(int64, tag = "1")] pub period_id: i64, } #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct GetAccountingPeriodRequest { #[prost(int64, tag = "1")] pub period_id: i64, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ListAccountingPeriodsRequest { #[prost(string, tag = "1")] pub profile_name: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListAccountingPeriodsResponse { #[prost(message, repeated, tag = "1")] pub periods: ::prost::alloc::vec::Vec, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct AccountingPeriod { #[prost(int64, tag = "1")] pub id: i64, #[prost(string, tag = "2")] pub profile_name: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub period_start: ::prost::alloc::string::String, #[prost(string, tag = "4")] pub period_end: ::prost::alloc::string::String, #[prost(enumeration = "AccountingPeriodStatus", tag = "5")] pub status: i32, #[prost(int64, tag = "6")] pub previous_period_id: i64, #[prost(string, tag = "7")] pub closed_at: ::prost::alloc::string::String, #[prost(string, tag = "8")] pub closed_by_user_id: ::prost::alloc::string::String, #[prost(string, tag = "9")] pub approved_at: ::prost::alloc::string::String, #[prost(string, tag = "10")] pub approved_by_user_id: ::prost::alloc::string::String, #[prost(enumeration = "AccountingPeriodType", tag = "11")] pub period_type: i32, } #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct ListPeriodBalancesRequest { #[prost(int64, tag = "1")] pub period_id: i64, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct PeriodBalance { #[prost(int64, tag = "1")] pub period_id: i64, #[prost(string, tag = "2")] pub account_code: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub currency: ::prost::alloc::string::String, /// Signed nets use debit-positive convention. #[prost(string, tag = "4")] pub opening_balance: ::prost::alloc::string::String, #[prost(string, tag = "5")] pub period_debit: ::prost::alloc::string::String, #[prost(string, tag = "6")] pub period_credit: ::prost::alloc::string::String, #[prost(string, tag = "7")] pub closing_balance: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListPeriodBalancesResponse { #[prost(message, repeated, tag = "1")] pub balances: ::prost::alloc::vec::Vec, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum JournalSide { Unspecified = 0, Debit = 1, Credit = 2, } impl JournalSide { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { Self::Unspecified => "JOURNAL_SIDE_UNSPECIFIED", Self::Debit => "JOURNAL_SIDE_DEBIT", Self::Credit => "JOURNAL_SIDE_CREDIT", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "JOURNAL_SIDE_UNSPECIFIED" => Some(Self::Unspecified), "JOURNAL_SIDE_DEBIT" => Some(Self::Debit), "JOURNAL_SIDE_CREDIT" => Some(Self::Credit), _ => None, } } } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum AccountingPeriodStatus { Unspecified = 0, Open = 1, Closed = 2, Approved = 3, } impl AccountingPeriodStatus { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { Self::Unspecified => "ACCOUNTING_PERIOD_STATUS_UNSPECIFIED", Self::Open => "ACCOUNTING_PERIOD_STATUS_OPEN", Self::Closed => "ACCOUNTING_PERIOD_STATUS_CLOSED", Self::Approved => "ACCOUNTING_PERIOD_STATUS_APPROVED", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "ACCOUNTING_PERIOD_STATUS_UNSPECIFIED" => Some(Self::Unspecified), "ACCOUNTING_PERIOD_STATUS_OPEN" => Some(Self::Open), "ACCOUNTING_PERIOD_STATUS_CLOSED" => Some(Self::Closed), "ACCOUNTING_PERIOD_STATUS_APPROVED" => Some(Self::Approved), _ => None, } } } /// How long one accounting period lasts. MONTH and YEAR span whole months, so /// the caller states only the start and the end is derived. PARTIAL is the /// exception for periods real life cut short. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum AccountingPeriodType { Unspecified = 0, /// One calendar month. Month = 1, /// Twelve consecutive months. Starting in January gives the calendar year; /// any other start month gives a business year (hospodársky rok). Year = 2, /// Neither a whole month nor a whole year, because the entity was formed or /// terminated part-way through one. The only type carrying an explicit end. Partial = 3, } impl AccountingPeriodType { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { Self::Unspecified => "ACCOUNTING_PERIOD_TYPE_UNSPECIFIED", Self::Month => "ACCOUNTING_PERIOD_TYPE_MONTH", Self::Year => "ACCOUNTING_PERIOD_TYPE_YEAR", Self::Partial => "ACCOUNTING_PERIOD_TYPE_PARTIAL", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "ACCOUNTING_PERIOD_TYPE_UNSPECIFIED" => Some(Self::Unspecified), "ACCOUNTING_PERIOD_TYPE_MONTH" => Some(Self::Month), "ACCOUNTING_PERIOD_TYPE_YEAR" => Some(Self::Year), "ACCOUNTING_PERIOD_TYPE_PARTIAL" => Some(Self::Partial), _ => None, } } } /// Generated client implementations. pub mod accounting_client { #![allow( unused_variables, dead_code, missing_docs, clippy::wildcard_imports, clippy::let_unit_value, )] use tonic::codegen::*; use tonic::codegen::http::Uri; /// Mutable informational journals. A journal may contain only debits, only /// credits, or any non-zero balance. Balance is reported but never enforced. /// Accounting periods close date ranges inside a profile and freeze account sums /// without replacing the live accounts projection. Closed periods can be reopened; /// approved periods are final. #[derive(Debug, Clone)] pub struct AccountingClient { inner: tonic::client::Grpc, } impl AccountingClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where D: TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; Ok(Self::new(conn)) } } impl AccountingClient where T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + std::marker::Send + 'static, ::Error: Into + 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( inner: T, interceptor: F, ) -> AccountingClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, , >>::Error: Into + std::marker::Send + std::marker::Sync, { AccountingClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// /// This requires the server to support it otherwise it might respond with an /// error. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.send_compressed(encoding); self } /// Enable decompressing responses. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.accept_compressed(encoding); self } /// Limits the maximum size of a decoded message. /// /// Default: `4MB` #[must_use] pub fn max_decoding_message_size(mut self, limit: usize) -> Self { self.inner = self.inner.max_decoding_message_size(limit); self } /// Limits the maximum size of an encoded message. /// /// Default: `usize::MAX` #[must_use] pub fn max_encoding_message_size(mut self, limit: usize) -> Self { self.inner = self.inner.max_encoding_message_size(limit); self } /// Create a journal with its first lines when journal_id is absent, or append /// all supplied lines atomically when journal_id identifies an existing one. pub async fn post_journal( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, 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( "/komp_ac.accounting.Accounting/PostJournal", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("komp_ac.accounting.Accounting", "PostJournal")); self.inner.unary(req, path, codec).await } /// Close a balanced journal. Closed journals can be reopened while their /// accounting period is open. pub async fn close_journal( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, 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( "/komp_ac.accounting.Accounting/CloseJournal", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new("komp_ac.accounting.Accounting", "CloseJournal"), ); self.inner.unary(req, path, codec).await } pub async fn reopen_journal( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, 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( "/komp_ac.accounting.Accounting/ReopenJournal", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new("komp_ac.accounting.Accounting", "ReopenJournal"), ); self.inner.unary(req, path, codec).await } /// Return journal lines and credits-minus-debits informational balance. pub async fn get_journal( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, 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( "/komp_ac.accounting.Accounting/GetJournal", ); let mut req = request.into_request(); req.extensions_mut() .insert(GrpcMethod::new("komp_ac.accounting.Accounting", "GetJournal")); self.inner.unary(req, path, codec).await } /// Search profile journals by user-facing name while retaining journal ids /// as the stable relationship keys. pub async fn search_journals( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, 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( "/komp_ac.accounting.Accounting/SearchJournals", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new("komp_ac.accounting.Accounting", "SearchJournals"), ); self.inner.unary(req, path, codec).await } /// Return the profile-wide count of balanced and unbalanced journals. pub async fn get_accounting_status( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, 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( "/komp_ac.accounting.Accounting/GetAccountingStatus", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( "komp_ac.accounting.Accounting", "GetAccountingStatus", ), ); self.inner.unary(req, path, codec).await } /// Return an oldest-first, paginated queue of unbalanced journals. pub async fn list_unbalanced_journals( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, 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( "/komp_ac.accounting.Accounting/ListUnbalancedJournals", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( "komp_ac.accounting.Accounting", "ListUnbalancedJournals", ), ); self.inner.unary(req, path, codec).await } /// Soft-delete one line while retaining it for audit display. pub async fn soft_delete_journal_line( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result, 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( "/komp_ac.accounting.Accounting/SoftDeleteJournalLine", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( "komp_ac.accounting.Accounting", "SoftDeleteJournalLine", ), ); self.inner.unary(req, path, codec).await } /// Create an open accounting period for a profile. Periods may be any length /// (month, half-year, year). Overlapping ranges for the same profile are rejected. pub async fn configure_accounting_period( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, 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( "/komp_ac.accounting.Accounting/ConfigureAccountingPeriod", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( "komp_ac.accounting.Accounting", "ConfigureAccountingPeriod", ), ); self.inner.unary(req, path, codec).await } /// Closing snapshots balances and blocks mutations through the period end. /// A closed period may be reopened; approval makes it final. pub async fn close_accounting_period( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, 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( "/komp_ac.accounting.Accounting/CloseAccountingPeriod", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( "komp_ac.accounting.Accounting", "CloseAccountingPeriod", ), ); self.inner.unary(req, path, codec).await } pub async fn reopen_accounting_period( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, 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( "/komp_ac.accounting.Accounting/ReopenAccountingPeriod", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( "komp_ac.accounting.Accounting", "ReopenAccountingPeriod", ), ); self.inner.unary(req, path, codec).await } pub async fn approve_accounting_period( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, 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( "/komp_ac.accounting.Accounting/ApproveAccountingPeriod", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( "komp_ac.accounting.Accounting", "ApproveAccountingPeriod", ), ); self.inner.unary(req, path, codec).await } pub async fn get_accounting_period( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, 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( "/komp_ac.accounting.Accounting/GetAccountingPeriod", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( "komp_ac.accounting.Accounting", "GetAccountingPeriod", ), ); self.inner.unary(req, path, codec).await } pub async fn list_accounting_periods( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, 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( "/komp_ac.accounting.Accounting/ListAccountingPeriods", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( "komp_ac.accounting.Accounting", "ListAccountingPeriods", ), ); self.inner.unary(req, path, codec).await } pub async fn list_period_balances( &mut self, request: impl tonic::IntoRequest, ) -> std::result::Result< tonic::Response, 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( "/komp_ac.accounting.Accounting/ListPeriodBalances", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( "komp_ac.accounting.Accounting", "ListPeriodBalances", ), ); self.inner.unary(req, path, codec).await } } } /// Generated server implementations. pub mod accounting_server { #![allow( unused_variables, dead_code, missing_docs, clippy::wildcard_imports, clippy::let_unit_value, )] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with AccountingServer. #[async_trait] pub trait Accounting: std::marker::Send + std::marker::Sync + 'static { /// Create a journal with its first lines when journal_id is absent, or append /// all supplied lines atomically when journal_id identifies an existing one. async fn post_journal( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; /// Close a balanced journal. Closed journals can be reopened while their /// accounting period is open. async fn close_journal( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; async fn reopen_journal( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; /// Return journal lines and credits-minus-debits informational balance. async fn get_journal( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; /// Search profile journals by user-facing name while retaining journal ids /// as the stable relationship keys. async fn search_journals( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; /// Return the profile-wide count of balanced and unbalanced journals. async fn get_accounting_status( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; /// Return an oldest-first, paginated queue of unbalanced journals. async fn list_unbalanced_journals( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; /// Soft-delete one line while retaining it for audit display. async fn soft_delete_journal_line( &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; /// Create an open accounting period for a profile. Periods may be any length /// (month, half-year, year). Overlapping ranges for the same profile are rejected. async fn configure_accounting_period( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; /// Closing snapshots balances and blocks mutations through the period end. /// A closed period may be reopened; approval makes it final. async fn close_accounting_period( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; async fn reopen_accounting_period( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; async fn approve_accounting_period( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; async fn get_accounting_period( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; async fn list_accounting_periods( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; async fn list_period_balances( &self, request: tonic::Request, ) -> std::result::Result< tonic::Response, tonic::Status, >; } /// Mutable informational journals. A journal may contain only debits, only /// credits, or any non-zero balance. Balance is reported but never enforced. /// Accounting periods close date ranges inside a profile and freeze account sums /// without replacing the live accounts projection. Closed periods can be reopened; /// approved periods are final. #[derive(Debug)] pub struct AccountingServer { inner: Arc, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } impl AccountingServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> 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( inner: T, interceptor: F, ) -> InterceptedService where F: tonic::service::Interceptor, { InterceptedService::new(Self::new(inner), interceptor) } /// Enable decompressing requests with the given encoding. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.accept_compression_encodings.enable(encoding); self } /// Compress responses with the given encoding, if the client supports it. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.send_compression_encodings.enable(encoding); self } /// Limits the maximum size of a decoded message. /// /// Default: `4MB` #[must_use] pub fn max_decoding_message_size(mut self, limit: usize) -> Self { self.max_decoding_message_size = Some(limit); self } /// Limits the maximum size of an encoded message. /// /// Default: `usize::MAX` #[must_use] pub fn max_encoding_message_size(mut self, limit: usize) -> Self { self.max_encoding_message_size = Some(limit); self } } impl tonic::codegen::Service> for AccountingServer where T: Accounting, B: Body + std::marker::Send + 'static, B::Error: Into + std::marker::Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( &mut self, _cx: &mut Context<'_>, ) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { match req.uri().path() { "/komp_ac.accounting.Accounting/PostJournal" => { #[allow(non_camel_case_types)] struct PostJournalSvc(pub Arc); impl< T: Accounting, > tonic::server::UnaryService for PostJournalSvc { type Response = super::Journal; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::post_journal(&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 = PostJournalSvc(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) } "/komp_ac.accounting.Accounting/CloseJournal" => { #[allow(non_camel_case_types)] struct CloseJournalSvc(pub Arc); impl< T: Accounting, > tonic::server::UnaryService for CloseJournalSvc { type Response = super::Journal; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::close_journal(&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 = CloseJournalSvc(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) } "/komp_ac.accounting.Accounting/ReopenJournal" => { #[allow(non_camel_case_types)] struct ReopenJournalSvc(pub Arc); impl< T: Accounting, > tonic::server::UnaryService for ReopenJournalSvc { type Response = super::Journal; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::reopen_journal(&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 = ReopenJournalSvc(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) } "/komp_ac.accounting.Accounting/GetJournal" => { #[allow(non_camel_case_types)] struct GetJournalSvc(pub Arc); impl< T: Accounting, > tonic::server::UnaryService for GetJournalSvc { type Response = super::Journal; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::get_journal(&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 = GetJournalSvc(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) } "/komp_ac.accounting.Accounting/SearchJournals" => { #[allow(non_camel_case_types)] struct SearchJournalsSvc(pub Arc); impl< T: Accounting, > tonic::server::UnaryService for SearchJournalsSvc { type Response = super::SearchJournalsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::search_journals(&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 = SearchJournalsSvc(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) } "/komp_ac.accounting.Accounting/GetAccountingStatus" => { #[allow(non_camel_case_types)] struct GetAccountingStatusSvc(pub Arc); impl< T: Accounting, > tonic::server::UnaryService for GetAccountingStatusSvc { type Response = super::AccountingStatus; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::get_accounting_status(&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 = GetAccountingStatusSvc(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) } "/komp_ac.accounting.Accounting/ListUnbalancedJournals" => { #[allow(non_camel_case_types)] struct ListUnbalancedJournalsSvc(pub Arc); impl< T: Accounting, > tonic::server::UnaryService for ListUnbalancedJournalsSvc { type Response = super::ListUnbalancedJournalsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::list_unbalanced_journals(&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 = ListUnbalancedJournalsSvc(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) } "/komp_ac.accounting.Accounting/SoftDeleteJournalLine" => { #[allow(non_camel_case_types)] struct SoftDeleteJournalLineSvc(pub Arc); impl< T: Accounting, > tonic::server::UnaryService for SoftDeleteJournalLineSvc { type Response = super::Journal; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::soft_delete_journal_line(&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 = SoftDeleteJournalLineSvc(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) } "/komp_ac.accounting.Accounting/ConfigureAccountingPeriod" => { #[allow(non_camel_case_types)] struct ConfigureAccountingPeriodSvc(pub Arc); impl< T: Accounting, > tonic::server::UnaryService< super::ConfigureAccountingPeriodRequest, > for ConfigureAccountingPeriodSvc { type Response = super::AccountingPeriod; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request< super::ConfigureAccountingPeriodRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::configure_accounting_period( &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 = ConfigureAccountingPeriodSvc(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) } "/komp_ac.accounting.Accounting/CloseAccountingPeriod" => { #[allow(non_camel_case_types)] struct CloseAccountingPeriodSvc(pub Arc); impl< T: Accounting, > tonic::server::UnaryService for CloseAccountingPeriodSvc { type Response = super::AccountingPeriod; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::close_accounting_period(&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 = CloseAccountingPeriodSvc(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) } "/komp_ac.accounting.Accounting/ReopenAccountingPeriod" => { #[allow(non_camel_case_types)] struct ReopenAccountingPeriodSvc(pub Arc); impl< T: Accounting, > tonic::server::UnaryService for ReopenAccountingPeriodSvc { type Response = super::AccountingPeriod; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::reopen_accounting_period(&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 = ReopenAccountingPeriodSvc(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) } "/komp_ac.accounting.Accounting/ApproveAccountingPeriod" => { #[allow(non_camel_case_types)] struct ApproveAccountingPeriodSvc(pub Arc); impl< T: Accounting, > tonic::server::UnaryService for ApproveAccountingPeriodSvc { type Response = super::AccountingPeriod; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request< super::ApproveAccountingPeriodRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::approve_accounting_period( &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 = ApproveAccountingPeriodSvc(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) } "/komp_ac.accounting.Accounting/GetAccountingPeriod" => { #[allow(non_camel_case_types)] struct GetAccountingPeriodSvc(pub Arc); impl< T: Accounting, > tonic::server::UnaryService for GetAccountingPeriodSvc { type Response = super::AccountingPeriod; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::get_accounting_period(&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 = GetAccountingPeriodSvc(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) } "/komp_ac.accounting.Accounting/ListAccountingPeriods" => { #[allow(non_camel_case_types)] struct ListAccountingPeriodsSvc(pub Arc); impl< T: Accounting, > tonic::server::UnaryService for ListAccountingPeriodsSvc { type Response = super::ListAccountingPeriodsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::list_accounting_periods(&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 = ListAccountingPeriodsSvc(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) } "/komp_ac.accounting.Accounting/ListPeriodBalances" => { #[allow(non_camel_case_types)] struct ListPeriodBalancesSvc(pub Arc); impl< T: Accounting, > tonic::server::UnaryService for ListPeriodBalancesSvc { type Response = super::ListPeriodBalancesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { ::list_period_balances(&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 = ListPeriodBalancesSvc(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 Clone for AccountingServer { 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, } } } /// Generated gRPC service name pub const SERVICE_NAME: &str = "komp_ac.accounting.Accounting"; impl tonic::server::NamedService for AccountingServer { const NAME: &'static str = SERVICE_NAME; } }