aws-sdk-budgets 1.28.0

AWS SDK for AWS Budgets
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 CreateBudgetActionInput {
    /// <p>The account ID of the user. It's a 12-digit number.</p>
    pub account_id: ::std::option::Option<::std::string::String>,
    /// <p>A string that represents the budget name. The ":" and "\" characters, and the "/action/" substring, aren't allowed.</p>
    pub budget_name: ::std::option::Option<::std::string::String>,
    /// <p>The type of a notification. It must be ACTUAL or FORECASTED.</p>
    pub notification_type: ::std::option::Option<crate::types::NotificationType>,
    /// <p>The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition.</p>
    pub action_type: ::std::option::Option<crate::types::ActionType>,
    /// <p>The trigger threshold of the action.</p>
    pub action_threshold: ::std::option::Option<crate::types::ActionThreshold>,
    /// <p>Specifies all of the type-specific parameters.</p>
    pub definition: ::std::option::Option<crate::types::Definition>,
    /// <p>The role passed for action execution and reversion. Roles and actions must be in the same account.</p>
    pub execution_role_arn: ::std::option::Option<::std::string::String>,
    /// <p>This specifies if the action needs manual or automatic approval.</p>
    pub approval_model: ::std::option::Option<crate::types::ApprovalModel>,
    /// <p>A list of subscribers.</p>
    pub subscribers: ::std::option::Option<::std::vec::Vec<crate::types::Subscriber>>,
    /// <p>An optional list of tags to associate with the specified budget action. Each tag consists of a key and a value, and each key must be unique for the resource.</p>
    pub resource_tags: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>,
}
impl CreateBudgetActionInput {
    /// <p>The account ID of the user. It's a 12-digit number.</p>
    pub fn account_id(&self) -> ::std::option::Option<&str> {
        self.account_id.as_deref()
    }
    /// <p>A string that represents the budget name. The ":" and "\" characters, and the "/action/" substring, aren't allowed.</p>
    pub fn budget_name(&self) -> ::std::option::Option<&str> {
        self.budget_name.as_deref()
    }
    /// <p>The type of a notification. It must be ACTUAL or FORECASTED.</p>
    pub fn notification_type(&self) -> ::std::option::Option<&crate::types::NotificationType> {
        self.notification_type.as_ref()
    }
    /// <p>The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition.</p>
    pub fn action_type(&self) -> ::std::option::Option<&crate::types::ActionType> {
        self.action_type.as_ref()
    }
    /// <p>The trigger threshold of the action.</p>
    pub fn action_threshold(&self) -> ::std::option::Option<&crate::types::ActionThreshold> {
        self.action_threshold.as_ref()
    }
    /// <p>Specifies all of the type-specific parameters.</p>
    pub fn definition(&self) -> ::std::option::Option<&crate::types::Definition> {
        self.definition.as_ref()
    }
    /// <p>The role passed for action execution and reversion. Roles and actions must be in the same account.</p>
    pub fn execution_role_arn(&self) -> ::std::option::Option<&str> {
        self.execution_role_arn.as_deref()
    }
    /// <p>This specifies if the action needs manual or automatic approval.</p>
    pub fn approval_model(&self) -> ::std::option::Option<&crate::types::ApprovalModel> {
        self.approval_model.as_ref()
    }
    /// <p>A list of subscribers.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.subscribers.is_none()`.
    pub fn subscribers(&self) -> &[crate::types::Subscriber] {
        self.subscribers.as_deref().unwrap_or_default()
    }
    /// <p>An optional list of tags to associate with the specified budget action. Each tag consists of a key and a value, and each key must be unique for the resource.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_tags.is_none()`.
    pub fn resource_tags(&self) -> &[crate::types::ResourceTag] {
        self.resource_tags.as_deref().unwrap_or_default()
    }
}
impl CreateBudgetActionInput {
    /// Creates a new builder-style object to manufacture [`CreateBudgetActionInput`](crate::operation::create_budget_action::CreateBudgetActionInput).
    pub fn builder() -> crate::operation::create_budget_action::builders::CreateBudgetActionInputBuilder {
        crate::operation::create_budget_action::builders::CreateBudgetActionInputBuilder::default()
    }
}

