{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SNS.GetSubscriptionAttributes
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns all of the properties of a subscription.
module Amazonka.SNS.GetSubscriptionAttributes
  ( -- * Creating a Request
    GetSubscriptionAttributes (..),
    newGetSubscriptionAttributes,

    -- * Request Lenses
    getSubscriptionAttributes_subscriptionArn,

    -- * Destructuring the Response
    GetSubscriptionAttributesResponse (..),
    newGetSubscriptionAttributesResponse,

    -- * Response Lenses
    getSubscriptionAttributesResponse_attributes,
    getSubscriptionAttributesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SNS.Types

-- | Input for GetSubscriptionAttributes.
--
-- /See:/ 'newGetSubscriptionAttributes' smart constructor.
data GetSubscriptionAttributes = GetSubscriptionAttributes'
  { -- | The ARN of the subscription whose properties you want to get.
    GetSubscriptionAttributes -> Text
subscriptionArn :: Prelude.Text
  }
  deriving (GetSubscriptionAttributes -> GetSubscriptionAttributes -> Bool
(GetSubscriptionAttributes -> GetSubscriptionAttributes -> Bool)
-> (GetSubscriptionAttributes -> GetSubscriptionAttributes -> Bool)
-> Eq GetSubscriptionAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetSubscriptionAttributes -> GetSubscriptionAttributes -> Bool
== :: GetSubscriptionAttributes -> GetSubscriptionAttributes -> Bool
$c/= :: GetSubscriptionAttributes -> GetSubscriptionAttributes -> Bool
/= :: GetSubscriptionAttributes -> GetSubscriptionAttributes -> Bool
Prelude.Eq, ReadPrec [GetSubscriptionAttributes]
ReadPrec GetSubscriptionAttributes
Int -> ReadS GetSubscriptionAttributes
ReadS [GetSubscriptionAttributes]
(Int -> ReadS GetSubscriptionAttributes)
-> ReadS [GetSubscriptionAttributes]
-> ReadPrec GetSubscriptionAttributes
-> ReadPrec [GetSubscriptionAttributes]
-> Read GetSubscriptionAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS GetSubscriptionAttributes
readsPrec :: Int -> ReadS GetSubscriptionAttributes
$creadList :: ReadS [GetSubscriptionAttributes]
readList :: ReadS [GetSubscriptionAttributes]
$creadPrec :: ReadPrec GetSubscriptionAttributes
readPrec :: ReadPrec GetSubscriptionAttributes
$creadListPrec :: ReadPrec [GetSubscriptionAttributes]
readListPrec :: ReadPrec [GetSubscriptionAttributes]
Prelude.Read, Int -> GetSubscriptionAttributes -> ShowS
[GetSubscriptionAttributes] -> ShowS
GetSubscriptionAttributes -> String
(Int -> GetSubscriptionAttributes -> ShowS)
-> (GetSubscriptionAttributes -> String)
-> ([GetSubscriptionAttributes] -> ShowS)
-> Show GetSubscriptionAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetSubscriptionAttributes -> ShowS
showsPrec :: Int -> GetSubscriptionAttributes -> ShowS
$cshow :: GetSubscriptionAttributes -> String
show :: GetSubscriptionAttributes -> String
$cshowList :: [GetSubscriptionAttributes] -> ShowS
showList :: [GetSubscriptionAttributes] -> ShowS
Prelude.Show, (forall x.
 GetSubscriptionAttributes -> Rep GetSubscriptionAttributes x)
-> (forall x.
    Rep GetSubscriptionAttributes x -> GetSubscriptionAttributes)
-> Generic GetSubscriptionAttributes
forall x.
Rep GetSubscriptionAttributes x -> GetSubscriptionAttributes
forall x.
GetSubscriptionAttributes -> Rep GetSubscriptionAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
GetSubscriptionAttributes -> Rep GetSubscriptionAttributes x
from :: forall x.
GetSubscriptionAttributes -> Rep GetSubscriptionAttributes x
$cto :: forall x.
Rep GetSubscriptionAttributes x -> GetSubscriptionAttributes
to :: forall x.
Rep GetSubscriptionAttributes x -> GetSubscriptionAttributes
Prelude.Generic)

-- |
-- Create a value of 'GetSubscriptionAttributes' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'subscriptionArn', 'getSubscriptionAttributes_subscriptionArn' - The ARN of the subscription whose properties you want to get.
newGetSubscriptionAttributes ::
  -- | 'subscriptionArn'
  Prelude.Text ->
  GetSubscriptionAttributes
newGetSubscriptionAttributes :: Text -> GetSubscriptionAttributes
newGetSubscriptionAttributes Text
pSubscriptionArn_ =
  GetSubscriptionAttributes'
    { subscriptionArn :: Text
subscriptionArn =
        Text
pSubscriptionArn_
    }

-- | The ARN of the subscription whose properties you want to get.
getSubscriptionAttributes_subscriptionArn :: Lens.Lens' GetSubscriptionAttributes Prelude.Text
getSubscriptionAttributes_subscriptionArn :: Lens' GetSubscriptionAttributes Text
getSubscriptionAttributes_subscriptionArn = (GetSubscriptionAttributes -> Text)
-> (GetSubscriptionAttributes -> Text -> GetSubscriptionAttributes)
-> Lens' GetSubscriptionAttributes Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSubscriptionAttributes' {Text
subscriptionArn :: GetSubscriptionAttributes -> Text
subscriptionArn :: Text
subscriptionArn} -> Text
subscriptionArn) (\s :: GetSubscriptionAttributes
s@GetSubscriptionAttributes' {} Text
a -> GetSubscriptionAttributes
s {subscriptionArn = a} :: GetSubscriptionAttributes)

instance Core.AWSRequest GetSubscriptionAttributes where
  type
    AWSResponse GetSubscriptionAttributes =
      GetSubscriptionAttributesResponse
  request :: (Service -> Service)
-> GetSubscriptionAttributes -> Request GetSubscriptionAttributes
request Service -> Service
overrides =
    Service
-> GetSubscriptionAttributes -> Request GetSubscriptionAttributes
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetSubscriptionAttributes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetSubscriptionAttributes)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse GetSubscriptionAttributes))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetSubscriptionAttributes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetSubscriptionAttributes)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"GetSubscriptionAttributesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe (HashMap Text Text)
-> Int -> GetSubscriptionAttributesResponse
GetSubscriptionAttributesResponse'
            (Maybe (HashMap Text Text)
 -> Int -> GetSubscriptionAttributesResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> GetSubscriptionAttributesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Attributes" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe (HashMap Text Text)))
-> Either String (Maybe (HashMap Text Text))
forall a b.
Either String a -> (a -> Either String b) -> Either String b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String (HashMap Text Text))
-> [Node] -> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> Text -> Text -> [Node] -> Either String (HashMap Text Text)
forall k v.
(Eq k, Hashable k, FromText k, FromXML v) =>
Text -> Text -> Text -> [Node] -> Either String (HashMap k v)
Data.parseXMLMap Text
"entry" Text
"key" Text
"value")
                        )
            Either String (Int -> GetSubscriptionAttributesResponse)
