aws-sdk-billing 1.53.0

AWS SDK for AWS Billing
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)]
pub struct CreateBillingViewInput {
    /// <p>The name of the billing view.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The description of the billing view.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>A list of billing views used as the data source for the custom billing view.</p>
    pub source_views: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>See <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_billing_Expression.html">Expression</a>. Billing view only supports <code>LINKED_ACCOUNT</code>, <code>Tags</code>, and <code>CostCategories</code>.</p>
    pub data_filter_expression: ::std::option::Option<crate::types::Expression>,
    /// <p>A unique, case-sensitive identifier you specify to ensure idempotency of the request. Idempotency ensures that an API request completes no more than one time. If the original request completes successfully, any subsequent retries complete successfully without performing any further actions with an idempotent request.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>A list of key value map specifying tags associated to the billing view being created.</p>
    pub resource_tags: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>,
}
impl CreateBillingViewInput {
    /// <p>The name of the billing view.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The description of the billing view.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>A list of billing views used as the data source for the custom billing view.</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 `.source_views.is_none()`.
    pub fn source_views(&self) -> &[::std::string::String] {
        self.source_views.as_deref().unwrap_or_default()
    }
    /// <p>See <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_billing_Expression.html">Expression</a>. Billing view only supports <code>LINKED_ACCOUNT</code>, <code>Tags</code>, and <code>CostCategories</code>.</p>
    pub fn data_filter_expression(&self) -> ::std::option::Option<&crate::types::Expression> {
        self.data_filter_expression.as_ref()
    }
    /// <p>A unique, case-sensitive identifier you specify to ensure idempotency of the request. Idempotency ensures that an API request completes no more than one time. If the original request completes successfully, any subsequent retries complete successfully without performing any further actions with an idempotent request.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>A list of key value map specifying tags associated to the billing view being created.</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 ::std::fmt::Debug for CreateBillingViewInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateBillingViewInput");
        formatter.field("name", &"*** Sensitive Data Redacted ***");
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("source_views", &self.source_views);
        formatter.field("data_filter_expression", &self.data_filter_expression);
        formatter.field("client_token", &self.client_token);
        formatter.field("resource_tags", &self.resource_tags);
        formatter.finish()
    }
}
impl CreateBillingViewInput {
    /// Creates a new builder-style object to manufacture [`CreateBillingViewInput`](crate::operation::create_billing_view::CreateBillingViewInput).
    pub fn builder() -> crate::operation::create_billing_view::builders::CreateBillingViewInputBuilder {
        crate::operation::create_billing_view::builders::CreateBillingViewInputBuilder::default()
    }
}

/// A builder for [`CreateBillingViewInput`](crate::operation::create_billing_view::CreateBillingViewInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateBillingViewInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) source_views: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) data_filter_expression: ::std::option::Option<crate::types::Expression>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) resource_tags: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>,
}
impl CreateBillingViewInputBuilder {
    /// <p>The name of the billing view.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the billing view.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the billing view.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The description of the billing view.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the billing view.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description of the billing view.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Appends an item to `source_views`.
    ///
    /// To override the contents of this collection use [`set_source_views`](Self::set_source_views).
    ///
    /// <p>A list of billing views used as the data source for the custom billing view.</p>
    pub fn source_views(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.source_views.unwrap_or_default();
        v.push(input.into());
        self.source_views = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of billing views used as the data source for the custom billing view.</p>
    pub fn set_source_views(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.source_views = input;
        self
    }
    /// <p>A list of billing views used as the data source for the custom billing view.</p>
    pub fn get_source_views(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.source_views
    }
    /// <p>See <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_billing_Expression.html">Expression</a>. Billing view only supports <code>LINKED_ACCOUNT</code>, <code>Tags</code>, and <code>CostCategories</code>.</p>
    pub fn data_filter_expression(mut self, input: crate::types::Expression) -> Self {
        self.data_filter_expression = ::std::option::Option::Some(input);
        self
    }
    /// <p>See <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_billing_Expression.html">Expression</a>. Billing view only supports <code>LINKED_ACCOUNT</code>, <code>Tags</code>, and <code>CostCategories</code>.</p>
    pub fn set_data_filter_expression(mut self, input: ::std::option::Option<crate::types::Expression>) -> Self {
        self.data_filter_expression = input;
        self
    }
    /// <p>See <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_billing_Expression.html">Expression</a>. Billing view only supports <code>LINKED_ACCOUNT</code>, <code>Tags</code>, and <code>CostCategories</code>.</p>
    pub fn get_data_filter_expression(&self) -> &::std::option::Option<crate::types::Expression> {
        &self.data_filter_expression
    }
    /// <p>A unique, case-sensitive identifier you specify to ensure idempotency of the request. Idempotency ensures that an API request completes no more than one time. If the original request completes successfully, any subsequent retries complete successfully without performing any further actions with an idempotent request.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique, case-sensitive identifier you specify to ensure idempotency of the request. Idempotency ensures that an API request completes no more than one time. If the original request completes successfully, any subsequent retries complete successfully without performing any further actions with an idempotent request.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique, case-sensitive identifier you specify to ensure idempotency of the request. Idempotency ensures that an API request completes no more than one time. If the original request completes successfully, any subsequent retries complete successfully without performing any further actions with an idempotent request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Appends an item to `resource_tags`.
    ///
    /// To override the contents of this collection use [`set_resource_tags`](Self::set_resource_tags).
    ///
    /// <p>A list of key value map specifying tags associated to the billing view being created.</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>A list of key value map specifying tags associated to the billing view being created.</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>A list of key value map specifying tags associated to the billing view being created.</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 [`CreateBillingViewInput`](crate::operation::create_billing_view::CreateBillingViewInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_billing_view::CreateBillingViewInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_billing_view::CreateBillingViewInput {
            name: self.name,
            description: self.description,
            source_views: self.source_views,
            data_filter_expression: self.data_filter_expression,
            client_token: self.client_token,
            resource_tags: self.resource_tags,
        })
    }
}
impl ::std::fmt::Debug for CreateBillingViewInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateBillingViewInputBuilder");
        formatter.field("name", &"*** Sensitive Data Redacted ***");
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("source_views", &self.source_views);
        formatter.field("data_filter_expression", &self.data_filter_expression);
        formatter.field("client_token", &self.client_token);
        formatter.field("resource_tags", &self.resource_tags);
        formatter.finish()
    }
}