billecta 1.14.0

Generated Billecta API
Documentation
//! # Accounting dimensions
//!
//! Accounting dimensions are mainly a bookkeeping feature and enabled you to in the
//! bookkeeping mark invoices to certain groups. Accounting dimension enables the possibility
//! to add other bookkeeping dimensions than the already existing dimensions 1 and 6 (cost
//! center and project). The information is not show on the invoices towards the customers.
//!
use crate::{
    AccountingDimension, AccountingDimensions, EmptyResponse, Request, RequestBuilder, Uuid,
};

pub fn get_a_dimension(
    id: Uuid,
    dimension: i32,
    code: Option<&str>,
) -> Request<AccountingDimension> {
    RequestBuilder::new(http::Method::GET, "/v1/accountingdimensions/dimension/")
        .path_param(id)
        .query_param("dimension", dimension)
        .query_param_opt("code", code)
        .build()
}
pub fn update_a_dimension(body: &AccountingDimension) -> Request<EmptyResponse> {
    RequestBuilder::new(http::Method::PUT, "/v1/accountingdimensions/dimension")
        .body(body)
        .build()
}
pub fn create_a_dimension(body: &AccountingDimension) -> Request<AccountingDimension> {
    RequestBuilder::new(http::Method::POST, "/v1/accountingdimensions/dimension")
        .body(body)
        .build()
}
///Deletes a dimension. Note that a dimension can't be deleted if it has
///been used on any invoice.
pub fn delete_a_dimension(id: Uuid, dimension: i32, code: Option<&str>) -> Request<EmptyResponse> {
    RequestBuilder::new(http::Method::DELETE, "/v1/accountingdimensions/dimension/")
        .path_param(id)
        .query_param("dimension", dimension)
        .query_param_opt("code", code)
        .build()
}
pub fn get_all_dimensions(id: Uuid) -> Request<AccountingDimensions> {
    RequestBuilder::new(http::Method::GET, "/v1/accountingdimensions/dimensions/")
        .path_param(id)
        .build()
}