-> Either String Int
-> Either String GetSubscriptionAttributesResponse
forall a b.
Either String (a -> b) -> Either String a -> Either String b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetSubscriptionAttributes where
  hashWithSalt :: Int -> GetSubscriptionAttributes -> Int
hashWithSalt Int
_salt GetSubscriptionAttributes' {Text
subscriptionArn :: GetSubscriptionAttributes -> Text
subscriptionArn :: Text
..} =
    Int
_salt Int -> Text -> Int
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
subscriptionArn

instance Prelude.NFData GetSubscriptionAttributes where
  rnf :: GetSubscriptionAttributes -> ()
rnf GetSubscriptionAttributes' {Text
subscriptionArn :: GetSubscriptionAttributes -> Text
subscriptionArn :: Text
..} =
    Text -> ()
forall a. NFData a => a -> ()
Prelude.rnf Text
subscriptionArn

instance Data.ToHeaders GetSubscriptionAttributes where
  toHeaders :: GetSubscriptionAttributes -> ResponseHeaders
toHeaders = ResponseHeaders -> GetSubscriptionAttributes -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath GetSubscriptionAttributes where
  toPath :: GetSubscriptionAttributes -> ByteString
toPath = ByteString -> GetSubscriptionAttributes -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery GetSubscriptionAttributes where
  toQuery :: GetSubscriptionAttributes -> QueryString
