billecta 1.14.0

Generated Billecta API
Documentation
//! # Users
//!
//!
use crate::{Created, EmptyResponse, Password, Request, RequestBuilder, User, Users, Uuid};

///Request to update password for current user. Changing password for
///other users can't be made.
pub fn update_password(body: &Password) -> Request<EmptyResponse> {
    RequestBuilder::new(http::Method::PUT, "/v1/users/changepassword")
        .body(body)
        .build()
}
///Returns the associated user and user rights. Passwords are always
///removed from response. Note that LastLogin is the date when user last
///accessed Billecta API/Portal and can't be set.
pub fn get_a_user(id: Uuid) -> Request<User> {
    RequestBuilder::new(http::Method::GET, "/v1/users/user/")
        .path_param(id)
        .build()
}
///Note that UserPublicId must be set when updating a user. It is used to
///identify which user to update.
pub fn update_user(body: &User) -> Request<EmptyResponse> {
    RequestBuilder::new(http::Method::PUT, "/v1/users/user")
        .body(body)
        .build()
}
///Creates a user. Note that UserPublicId are generated by Billecta API
///and can't be set through the API and should be omitted when creating
pub fn create_a_user(body: &User) -> Request<Created> {
    RequestBuilder::new(http::Method::POST, "/v1/users/user")
        .body(body)
        .build()
}
pub fn delete_a_user(id: Uuid) -> Request<EmptyResponse> {
    RequestBuilder::new(http::Method::DELETE, "/v1/users/user/")
        .path_param(id)
        .build()
}
pub fn get_all_users() -> Request<Users> {
    RequestBuilder::new(http::Method::GET, "/v1/users/users").build()
}