aws-sdk-mailmanager 1.86.0

AWS SDK for MailManager
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 GetRuleSetOutput {
    /// <p>The identifier of the rule set resource.</p>
    pub rule_set_id: ::std::string::String,
    /// <p>The Amazon Resource Name (ARN) of the rule set resource.</p>
    pub rule_set_arn: ::std::string::String,
    /// <p>A user-friendly name for the rule set resource.</p>
    pub rule_set_name: ::std::string::String,
    /// <p>The date of when then rule set was created.</p>
    pub created_date: ::aws_smithy_types::DateTime,
    /// <p>The date of when the rule set was last modified.</p>
    pub last_modification_date: ::aws_smithy_types::DateTime,
    /// <p>The rules contained in the rule set.</p>
    pub rules: ::std::vec::Vec<crate::types::Rule>,
    _request_id: Option<String>,
}
impl GetRuleSetOutput {
    /// <p>The identifier of the rule set resource.</p>
    pub fn rule_set_id(&self) -> &str {
        use std::ops::Deref;
        self.rule_set_id.deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the rule set resource.</p>
    pub fn rule_set_arn(&self) -> &str {
        use std::ops::Deref;
        self.rule_set_arn.deref()
    }
    /// <p>A user-friendly name for the rule set resource.</p>
    pub fn rule_set_name(&self) -> &str {
        use std::ops::Deref;
        self.rule_set_name.deref()
    }
    /// <p>The date of when then rule set was created.</p>
    pub fn created_date(&self) -> &::aws_smithy_types::DateTime {
        &self.created_date
    }
    /// <p>The date of when the rule set was last modified.</p>
    pub fn last_modification_date(&self) -> &::aws_smithy_types::DateTime {
        &self.last_modification_date
    }
    /// <p>The rules contained in the rule set.</p>
    pub fn rules(&self) -> &[crate::types::Rule] {
        use std::ops::Deref;
        self.rules.deref()
    }
}
impl ::aws_types::request_id::RequestId for GetRuleSetOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetRuleSetOutput {
    /// Creates a new builder-style object to manufacture [`GetRuleSetOutput`](crate::operation::get_rule_set::GetRuleSetOutput).
    pub fn builder() -> crate::operation::get_rule_set::builders::GetRuleSetOutputBuilder {
        crate::operation::get_rule_set::builders::GetRuleSetOutputBuilder::default()
    }
}

/// A builder for [`GetRuleSetOutput`](crate::operation::get_rule_set::GetRuleSetOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetRuleSetOutputBuilder {
    pub(crate) rule_set_id: ::std::option::Option<::std::string::String>,
    pub(crate) rule_set_arn: ::std::option::Option<::std::string::String>,
    pub(crate) rule_set_name: ::std::option::Option<::std::string::String>,
    pub(crate) created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_modification_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) rules: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>,
    _request_id: Option<String>,
}
impl GetRuleSetOutputBuilder {
    /// <p>The identifier of the rule set resource.</p>
    /// This field is required.
    pub fn rule_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.rule_set_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the rule set resource.</p>
    pub fn set_rule_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.rule_set_id = input;
        self
    }
    /// <p>The identifier of the rule set resource.</p>
    pub fn get_rule_set_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.rule_set_id
    }
    /// <p>The Amazon Resource Name (ARN) of the rule set resource.</p>
    /// This field is required.
    pub fn rule_set_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.rule_set_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the rule set resource.</p>
    pub fn set_rule_set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.rule_set_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the rule set resource.</p>
    pub fn get_rule_set_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.rule_set_arn
    }
    /// <p>A user-friendly name for the rule set resource.</p>
    /// This field is required.
    pub fn rule_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.rule_set_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A user-friendly name for the rule set resource.</p>
    pub fn set_rule_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.rule_set_name = input;
        self
    }
    /// <p>A user-friendly name for the rule set resource.</p>
    pub fn get_rule_set_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.rule_set_name
    }
    /// <p>The date of when then rule set was created.</p>
    /// This field is required.
    pub fn created_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date of when then rule set was created.</p>
    pub fn set_created_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_date = input;
        self
    }
    /// <p>The date of when then rule set was created.</p>
    pub fn get_created_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_date
    }
    /// <p>The date of when the rule set was last modified.</p>
    /// This field is required.
    pub fn last_modification_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_modification_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date of when the rule set was last modified.</p>
    pub fn set_last_modification_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_modification_date = input;
        self
    }
    /// <p>The date of when the rule set was last modified.</p>
    pub fn get_last_modification_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_modification_date
    }
    /// Appends an item to `rules`.
    ///
    /// To override the contents of this collection use [`set_rules`](Self::set_rules).
    ///
    /// <p>The rules contained in the rule set.</p>
    pub fn rules(mut self, input: crate::types::Rule) -> Self {
        let mut v = self.rules.unwrap_or_default();
        v.push(input);
        self.rules = ::std::option::Option::Some(v);
        self
    }
    /// <p>The rules contained in the rule set.</p>
    pub fn set_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Rule>>) -> Self {
        self.rules = input;
        self
    }
    /// <p>The rules contained in the rule set.</p>
    pub fn get_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Rule>> {
        &self.rules
    }
    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 [`GetRuleSetOutput`](crate::operation::get_rule_set::GetRuleSetOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`rule_set_id`](crate::operation::get_rule_set::builders::GetRuleSetOutputBuilder::rule_set_id)
    /// - [`rule_set_arn`](crate::operation::get_rule_set::builders::GetRuleSetOutputBuilder::rule_set_arn)
    /// - [`rule_set_name`](crate::operation::get_rule_set::builders::GetRuleSetOutputBuilder::rule_set_name)
    /// - [`created_date`](crate::operation::get_rule_set::builders::GetRuleSetOutputBuilder::created_date)
    /// - [`last_modification_date`](crate::operation::get_rule_set::builders::GetRuleSetOutputBuilder::last_modification_date)
    /// - [`rules`](crate::operation::get_rule_set::builders::GetRuleSetOutputBuilder::rules)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_rule_set::GetRuleSetOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_rule_set::GetRuleSetOutput {
            rule_set_id: self.rule_set_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "rule_set_id",
                    "rule_set_id was not specified but it is required when building GetRuleSetOutput",
                )
            })?,
            rule_set_arn: self.rule_set_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "rule_set_arn",
                    "rule_set_arn was not specified but it is required when building GetRuleSetOutput",
                )
            })?,
            rule_set_name: self.rule_set_name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "rule_set_name",
                    "rule_set_name was not specified but it is required when building GetRuleSetOutput",
                )
            })?,
            created_date: self.created_date.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_date",
                    "created_date was not specified but it is required when building GetRuleSetOutput",
                )
            })?,
            last_modification_date: self.last_modification_date.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "last_modification_date",
                    "last_modification_date was not specified but it is required when building GetRuleSetOutput",
                )
            })?,
            rules: self.rules.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "rules",
                    "rules was not specified but it is required when building GetRuleSetOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}