More improvements and testing.
This commit is contained in:
39
src/vacation_response/helpers.rs
Normal file
39
src/vacation_response/helpers.rs
Normal file
@@ -0,0 +1,39 @@
|
||||
use crate::{
|
||||
core::{
|
||||
get::GetRequest,
|
||||
request::{Arguments, Request},
|
||||
response::{VacationResponseGetResponse, VacationResponseSetResponse},
|
||||
set::SetRequest,
|
||||
},
|
||||
Method, Set, URI,
|
||||
};
|
||||
|
||||
use super::VacationResponse;
|
||||
|
||||
impl Request<'_> {
|
||||
pub fn get_vacation_response(&mut self) -> &mut GetRequest<super::Property, ()> {
|
||||
self.add_capability(URI::VacationResponse);
|
||||
self.add_method_call(
|
||||
Method::GetVacationResponse,
|
||||
Arguments::vacation_response_get(self.params(Method::GetVacationResponse)),
|
||||
)
|
||||
.vacation_response_get_mut()
|
||||
}
|
||||
|
||||
pub async fn send_get_vacation_response(self) -> crate::Result<VacationResponseGetResponse> {
|
||||
self.send_single().await
|
||||
}
|
||||
|
||||
pub fn set_vacation_response(&mut self) -> &mut SetRequest<VacationResponse<Set>, ()> {
|
||||
self.add_capability(URI::VacationResponse);
|
||||
self.add_method_call(
|
||||
Method::SetVacationResponse,
|
||||
Arguments::vacation_response_set(self.params(Method::GetVacationResponse)),
|
||||
)
|
||||
.vacation_response_set_mut()
|
||||
}
|
||||
|
||||
pub async fn send_set_vacation_response(self) -> crate::Result<VacationResponseSetResponse> {
|
||||
self.send_single().await
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
pub mod get;
|
||||
pub mod helpers;
|
||||
pub mod set;
|
||||
|
||||
use std::fmt::Display;
|
||||
|
||||
Reference in New Issue
Block a user