toQuery GetSubscriptionAttributes' {Text
subscriptionArn :: GetSubscriptionAttributes -> Text
subscriptionArn :: Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"GetSubscriptionAttributes" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-03-31" :: Prelude.ByteString),
        ByteString
"SubscriptionArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
subscriptionArn
      ]

-- | Response for GetSubscriptionAttributes action.
--
-- /See:/ 'newGetSubscriptionAttributesResponse' smart constructor.
data GetSubscriptionAttributesResponse = GetSubscriptionAttributesResponse'
  { -- | A map of the subscription\'s attributes. Attributes in this map include
    -- the following:
    --
    -- -   @ConfirmationWasAuthenticated@ – @true@ if the subscription
    --     confirmation request was authenticated.
    --
    -- -   @DeliveryPolicy@ – The JSON serialization of the subscription\'s
    --     delivery policy.
    --
    -- -   @EffectiveDeliveryPolicy@ – The JSON serialization of the effective
    --     delivery policy that takes into account the topic delivery policy
    --     and account system defaults.
    --
    -- -   @FilterPolicy@ – The filter policy JSON that is assigned to the
    --     subscription. For more information, see
    --     <https://docs.aws.amazon.com/sns/latest/dg/sns-message-filtering.html Amazon SNS Message Filtering>
    --     in the /Amazon SNS Developer Guide/.
    --
    -- -   @FilterPolicyScope@ – This attribute lets you choose the filtering
    --     scope by using one of the following string value types:
    --
    --     -   @MessageAttributes@ (default) – The filter is applied on the
    --         message attributes.
    --
    --     -   @MessageBody@ – The filter is applied on the message body.
    --
    -- -   @Owner@ – The Amazon Web Services account ID of the subscription\'s
    --     owner.
    --
    -- -   @PendingConfirmation@ – @true@ if the subscription hasn\'t been
    --     confirmed. To confirm a pending subscription, call the
    --     @ConfirmSubscription@ action with a confirmation token.
    --
    -- -   @RawMessageDelivery@ – @true@ if raw message delivery is enabled for
    --     the subscription. Raw messages are free of JSON formatting and can
    --     be sent to HTTP\/S and Amazon SQS endpoints.
    --
    -- -   @RedrivePolicy@ – 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.
    --
    -- -   @SubscriptionArn@ – The subscription\'s ARN.
    --
    -- -   @TopicArn@ – The topic ARN that the subscription is associated with.
    --
    -- The following attribute applies only to Amazon Kinesis Data Firehose
    -- delivery stream subscriptions:
    --
    -- -   @SubscriptionRoleArn@ – The ARN of the IAM role that has the
    --     following:
    --
    --     -   Permission to write to the Kinesis Data Firehose delivery stream
    --
    --     -   Amazon SNS listed as a trusted entity
    --
    --     Specifying a valid ARN for this attribute is required for Kinesis
    --     Data Firehose delivery stream subscriptions. For more information,
    --     see
    --     <https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html Fanout to Kinesis Data Firehose delivery streams>
    --     in the /Amazon SNS Developer Guide/.
    GetSubscriptionAttributesResponse -> Maybe (HashMap Text Text)
attributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    GetSubscriptionAttributesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetSubscriptionAttributesResponse
-> GetSubscriptionAttributesResponse -> Bool
(GetSubscriptionAttributesResponse
 -> GetSubscriptionAttributesResponse -> Bool)
-> (GetSubscriptionAttributesResponse
    -> GetSubscriptionAttributesResponse -> Bool)
-> Eq GetSubscriptionAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetSubscriptionAttributesResponse
-> GetSubscriptionAttributesResponse -> Bool
== :: GetSubscriptionAttributesResponse
-> GetSubscriptionAttributesResponse -> Bool
$c/= :: GetSubscriptionAttributesResponse
-> GetSubscriptionAttributesResponse -> Bool
/= :: GetSubscriptionAttributesResponse
-> GetSubscriptionAttributesResponse -> Bool
Prelude.Eq, ReadPrec [GetSubscriptionAttributesResponse]
ReadPrec GetSubscriptionAttributesResponse
Int -> ReadS GetSubscriptionAttributesResponse
ReadS [GetSubscriptionAttributesResponse]
(Int -> ReadS GetSubscriptionAttributesResponse)
-> ReadS [GetSubscriptionAttributesResponse]
-> ReadPrec GetSubscriptionAttributesResponse
-> ReadPrec [GetSubscriptionAttributesResponse]
-> Read GetSubscriptionAttributesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS GetSubscriptionAttributesResponse
readsPrec :: Int -> ReadS GetSubscriptionAttributesResponse
$creadList :: ReadS [GetSubscriptionAttributesResponse]
readList :: ReadS [GetSubscriptionAttributesResponse]
$creadPrec :: ReadPrec GetSubscriptionAttributesResponse
readPrec :: ReadPrec GetSubscriptionAttributesResponse
$creadListPrec :: ReadPrec [GetSubscriptionAttributesResponse]
readListPrec :: ReadPrec [GetSubscriptionAttributesResponse]
Prelude.Read, Int -> GetSubscriptionAttributesResponse -> ShowS
[GetSubscriptionAttributesResponse] -> ShowS
GetSubscriptionAttributesResponse -> String
(Int -> GetSubscriptionAttributesResponse -> ShowS)
-> (GetSubscriptionAttributesResponse -> String)
-> ([GetSubscriptionAttributesResponse] -> ShowS)
-> Show GetSubscriptionAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetSubscriptionAttributesResponse -> ShowS
showsPrec :: Int -> GetSubscriptionAttributesResponse -> ShowS
$cshow :: GetSubscriptionAttributesResponse -> String
show :: GetSubscriptionAttributesResponse -> String
$cshowList :: [GetSubscriptionAttributesResponse] -> ShowS
showList :: [GetSubscriptionAttributesResponse] -> ShowS
Prelude.Show, (forall x.
 GetSubscriptionAttributesResponse
 -> Rep GetSubscriptionAttributesResponse x)
-> (forall x.
    Rep GetSubscriptionAttributesResponse x
    -> GetSubscriptionAttributesResponse)
-> Generic GetSubscriptionAttributesResponse
forall x.
Rep GetSubscriptionAttributesResponse x
-> GetSubscriptionAttributesResponse
forall x.
GetSubscriptionAttributesResponse
-> Rep GetSubscriptionAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
GetSubscriptionAttributesResponse
-> Rep GetSubscriptionAttributesResponse x
from :: forall x.
GetSubscriptionAttributesResponse
-> Rep GetSubscriptionAttributesResponse x
$cto :: forall x.
Rep GetSubscriptionAttributesResponse x
-> GetSubscriptionAttributesResponse
to :: forall x.
Rep GetSubscriptionAttributesResponse x
-> GetSubscriptionAttributesResponse
Prelude.Generic)

