aws-sdk-budgets 1.74.0

AWS SDK for AWS Budgets
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Request of CreateBudget</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateBudgetInput {
    /// <p>The <code>accountId</code> that is associated with the budget.</p>
    pub account_id: ::std::option::Option<::std::string::String>,
    /// <p>The budget object that you want to create.</p>
    pub budget: ::std::option::Option<crate::types::Budget>,
    /// <p>A notification that you want to associate with a budget. A budget can have up to five notifications, and each notification can have one SNS subscriber and up to 10 email subscribers. If you include notifications and subscribers in your <code>CreateBudget</code> call, Amazon Web Services creates the notifications and subscribers for you.</p>
    pub notifications_with_subscribers: ::std::option::Option<::std::vec::Vec<crate::types::NotificationWithSubscribers>>,
    /// <p>An optional list of tags to associate with the specified budget. 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 CreateBudgetInput {
    /// <p>The <code>accountId</code> that is associated with the budget.</p>
    pub fn account_id(&self) -> ::std::option::Option<&str> {
        self.account_id.as_deref()
    }
    /// <p>The budget object that you want to create.</p>
    pub fn budget(&self) -> ::std::option::Option<&crate::types::Budget> {
        self.budget.as_ref()
    }
    /// <p>A notification that you want to associate with a budget. A budget can have up to five notifications, and each notification can have one SNS subscriber and up to 10 email subscribers. If you include notifications and subscribers in your <code>CreateBudget</code> call, Amazon Web Services creates the notifications and subscribers for you.</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 `.notifications_with_subscribers.is_none()`.
    pub fn notifications_with_subscribers(&self) -> &[crate::types::NotificationWithSubscribers] {
        self.notifications_with_subscribers.as_deref().unwrap_or_default()
    }
    /// <p>An optional list of tags to associate with the specified budget. 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 CreateBudgetInput {
    /// Creates a new builder-style object to manufacture [`CreateBudgetInput`](crate::operation::create_budget::CreateBudgetInput).
    pub fn builder() -> crate::operation::create_budget::builders::CreateBudgetInputBuilder {
        crate::operation::create_budget::builders::CreateBudgetInputBuilder::default()
    }
}

/// A builder for [`CreateBudgetInput`](crate::operation::create_budget::CreateBudgetInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateBudgetInputBuilder {
    pub(crate) account_id: ::std::option::Option<::std::string::String>,
    pub(crate) budget: ::std::option::Option<crate::types::Budget>,
    pub(crate) notifications_with_subscribers: ::std::option::Option<::std::vec::Vec<crate::types::NotificationWithSubscribers>>,
    pub(crate) resource_tags: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>,
}
impl CreateBudgetInputBuilder {
    /// <p>The <code>accountId</code> that is associated with the budget.</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 <code>accountId</code> that is associated with the budget.</p>
    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.account_id = input;
        self
    }
    /// <p>The <code>accountId</code> that is associated with the budget.</p>
    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.account_id
    }
    /// <p>The budget object that you want to create.</p>
    /// This field is required.
    pub fn budget(mut self, input: crate::types::Budget) -> Self {
        self.budget = ::std::option::Option::Some(input);
        self
    }
    /// <p>The budget object that you want to create.</p>
    pub fn set_budget(mut self, input: ::std::option::Option<crate::types::Budget>) -> Self {
        self.budget = input;
        self
    }
    /// <p>The budget object that you want to create.</p>
    pub fn get_budget(&self) -> &::std::option::Option<crate::types::Budget> {
        &self.budget
    }
    /// Appends an item to `notifications_with_subscribers`.
    ///
    /// To override the contents of this collection use [`set_notifications_with_subscribers`](Self::set_notifications_with_subscribers).
    ///
    /// <p>A notification that you want to associate with a budget. A budget can have up to five notifications, and each notification can have one SNS subscriber and up to 10 email subscribers. If you include notifications and subscribers in your <code>CreateBudget</code> call, Amazon Web Services creates the notifications and subscribers for you.</p>
    pub fn notifications_with_subscribers(mut self, input: crate::types::NotificationWithSubscribers) -> Self {
        let mut v = self.notifications_with_subscribers.unwrap_or_default();
        v.push(input);
        self.notifications_with_subscribers = ::std::option::Option::Some(v);
        self
    }
    /// <p>A notification that you want to associate with a budget. A budget can have up to five notifications, and each notification can have one SNS subscriber and up to 10 email subscribers. If you include notifications and subscribers in your <code>CreateBudget</code> call, Amazon Web Services creates the notifications and subscribers for you.</p>
    pub fn set_notifications_with_subscribers(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::NotificationWithSubscribers>>,
    ) -> Self {
        self.notifications_with_subscribers = input;
        self
    }
    /// <p>A notification that you want to associate with a budget. A budget can have up to five notifications, and each notification can have one SNS subscriber and up to 10 email subscribers. If you include notifications and subscribers in your <code>CreateBudget</code> call, Amazon Web Services creates the notifications and subscribers for you.</p>
    pub fn get_notifications_with_subscribers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::NotificationWithSubscribers>> {
        &self.notifications_with_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. 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. 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. 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 [`CreateBudgetInput`](crate::operation::create_budget::CreateBudgetInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_budget::CreateBudgetInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_budget::CreateBudgetInput {
            account_id: self.account_id,
            budget: self.budget,
            notifications_with_subscribers: self.notifications_with_subscribers,
            resource_tags: self.resource_tags,
        })
    }
}