{-# 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.AutoScaling.DescribeNotificationConfigurations
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets information about the Amazon SNS notifications that are configured
-- for one or more Auto Scaling groups.
--
-- This operation returns paginated results.
module Amazonka.AutoScaling.DescribeNotificationConfigurations
  ( -- * Creating a Request
    DescribeNotificationConfigurations (..),
    newDescribeNotificationConfigurations,

    -- * Request Lenses
    describeNotificationConfigurations_autoScalingGroupNames,
    describeNotificationConfigurations_nextToken,
    describeNotificationConfigurations_maxRecords,

    -- * Destructuring the Response
    DescribeNotificationConfigurationsResponse (..),
    newDescribeNotificationConfigurationsResponse,

    -- * Response Lenses
    describeNotificationConfigurationsResponse_nextToken,
    describeNotificationConfigurationsResponse_httpStatus,
    describeNotificationConfigurationsResponse_notificationConfigurations,
  )
where

import Amazonka.AutoScaling.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeNotificationConfigurations' smart constructor.
data DescribeNotificationConfigurations = DescribeNotificationConfigurations'
  { -- | The name of the Auto Scaling group.
    DescribeNotificationConfigurations -> Maybe [Text]
autoScalingGroupNames :: Prelude.Maybe [Prelude.Text],
    -- | The token for the next set of items to return. (You received this token
    -- from a previous call.)
    DescribeNotificationConfigurations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return with this call. The default value
    -- is @50@ and the maximum value is @100@.
    DescribeNotificationConfigurations -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeNotificationConfigurations
-> DescribeNotificationConfigurations -> Bool
(DescribeNotificationConfigurations
 -> DescribeNotificationConfigurations -> Bool)
-> (DescribeNotificationConfigurations
    -> DescribeNotificationConfigurations -> Bool)
-> Eq DescribeNotificationConfigurations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeNotificationConfigurations
-> DescribeNotificationConfigurations -> Bool
$c/= :: DescribeNotificationConfigurations
-> DescribeNotificationConfigurations -> Bool
== :: DescribeNotificationConfigurations
-> DescribeNotificationConfigurations -> Bool
$c== :: DescribeNotificationConfigurations
-> DescribeNotificationConfigurations -> Bool
Prelude.Eq, ReadPrec [DescribeNotificationConfigurations]
ReadPrec DescribeNotificationConfigurations
Int -> ReadS DescribeNotificationConfigurations
ReadS [DescribeNotificationConfigurations]
(Int -> ReadS DescribeNotificationConfigurations)
-> ReadS [DescribeNotificationConfigurations]
-> ReadPrec DescribeNotificationConfigurations
-> ReadPrec [DescribeNotificationConfigurations]
-> Read DescribeNotificationConfigurations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeNotificationConfigurations]
$creadListPrec :: ReadPrec [DescribeNotificationConfigurations]
readPrec :: ReadPrec DescribeNotificationConfigurations
$creadPrec :: ReadPrec DescribeNotificationConfigurations
readList :: ReadS [DescribeNotificationConfigurations]
$creadList :: ReadS [DescribeNotificationConfigurations]
readsPrec :: Int -> ReadS DescribeNotificationConfigurations
$creadsPrec :: Int -> ReadS DescribeNotificationConfigurations
Prelude.Read, Int -> DescribeNotificationConfigurations -> ShowS
[DescribeNotificationConfigurations] -> ShowS
DescribeNotificationConfigurations -> String
(Int -> DescribeNotificationConfigurations -> ShowS)
-> (DescribeNotificationConfigurations -> String)
-> ([DescribeNotificationConfigurations] -> ShowS)
-> Show DescribeNotificationConfigurations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeNotificationConfigurations] -> ShowS
$cshowList :: [DescribeNotificationConfigurations] -> ShowS
show :: DescribeNotificationConfigurations -> String
$cshow :: DescribeNotificationConfigurations -> String
showsPrec :: Int -> DescribeNotificationConfigurations -> ShowS
$cshowsPrec :: Int -> DescribeNotificationConfigurations -> ShowS
Prelude.Show, (forall x.
 DescribeNotificationConfigurations
 -> Rep DescribeNotificationConfigurations x)
