#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Intent {
pub intent_name: ::std::string::String,
pub intent_version: ::std::string::String,
}
impl Intent {
pub fn intent_name(&self) -> &str {
use std::ops::Deref;
self.intent_name.deref()
}
pub fn intent_version(&self) -> &str {
use std::ops::Deref;
self.intent_version.deref()
}
}
impl Intent {
pub fn builder() -> crate::types::builders::IntentBuilder {
crate::types::builders::IntentBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct IntentBuilder {
pub(crate) intent_name: ::std::option::Option<::std::string::String>,
pub(crate) intent_version: ::std::option::Option<::std::string::String>,
}
impl IntentBuilder {
pub fn intent_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.intent_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_intent_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.intent_name = input;
self
}
pub fn get_intent_name(&self) -> &::std::option::Option<::std::string::String> {
&self.intent_name
}
pub fn intent_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.intent_version = ::std::option::Option::Some(input.into());
self
}
pub fn set_intent_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.intent_version = input;
self
}
pub fn get_intent_version(&self) -> &::std::option::Option<::std::string::String> {
&self.intent_version
}
pub fn build(self) -> ::std::result::Result<crate::types::Intent, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Intent {
intent_name: self.intent_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"intent_name",
"intent_name was not specified but it is required when building Intent",
)
})?,
intent_version: self.intent_version.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"intent_version",
"intent_version was not specified but it is required when building Intent",
)
})?,
})
}
}