{-# 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.DAX.DescribeParameterGroups
-- 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)
--
-- Returns a list of parameter group descriptions. If a parameter group
-- name is specified, the list will contain only the descriptions for that
-- group.
--
-- This operation returns paginated results.
module Amazonka.DAX.DescribeParameterGroups
  ( -- * Creating a Request
    DescribeParameterGroups (..),
    newDescribeParameterGroups,

    -- * Request Lenses
    describeParameterGroups_nextToken,
    describeParameterGroups_parameterGroupNames,
    describeParameterGroups_maxResults,

    -- * Destructuring the Response
    DescribeParameterGroupsResponse (..),
    newDescribeParameterGroupsResponse,

    -- * Response Lenses
    describeParameterGroupsResponse_nextToken,
    describeParameterGroupsResponse_parameterGroups,
    describeParameterGroupsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DAX.Types
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:/ 'newDescribeParameterGroups' smart constructor.
data DescribeParameterGroups = DescribeParameterGroups'
  { -- | An optional token returned from a prior request. Use this token for
    -- pagination of results from this action. If this parameter is specified,
    -- the response includes only results beyond the token, up to the value
    -- specified by @MaxResults@.
    DescribeParameterGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The names of the parameter groups.
    DescribeParameterGroups -> Maybe [Text]
parameterGroupNames :: Prelude.Maybe [Prelude.Text],
    -- | The maximum number of results to include in the response. If more
    -- results exist than the specified @MaxResults@ value, a token is included
    -- in the response so that the remaining results can be retrieved.
    --
    -- The value for @MaxResults@ must be between 20 and 100.
    DescribeParameterGroups -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeParameterGroups -> DescribeParameterGroups -> Bool
(DescribeParameterGroups -> DescribeParameterGroups -> Bool)
-> (DescribeParameterGroups -> DescribeParameterGroups -> Bool)
-> Eq DescribeParameterGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeParameterGroups -> DescribeParameterGroups -> Bool
$c/= :: DescribeParameterGroups -> DescribeParameterGroups -> Bool
== :: DescribeParameterGroups -> DescribeParameterGroups -> Bool
$c== :: DescribeParameterGroups -> DescribeParameterGroups -> Bool
Prelude.Eq, ReadPrec [DescribeParameterGroups]
ReadPrec DescribeParameterGroups
Int -> ReadS DescribeParameterGroups
ReadS [DescribeParameterGroups]
(Int -> ReadS DescribeParameterGroups)
-> ReadS [DescribeParameterGroups]
-> ReadPrec DescribeParameterGroups
-> ReadPrec [DescribeParameterGroups]
-> Read DescribeParameterGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeParameterGroups]
$creadListPrec :: ReadPrec [DescribeParameterGroups]
readPrec :: ReadPrec DescribeParameterGroups
$creadPrec :: ReadPrec DescribeParameterGroups
readList :: ReadS [DescribeParameterGroups]
$creadList :: ReadS [DescribeParameterGroups]
readsPrec :: Int -> ReadS DescribeParameterGroups
$creadsPrec :: Int -> ReadS DescribeParameterGroups
Prelude.Read, Int -> DescribeParameterGroups -> ShowS
[DescribeParameterGroups] -> ShowS
DescribeParameterGroups -> String
(Int -> DescribeParameterGroups -> ShowS)
-> (DescribeParameterGroups -> String)
-> ([DescribeParameterGroups] -> ShowS)
-> Show DescribeParameterGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeParameterGroups] -> ShowS
$cshowList :: [DescribeParameterGroups] -> ShowS
show :: DescribeParameterGroups -> String
$cshow :: DescribeParameterGroups -> String
showsPrec :: Int -> DescribeParameterGroups -> ShowS
$cshowsPrec :: Int -> DescribeParameterGroups -> ShowS
Prelude.Show, (forall x.
 DescribeParameterGroups -> Rep DescribeParameterGroups x)
-> (forall x.
    Rep DescribeParameterGroups x -> DescribeParameterGroups)
-> Generic DescribeParameterGroups
forall x. Rep DescribeParameterGroups x -> DescribeParameterGroups
forall x. DescribeParameterGroups -> Rep DescribeParameterGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeParameterGroups x -> DescribeParameterGroups
$cfrom :: forall x. DescribeParameterGroups -> Rep DescribeParameterGroups x
Prelude.Generic)

