aws_sdk_codeguruprofiler/operation/get_policy/
_get_policy_output.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct GetPolicyOutput {
7 pub policy: ::std::string::String,
9 pub revision_id: ::std::string::String,
11 _request_id: Option<String>,
12}
13impl GetPolicyOutput {
14 pub fn policy(&self) -> &str {
16 use std::ops::Deref;
17 self.policy.deref()
18 }
19 pub fn revision_id(&self) -> &str {
21 use std::ops::Deref;
22 self.revision_id.deref()
23 }
24}
25impl ::aws_types::request_id::RequestId for GetPolicyOutput {
26 fn request_id(&self) -> Option<&str> {
27 self._request_id.as_deref()
28 }
29}
30impl GetPolicyOutput {
31 pub fn builder() -> crate::operation::get_policy::builders::GetPolicyOutputBuilder {
33 crate::operation::get_policy::builders::GetPolicyOutputBuilder::default()
34 }
35}
36
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct GetPolicyOutputBuilder {
41 pub(crate) policy: ::std::option::Option<::std::string::String>,
42 pub(crate) revision_id: ::std::option::Option<::std::string::String>,
43 _request_id: Option<String>,
44}
45impl GetPolicyOutputBuilder {
46 pub fn policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49 self.policy = ::std::option::Option::Some(input.into());
50 self
51 }
52 pub fn set_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54 self.policy = input;
55 self
56 }
57 pub fn get_policy(&self) -> &::std::option::Option<::std::string::String> {
59 &self.policy
60 }
61 pub fn revision_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64 self.revision_id = ::std::option::Option::Some(input.into());
65 self
66 }
67 pub fn set_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69 self.revision_id = input;
70 self
71 }
72 pub fn get_revision_id(&self) -> &::std::option::Option<::std::string::String> {
74 &self.revision_id
75 }
76 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
77 self._request_id = Some(request_id.into());
78 self
79 }
80
81 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
82 self._request_id = request_id;
83 self
84 }
85 pub fn build(self) -> ::std::result::Result<crate::operation::get_policy::GetPolicyOutput, ::aws_smithy_types::error::operation::BuildError> {
90 ::std::result::Result::Ok(crate::operation::get_policy::GetPolicyOutput {
91 policy: self.policy.ok_or_else(|| {
92 ::aws_smithy_types::error::operation::BuildError::missing_field(
93 "policy",
94 "policy was not specified but it is required when building GetPolicyOutput",
95 )
96 })?,
97 revision_id: self.revision_id.ok_or_else(|| {
98 ::aws_smithy_types::error::operation::BuildError::missing_field(
99 "revision_id",
100 "revision_id was not specified but it is required when building GetPolicyOutput",
101 )
102 })?,
103 _request_id: self._request_id,
104 })
105 }
106}