#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct DescribeNotificationRuleOutput {
pub arn: ::std::string::String,
pub name: ::std::option::Option<::std::string::String>,
pub event_types: ::std::option::Option<::std::vec::Vec<crate::types::EventTypeSummary>>,
pub resource: ::std::option::Option<::std::string::String>,
pub targets: ::std::option::Option<::std::vec::Vec<crate::types::TargetSummary>>,
pub detail_type: ::std::option::Option<crate::types::DetailType>,
pub created_by: ::std::option::Option<::std::string::String>,
pub status: ::std::option::Option<crate::types::NotificationRuleStatus>,
pub created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
pub last_modified_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
_request_id: Option<String>,
}
impl DescribeNotificationRuleOutput {
pub fn arn(&self) -> &str {
use std::ops::Deref;
self.arn.deref()
}
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
pub fn event_types(&self) -> &[crate::types::EventTypeSummary] {
self.event_types.as_deref().unwrap_or_default()
}
pub fn resource(&self) -> ::std::option::Option<&str> {
self.resource.as_deref()
}
pub fn targets(&self) -> &[crate::types::TargetSummary] {
self.targets.as_deref().unwrap_or_default()
}
pub fn detail_type(&self) -> ::std::option::Option<&crate::types::DetailType> {
self.detail_type.as_ref()
}
pub fn created_by(&self) -> ::std::option::Option<&str> {
self.created_by.as_deref()
}
pub fn status(&self) -> ::std::option::Option<&crate::types::NotificationRuleStatus> {
self.status.as_ref()
}
pub fn created_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.created_timestamp.as_ref()
}
pub fn last_modified_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.last_modified_timestamp.as_ref()
}
pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.tags.as_ref()
}
}
impl ::std::fmt::Debug for DescribeNotificationRuleOutput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("DescribeNotificationRuleOutput");
formatter.field("arn", &self.arn);
formatter.field("name", &"*** Sensitive Data Redacted ***");
formatter.field("event_types", &self.event_types);
formatter.field("resource", &self.resource);
formatter.field("targets", &self.targets);
formatter.field("detail_type", &self.detail_type);
formatter.field("created_by", &self.created_by);
formatter.field("status", &self.status);
formatter.field("created_timestamp", &self.created_timestamp);
formatter.field("last_modified_timestamp", &self.last_modified_timestamp);
formatter.field("tags", &self.tags);
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}
impl ::aws_types::request_id::RequestId for DescribeNotificationRuleOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl DescribeNotificationRuleOutput {
pub fn builder() -> crate::operation::describe_notification_rule::builders::DescribeNotificationRuleOutputBuilder {
crate::operation::describe_notification_rule::builders::DescribeNotificationRuleOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct DescribeNotificationRuleOutputBuilder {
pub(crate) arn: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) event_types: ::std::option::Option<::std::vec::Vec<crate::types::EventTypeSummary>>,
pub(crate) resource: ::std::option::Option<::std::string::String>,
pub(crate) targets: ::std::option::Option<::std::vec::Vec<crate::types::TargetSummary>>,
pub(crate) detail_type: ::std::option::Option<crate::types::DetailType>,
pub(crate) created_by: ::std::option::Option<::std::string::String>,
pub(crate) status: ::std::option::Option<crate::types::NotificationRuleStatus>,
pub(crate) created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) last_modified_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
_request_id: Option<String>,
}
impl DescribeNotificationRuleOutputBuilder {
pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.arn = ::std::option::Option::Some(input.into());
self
}
pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.arn = input;
self
}
pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.arn
}
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
pub fn event_types(mut self, input: crate::types::EventTypeSummary) -> Self {
let mut v = self.event_types.unwrap_or_default();
v.push(input);
self.event_types = ::std::option::Option::Some(v);
self
}
pub fn set_event_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EventTypeSummary>>) -> Self {
self.event_types = input;
self
}
pub fn get_event_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EventTypeSummary>> {
&self.event_types
}
pub fn resource(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.resource = ::std::option::Option::Some(input.into());
self
}
pub fn set_resource(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.resource = input;
self
}
pub fn get_resource(&self) -> &::std::option::Option<::std::string::String> {
&self.resource
}
pub fn targets(mut self, input: crate::types::TargetSummary) -> Self {
let mut v = self.targets.unwrap_or_default();
v.push(input);
self.targets = ::std::option::Option::Some(v);
self
}
pub fn set_targets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TargetSummary>>) -> Self {
self.targets = input;
self
}
pub fn get_targets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TargetSummary>> {
&self.targets
}
pub fn detail_type(mut self, input: crate::types::DetailType) -> Self {
self.detail_type = ::std::option::Option::Some(input);
self
}
pub fn set_detail_type(mut self, input: ::std::option::Option<crate::types::DetailType>) -> Self {
self.detail_type = input;
self
}
pub fn get_detail_type(&self) -> &::std::option::Option<crate::types::DetailType> {
&self.detail_type
}
pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.created_by = ::std::option::Option::Some(input.into());
self
}
pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.created_by = input;
self
}
pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
&self.created_by
}
pub fn status(mut self, input: crate::types::NotificationRuleStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
pub fn set_status(mut self, input: ::std::option::Option<crate::types::NotificationRuleStatus>) -> Self {
self.status = input;
self
}
pub fn get_status(&self) -> &::std::option::Option<crate::types::NotificationRuleStatus> {
&self.status
}
pub fn created_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_timestamp = ::std::option::Option::Some(input);
self
}
pub fn set_created_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_timestamp = input;
self
}
pub fn get_created_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_timestamp
}
pub fn last_modified_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.last_modified_timestamp = ::std::option::Option::Some(input);
self
}
pub fn set_last_modified_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.last_modified_timestamp = input;
self
}
pub fn get_last_modified_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.last_modified_timestamp
}
pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = ::std::option::Option::Some(hash_map);
self
}
pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.tags = input;
self
}
pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.tags
}
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::describe_notification_rule::DescribeNotificationRuleOutput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::describe_notification_rule::DescribeNotificationRuleOutput {
arn: self.arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"arn",
"arn was not specified but it is required when building DescribeNotificationRuleOutput",
)
})?,
name: self.name,
event_types: self.event_types,
resource: self.resource,
targets: self.targets,
detail_type: self.detail_type,
created_by: self.created_by,
status: self.status,
created_timestamp: self.created_timestamp,
last_modified_timestamp: self.last_modified_timestamp,
tags: self.tags,
_request_id: self._request_id,
})
}
}
impl ::std::fmt::Debug for DescribeNotificationRuleOutputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("DescribeNotificationRuleOutputBuilder");
formatter.field("arn", &self.arn);
formatter.field("name", &"*** Sensitive Data Redacted ***");
formatter.field("event_types", &self.event_types);
formatter.field("resource", &self.resource);
formatter.field("targets", &self.targets);
formatter.field("detail_type", &self.detail_type);
formatter.field("created_by", &self.created_by);
formatter.field("status", &self.status);
formatter.field("created_timestamp", &self.created_timestamp);
formatter.field("last_modified_timestamp", &self.last_modified_timestamp);
formatter.field("tags", &self.tags);
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}