-> (forall x.
    Rep DescribeNotificationConfigurations x
    -> DescribeNotificationConfigurations)
-> Generic DescribeNotificationConfigurations
forall x.
Rep DescribeNotificationConfigurations x
-> DescribeNotificationConfigurations
forall x.
DescribeNotificationConfigurations
-> Rep DescribeNotificationConfigurations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeNotificationConfigurations x
-> DescribeNotificationConfigurations
$cfrom :: forall x.
DescribeNotificationConfigurations
-> Rep DescribeNotificationConfigurations x
Prelude.Generic)

-- |
-- Create a value of 'DescribeNotificationConfigurations' 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:
--
-- 'autoScalingGroupNames', 'describeNotificationConfigurations_autoScalingGroupNames' - The name of the Auto Scaling group.
--
-- 'nextToken', 'describeNotificationConfigurations_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
--
-- 'maxRecords', 'describeNotificationConfigurations_maxRecords' - The maximum number of items to return with this call. The default value
-- is @50@ and the maximum value is @100@.
newDescribeNotificationConfigurations ::
  DescribeNotificationConfigurations
newDescribeNotificationConfigurations :: DescribeNotificationConfigurations
newDescribeNotificationConfigurations =
  DescribeNotificationConfigurations' :: Maybe [Text]
-> Maybe Text -> Maybe Int -> DescribeNotificationConfigurations
DescribeNotificationConfigurations'
    { $sel:autoScalingGroupNames:DescribeNotificationConfigurations' :: Maybe [Text]
autoScalingGroupNames =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeNotificationConfigurations' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeNotificationConfigurations' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the Auto Scaling group.
describeNotificationConfigurations_autoScalingGroupNames :: Lens.Lens' DescribeNotificationConfigurations (Prelude.Maybe [Prelude.Text])
describeNotificationConfigurations_autoScalingGroupNames :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeNotificationConfigurations
-> f DescribeNotificationConfigurations
describeNotificationConfigurations_autoScalingGroupNames = (DescribeNotificationConfigurations -> Maybe [Text])
-> (DescribeNotificationConfigurations
    -> Maybe [Text] -> DescribeNotificationConfigurations)
-> Lens
     DescribeNotificationConfigurations
     DescribeNotificationConfigurations
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationConfigurations' {Maybe [Text]
autoScalingGroupNames :: Maybe [Text]
$sel:autoScalingGroupNames:DescribeNotificationConfigurations' :: DescribeNotificationConfigurations -> Maybe [Text]
autoScalingGroupNames} -> Maybe [Text]
autoScalingGroupNames) (\s :: DescribeNotificationConfigurations
s@DescribeNotificationConfigurations' {} Maybe [Text]
a -> DescribeNotificationConfigurations
s {$sel:autoScalingGroupNames:DescribeNotificationConfigurations' :: Maybe [Text]
autoScalingGroupNames = Maybe [Text]
a} :: DescribeNotificationConfigurations) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeNotificationConfigurations
 -> f DescribeNotificationConfigurations)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeNotificationConfigurations
-> f DescribeNotificationConfigurations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token for the next set of items to return. (You received this token
-- from a previous call.)
describeNotificationConfigurations_nextToken :: Lens.Lens' DescribeNotificationConfigurations (Prelude.Maybe Prelude.Text)
describeNotificationConfigurations_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeNotificationConfigurations
-> f DescribeNotificationConfigurations
describeNotificationConfigurations_nextToken = (DescribeNotificationConfigurations -> Maybe Text)
-> (DescribeNotificationConfigurations
    -> Maybe Text -> DescribeNotificationConfigurations)
