#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Usage {
pub usage_type: ::std::option::Option<::std::string::String>,
pub usage_amount: ::std::option::Option<f64>,
pub operation: ::std::option::Option<::std::string::String>,
pub product_code: ::std::option::Option<::std::string::String>,
pub unit: ::std::option::Option<::std::string::String>,
}
impl Usage {
pub fn usage_type(&self) -> ::std::option::Option<&str> {
self.usage_type.as_deref()
}
pub fn usage_amount(&self) -> ::std::option::Option<f64> {
self.usage_amount
}
pub fn operation(&self) -> ::std::option::Option<&str> {
self.operation.as_deref()
}
pub fn product_code(&self) -> ::std::option::Option<&str> {
self.product_code.as_deref()
}
pub fn unit(&self) -> ::std::option::Option<&str> {
self.unit.as_deref()
}
}
impl Usage {
pub fn builder() -> crate::types::builders::UsageBuilder {
crate::types::builders::UsageBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct UsageBuilder {
pub(crate) usage_type: ::std::option::Option<::std::string::String>,
pub(crate) usage_amount: ::std::option::Option<f64>,
pub(crate) operation: ::std::option::Option<::std::string::String>,
pub(crate) product_code: ::std::option::Option<::std::string::String>,
pub(crate) unit: ::std::option::Option<::std::string::String>,
}
impl UsageBuilder {
pub fn usage_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.usage_type = ::std::option::Option::Some(input.into());
self
}
pub fn set_usage_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.usage_type = input;
self
}
pub fn get_usage_type(&self) -> &::std::option::Option<::std::string::String> {
&self.usage_type
}
pub fn usage_amount(mut self, input: f64) -> Self {
self.usage_amount = ::std::option::Option::Some(input);
self
}
pub fn set_usage_amount(mut self, input: ::std::option::Option<f64>) -> Self {
self.usage_amount = input;
self
}
pub fn get_usage_amount(&self) -> &::std::option::Option<f64> {
&self.usage_amount
}
pub fn operation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.operation = ::std::option::Option::Some(input.into());
self
}
pub fn set_operation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.operation = input;
self
}
pub fn get_operation(&self) -> &::std::option::Option<::std::string::String> {
&self.operation
}
pub fn product_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.product_code = ::std::option::Option::Some(input.into());
self
}
pub fn set_product_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.product_code = input;
self
}
pub fn get_product_code(&self) -> &::std::option::Option<::std::string::String> {
&self.product_code
}
pub fn unit(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.unit = ::std::option::Option::Some(input.into());
self
}
pub fn set_unit(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.unit = input;
self
}
pub fn get_unit(&self) -> &::std::option::Option<::std::string::String> {
&self.unit
}
pub fn build(self) -> crate::types::Usage {
crate::types::Usage {
usage_type: self.usage_type,
usage_amount: self.usage_amount,
operation: self.operation,
product_code: self.product_code,
unit: self.unit,
}
}
}