#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Field {
pub key: ::std::string::String,
pub string_value: ::std::option::Option<::std::string::String>,
pub ref_value: ::std::option::Option<::std::string::String>,
}
impl Field {
pub fn key(&self) -> &str {
use std::ops::Deref;
self.key.deref()
}
pub fn string_value(&self) -> ::std::option::Option<&str> {
self.string_value.as_deref()
}
pub fn ref_value(&self) -> ::std::option::Option<&str> {
self.ref_value.as_deref()
}
}
impl Field {
pub fn builder() -> crate::types::builders::FieldBuilder {
crate::types::builders::FieldBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct FieldBuilder {
pub(crate) key: ::std::option::Option<::std::string::String>,
pub(crate) string_value: ::std::option::Option<::std::string::String>,
pub(crate) ref_value: ::std::option::Option<::std::string::String>,
}
impl FieldBuilder {
pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.key = ::std::option::Option::Some(input.into());
self
}
pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.key = input;
self
}
pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
&self.key
}
pub fn string_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.string_value = ::std::option::Option::Some(input.into());
self
}
pub fn set_string_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.string_value = input;
self
}
pub fn get_string_value(&self) -> &::std::option::Option<::std::string::String> {
&self.string_value
}
pub fn ref_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.ref_value = ::std::option::Option::Some(input.into());
self
}
pub fn set_ref_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.ref_value = input;
self
}
pub fn get_ref_value(&self) -> &::std::option::Option<::std::string::String> {
&self.ref_value
}
pub fn build(self) -> ::std::result::Result<crate::types::Field, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Field {
key: self.key.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field("key", "key was not specified but it is required when building Field")
})?,
string_value: self.string_value,
ref_value: self.ref_value,
})
}
}