1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p> <i> <b>This feature is in preview release and is subject to change. Your use of Amazon Web Services Price List API is subject to the Beta Service Participation terms of the <a href="https://aws.amazon.com/service-terms/">Amazon Web Services Service Terms</a> (Section 1.10).</b> </i> </p>
/// <p>This is the type of price list references that match your request. </p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PriceList {
    /// <p>The unique identifier that maps to where your Price List files are located. <code>PriceListArn</code> can be obtained from the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html"> <code>ListPriceList</code> </a> response. </p>
    pub price_list_arn: ::std::option::Option<::std::string::String>,
    /// <p>This is used to filter the Price List by Amazon Web Services Region. For example, to get the price list only for the <code>US East (N. Virginia)</code> Region, use <code>us-east-1</code>. If nothing is specified, you retrieve price lists for all applicable Regions. The available <code>RegionCode</code> list can be retrieved from <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_GetAttributeValues.html"> <code>GetAttributeValues</code> </a> API. </p>
    pub region_code: ::std::option::Option<::std::string::String>,
    /// <p>The three alphabetical character ISO-4217 currency code the Price List files are denominated in. </p>
    pub currency_code: ::std::option::Option<::std::string::String>,
    /// <p>The format you want to retrieve your Price List files. The <code>FileFormat</code> can be obtained from the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html"> <code>ListPriceList</code> </a> response. </p>
    pub file_formats: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl PriceList {
    /// <p>The unique identifier that maps to where your Price List files are located. <code>PriceListArn</code> can be obtained from the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html"> <code>ListPriceList</code> </a> response. </p>
    pub fn price_list_arn(&self) -> ::std::option::Option<&str> {
        self.price_list_arn.as_deref()
    }
    /// <p>This is used to filter the Price List by Amazon Web Services Region. For example, to get the price list only for the <code>US East (N. Virginia)</code> Region, use <code>us-east-1</code>. If nothing is specified, you retrieve price lists for all applicable Regions. The available <code>RegionCode</code> list can be retrieved from <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_GetAttributeValues.html"> <code>GetAttributeValues</code> </a> API. </p>
    pub fn region_code(&self) -> ::std::option::Option<&str> {
        self.region_code.as_deref()
    }
    /// <p>The three alphabetical character ISO-4217 currency code the Price List files are denominated in. </p>
    pub fn currency_code(&self) -> ::std::option::Option<&str> {
        self.currency_code.as_deref()
    }
    /// <p>The format you want to retrieve your Price List files. The <code>FileFormat</code> can be obtained from the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html"> <code>ListPriceList</code> </a> response. </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 `.file_formats.is_none()`.
    pub fn file_formats(&self) -> &[::std::string::String] {
        self.file_formats.as_deref().unwrap_or_default()
    }
}
impl PriceList {
    /// Creates a new builder-style object to manufacture [`PriceList`](crate::types::PriceList).
    pub fn builder() -> crate::types::builders::PriceListBuilder {
        crate::types::builders::PriceListBuilder::default()
    }
}

/// A builder for [`PriceList`](crate::types::PriceList).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct PriceListBuilder {
    pub(crate) price_list_arn: ::std::option::Option<::std::string::String>,
    pub(crate) region_code: ::std::option::Option<::std::string::String>,
    pub(crate) currency_code: ::std::option::Option<::std::string::String>,
    pub(crate) file_formats: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl PriceListBuilder {
    /// <p>The unique identifier that maps to where your Price List files are located. <code>PriceListArn</code> can be obtained from the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html"> <code>ListPriceList</code> </a> response. </p>
    pub fn price_list_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.price_list_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier that maps to where your Price List files are located. <code>PriceListArn</code> can be obtained from the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html"> <code>ListPriceList</code> </a> response. </p>
    pub fn set_price_list_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.price_list_arn = input;
        self
    }
    /// <p>The unique identifier that maps to where your Price List files are located. <code>PriceListArn</code> can be obtained from the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html"> <code>ListPriceList</code> </a> response. </p>
    pub fn get_price_list_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.price_list_arn
    }
    /// <p>This is used to filter the Price List by Amazon Web Services Region. For example, to get the price list only for the <code>US East (N. Virginia)</code> Region, use <code>us-east-1</code>. If nothing is specified, you retrieve price lists for all applicable Regions. The available <code>RegionCode</code> list can be retrieved from <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_GetAttributeValues.html"> <code>GetAttributeValues</code> </a> API. </p>
    pub fn region_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.region_code = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>This is used to filter the Price List by Amazon Web Services Region. For example, to get the price list only for the <code>US East (N. Virginia)</code> Region, use <code>us-east-1</code>. If nothing is specified, you retrieve price lists for all applicable Regions. The available <code>RegionCode</code> list can be retrieved from <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_GetAttributeValues.html"> <code>GetAttributeValues</code> </a> API. </p>
    pub fn set_region_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.region_code = input;
        self
    }
    /// <p>This is used to filter the Price List by Amazon Web Services Region. For example, to get the price list only for the <code>US East (N. Virginia)</code> Region, use <code>us-east-1</code>. If nothing is specified, you retrieve price lists for all applicable Regions. The available <code>RegionCode</code> list can be retrieved from <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_GetAttributeValues.html"> <code>GetAttributeValues</code> </a> API. </p>
    pub fn get_region_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.region_code
    }
    /// <p>The three alphabetical character ISO-4217 currency code the Price List files are denominated in. </p>
    pub fn currency_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.currency_code = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The three alphabetical character ISO-4217 currency code the Price List files are denominated in. </p>
    pub fn set_currency_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.currency_code = input;
        self
    }
    /// <p>The three alphabetical character ISO-4217 currency code the Price List files are denominated in. </p>
    pub fn get_currency_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.currency_code
    }
    /// Appends an item to `file_formats`.
    ///
    /// To override the contents of this collection use [`set_file_formats`](Self::set_file_formats).
    ///
    /// <p>The format you want to retrieve your Price List files. The <code>FileFormat</code> can be obtained from the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html"> <code>ListPriceList</code> </a> response. </p>
    pub fn file_formats(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.file_formats.unwrap_or_default();
        v.push(input.into());
        self.file_formats = ::std::option::Option::Some(v);
        self
    }
    /// <p>The format you want to retrieve your Price List files. The <code>FileFormat</code> can be obtained from the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html"> <code>ListPriceList</code> </a> response. </p>
    pub fn set_file_formats(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.file_formats = input;
        self
    }
    /// <p>The format you want to retrieve your Price List files. The <code>FileFormat</code> can be obtained from the <a href="https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_pricing_ListPriceLists.html"> <code>ListPriceList</code> </a> response. </p>
    pub fn get_file_formats(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.file_formats
    }
    /// Consumes the builder and constructs a [`PriceList`](crate::types::PriceList).
    pub fn build(self) -> crate::types::PriceList {
        crate::types::PriceList {
            price_list_arn: self.price_list_arn,
            region_code: self.region_code,
            currency_code: self.currency_code,
            file_formats: self.file_formats,
        }
    }
}