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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Represents the usage data of a usage plan.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateUsageOutput {
    /// <p>The plan Id associated with this usage data.</p>
    pub usage_plan_id: ::std::option::Option<::std::string::String>,
    /// <p>The starting date of the usage data.</p>
    pub start_date: ::std::option::Option<::std::string::String>,
    /// <p>The ending date of the usage data.</p>
    pub end_date: ::std::option::Option<::std::string::String>,
    /// <p>The usage data, as daily logs of used and remaining quotas, over the specified time interval indexed over the API keys in a usage plan. For example, <code>{..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]}</code>, where <code>{api_key}</code> stands for an API key value and the daily log entry is of the format <code>[used quota, remaining quota]</code>.</p>
    pub items: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::vec::Vec<i64>>>>,
    /// <p>The current pagination position in the paged result set.</p>
    pub position: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl UpdateUsageOutput {
    /// <p>The plan Id associated with this usage data.</p>
    pub fn usage_plan_id(&self) -> ::std::option::Option<&str> {
        self.usage_plan_id.as_deref()
    }
    /// <p>The starting date of the usage data.</p>
    pub fn start_date(&self) -> ::std::option::Option<&str> {
        self.start_date.as_deref()
    }
    /// <p>The ending date of the usage data.</p>
    pub fn end_date(&self) -> ::std::option::Option<&str> {
        self.end_date.as_deref()
    }
    /// <p>The usage data, as daily logs of used and remaining quotas, over the specified time interval indexed over the API keys in a usage plan. For example, <code>{..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]}</code>, where <code>{api_key}</code> stands for an API key value and the daily log entry is of the format <code>[used quota, remaining quota]</code>.</p>
    pub fn items(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::vec::Vec<i64>>>> {
        self.items.as_ref()
    }
    /// <p>The current pagination position in the paged result set.</p>
    pub fn position(&self) -> ::std::option::Option<&str> {
        self.position.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for UpdateUsageOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl UpdateUsageOutput {
    /// Creates a new builder-style object to manufacture [`UpdateUsageOutput`](crate::operation::update_usage::UpdateUsageOutput).
    pub fn builder() -> crate::operation::update_usage::builders::UpdateUsageOutputBuilder {
        crate::operation::update_usage::builders::UpdateUsageOutputBuilder::default()
    }
}

/// A builder for [`UpdateUsageOutput`](crate::operation::update_usage::UpdateUsageOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct UpdateUsageOutputBuilder {
    pub(crate) usage_plan_id: ::std::option::Option<::std::string::String>,
    pub(crate) start_date: ::std::option::Option<::std::string::String>,
    pub(crate) end_date: ::std::option::Option<::std::string::String>,
    pub(crate) items: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::vec::Vec<i64>>>>,
    pub(crate) position: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl UpdateUsageOutputBuilder {
    /// <p>The plan Id associated with this usage data.</p>
    pub fn usage_plan_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.usage_plan_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The plan Id associated with this usage data.</p>
    pub fn set_usage_plan_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.usage_plan_id = input;
        self
    }
    /// <p>The plan Id associated with this usage data.</p>
    pub fn get_usage_plan_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.usage_plan_id
    }
    /// <p>The starting date of the usage data.</p>
    pub fn start_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.start_date = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The starting date of the usage data.</p>
    pub fn set_start_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.start_date = input;
        self
    }
    /// <p>The starting date of the usage data.</p>
    pub fn get_start_date(&self) -> &::std::option::Option<::std::string::String> {
        &self.start_date
    }
    /// <p>The ending date of the usage data.</p>
    pub fn end_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.end_date = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ending date of the usage data.</p>
    pub fn set_end_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.end_date = input;
        self
    }
    /// <p>The ending date of the usage data.</p>
    pub fn get_end_date(&self) -> &::std::option::Option<::std::string::String> {
        &self.end_date
    }
    /// Adds a key-value pair to `items`.
    ///
    /// To override the contents of this collection use [`set_items`](Self::set_items).
    ///
    /// <p>The usage data, as daily logs of used and remaining quotas, over the specified time interval indexed over the API keys in a usage plan. For example, <code>{..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]}</code>, where <code>{api_key}</code> stands for an API key value and the daily log entry is of the format <code>[used quota, remaining quota]</code>.</p>
    pub fn items(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::vec::Vec<i64>>) -> Self {
        let mut hash_map = self.items.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.items = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The usage data, as daily logs of used and remaining quotas, over the specified time interval indexed over the API keys in a usage plan. For example, <code>{..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]}</code>, where <code>{api_key}</code> stands for an API key value and the daily log entry is of the format <code>[used quota, remaining quota]</code>.</p>
    pub fn set_items(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::vec::Vec<i64>>>>,
    ) -> Self {
        self.items = input;
        self
    }
    /// <p>The usage data, as daily logs of used and remaining quotas, over the specified time interval indexed over the API keys in a usage plan. For example, <code>{..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]}</code>, where <code>{api_key}</code> stands for an API key value and the daily log entry is of the format <code>[used quota, remaining quota]</code>.</p>
    pub fn get_items(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::vec::Vec<i64>>>> {
        &self.items
    }
    /// <p>The current pagination position in the paged result set.</p>
    pub fn position(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.position = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The current pagination position in the paged result set.</p>
    pub fn set_position(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.position = input;
        self
    }
    /// <p>The current pagination position in the paged result set.</p>
    pub fn get_position(&self) -> &::std::option::Option<::std::string::String> {
        &self.position
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`UpdateUsageOutput`](crate::operation::update_usage::UpdateUsageOutput).
    pub fn build(self) -> crate::operation::update_usage::UpdateUsageOutput {
        crate::operation::update_usage::UpdateUsageOutput {
            usage_plan_id: self.usage_plan_id,
            start_date: self.start_date,
            end_date: self.end_date,
            items: self.items,
            position: self.position,
            _request_id: self._request_id,
        }
    }
}