aws_sdk_entityresolution/operation/get_policy/
_get_policy_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetPolicyOutput {
6 pub arn: ::std::string::String,
8 pub token: ::std::string::String,
10 pub policy: ::std::option::Option<::std::string::String>,
12 _request_id: Option<String>,
13}
14impl GetPolicyOutput {
15 pub fn arn(&self) -> &str {
17 use std::ops::Deref;
18 self.arn.deref()
19 }
20 pub fn token(&self) -> &str {
22 use std::ops::Deref;
23 self.token.deref()
24 }
25 pub fn policy(&self) -> ::std::option::Option<&str> {
27 self.policy.as_deref()
28 }
29}
30impl ::aws_types::request_id::RequestId for GetPolicyOutput {
31 fn request_id(&self) -> Option<&str> {
32 self._request_id.as_deref()
33 }
34}
35impl GetPolicyOutput {
36 pub fn builder() -> crate::operation::get_policy::builders::GetPolicyOutputBuilder {
38 crate::operation::get_policy::builders::GetPolicyOutputBuilder::default()
39 }
40}
41
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct GetPolicyOutputBuilder {
46 pub(crate) arn: ::std::option::Option<::std::string::String>,
47 pub(crate) token: ::std::option::Option<::std::string::String>,
48 pub(crate) policy: ::std::option::Option<::std::string::String>,
49 _request_id: Option<String>,
50}
51impl GetPolicyOutputBuilder {
52 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55 self.arn = ::std::option::Option::Some(input.into());
56 self
57 }
58 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60 self.arn = input;
61 self
62 }
63 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
65 &self.arn
66 }
67 pub fn token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70 self.token = ::std::option::Option::Some(input.into());
71 self
72 }
73 pub fn set_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75 self.token = input;
76 self
77 }
78 pub fn get_token(&self) -> &::std::option::Option<::std::string::String> {
80 &self.token
81 }
82 pub fn policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84 self.policy = ::std::option::Option::Some(input.into());
85 self
86 }
87 pub fn set_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89 self.policy = input;
90 self
91 }
92 pub fn get_policy(&self) -> &::std::option::Option<::std::string::String> {
94 &self.policy
95 }
96 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
97 self._request_id = Some(request_id.into());
98 self
99 }
100
101 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
102 self._request_id = request_id;
103 self
104 }
105 pub fn build(self) -> ::std::result::Result<crate::operation::get_policy::GetPolicyOutput, ::aws_smithy_types::error::operation::BuildError> {
110 ::std::result::Result::Ok(crate::operation::get_policy::GetPolicyOutput {
111 arn: self.arn.ok_or_else(|| {
112 ::aws_smithy_types::error::operation::BuildError::missing_field(
113 "arn",
114 "arn was not specified but it is required when building GetPolicyOutput",
115 )
116 })?,
117 token: self.token.ok_or_else(|| {
118 ::aws_smithy_types::error::operation::BuildError::missing_field(
119 "token",
120 "token was not specified but it is required when building GetPolicyOutput",
121 )
122 })?,
123 policy: self.policy,
124 _request_id: self._request_id,
125 })
126 }
127}