-> Lens
     DescribeNotificationConfigurations
     DescribeNotificationConfigurations
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationConfigurations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeNotificationConfigurations' :: DescribeNotificationConfigurations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeNotificationConfigurations
s@DescribeNotificationConfigurations' {} Maybe Text
a -> DescribeNotificationConfigurations
s {$sel:nextToken:DescribeNotificationConfigurations' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeNotificationConfigurations)

-- | The maximum number of items to return with this call. The default value
-- is @50@ and the maximum value is @100@.
describeNotificationConfigurations_maxRecords :: Lens.Lens' DescribeNotificationConfigurations (Prelude.Maybe Prelude.Int)
describeNotificationConfigurations_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeNotificationConfigurations
-> f DescribeNotificationConfigurations
describeNotificationConfigurations_maxRecords = (DescribeNotificationConfigurations -> Maybe Int)
-> (DescribeNotificationConfigurations
    -> Maybe Int -> DescribeNotificationConfigurations)
-> Lens
     DescribeNotificationConfigurations
     DescribeNotificationConfigurations
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationConfigurations' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeNotificationConfigurations' :: DescribeNotificationConfigurations -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeNotificationConfigurations
s@DescribeNotificationConfigurations' {} Maybe Int
a -> DescribeNotificationConfigurations
s {$sel:maxRecords:DescribeNotificationConfigurations' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeNotificationConfigurations)

instance
  Core.AWSPager
    DescribeNotificationConfigurations
  where
  page :: DescribeNotificationConfigurations
-> AWSResponse DescribeNotificationConfigurations
-> Maybe DescribeNotificationConfigurations
page DescribeNotificationConfigurations
rq AWSResponse DescribeNotificationConfigurations
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeNotificationConfigurations
DescribeNotificationConfigurationsResponse
rs
            DescribeNotificationConfigurationsResponse
-> Getting
     (First Text) DescribeNotificationConfigurationsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeNotificationConfigurationsResponse
-> Const (First Text) DescribeNotificationConfigurationsResponse
Lens' DescribeNotificationConfigurationsResponse (Maybe Text)
describeNotificationConfigurationsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeNotificationConfigurationsResponse
 -> Const (First Text) DescribeNotificationConfigurationsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text) DescribeNotificationConfigurationsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeNotificationConfigurations
forall a. Maybe a
Prelude.Nothing
    | [NotificationConfiguration] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeNotificationConfigurations
DescribeNotificationConfigurationsResponse
rs
            DescribeNotificationConfigurationsResponse
-> Getting
     [NotificationConfiguration]
     DescribeNotificationConfigurationsResponse
     [NotificationConfiguration]
-> [NotificationConfiguration]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [NotificationConfiguration]
  DescribeNotificationConfigurationsResponse
  [NotificationConfiguration]
Lens'
  DescribeNotificationConfigurationsResponse
  [NotificationConfiguration]
describeNotificationConfigurationsResponse_notificationConfigurations
        ) =
      Maybe DescribeNotificationConfigurations
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeNotificationConfigurations
-> Maybe DescribeNotificationConfigurations
forall a. a -> Maybe a
Prelude.Just (DescribeNotificationConfigurations
 -> Maybe DescribeNotificationConfigurations)
-> DescribeNotificationConfigurations
-> Maybe DescribeNotificationConfigurations
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeNotificationConfigurations
rq
          DescribeNotificationConfigurations
-> (DescribeNotificationConfigurations
    -> DescribeNotificationConfigurations)
-> DescribeNotificationConfigurations
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeNotificationConfigurations
-> Identity DescribeNotificationConfigurations
Lens
  DescribeNotificationConfigurations
  DescribeNotificationConfigurations
  (Maybe Text)
  (Maybe Text)
describeNotificationConfigurations_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeNotificationConfigurations
 -> Identity DescribeNotificationConfigurations)
-> Maybe Text
-> DescribeNotificationConfigurations
-> DescribeNotificationConfigurations
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeNotificationConfigurations
DescribeNotificationConfigurationsResponse
rs
          DescribeNotificationConfigurationsResponse
-> Getting
     (First Text) DescribeNotificationConfigurationsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeNotificationConfigurationsResponse
