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