use serde_json::Value;
use crate::api::OperationRequest;
use crate::api::operations::{
BankAccountsOperation, CustomersOperation, EstimatesOperation, ExpensesOperation,
FilesOperation, InboxOperation, InvoicesOperation, LabelsOperation, LedgerAccountsOperation,
LoonjournaalpostenOperation, OrganizationsOperation, ProjectsOperation, ReportsOperation,
TradenamesOperation, TypedOperation, V2Operation,
};
use crate::client::JorttClient;
use crate::error::JorttError;
#[derive(Clone)]
pub struct ApiMethods {
client: JorttClient,
}
impl ApiMethods {
pub(crate) fn new(client: JorttClient) -> Self {
Self { client }
}
pub fn bank_accounts(&self) -> BankAccountsMethods {
BankAccountsMethods::new(self.client.clone())
}
pub fn customers(&self) -> CustomersMethods {
CustomersMethods::new(self.client.clone())
}
pub fn estimates(&self) -> EstimatesMethods {
EstimatesMethods::new(self.client.clone())
}
pub fn expenses(&self) -> ExpensesMethods {
ExpensesMethods::new(self.client.clone())
}
pub fn files(&self) -> FilesMethods {
FilesMethods::new(self.client.clone())
}
pub fn inbox(&self) -> InboxMethods {
InboxMethods::new(self.client.clone())
}
pub fn invoices(&self) -> InvoicesMethods {
InvoicesMethods::new(self.client.clone())
}
pub fn labels(&self) -> LabelsMethods {
LabelsMethods::new(self.client.clone())
}
pub fn ledger_accounts(&self) -> LedgerAccountsMethods {
LedgerAccountsMethods::new(self.client.clone())
}
pub fn loonjournaalposten(&self) -> LoonjournaalpostenMethods {
LoonjournaalpostenMethods::new(self.client.clone())
}
pub fn organizations(&self) -> OrganizationsMethods {
OrganizationsMethods::new(self.client.clone())
}
pub fn projects(&self) -> ProjectsMethods {
ProjectsMethods::new(self.client.clone())
}
pub fn reports(&self) -> ReportsMethods {
ReportsMethods::new(self.client.clone())
}
pub fn tradenames(&self) -> TradenamesMethods {
TradenamesMethods::new(self.client.clone())
}
pub fn v2(&self) -> V2Methods {
V2Methods::new(self.client.clone())
}
}
#[derive(Clone)]
pub struct BankAccountsMethods {
client: JorttClient,
}
impl BankAccountsMethods {
pub(crate) fn new(client: JorttClient) -> Self {
Self { client }
}
pub async fn get_v3_bank_accounts(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(BankAccountsOperation::GetV3BankAccounts.spec(), request)
.await
}
pub async fn get_v3_bank_accounts_by_id_bank_transactions(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
BankAccountsOperation::GetV3BankAccountsByIdBankTransactions.spec(),
request,
)
.await
}
}
#[derive(Clone)]
pub struct CustomersMethods {
client: JorttClient,
}
impl CustomersMethods {
pub(crate) fn new(client: JorttClient) -> Self {
Self { client }
}
pub async fn get_customers(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(CustomersOperation::GetCustomers.spec(), request)
.await
}
pub async fn post_customers(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(CustomersOperation::PostCustomers.spec(), request)
.await
}
pub async fn delete_customers_by_customer_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
CustomersOperation::DeleteCustomersByCustomerId.spec(),
request,
)
.await
}
pub async fn get_customers_by_customer_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(CustomersOperation::GetCustomersByCustomerId.spec(), request)
.await
}
pub async fn put_customers_by_customer_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(CustomersOperation::PutCustomersByCustomerId.spec(), request)
.await
}
pub async fn post_customers_by_customer_id_direct_debit_mandate(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
CustomersOperation::PostCustomersByCustomerIdDirectDebitMandate.spec(),
request,
)
.await
}
pub async fn get_customers_by_customer_id_extra_details(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
CustomersOperation::GetCustomersByCustomerIdExtraDetails.spec(),
request,
)
.await
}
pub async fn put_customers_by_customer_id_set_archived(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
CustomersOperation::PutCustomersByCustomerIdSetArchived.spec(),
request,
)
.await
}
pub async fn get_customers_by_customer_id_vat_percentages(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
CustomersOperation::GetCustomersByCustomerIdVatPercentages.spec(),
request,
)
.await
}
pub async fn get_v1_customers(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(CustomersOperation::GetV1Customers.spec(), request)
.await
}
pub async fn post_v1_customers(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(CustomersOperation::PostV1Customers.spec(), request)
.await
}
pub async fn delete_v1_customers_by_customer_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
CustomersOperation::DeleteV1CustomersByCustomerId.spec(),
request,
)
.await
}
pub async fn get_v1_customers_by_customer_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
CustomersOperation::GetV1CustomersByCustomerId.spec(),
request,
)
.await
}
pub async fn put_v1_customers_by_customer_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
CustomersOperation::PutV1CustomersByCustomerId.spec(),
request,
)
.await
}
pub async fn post_v1_customers_by_customer_id_direct_debit_mandate(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
CustomersOperation::PostV1CustomersByCustomerIdDirectDebitMandate.spec(),
request,
)
.await
}
pub async fn get_v1_customers_by_customer_id_extra_details(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
CustomersOperation::GetV1CustomersByCustomerIdExtraDetails.spec(),
request,
)
.await
}
pub async fn put_v1_customers_by_customer_id_set_archived(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
CustomersOperation::PutV1CustomersByCustomerIdSetArchived.spec(),
request,
)
.await
}
pub async fn get_v1_customers_by_customer_id_vat_percentages(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
CustomersOperation::GetV1CustomersByCustomerIdVatPercentages.spec(),
request,
)
.await
}
pub async fn get_v2_customers_by_customer_id_vat_percentages(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
CustomersOperation::GetV2CustomersByCustomerIdVatPercentages.spec(),
request,
)
.await
}
}
#[derive(Clone)]
pub struct EstimatesMethods {
client: JorttClient,
}
impl EstimatesMethods {
pub(crate) fn new(client: JorttClient) -> Self {
Self { client }
}
pub async fn post_v2_estimates(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(EstimatesOperation::PostV2Estimates.spec(), request)
.await
}
pub async fn put_v2_estimates_by_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(EstimatesOperation::PutV2EstimatesById.spec(), request)
.await
}
pub async fn post_v2_estimates_by_id_send(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(EstimatesOperation::PostV2EstimatesByIdSend.spec(), request)
.await
}
}
#[derive(Clone)]
pub struct ExpensesMethods {
client: JorttClient,
}
impl ExpensesMethods {
pub(crate) fn new(client: JorttClient) -> Self {
Self { client }
}
pub async fn get_v3_expenses(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(ExpensesOperation::GetV3Expenses.spec(), request)
.await
}
pub async fn post_v3_expenses(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(ExpensesOperation::PostV3Expenses.spec(), request)
.await
}
pub async fn get_v3_expenses_id_by_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(ExpensesOperation::GetV3ExpensesIdById.spec(), request)
.await
}
pub async fn post_v3_expenses_id_by_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(ExpensesOperation::PostV3ExpensesIdById.spec(), request)
.await
}
pub async fn post_v3_expenses_id_by_id_receipt(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ExpensesOperation::PostV3ExpensesIdByIdReceipt.spec(),
request,
)
.await
}
}
#[derive(Clone)]
pub struct FilesMethods {
client: JorttClient,
}
impl FilesMethods {
pub(crate) fn new(client: JorttClient) -> Self {
Self { client }
}
pub async fn get_files_put_url(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(FilesOperation::GetFilesPutUrl.spec(), request)
.await
}
pub async fn get_v1_files_put_url(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(FilesOperation::GetV1FilesPutUrl.spec(), request)
.await
}
}
#[derive(Clone)]
pub struct InboxMethods {
client: JorttClient,
}
impl InboxMethods {
pub(crate) fn new(client: JorttClient) -> Self {
Self { client }
}
pub async fn post_inbox_images(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(InboxOperation::PostInboxImages.spec(), request)
.await
}
pub async fn post_v1_inbox_images(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(InboxOperation::PostV1InboxImages.spec(), request)
.await
}
}
#[derive(Clone)]
pub struct InvoicesMethods {
client: JorttClient,
}
impl InvoicesMethods {
pub(crate) fn new(client: JorttClient) -> Self {
Self { client }
}
pub async fn get_invoices(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::GetInvoices.spec(), request)
.await
}
pub async fn post_invoices(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::PostInvoices.spec(), request)
.await
}
pub async fn delete_invoices_by_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::DeleteInvoicesById.spec(), request)
.await
}
pub async fn get_invoices_by_id(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::GetInvoicesById.spec(), request)
.await
}
pub async fn put_invoices_by_id(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::PutInvoicesById.spec(), request)
.await
}
pub async fn post_invoices_by_id_copy(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::PostInvoicesByIdCopy.spec(), request)
.await
}
pub async fn post_invoices_by_id_credit(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::PostInvoicesByIdCredit.spec(), request)
.await
}
pub async fn get_invoices_by_id_download(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::GetInvoicesByIdDownload.spec(), request)
.await
}
pub async fn get_invoices_by_id_line_item_suggestions(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
InvoicesOperation::GetInvoicesByIdLineItemSuggestions.spec(),
request,
)
.await
}
pub async fn get_invoices_by_id_next_possible_invoice_number(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
InvoicesOperation::GetInvoicesByIdNextPossibleInvoiceNumber.spec(),
request,
)
.await
}
pub async fn post_invoices_by_id_send(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::PostInvoicesByIdSend.spec(), request)
.await
}
pub async fn get_invoices_by_id_send_settings(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
InvoicesOperation::GetInvoicesByIdSendSettings.spec(),
request,
)
.await
}
pub async fn put_invoices_by_id_set_labels(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::PutInvoicesByIdSetLabels.spec(), request)
.await
}
pub async fn get_v1_invoices(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::GetV1Invoices.spec(), request)
.await
}
pub async fn post_v1_invoices(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::PostV1Invoices.spec(), request)
.await
}
pub async fn delete_v1_invoices_by_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::DeleteV1InvoicesById.spec(), request)
.await
}
pub async fn get_v1_invoices_by_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::GetV1InvoicesById.spec(), request)
.await
}
pub async fn put_v1_invoices_by_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::PutV1InvoicesById.spec(), request)
.await
}
pub async fn post_v1_invoices_by_id_copy(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::PostV1InvoicesByIdCopy.spec(), request)
.await
}
pub async fn post_v1_invoices_by_id_credit(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::PostV1InvoicesByIdCredit.spec(), request)
.await
}
pub async fn get_v1_invoices_by_id_download(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::GetV1InvoicesByIdDownload.spec(), request)
.await
}
pub async fn get_v1_invoices_by_id_line_item_suggestions(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
InvoicesOperation::GetV1InvoicesByIdLineItemSuggestions.spec(),
request,
)
.await
}
pub async fn get_v1_invoices_by_id_next_possible_invoice_number(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
InvoicesOperation::GetV1InvoicesByIdNextPossibleInvoiceNumber.spec(),
request,
)
.await
}
pub async fn post_v1_invoices_by_id_send(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::PostV1InvoicesByIdSend.spec(), request)
.await
}
pub async fn get_v1_invoices_by_id_send_settings(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
InvoicesOperation::GetV1InvoicesByIdSendSettings.spec(),
request,
)
.await
}
pub async fn put_v1_invoices_by_id_set_labels(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
InvoicesOperation::PutV1InvoicesByIdSetLabels.spec(),
request,
)
.await
}
pub async fn post_v2_invoices(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::PostV2Invoices.spec(), request)
.await
}
pub async fn put_v2_invoices_by_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::PutV2InvoicesById.spec(), request)
.await
}
pub async fn get_v2_invoices_by_id_line_item_suggestions(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
InvoicesOperation::GetV2InvoicesByIdLineItemSuggestions.spec(),
request,
)
.await
}
pub async fn get_v2_invoices_peppol_scheme_catalog(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
InvoicesOperation::GetV2InvoicesPeppolSchemeCatalog.spec(),
request,
)
.await
}
pub async fn post_v3_invoices(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(InvoicesOperation::PostV3Invoices.spec(), request)
.await
}
}
#[derive(Clone)]
pub struct LabelsMethods {
client: JorttClient,
}
impl LabelsMethods {
pub(crate) fn new(client: JorttClient) -> Self {
Self { client }
}
pub async fn get_labels(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(LabelsOperation::GetLabels.spec(), request)
.await
}
pub async fn post_labels(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(LabelsOperation::PostLabels.spec(), request)
.await
}
pub async fn get_v1_labels(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(LabelsOperation::GetV1Labels.spec(), request)
.await
}
pub async fn post_v1_labels(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(LabelsOperation::PostV1Labels.spec(), request)
.await
}
}
#[derive(Clone)]
pub struct LedgerAccountsMethods {
client: JorttClient,
}
impl LedgerAccountsMethods {
pub(crate) fn new(client: JorttClient) -> Self {
Self { client }
}
pub async fn get_ledger_accounts_invoices(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
LedgerAccountsOperation::GetLedgerAccountsInvoices.spec(),
request,
)
.await
}
pub async fn get_ledger_accounts_invoices_default(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
LedgerAccountsOperation::GetLedgerAccountsInvoicesDefault.spec(),
request,
)
.await
}
pub async fn get_v1_ledger_accounts_invoices(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
LedgerAccountsOperation::GetV1LedgerAccountsInvoices.spec(),
request,
)
.await
}
pub async fn get_v1_ledger_accounts_invoices_default(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
LedgerAccountsOperation::GetV1LedgerAccountsInvoicesDefault.spec(),
request,
)
.await
}
pub async fn get_v3_ledger_accounts_expenses_balance(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
LedgerAccountsOperation::GetV3LedgerAccountsExpensesBalance.spec(),
request,
)
.await
}
pub async fn get_v3_ledger_accounts_expenses_cost(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
LedgerAccountsOperation::GetV3LedgerAccountsExpensesCost.spec(),
request,
)
.await
}
pub async fn get_v3_ledger_accounts_expenses_income(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
LedgerAccountsOperation::GetV3LedgerAccountsExpensesIncome.spec(),
request,
)
.await
}
}
#[derive(Clone)]
pub struct LoonjournaalpostenMethods {
client: JorttClient,
}
impl LoonjournaalpostenMethods {
pub(crate) fn new(client: JorttClient) -> Self {
Self { client }
}
pub async fn get_loonjournaalposten(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
LoonjournaalpostenOperation::GetLoonjournaalposten.spec(),
request,
)
.await
}
pub async fn post_loonjournaalposten(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
LoonjournaalpostenOperation::PostLoonjournaalposten.spec(),
request,
)
.await
}
pub async fn delete_loonjournaalposten_by_loonjournaalpost_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
LoonjournaalpostenOperation::DeleteLoonjournaalpostenByLoonjournaalpostId.spec(),
request,
)
.await
}
pub async fn put_loonjournaalposten_by_loonjournaalpost_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
LoonjournaalpostenOperation::PutLoonjournaalpostenByLoonjournaalpostId.spec(),
request,
)
.await
}
pub async fn get_v1_loonjournaalposten(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
LoonjournaalpostenOperation::GetV1Loonjournaalposten.spec(),
request,
)
.await
}
pub async fn post_v1_loonjournaalposten(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
LoonjournaalpostenOperation::PostV1Loonjournaalposten.spec(),
request,
)
.await
}
pub async fn delete_v1_loonjournaalposten_by_loonjournaalpost_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
LoonjournaalpostenOperation::DeleteV1LoonjournaalpostenByLoonjournaalpostId.spec(),
request,
)
.await
}
pub async fn put_v1_loonjournaalposten_by_loonjournaalpost_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
LoonjournaalpostenOperation::PutV1LoonjournaalpostenByLoonjournaalpostId.spec(),
request,
)
.await
}
}
#[derive(Clone)]
pub struct OrganizationsMethods {
client: JorttClient,
}
impl OrganizationsMethods {
pub(crate) fn new(client: JorttClient) -> Self {
Self { client }
}
pub async fn get_organizations_me(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(OrganizationsOperation::GetOrganizationsMe.spec(), request)
.await
}
pub async fn get_v1_organizations_me(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(OrganizationsOperation::GetV1OrganizationsMe.spec(), request)
.await
}
}
#[derive(Clone)]
pub struct ProjectsMethods {
client: JorttClient,
}
impl ProjectsMethods {
pub(crate) fn new(client: JorttClient) -> Self {
Self { client }
}
pub async fn get_projects(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(ProjectsOperation::GetProjects.spec(), request)
.await
}
pub async fn post_projects(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(ProjectsOperation::PostProjects.spec(), request)
.await
}
pub async fn delete_projects_by_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(ProjectsOperation::DeleteProjectsById.spec(), request)
.await
}
pub async fn get_projects_by_id(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(ProjectsOperation::GetProjectsById.spec(), request)
.await
}
pub async fn put_projects_by_id(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(ProjectsOperation::PutProjectsById.spec(), request)
.await
}
pub async fn post_projects_by_id_invoice(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(ProjectsOperation::PostProjectsByIdInvoice.spec(), request)
.await
}
pub async fn get_projects_by_id_line_items(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(ProjectsOperation::GetProjectsByIdLineItems.spec(), request)
.await
}
pub async fn post_projects_by_id_line_items(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(ProjectsOperation::PostProjectsByIdLineItems.spec(), request)
.await
}
pub async fn delete_projects_by_id_line_items_by_line_item_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ProjectsOperation::DeleteProjectsByIdLineItemsByLineItemId.spec(),
request,
)
.await
}
pub async fn get_projects_by_id_line_items_by_line_item_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ProjectsOperation::GetProjectsByIdLineItemsByLineItemId.spec(),
request,
)
.await
}
pub async fn put_projects_by_id_line_items_by_line_item_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ProjectsOperation::PutProjectsByIdLineItemsByLineItemId.spec(),
request,
)
.await
}
pub async fn get_projects_by_id_line_items_summary(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ProjectsOperation::GetProjectsByIdLineItemsSummary.spec(),
request,
)
.await
}
pub async fn get_v1_projects(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(ProjectsOperation::GetV1Projects.spec(), request)
.await
}
pub async fn post_v1_projects(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(ProjectsOperation::PostV1Projects.spec(), request)
.await
}
pub async fn delete_v1_projects_by_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(ProjectsOperation::DeleteV1ProjectsById.spec(), request)
.await
}
pub async fn get_v1_projects_by_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(ProjectsOperation::GetV1ProjectsById.spec(), request)
.await
}
pub async fn put_v1_projects_by_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(ProjectsOperation::PutV1ProjectsById.spec(), request)
.await
}
pub async fn post_v1_projects_by_id_invoice(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(ProjectsOperation::PostV1ProjectsByIdInvoice.spec(), request)
.await
}
pub async fn get_v1_projects_by_id_line_items(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ProjectsOperation::GetV1ProjectsByIdLineItems.spec(),
request,
)
.await
}
pub async fn post_v1_projects_by_id_line_items(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ProjectsOperation::PostV1ProjectsByIdLineItems.spec(),
request,
)
.await
}
pub async fn delete_v1_projects_by_id_line_items_by_line_item_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ProjectsOperation::DeleteV1ProjectsByIdLineItemsByLineItemId.spec(),
request,
)
.await
}
pub async fn get_v1_projects_by_id_line_items_by_line_item_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ProjectsOperation::GetV1ProjectsByIdLineItemsByLineItemId.spec(),
request,
)
.await
}
pub async fn put_v1_projects_by_id_line_items_by_line_item_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ProjectsOperation::PutV1ProjectsByIdLineItemsByLineItemId.spec(),
request,
)
.await
}
pub async fn get_v1_projects_by_id_line_items_summary(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ProjectsOperation::GetV1ProjectsByIdLineItemsSummary.spec(),
request,
)
.await
}
}
#[derive(Clone)]
pub struct ReportsMethods {
client: JorttClient,
}
impl ReportsMethods {
pub(crate) fn new(client: JorttClient) -> Self {
Self { client }
}
pub async fn get_reports_summaries_balance(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(ReportsOperation::GetReportsSummariesBalance.spec(), request)
.await
}
pub async fn get_reports_summaries_btw(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(ReportsOperation::GetReportsSummariesBtw.spec(), request)
.await
}
pub async fn get_reports_summaries_cash_and_bank(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ReportsOperation::GetReportsSummariesCashAndBank.spec(),
request,
)
.await
}
pub async fn get_reports_summaries_invoices(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ReportsOperation::GetReportsSummariesInvoices.spec(),
request,
)
.await
}
pub async fn get_reports_summaries_profit_and_loss(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ReportsOperation::GetReportsSummariesProfitAndLoss.spec(),
request,
)
.await
}
pub async fn get_v1_reports_summaries_balance(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ReportsOperation::GetV1ReportsSummariesBalance.spec(),
request,
)
.await
}
pub async fn get_v1_reports_summaries_btw(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(ReportsOperation::GetV1ReportsSummariesBtw.spec(), request)
.await
}
pub async fn get_v1_reports_summaries_cash_and_bank(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ReportsOperation::GetV1ReportsSummariesCashAndBank.spec(),
request,
)
.await
}
pub async fn get_v1_reports_summaries_invoices(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ReportsOperation::GetV1ReportsSummariesInvoices.spec(),
request,
)
.await
}
pub async fn get_v1_reports_summaries_profit_and_loss(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(
ReportsOperation::GetV1ReportsSummariesProfitAndLoss.spec(),
request,
)
.await
}
}
#[derive(Clone)]
pub struct TradenamesMethods {
client: JorttClient,
}
impl TradenamesMethods {
pub(crate) fn new(client: JorttClient) -> Self {
Self { client }
}
pub async fn get_tradenames(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(TradenamesOperation::GetTradenames.spec(), request)
.await
}
pub async fn get_v1_tradenames(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(TradenamesOperation::GetV1Tradenames.spec(), request)
.await
}
}
#[derive(Clone)]
pub struct V2Methods {
client: JorttClient,
}
impl V2Methods {
pub(crate) fn new(client: JorttClient) -> Self {
Self { client }
}
pub async fn get_v2_estimates(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(V2Operation::GetV2Estimates.spec(), request)
.await
}
pub async fn get_v2_estimates_by_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(V2Operation::GetV2EstimatesById.spec(), request)
.await
}
pub async fn get_v2_estimates_by_id_send_settings(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(V2Operation::GetV2EstimatesByIdSendSettings.spec(), request)
.await
}
pub async fn get_v2_invoices(&self, request: OperationRequest) -> Result<Value, JorttError> {
self.client
.execute_spec(V2Operation::GetV2Invoices.spec(), request)
.await
}
pub async fn get_v2_invoices_by_id(
&self,
request: OperationRequest,
) -> Result<Value, JorttError> {
self.client
.execute_spec(V2Operation::GetV2InvoicesById.spec(), request)
.await
}
}
pub const GENERATED_METHOD_COUNT: usize = 126;