billecta 1.14.0

Generated Billecta API
Documentation
//! # Projects
//!
//! Projects are mainly a bookkeeping feature and enabled you to in the bookkeeping mark
//! invoices to certain project 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::{Created, EmptyResponse, Project, Projects, Request, RequestBuilder, Uuid};

///Returns the project the associated project number
pub fn get_a_project(id: Uuid, projectnumber: &str) -> Request<EmptyResponse> {
    RequestBuilder::new(http::Method::GET, "/v1/projects/project/")
        .path_param(id)
        .query_param("projectnumber", projectnumber)
        .build()
}
pub fn update_a_project(body: &Project) -> Request<EmptyResponse> {
    RequestBuilder::new(http::Method::PUT, "/v1/projects/project")
        .body(body)
        .build()
}
///Creates a project. CreditorPublicId is required and specifies under
///which creditor it shall be created since creditors don't share data
pub fn create_a_project(body: &Project) -> Request<Created> {
    RequestBuilder::new(http::Method::POST, "/v1/projects/project")
        .body(body)
        .build()
}
///A project can't be deleted if it used in an invoice (of any kind)
pub fn delete_a_project(id: Uuid, projectnumber: &str) -> Request<EmptyResponse> {
    RequestBuilder::new(http::Method::DELETE, "/v1/projects/project/")
        .path_param(id)
        .query_param("projectnumber", projectnumber)
        .build()
}
///Get all projects for a creditor
pub fn get_all_projects(id: Uuid) -> Request<Projects> {
    RequestBuilder::new(http::Method::GET, "/v1/projects/projects/")
        .path_param(id)
        .build()
}
///Imports multiple projects. Projects will be match on ProjectNumber for
///updates or create
pub fn create_multiple_projects(body: &Projects) -> Request<Created> {
    RequestBuilder::new(http::Method::POST, "/v1/projects/projects")
        .body(body)
        .build()
}