aws-sdk-emrserverless 1.103.0

AWS SDK for EMR Serverless
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateApplicationOutput {
    /// <p>The output contains the application ID.</p>
    pub application_id: ::std::string::String,
    /// <p>The output contains the name of the application.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The output contains the ARN of the application.</p>
    pub arn: ::std::string::String,
    _request_id: Option<String>,
}
impl CreateApplicationOutput {
    /// <p>The output contains the application ID.</p>
    pub fn application_id(&self) -> &str {
        use std::ops::Deref;
        self.application_id.deref()
    }
    /// <p>The output contains the name of the application.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The output contains the ARN of the application.</p>
    pub fn arn(&self) -> &str {
        use std::ops::Deref;
        self.arn.deref()
    }
}
impl ::aws_types::request_id::RequestId for CreateApplicationOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateApplicationOutput {
    /// Creates a new builder-style object to manufacture [`CreateApplicationOutput`](crate::operation::create_application::CreateApplicationOutput).
    pub fn builder() -> crate::operation::create_application::builders::CreateApplicationOutputBuilder {
        crate::operation::create_application::builders::CreateApplicationOutputBuilder::default()
    }
}

/// A builder for [`CreateApplicationOutput`](crate::operation::create_application::CreateApplicationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateApplicationOutputBuilder {
    pub(crate) application_id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateApplicationOutputBuilder {
    /// <p>The output contains the application ID.</p>
    /// This field is required.
    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.application_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The output contains the application ID.</p>
    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.application_id = input;
        self
    }
    /// <p>The output contains the application ID.</p>
    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.application_id
    }
    /// <p>The output contains the name of the application.</p>
    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 output contains the name of the application.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The output contains the name of the application.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The output contains the ARN of the application.</p>
    /// This field is required.
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The output contains the ARN of the application.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The output contains the ARN of the application.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`CreateApplicationOutput`](crate::operation::create_application::CreateApplicationOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`application_id`](crate::operation::create_application::builders::CreateApplicationOutputBuilder::application_id)
    /// - [`arn`](crate::operation::create_application::builders::CreateApplicationOutputBuilder::arn)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_application::CreateApplicationOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_application::CreateApplicationOutput {
            application_id: self.application_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "application_id",
                    "application_id was not specified but it is required when building CreateApplicationOutput",
                )
            })?,
            name: self.name,
            arn: self.arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "arn",
                    "arn was not specified but it is required when building CreateApplicationOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}