{-# 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.SSM.DescribeParameters
-- 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)
--
-- Get information about a parameter.
--
-- Request results are returned on a best-effort basis. If you specify
-- @MaxResults@ in the request, the response includes information up to the
-- limit specified. The number of items returned, however, can be between
-- zero and the value of @MaxResults@. If the service reaches an internal
-- limit while processing the results, it stops the operation and returns
-- the matching values up to that point and a @NextToken@. You can specify
-- the @NextToken@ in a subsequent call to get the next set of results.
--
-- If you change the KMS key alias for the KMS key used to encrypt a
-- parameter, then you must also update the key alias the parameter uses to
-- reference KMS. Otherwise, @DescribeParameters@ retrieves whatever the
-- original key alias was referencing.
--
-- This operation returns paginated results.
module Amazonka.SSM.DescribeParameters
  ( -- * Creating a Request
    DescribeParameters (..),
    newDescribeParameters,

    -- * Request Lenses
    describeParameters_parameterFilters,
    describeParameters_filters,
    describeParameters_nextToken,
    describeParameters_maxResults,

    -- * Destructuring the Response
    DescribeParametersResponse (..),
    newDescribeParametersResponse,

    -- * Response Lenses
    describeParametersResponse_nextToken,
    describeParametersResponse_parameters,
    describeParametersResponse_httpStatus,
  )
where

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
import Amazonka.SSM.Types

-- | /See:/ 'newDescribeParameters' smart constructor.
data DescribeParameters = DescribeParameters'
  { -- | Filters to limit the request results.
    DescribeParameters -> Maybe [ParameterStringFilter]
parameterFilters :: Prelude.Maybe [ParameterStringFilter],
    -- | This data type is deprecated. Instead, use @ParameterFilters@.
    DescribeParameters -> Maybe [ParametersFilter]
filters :: Prelude.Maybe [ParametersFilter],
    -- | The token for the next set of items to return. (You received this token
    -- from a previous call.)
    DescribeParameters -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return for this call. The call also
    -- returns a token that you can specify in a subsequent call to get the
    -- next set of results.
    DescribeParameters -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (DescribeParameters -> DescribeParameters -> Bool
(DescribeParameters -> DescribeParameters -> Bool)
-> (DescribeParameters -> DescribeParameters -> Bool)
-> Eq DescribeParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeParameters -> DescribeParameters -> Bool
$c/= :: DescribeParameters -> DescribeParameters -> Bool
== :: DescribeParameters -> DescribeParameters -> Bool
$c== :: DescribeParameters -> DescribeParameters -> Bool
Prelude.Eq, ReadPrec [DescribeParameters]
ReadPrec DescribeParameters
Int -> ReadS DescribeParameters
ReadS [DescribeParameters]
(Int -> ReadS DescribeParameters)
-> ReadS [DescribeParameters]
-> ReadPrec DescribeParameters
-> ReadPrec [DescribeParameters]
-> Read DescribeParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeParameters]
$creadListPrec :: ReadPrec [DescribeParameters]
readPrec :: ReadPrec DescribeParameters
$creadPrec :: ReadPrec DescribeParameters
readList :: ReadS [DescribeParameters]
$creadList :: ReadS [DescribeParameters]
readsPrec :: Int -> ReadS DescribeParameters
$creadsPrec :: Int -> ReadS DescribeParameters
Prelude.Read, Int -> DescribeParameters -> ShowS
[DescribeParameters] -> ShowS
DescribeParameters -> String
(Int -> DescribeParameters -> ShowS)
-> (DescribeParameters -> String)
-> ([DescribeParameters] -> ShowS)
-> Show DescribeParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeParameters] -> ShowS
$cshowList :: [DescribeParameters] -> ShowS
show :: DescribeParameters -> String
$cshow :: DescribeParameters -> String
showsPrec :: Int -> DescribeParameters -> ShowS
$cshowsPrec :: Int -> DescribeParameters -> ShowS
Prelude.Show, (forall x. DescribeParameters -> Rep DescribeParameters x)
-> (forall x. Rep DescribeParameters x -> DescribeParameters)
-> Generic DescribeParameters
forall x. Rep DescribeParameters x -> DescribeParameters
forall x. DescribeParameters -> Rep DescribeParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeParameters x -> DescribeParameters
$cfrom :: forall x. DescribeParameters -> Rep DescribeParameters x
Prelude.Generic)

-- |
-- Create a value of 'DescribeParameters' 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:
--
-- 'parameterFilters', 'describeParameters_parameterFilters' - Filters to limit the request results.
--
-- 'filters', 'describeParameters_filters' - This data type is deprecated. Instead, use @ParameterFilters@.
--
-- 'nextToken', 'describeParameters_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
--
-- 'maxResults', 'describeParameters_maxResults' - The maximum number of items to return for this call. The call also
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
newDescribeParameters ::
  DescribeParameters
