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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The GET request to get the usage data of a usage plan in a specified time interval.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetUsageInput {
    /// <p>The Id of the usage plan associated with the usage data.</p>
    pub usage_plan_id: ::std::option::Option<::std::string::String>,
    /// <p>The Id of the API key associated with the resultant usage data.</p>
    pub key_id: ::std::option::Option<::std::string::String>,
    /// <p>The starting date (e.g., 2016-01-01) of the usage data.</p>
    pub start_date: ::std::option::Option<::std::string::String>,
    /// <p>The ending date (e.g., 2016-12-31) of the usage data.</p>
    pub end_date: ::std::option::Option<::std::string::String>,
    /// <p>The current pagination position in the paged result set.</p>
    pub position: ::std::option::Option<::std::string::String>,
    /// <p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>
    pub limit: ::std::option::Option<i32>,
}
impl GetUsageInput {
    /// <p>The Id of the usage plan associated with the usage data.</p>
    pub fn usage_plan_id(&self) -> ::std::option::Option<&str> {
        self.usage_plan_id.as_deref()
    }
    /// <p>The Id of the API key associated with the resultant usage data.</p>
    pub fn key_id(&self) -> ::std::option::Option<&str> {
        self.key_id.as_deref()
    }
    /// <p>The starting date (e.g., 2016-01-01) of the usage data.</p>
    pub fn start_date(&self) -> ::std::option::Option<&str> {
        self.start_date.as_deref()
    }
    /// <p>The ending date (e.g., 2016-12-31) of the usage data.</p>
    pub fn end_date(&self) -> ::std::option::Option<&str> {
        self.end_date.as_deref()
    }
    /// <p>The current pagination position in the paged result set.</p>
    pub fn position(&self) -> ::std::option::Option<&str> {
        self.position.as_deref()
    }
    /// <p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>
    pub fn limit(&self) -> ::std::option::Option<i32> {
        self.limit
    }
}
impl GetUsageInput {
    /// Creates a new builder-style object to manufacture [`GetUsageInput`](crate::operation::get_usage::GetUsageInput).
    pub fn builder() -> crate::operation::get_usage::builders::GetUsageInputBuilder {
        crate::operation::get_usage::builders::GetUsageInputBuilder::default()
    }
}

/// A builder for [`GetUsageInput`](crate::operation::get_usage::GetUsageInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct GetUsageInputBuilder {
    pub(crate) usage_plan_id: ::std::option::Option<::std::string::String>,
    pub(crate) key_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) position: ::std::option::Option<::std::string::String>,
    pub(crate) limit: ::std::option::Option<i32>,
}
impl GetUsageInputBuilder {
    /// <p>The Id of the usage plan associated with the usage data.</p>
    /// This field is required.
    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 Id of the usage plan associated with the 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 Id of the usage plan associated with the usage data.</p>
    pub fn get_usage_plan_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.usage_plan_id
    }
    /// <p>The Id of the API key associated with the resultant usage data.</p>
    pub fn key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.key_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Id of the API key associated with the resultant usage data.</p>
    pub fn set_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.key_id = input;
        self
    }
    /// <p>The Id of the API key associated with the resultant usage data.</p>
    pub fn get_key_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.key_id
    }
    /// <p>The starting date (e.g., 2016-01-01) of the usage data.</p>
    /// This field is required.
    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 (e.g., 2016-01-01) 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 (e.g., 2016-01-01) of the usage data.</p>
    pub fn get_start_date(&self) -> &::std::option::Option<::std::string::String> {
        &self.start_date
    }
    /// <p>The ending date (e.g., 2016-12-31) of the usage data.</p>
    /// This field is required.
    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 (e.g., 2016-12-31) 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 (e.g., 2016-12-31) of the usage data.</p>
    pub fn get_end_date(&self) -> &::std::option::Option<::std::string::String> {
        &self.end_date
    }
    /// <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
    }
    /// <p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>
    pub fn limit(mut self, input: i32) -> Self {
        self.limit = ::std::option::Option::Some(input);
        self
    }
    /// <p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>
    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
        self.limit = input;
        self
    }
    /// <p>The maximum number of returned results per page. The default value is 25 and the maximum value is 500.</p>
    pub fn get_limit(&self) -> &::std::option::Option<i32> {
        &self.limit
    }
    /// Consumes the builder and constructs a [`GetUsageInput`](crate::operation::get_usage::GetUsageInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::get_usage::GetUsageInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_usage::GetUsageInput {
            usage_plan_id: self.usage_plan_id,
            key_id: self.key_id,
            start_date: self.start_date,
            end_date: self.end_date,
            position: self.position,
            limit: self.limit,
        })
    }
}