aws_sdk_kinesis/operation/describe_limits/
_describe_limits_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DescribeLimitsOutput {
6    /// <p>The maximum number of shards.</p>
7    pub shard_limit: i32,
8    /// <p>The number of open shards.</p>
9    pub open_shard_count: i32,
10    /// <p>Indicates the number of data streams with the on-demand capacity mode.</p>
11    pub on_demand_stream_count: i32,
12    /// <p>The maximum number of data streams with the on-demand capacity mode.</p>
13    pub on_demand_stream_count_limit: i32,
14    _request_id: Option<String>,
15}
16impl DescribeLimitsOutput {
17    /// <p>The maximum number of shards.</p>
18    pub fn shard_limit(&self) -> i32 {
19        self.shard_limit
20    }
21    /// <p>The number of open shards.</p>
22    pub fn open_shard_count(&self) -> i32 {
23        self.open_shard_count
24    }
25    /// <p>Indicates the number of data streams with the on-demand capacity mode.</p>
26    pub fn on_demand_stream_count(&self) -> i32 {
27        self.on_demand_stream_count
28    }
29    /// <p>The maximum number of data streams with the on-demand capacity mode.</p>
30    pub fn on_demand_stream_count_limit(&self) -> i32 {
31        self.on_demand_stream_count_limit
32    }
33}
34impl ::aws_types::request_id::RequestId for DescribeLimitsOutput {
35    fn request_id(&self) -> Option<&str> {
36        self._request_id.as_deref()
37    }
38}
39impl DescribeLimitsOutput {
40    /// Creates a new builder-style object to manufacture [`DescribeLimitsOutput`](crate::operation::describe_limits::DescribeLimitsOutput).
41    pub fn builder() -> crate::operation::describe_limits::builders::DescribeLimitsOutputBuilder {
42        crate::operation::describe_limits::builders::DescribeLimitsOutputBuilder::default()
43    }
44}
45
46/// A builder for [`DescribeLimitsOutput`](crate::operation::describe_limits::DescribeLimitsOutput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct DescribeLimitsOutputBuilder {
50    pub(crate) shard_limit: ::std::option::Option<i32>,
51    pub(crate) open_shard_count: ::std::option::Option<i32>,
52    pub(crate) on_demand_stream_count: ::std::option::Option<i32>,
53    pub(crate) on_demand_stream_count_limit: ::std::option::Option<i32>,
54    _request_id: Option<String>,
55}
56impl DescribeLimitsOutputBuilder {
57    /// <p>The maximum number of shards.</p>
58    /// This field is required.
59    pub fn shard_limit(mut self, input: i32) -> Self {
60        self.shard_limit = ::std::option::Option::Some(input);
61        self
62    }
63    /// <p>The maximum number of shards.</p>
64    pub fn set_shard_limit(mut self, input: ::std::option::Option<i32>) -> Self {
65        self.shard_limit = input;
66        self
67    }
68    /// <p>The maximum number of shards.</p>
69    pub fn get_shard_limit(&self) -> &::std::option::Option<i32> {
70        &self.shard_limit
71    }
72    /// <p>The number of open shards.</p>
73    /// This field is required.
74    pub fn open_shard_count(mut self, input: i32) -> Self {
75        self.open_shard_count = ::std::option::Option::Some(input);
76        self
77    }
78    /// <p>The number of open shards.</p>
79    pub fn set_open_shard_count(mut self, input: ::std::option::Option<i32>) -> Self {
80        self.open_shard_count = input;
81        self
82    }
83    /// <p>The number of open shards.</p>
84    pub fn get_open_shard_count(&self) -> &::std::option::Option<i32> {
85        &self.open_shard_count
86    }
87    /// <p>Indicates the number of data streams with the on-demand capacity mode.</p>
88    /// This field is required.
89    pub fn on_demand_stream_count(mut self, input: i32) -> Self {
90        self.on_demand_stream_count = ::std::option::Option::Some(input);
91        self
92    }
93    /// <p>Indicates the number of data streams with the on-demand capacity mode.</p>
94    pub fn set_on_demand_stream_count(mut self, input: ::std::option::Option<i32>) -> Self {
95        self.on_demand_stream_count = input;
96        self
97    }
98    /// <p>Indicates the number of data streams with the on-demand capacity mode.</p>
99    pub fn get_on_demand_stream_count(&self) -> &::std::option::Option<i32> {
100        &self.on_demand_stream_count
101    }
102    /// <p>The maximum number of data streams with the on-demand capacity mode.</p>
103    /// This field is required.
104    pub fn on_demand_stream_count_limit(mut self, input: i32) -> Self {
105        self.on_demand_stream_count_limit = ::std::option::Option::Some(input);
106        self
107    }
108    /// <p>The maximum number of data streams with the on-demand capacity mode.</p>
109    pub fn set_on_demand_stream_count_limit(mut self, input: ::std::option::Option<i32>) -> Self {
110        self.on_demand_stream_count_limit = input;
111        self
112    }
113    /// <p>The maximum number of data streams with the on-demand capacity mode.</p>
114    pub fn get_on_demand_stream_count_limit(&self) -> &::std::option::Option<i32> {
115        &self.on_demand_stream_count_limit
116    }
117    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
118        self._request_id = Some(request_id.into());
119        self
120    }
121
122    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
123        self._request_id = request_id;
124        self
125    }
126    /// Consumes the builder and constructs a [`DescribeLimitsOutput`](crate::operation::describe_limits::DescribeLimitsOutput).
127    /// This method will fail if any of the following fields are not set:
128    /// - [`shard_limit`](crate::operation::describe_limits::builders::DescribeLimitsOutputBuilder::shard_limit)
129    /// - [`open_shard_count`](crate::operation::describe_limits::builders::DescribeLimitsOutputBuilder::open_shard_count)
130    /// - [`on_demand_stream_count`](crate::operation::describe_limits::builders::DescribeLimitsOutputBuilder::on_demand_stream_count)
131    /// - [`on_demand_stream_count_limit`](crate::operation::describe_limits::builders::DescribeLimitsOutputBuilder::on_demand_stream_count_limit)
132    pub fn build(
133        self,
134    ) -> ::std::result::Result<crate::operation::describe_limits::DescribeLimitsOutput, ::aws_smithy_types::error::operation::BuildError> {
135        ::std::result::Result::Ok(crate::operation::describe_limits::DescribeLimitsOutput {
136            shard_limit: self.shard_limit.ok_or_else(|| {
137                ::aws_smithy_types::error::operation::BuildError::missing_field(
138                    "shard_limit",
139                    "shard_limit was not specified but it is required when building DescribeLimitsOutput",
140                )
141            })?,
142            open_shard_count: self.open_shard_count.ok_or_else(|| {
143                ::aws_smithy_types::error::operation::BuildError::missing_field(
144                    "open_shard_count",
145                    "open_shard_count was not specified but it is required when building DescribeLimitsOutput",
146                )
147            })?,
148            on_demand_stream_count: self.on_demand_stream_count.ok_or_else(|| {
149                ::aws_smithy_types::error::operation::BuildError::missing_field(
150                    "on_demand_stream_count",
151                    "on_demand_stream_count was not specified but it is required when building DescribeLimitsOutput",
152                )
153            })?,
154            on_demand_stream_count_limit: self.on_demand_stream_count_limit.ok_or_else(|| {
155                ::aws_smithy_types::error::operation::BuildError::missing_field(
156                    "on_demand_stream_count_limit",
157                    "on_demand_stream_count_limit was not specified but it is required when building DescribeLimitsOutput",
158                )
159            })?,
160            _request_id: self._request_id,
161        })
162    }
163}