aws_sdk_codestarnotifications/operation/subscribe/
_subscribe_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, ::std::fmt::Debug)]
5pub struct SubscribeInput {
6    /// <p>The Amazon Resource Name (ARN) of the notification rule for which you want to create the association.</p>
7    pub arn: ::std::option::Option<::std::string::String>,
8    /// <p>Information about the Chatbot topics or Chatbot clients associated with a notification rule.</p>
9    pub target: ::std::option::Option<crate::types::Target>,
10    /// <p>An enumeration token that, when provided in a request, returns the next batch of the results.</p>
11    pub client_request_token: ::std::option::Option<::std::string::String>,
12}
13impl SubscribeInput {
14    /// <p>The Amazon Resource Name (ARN) of the notification rule for which you want to create the association.</p>
15    pub fn arn(&self) -> ::std::option::Option<&str> {
16        self.arn.as_deref()
17    }
18    /// <p>Information about the Chatbot topics or Chatbot clients associated with a notification rule.</p>
19    pub fn target(&self) -> ::std::option::Option<&crate::types::Target> {
20        self.target.as_ref()
21    }
22    /// <p>An enumeration token that, when provided in a request, returns the next batch of the results.</p>
23    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
24        self.client_request_token.as_deref()
25    }
26}
27impl SubscribeInput {
28    /// Creates a new builder-style object to manufacture [`SubscribeInput`](crate::operation::subscribe::SubscribeInput).
29    pub fn builder() -> crate::operation::subscribe::builders::SubscribeInputBuilder {
30        crate::operation::subscribe::builders::SubscribeInputBuilder::default()
31    }
32}
33
34/// A builder for [`SubscribeInput`](crate::operation::subscribe::SubscribeInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct SubscribeInputBuilder {
38    pub(crate) arn: ::std::option::Option<::std::string::String>,
39    pub(crate) target: ::std::option::Option<crate::types::Target>,
40    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
41}
42impl SubscribeInputBuilder {
43    /// <p>The Amazon Resource Name (ARN) of the notification rule for which you want to create the association.</p>
44    /// This field is required.
45    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.arn = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>The Amazon Resource Name (ARN) of the notification rule for which you want to create the association.</p>
50    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.arn = input;
52        self
53    }
54    /// <p>The Amazon Resource Name (ARN) of the notification rule for which you want to create the association.</p>
55    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
56        &self.arn
57    }
58    /// <p>Information about the Chatbot topics or Chatbot clients associated with a notification rule.</p>
59    /// This field is required.
60    pub fn target(mut self, input: crate::types::Target) -> Self {
61        self.target = ::std::option::Option::Some(input);
62        self
63    }
64    /// <p>Information about the Chatbot topics or Chatbot clients associated with a notification rule.</p>
65    pub fn set_target(mut self, input: ::std::option::Option<crate::types::Target>) -> Self {
66        self.target = input;
67        self
68    }
69    /// <p>Information about the Chatbot topics or Chatbot clients associated with a notification rule.</p>
70    pub fn get_target(&self) -> &::std::option::Option<crate::types::Target> {
71        &self.target
72    }
73    /// <p>An enumeration token that, when provided in a request, returns the next batch of the results.</p>
74    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.client_request_token = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>An enumeration token that, when provided in a request, returns the next batch of the results.</p>
79    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.client_request_token = input;
81        self
82    }
83    /// <p>An enumeration token that, when provided in a request, returns the next batch of the results.</p>
84    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
85        &self.client_request_token
86    }
87    /// Consumes the builder and constructs a [`SubscribeInput`](crate::operation::subscribe::SubscribeInput).
88    pub fn build(self) -> ::std::result::Result<crate::operation::subscribe::SubscribeInput, ::aws_smithy_types::error::operation::BuildError> {
89        ::std::result::Result::Ok(crate::operation::subscribe::SubscribeInput {
90            arn: self.arn,
91            target: self.target,
92            client_request_token: self.client_request_token,
93        })
94    }
95}