aws_sdk_iot/operation/get_policy/
_get_policy_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The output from the GetPolicy operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetPolicyOutput {
7    /// <p>The policy name.</p>
8    pub policy_name: ::std::option::Option<::std::string::String>,
9    /// <p>The policy ARN.</p>
10    pub policy_arn: ::std::option::Option<::std::string::String>,
11    /// <p>The JSON document that describes the policy.</p>
12    pub policy_document: ::std::option::Option<::std::string::String>,
13    /// <p>The default policy version ID.</p>
14    pub default_version_id: ::std::option::Option<::std::string::String>,
15    /// <p>The date the policy was created.</p>
16    pub creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
17    /// <p>The date the policy was last modified.</p>
18    pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
19    /// <p>The generation ID of the policy.</p>
20    pub generation_id: ::std::option::Option<::std::string::String>,
21    _request_id: Option<String>,
22}
23impl GetPolicyOutput {
24    /// <p>The policy name.</p>
25    pub fn policy_name(&self) -> ::std::option::Option<&str> {
26        self.policy_name.as_deref()
27    }
28    /// <p>The policy ARN.</p>
29    pub fn policy_arn(&self) -> ::std::option::Option<&str> {
30        self.policy_arn.as_deref()
31    }
32    /// <p>The JSON document that describes the policy.</p>
33    pub fn policy_document(&self) -> ::std::option::Option<&str> {
34        self.policy_document.as_deref()
35    }
36    /// <p>The default policy version ID.</p>
37    pub fn default_version_id(&self) -> ::std::option::Option<&str> {
38        self.default_version_id.as_deref()
39    }
40    /// <p>The date the policy was created.</p>
41    pub fn creation_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
42        self.creation_date.as_ref()
43    }
44    /// <p>The date the policy was last modified.</p>
45    pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
46        self.last_modified_date.as_ref()
47    }
48    /// <p>The generation ID of the policy.</p>
49    pub fn generation_id(&self) -> ::std::option::Option<&str> {
50        self.generation_id.as_deref()
51    }
52}
53impl ::aws_types::request_id::RequestId for GetPolicyOutput {
54    fn request_id(&self) -> Option<&str> {
55        self._request_id.as_deref()
56    }
57}
58impl GetPolicyOutput {
59    /// Creates a new builder-style object to manufacture [`GetPolicyOutput`](crate::operation::get_policy::GetPolicyOutput).
60    pub fn builder() -> crate::operation::get_policy::builders::GetPolicyOutputBuilder {
61        crate::operation::get_policy::builders::GetPolicyOutputBuilder::default()
62    }
63}
64
65/// A builder for [`GetPolicyOutput`](crate::operation::get_policy::GetPolicyOutput).
66#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
67#[non_exhaustive]
68pub struct GetPolicyOutputBuilder {
69    pub(crate) policy_name: ::std::option::Option<::std::string::String>,
70    pub(crate) policy_arn: ::std::option::Option<::std::string::String>,
71    pub(crate) policy_document: ::std::option::Option<::std::string::String>,
72    pub(crate) default_version_id: ::std::option::Option<::std::string::String>,
73    pub(crate) creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
74    pub(crate) last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
75    pub(crate) generation_id: ::std::option::Option<::std::string::String>,
76    _request_id: Option<String>,
77}
78impl GetPolicyOutputBuilder {
79    /// <p>The policy name.</p>
80    pub fn policy_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.policy_name = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The policy name.</p>
85    pub fn set_policy_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.policy_name = input;
87        self
88    }
89    /// <p>The policy name.</p>
90    pub fn get_policy_name(&self) -> &::std::option::Option<::std::string::String> {
91        &self.policy_name
92    }
93    /// <p>The policy ARN.</p>
94    pub fn policy_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.policy_arn = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The policy ARN.</p>
99    pub fn set_policy_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.policy_arn = input;
101        self
102    }
103    /// <p>The policy ARN.</p>
104    pub fn get_policy_arn(&self) -> &::std::option::Option<::std::string::String> {
105        &self.policy_arn
106    }
107    /// <p>The JSON document that describes the policy.</p>
108    pub fn policy_document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.policy_document = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The JSON document that describes the policy.</p>
113    pub fn set_policy_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.policy_document = input;
115        self
116    }
117    /// <p>The JSON document that describes the policy.</p>
118    pub fn get_policy_document(&self) -> &::std::option::Option<::std::string::String> {
119        &self.policy_document
120    }
121    /// <p>The default policy version ID.</p>
122    pub fn default_version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.default_version_id = ::std::option::Option::Some(input.into());
124        self
125    }
126    /// <p>The default policy version ID.</p>
127    pub fn set_default_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.default_version_id = input;
129        self
130    }
131    /// <p>The default policy version ID.</p>
132    pub fn get_default_version_id(&self) -> &::std::option::Option<::std::string::String> {
133        &self.default_version_id
134    }
135    /// <p>The date the policy was created.</p>
136    pub fn creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
137        self.creation_date = ::std::option::Option::Some(input);
138        self
139    }
140    /// <p>The date the policy was created.</p>
141    pub fn set_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
142        self.creation_date = input;
143        self
144    }
145    /// <p>The date the policy was created.</p>
146    pub fn get_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
147        &self.creation_date
148    }
149    /// <p>The date the policy was last modified.</p>
150    pub fn last_modified_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
151        self.last_modified_date = ::std::option::Option::Some(input);
152        self
153    }
154    /// <p>The date the policy was last modified.</p>
155    pub fn set_last_modified_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
156        self.last_modified_date = input;
157        self
158    }
159    /// <p>The date the policy was last modified.</p>
160    pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
161        &self.last_modified_date
162    }
163    /// <p>The generation ID of the policy.</p>
164    pub fn generation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.generation_id = ::std::option::Option::Some(input.into());
166        self
167    }
168    /// <p>The generation ID of the policy.</p>
169    pub fn set_generation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.generation_id = input;
171        self
172    }
173    /// <p>The generation ID of the policy.</p>
174    pub fn get_generation_id(&self) -> &::std::option::Option<::std::string::String> {
175        &self.generation_id
176    }
177    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
178        self._request_id = Some(request_id.into());
179        self
180    }
181
182    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
183        self._request_id = request_id;
184        self
185    }
186    /// Consumes the builder and constructs a [`GetPolicyOutput`](crate::operation::get_policy::GetPolicyOutput).
187    pub fn build(self) -> crate::operation::get_policy::GetPolicyOutput {
188        crate::operation::get_policy::GetPolicyOutput {
189            policy_name: self.policy_name,
190            policy_arn: self.policy_arn,
191            policy_document: self.policy_document,
192            default_version_id: self.default_version_id,
193            creation_date: self.creation_date,
194            last_modified_date: self.last_modified_date,
195            generation_id: self.generation_id,
196            _request_id: self._request_id,
197        }
198    }
199}