aws_sdk_apigateway/operation/get_account/
_get_account_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents an AWS account that is associated with API Gateway.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetAccountOutput {
7    /// <p>The ARN of an Amazon CloudWatch role for the current Account.</p>
8    pub cloudwatch_role_arn: ::std::option::Option<::std::string::String>,
9    /// <p>Specifies the API request limits configured for the current Account.</p>
10    pub throttle_settings: ::std::option::Option<crate::types::ThrottleSettings>,
11    /// <p>A list of features supported for the account. When usage plans are enabled, the features list will include an entry of <code>"UsagePlans"</code>.</p>
12    pub features: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
13    /// <p>The version of the API keys used for the account.</p>
14    pub api_key_version: ::std::option::Option<::std::string::String>,
15    _request_id: Option<String>,
16}
17impl GetAccountOutput {
18    /// <p>The ARN of an Amazon CloudWatch role for the current Account.</p>
19    pub fn cloudwatch_role_arn(&self) -> ::std::option::Option<&str> {
20        self.cloudwatch_role_arn.as_deref()
21    }
22    /// <p>Specifies the API request limits configured for the current Account.</p>
23    pub fn throttle_settings(&self) -> ::std::option::Option<&crate::types::ThrottleSettings> {
24        self.throttle_settings.as_ref()
25    }
26    /// <p>A list of features supported for the account. When usage plans are enabled, the features list will include an entry of <code>"UsagePlans"</code>.</p>
27    ///
28    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.features.is_none()`.
29    pub fn features(&self) -> &[::std::string::String] {
30        self.features.as_deref().unwrap_or_default()
31    }
32    /// <p>The version of the API keys used for the account.</p>
33    pub fn api_key_version(&self) -> ::std::option::Option<&str> {
34        self.api_key_version.as_deref()
35    }
36}
37impl ::aws_types::request_id::RequestId for GetAccountOutput {
38    fn request_id(&self) -> Option<&str> {
39        self._request_id.as_deref()
40    }
41}
42impl GetAccountOutput {
43    /// Creates a new builder-style object to manufacture [`GetAccountOutput`](crate::operation::get_account::GetAccountOutput).
44    pub fn builder() -> crate::operation::get_account::builders::GetAccountOutputBuilder {
45        crate::operation::get_account::builders::GetAccountOutputBuilder::default()
46    }
47}
48
49/// A builder for [`GetAccountOutput`](crate::operation::get_account::GetAccountOutput).
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
51#[non_exhaustive]
52pub struct GetAccountOutputBuilder {
53    pub(crate) cloudwatch_role_arn: ::std::option::Option<::std::string::String>,
54    pub(crate) throttle_settings: ::std::option::Option<crate::types::ThrottleSettings>,
55    pub(crate) features: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
56    pub(crate) api_key_version: ::std::option::Option<::std::string::String>,
57    _request_id: Option<String>,
58}
59impl GetAccountOutputBuilder {
60    /// <p>The ARN of an Amazon CloudWatch role for the current Account.</p>
61    pub fn cloudwatch_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.cloudwatch_role_arn = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The ARN of an Amazon CloudWatch role for the current Account.</p>
66    pub fn set_cloudwatch_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.cloudwatch_role_arn = input;
68        self
69    }
70    /// <p>The ARN of an Amazon CloudWatch role for the current Account.</p>
71    pub fn get_cloudwatch_role_arn(&self) -> &::std::option::Option<::std::string::String> {
72        &self.cloudwatch_role_arn
73    }
74    /// <p>Specifies the API request limits configured for the current Account.</p>
75    pub fn throttle_settings(mut self, input: crate::types::ThrottleSettings) -> Self {
76        self.throttle_settings = ::std::option::Option::Some(input);
77        self
78    }
79    /// <p>Specifies the API request limits configured for the current Account.</p>
80    pub fn set_throttle_settings(mut self, input: ::std::option::Option<crate::types::ThrottleSettings>) -> Self {
81        self.throttle_settings = input;
82        self
83    }
84    /// <p>Specifies the API request limits configured for the current Account.</p>
85    pub fn get_throttle_settings(&self) -> &::std::option::Option<crate::types::ThrottleSettings> {
86        &self.throttle_settings
87    }
88    /// Appends an item to `features`.
89    ///
90    /// To override the contents of this collection use [`set_features`](Self::set_features).
91    ///
92    /// <p>A list of features supported for the account. When usage plans are enabled, the features list will include an entry of <code>"UsagePlans"</code>.</p>
93    pub fn features(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        let mut v = self.features.unwrap_or_default();
95        v.push(input.into());
96        self.features = ::std::option::Option::Some(v);
97        self
98    }
99    /// <p>A list of features supported for the account. When usage plans are enabled, the features list will include an entry of <code>"UsagePlans"</code>.</p>
100    pub fn set_features(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
101        self.features = input;
102        self
103    }
104    /// <p>A list of features supported for the account. When usage plans are enabled, the features list will include an entry of <code>"UsagePlans"</code>.</p>
105    pub fn get_features(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
106        &self.features
107    }
108    /// <p>The version of the API keys used for the account.</p>
109    pub fn api_key_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.api_key_version = ::std::option::Option::Some(input.into());
111        self
112    }
113    /// <p>The version of the API keys used for the account.</p>
114    pub fn set_api_key_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.api_key_version = input;
116        self
117    }
118    /// <p>The version of the API keys used for the account.</p>
119    pub fn get_api_key_version(&self) -> &::std::option::Option<::std::string::String> {
120        &self.api_key_version
121    }
122    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
123        self._request_id = Some(request_id.into());
124        self
125    }
126
127    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
128        self._request_id = request_id;
129        self
130    }
131    /// Consumes the builder and constructs a [`GetAccountOutput`](crate::operation::get_account::GetAccountOutput).
132    pub fn build(self) -> crate::operation::get_account::GetAccountOutput {
133        crate::operation::get_account::GetAccountOutput {
134            cloudwatch_role_arn: self.cloudwatch_role_arn,
135            throttle_settings: self.throttle_settings,
136            features: self.features,
137            api_key_version: self.api_key_version,
138            _request_id: self._request_id,
139        }
140    }
141}