-- |
-- Create a value of 'DescribeParameterGroups' 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', 'describeParameterGroups_nextToken' - An optional token returned from a prior request. Use this token for
-- pagination of results from this action. If this parameter is specified,
-- the response includes only results beyond the token, up to the value
-- specified by @MaxResults@.
--
-- 'parameterGroupNames', 'describeParameterGroups_parameterGroupNames' - The names of the parameter groups.
--
-- 'maxResults', 'describeParameterGroups_maxResults' - The maximum number of results to include in the response. If more
-- results exist than the specified @MaxResults@ value, a token is included
-- in the response so that the remaining results can be retrieved.
--
-- The value for @MaxResults@ must be between 20 and 100.
newDescribeParameterGroups ::
  DescribeParameterGroups
newDescribeParameterGroups :: DescribeParameterGroups
newDescribeParameterGroups =
  DescribeParameterGroups' :: Maybe Text -> Maybe [Text] -> Maybe Int -> DescribeParameterGroups
DescribeParameterGroups'
    { $sel:nextToken:DescribeParameterGroups' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterGroupNames:DescribeParameterGroups' :: Maybe [Text]
parameterGroupNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeParameterGroups' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | An optional token returned from a prior request. Use this token for
-- pagination of results from this action. If this parameter is specified,
-- the response includes only results beyond the token, up to the value
-- specified by @MaxResults@.
describeParameterGroups_nextToken :: Lens.Lens' DescribeParameterGroups (Prelude.Maybe Prelude.Text)
describeParameterGroups_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeParameterGroups -> f DescribeParameterGroups
describeParameterGroups_nextToken = (DescribeParameterGroups -> Maybe Text)
-> (DescribeParameterGroups
    -> Maybe Text -> DescribeParameterGroups)
-> Lens
     DescribeParameterGroups
     DescribeParameterGroups
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameterGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeParameterGroups
s@DescribeParameterGroups' {} Maybe Text
a -> DescribeParameterGroups
s {$sel:nextToken:DescribeParameterGroups' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeParameterGroups)

-- | The names of the parameter groups.
describeParameterGroups_parameterGroupNames :: Lens.Lens' DescribeParameterGroups (Prelude.Maybe [Prelude.Text])
describeParameterGroups_parameterGroupNames :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeParameterGroups -> f DescribeParameterGroups
describeParameterGroups_parameterGroupNames = (DescribeParameterGroups -> Maybe [Text])
-> (DescribeParameterGroups
    -> Maybe [Text] -> DescribeParameterGroups)
-> Lens
     DescribeParameterGroups
     DescribeParameterGroups
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameterGroups' {Maybe [Text]
parameterGroupNames :: Maybe [Text]
$sel:parameterGroupNames:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe [Text]
parameterGroupNames} -> Maybe [Text]
parameterGroupNames) (\s :: DescribeParameterGroups
s@DescribeParameterGroups' {} Maybe [Text]
a -> DescribeParameterGroups
s {$sel:parameterGroupNames:DescribeParameterGroups' :: Maybe [Text]
parameterGroupNames = Maybe [Text]
a} :: DescribeParameterGroups) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeParameterGroups -> f DescribeParameterGroups)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeParameterGroups
-> f DescribeParameterGroups
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 maximum number of results to include in the response. If more
-- results exist than the specified @MaxResults@ value, a token is included
-- in the response so that the remaining results can be retrieved.
--
-- The value for @MaxResults@ must be between 20 and 100.
describeParameterGroups_maxResults :: Lens.Lens' DescribeParameterGroups (Prelude.Maybe Prelude.Int)
describeParameterGroups_maxResults :: (Maybe Int -> f (Maybe Int))
-> DescribeParameterGroups -> f DescribeParameterGroups
describeParameterGroups_maxResults = (DescribeParameterGroups -> Maybe Int)
-> (DescribeParameterGroups
    -> Maybe Int -> DescribeParameterGroups)
