Struct ramp_api::departments::Departments
source · pub struct Departments {
pub client: Client,
}
Fields§
§client: Client
Implementations§
source§impl Departments
impl Departments
sourcepub async fn get_page(
&self,
start: &str,
page_size: f64
) -> Result<Response<Vec<Department>>, ClientError>
pub async fn get_page( &self, start: &str, page_size: f64 ) -> Result<Response<Vec<Department>>, ClientError>
List departments.
This function performs a GET
to the /departments
endpoint.
Retrieve all departments.
Parameters:
authorization: &str
– The OAuth2 token header.start: &str
– The ID of the last entity of the previous page, used for pagination to get the next page.page_size: f64
– The number of results to be returned in each page. The value must be between 2 and 10,000. If not specified, the default will be 1,000.
sourcepub async fn get_all(&self) -> Result<Response<Vec<Department>>, ClientError>
pub async fn get_all(&self) -> Result<Response<Vec<Department>>, ClientError>
List departments.
This function performs a GET
to the /departments
endpoint.
As opposed to get
, this function returns all the pages of the request at once.
Retrieve all departments.
sourcepub async fn post(
&self,
body: &PostLocationRequest
) -> Result<Response<Department>, ClientError>
pub async fn post( &self, body: &PostLocationRequest ) -> Result<Response<Department>, ClientError>
Create department.
This function performs a POST
to the /departments
endpoint.
Create a new department.
sourcepub async fn get(&self, id: &str) -> Result<Response<Department>, ClientError>
pub async fn get(&self, id: &str) -> Result<Response<Department>, ClientError>
GET a department.
This function performs a GET
to the /departments/{id}
endpoint.
Retrieve a single department.
Parameters:
authorization: &str
– The OAuth2 token header.
sourcepub async fn patch(
&self,
id: &str,
body: &PostLocationRequest
) -> Result<Response<Department>, ClientError>
pub async fn patch( &self, id: &str, body: &PostLocationRequest ) -> Result<Response<Department>, ClientError>
Update department.
This function performs a PATCH
to the /departments/{id}
endpoint.
Modify a department.
Auto Trait Implementations§
impl !RefUnwindSafe for Departments
impl Send for Departments
impl Sync for Departments
impl Unpin for Departments
impl !UnwindSafe for Departments
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more