pub struct BusinessDurationRequest<A = ProvidedArgument, B = ProvidedArgument, C = ProvidedArgument> { /* private fields */ }
Expand description
Date Calculator API requests. Business Duration API request.
Request is validated at compile time when supplied to the client.
Example:
use libtad_rs::{
ServiceClient,
service::date_calculator::BusinessDurationRequest,
models::time::DateTime,
};
let client = ServiceClient::new("access_key".into(), "secret_key".into());
let request = BusinessDurationRequest::new()
.set_country("dk")
.set_startdt(DateTime::from("2021-08-12"))
.set_enddt(DateTime::from("2021-08-20"));
let response = client.calculate_business_duration(&request);
Implementations§
Source§impl BusinessDurationRequest
impl BusinessDurationRequest
Sourcepub fn new() -> BusinessDurationRequest<RequiredArgument, RequiredArgument, RequiredArgument>
pub fn new() -> BusinessDurationRequest<RequiredArgument, RequiredArgument, RequiredArgument>
Start building a new request.
Source§impl<A, B, C> BusinessDurationRequest<A, B, C>
impl<A, B, C> BusinessDurationRequest<A, B, C>
Sourcepub fn set_placeid(
self,
placeid: impl Into<String>,
) -> BusinessDurationRequest<ProvidedArgument, B, C>
pub fn set_placeid( self, placeid: impl Into<String>, ) -> BusinessDurationRequest<ProvidedArgument, B, C>
Set placeid to calculate for.
Sourcepub fn set_country(
self,
country: impl Into<String>,
) -> BusinessDurationRequest<ProvidedArgument, B, C>
pub fn set_country( self, country: impl Into<String>, ) -> BusinessDurationRequest<ProvidedArgument, B, C>
Set country to calculate for.
Sourcepub fn set_startdt(
self,
startdt: DateTime,
) -> BusinessDurationRequest<A, ProvidedArgument, C>
pub fn set_startdt( self, startdt: DateTime, ) -> BusinessDurationRequest<A, ProvidedArgument, C>
Set start date for the request.
Sourcepub fn set_enddt(
self,
enddt: DateTime,
) -> BusinessDurationRequest<A, B, ProvidedArgument>
pub fn set_enddt( self, enddt: DateTime, ) -> BusinessDurationRequest<A, B, ProvidedArgument>
Set end date for the request.
Sourcepub fn set_include(self, enable: bool) -> Self
pub fn set_include(self, enable: bool) -> Self
Toggle whether the result should be calculated by including instead of excluding days.
Sourcepub fn with_filter(self, filter: BusinessDaysFilterType) -> Self
pub fn with_filter(self, filter: BusinessDaysFilterType) -> Self
Add a filter to the request.
Sourcepub fn set_includelastdate(self, enable: bool) -> Self
pub fn set_includelastdate(self, enable: bool) -> Self
Set whether or not the last date should be counted in the result.
Sourcepub fn set_verbosetime(self, enable: bool) -> Self
pub fn set_verbosetime(self, enable: bool) -> Self
Toggle whether to include verbose time stamps.
Trait Implementations§
Auto Trait Implementations§
impl<A, B, C> Freeze for BusinessDurationRequest<A, B, C>
impl<A, B, C> RefUnwindSafe for BusinessDurationRequest<A, B, C>
impl<A, B, C> Send for BusinessDurationRequest<A, B, C>
impl<A, B, C> Sync for BusinessDurationRequest<A, B, C>
impl<A, B, C> Unpin for BusinessDurationRequest<A, B, C>
impl<A, B, C> UnwindSafe for BusinessDurationRequest<A, B, C>
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