-> Lens
     DescribeParameterGroups
     DescribeParameterGroups
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameterGroups' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeParameterGroups
s@DescribeParameterGroups' {} Maybe Int
a -> DescribeParameterGroups
s {$sel:maxResults:DescribeParameterGroups' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeParameterGroups)

instance Core.AWSPager DescribeParameterGroups where
  page :: DescribeParameterGroups
-> AWSResponse DescribeParameterGroups
-> Maybe DescribeParameterGroups
page DescribeParameterGroups
rq AWSResponse DescribeParameterGroups
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeParameterGroups
DescribeParameterGroupsResponse
rs
            DescribeParameterGroupsResponse
-> Getting (First Text) DescribeParameterGroupsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeParameterGroupsResponse
-> Const (First Text) DescribeParameterGroupsResponse
Lens' DescribeParameterGroupsResponse (Maybe Text)
describeParameterGroupsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeParameterGroupsResponse
 -> Const (First Text) DescribeParameterGroupsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeParameterGroupsResponse 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 DescribeParameterGroups
forall a. Maybe a
Prelude.Nothing
    | Maybe [ParameterGroup] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeParameterGroups
DescribeParameterGroupsResponse
rs
            DescribeParameterGroupsResponse
-> Getting
     (First [ParameterGroup])
     DescribeParameterGroupsResponse
     [ParameterGroup]
-> Maybe [ParameterGroup]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ParameterGroup]
 -> Const (First [ParameterGroup]) (Maybe [ParameterGroup]))
-> DescribeParameterGroupsResponse
-> Const (First [ParameterGroup]) DescribeParameterGroupsResponse
Lens' DescribeParameterGroupsResponse (Maybe [ParameterGroup])
describeParameterGroupsResponse_parameterGroups
              ((Maybe [ParameterGroup]
  -> Const (First [ParameterGroup]) (Maybe [ParameterGroup]))
 -> DescribeParameterGroupsResponse
 -> Const (First [ParameterGroup]) DescribeParameterGroupsResponse)
-> (([ParameterGroup]
     -> Const (First [ParameterGroup]) [ParameterGroup])
    -> Maybe [ParameterGroup]
    -> Const (First [ParameterGroup]) (Maybe [ParameterGroup]))
-> Getting
     (First [ParameterGroup])
     DescribeParameterGroupsResponse
     [ParameterGroup]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ParameterGroup]
 -> Const (First [ParameterGroup]) [ParameterGroup])
-> Maybe [ParameterGroup]
-> Const (First [ParameterGroup]) (Maybe [ParameterGroup])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeParameterGroups
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeParameterGroups -> Maybe DescribeParameterGroups
forall a. a -> Maybe a
Prelude.Just (DescribeParameterGroups -> Maybe DescribeParameterGroups)
-> DescribeParameterGroups -> Maybe DescribeParameterGroups
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeParameterGroups
rq
          DescribeParameterGroups
-> (DescribeParameterGroups -> DescribeParameterGroups)
-> DescribeParameterGroups
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeParameterGroups -> Identity DescribeParameterGroups
Lens
  DescribeParameterGroups
  DescribeParameterGroups
  (Maybe Text)
  (Maybe Text)
describeParameterGroups_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeParameterGroups -> Identity DescribeParameterGroups)
-> Maybe Text -> DescribeParameterGroups -> DescribeParameterGroups
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeParameterGroups
DescribeParameterGroupsResponse
rs
          DescribeParameterGroupsResponse
-> Getting (First Text) DescribeParameterGroupsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeParameterGroupsResponse
-> Const (First Text) DescribeParameterGroupsResponse
Lens' DescribeParameterGroupsResponse (Maybe Text)
describeParameterGroupsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeParameterGroupsResponse
 -> Const (First Text) DescribeParameterGroupsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeParameterGroupsResponse 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 DescribeParameterGroups where
  type
    AWSResponse DescribeParameterGroups =
      DescribeParameterGroupsResponse
  request :: DescribeParameterGroups -> Request DescribeParameterGroups
request = Service
-> DescribeParameterGroups -> Request DescribeParameterGroups
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeParameterGroups
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeParameterGroups)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeParameterGroups))
-> Logger
-> Service
-> Proxy DescribeParameterGroups
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeParameterGroups)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [ParameterGroup] -> Int -> DescribeParameterGroupsResponse
DescribeParameterGroupsResponse'
            (Maybe Text
 -> Maybe [ParameterGroup]
 -> Int
 -> DescribeParameterGroupsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ParameterGroup] -> Int -> DescribeParameterGroupsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String
  (Maybe [ParameterGroup] -> Int -> DescribeParameterGroupsResponse)
-> Either String (Maybe [ParameterGroup])
-> Either String (Int -> DescribeParameterGroupsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [ParameterGroup]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ParameterGroups"
                            Either String (Maybe (Maybe [ParameterGroup]))
-> Maybe [ParameterGroup] -> Either String (Maybe [ParameterGroup])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ParameterGroup]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> DescribeParameterGroupsResponse)
-> Either String Int
-> Either String DescribeParameterGroupsResponse
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))
      )

instance Prelude.Hashable DescribeParameterGroups

