aws-sdk-notifications 1.51.0

AWS SDK for AWS User Notifications
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 UpdateEventRuleOutput {
    /// <p>The Amazon Resource Name (ARN) to use to update the <code>EventRule</code>.</p>
    pub arn: ::std::string::String,
    /// <p>The ARN of the <code>NotificationConfiguration</code>.</p>
    pub notification_configuration_arn: ::std::string::String,
    /// <p>The status of the action by Region.</p>
    pub status_summary_by_region: ::std::collections::HashMap<::std::string::String, crate::types::EventRuleStatusSummary>,
    _request_id: Option<String>,
}
impl UpdateEventRuleOutput {
    /// <p>The Amazon Resource Name (ARN) to use to update the <code>EventRule</code>.</p>
    pub fn arn(&self) -> &str {
        use std::ops::Deref;
        self.arn.deref()
    }
    /// <p>The ARN of the <code>NotificationConfiguration</code>.</p>
    pub fn notification_configuration_arn(&self) -> &str {
        use std::ops::Deref;
        self.notification_configuration_arn.deref()
    }
    /// <p>The status of the action by Region.</p>
    pub fn status_summary_by_region(&self) -> &::std::collections::HashMap<::std::string::String, crate::types::EventRuleStatusSummary> {
        &self.status_summary_by_region
    }
}
impl ::aws_types::request_id::RequestId for UpdateEventRuleOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl UpdateEventRuleOutput {
    /// Creates a new builder-style object to manufacture [`UpdateEventRuleOutput`](crate::operation::update_event_rule::UpdateEventRuleOutput).
    pub fn builder() -> crate::operation::update_event_rule::builders::UpdateEventRuleOutputBuilder {
        crate::operation::update_event_rule::builders::UpdateEventRuleOutputBuilder::default()
    }
}

/// A builder for [`UpdateEventRuleOutput`](crate::operation::update_event_rule::UpdateEventRuleOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateEventRuleOutputBuilder {
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) notification_configuration_arn: ::std::option::Option<::std::string::String>,
    pub(crate) status_summary_by_region:
        ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::EventRuleStatusSummary>>,
    _request_id: Option<String>,
}
impl UpdateEventRuleOutputBuilder {
    /// <p>The Amazon Resource Name (ARN) to use to update the <code>EventRule</code>.</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 Amazon Resource Name (ARN) to use to update the <code>EventRule</code>.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) to use to update the <code>EventRule</code>.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The ARN of the <code>NotificationConfiguration</code>.</p>
    /// This field is required.
    pub fn notification_configuration_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.notification_configuration_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the <code>NotificationConfiguration</code>.</p>
    pub fn set_notification_configuration_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.notification_configuration_arn = input;
        self
    }
    /// <p>The ARN of the <code>NotificationConfiguration</code>.</p>
    pub fn get_notification_configuration_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.notification_configuration_arn
    }
    /// Adds a key-value pair to `status_summary_by_region`.
    ///
    /// To override the contents of this collection use [`set_status_summary_by_region`](Self::set_status_summary_by_region).
    ///
    /// <p>The status of the action by Region.</p>
    pub fn status_summary_by_region(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::EventRuleStatusSummary) -> Self {
        let mut hash_map = self.status_summary_by_region.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.status_summary_by_region = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The status of the action by Region.</p>
    pub fn set_status_summary_by_region(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::EventRuleStatusSummary>>,
    ) -> Self {
        self.status_summary_by_region = input;
        self
    }
    /// <p>The status of the action by Region.</p>
    pub fn get_status_summary_by_region(
        &self,
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::EventRuleStatusSummary>> {
        &self.status_summary_by_region
    }
    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 [`UpdateEventRuleOutput`](crate::operation::update_event_rule::UpdateEventRuleOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`arn`](crate::operation::update_event_rule::builders::UpdateEventRuleOutputBuilder::arn)
    /// - [`notification_configuration_arn`](crate::operation::update_event_rule::builders::UpdateEventRuleOutputBuilder::notification_configuration_arn)
    /// - [`status_summary_by_region`](crate::operation::update_event_rule::builders::UpdateEventRuleOutputBuilder::status_summary_by_region)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_event_rule::UpdateEventRuleOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_event_rule::UpdateEventRuleOutput {
            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 UpdateEventRuleOutput",
                )
            })?,
            notification_configuration_arn: self.notification_configuration_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "notification_configuration_arn",
                    "notification_configuration_arn was not specified but it is required when building UpdateEventRuleOutput",
                )
            })?,
            status_summary_by_region: self.status_summary_by_region.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status_summary_by_region",
                    "status_summary_by_region was not specified but it is required when building UpdateEventRuleOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}