#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Operation {
pub name: ::std::string::String,
pub equation: ::std::string::String,
pub output_type: ::std::option::Option<crate::types::OutputType>,
}
impl Operation {
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
pub fn equation(&self) -> &str {
use std::ops::Deref;
self.equation.deref()
}
pub fn output_type(&self) -> ::std::option::Option<&crate::types::OutputType> {
self.output_type.as_ref()
}
}
impl Operation {
pub fn builder() -> crate::types::builders::OperationBuilder {
crate::types::builders::OperationBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct OperationBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) equation: ::std::option::Option<::std::string::String>,
pub(crate) output_type: ::std::option::Option<crate::types::OutputType>,
}
impl OperationBuilder {
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
pub fn equation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.equation = ::std::option::Option::Some(input.into());
self
}
pub fn set_equation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.equation = input;
self
}
pub fn get_equation(&self) -> &::std::option::Option<::std::string::String> {
&self.equation
}
pub fn output_type(mut self, input: crate::types::OutputType) -> Self {
self.output_type = ::std::option::Option::Some(input);
self
}
pub fn set_output_type(mut self, input: ::std::option::Option<crate::types::OutputType>) -> Self {
self.output_type = input;
self
}
pub fn get_output_type(&self) -> &::std::option::Option<crate::types::OutputType> {
&self.output_type
}
pub fn build(self) -> ::std::result::Result<crate::types::Operation, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Operation {
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building Operation",
)
})?,
equation: self.equation.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"equation",
"equation was not specified but it is required when building Operation",
)
})?,
output_type: self.output_type,
})
}
}