billecta 1.14.0

Generated Billecta API
Documentation
//! # Cost Centers
//!
//! Cost centers are mainly a bookkeeping feature and enabled you to in the bookkeeping mark
//! invoices to certain groups. The feature can also be used to group invoice rows for later
//! searches. The information is not show on the invoices towards the customers.
//!
use crate::{CostCenter, CostCenters, Created, EmptyResponse, Request, RequestBuilder, Uuid};

pub fn get_a_cost_center(id: Uuid, code: &str) -> Request<CostCenter> {
    RequestBuilder::new(http::Method::GET, "/v1/costcenters/costcenter/")
        .path_param(id)
        .query_param("code", code)
        .build()
}
pub fn update_a_cost_center(body: &CostCenter) -> Request<EmptyResponse> {
    RequestBuilder::new(http::Method::PUT, "/v1/costcenters/costcenter")
        .body(body)
        .build()
}
pub fn create_a_cost_center(body: &CostCenter) -> Request<Created> {
    RequestBuilder::new(http::Method::POST, "/v1/costcenters/costcenter")
        .body(body)
        .build()
}
///Deletes a cost center. Note that a cost center can't be deleted if it
///has been used on any invoice. You will get a 400 Bad Request it you
///try to delete a contract invoice that is used.
pub fn delete_a_cost_center(id: Uuid, code: &str) -> Request<EmptyResponse> {
    RequestBuilder::new(http::Method::DELETE, "/v1/costcenters/costcenter/")
        .path_param(id)
        .query_param("code", code)
        .build()
}
pub fn get_all_cost_centers(id: Uuid) -> Request<CostCenters> {
    RequestBuilder::new(http::Method::GET, "/v1/costcenters/costcenters/")
        .path_param(id)
        .build()
}
///Imports multiple costCenters. CostCenters will be match on
///CostCenterNumber for updates or create
pub fn create_multiple_cost_centers(body: &CostCenters) -> Request<Created> {
    RequestBuilder::new(http::Method::POST, "/v1/costcenters/costcenters")
        .body(body)
        .build()
}