use crate::{
CommentAction, ContractInvoiceAction, ContractInvoiceActionSubs, Created, Date, EmptyResponse,
HalfYearlyAutogiroContractInvoice, InvoiceActionSubs, MonthlyAutogiroContractInvoice, Request,
RequestBuilder, Uuid, YearlyAutogiroContractInvoice,
};
pub fn get_a_contract_invoice(id: &str) -> Request<ContractInvoiceAction> {
RequestBuilder::new(http::Method::GET, "/v1/contractinvoice/action/")
.path_param(id)
.build()
}
pub fn update_a_contract_invoice(id: &str, body: &ContractInvoiceAction) -> Request<EmptyResponse> {
RequestBuilder::new(http::Method::PUT, "/v1/contractinvoice/action/")
.path_param(id)
.body(body)
.build()
}
pub fn create_a_contract_invoice(body: &ContractInvoiceAction) -> Request<Created> {
RequestBuilder::new(http::Method::POST, "/v1/contractinvoice/action")
.body(body)
.build()
}
pub fn delete_a_contract_invoice(id: &str) -> Request<EmptyResponse> {
RequestBuilder::new(http::Method::DELETE, "/v1/contractinvoice/action/")
.path_param(id)
.build()
}
pub fn get_all_contract_invoices(
id: Uuid,
offset: Option<i32>,
limit: Option<i32>,
sortingfield: Option<&str>,
asc: Option<bool>,
) -> Request<ContractInvoiceActionSubs> {
RequestBuilder::new(http::Method::GET, "/v1/contractinvoice/actions/")
.path_param(id)
.query_param_opt("offset", offset)
.query_param_opt("limit", limit)
.query_param_opt("sortingfield", sortingfield)
.query_param_opt("asc", asc)
.build()
}
pub fn get_all_contract_invoices_to_a_debtor(
id: Uuid,
debtorpublicid: Uuid,
offset: Option<i32>,
limit: Option<i32>,
sortingfield: Option<&str>,
asc: Option<bool>,
) -> Request<ContractInvoiceActionSubs> {
RequestBuilder::new(http::Method::GET, "/v1/contractinvoice/actionsbydebtor/")
.path_param(id)
.query_param("debtorpublicid", debtorpublicid)
.query_param_opt("offset", offset)
.query_param_opt("limit", limit)
.query_param_opt("sortingfield", sortingfield)
.query_param_opt("asc", asc)
.build()
}
pub fn comment_a_contract_invoice(body: &CommentAction) -> Request<EmptyResponse> {
RequestBuilder::new(http::Method::POST, "/v1/contractinvoice/comment")
.body(body)
.build()
}
pub fn generate_a_new_invoice_from_a_contract_invoice(id: &str) -> Request<Created> {
RequestBuilder::new(http::Method::PUT, "/v1/contractinvoice/createinvoice/")
.path_param(id)
.build()
}
pub fn get_invoices_generated_from_contract_invoice(
id: &str,
offset: Option<i32>,
limit: Option<i32>,
sortingfield: Option<&str>,
asc: Option<bool>,
) -> Request<InvoiceActionSubs> {
RequestBuilder::new(http::Method::GET, "/v1/contractinvoice/generatedinvoices/")
.path_param(id)
.query_param_opt("offset", offset)
.query_param_opt("limit", limit)
.query_param_opt("sortingfield", sortingfield)
.query_param_opt("asc", asc)
.build()
}
pub fn create_half_year_recurring_autogiro_contract_invoice(
body: &HalfYearlyAutogiroContractInvoice,
) -> Request<Created> {
RequestBuilder::new(
http::Method::POST,
"/v1/contractinvoice/halfyearlyrecurringautogiro",
)
.body(body)
.build()
}
pub fn create_monthly_recurring_autogiro_contract_invoice(
body: &MonthlyAutogiroContractInvoice,
) -> Request<Created> {
RequestBuilder::new(
http::Method::POST,
"/v1/contractinvoice/monthlyrecurringautogiro",
)
.body(body)
.build()
}
pub fn move_next_run(id: &str, steps: i32) -> Request<EmptyResponse> {
RequestBuilder::new(http::Method::PUT, "/v1/contractinvoice/movenextrun/")
.path_param(id)
.query_param("steps", steps)
.build()
}
pub fn pause_disables_a_contract_invoice(id: &str) -> Request<EmptyResponse> {
RequestBuilder::new(http::Method::PUT, "/v1/contractinvoice/pause/")
.path_param(id)
.build()
}
pub fn preview_a_contract_invoice(id: &str) -> Request<Vec<u8>> {
RequestBuilder::new(http::Method::GET, "/v1/contractinvoice/preview/")
.path_param(id)
.build()
}
pub fn preview_a_contract_invoice_post(body: &ContractInvoiceAction) -> Request<Vec<u8>> {
RequestBuilder::new(http::Method::POST, "/v1/contractinvoice/preview")
.body(body)
.build()
}
pub fn resume_a_contract_invoice(id: &str, nextdate: Date) -> Request<EmptyResponse> {
RequestBuilder::new(http::Method::PUT, "/v1/contractinvoice/resume/")
.path_param(id)
.query_param("nextdate", nextdate)
.build()
}
pub fn create_yearly_recurring_autogiro_contract_invoice(
body: &YearlyAutogiroContractInvoice,
) -> Request<Created> {
RequestBuilder::new(
http::Method::POST,
"/v1/contractinvoice/yearlyrecurringautogiro",
)
.body(body)
.build()
}