-> Const (First Text) DescribeNotificationConfigurationsResponse
Lens' DescribeNotificationConfigurationsResponse (Maybe Text)
describeNotificationConfigurationsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeNotificationConfigurationsResponse
 -> Const (First Text) DescribeNotificationConfigurationsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting
     (First Text) DescribeNotificationConfigurationsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    DescribeNotificationConfigurations
  where
  type
    AWSResponse DescribeNotificationConfigurations =
      DescribeNotificationConfigurationsResponse
  request :: DescribeNotificationConfigurations
-> Request DescribeNotificationConfigurations
request = Service
-> DescribeNotificationConfigurations
-> Request DescribeNotificationConfigurations
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeNotificationConfigurations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeNotificationConfigurations)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeNotificationConfigurations))
-> Logger
-> Service
-> Proxy DescribeNotificationConfigurations
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeNotificationConfigurations)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeNotificationConfigurationsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Int
-> [NotificationConfiguration]
-> DescribeNotificationConfigurationsResponse
DescribeNotificationConfigurationsResponse'
            (Maybe Text
 -> Int
 -> [NotificationConfiguration]
 -> DescribeNotificationConfigurationsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int
      -> [NotificationConfiguration]
      -> DescribeNotificationConfigurationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextToken")
              Either
  String
  (Int
   -> [NotificationConfiguration]
   -> DescribeNotificationConfigurationsResponse)
-> Either String Int
-> Either
     String
     ([NotificationConfiguration]
      -> DescribeNotificationConfigurationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
              Either
  String
  ([NotificationConfiguration]
   -> DescribeNotificationConfigurationsResponse)
-> Either String [NotificationConfiguration]
-> Either String DescribeNotificationConfigurationsResponse
forall (f :: * -> *) a b. Applicative f => 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)
Core..@? Text
"NotificationConfigurations"
                              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 [NotificationConfiguration])
-> Either String [NotificationConfiguration]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [NotificationConfiguration]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
                          )
      )

instance
  Prelude.Hashable
    DescribeNotificationConfigurations

instance
  Prelude.NFData
    DescribeNotificationConfigurations

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

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

instance
  Core.ToQuery
    DescribeNotificationConfigurations
  where
  toQuery :: DescribeNotificationConfigurations -> QueryString
toQuery DescribeNotificationConfigurations' {Maybe Int
Maybe [Text]
Maybe Text
maxRecords :: Maybe Int
nextToken :: Maybe Text
autoScalingGroupNames :: Maybe [Text]
$sel:maxRecords:DescribeNotificationConfigurations' :: DescribeNotificationConfigurations -> Maybe Int
$sel:nextToken:DescribeNotificationConfigurations' :: DescribeNotificationConfigurations -> Maybe Text
$sel:autoScalingGroupNames:DescribeNotificationConfigurations' :: DescribeNotificationConfigurations -> Maybe [Text]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"DescribeNotificationConfigurations" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
        ByteString
"AutoScalingGroupNames"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
autoScalingGroupNames
            ),
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"MaxRecords" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxRecords
      ]