-- |
-- Create a value of 'GetSubscriptionAttributesResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'attributes', 'getSubscriptionAttributesResponse_attributes' - A map of the subscription\'s attributes. Attributes in this map include
-- the following:
--
-- -   @ConfirmationWasAuthenticated@ – @true@ if the subscription
--     confirmation request was authenticated.
--
-- -   @DeliveryPolicy@ – The JSON serialization of the subscription\'s
--     delivery policy.
--
-- -   @EffectiveDeliveryPolicy@ – The JSON serialization of the effective
--     delivery policy that takes into account the topic delivery policy
--     and account system defaults.
--
-- -   @FilterPolicy@ – The filter policy JSON that is assigned to the
--     subscription. For more information, see
--     <https://docs.aws.amazon.com/sns/latest/dg/sns-message-filtering.html Amazon SNS Message Filtering>
--     in the /Amazon SNS Developer Guide/.
--
-- -   @FilterPolicyScope@ – This attribute lets you choose the filtering
--     scope by using one of the following string value types:
--
--     -   @MessageAttributes@ (default) – The filter is applied on the
--         message attributes.
--
--     -   @MessageBody@ – The filter is applied on the message body.
--
-- -   @Owner@ – The Amazon Web Services account ID of the subscription\'s
--     owner.
--
-- -   @PendingConfirmation@ – @true@ if the subscription hasn\'t been
--     confirmed. To confirm a pending subscription, call the
--     @ConfirmSubscription@ action with a confirmation token.
--
-- -   @RawMessageDelivery@ – @true@ if raw message delivery is enabled for
--     the subscription. Raw messages are free of JSON formatting and can
--     be sent to HTTP\/S and Amazon SQS endpoints.
--
-- -   @RedrivePolicy@ – 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.
--
-- -   @SubscriptionArn@ – The subscription\'s ARN.
--
-- -   @TopicArn@ – The topic ARN that the subscription is associated with.
--
-- The following attribute applies only to Amazon Kinesis Data Firehose
-- delivery stream subscriptions:
--
-- -   @SubscriptionRoleArn@ – The ARN of the IAM role that has the
--     following:
--
--     -   Permission to write to the Kinesis Data Firehose delivery stream
--
--     -   Amazon SNS listed as a trusted entity
--
--     Specifying a valid ARN for this attribute is required for Kinesis
--     Data Firehose delivery stream subscriptions. For more information,
--     see
--     <https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html Fanout to Kinesis Data Firehose delivery streams>
--     in the /Amazon SNS Developer Guide/.
--
-- 'httpStatus', 'getSubscriptionAttributesResponse_httpStatus' - The response's http status code.
newGetSubscriptionAttributesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetSubscriptionAttributesResponse
newGetSubscriptionAttributesResponse :: Int -> GetSubscriptionAttributesResponse
newGetSubscriptionAttributesResponse Int
pHttpStatus_ =
  GetSubscriptionAttributesResponse'
    { attributes :: Maybe (HashMap Text Text)
attributes =
        Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      httpStatus :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A map of the subscription\'s attributes. Attributes in this map include
-- the following:
--
-- -   @ConfirmationWasAuthenticated@ – @true@ if the subscription
--     confirmation request was authenticated.
--
-- -   @DeliveryPolicy@ – The JSON serialization of the subscription\'s
--     delivery policy.
--
-- -   @EffectiveDeliveryPolicy@ – The JSON serialization of the effective
--     delivery policy that takes into account the topic delivery policy
--     and account system defaults.
--
-- -   @FilterPolicy@ – The filter policy JSON that is assigned to the
--     subscription. For more information, see
--     <https://docs.aws.amazon.com/sns/latest/dg/sns-message-filtering.html Amazon SNS Message Filtering>
--     in the /Amazon SNS Developer Guide/.
--
-- -   @FilterPolicyScope@ – This attribute lets you choose the filtering
--     scope by using one of the following string value types:
--
--     -   @MessageAttributes@ (default) – The filter is applied on the
--         message attributes.
--
--     -   @MessageBody@ – The filter is applied on the message body.
--
-- -   @Owner@ – The Amazon Web Services account ID of the subscription\'s
--     owner.
--
-- -   @PendingConfirmation@ – @true@ if the subscription hasn\'t been
--     confirmed. To confirm a pending subscription, call the
--     @ConfirmSubscription@ action with a confirmation token.
--
-- -   @RawMessageDelivery@ – @true@ if raw message delivery is enabled for
--     the subscription. Raw messages are free of JSON formatting and can
--     be sent to HTTP\/S and Amazon SQS endpoints.
--
-- -   @RedrivePolicy@ – 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.
--
-- -   @SubscriptionArn@ – The subscription\'s ARN.
--
-- -   @TopicArn@ – The topic ARN that the subscription is associated with.
--
-- The following attribute applies only to Amazon Kinesis Data Firehose
-- delivery stream subscriptions:
--
-- -   @SubscriptionRoleArn@ – The ARN of the IAM role that has the
--     following:
--
--     -   Permission to write to the Kinesis Data Firehose delivery stream
--
--     -   Amazon SNS listed as a trusted entity
--
--     Specifying a valid ARN for this attribute is required for Kinesis
--     Data Firehose delivery stream subscriptions. For more information,
--     see
--     <https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html Fanout to Kinesis Data Firehose delivery streams>
--     in the /Amazon SNS Developer Guide/.
getSubscriptionAttributesResponse_attributes :: Lens.Lens' GetSubscriptionAttributesResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getSubscriptionAttributesResponse_attributes :: Lens' GetSubscriptionAttributesResponse (Maybe (HashMap Text Text))
getSubscriptionAttributesResponse_attributes = (GetSubscriptionAttributesResponse -> Maybe (HashMap Text Text))
-> (GetSubscriptionAttributesResponse
    -> Maybe (HashMap Text Text) -> GetSubscriptionAttributesResponse)
-> Lens'
     GetSubscriptionAttributesResponse (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSubscriptionAttributesResponse' {Maybe (HashMap Text Text)
attributes :: GetSubscriptionAttributesResponse -> Maybe (HashMap Text Text)
attributes :: Maybe (HashMap Text Text)
attributes} -> Maybe (HashMap Text Text)
attributes) (\s :: GetSubscriptionAttributesResponse
s@GetSubscriptionAttributesResponse' {} Maybe (HashMap Text Text)
a -> GetSubscriptionAttributesResponse
s {attributes = a} :: GetSubscriptionAttributesResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> GetSubscriptionAttributesResponse
 -> f GetSubscriptionAttributesResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetSubscriptionAttributesResponse
-> f GetSubscriptionAttributesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Iso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
Lens.coerced

-- | The response's http status code.
getSubscriptionAttributesResponse_httpStatus :: Lens.Lens' GetSubscriptionAttributesResponse Prelude.Int
getSubscriptionAttributesResponse_httpStatus :: Lens' GetSubscriptionAttributesResponse Int
getSubscriptionAttributesResponse_httpStatus = (GetSubscriptionAttributesResponse -> Int)
-> (GetSubscriptionAttributesResponse
    -> Int -> GetSubscriptionAttributesResponse)
-> Lens' GetSubscriptionAttributesResponse Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSubscriptionAttributesResponse' {Int
httpStatus :: GetSubscriptionAttributesResponse -> Int
httpStatus :: Int
httpStatus} -> Int
httpStatus) (\s :: GetSubscriptionAttributesResponse
s@GetSubscriptionAttributesResponse' {} Int
a -> GetSubscriptionAttributesResponse
s {httpStatus = a} :: GetSubscriptionAttributesResponse)

instance
  Prelude.NFData
    GetSubscriptionAttributesResponse
  where
  rnf :: GetSubscriptionAttributesResponse -> ()
rnf GetSubscriptionAttributesResponse' {Int
Maybe (HashMap Text Text)
attributes :: GetSubscriptionAttributesResponse -> Maybe (HashMap Text Text)
httpStatus :: GetSubscriptionAttributesResponse -> Int
attributes :: Maybe (HashMap Text Text)
httpStatus :: Int
..} =
    Maybe (HashMap Text Text) -> ()
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
attributes () -> () -> ()
forall a b. a -> b -> b
`Prelude.seq`
      Int -> ()
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus