{-# 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.Redshift.DescribeEventSubscriptions
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists descriptions of all the Amazon Redshift event notification
-- subscriptions for a customer account. If you specify a subscription
-- name, lists the description for that subscription.
--
-- If you specify both tag keys and tag values in the same request, Amazon
-- Redshift returns all event notification subscriptions that match any
-- combination of the specified keys and values. For example, if you have
-- @owner@ and @environment@ for tag keys, and @admin@ and @test@ for tag
-- values, all subscriptions that have any combination of those values are
-- returned.
--
-- If both tag keys and values are omitted from the request, subscriptions
-- are returned regardless of whether they have tag keys or values
-- associated with them.
--
-- This operation returns paginated results.
module Amazonka.Redshift.DescribeEventSubscriptions
  ( -- * Creating a Request
    DescribeEventSubscriptions (..),
    newDescribeEventSubscriptions,

    -- * Request Lenses
    describeEventSubscriptions_marker,
    describeEventSubscriptions_maxRecords,
    describeEventSubscriptions_subscriptionName,
    describeEventSubscriptions_tagKeys,
    describeEventSubscriptions_tagValues,

    -- * Destructuring the Response
    DescribeEventSubscriptionsResponse (..),
    newDescribeEventSubscriptionsResponse,

    -- * Response Lenses
    describeEventSubscriptionsResponse_eventSubscriptionsList,
    describeEventSubscriptionsResponse_marker,
    describeEventSubscriptionsResponse_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 Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- |
--
-- /See:/ 'newDescribeEventSubscriptions' smart constructor.
data DescribeEventSubscriptions = DescribeEventSubscriptions'
  { -- | An optional parameter that specifies the starting point to return a set
    -- of response records. When the results of a DescribeEventSubscriptions
    -- request exceed the value specified in @MaxRecords@, Amazon Web Services
    -- returns a value in the @Marker@ field of the response. You can retrieve
    -- the next set of response records by providing the returned marker value
    -- in the @Marker@ parameter and retrying the request.
    DescribeEventSubscriptions -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of response records to return in each call. If the
    -- number of remaining response records exceeds the specified @MaxRecords@
    -- value, a value is returned in a @marker@ field of the response. You can
    -- retrieve the next set of records by retrying the command with the
    -- returned marker value.
    --
    -- Default: @100@
    --
    -- Constraints: minimum 20, maximum 100.
    DescribeEventSubscriptions -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | The name of the Amazon Redshift event notification subscription to be
    -- described.
    DescribeEventSubscriptions -> Maybe Text
subscriptionName :: Prelude.Maybe Prelude.Text,
    -- | A tag key or keys for which you want to return all matching event
    -- notification subscriptions that are associated with the specified key or
    -- keys. For example, suppose that you have subscriptions that are tagged
    -- with keys called @owner@ and @environment@. If you specify both of these
    -- tag keys in the request, Amazon Redshift returns a response with the
    -- subscriptions that have either or both of these tag keys associated with
    -- them.
    DescribeEventSubscriptions -> Maybe [Text]
tagKeys :: Prelude.Maybe [Prelude.Text],
    -- | A tag value or values for which you want to return all matching event
    -- notification subscriptions that are associated with the specified tag
    -- value or values. For example, suppose that you have subscriptions that
    -- are tagged with values called @admin@ and @test@. If you specify both of
    -- these tag values in the request, Amazon Redshift returns a response with
    -- the subscriptions that have either or both of these tag values
    -- associated with them.
    DescribeEventSubscriptions -> Maybe [Text]
tagValues :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeEventSubscriptions -> DescribeEventSubscriptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEventSubscriptions -> DescribeEventSubscriptions -> Bool
$c/= :: DescribeEventSubscriptions -> DescribeEventSubscriptions -> Bool
== :: DescribeEventSubscriptions -> DescribeEventSubscriptions -> Bool
$c== :: DescribeEventSubscriptions -> DescribeEventSubscriptions -> Bool
Prelude.Eq, ReadPrec [DescribeEventSubscriptions]
ReadPrec DescribeEventSubscriptions
Int -> ReadS DescribeEventSubscriptions
ReadS [DescribeEventSubscriptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEventSubscriptions]
$creadListPrec :: ReadPrec [DescribeEventSubscriptions]
readPrec :: ReadPrec DescribeEventSubscriptions
$creadPrec :: ReadPrec DescribeEventSubscriptions
readList :: ReadS [DescribeEventSubscriptions]
$creadList :: ReadS [DescribeEventSubscriptions]
readsPrec :: Int -> ReadS DescribeEventSubscriptions
$creadsPrec :: Int -> ReadS DescribeEventSubscriptions
Prelude.Read, Int -> DescribeEventSubscriptions -> ShowS
[DescribeEventSubscriptions] -> ShowS
DescribeEventSubscriptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEventSubscriptions] -> ShowS
$cshowList :: [DescribeEventSubscriptions] -> ShowS
show :: DescribeEventSubscriptions -> String
$cshow :: DescribeEventSubscriptions -> String
showsPrec :: Int -> DescribeEventSubscriptions -> ShowS
$cshowsPrec :: Int -> DescribeEventSubscriptions -> ShowS
Prelude.Show, forall x.
Rep DescribeEventSubscriptions x -> DescribeEventSubscriptions
forall x.
DescribeEventSubscriptions -> Rep DescribeEventSubscriptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEventSubscriptions x -> DescribeEventSubscriptions
$cfrom :: forall x.
DescribeEventSubscriptions -> Rep DescribeEventSubscriptions x
Prelude.Generic)

-- |
-- Create a value of 'DescribeEventSubscriptions' 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:
--
-- 'marker', 'describeEventSubscriptions_marker' - An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeEventSubscriptions
-- request exceed the value specified in @MaxRecords@, Amazon Web Services
-- returns a value in the @Marker@ field of the response. You can retrieve
-- the next set of response records by providing the returned marker value
-- in the @Marker@ parameter and retrying the request.
--
-- 'maxRecords', 'describeEventSubscriptions_maxRecords' - The maximum number of response records to return in each call. If the
-- number of remaining response records exceeds the specified @MaxRecords@
-- value, a value is returned in a @marker@ field of the response. You can
-- retrieve the next set of records by retrying the command with the
-- returned marker value.
--
-- Default: @100@
--
-- Constraints: minimum 20, maximum 100.
--
-- 'subscriptionName', 'describeEventSubscriptions_subscriptionName' - The name of the Amazon Redshift event notification subscription to be
-- described.
--
-- 'tagKeys', 'describeEventSubscriptions_tagKeys' - A tag key or keys for which you want to return all matching event
-- notification subscriptions that are associated with the specified key or
-- keys. For example, suppose that you have subscriptions that are tagged
-- with keys called @owner@ and @environment@. If you specify both of these
-- tag keys in the request, Amazon Redshift returns a response with the
-- subscriptions that have either or both of these tag keys associated with
-- them.
--
-- 'tagValues', 'describeEventSubscriptions_tagValues' - A tag value or values for which you want to return all matching event
-- notification subscriptions that are associated with the specified tag
-- value or values. For example, suppose that you have subscriptions that
-- are tagged with values called @admin@ and @test@. If you specify both of
-- these tag values in the request, Amazon Redshift returns a response with
-- the subscriptions that have either or both of these tag values
-- associated with them.
newDescribeEventSubscriptions ::
  DescribeEventSubscriptions
newDescribeEventSubscriptions :: DescribeEventSubscriptions
newDescribeEventSubscriptions =
  DescribeEventSubscriptions'
    { $sel:marker:DescribeEventSubscriptions' :: Maybe Text
marker =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeEventSubscriptions' :: Maybe Int
maxRecords = forall a. Maybe a
Prelude.Nothing,
      $sel:subscriptionName:DescribeEventSubscriptions' :: Maybe Text
subscriptionName = forall a. Maybe a
Prelude.Nothing,
      $sel:tagKeys:DescribeEventSubscriptions' :: Maybe [Text]
tagKeys = forall a. Maybe a
Prelude.Nothing,
      $sel:tagValues:DescribeEventSubscriptions' :: Maybe [Text]
tagValues = forall a. Maybe a
Prelude.Nothing
    }

-- | An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeEventSubscriptions
-- request exceed the value specified in @MaxRecords@, Amazon Web Services
-- returns a value in the @Marker@ field of the response. You can retrieve
-- the next set of response records by providing the returned marker value
-- in the @Marker@ parameter and retrying the request.
describeEventSubscriptions_marker :: Lens.Lens' DescribeEventSubscriptions (Prelude.Maybe Prelude.Text)
describeEventSubscriptions_marker :: Lens' DescribeEventSubscriptions (Maybe Text)
describeEventSubscriptions_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSubscriptions' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeEventSubscriptions
s@DescribeEventSubscriptions' {} Maybe Text
a -> DescribeEventSubscriptions
s {$sel:marker:DescribeEventSubscriptions' :: Maybe Text
marker = Maybe Text
a} :: DescribeEventSubscriptions)

