aws_sdk_iot/operation/create_policy/
_create_policy_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The output from the CreatePolicy operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreatePolicyOutput {
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 policy version ID.</p>
14    pub policy_version_id: ::std::option::Option<::std::string::String>,
15    _request_id: Option<String>,
16}
17impl CreatePolicyOutput {
18    /// <p>The policy name.</p>
19    pub fn policy_name(&self) -> ::std::option::Option<&str> {
20        self.policy_name.as_deref()
21    }
22    /// <p>The policy ARN.</p>
23    pub fn policy_arn(&self) -> ::std::option::Option<&str> {
24        self.policy_arn.as_deref()
25    }
26    /// <p>The JSON document that describes the policy.</p>
27    pub fn policy_document(&self) -> ::std::option::Option<&str> {
28        self.policy_document.as_deref()
29    }
30    /// <p>The policy version ID.</p>
31    pub fn policy_version_id(&self) -> ::std::option::Option<&str> {
32        self.policy_version_id.as_deref()
33    }
34}
35impl ::aws_types::request_id::RequestId for CreatePolicyOutput {
36    fn request_id(&self) -> Option<&str> {
37        self._request_id.as_deref()
38    }
39}
40impl CreatePolicyOutput {
41    /// Creates a new builder-style object to manufacture [`CreatePolicyOutput`](crate::operation::create_policy::CreatePolicyOutput).
42    pub fn builder() -> crate::operation::create_policy::builders::CreatePolicyOutputBuilder {
43        crate::operation::create_policy::builders::CreatePolicyOutputBuilder::default()
44    }
45}
46
47/// A builder for [`CreatePolicyOutput`](crate::operation::create_policy::CreatePolicyOutput).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct CreatePolicyOutputBuilder {
51    pub(crate) policy_name: ::std::option::Option<::std::string::String>,
52    pub(crate) policy_arn: ::std::option::Option<::std::string::String>,
53    pub(crate) policy_document: ::std::option::Option<::std::string::String>,
54    pub(crate) policy_version_id: ::std::option::Option<::std::string::String>,
55    _request_id: Option<String>,
56}
57impl CreatePolicyOutputBuilder {
58    /// <p>The policy name.</p>
59    pub fn policy_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.policy_name = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The policy name.</p>
64    pub fn set_policy_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.policy_name = input;
66        self
67    }
68    /// <p>The policy name.</p>
69    pub fn get_policy_name(&self) -> &::std::option::Option<::std::string::String> {
70        &self.policy_name
71    }
72    /// <p>The policy ARN.</p>
73    pub fn policy_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.policy_arn = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>The policy ARN.</p>
78    pub fn set_policy_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.policy_arn = input;
80        self
81    }
82    /// <p>The policy ARN.</p>
83    pub fn get_policy_arn(&self) -> &::std::option::Option<::std::string::String> {
84        &self.policy_arn
85    }
86    /// <p>The JSON document that describes the policy.</p>
87    pub fn policy_document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88        self.policy_document = ::std::option::Option::Some(input.into());
89        self
90    }
91    /// <p>The JSON document that describes the policy.</p>
92    pub fn set_policy_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93        self.policy_document = input;
94        self
95    }
96    /// <p>The JSON document that describes the policy.</p>
97    pub fn get_policy_document(&self) -> &::std::option::Option<::std::string::String> {
98        &self.policy_document
99    }
100    /// <p>The policy version ID.</p>
101    pub fn policy_version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        self.policy_version_id = ::std::option::Option::Some(input.into());
103        self
104    }
105    /// <p>The policy version ID.</p>
106    pub fn set_policy_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107        self.policy_version_id = input;
108        self
109    }
110    /// <p>The policy version ID.</p>
111    pub fn get_policy_version_id(&self) -> &::std::option::Option<::std::string::String> {
112        &self.policy_version_id
113    }
114    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
115        self._request_id = Some(request_id.into());
116        self
117    }
118
119    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
120        self._request_id = request_id;
121        self
122    }
123    /// Consumes the builder and constructs a [`CreatePolicyOutput`](crate::operation::create_policy::CreatePolicyOutput).
124    pub fn build(self) -> crate::operation::create_policy::CreatePolicyOutput {
125        crate::operation::create_policy::CreatePolicyOutput {
126            policy_name: self.policy_name,
127            policy_arn: self.policy_arn,
128            policy_document: self.policy_document,
129            policy_version_id: self.policy_version_id,
130            _request_id: self._request_id,
131        }
132    }
133}