aws-sdk-emrserverless 1.101.0

AWS SDK for EMR Serverless
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The configurations for the Hive job driver.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Hive {
    /// <p>The query for the Hive job run.</p>
    pub query: ::std::string::String,
    /// <p>The query file for the Hive job run.</p>
    pub init_query_file: ::std::option::Option<::std::string::String>,
    /// <p>The parameters for the Hive job run.</p>
    pub parameters: ::std::option::Option<::std::string::String>,
}
impl Hive {
    /// <p>The query for the Hive job run.</p>
    pub fn query(&self) -> &str {
        use std::ops::Deref;
        self.query.deref()
    }
    /// <p>The query file for the Hive job run.</p>
    pub fn init_query_file(&self) -> ::std::option::Option<&str> {
        self.init_query_file.as_deref()
    }
    /// <p>The parameters for the Hive job run.</p>
    pub fn parameters(&self) -> ::std::option::Option<&str> {
        self.parameters.as_deref()
    }
}
impl ::std::fmt::Debug for Hive {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("Hive");
        formatter.field("query", &"*** Sensitive Data Redacted ***");
        formatter.field("init_query_file", &"*** Sensitive Data Redacted ***");
        formatter.field("parameters", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl Hive {
    /// Creates a new builder-style object to manufacture [`Hive`](crate::types::Hive).
    pub fn builder() -> crate::types::builders::HiveBuilder {
        crate::types::builders::HiveBuilder::default()
    }
}

/// A builder for [`Hive`](crate::types::Hive).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct HiveBuilder {
    pub(crate) query: ::std::option::Option<::std::string::String>,
    pub(crate) init_query_file: ::std::option::Option<::std::string::String>,
    pub(crate) parameters: ::std::option::Option<::std::string::String>,
}
impl HiveBuilder {
    /// <p>The query for the Hive job run.</p>
    /// This field is required.
    pub fn query(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.query = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The query for the Hive job run.</p>
    pub fn set_query(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.query = input;
        self
    }
    /// <p>The query for the Hive job run.</p>
    pub fn get_query(&self) -> &::std::option::Option<::std::string::String> {
        &self.query
    }
    /// <p>The query file for the Hive job run.</p>
    pub fn init_query_file(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.init_query_file = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The query file for the Hive job run.</p>
    pub fn set_init_query_file(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.init_query_file = input;
        self
    }
    /// <p>The query file for the Hive job run.</p>
    pub fn get_init_query_file(&self) -> &::std::option::Option<::std::string::String> {
        &self.init_query_file
    }
    /// <p>The parameters for the Hive job run.</p>
    pub fn parameters(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.parameters = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The parameters for the Hive job run.</p>
    pub fn set_parameters(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.parameters = input;
        self
    }
    /// <p>The parameters for the Hive job run.</p>
    pub fn get_parameters(&self) -> &::std::option::Option<::std::string::String> {
        &self.parameters
    }
    /// Consumes the builder and constructs a [`Hive`](crate::types::Hive).
    /// This method will fail if any of the following fields are not set:
    /// - [`query`](crate::types::builders::HiveBuilder::query)
    pub fn build(self) -> ::std::result::Result<crate::types::Hive, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Hive {
            query: self.query.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "query",
                    "query was not specified but it is required when building Hive",
                )
            })?,
            init_query_file: self.init_query_file,
            parameters: self.parameters,
        })
    }
}
impl ::std::fmt::Debug for HiveBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("HiveBuilder");
        formatter.field("query", &"*** Sensitive Data Redacted ***");
        formatter.field("init_query_file", &"*** Sensitive Data Redacted ***");
        formatter.field("parameters", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}