aws-sdk-connect 1.171.0

AWS SDK for Amazon Connect Service
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 CreateNotificationOutput {
    /// <p>The unique identifier assigned to the created notification.</p>
    pub notification_id: ::std::string::String,
    /// <p>The Amazon Resource Name (ARN) of the created notification.</p>
    pub notification_arn: ::std::string::String,
    _request_id: Option<String>,
}
impl CreateNotificationOutput {
    /// <p>The unique identifier assigned to the created notification.</p>
    pub fn notification_id(&self) -> &str {
        use std::ops::Deref;
        self.notification_id.deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the created notification.</p>
    pub fn notification_arn(&self) -> &str {
        use std::ops::Deref;
        self.notification_arn.deref()
    }
}
impl ::aws_types::request_id::RequestId for CreateNotificationOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateNotificationOutput {
    /// Creates a new builder-style object to manufacture [`CreateNotificationOutput`](crate::operation::create_notification::CreateNotificationOutput).
    pub fn builder() -> crate::operation::create_notification::builders::CreateNotificationOutputBuilder {
        crate::operation::create_notification::builders::CreateNotificationOutputBuilder::default()
    }
}

/// A builder for [`CreateNotificationOutput`](crate::operation::create_notification::CreateNotificationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateNotificationOutputBuilder {
    pub(crate) notification_id: ::std::option::Option<::std::string::String>,
    pub(crate) notification_arn: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateNotificationOutputBuilder {
    /// <p>The unique identifier assigned to the created notification.</p>
    /// This field is required.
    pub fn notification_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.notification_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier assigned to the created notification.</p>
    pub fn set_notification_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.notification_id = input;
        self
    }
    /// <p>The unique identifier assigned to the created notification.</p>
    pub fn get_notification_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.notification_id
    }
    /// <p>The Amazon Resource Name (ARN) of the created notification.</p>
    /// This field is required.
    pub fn notification_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.notification_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the created notification.</p>
    pub fn set_notification_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.notification_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the created notification.</p>
    pub fn get_notification_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.notification_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 [`CreateNotificationOutput`](crate::operation::create_notification::CreateNotificationOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`notification_id`](crate::operation::create_notification::builders::CreateNotificationOutputBuilder::notification_id)
    /// - [`notification_arn`](crate::operation::create_notification::builders::CreateNotificationOutputBuilder::notification_arn)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_notification::CreateNotificationOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_notification::CreateNotificationOutput {
            notification_id: self.notification_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "notification_id",
                    "notification_id was not specified but it is required when building CreateNotificationOutput",
                )
            })?,
            notification_arn: self.notification_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "notification_arn",
                    "notification_arn was not specified but it is required when building CreateNotificationOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}