-- | The maximum number of response records to return in each call. If the
-- number of remaining response records exceeds the specified @MaxRecords@
-- value, a value is returned in a @marker@ field of the response. You can
-- retrieve the next set of records by retrying the command with the
-- returned marker value.
--
-- Default: @100@
--
-- Constraints: minimum 20, maximum 100.
describeEventSubscriptions_maxRecords :: Lens.Lens' DescribeEventSubscriptions (Prelude.Maybe Prelude.Int)
describeEventSubscriptions_maxRecords :: Lens' DescribeEventSubscriptions (Maybe Int)
describeEventSubscriptions_maxRecords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSubscriptions' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeEventSubscriptions
s@DescribeEventSubscriptions' {} Maybe Int
a -> DescribeEventSubscriptions
s {$sel:maxRecords:DescribeEventSubscriptions' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeEventSubscriptions)

-- | The name of the Amazon Redshift event notification subscription to be
-- described.
describeEventSubscriptions_subscriptionName :: Lens.Lens' DescribeEventSubscriptions (Prelude.Maybe Prelude.Text)
describeEventSubscriptions_subscriptionName :: Lens' DescribeEventSubscriptions (Maybe Text)
describeEventSubscriptions_subscriptionName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSubscriptions' {Maybe Text
subscriptionName :: Maybe Text
$sel:subscriptionName:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Text
subscriptionName} -> Maybe Text
subscriptionName) (\s :: DescribeEventSubscriptions
s@DescribeEventSubscriptions' {} Maybe Text
a -> DescribeEventSubscriptions
s {$sel:subscriptionName:DescribeEventSubscriptions' :: Maybe Text
subscriptionName = Maybe Text
a} :: DescribeEventSubscriptions)