newDescribeParameters :: DescribeParameters
newDescribeParameters =
  DescribeParameters' :: Maybe [ParameterStringFilter]
-> Maybe [ParametersFilter]
-> Maybe Text
-> Maybe Natural
-> DescribeParameters
DescribeParameters'
    { $sel:parameterFilters:DescribeParameters' :: Maybe [ParameterStringFilter]
parameterFilters =
        Maybe [ParameterStringFilter]
forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeParameters' :: Maybe [ParametersFilter]
filters = Maybe [ParametersFilter]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeParameters' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeParameters' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Filters to limit the request results.
describeParameters_parameterFilters :: Lens.Lens' DescribeParameters (Prelude.Maybe [ParameterStringFilter])
describeParameters_parameterFilters :: (Maybe [ParameterStringFilter]
 -> f (Maybe [ParameterStringFilter]))
-> DescribeParameters -> f DescribeParameters
describeParameters_parameterFilters = (DescribeParameters -> Maybe [ParameterStringFilter])
-> (DescribeParameters
    -> Maybe [ParameterStringFilter] -> DescribeParameters)
-> Lens
     DescribeParameters
     DescribeParameters
     (Maybe [ParameterStringFilter])
     (Maybe [ParameterStringFilter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameters' {Maybe [ParameterStringFilter]
parameterFilters :: Maybe [ParameterStringFilter]
$sel:parameterFilters:DescribeParameters' :: DescribeParameters -> Maybe [ParameterStringFilter]
parameterFilters} -> Maybe [ParameterStringFilter]
parameterFilters) (\s :: DescribeParameters
s@DescribeParameters' {} Maybe [ParameterStringFilter]
a -> DescribeParameters
s {$sel:parameterFilters:DescribeParameters' :: Maybe [ParameterStringFilter]
parameterFilters = Maybe [ParameterStringFilter]
a} :: DescribeParameters) ((Maybe [ParameterStringFilter]
  -> f (Maybe [ParameterStringFilter]))
 -> DescribeParameters -> f DescribeParameters)
-> ((Maybe [ParameterStringFilter]
     -> f (Maybe [ParameterStringFilter]))
    -> Maybe [ParameterStringFilter]
    -> f (Maybe [ParameterStringFilter]))
-> (Maybe [ParameterStringFilter]
    -> f (Maybe [ParameterStringFilter]))
-> DescribeParameters
-> f DescribeParameters
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ParameterStringFilter]
  [ParameterStringFilter]
  [ParameterStringFilter]
  [ParameterStringFilter]
-> Iso
     (Maybe [ParameterStringFilter])
     (Maybe [ParameterStringFilter])
     (Maybe [ParameterStringFilter])
     (Maybe [ParameterStringFilter])
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
  [ParameterStringFilter]
  [ParameterStringFilter]
  [ParameterStringFilter]
  [ParameterStringFilter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | This data type is deprecated. Instead, use @ParameterFilters@.
describeParameters_filters :: Lens.Lens' DescribeParameters (Prelude.Maybe [ParametersFilter])
describeParameters_filters :: (Maybe [ParametersFilter] -> f (Maybe [ParametersFilter]))
-> DescribeParameters -> f DescribeParameters
describeParameters_filters = (DescribeParameters -> Maybe [ParametersFilter])
-> (DescribeParameters
    -> Maybe [ParametersFilter] -> DescribeParameters)
-> Lens
     DescribeParameters
     DescribeParameters
     (Maybe [ParametersFilter])
     (Maybe [ParametersFilter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameters' {Maybe [ParametersFilter]
filters :: Maybe [ParametersFilter]
$sel:filters:DescribeParameters' :: DescribeParameters -> Maybe [ParametersFilter]
filters} -> Maybe [ParametersFilter]
filters) (\s :: DescribeParameters
s@DescribeParameters' {} Maybe [ParametersFilter]
a -> DescribeParameters
s {$sel:filters:DescribeParameters' :: Maybe [ParametersFilter]
filters = Maybe [ParametersFilter]
a} :: DescribeParameters) ((Maybe [ParametersFilter] -> f (Maybe [ParametersFilter]))
 -> DescribeParameters -> f DescribeParameters)
-> ((Maybe [ParametersFilter] -> f (Maybe [ParametersFilter]))
    -> Maybe [ParametersFilter] -> f (Maybe [ParametersFilter]))
-> (Maybe [ParametersFilter] -> f (Maybe [ParametersFilter]))
-> DescribeParameters
-> f DescribeParameters
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ParametersFilter]
  [ParametersFilter]
  [ParametersFilter]
  [ParametersFilter]
