aws-sdk-sagemakergeospatial 1.103.0

AWS SDK for Amazon SageMaker geospatial capabilities
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Represents an arithmetic operation to compute spectral index.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Operation {
    /// <p>The name of the operation.</p>
    pub name: ::std::string::String,
    /// <p>Textual representation of the math operation; Equation used to compute the spectral index.</p>
    pub equation: ::std::string::String,
    /// <p>The type of the operation.</p>
    pub output_type: ::std::option::Option<crate::types::OutputType>,
}
impl Operation {
    /// <p>The name of the operation.</p>
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// <p>Textual representation of the math operation; Equation used to compute the spectral index.</p>
    pub fn equation(&self) -> &str {
        use std::ops::Deref;
        self.equation.deref()
    }
    /// <p>The type of the operation.</p>
    pub fn output_type(&self) -> ::std::option::Option<&crate::types::OutputType> {
        self.output_type.as_ref()
    }
}
impl Operation {
    /// Creates a new builder-style object to manufacture [`Operation`](crate::types::Operation).
    pub fn builder() -> crate::types::builders::OperationBuilder {
        crate::types::builders::OperationBuilder::default()
    }
}

/// A builder for [`Operation`](crate::types::Operation).
#[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 {
    /// <p>The name of the operation.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the operation.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the operation.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>Textual representation of the math operation; Equation used to compute the spectral index.</p>
    /// This field is required.
    pub fn equation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.equation = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Textual representation of the math operation; Equation used to compute the spectral index.</p>
    pub fn set_equation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.equation = input;
        self
    }
    /// <p>Textual representation of the math operation; Equation used to compute the spectral index.</p>
    pub fn get_equation(&self) -> &::std::option::Option<::std::string::String> {
        &self.equation
    }
    /// <p>The type of the operation.</p>
    pub fn output_type(mut self, input: crate::types::OutputType) -> Self {
        self.output_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of the operation.</p>
    pub fn set_output_type(mut self, input: ::std::option::Option<crate::types::OutputType>) -> Self {
        self.output_type = input;
        self
    }
    /// <p>The type of the operation.</p>
    pub fn get_output_type(&self) -> &::std::option::Option<crate::types::OutputType> {
        &self.output_type
    }
    /// Consumes the builder and constructs a [`Operation`](crate::types::Operation).
    /// This method will fail if any of the following fields are not set:
    /// - [`name`](crate::types::builders::OperationBuilder::name)
    /// - [`equation`](crate::types::builders::OperationBuilder::equation)
    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,
        })
    }
}