-- | /See:/ 'newDescribeNotificationConfigurationsResponse' smart constructor.
data DescribeNotificationConfigurationsResponse = DescribeNotificationConfigurationsResponse'
  { -- | A string that indicates that the response contains more items than can
    -- be returned in a single response. To receive additional items, specify
    -- this string for the @NextToken@ value when requesting the next set of
    -- items. This value is null when there are no more items to return.
    DescribeNotificationConfigurationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeNotificationConfigurationsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The notification configurations.
    DescribeNotificationConfigurationsResponse
-> [NotificationConfiguration]
notificationConfigurations :: [NotificationConfiguration]
  }
  deriving (DescribeNotificationConfigurationsResponse
-> DescribeNotificationConfigurationsResponse -> Bool
(DescribeNotificationConfigurationsResponse
 -> DescribeNotificationConfigurationsResponse -> Bool)
-> (DescribeNotificationConfigurationsResponse
    -> DescribeNotificationConfigurationsResponse -> Bool)
-> Eq DescribeNotificationConfigurationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeNotificationConfigurationsResponse
-> DescribeNotificationConfigurationsResponse -> Bool
$c/= :: DescribeNotificationConfigurationsResponse
-> DescribeNotificationConfigurationsResponse -> Bool
== :: DescribeNotificationConfigurationsResponse
-> DescribeNotificationConfigurationsResponse -> Bool
$c== :: DescribeNotificationConfigurationsResponse
-> DescribeNotificationConfigurationsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeNotificationConfigurationsResponse]
ReadPrec DescribeNotificationConfigurationsResponse
Int -> ReadS DescribeNotificationConfigurationsResponse
ReadS [DescribeNotificationConfigurationsResponse]
(Int -> ReadS DescribeNotificationConfigurationsResponse)
-> ReadS [DescribeNotificationConfigurationsResponse]
-> ReadPrec DescribeNotificationConfigurationsResponse
-> ReadPrec [DescribeNotificationConfigurationsResponse]
-> Read DescribeNotificationConfigurationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeNotificationConfigurationsResponse]
$creadListPrec :: ReadPrec [DescribeNotificationConfigurationsResponse]
readPrec :: ReadPrec DescribeNotificationConfigurationsResponse
$creadPrec :: ReadPrec DescribeNotificationConfigurationsResponse
readList :: ReadS [DescribeNotificationConfigurationsResponse]
$creadList :: ReadS [DescribeNotificationConfigurationsResponse]
readsPrec :: Int -> ReadS DescribeNotificationConfigurationsResponse
$creadsPrec :: Int -> ReadS DescribeNotificationConfigurationsResponse
Prelude.Read, Int -> DescribeNotificationConfigurationsResponse -> ShowS
[DescribeNotificationConfigurationsResponse] -> ShowS
DescribeNotificationConfigurationsResponse -> String
(Int -> DescribeNotificationConfigurationsResponse -> ShowS)
-> (DescribeNotificationConfigurationsResponse -> String)
-> ([DescribeNotificationConfigurationsResponse] -> ShowS)
-> Show DescribeNotificationConfigurationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeNotificationConfigurationsResponse] -> ShowS
$cshowList :: [DescribeNotificationConfigurationsResponse] -> ShowS
show :: DescribeNotificationConfigurationsResponse -> String
$cshow :: DescribeNotificationConfigurationsResponse -> String
showsPrec :: Int -> DescribeNotificationConfigurationsResponse -> ShowS
$cshowsPrec :: Int -> DescribeNotificationConfigurationsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeNotificationConfigurationsResponse
 -> Rep DescribeNotificationConfigurationsResponse x)
-> (forall x.
    Rep DescribeNotificationConfigurationsResponse x
    -> DescribeNotificationConfigurationsResponse)
-> Generic DescribeNotificationConfigurationsResponse
forall x.
Rep DescribeNotificationConfigurationsResponse x
-> DescribeNotificationConfigurationsResponse
forall x.
DescribeNotificationConfigurationsResponse
-> Rep DescribeNotificationConfigurationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeNotificationConfigurationsResponse x
-> DescribeNotificationConfigurationsResponse
$cfrom :: forall x.
DescribeNotificationConfigurationsResponse
-> Rep DescribeNotificationConfigurationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeNotificationConfigurationsResponse' 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:
--
-- 'nextToken', 'describeNotificationConfigurationsResponse_nextToken' - A string that indicates that the response contains more items than can
-- be returned in a single response. To receive additional items, specify
-- this string for the @NextToken@ value when requesting the next set of
-- items. This value is null when there are no more items to return.
--
-- 'httpStatus', 'describeNotificationConfigurationsResponse_httpStatus' - The response's http status code.
--
-- 'notificationConfigurations', 'describeNotificationConfigurationsResponse_notificationConfigurations' - The notification configurations.
newDescribeNotificationConfigurationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeNotificationConfigurationsResponse
newDescribeNotificationConfigurationsResponse :: Int -> DescribeNotificationConfigurationsResponse
newDescribeNotificationConfigurationsResponse
  Int