-- | A tag key or keys for which you want to return all matching event
-- notification subscriptions that are associated with the specified key or
-- keys. For example, suppose that you have subscriptions that are tagged
-- with keys called @owner@ and @environment@. If you specify both of these
-- tag keys in the request, Amazon Redshift returns a response with the
-- subscriptions that have either or both of these tag keys associated with
-- them.
describeEventSubscriptions_tagKeys :: Lens.Lens' DescribeEventSubscriptions (Prelude.Maybe [Prelude.Text])
describeEventSubscriptions_tagKeys :: Lens' DescribeEventSubscriptions (Maybe [Text])
describeEventSubscriptions_tagKeys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSubscriptions' {Maybe [Text]
tagKeys :: Maybe [Text]
$sel:tagKeys:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe [Text]
tagKeys} -> Maybe [Text]
tagKeys) (\s :: DescribeEventSubscriptions
s@DescribeEventSubscriptions' {} Maybe [Text]
a -> DescribeEventSubscriptions
s {$sel:tagKeys:DescribeEventSubscriptions' :: Maybe [Text]
tagKeys = Maybe [Text]
a} :: DescribeEventSubscriptions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A tag value or values for which you want to return all matching event
-- notification subscriptions that are associated with the specified tag
-- value or values. For example, suppose that you have subscriptions that
-- are tagged with values called @admin@ and @test@. If you specify both of
-- these tag values in the request, Amazon Redshift returns a response with
-- the subscriptions that have either or both of these tag values
-- associated with them.
describeEventSubscriptions_tagValues :: Lens.Lens' DescribeEventSubscriptions (Prelude.Maybe [Prelude.Text])
describeEventSubscriptions_tagValues :: Lens' DescribeEventSubscriptions (Maybe [Text])
describeEventSubscriptions_tagValues = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSubscriptions' {Maybe [Text]
tagValues :: Maybe [Text]
$sel:tagValues:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe [Text]
tagValues} -> Maybe [Text]
tagValues) (\s :: DescribeEventSubscriptions
s@DescribeEventSubscriptions' {} Maybe [Text]
a -> DescribeEventSubscriptions
s {$sel:tagValues:DescribeEventSubscriptions' :: Maybe [Text]
tagValues = Maybe [Text]
a} :: DescribeEventSubscriptions) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSPager DescribeEventSubscriptions where
  page :: DescribeEventSubscriptions
