aws_sdk_codestarnotifications/operation/unsubscribe/
_unsubscribe_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct UnsubscribeInput {
6    /// <p>The Amazon Resource Name (ARN) of the notification rule.</p>
7    pub arn: ::std::option::Option<::std::string::String>,
8    /// <p>The ARN of the Chatbot topic to unsubscribe from the notification rule.</p>
9    pub target_address: ::std::option::Option<::std::string::String>,
10}
11impl UnsubscribeInput {
12    /// <p>The Amazon Resource Name (ARN) of the notification rule.</p>
13    pub fn arn(&self) -> ::std::option::Option<&str> {
14        self.arn.as_deref()
15    }
16    /// <p>The ARN of the Chatbot topic to unsubscribe from the notification rule.</p>
17    pub fn target_address(&self) -> ::std::option::Option<&str> {
18        self.target_address.as_deref()
19    }
20}
21impl ::std::fmt::Debug for UnsubscribeInput {
22    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
23        let mut formatter = f.debug_struct("UnsubscribeInput");
24        formatter.field("arn", &self.arn);
25        formatter.field("target_address", &"*** Sensitive Data Redacted ***");
26        formatter.finish()
27    }
28}
29impl UnsubscribeInput {
30    /// Creates a new builder-style object to manufacture [`UnsubscribeInput`](crate::operation::unsubscribe::UnsubscribeInput).
31    pub fn builder() -> crate::operation::unsubscribe::builders::UnsubscribeInputBuilder {
32        crate::operation::unsubscribe::builders::UnsubscribeInputBuilder::default()
33    }
34}
35
36/// A builder for [`UnsubscribeInput`](crate::operation::unsubscribe::UnsubscribeInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
38#[non_exhaustive]
39pub struct UnsubscribeInputBuilder {
40    pub(crate) arn: ::std::option::Option<::std::string::String>,
41    pub(crate) target_address: ::std::option::Option<::std::string::String>,
42}
43impl UnsubscribeInputBuilder {
44    /// <p>The Amazon Resource Name (ARN) of the notification rule.</p>
45    /// This field is required.
46    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.arn = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The Amazon Resource Name (ARN) of the notification rule.</p>
51    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.arn = input;
53        self
54    }
55    /// <p>The Amazon Resource Name (ARN) of the notification rule.</p>
56    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
57        &self.arn
58    }
59    /// <p>The ARN of the Chatbot topic to unsubscribe from the notification rule.</p>
60    /// This field is required.
61    pub fn target_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.target_address = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The ARN of the Chatbot topic to unsubscribe from the notification rule.</p>
66    pub fn set_target_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.target_address = input;
68        self
69    }
70    /// <p>The ARN of the Chatbot topic to unsubscribe from the notification rule.</p>
71    pub fn get_target_address(&self) -> &::std::option::Option<::std::string::String> {
72        &self.target_address
73    }
74    /// Consumes the builder and constructs a [`UnsubscribeInput`](crate::operation::unsubscribe::UnsubscribeInput).
75    pub fn build(self) -> ::std::result::Result<crate::operation::unsubscribe::UnsubscribeInput, ::aws_smithy_types::error::operation::BuildError> {
76        ::std::result::Result::Ok(crate::operation::unsubscribe::UnsubscribeInput {
77            arn: self.arn,
78            target_address: self.target_address,
79        })
80    }
81}
82impl ::std::fmt::Debug for UnsubscribeInputBuilder {
83    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
84        let mut formatter = f.debug_struct("UnsubscribeInputBuilder");
85        formatter.field("arn", &self.arn);
86        formatter.field("target_address", &"*** Sensitive Data Redacted ***");
87        formatter.finish()
88    }
89}