aws_sdk_apigateway/operation/get_usage/
_get_usage_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The GET request to get the usage data of a usage plan in a specified time interval.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetUsageInput {
7    /// <p>The Id of the usage plan associated with the usage data.</p>
8    pub usage_plan_id: ::std::option::Option<::std::string::String>,
9    /// <p>The Id of the API key associated with the resultant usage data.</p>
10    pub key_id: ::std::option::Option<::std::string::String>,
11    /// <p>The starting date (e.g., 2016-01-01) of the usage data.</p>
12    pub start_date: ::std::option::Option<::std::string::String>,
13    /// <p>The ending date (e.g., 2016-12-31) of the usage data.</p>
14    pub end_date: ::std::option::Option<::std::string::String>,
15    /// <p>The current pagination position in the paged result set.</p>
16    pub position: ::std::option::Option<::std::string::String>,
17    /// <p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>
18    pub limit: ::std::option::Option<i32>,
19}
20impl GetUsageInput {
21    /// <p>The Id of the usage plan associated with the usage data.</p>
22    pub fn usage_plan_id(&self) -> ::std::option::Option<&str> {
23        self.usage_plan_id.as_deref()
24    }
25    /// <p>The Id of the API key associated with the resultant usage data.</p>
26    pub fn key_id(&self) -> ::std::option::Option<&str> {
27        self.key_id.as_deref()
28    }
29    /// <p>The starting date (e.g., 2016-01-01) of the usage data.</p>
30    pub fn start_date(&self) -> ::std::option::Option<&str> {
31        self.start_date.as_deref()
32    }
33    /// <p>The ending date (e.g., 2016-12-31) of the usage data.</p>
34    pub fn end_date(&self) -> ::std::option::Option<&str> {
35        self.end_date.as_deref()
36    }
37    /// <p>The current pagination position in the paged result set.</p>
38    pub fn position(&self) -> ::std::option::Option<&str> {
39        self.position.as_deref()
40    }
41    /// <p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>
42    pub fn limit(&self) -> ::std::option::Option<i32> {
43        self.limit
44    }
45}
46impl GetUsageInput {
47    /// Creates a new builder-style object to manufacture [`GetUsageInput`](crate::operation::get_usage::GetUsageInput).
48    pub fn builder() -> crate::operation::get_usage::builders::GetUsageInputBuilder {
49        crate::operation::get_usage::builders::GetUsageInputBuilder::default()
50    }
51}
52
53/// A builder for [`GetUsageInput`](crate::operation::get_usage::GetUsageInput).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct GetUsageInputBuilder {
57    pub(crate) usage_plan_id: ::std::option::Option<::std::string::String>,
58    pub(crate) key_id: ::std::option::Option<::std::string::String>,
59    pub(crate) start_date: ::std::option::Option<::std::string::String>,
60    pub(crate) end_date: ::std::option::Option<::std::string::String>,
61    pub(crate) position: ::std::option::Option<::std::string::String>,
62    pub(crate) limit: ::std::option::Option<i32>,
63}
64impl GetUsageInputBuilder {
65    /// <p>The Id of the usage plan associated with the usage data.</p>
66    /// This field is required.
67    pub fn usage_plan_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.usage_plan_id = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The Id of the usage plan associated with the usage data.</p>
72    pub fn set_usage_plan_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.usage_plan_id = input;
74        self
75    }
76    /// <p>The Id of the usage plan associated with the usage data.</p>
77    pub fn get_usage_plan_id(&self) -> &::std::option::Option<::std::string::String> {
78        &self.usage_plan_id
79    }
80    /// <p>The Id of the API key associated with the resultant usage data.</p>
81    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.key_id = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The Id of the API key associated with the resultant usage data.</p>
86    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.key_id = input;
88        self
89    }
90    /// <p>The Id of the API key associated with the resultant usage data.</p>
91    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
92        &self.key_id
93    }
94    /// <p>The starting date (e.g., 2016-01-01) of the usage data.</p>
95    /// This field is required.
96    pub fn start_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.start_date = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The starting date (e.g., 2016-01-01) of the usage data.</p>
101    pub fn set_start_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.start_date = input;
103        self
104    }
105    /// <p>The starting date (e.g., 2016-01-01) of the usage data.</p>
106    pub fn get_start_date(&self) -> &::std::option::Option<::std::string::String> {
107        &self.start_date
108    }
109    /// <p>The ending date (e.g., 2016-12-31) of the usage data.</p>
110    /// This field is required.
111    pub fn end_date(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
112        self.end_date = ::std::option::Option::Some(input.into());
113        self
114    }
115    /// <p>The ending date (e.g., 2016-12-31) of the usage data.</p>
116    pub fn set_end_date(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
117        self.end_date = input;
118        self
119    }
120    /// <p>The ending date (e.g., 2016-12-31) of the usage data.</p>
121    pub fn get_end_date(&self) -> &::std::option::Option<::std::string::String> {
122        &self.end_date
123    }
124    /// <p>The current pagination position in the paged result set.</p>
125    pub fn position(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.position = ::std::option::Option::Some(input.into());
127        self
128    }
129    /// <p>The current pagination position in the paged result set.</p>
130    pub fn set_position(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.position = input;
132        self
133    }
134    /// <p>The current pagination position in the paged result set.</p>
135    pub fn get_position(&self) -> &::std::option::Option<::std::string::String> {
136        &self.position
137    }
138    /// <p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>
139    pub fn limit(mut self, input: i32) -> Self {
140        self.limit = ::std::option::Option::Some(input);
141        self
142    }
143    /// <p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>
144    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
145        self.limit = input;
146        self
147    }
148    /// <p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>
149    pub fn get_limit(&self) -> &::std::option::Option<i32> {
150        &self.limit
151    }
152    /// Consumes the builder and constructs a [`GetUsageInput`](crate::operation::get_usage::GetUsageInput).
153    pub fn build(self) -> ::std::result::Result<crate::operation::get_usage::GetUsageInput, ::aws_smithy_types::error::operation::BuildError> {
154        ::std::result::Result::Ok(crate::operation::get_usage::GetUsageInput {
155            usage_plan_id: self.usage_plan_id,
156            key_id: self.key_id,
157            start_date: self.start_date,
158            end_date: self.end_date,
159            position: self.position,
160            limit: self.limit,
161        })
162    }
163}