aws_sdk_iam/operation/create_policy/
_create_policy_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the response to a successful <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreatePolicy.html">CreatePolicy</a> request.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreatePolicyOutput {
7    /// <p>A structure containing details about the new policy.</p>
8    pub policy: ::std::option::Option<crate::types::Policy>,
9    _request_id: Option<String>,
10}
11impl CreatePolicyOutput {
12    /// <p>A structure containing details about the new policy.</p>
13    pub fn policy(&self) -> ::std::option::Option<&crate::types::Policy> {
14        self.policy.as_ref()
15    }
16}
17impl ::aws_types::request_id::RequestId for CreatePolicyOutput {
18    fn request_id(&self) -> Option<&str> {
19        self._request_id.as_deref()
20    }
21}
22impl CreatePolicyOutput {
23    /// Creates a new builder-style object to manufacture [`CreatePolicyOutput`](crate::operation::create_policy::CreatePolicyOutput).
24    pub fn builder() -> crate::operation::create_policy::builders::CreatePolicyOutputBuilder {
25        crate::operation::create_policy::builders::CreatePolicyOutputBuilder::default()
26    }
27}
28
29/// A builder for [`CreatePolicyOutput`](crate::operation::create_policy::CreatePolicyOutput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct CreatePolicyOutputBuilder {
33    pub(crate) policy: ::std::option::Option<crate::types::Policy>,
34    _request_id: Option<String>,
35}
36impl CreatePolicyOutputBuilder {
37    /// <p>A structure containing details about the new policy.</p>
38    pub fn policy(mut self, input: crate::types::Policy) -> Self {
39        self.policy = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>A structure containing details about the new policy.</p>
43    pub fn set_policy(mut self, input: ::std::option::Option<crate::types::Policy>) -> Self {
44        self.policy = input;
45        self
46    }
47    /// <p>A structure containing details about the new policy.</p>
48    pub fn get_policy(&self) -> &::std::option::Option<crate::types::Policy> {
49        &self.policy
50    }
51    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
52        self._request_id = Some(request_id.into());
53        self
54    }
55
56    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
57        self._request_id = request_id;
58        self
59    }
60    /// Consumes the builder and constructs a [`CreatePolicyOutput`](crate::operation::create_policy::CreatePolicyOutput).
61    pub fn build(self) -> crate::operation::create_policy::CreatePolicyOutput {
62        crate::operation::create_policy::CreatePolicyOutput {
63            policy: self.policy,
64            _request_id: self._request_id,
65        }
66    }
67}