pHttpStatus_ =
    DescribeNotificationConfigurationsResponse' :: Maybe Text
-> Int
-> [NotificationConfiguration]
-> DescribeNotificationConfigurationsResponse
DescribeNotificationConfigurationsResponse'
      { $sel:nextToken:DescribeNotificationConfigurationsResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeNotificationConfigurationsResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:notificationConfigurations:DescribeNotificationConfigurationsResponse' :: [NotificationConfiguration]
notificationConfigurations =
          [NotificationConfiguration]
forall a. Monoid a => a
Prelude.mempty
      }

-- | A string that indicates that the response contains more items than can
-- be returned in a single response. To receive additional items, specify
-- this string for the @NextToken@ value when requesting the next set of
-- items. This value is null when there are no more items to return.
describeNotificationConfigurationsResponse_nextToken :: Lens.Lens' DescribeNotificationConfigurationsResponse (Prelude.Maybe Prelude.Text)
describeNotificationConfigurationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeNotificationConfigurationsResponse
-> f DescribeNotificationConfigurationsResponse
describeNotificationConfigurationsResponse_nextToken = (DescribeNotificationConfigurationsResponse -> Maybe Text)
-> (DescribeNotificationConfigurationsResponse
    -> Maybe Text -> DescribeNotificationConfigurationsResponse)
-> Lens' DescribeNotificationConfigurationsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationConfigurationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeNotificationConfigurationsResponse' :: DescribeNotificationConfigurationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeNotificationConfigurationsResponse
s@DescribeNotificationConfigurationsResponse' {} Maybe Text
a -> DescribeNotificationConfigurationsResponse
s {$sel:nextToken:DescribeNotificationConfigurationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeNotificationConfigurationsResponse)

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

-- | The notification configurations.
describeNotificationConfigurationsResponse_notificationConfigurations :: Lens.Lens' DescribeNotificationConfigurationsResponse [NotificationConfiguration]
describeNotificationConfigurationsResponse_notificationConfigurations :: ([NotificationConfiguration] -> f [NotificationConfiguration])
-> DescribeNotificationConfigurationsResponse
-> f DescribeNotificationConfigurationsResponse
describeNotificationConfigurationsResponse_notificationConfigurations = (DescribeNotificationConfigurationsResponse
 -> [NotificationConfiguration])
-> (DescribeNotificationConfigurationsResponse
    -> [NotificationConfiguration]
    -> DescribeNotificationConfigurationsResponse)
-> Lens'
     DescribeNotificationConfigurationsResponse
     [NotificationConfiguration]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationConfigurationsResponse' {[NotificationConfiguration]
notificationConfigurations :: [NotificationConfiguration]
$sel:notificationConfigurations:DescribeNotificationConfigurationsResponse' :: DescribeNotificationConfigurationsResponse
-> [NotificationConfiguration]
notificationConfigurations} -> [NotificationConfiguration]
notificationConfigurations) (\s :: DescribeNotificationConfigurationsResponse
s@DescribeNotificationConfigurationsResponse' {} [NotificationConfiguration]
a -> DescribeNotificationConfigurationsResponse
s {$sel:notificationConfigurations:DescribeNotificationConfigurationsResponse' :: [NotificationConfiguration]
notificationConfigurations = [NotificationConfiguration]
a} :: DescribeNotificationConfigurationsResponse) (([NotificationConfiguration] -> f [NotificationConfiguration])
 -> DescribeNotificationConfigurationsResponse
 -> f DescribeNotificationConfigurationsResponse)
-> (([NotificationConfiguration] -> f [NotificationConfiguration])
    -> [NotificationConfiguration] -> f [NotificationConfiguration])
-> ([NotificationConfiguration] -> f [NotificationConfiguration])
-> DescribeNotificationConfigurationsResponse
-> f DescribeNotificationConfigurationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([NotificationConfiguration] -> f [NotificationConfiguration])
-> [NotificationConfiguration] -> f [NotificationConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    DescribeNotificationConfigurationsResponse