aws_sdk_sns/operation/confirm_subscription/_confirm_subscription_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Input for ConfirmSubscription action.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ConfirmSubscriptionInput {
7 /// <p>The ARN of the topic for which you wish to confirm a subscription.</p>
8 pub topic_arn: ::std::option::Option<::std::string::String>,
9 /// <p>Short-lived token sent to an endpoint during the <code>Subscribe</code> action.</p>
10 pub token: ::std::option::Option<::std::string::String>,
11 /// <p>Disallows unauthenticated unsubscribes of the subscription. If the value of this parameter is <code>true</code> and the request has an Amazon Web Services signature, then only the topic owner and the subscription owner can unsubscribe the endpoint. The unsubscribe action requires Amazon Web Services authentication.</p>
12 pub authenticate_on_unsubscribe: ::std::option::Option<::std::string::String>,
13}
14impl ConfirmSubscriptionInput {
15 /// <p>The ARN of the topic for which you wish to confirm a subscription.</p>
16 pub fn topic_arn(&self) -> ::std::option::Option<&str> {
17 self.topic_arn.as_deref()
18 }
19 /// <p>Short-lived token sent to an endpoint during the <code>Subscribe</code> action.</p>
20 pub fn token(&self) -> ::std::option::Option<&str> {
21 self.token.as_deref()
22 }
23 /// <p>Disallows unauthenticated unsubscribes of the subscription. If the value of this parameter is <code>true</code> and the request has an Amazon Web Services signature, then only the topic owner and the subscription owner can unsubscribe the endpoint. The unsubscribe action requires Amazon Web Services authentication.</p>
24 pub fn authenticate_on_unsubscribe(&self) -> ::std::option::Option<&str> {
25 self.authenticate_on_unsubscribe.as_deref()
26 }
27}
28impl ConfirmSubscriptionInput {
29 /// Creates a new builder-style object to manufacture [`ConfirmSubscriptionInput`](crate::operation::confirm_subscription::ConfirmSubscriptionInput).
30 pub fn builder() -> crate::operation::confirm_subscription::builders::ConfirmSubscriptionInputBuilder {
31 crate::operation::confirm_subscription::builders::ConfirmSubscriptionInputBuilder::default()
32 }
33}
34
35/// A builder for [`ConfirmSubscriptionInput`](crate::operation::confirm_subscription::ConfirmSubscriptionInput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct ConfirmSubscriptionInputBuilder {
39 pub(crate) topic_arn: ::std::option::Option<::std::string::String>,
40 pub(crate) token: ::std::option::Option<::std::string::String>,
41 pub(crate) authenticate_on_unsubscribe: ::std::option::Option<::std::string::String>,
42}
43impl ConfirmSubscriptionInputBuilder {
44 /// <p>The ARN of the topic for which you wish to confirm a subscription.</p>
45 /// This field is required.
46 pub fn topic_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47 self.topic_arn = ::std::option::Option::Some(input.into());
48 self
49 }
50 /// <p>The ARN of the topic for which you wish to confirm a subscription.</p>
51 pub fn set_topic_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52 self.topic_arn = input;
53 self
54 }
55 /// <p>The ARN of the topic for which you wish to confirm a subscription.</p>
56 pub fn get_topic_arn(&self) -> &::std::option::Option<::std::string::String> {
57 &self.topic_arn
58 }
59 /// <p>Short-lived token sent to an endpoint during the <code>Subscribe</code> action.</p>
60 /// This field is required.
61 pub fn token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62 self.token = ::std::option::Option::Some(input.into());
63 self
64 }
65 /// <p>Short-lived token sent to an endpoint during the <code>Subscribe</code> action.</p>
66 pub fn set_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.token = input;
68 self
69 }
70 /// <p>Short-lived token sent to an endpoint during the <code>Subscribe</code> action.</p>
71 pub fn get_token(&self) -> &::std::option::Option<::std::string::String> {
72 &self.token
73 }
74 /// <p>Disallows unauthenticated unsubscribes of the subscription. If the value of this parameter is <code>true</code> and the request has an Amazon Web Services signature, then only the topic owner and the subscription owner can unsubscribe the endpoint. The unsubscribe action requires Amazon Web Services authentication.</p>
75 pub fn authenticate_on_unsubscribe(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.authenticate_on_unsubscribe = ::std::option::Option::Some(input.into());
77 self
78 }
79 /// <p>Disallows unauthenticated unsubscribes of the subscription. If the value of this parameter is <code>true</code> and the request has an Amazon Web Services signature, then only the topic owner and the subscription owner can unsubscribe the endpoint. The unsubscribe action requires Amazon Web Services authentication.</p>
80 pub fn set_authenticate_on_unsubscribe(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.authenticate_on_unsubscribe = input;
82 self
83 }
84 /// <p>Disallows unauthenticated unsubscribes of the subscription. If the value of this parameter is <code>true</code> and the request has an Amazon Web Services signature, then only the topic owner and the subscription owner can unsubscribe the endpoint. The unsubscribe action requires Amazon Web Services authentication.</p>
85 pub fn get_authenticate_on_unsubscribe(&self) -> &::std::option::Option<::std::string::String> {
86 &self.authenticate_on_unsubscribe
87 }
88 /// Consumes the builder and constructs a [`ConfirmSubscriptionInput`](crate::operation::confirm_subscription::ConfirmSubscriptionInput).
89 pub fn build(
90 self,
91 ) -> ::std::result::Result<crate::operation::confirm_subscription::ConfirmSubscriptionInput, ::aws_smithy_types::error::operation::BuildError>
92 {
93 ::std::result::Result::Ok(crate::operation::confirm_subscription::ConfirmSubscriptionInput {
94 topic_arn: self.topic_arn,
95 token: self.token,
96 authenticate_on_unsubscribe: self.authenticate_on_unsubscribe,
97 })
98 }
99}