1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Information about the Chatbot topics or Chatbot clients associated with a notification rule.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Target {
/// <p>The target type. Can be an Chatbot topic or Chatbot client.</p>
/// <ul>
/// <li> <p>Chatbot topics are specified as <code>SNS</code>.</p> </li>
/// <li> <p>Chatbot clients are specified as <code>AWSChatbotSlack</code>.</p> </li>
/// </ul>
pub target_type: ::std::option::Option<::std::string::String>,
/// <p>The Amazon Resource Name (ARN) of the Chatbot topic or Chatbot client.</p>
pub target_address: ::std::option::Option<::std::string::String>,
}
impl Target {
/// <p>The target type. Can be an Chatbot topic or Chatbot client.</p>
/// <ul>
/// <li> <p>Chatbot topics are specified as <code>SNS</code>.</p> </li>
/// <li> <p>Chatbot clients are specified as <code>AWSChatbotSlack</code>.</p> </li>
/// </ul>
pub fn target_type(&self) -> ::std::option::Option<&str> {
self.target_type.as_deref()
}
/// <p>The Amazon Resource Name (ARN) of the Chatbot topic or Chatbot client.</p>
pub fn target_address(&self) -> ::std::option::Option<&str> {
self.target_address.as_deref()
}
}
impl ::std::fmt::Debug for Target {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("Target");
formatter.field("target_type", &self.target_type);
formatter.field("target_address", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
impl Target {
/// Creates a new builder-style object to manufacture [`Target`](crate::types::Target).
pub fn builder() -> crate::types::builders::TargetBuilder {
crate::types::builders::TargetBuilder::default()
}
}
/// A builder for [`Target`](crate::types::Target).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct TargetBuilder {
pub(crate) target_type: ::std::option::Option<::std::string::String>,
pub(crate) target_address: ::std::option::Option<::std::string::String>,
}
impl TargetBuilder {
/// <p>The target type. Can be an Chatbot topic or Chatbot client.</p>
/// <ul>
/// <li> <p>Chatbot topics are specified as <code>SNS</code>.</p> </li>
/// <li> <p>Chatbot clients are specified as <code>AWSChatbotSlack</code>.</p> </li>
/// </ul>
pub fn target_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.target_type = ::std::option::Option::Some(input.into());
self
}
/// <p>The target type. Can be an Chatbot topic or Chatbot client.</p>
/// <ul>
/// <li> <p>Chatbot topics are specified as <code>SNS</code>.</p> </li>
/// <li> <p>Chatbot clients are specified as <code>AWSChatbotSlack</code>.</p> </li>
/// </ul>
pub fn set_target_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.target_type = input;
self
}
/// <p>The target type. Can be an Chatbot topic or Chatbot client.</p>
/// <ul>
/// <li> <p>Chatbot topics are specified as <code>SNS</code>.</p> </li>
/// <li> <p>Chatbot clients are specified as <code>AWSChatbotSlack</code>.</p> </li>
/// </ul>
pub fn get_target_type(&self) -> &::std::option::Option<::std::string::String> {
&self.target_type
}
/// <p>The Amazon Resource Name (ARN) of the Chatbot topic or Chatbot client.</p>
pub fn target_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.target_address = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the Chatbot topic or Chatbot client.</p>
pub fn set_target_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.target_address = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the Chatbot topic or Chatbot client.</p>
pub fn get_target_address(&self) -> &::std::option::Option<::std::string::String> {
&self.target_address
}
/// Consumes the builder and constructs a [`Target`](crate::types::Target).
pub fn build(self) -> crate::types::Target {
crate::types::Target {
target_type: self.target_type,
target_address: self.target_address,
}
}
}
impl ::std::fmt::Debug for TargetBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("TargetBuilder");
formatter.field("target_type", &self.target_type);
formatter.field("target_address", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}