-> AWSResponse DescribeEventSubscriptions
-> Maybe DescribeEventSubscriptions
page DescribeEventSubscriptions
rq AWSResponse DescribeEventSubscriptions
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeEventSubscriptions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeEventSubscriptionsResponse (Maybe Text)
describeEventSubscriptionsResponse_marker
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeEventSubscriptions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeEventSubscriptionsResponse (Maybe [EventSubscription])
describeEventSubscriptionsResponse_eventSubscriptionsList
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeEventSubscriptions
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeEventSubscriptions (Maybe Text)
describeEventSubscriptions_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeEventSubscriptions
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeEventSubscriptionsResponse (Maybe Text)
describeEventSubscriptionsResponse_marker
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeEventSubscriptions where
  type
    AWSResponse DescribeEventSubscriptions =
      DescribeEventSubscriptionsResponse
  request :: (Service -> Service)
-> DescribeEventSubscriptions -> Request DescribeEventSubscriptions
request Service -> Service
overrides =
    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 DescribeEventSubscriptions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeEventSubscriptions)))
response =
    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
"DescribeEventSubscriptionsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [EventSubscription]
-> Maybe Text -> Int -> DescribeEventSubscriptionsResponse
DescribeEventSubscriptionsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                            forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"EventSubscriptionsList"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"EventSubscription")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Marker")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeEventSubscriptions where
  hashWithSalt :: Int -> DescribeEventSubscriptions -> Int
hashWithSalt Int
_salt DescribeEventSubscriptions' {Maybe Int
Maybe [Text]
Maybe Text
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
subscriptionName :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
$sel:tagValues:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe [Text]
$sel:tagKeys:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe [Text]
$sel:subscriptionName:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Text
$sel:maxRecords:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Int
$sel:marker:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxRecords
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subscriptionName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
tagKeys
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
tagValues

instance Prelude.NFData DescribeEventSubscriptions where
  rnf :: DescribeEventSubscriptions -> ()
rnf DescribeEventSubscriptions' {Maybe Int
Maybe [Text]
Maybe Text
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
subscriptionName :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
$sel:tagValues:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe [Text]
$sel:tagKeys:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe [Text]
$sel:subscriptionName:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Text
$sel:maxRecords:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Int
$sel:marker:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxRecords
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subscriptionName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
tagKeys
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
tagValues

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

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

instance Data.ToQuery DescribeEventSubscriptions where
  toQuery :: DescribeEventSubscriptions -> QueryString
