#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Service {
pub service_code: ::std::string::String,
pub attribute_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Service {
pub fn service_code(&self) -> &str {
use std::ops::Deref;
self.service_code.deref()
}
pub fn attribute_names(&self) -> &[::std::string::String] {
self.attribute_names.as_deref().unwrap_or_default()
}
}
impl Service {
pub fn builder() -> crate::types::builders::ServiceBuilder {
crate::types::builders::ServiceBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ServiceBuilder {
pub(crate) service_code: ::std::option::Option<::std::string::String>,
pub(crate) attribute_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl ServiceBuilder {
pub fn service_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.service_code = ::std::option::Option::Some(input.into());
self
}
pub fn set_service_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.service_code = input;
self
}
pub fn get_service_code(&self) -> &::std::option::Option<::std::string::String> {
&self.service_code
}
pub fn attribute_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.attribute_names.unwrap_or_default();
v.push(input.into());
self.attribute_names = ::std::option::Option::Some(v);
self
}
pub fn set_attribute_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.attribute_names = input;
self
}
pub fn get_attribute_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.attribute_names
}
pub fn build(self) -> ::std::result::Result<crate::types::Service, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Service {
service_code: self.service_code.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"service_code",
"service_code was not specified but it is required when building Service",
)
})?,
attribute_names: self.attribute_names,
})
}
}