aws_sdk_apigateway/operation/update_usage/
_update_usage_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the usage data of a usage plan.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateUsageOutput {
7    /// <p>The plan Id associated with this usage data.</p>
8    pub usage_plan_id: ::std::option::Option<::std::string::String>,
9    /// <p>The starting date of the usage data.</p>
10    pub start_date: ::std::option::Option<::std::string::String>,
11    /// <p>The ending date of the usage data.</p>
12    pub end_date: ::std::option::Option<::std::string::String>,
13    /// <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>
14    pub items: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::vec::Vec<i64>>>>,
15    /// <p>The current pagination position in the paged result set.</p>
16    pub position: ::std::option::Option<::std::string::String>,
17    _request_id: Option<String>,
18}
19impl UpdateUsageOutput {
20    /// <p>The plan Id associated with this usage data.</p>
21    pub fn usage_plan_id(&self) -> ::std::option::Option<&str> {
22        self.usage_plan_id.as_deref()
23    }
24    /// <p>The starting date of the usage data.</p>
25    pub fn start_date(&self) -> ::std::option::Option<&str> {
26        self.start_date.as_deref()
27    }
28    /// <p>The ending date of the usage data.</p>
29    pub fn end_date(&self) -> ::std::option::Option<&str> {
30        self.end_date.as_deref()
31    }
32    /// <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>
33    pub fn items(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::vec::Vec<i64>>>> {
34        self.items.as_ref()
35    }
36    /// <p>The current pagination position in the paged result set.</p>
37    pub fn position(&self) -> ::std::option::Option<&str> {
38        self.position.as_deref()
39    }
40}
41impl ::aws_types::request_id::RequestId for UpdateUsageOutput {
42    fn request_id(&self) -> Option<&str> {
43        self._request_id.as_deref()
44    }
45}
46impl UpdateUsageOutput {
47    /// Creates a new builder-style object to manufacture [`UpdateUsageOutput`](crate::operation::update_usage::UpdateUsageOutput).
48    pub fn builder() -> crate::operation::update_usage::builders::UpdateUsageOutputBuilder {
49        crate::operation::update_usage::builders::UpdateUsageOutputBuilder::default()
50    }
51}
52
53/// A builder for [`UpdateUsageOutput`](crate::operation::update_usage::UpdateUsageOutput).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct UpdateUsageOutputBuilder {
57    pub(crate) usage_plan_id: ::std::option::Option<::std::string::String>,
58    pub(crate) start_date: ::std::option::Option<::std::string::String>,
59    pub(crate) end_date: ::std::option::Option<::std::string::String>,
60    pub(crate) items: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::vec::Vec<i64>>>>,
61    pub(crate) position: ::std::option::Option<::std::string::String>,
62    _request_id: Option<String>,
63}
64impl UpdateUsageOutputBuilder {
65    /// <p>The plan Id associated with this usage data.</p>
66    pub fn usage_plan_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.usage_plan_id = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The plan Id associated with this usage data.</p>
71    pub fn set_usage_plan_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.usage_plan_id = input;
73        self
74    }
75    /// <p>The plan Id associated with this usage data.</p>
76    pub fn get_usage_plan_id(&self) -> &::std::option::Option<::std::string::String> {
77        &self.usage_plan_id
78    }
79    /// <p>The starting date of the usage data.</p>
80    pub fn start_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.start_date = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The starting date of the usage data.</p>
85    pub fn set_start_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.start_date = input;
87        self
88    }
89    /// <p>The starting date of the usage data.</p>
90    pub fn get_start_date(&self) -> &::std::option::Option<::std::string::String> {
91        &self.start_date
92    }
93    /// <p>The ending date of the usage data.</p>
94    pub fn end_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.end_date = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The ending date of the usage data.</p>
99    pub fn set_end_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.end_date = input;
101        self
102    }
103    /// <p>The ending date of the usage data.</p>
104    pub fn get_end_date(&self) -> &::std::option::Option<::std::string::String> {
105        &self.end_date
106    }
107    /// Adds a key-value pair to `items`.
108    ///
109    /// To override the contents of this collection use [`set_items`](Self::set_items).
110    ///
111    /// <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>
112    pub fn items(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::vec::Vec<i64>>) -> Self {
113        let mut hash_map = self.items.unwrap_or_default();
114        hash_map.insert(k.into(), v);
115        self.items = ::std::option::Option::Some(hash_map);
116        self
117    }
118    /// <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>
119    pub fn set_items(
120        mut self,
121        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::vec::Vec<i64>>>>,
122    ) -> Self {
123        self.items = input;
124        self
125    }
126    /// <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>
127    pub fn get_items(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::vec::Vec<i64>>>> {
128        &self.items
129    }
130    /// <p>The current pagination position in the paged result set.</p>
131    pub fn position(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.position = ::std::option::Option::Some(input.into());
133        self
134    }
135    /// <p>The current pagination position in the paged result set.</p>
136    pub fn set_position(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.position = input;
138        self
139    }
140    /// <p>The current pagination position in the paged result set.</p>
141    pub fn get_position(&self) -> &::std::option::Option<::std::string::String> {
142        &self.position
143    }
144    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
145        self._request_id = Some(request_id.into());
146        self
147    }
148
149    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
150        self._request_id = request_id;
151        self
152    }
153    /// Consumes the builder and constructs a [`UpdateUsageOutput`](crate::operation::update_usage::UpdateUsageOutput).
154    pub fn build(self) -> crate::operation::update_usage::UpdateUsageOutput {
155        crate::operation::update_usage::UpdateUsageOutput {
156            usage_plan_id: self.usage_plan_id,
157            start_date: self.start_date,
158            end_date: self.end_date,
159            items: self.items,
160            position: self.position,
161            _request_id: self._request_id,
162        }
163    }
164}