// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
impl super::Client {
/// Constructs a fluent builder for the [`Subscribe`](crate::operation::subscribe::builders::SubscribeFluentBuilder) operation.
///
/// - The fluent builder is configurable:
/// - [`topic_arn(impl Into<String>)`](crate::operation::subscribe::builders::SubscribeFluentBuilder::topic_arn) / [`set_topic_arn(Option<String>)`](crate::operation::subscribe::builders::SubscribeFluentBuilder::set_topic_arn):<br>required: **true**<br><p>The ARN of the topic you want to subscribe to.</p><br>
/// - [`protocol(impl Into<String>)`](crate::operation::subscribe::builders::SubscribeFluentBuilder::protocol) / [`set_protocol(Option<String>)`](crate::operation::subscribe::builders::SubscribeFluentBuilder::set_protocol):<br>required: **true**<br><p>The protocol that you want to use. Supported protocols include:</p> <ul> <li> <p><code>http</code> – delivery of JSON-encoded message via HTTP POST</p></li> <li> <p><code>https</code> – delivery of JSON-encoded message via HTTPS POST</p></li> <li> <p><code>email</code> – delivery of message via SMTP</p></li> <li> <p><code>email-json</code> – delivery of JSON-encoded message via SMTP</p></li> <li> <p><code>sms</code> – delivery of message via SMS</p></li> <li> <p><code>sqs</code> – delivery of JSON-encoded message to an Amazon SQS queue</p></li> <li> <p><code>application</code> – delivery of JSON-encoded message to an EndpointArn for a mobile app and device</p></li> <li> <p><code>lambda</code> – delivery of JSON-encoded message to an Lambda function</p></li> <li> <p><code>firehose</code> – delivery of JSON-encoded message to an Amazon Kinesis Data Firehose delivery stream.</p></li> </ul><br>
/// - [`endpoint(impl Into<String>)`](crate::operation::subscribe::builders::SubscribeFluentBuilder::endpoint) / [`set_endpoint(Option<String>)`](crate::operation::subscribe::builders::SubscribeFluentBuilder::set_endpoint):<br>required: **false**<br><p>The endpoint that you want to receive notifications. Endpoints vary by protocol:</p> <ul> <li> <p>For the <code>http</code> protocol, the (public) endpoint is a URL beginning with <code>http://</code>.</p></li> <li> <p>For the <code>https</code> protocol, the (public) endpoint is a URL beginning with <code>https://</code>.</p></li> <li> <p>For the <code>email</code> protocol, the endpoint is an email address.</p></li> <li> <p>For the <code>email-json</code> protocol, the endpoint is an email address.</p></li> <li> <p>For the <code>sms</code> protocol, the endpoint is a phone number of an SMS-enabled device.</p></li> <li> <p>For the <code>sqs</code> protocol, the endpoint is the ARN of an Amazon SQS queue.</p></li> <li> <p>For the <code>application</code> protocol, the endpoint is the EndpointArn of a mobile app and device.</p></li> <li> <p>For the <code>lambda</code> protocol, the endpoint is the ARN of an Lambda function.</p></li> <li> <p>For the <code>firehose</code> protocol, the endpoint is the ARN of an Amazon Kinesis Data Firehose delivery stream.</p></li> </ul><br>
/// - [`attributes(impl Into<String>, impl Into<String>)`](crate::operation::subscribe::builders::SubscribeFluentBuilder::attributes) / [`set_attributes(Option<HashMap::<String, String>>)`](crate::operation::subscribe::builders::SubscribeFluentBuilder::set_attributes):<br>required: **false**<br><p>A map of attributes with their corresponding values.</p> <p>The following lists the names, descriptions, and values of the special request parameters that the <code>Subscribe</code> action uses:</p> <ul> <li> <p><code>DeliveryPolicy</code> – The policy that defines how Amazon SNS retries failed deliveries to HTTP/S endpoints.</p></li> <li> <p><code>FilterPolicy</code> – The simple JSON object that lets your subscriber receive only a subset of messages, rather than receiving every message published to the topic.</p></li> <li> <p><code>FilterPolicyScope</code> – This attribute lets you choose the filtering scope by using one of the following string value types:</p> <ul> <li> <p><code>MessageAttributes</code> (default) – The filter is applied on the message attributes.</p></li> <li> <p><code>MessageBody</code> – The filter is applied on the message body.</p></li> </ul></li> <li> <p><code>RawMessageDelivery</code> – When set to <code>true</code>, enables raw message delivery to Amazon SQS or HTTP/S endpoints. This eliminates the need for the endpoints to process JSON formatting, which is otherwise created for Amazon SNS metadata.</p></li> <li> <p><code>RedrivePolicy</code> – When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue. Messages that can't be delivered due to client errors (for example, when the subscribed endpoint is unreachable) or server errors (for example, when the service that powers the subscribed endpoint becomes unavailable) are held in the dead-letter queue for further analysis or reprocessing.</p></li> </ul> <p>The following attribute applies only to Amazon Kinesis Data Firehose delivery stream subscriptions:</p> <ul> <li> <p><code>SubscriptionRoleArn</code> – The ARN of the IAM role that has the following:</p> <ul> <li> <p>Permission to write to the Kinesis Data Firehose delivery stream</p></li> <li> <p>Amazon SNS listed as a trusted entity</p></li> </ul> <p>Specifying a valid ARN for this attribute is required for Kinesis Data Firehose delivery stream subscriptions. For more information, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html">Fanout to Kinesis Data Firehose delivery streams</a> in the <i>Amazon SNS Developer Guide</i>.</p></li> </ul> <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html">FIFO topics</a>:</p> <ul> <li> <p><code>ReplayPolicy</code> – Adds or updates an inline policy document for a subscription to replay messages stored in the specified Amazon SNS topic.</p></li> <li> <p><code>ReplayStatus</code> – Retrieves the status of the subscription message replay, which can be one of the following:</p> <ul> <li> <p><code>Completed</code> – The replay has successfully redelivered all messages, and is now delivering newly published messages. If an ending point was specified in the <code>ReplayPolicy</code> then the subscription will no longer receive newly published messages.</p></li> <li> <p><code>In progress</code> – The replay is currently replaying the selected messages.</p></li> <li> <p><code>Failed</code> – The replay was unable to complete.</p></li> <li> <p><code>Pending</code> – The default state while the replay initiates.</p></li> </ul></li> </ul><br>
/// - [`return_subscription_arn(bool)`](crate::operation::subscribe::builders::SubscribeFluentBuilder::return_subscription_arn) / [`set_return_subscription_arn(Option<bool>)`](crate::operation::subscribe::builders::SubscribeFluentBuilder::set_return_subscription_arn):<br>required: **false**<br><p>Sets whether the response from the <code>Subscribe</code> request includes the subscription ARN, even if the subscription is not yet confirmed.</p> <p>If you set this parameter to <code>true</code>, the response includes the ARN in all cases, even if the subscription is not yet confirmed. In addition to the ARN for confirmed subscriptions, the response also includes the <code>pending subscription</code> ARN value for subscriptions that aren't yet confirmed. A subscription becomes confirmed when the subscriber calls the <code>ConfirmSubscription</code> action with a confirmation token.</p> <p></p> <p>The default value is <code>false</code>.</p><br>
/// - On success, responds with [`SubscribeOutput`](crate::operation::subscribe::SubscribeOutput) with field(s):
/// - [`subscription_arn(Option<String>)`](crate::operation::subscribe::SubscribeOutput::subscription_arn): <p>The ARN of the subscription if it is confirmed, or the string "pending confirmation" if the subscription requires confirmation. However, if the API request parameter <code>ReturnSubscriptionArn</code> is true, then the value is always the subscription ARN, even if the subscription requires confirmation.</p>
/// - On failure, responds with [`SdkError<SubscribeError>`](crate::operation::subscribe::SubscribeError)
pub fn subscribe(&self) -> crate::operation::subscribe::builders::SubscribeFluentBuilder {
crate::operation::subscribe::builders::SubscribeFluentBuilder::new(self.handle.clone())
}
}