aws-sdk-iot 1.112.0

AWS SDK for AWS IoT
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 UpdateMitigationActionInput {
    /// <p>The friendly name for the mitigation action. You cannot change the name by using <code>UpdateMitigationAction</code>. Instead, you must delete and recreate the mitigation action with the new name.</p>
    pub action_name: ::std::option::Option<::std::string::String>,
    /// <p>The ARN of the IAM role that is used to apply the mitigation action.</p>
    pub role_arn: ::std::option::Option<::std::string::String>,
    /// <p>Defines the type of action and the parameters for that action.</p>
    pub action_params: ::std::option::Option<crate::types::MitigationActionParams>,
}
impl UpdateMitigationActionInput {
    /// <p>The friendly name for the mitigation action. You cannot change the name by using <code>UpdateMitigationAction</code>. Instead, you must delete and recreate the mitigation action with the new name.</p>
    pub fn action_name(&self) -> ::std::option::Option<&str> {
        self.action_name.as_deref()
    }
    /// <p>The ARN of the IAM role that is used to apply the mitigation action.</p>
    pub fn role_arn(&self) -> ::std::option::Option<&str> {
        self.role_arn.as_deref()
    }
    /// <p>Defines the type of action and the parameters for that action.</p>
    pub fn action_params(&self) -> ::std::option::Option<&crate::types::MitigationActionParams> {
        self.action_params.as_ref()
    }
}
impl UpdateMitigationActionInput {
    /// Creates a new builder-style object to manufacture [`UpdateMitigationActionInput`](crate::operation::update_mitigation_action::UpdateMitigationActionInput).
    pub fn builder() -> crate::operation::update_mitigation_action::builders::UpdateMitigationActionInputBuilder {
        crate::operation::update_mitigation_action::builders::UpdateMitigationActionInputBuilder::default()
    }
}

/// A builder for [`UpdateMitigationActionInput`](crate::operation::update_mitigation_action::UpdateMitigationActionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateMitigationActionInputBuilder {
    pub(crate) action_name: ::std::option::Option<::std::string::String>,
    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) action_params: ::std::option::Option<crate::types::MitigationActionParams>,
}
impl UpdateMitigationActionInputBuilder {
    /// <p>The friendly name for the mitigation action. You cannot change the name by using <code>UpdateMitigationAction</code>. Instead, you must delete and recreate the mitigation action with the new name.</p>
    /// This field is required.
    pub fn action_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.action_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The friendly name for the mitigation action. You cannot change the name by using <code>UpdateMitigationAction</code>. Instead, you must delete and recreate the mitigation action with the new name.</p>
    pub fn set_action_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.action_name = input;
        self
    }
    /// <p>The friendly name for the mitigation action. You cannot change the name by using <code>UpdateMitigationAction</code>. Instead, you must delete and recreate the mitigation action with the new name.</p>
    pub fn get_action_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.action_name
    }
    /// <p>The ARN of the IAM role that is used to apply the mitigation action.</p>
    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the IAM role that is used to apply the mitigation action.</p>
    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.role_arn = input;
        self
    }
    /// <p>The ARN of the IAM role that is used to apply the mitigation action.</p>
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.role_arn
    }
    /// <p>Defines the type of action and the parameters for that action.</p>
    pub fn action_params(mut self, input: crate::types::MitigationActionParams) -> Self {
        self.action_params = ::std::option::Option::Some(input);
        self
    }
    /// <p>Defines the type of action and the parameters for that action.</p>
    pub fn set_action_params(mut self, input: ::std::option::Option<crate::types::MitigationActionParams>) -> Self {
        self.action_params = input;
        self
    }
    /// <p>Defines the type of action and the parameters for that action.</p>
    pub fn get_action_params(&self) -> &::std::option::Option<crate::types::MitigationActionParams> {
        &self.action_params
    }
    /// Consumes the builder and constructs a [`UpdateMitigationActionInput`](crate::operation::update_mitigation_action::UpdateMitigationActionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::update_mitigation_action::UpdateMitigationActionInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::update_mitigation_action::UpdateMitigationActionInput {
            action_name: self.action_name,
            role_arn: self.role_arn,
            action_params: self.action_params,
        })
    }
}