aws_sdk_codeguruprofiler/operation/remove_permission/_remove_permission_output.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The structure representing the <code>removePermissionResponse</code>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct RemovePermissionOutput {
7 /// <p>The JSON-formatted resource-based policy on the profiling group after the specified permissions were removed.</p>
8 pub policy: ::std::string::String,
9 /// <p>A universally unique identifier (UUID) for the revision of the resource-based policy after the specified permissions were removed. The updated JSON-formatted policy is in the <code>policy</code> element of the response.</p>
10 pub revision_id: ::std::string::String,
11 _request_id: Option<String>,
12}
13impl RemovePermissionOutput {
14 /// <p>The JSON-formatted resource-based policy on the profiling group after the specified permissions were removed.</p>
15 pub fn policy(&self) -> &str {
16 use std::ops::Deref;
17 self.policy.deref()
18 }
19 /// <p>A universally unique identifier (UUID) for the revision of the resource-based policy after the specified permissions were removed. The updated JSON-formatted policy is in the <code>policy</code> element of the response.</p>
20 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 RemovePermissionOutput {
26 fn request_id(&self) -> Option<&str> {
27 self._request_id.as_deref()
28 }
29}
30impl RemovePermissionOutput {
31 /// Creates a new builder-style object to manufacture [`RemovePermissionOutput`](crate::operation::remove_permission::RemovePermissionOutput).
32 pub fn builder() -> crate::operation::remove_permission::builders::RemovePermissionOutputBuilder {
33 crate::operation::remove_permission::builders::RemovePermissionOutputBuilder::default()
34 }
35}
36
37/// A builder for [`RemovePermissionOutput`](crate::operation::remove_permission::RemovePermissionOutput).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct RemovePermissionOutputBuilder {
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 RemovePermissionOutputBuilder {
46 /// <p>The JSON-formatted resource-based policy on the profiling group after the specified permissions were removed.</p>
47 /// This field is required.
48 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 /// <p>The JSON-formatted resource-based policy on the profiling group after the specified permissions were removed.</p>
53 pub fn set_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54 self.policy = input;
55 self
56 }
57 /// <p>The JSON-formatted resource-based policy on the profiling group after the specified permissions were removed.</p>
58 pub fn get_policy(&self) -> &::std::option::Option<::std::string::String> {
59 &self.policy
60 }
61 /// <p>A universally unique identifier (UUID) for the revision of the resource-based policy after the specified permissions were removed. The updated JSON-formatted policy is in the <code>policy</code> element of the response.</p>
62 /// This field is required.
63 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 /// <p>A universally unique identifier (UUID) for the revision of the resource-based policy after the specified permissions were removed. The updated JSON-formatted policy is in the <code>policy</code> element of the response.</p>
68 pub fn set_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69 self.revision_id = input;
70 self
71 }
72 /// <p>A universally unique identifier (UUID) for the revision of the resource-based policy after the specified permissions were removed. The updated JSON-formatted policy is in the <code>policy</code> element of the response.</p>
73 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 /// Consumes the builder and constructs a [`RemovePermissionOutput`](crate::operation::remove_permission::RemovePermissionOutput).
86 /// This method will fail if any of the following fields are not set:
87 /// - [`policy`](crate::operation::remove_permission::builders::RemovePermissionOutputBuilder::policy)
88 /// - [`revision_id`](crate::operation::remove_permission::builders::RemovePermissionOutputBuilder::revision_id)
89 pub fn build(
90 self,
91 ) -> ::std::result::Result<crate::operation::remove_permission::RemovePermissionOutput, ::aws_smithy_types::error::operation::BuildError> {
92 ::std::result::Result::Ok(crate::operation::remove_permission::RemovePermissionOutput {
93 policy: self.policy.ok_or_else(|| {
94 ::aws_smithy_types::error::operation::BuildError::missing_field(
95 "policy",
96 "policy was not specified but it is required when building RemovePermissionOutput",
97 )
98 })?,
99 revision_id: self.revision_id.ok_or_else(|| {
100 ::aws_smithy_types::error::operation::BuildError::missing_field(
101 "revision_id",
102 "revision_id was not specified but it is required when building RemovePermissionOutput",
103 )
104 })?,
105 _request_id: self._request_id,
106 })
107 }
108}