#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetClusterPolicyOutput {
pub policy: ::std::string::String,
pub policy_version: ::std::string::String,
_request_id: Option<String>,
}
impl GetClusterPolicyOutput {
pub fn policy(&self) -> &str {
use std::ops::Deref;
self.policy.deref()
}
pub fn policy_version(&self) -> &str {
use std::ops::Deref;
self.policy_version.deref()
}
}
impl ::aws_types::request_id::RequestId for GetClusterPolicyOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetClusterPolicyOutput {
pub fn builder() -> crate::operation::get_cluster_policy::builders::GetClusterPolicyOutputBuilder {
crate::operation::get_cluster_policy::builders::GetClusterPolicyOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetClusterPolicyOutputBuilder {
pub(crate) policy: ::std::option::Option<::std::string::String>,
pub(crate) policy_version: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl GetClusterPolicyOutputBuilder {
pub fn policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.policy = ::std::option::Option::Some(input.into());
self
}
pub fn set_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.policy = input;
self
}
pub fn get_policy(&self) -> &::std::option::Option<::std::string::String> {
&self.policy
}
pub fn policy_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.policy_version = ::std::option::Option::Some(input.into());
self
}
pub fn set_policy_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.policy_version = input;
self
}
pub fn get_policy_version(&self) -> &::std::option::Option<::std::string::String> {
&self.policy_version
}
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_cluster_policy::GetClusterPolicyOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_cluster_policy::GetClusterPolicyOutput {
policy: self.policy.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"policy",
"policy was not specified but it is required when building GetClusterPolicyOutput",
)
})?,
policy_version: self.policy_version.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"policy_version",
"policy_version was not specified but it is required when building GetClusterPolicyOutput",
)
})?,
_request_id: self._request_id,
})
}
}