#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetFlagOutput {
pub enabled: bool,
pub variant: ::std::option::Option<::std::string::String>,
pub attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FlagAttributeValue>>,
_request_id: Option<String>,
}
impl GetFlagOutput {
pub fn enabled(&self) -> bool {
self.enabled
}
pub fn variant(&self) -> ::std::option::Option<&str> {
self.variant.as_deref()
}
pub fn attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::FlagAttributeValue>> {
self.attributes.as_ref()
}
}
impl ::aws_types::request_id::RequestId for GetFlagOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetFlagOutput {
pub fn builder() -> crate::operation::get_flag::builders::GetFlagOutputBuilder {
crate::operation::get_flag::builders::GetFlagOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetFlagOutputBuilder {
pub(crate) enabled: ::std::option::Option<bool>,
pub(crate) variant: ::std::option::Option<::std::string::String>,
pub(crate) attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FlagAttributeValue>>,
_request_id: Option<String>,
}
impl GetFlagOutputBuilder {
pub fn enabled(mut self, input: bool) -> Self {
self.enabled = ::std::option::Option::Some(input);
self
}
pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
self.enabled = input;
self
}
pub fn get_enabled(&self) -> &::std::option::Option<bool> {
&self.enabled
}
pub fn variant(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.variant = ::std::option::Option::Some(input.into());
self
}
pub fn set_variant(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.variant = input;
self
}
pub fn get_variant(&self) -> &::std::option::Option<::std::string::String> {
&self.variant
}
pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::FlagAttributeValue) -> Self {
let mut hash_map = self.attributes.unwrap_or_default();
hash_map.insert(k.into(), v);
self.attributes = ::std::option::Option::Some(hash_map);
self
}
pub fn set_attributes(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FlagAttributeValue>>,
) -> Self {
self.attributes = input;
self
}
pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FlagAttributeValue>> {
&self.attributes
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
pub fn build(self) -> ::std::result::Result<crate::operation::get_flag::GetFlagOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_flag::GetFlagOutput {
enabled: self.enabled.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"enabled",
"enabled was not specified but it is required when building GetFlagOutput",
)
})?,
variant: self.variant,
attributes: self.attributes,
_request_id: self._request_id,
})
}
}