aws_sdk_dynamodb/operation/get_resource_policy/
_get_resource_policy_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 GetResourcePolicyOutput {
6    /// <p>The resource-based policy document attached to the resource, which can be a table or stream, in JSON format.</p>
7    pub policy: ::std::option::Option<::std::string::String>,
8    /// <p>A unique string that represents the revision ID of the policy. If you're comparing revision IDs, make sure to always use string comparison logic.</p>
9    pub revision_id: ::std::option::Option<::std::string::String>,
10    _request_id: Option<String>,
11}
12impl GetResourcePolicyOutput {
13    /// <p>The resource-based policy document attached to the resource, which can be a table or stream, in JSON format.</p>
14    pub fn policy(&self) -> ::std::option::Option<&str> {
15        self.policy.as_deref()
16    }
17    /// <p>A unique string that represents the revision ID of the policy. If you're comparing revision IDs, make sure to always use string comparison logic.</p>
18    pub fn revision_id(&self) -> ::std::option::Option<&str> {
19        self.revision_id.as_deref()
20    }
21}
22impl ::aws_types::request_id::RequestId for GetResourcePolicyOutput {
23    fn request_id(&self) -> Option<&str> {
24        self._request_id.as_deref()
25    }
26}
27impl GetResourcePolicyOutput {
28    /// Creates a new builder-style object to manufacture [`GetResourcePolicyOutput`](crate::operation::get_resource_policy::GetResourcePolicyOutput).
29    pub fn builder() -> crate::operation::get_resource_policy::builders::GetResourcePolicyOutputBuilder {
30        crate::operation::get_resource_policy::builders::GetResourcePolicyOutputBuilder::default()
31    }
32}
33
34/// A builder for [`GetResourcePolicyOutput`](crate::operation::get_resource_policy::GetResourcePolicyOutput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct GetResourcePolicyOutputBuilder {
38    pub(crate) policy: ::std::option::Option<::std::string::String>,
39    pub(crate) revision_id: ::std::option::Option<::std::string::String>,
40    _request_id: Option<String>,
41}
42impl GetResourcePolicyOutputBuilder {
43    /// <p>The resource-based policy document attached to the resource, which can be a table or stream, in JSON format.</p>
44    pub fn policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        self.policy = ::std::option::Option::Some(input.into());
46        self
47    }
48    /// <p>The resource-based policy document attached to the resource, which can be a table or stream, in JSON format.</p>
49    pub fn set_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.policy = input;
51        self
52    }
53    /// <p>The resource-based policy document attached to the resource, which can be a table or stream, in JSON format.</p>
54    pub fn get_policy(&self) -> &::std::option::Option<::std::string::String> {
55        &self.policy
56    }
57    /// <p>A unique string that represents the revision ID of the policy. If you're comparing revision IDs, make sure to always use string comparison logic.</p>
58    pub fn revision_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        self.revision_id = ::std::option::Option::Some(input.into());
60        self
61    }
62    /// <p>A unique string that represents the revision ID of the policy. If you're comparing revision IDs, make sure to always use string comparison logic.</p>
63    pub fn set_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64        self.revision_id = input;
65        self
66    }
67    /// <p>A unique string that represents the revision ID of the policy. If you're comparing revision IDs, make sure to always use string comparison logic.</p>
68    pub fn get_revision_id(&self) -> &::std::option::Option<::std::string::String> {
69        &self.revision_id
70    }
71    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
72        self._request_id = Some(request_id.into());
73        self
74    }
75
76    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
77        self._request_id = request_id;
78        self
79    }
80    /// Consumes the builder and constructs a [`GetResourcePolicyOutput`](crate::operation::get_resource_policy::GetResourcePolicyOutput).
81    pub fn build(self) -> crate::operation::get_resource_policy::GetResourcePolicyOutput {
82        crate::operation::get_resource_policy::GetResourcePolicyOutput {
83            policy: self.policy,
84            revision_id: self.revision_id,
85            _request_id: self._request_id,
86        }
87    }
88}