/// A builder for [`CreateBudgetActionInput`](crate::operation::create_budget_action::CreateBudgetActionInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CreateBudgetActionInputBuilder {
    pub(crate) account_id: ::std::option::Option<::std::string::String>,
    pub(crate) budget_name: ::std::option::Option<::std::string::String>,
    pub(crate) notification_type: ::std::option::Option<crate::types::NotificationType>,
    pub(crate) action_type: ::std::option::Option<crate::types::ActionType>,
    pub(crate) action_threshold: ::std::option::Option<crate::types::ActionThreshold>,
    pub(crate) definition: ::std::option::Option<crate::types::Definition>,
    pub(crate) execution_role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) approval_model: ::std::option::Option<crate::types::ApprovalModel>,
    pub(crate) subscribers: ::std::option::Option<::std::vec::Vec<crate::types::Subscriber>>,
    pub(crate) resource_tags: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>,
}
impl CreateBudgetActionInputBuilder {
    /// <p>The account ID of the user. It's a 12-digit number.</p>
    /// This field is required.
    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.account_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The account ID of the user. It's a 12-digit number.</p>
    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.account_id = input;
        self
    }
    /// <p>The account ID of the user. It's a 12-digit number.</p>
    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.account_id
    }
    /// <p>A string that represents the budget name. The ":" and "\" characters, and the "/action/" substring, aren't allowed.</p>
    /// This field is required.
    pub fn budget_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.budget_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A string that represents the budget name. The ":" and "\" characters, and the "/action/" substring, aren't allowed.</p>
    pub fn set_budget_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.budget_name = input;
        self
    }
    /// <p>A string that represents the budget name. The ":" and "\" characters, and the "/action/" substring, aren't allowed.</p>
    pub fn get_budget_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.budget_name
    }
    /// <p>The type of a notification. It must be ACTUAL or FORECASTED.</p>
    /// This field is required.
    pub fn notification_type(mut self, input: crate::types::NotificationType) -> Self {
        self.notification_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of a notification. It must be ACTUAL or FORECASTED.</p>
    pub fn set_notification_type(mut self, input: ::std::option::Option<crate::types::NotificationType>) -> Self {
        self.notification_type = input;
        self
    }
    /// <p>The type of a notification. It must be ACTUAL or FORECASTED.</p>
    pub fn get_notification_type(&self) -> &::std::option::Option<crate::types::NotificationType> {
        &self.notification_type
    }
    /// <p>The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition.</p>
    /// This field is required.
    pub fn action_type(mut self, input: crate::types::ActionType) -> Self {
        self.action_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition.</p>
    pub fn set_action_type(mut self, input: ::std::option::Option<crate::types::ActionType>) -> Self {
        self.action_type = input;
        self
    }
    /// <p>The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition.</p>
    pub fn get_action_type(&self) -> &::std::option::Option<crate::types::ActionType> {
        &self.action_type
    }
    /// <p>The trigger threshold of the action.</p>
    /// This field is required.
    pub fn action_threshold(mut self, input: crate::types::ActionThreshold) -> Self {
        self.action_threshold = ::std::option::Option::Some(input);
        self
    }
    /// <p>The trigger threshold of the action.</p>
    pub fn set_action_threshold(mut self, input: ::std::option::Option<crate::types::ActionThreshold>) -> Self {
        self.action_threshold = input;
        self
    }
    /// <p>The trigger threshold of the action.</p>
    pub fn get_action_threshold(&self) -> &::std::option::Option<crate::types::ActionThreshold> {
        &self.action_threshold
    }
    /// <p>Specifies all of the type-specific parameters.</p>
    /// This field is required.
    pub fn definition(mut self, input: crate::types::Definition) -> Self {
        self.definition = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies all of the type-specific parameters.</p>
    pub fn set_definition(mut self, input: ::std::option::Option<crate::types::Definition>) -> Self {
        self.definition = input;
        self
    }
    /// <p>Specifies all of the type-specific parameters.</p>
    pub fn get_definition(&self) -> &::std::option::Option<crate::types::Definition> {
        &self.definition
    }
    /// <p>The role passed for action execution and reversion. Roles and actions must be in the same account.</p>
    /// This field is required.
    pub fn execution_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.execution_role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The role passed for action execution and reversion. Roles and actions must be in the same account.</p>
    pub fn set_execution_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.execution_role_arn = input;
        self
    }
    /// <p>The role passed for action execution and reversion. Roles and actions must be in the same account.</p>
    pub fn get_execution_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.execution_role_arn
    }
    /// <p>This specifies if the action needs manual or automatic approval.</p>
    /// This field is required.
    pub fn approval_model(mut self, input: crate::types::ApprovalModel) -> Self {
        self.approval_model = ::std::option::Option::Some(input);
        self
    }
    /// <p>This specifies if the action needs manual or automatic approval.</p>
    pub fn set_approval_model(mut self, input: ::std::option::Option<crate::types::ApprovalModel>) -> Self {
        self.approval_model = input;
        self
    }
    /// <p>This specifies if the action needs manual or automatic approval.</p>
    pub fn get_approval_model(&self) -> &::std::option::Option<crate::types::ApprovalModel> {
        &self.approval_model
    }
    /// Appends an item to `subscribers`.
    ///
    /// To override the contents of this collection use [`set_subscribers`](Self::set_subscribers).
    ///
    /// <p>A list of subscribers.</p>
    pub fn subscribers(mut self, input: crate::types::Subscriber) -> Self {
        let mut v = self.subscribers.unwrap_or_default();
        v.push(input);
        self.subscribers = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of subscribers.</p>
    pub fn set_subscribers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Subscriber>>) -> Self {
        self.subscribers = input;
        self
    }
    /// <p>A list of subscribers.</p>
    pub fn get_subscribers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Subscriber>> {
        &self.subscribers
    }
    /// Appends an item to `resource_tags`.
    ///
    /// To override the contents of this collection use [`set_resource_tags`](Self::set_resource_tags).
    ///
    /// <p>An optional list of tags to associate with the specified budget action. Each tag consists of a key and a value, and each key must be unique for the resource.</p>
    pub fn resource_tags(mut self, input: crate::types::ResourceTag) -> Self {
        let mut v = self.resource_tags.unwrap_or_default();
        v.push(input);
        self.resource_tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>An optional list of tags to associate with the specified budget action. Each tag consists of a key and a value, and each key must be unique for the resource.</p>
    pub fn set_resource_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>) -> Self {
        self.resource_tags = input;
        self
    }
    /// <p>An optional list of tags to associate with the specified budget action. Each tag consists of a key and a value, and each key must be unique for the resource.</p>
    pub fn get_resource_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>> {
        &self.resource_tags
    }
    /// Consumes the builder and constructs a [`CreateBudgetActionInput`](crate::operation::create_budget_action::CreateBudgetActionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_budget_action::CreateBudgetActionInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_budget_action::CreateBudgetActionInput {
            account_id: self.account_id,
            budget_name: self.budget_name,
            notification_type: self.notification_type,
            action_type: self.action_type,
            action_threshold: self.action_threshold,
            definition: self.definition,
            execution_role_arn: self.execution_role_arn,
            approval_model: self.approval_model,
            subscribers: self.subscribers,
            resource_tags: self.resource_tags,
        })
    }
}