#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PutCustomChargesInput {
pub app_id: ::std::option::Option<::std::string::String>,
pub user_id: ::std::option::Option<::std::string::String>,
pub charges: ::std::option::Option<::std::vec::Vec<crate::types::CustomCharge>>,
pub scope: ::std::option::Option<crate::types::RequestScope>,
}
impl PutCustomChargesInput {
pub fn app_id(&self) -> ::std::option::Option<&str> {
self.app_id.as_deref()
}
pub fn user_id(&self) -> ::std::option::Option<&str> {
self.user_id.as_deref()
}
pub fn charges(&self) -> &[crate::types::CustomCharge] {
self.charges.as_deref().unwrap_or_default()
}
pub fn scope(&self) -> ::std::option::Option<&crate::types::RequestScope> {
self.scope.as_ref()
}
}
impl PutCustomChargesInput {
pub fn builder() -> crate::operation::put_custom_charges::builders::PutCustomChargesInputBuilder {
crate::operation::put_custom_charges::builders::PutCustomChargesInputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutCustomChargesInputBuilder {
pub(crate) app_id: ::std::option::Option<::std::string::String>,
pub(crate) user_id: ::std::option::Option<::std::string::String>,
pub(crate) charges: ::std::option::Option<::std::vec::Vec<crate::types::CustomCharge>>,
pub(crate) scope: ::std::option::Option<crate::types::RequestScope>,
}
impl PutCustomChargesInputBuilder {
pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.app_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.app_id = input;
self
}
pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
&self.app_id
}
pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.user_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.user_id = input;
self
}
pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
&self.user_id
}
pub fn charges(mut self, input: crate::types::CustomCharge) -> Self {
let mut v = self.charges.unwrap_or_default();
v.push(input);
self.charges = ::std::option::Option::Some(v);
self
}
pub fn set_charges(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CustomCharge>>) -> Self {
self.charges = input;
self
}
pub fn get_charges(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CustomCharge>> {
&self.charges
}
pub fn scope(mut self, input: crate::types::RequestScope) -> Self {
self.scope = ::std::option::Option::Some(input);
self
}
pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RequestScope>) -> Self {
self.scope = input;
self
}
pub fn get_scope(&self) -> &::std::option::Option<crate::types::RequestScope> {
&self.scope
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::put_custom_charges::PutCustomChargesInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::put_custom_charges::PutCustomChargesInput {
app_id: self.app_id,
user_id: self.user_id,
charges: self.charges,
scope: self.scope,
})
}
}