instance Prelude.NFData DescribeParameterGroups

instance Core.ToHeaders DescribeParameterGroups where
  toHeaders :: DescribeParameterGroups -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeParameterGroups -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonDAXV3.DescribeParameterGroups" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DescribeParameterGroups where
  toJSON :: DescribeParameterGroups -> Value
toJSON DescribeParameterGroups' {Maybe Int
Maybe [Text]
Maybe Text
maxResults :: Maybe Int
parameterGroupNames :: Maybe [Text]
nextToken :: Maybe Text
$sel:maxResults:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe Int
$sel:parameterGroupNames:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe [Text]
$sel:nextToken:DescribeParameterGroups' :: DescribeParameterGroups -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"ParameterGroupNames" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
parameterGroupNames,
            (Text
"MaxResults" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults
          ]
      )

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

instance Core.ToQuery DescribeParameterGroups where
  toQuery :: DescribeParameterGroups -> QueryString
toQuery = QueryString -> DescribeParameterGroups -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeParameterGroupsResponse' smart constructor.
data DescribeParameterGroupsResponse = DescribeParameterGroupsResponse'
  { -- | Provides an identifier to allow retrieval of paginated results.
    DescribeParameterGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of parameter groups. Each element in the array represents one
    -- parameter group.
    DescribeParameterGroupsResponse -> Maybe [ParameterGroup]
parameterGroups :: Prelude.Maybe [ParameterGroup],
    -- | The response's http status code.
    DescribeParameterGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeParameterGroupsResponse
-> DescribeParameterGroupsResponse -> Bool
(DescribeParameterGroupsResponse
 -> DescribeParameterGroupsResponse -> Bool)
-> (DescribeParameterGroupsResponse
    -> DescribeParameterGroupsResponse -> Bool)
-> Eq DescribeParameterGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeParameterGroupsResponse
-> DescribeParameterGroupsResponse -> Bool
$c/= :: DescribeParameterGroupsResponse
-> DescribeParameterGroupsResponse -> Bool
== :: DescribeParameterGroupsResponse
-> DescribeParameterGroupsResponse -> Bool
$c== :: DescribeParameterGroupsResponse
-> DescribeParameterGroupsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeParameterGroupsResponse]
ReadPrec DescribeParameterGroupsResponse
Int -> ReadS DescribeParameterGroupsResponse
ReadS [DescribeParameterGroupsResponse]
(Int -> ReadS DescribeParameterGroupsResponse)
-> ReadS [DescribeParameterGroupsResponse]
-> ReadPrec DescribeParameterGroupsResponse
-> ReadPrec [DescribeParameterGroupsResponse]
-> Read DescribeParameterGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeParameterGroupsResponse]
$creadListPrec :: ReadPrec [DescribeParameterGroupsResponse]
readPrec :: ReadPrec DescribeParameterGroupsResponse
$creadPrec :: ReadPrec DescribeParameterGroupsResponse
readList :: ReadS [DescribeParameterGroupsResponse]
$creadList :: ReadS [DescribeParameterGroupsResponse]
readsPrec :: Int -> ReadS DescribeParameterGroupsResponse
$creadsPrec :: Int -> ReadS DescribeParameterGroupsResponse
Prelude.Read, Int -> DescribeParameterGroupsResponse -> ShowS
[DescribeParameterGroupsResponse] -> ShowS
DescribeParameterGroupsResponse -> String
(Int -> DescribeParameterGroupsResponse -> ShowS)
-> (DescribeParameterGroupsResponse -> String)
-> ([DescribeParameterGroupsResponse] -> ShowS)
-> Show DescribeParameterGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeParameterGroupsResponse] -> ShowS
$cshowList :: [DescribeParameterGroupsResponse] -> ShowS
show :: DescribeParameterGroupsResponse -> String
$cshow :: DescribeParameterGroupsResponse -> String
showsPrec :: Int -> DescribeParameterGroupsResponse -> ShowS
$cshowsPrec :: Int -> DescribeParameterGroupsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeParameterGroupsResponse
 -> Rep DescribeParameterGroupsResponse x)
-> (forall x.
    Rep DescribeParameterGroupsResponse x
    -> DescribeParameterGroupsResponse)
