aws-sdk-appmonetization 1.0.0

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

/// Output for DeleteApp.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DeleteAppOutput {
    /// The ID of the deleted app.
    pub app_id: ::std::string::String,
    /// The resource status after deletion.
    pub status: crate::types::AppStatus,
    /// The resource ARN of the deleted app.
    pub arn: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl DeleteAppOutput {
    /// The ID of the deleted app.
    pub fn app_id(&self) -> &str {
        use std::ops::Deref;
        self.app_id.deref()
    }
    /// The resource status after deletion.
    pub fn status(&self) -> &crate::types::AppStatus {
        &self.status
    }
    /// The resource ARN of the deleted app.
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for DeleteAppOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DeleteAppOutput {
    /// Creates a new builder-style object to manufacture [`DeleteAppOutput`](crate::operation::delete_app::DeleteAppOutput).
    pub fn builder() -> crate::operation::delete_app::builders::DeleteAppOutputBuilder {
        crate::operation::delete_app::builders::DeleteAppOutputBuilder::default()
    }
}

/// A builder for [`DeleteAppOutput`](crate::operation::delete_app::DeleteAppOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DeleteAppOutputBuilder {
    pub(crate) app_id: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::AppStatus>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl DeleteAppOutputBuilder {
    /// The ID of the deleted app.
    /// This field is required.
    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.app_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The ID of the deleted app.
    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.app_id = input;
        self
    }
    /// The ID of the deleted app.
    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.app_id
    }
    /// The resource status after deletion.
    /// This field is required.
    pub fn status(mut self, input: crate::types::AppStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// The resource status after deletion.
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::AppStatus>) -> Self {
        self.status = input;
        self
    }
    /// The resource status after deletion.
    pub fn get_status(&self) -> &::std::option::Option<crate::types::AppStatus> {
        &self.status
    }
    /// The resource ARN of the deleted app.
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The resource ARN of the deleted app.
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// The resource ARN of the deleted app.
    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 [`DeleteAppOutput`](crate::operation::delete_app::DeleteAppOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`app_id`](crate::operation::delete_app::builders::DeleteAppOutputBuilder::app_id)
    /// - [`status`](crate::operation::delete_app::builders::DeleteAppOutputBuilder::status)
    pub fn build(self) -> ::std::result::Result<crate::operation::delete_app::DeleteAppOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::delete_app::DeleteAppOutput {
            app_id: self.app_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "app_id",
                    "app_id was not specified but it is required when building DeleteAppOutput",
                )
            })?,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building DeleteAppOutput",
                )
            })?,
            arn: self.arn,
            _request_id: self._request_id,
        })
    }
}