-> Iso
     (Maybe [ParametersFilter])
     (Maybe [ParametersFilter])
     (Maybe [ParametersFilter])
     (Maybe [ParametersFilter])
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
  [ParametersFilter]
  [ParametersFilter]
  [ParametersFilter]
  [ParametersFilter]
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.)
describeParameters_nextToken :: Lens.Lens' DescribeParameters (Prelude.Maybe Prelude.Text)
describeParameters_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeParameters -> f DescribeParameters
describeParameters_nextToken = (DescribeParameters -> Maybe Text)
-> (DescribeParameters -> Maybe Text -> DescribeParameters)
-> Lens
     DescribeParameters DescribeParameters (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameters' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeParameters' :: DescribeParameters -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeParameters
s@DescribeParameters' {} Maybe Text
a -> DescribeParameters
s {$sel:nextToken:DescribeParameters' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeParameters)

-- | The maximum number of items to return for this call. The call also
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
describeParameters_maxResults :: Lens.Lens' DescribeParameters (Prelude.Maybe Prelude.Natural)
describeParameters_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeParameters -> f DescribeParameters
describeParameters_maxResults = (DescribeParameters -> Maybe Natural)
-> (DescribeParameters -> Maybe Natural -> DescribeParameters)
-> Lens
     DescribeParameters
     DescribeParameters
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParameters' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeParameters' :: DescribeParameters -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeParameters
s@DescribeParameters' {} Maybe Natural
a -> DescribeParameters
s {$sel:maxResults:DescribeParameters' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeParameters)

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

instance Prelude.NFData DescribeParameters

instance Core.ToHeaders DescribeParameters where
  toHeaders :: DescribeParameters -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeParameters -> 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
"AmazonSSM.DescribeParameters" ::
                          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 DescribeParameters where
  toJSON :: DescribeParameters -> Value
toJSON DescribeParameters' {Maybe Natural
Maybe [ParameterStringFilter]
Maybe [ParametersFilter]
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
filters :: Maybe [ParametersFilter]
parameterFilters :: Maybe [ParameterStringFilter]
$sel:maxResults:DescribeParameters' :: DescribeParameters -> Maybe Natural
$sel:nextToken:DescribeParameters' :: DescribeParameters -> Maybe Text
$sel:filters:DescribeParameters' :: DescribeParameters -> Maybe [ParametersFilter]
$sel:parameterFilters:DescribeParameters' :: DescribeParameters -> Maybe [ParameterStringFilter]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ParameterFilters" Text -> [ParameterStringFilter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([ParameterStringFilter] -> Pair)
-> Maybe [ParameterStringFilter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ParameterStringFilter]
parameterFilters,
            (Text
"Filters" Text -> [ParametersFilter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([ParametersFilter] -> Pair)
-> Maybe [ParametersFilter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ParametersFilter]
filters,
            (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
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

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

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

-- | /See:/ 'newDescribeParametersResponse' smart constructor.
data DescribeParametersResponse = DescribeParametersResponse'
  { -- | The token to use when requesting the next set of items.
    DescribeParametersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Parameters returned by the request.
    DescribeParametersResponse -> Maybe [ParameterMetadata]
parameters :: Prelude.Maybe [ParameterMetadata],
    -- | The response's http status code.
    DescribeParametersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeParametersResponse -> DescribeParametersResponse -> Bool
(DescribeParametersResponse -> DescribeParametersResponse -> Bool)
-> (DescribeParametersResponse
    -> DescribeParametersResponse -> Bool)
-> Eq DescribeParametersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeParametersResponse -> DescribeParametersResponse -> Bool
$c/= :: DescribeParametersResponse -> DescribeParametersResponse -> Bool
== :: DescribeParametersResponse -> DescribeParametersResponse -> Bool
$c== :: DescribeParametersResponse -> DescribeParametersResponse -> Bool
Prelude.Eq, ReadPrec [DescribeParametersResponse]
ReadPrec DescribeParametersResponse
Int -> ReadS DescribeParametersResponse
ReadS [DescribeParametersResponse]
(Int -> ReadS DescribeParametersResponse)
-> ReadS [DescribeParametersResponse]
-> ReadPrec DescribeParametersResponse
-> ReadPrec [DescribeParametersResponse]
-> Read DescribeParametersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeParametersResponse]
$creadListPrec :: ReadPrec [DescribeParametersResponse]
readPrec :: ReadPrec DescribeParametersResponse
$creadPrec :: ReadPrec DescribeParametersResponse
readList :: ReadS [DescribeParametersResponse]
$creadList :: ReadS [DescribeParametersResponse]
readsPrec :: Int -> ReadS DescribeParametersResponse
$creadsPrec :: Int -> ReadS DescribeParametersResponse
Prelude.Read, Int -> DescribeParametersResponse -> ShowS
[DescribeParametersResponse] -> ShowS
DescribeParametersResponse -> String
(Int -> DescribeParametersResponse -> ShowS)
-> (DescribeParametersResponse -> String)
-> ([DescribeParametersResponse] -> ShowS)
-> Show DescribeParametersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeParametersResponse] -> ShowS
$cshowList :: [DescribeParametersResponse] -> ShowS
show :: DescribeParametersResponse -> String
$cshow :: DescribeParametersResponse -> String
showsPrec :: Int -> DescribeParametersResponse -> ShowS
$cshowsPrec :: Int -> DescribeParametersResponse -> ShowS
Prelude.Show, (forall x.
 DescribeParametersResponse -> Rep DescribeParametersResponse x)
-> (forall x.
    Rep DescribeParametersResponse x -> DescribeParametersResponse)
-> Generic DescribeParametersResponse
forall x.
Rep DescribeParametersResponse x -> DescribeParametersResponse
forall x.
DescribeParametersResponse -> Rep DescribeParametersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeParametersResponse x -> DescribeParametersResponse
$cfrom :: forall x.
DescribeParametersResponse -> Rep DescribeParametersResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeParametersResponse' 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', 'describeParametersResponse_nextToken' - The token to use when requesting the next set of items.
--
-- 'parameters', 'describeParametersResponse_parameters' - Parameters returned by the request.
--
-- 'httpStatus', 'describeParametersResponse_httpStatus' - The response's http status code.
newDescribeParametersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeParametersResponse
newDescribeParametersResponse :: Int -> DescribeParametersResponse
newDescribeParametersResponse Int
pHttpStatus_ =
  DescribeParametersResponse' :: Maybe Text
-> Maybe [ParameterMetadata] -> Int -> DescribeParametersResponse
DescribeParametersResponse'
    { $sel:nextToken:DescribeParametersResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:DescribeParametersResponse' :: Maybe [ParameterMetadata]
parameters = Maybe [ParameterMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeParametersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token to use when requesting the next set of items.
describeParametersResponse_nextToken :: Lens.Lens' DescribeParametersResponse (Prelude.Maybe Prelude.Text)
describeParametersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeParametersResponse -> f DescribeParametersResponse
describeParametersResponse_nextToken = (DescribeParametersResponse -> Maybe Text)
-> (DescribeParametersResponse
    -> Maybe Text -> DescribeParametersResponse)
-> Lens' DescribeParametersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParametersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeParametersResponse' :: DescribeParametersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeParametersResponse
s@DescribeParametersResponse' {} Maybe Text
a -> DescribeParametersResponse
s {$sel:nextToken:DescribeParametersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeParametersResponse)

-- | Parameters returned by the request.
describeParametersResponse_parameters :: Lens.Lens' DescribeParametersResponse (Prelude.Maybe [ParameterMetadata])
describeParametersResponse_parameters :: (Maybe [ParameterMetadata] -> f (Maybe [ParameterMetadata]))
-> DescribeParametersResponse -> f DescribeParametersResponse
describeParametersResponse_parameters = (DescribeParametersResponse -> Maybe [ParameterMetadata])
-> (DescribeParametersResponse
    -> Maybe [ParameterMetadata] -> DescribeParametersResponse)
-> Lens' DescribeParametersResponse (Maybe [ParameterMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeParametersResponse' {Maybe [ParameterMetadata]
parameters :: Maybe [ParameterMetadata]
$sel:parameters:DescribeParametersResponse' :: DescribeParametersResponse -> Maybe [ParameterMetadata]
parameters} -> Maybe [ParameterMetadata]
parameters) (\s :: DescribeParametersResponse
s@DescribeParametersResponse' {} Maybe [ParameterMetadata]
a -> DescribeParametersResponse
s {$sel:parameters:DescribeParametersResponse' :: Maybe [ParameterMetadata]
parameters = Maybe [ParameterMetadata]
a} :: DescribeParametersResponse) ((Maybe [ParameterMetadata] -> f (Maybe [ParameterMetadata]))
 -> DescribeParametersResponse -> f DescribeParametersResponse)
-> ((Maybe [ParameterMetadata] -> f (Maybe [ParameterMetadata]))
    -> Maybe [ParameterMetadata] -> f (Maybe [ParameterMetadata]))
-> (Maybe [ParameterMetadata] -> f (Maybe [ParameterMetadata]))
-> DescribeParametersResponse
-> f DescribeParametersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ParameterMetadata]
  [ParameterMetadata]
  [ParameterMetadata]
  [ParameterMetadata]
-> Iso
     (Maybe [ParameterMetadata])
     (Maybe [ParameterMetadata])
     (Maybe [ParameterMetadata])
     (Maybe [ParameterMetadata])
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
  [ParameterMetadata]
  [ParameterMetadata]
  [ParameterMetadata]
  [ParameterMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData DescribeParametersResponse