-> Generic DescribeParameterGroupsResponse
forall x.
Rep DescribeParameterGroupsResponse x
-> DescribeParameterGroupsResponse
forall x.
DescribeParameterGroupsResponse
-> Rep DescribeParameterGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeParameterGroupsResponse x
-> DescribeParameterGroupsResponse
$cfrom :: forall x.
DescribeParameterGroupsResponse
-> Rep DescribeParameterGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeParameterGroupsResponse' 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', 'describeParameterGroupsResponse_nextToken' - Provides an identifier to allow retrieval of paginated results.
--
-- 'parameterGroups', 'describeParameterGroupsResponse_parameterGroups' - An array of parameter groups. Each element in the array represents one
-- parameter group.
--
-- 'httpStatus', 'describeParameterGroupsResponse_httpStatus' - The response's http status code.
newDescribeParameterGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeParameterGroupsResponse
newDescribeParameterGroupsResponse :: Int -> DescribeParameterGroupsResponse
newDescribeParameterGroupsResponse Int
pHttpStatus_ =
  DescribeParameterGroupsResponse' :: Maybe Text
-> Maybe [ParameterGroup] -> Int -> DescribeParameterGroupsResponse
DescribeParameterGroupsResponse'
    { $sel:nextToken:DescribeParameterGroupsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterGroups:DescribeParameterGroupsResponse' :: Maybe [ParameterGroup]
parameterGroups = Maybe [ParameterGroup]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeParameterGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Provides an identifier to allow retrieval of paginated results.
describeParameterGroupsResponse_nextToken :: Lens.Lens' DescribeParameterGroupsResponse (Prelude.Maybe Prelude.Text)
describeParameterGroupsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeParameterGroupsResponse
-> f DescribeParameterGroupsResponse
describeParameterGroupsResponse_nextToken = (DescribeParameterGroupsResponse -> Maybe Text)
-> (DescribeParameterGroupsResponse
    -> Maybe Text -> DescribeParameterGroupsResponse)
-> Lens' DescribeParameterGroupsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameterGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeParameterGroupsResponse' :: DescribeParameterGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeParameterGroupsResponse
s@DescribeParameterGroupsResponse' {} Maybe Text
a -> DescribeParameterGroupsResponse
s {$sel:nextToken:DescribeParameterGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeParameterGroupsResponse)

-- | An array of parameter groups. Each element in the array represents one
-- parameter group.
describeParameterGroupsResponse_parameterGroups :: Lens.Lens' DescribeParameterGroupsResponse (Prelude.Maybe [ParameterGroup])
describeParameterGroupsResponse_parameterGroups :: (Maybe [ParameterGroup] -> f (Maybe [ParameterGroup]))
-> DescribeParameterGroupsResponse
-> f DescribeParameterGroupsResponse
describeParameterGroupsResponse_parameterGroups = (DescribeParameterGroupsResponse -> Maybe [ParameterGroup])
-> (DescribeParameterGroupsResponse
    -> Maybe [ParameterGroup] -> DescribeParameterGroupsResponse)
-> Lens' DescribeParameterGroupsResponse (Maybe [ParameterGroup])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameterGroupsResponse' {Maybe [ParameterGroup]
parameterGroups :: Maybe [ParameterGroup]
$sel:parameterGroups:DescribeParameterGroupsResponse' :: DescribeParameterGroupsResponse -> Maybe [ParameterGroup]
parameterGroups} -> Maybe [ParameterGroup]
parameterGroups) (\s :: DescribeParameterGroupsResponse
s@DescribeParameterGroupsResponse' {} Maybe [ParameterGroup]
a -> DescribeParameterGroupsResponse
s {$sel:parameterGroups:DescribeParameterGroupsResponse' :: Maybe [ParameterGroup]
parameterGroups = Maybe [ParameterGroup]
a} :: DescribeParameterGroupsResponse) ((Maybe [ParameterGroup] -> f (Maybe [ParameterGroup]))
 -> DescribeParameterGroupsResponse
 -> f DescribeParameterGroupsResponse)
-> ((Maybe [ParameterGroup] -> f (Maybe [ParameterGroup]))
    -> Maybe [ParameterGroup] -> f (Maybe [ParameterGroup]))
-> (Maybe [ParameterGroup] -> f (Maybe [ParameterGroup]))
-> DescribeParameterGroupsResponse
-> f DescribeParameterGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ParameterGroup] [ParameterGroup] [ParameterGroup] [ParameterGroup]
-> Iso
     (Maybe [ParameterGroup])
     (Maybe [ParameterGroup])
     (Maybe [ParameterGroup])
     (Maybe [ParameterGroup])
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
  [ParameterGroup] [ParameterGroup] [ParameterGroup] [ParameterGroup]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeParameterGroupsResponse