#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct GetResourcePolicyOutput {
pub resource_arn: ::std::string::String,
pub policy_type: crate::types::PolicyType,
pub policy_version_arn: ::std::option::Option<::std::string::String>,
pub policy_name: ::std::string::String,
pub policy_document: ::std::string::String,
_request_id: Option<String>,
}
impl GetResourcePolicyOutput {
pub fn resource_arn(&self) -> &str {
use std::ops::Deref;
self.resource_arn.deref()
}
pub fn policy_type(&self) -> &crate::types::PolicyType {
&self.policy_type
}
pub fn policy_version_arn(&self) -> ::std::option::Option<&str> {
self.policy_version_arn.as_deref()
}
pub fn policy_name(&self) -> &str {
use std::ops::Deref;
self.policy_name.deref()
}
pub fn policy_document(&self) -> &str {
use std::ops::Deref;
self.policy_document.deref()
}
}
impl ::std::fmt::Debug for GetResourcePolicyOutput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("GetResourcePolicyOutput");
formatter.field("resource_arn", &self.resource_arn);
formatter.field("policy_type", &self.policy_type);
formatter.field("policy_version_arn", &self.policy_version_arn);
formatter.field("policy_name", &self.policy_name);
formatter.field("policy_document", &"*** Sensitive Data Redacted ***");
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}
impl ::aws_types::request_id::RequestId for GetResourcePolicyOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetResourcePolicyOutput {
pub fn builder() -> crate::operation::get_resource_policy::builders::GetResourcePolicyOutputBuilder {
crate::operation::get_resource_policy::builders::GetResourcePolicyOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetResourcePolicyOutputBuilder {
pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
pub(crate) policy_type: ::std::option::Option<crate::types::PolicyType>,
pub(crate) policy_version_arn: ::std::option::Option<::std::string::String>,
pub(crate) policy_name: ::std::option::Option<::std::string::String>,
pub(crate) policy_document: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl GetResourcePolicyOutputBuilder {
pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.resource_arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.resource_arn
}
pub fn policy_type(mut self, input: crate::types::PolicyType) -> Self {
self.policy_type = ::std::option::Option::Some(input);
self
}
pub fn set_policy_type(mut self, input: ::std::option::Option<crate::types::PolicyType>) -> Self {
self.policy_type = input;
self
}
pub fn get_policy_type(&self) -> &::std::option::Option<crate::types::PolicyType> {
&self.policy_type
}
pub fn policy_version_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.policy_version_arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_policy_version_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.policy_version_arn = input;
self
}
pub fn get_policy_version_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.policy_version_arn
}
pub fn policy_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.policy_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_policy_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.policy_name = input;
self
}
pub fn get_policy_name(&self) -> &::std::option::Option<::std::string::String> {
&self.policy_name
}
pub fn policy_document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.policy_document = ::std::option::Option::Some(input.into());
self
}
pub fn set_policy_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.policy_document = input;
self
}
pub fn get_policy_document(&self) -> &::std::option::Option<::std::string::String> {
&self.policy_document
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::get_resource_policy::GetResourcePolicyOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_resource_policy::GetResourcePolicyOutput {
resource_arn: self.resource_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"resource_arn",
"resource_arn was not specified but it is required when building GetResourcePolicyOutput",
)
})?,
policy_type: self.policy_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"policy_type",
"policy_type was not specified but it is required when building GetResourcePolicyOutput",
)
})?,
policy_version_arn: self.policy_version_arn,
policy_name: self.policy_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"policy_name",
"policy_name was not specified but it is required when building GetResourcePolicyOutput",
)
})?,
policy_document: self.policy_document.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"policy_document",
"policy_document was not specified but it is required when building GetResourcePolicyOutput",
)
})?,
_request_id: self._request_id,
})
}
}
impl ::std::fmt::Debug for GetResourcePolicyOutputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("GetResourcePolicyOutputBuilder");
formatter.field("resource_arn", &self.resource_arn);
formatter.field("policy_type", &self.policy_type);
formatter.field("policy_version_arn", &self.policy_version_arn);
formatter.field("policy_name", &self.policy_name);
formatter.field("policy_document", &"*** Sensitive Data Redacted ***");
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}