toQuery DescribeEventSubscriptions' {Maybe Int
Maybe [Text]
Maybe Text
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
subscriptionName :: Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
$sel:tagValues:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe [Text]
$sel:tagKeys:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe [Text]
$sel:subscriptionName:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Text
$sel:maxRecords:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Int
$sel:marker:DescribeEventSubscriptions' :: DescribeEventSubscriptions -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeEventSubscriptions" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
        ByteString
"MaxRecords" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
maxRecords,
        ByteString
"SubscriptionName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
subscriptionName,
        ByteString
"TagKeys"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TagKey" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
tagKeys),
        ByteString
"TagValues"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TagValue" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
tagValues)
      ]

-- |
--
-- /See:/ 'newDescribeEventSubscriptionsResponse' smart constructor.
data DescribeEventSubscriptionsResponse = DescribeEventSubscriptionsResponse'
  { -- | A list of event subscriptions.
    DescribeEventSubscriptionsResponse -> Maybe [EventSubscription]
eventSubscriptionsList :: Prelude.Maybe [EventSubscription],
    -- | A value that indicates the starting point for the next set of response
    -- records in a subsequent request. If a value is returned in a response,
    -- you can retrieve the next set of records by providing this returned
    -- marker value in the @Marker@ parameter and retrying the command. If the
    -- @Marker@ field is empty, all response records have been retrieved for
    -- the request.
    DescribeEventSubscriptionsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeEventSubscriptionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeEventSubscriptionsResponse
-> DescribeEventSubscriptionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeEventSubscriptionsResponse
-> DescribeEventSubscriptionsResponse -> Bool
$c/= :: DescribeEventSubscriptionsResponse
-> DescribeEventSubscriptionsResponse -> Bool
== :: DescribeEventSubscriptionsResponse
-> DescribeEventSubscriptionsResponse -> Bool
$c== :: DescribeEventSubscriptionsResponse
-> DescribeEventSubscriptionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeEventSubscriptionsResponse]
ReadPrec DescribeEventSubscriptionsResponse
Int -> ReadS DescribeEventSubscriptionsResponse
ReadS [DescribeEventSubscriptionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeEventSubscriptionsResponse]
$creadListPrec :: ReadPrec [DescribeEventSubscriptionsResponse]
readPrec :: ReadPrec DescribeEventSubscriptionsResponse
$creadPrec :: ReadPrec DescribeEventSubscriptionsResponse
readList :: ReadS [DescribeEventSubscriptionsResponse]
$creadList :: ReadS [DescribeEventSubscriptionsResponse]
readsPrec :: Int -> ReadS DescribeEventSubscriptionsResponse
$creadsPrec :: Int -> ReadS DescribeEventSubscriptionsResponse
Prelude.Read, Int -> DescribeEventSubscriptionsResponse -> ShowS
[DescribeEventSubscriptionsResponse] -> ShowS
DescribeEventSubscriptionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeEventSubscriptionsResponse] -> ShowS
$cshowList :: [DescribeEventSubscriptionsResponse] -> ShowS
show :: DescribeEventSubscriptionsResponse -> String
$cshow :: DescribeEventSubscriptionsResponse -> String
showsPrec :: Int -> DescribeEventSubscriptionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeEventSubscriptionsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeEventSubscriptionsResponse x
-> DescribeEventSubscriptionsResponse
forall x.
DescribeEventSubscriptionsResponse
-> Rep DescribeEventSubscriptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeEventSubscriptionsResponse x
-> DescribeEventSubscriptionsResponse
$cfrom :: forall x.
DescribeEventSubscriptionsResponse
-> Rep DescribeEventSubscriptionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeEventSubscriptionsResponse' 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:
--
-- 'eventSubscriptionsList', 'describeEventSubscriptionsResponse_eventSubscriptionsList' - A list of event subscriptions.
--
-- 'marker', 'describeEventSubscriptionsResponse_marker' - A value that indicates the starting point for the next set of response
-- records in a subsequent request. If a value is returned in a response,
-- you can retrieve the next set of records by providing this returned
-- marker value in the @Marker@ parameter and retrying the command. If the
-- @Marker@ field is empty, all response records have been retrieved for
-- the request.
--
-- 'httpStatus', 'describeEventSubscriptionsResponse_httpStatus' - The response's http status code.
newDescribeEventSubscriptionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeEventSubscriptionsResponse
newDescribeEventSubscriptionsResponse :: Int -> DescribeEventSubscriptionsResponse
newDescribeEventSubscriptionsResponse Int
pHttpStatus_ =
  DescribeEventSubscriptionsResponse'
    { $sel:eventSubscriptionsList:DescribeEventSubscriptionsResponse' :: Maybe [EventSubscription]
eventSubscriptionsList =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeEventSubscriptionsResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeEventSubscriptionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of event subscriptions.
describeEventSubscriptionsResponse_eventSubscriptionsList :: Lens.Lens' DescribeEventSubscriptionsResponse (Prelude.Maybe [EventSubscription])
describeEventSubscriptionsResponse_eventSubscriptionsList :: Lens'
  DescribeEventSubscriptionsResponse (Maybe [EventSubscription])
describeEventSubscriptionsResponse_eventSubscriptionsList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSubscriptionsResponse' {Maybe [EventSubscription]
eventSubscriptionsList :: Maybe [EventSubscription]
$sel:eventSubscriptionsList:DescribeEventSubscriptionsResponse' :: DescribeEventSubscriptionsResponse -> Maybe [EventSubscription]
eventSubscriptionsList} -> Maybe [EventSubscription]
eventSubscriptionsList) (\s :: DescribeEventSubscriptionsResponse
s@DescribeEventSubscriptionsResponse' {} Maybe [EventSubscription]
a -> DescribeEventSubscriptionsResponse
s {$sel:eventSubscriptionsList:DescribeEventSubscriptionsResponse' :: Maybe [EventSubscription]
eventSubscriptionsList = Maybe [EventSubscription]
a} :: DescribeEventSubscriptionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A value that indicates the starting point for the next set of response
-- records in a subsequent request. If a value is returned in a response,
-- you can retrieve the next set of records by providing this returned
-- marker value in the @Marker@ parameter and retrying the command. If the
-- @Marker@ field is empty, all response records have been retrieved for
-- the request.
describeEventSubscriptionsResponse_marker :: Lens.Lens' DescribeEventSubscriptionsResponse (Prelude.Maybe Prelude.Text)
describeEventSubscriptionsResponse_marker :: Lens' DescribeEventSubscriptionsResponse (Maybe Text)
describeEventSubscriptionsResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeEventSubscriptionsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeEventSubscriptionsResponse' :: DescribeEventSubscriptionsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeEventSubscriptionsResponse
s@DescribeEventSubscriptionsResponse' {} Maybe Text
a -> DescribeEventSubscriptionsResponse
s {$sel:marker:DescribeEventSubscriptionsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeEventSubscriptionsResponse)

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

instance
  Prelude.NFData
    DescribeEventSubscriptionsResponse
  where
  rnf :: DescribeEventSubscriptionsResponse -> ()
rnf DescribeEventSubscriptionsResponse' {Int
Maybe [EventSubscription]
Maybe Text
httpStatus :: Int
marker :: Maybe Text
eventSubscriptionsList :: Maybe [EventSubscription]
$sel:httpStatus:DescribeEventSubscriptionsResponse' :: DescribeEventSubscriptionsResponse -> Int
$sel:marker:DescribeEventSubscriptionsResponse' :: DescribeEventSubscriptionsResponse -> Maybe Text
$sel:eventSubscriptionsList:DescribeEventSubscriptionsResponse' :: DescribeEventSubscriptionsResponse -> Maybe [EventSubscription]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [EventSubscription]
eventSubscriptionsList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus