{-# 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.GetParameterHistory
-- 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)
--
-- Retrieves the history of all changes to a parameter.
--
-- 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, @GetParameterHistory@ retrieves whatever the
-- original key alias was referencing.
--
-- This operation returns paginated results.
module Amazonka.SSM.GetParameterHistory
  ( -- * Creating a Request
    GetParameterHistory (..),
    newGetParameterHistory,

    -- * Request Lenses
    getParameterHistory_withDecryption,
    getParameterHistory_nextToken,
    getParameterHistory_maxResults,
    getParameterHistory_name,

    -- * Destructuring the Response
    GetParameterHistoryResponse (..),
    newGetParameterHistoryResponse,

    -- * Response Lenses
    getParameterHistoryResponse_nextToken,
    getParameterHistoryResponse_parameters,
    getParameterHistoryResponse_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:/ 'newGetParameterHistory' smart constructor.
data GetParameterHistory = GetParameterHistory'
  { -- | Return decrypted values for secure string parameters. This flag is
    -- ignored for @String@ and @StringList@ parameter types.
    GetParameterHistory -> Maybe Bool
withDecryption :: Prelude.Maybe Prelude.Bool,
    -- | The token for the next set of items to return. (You received this token
    -- from a previous call.)
    GetParameterHistory -> 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.
    GetParameterHistory -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the parameter for which you want to review history.
    GetParameterHistory -> Text
name :: Prelude.Text
  }
  deriving (GetParameterHistory -> GetParameterHistory -> Bool
(GetParameterHistory -> GetParameterHistory -> Bool)
-> (GetParameterHistory -> GetParameterHistory -> Bool)
-> Eq GetParameterHistory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetParameterHistory -> GetParameterHistory -> Bool
$c/= :: GetParameterHistory -> GetParameterHistory -> Bool
== :: GetParameterHistory -> GetParameterHistory -> Bool
$c== :: GetParameterHistory -> GetParameterHistory -> Bool
Prelude.Eq, ReadPrec [GetParameterHistory]
ReadPrec GetParameterHistory
Int -> ReadS GetParameterHistory
ReadS [GetParameterHistory]
(Int -> ReadS GetParameterHistory)
-> ReadS [GetParameterHistory]
-> ReadPrec GetParameterHistory
-> ReadPrec [GetParameterHistory]
-> Read GetParameterHistory
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetParameterHistory]
$creadListPrec :: ReadPrec [GetParameterHistory]
readPrec :: ReadPrec GetParameterHistory
$creadPrec :: ReadPrec GetParameterHistory
readList :: ReadS [GetParameterHistory]
$creadList :: ReadS [GetParameterHistory]
readsPrec :: Int -> ReadS GetParameterHistory
$creadsPrec :: Int -> ReadS GetParameterHistory
Prelude.Read, Int -> GetParameterHistory -> ShowS
[GetParameterHistory] -> ShowS
GetParameterHistory -> String
(Int -> GetParameterHistory -> ShowS)
-> (GetParameterHistory -> String)
-> ([GetParameterHistory] -> ShowS)
-> Show GetParameterHistory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetParameterHistory] -> ShowS
$cshowList :: [GetParameterHistory] -> ShowS
show :: GetParameterHistory -> String
$cshow :: GetParameterHistory -> String
showsPrec :: Int -> GetParameterHistory -> ShowS
$cshowsPrec :: Int -> GetParameterHistory -> ShowS
Prelude.Show, (forall x. GetParameterHistory -> Rep GetParameterHistory x)
-> (forall x. Rep GetParameterHistory x -> GetParameterHistory)
-> Generic GetParameterHistory
forall x. Rep GetParameterHistory x -> GetParameterHistory
forall x. GetParameterHistory -> Rep GetParameterHistory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetParameterHistory x -> GetParameterHistory
$cfrom :: forall x. GetParameterHistory -> Rep GetParameterHistory x
Prelude.Generic)

-- |
-- Create a value of 'GetParameterHistory' 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:
--
-- 'withDecryption', 'getParameterHistory_withDecryption' - Return decrypted values for secure string parameters. This flag is
-- ignored for @String@ and @StringList@ parameter types.
--
-- 'nextToken', 'getParameterHistory_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
--
-- 'maxResults', 'getParameterHistory_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.
--
-- 'name', 'getParameterHistory_name' - The name of the parameter for which you want to review history.
newGetParameterHistory ::
  -- | 'name'
  Prelude.Text ->
  GetParameterHistory
newGetParameterHistory :: Text -> GetParameterHistory
newGetParameterHistory Text
pName_ =
  GetParameterHistory' :: Maybe Bool
-> Maybe Text -> Maybe Natural -> Text -> GetParameterHistory
GetParameterHistory'
    { $sel:withDecryption:GetParameterHistory' :: Maybe Bool
withDecryption =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetParameterHistory' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetParameterHistory' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetParameterHistory' :: Text
name = Text
pName_
    }

-- | Return decrypted values for secure string parameters. This flag is
-- ignored for @String@ and @StringList@ parameter types.
getParameterHistory_withDecryption :: Lens.Lens' GetParameterHistory (Prelude.Maybe Prelude.Bool)
getParameterHistory_withDecryption :: (Maybe Bool -> f (Maybe Bool))
-> GetParameterHistory -> f GetParameterHistory
getParameterHistory_withDecryption = (GetParameterHistory -> Maybe Bool)
-> (GetParameterHistory -> Maybe Bool -> GetParameterHistory)
-> Lens
     GetParameterHistory GetParameterHistory (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetParameterHistory' {Maybe Bool
withDecryption :: Maybe Bool
$sel:withDecryption:GetParameterHistory' :: GetParameterHistory -> Maybe Bool
withDecryption} -> Maybe Bool
withDecryption) (\s :: GetParameterHistory
s@GetParameterHistory' {} Maybe Bool
a -> GetParameterHistory
s {$sel:withDecryption:GetParameterHistory' :: Maybe Bool
withDecryption = Maybe Bool
a} :: GetParameterHistory)

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

-- | 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.
getParameterHistory_maxResults :: Lens.Lens' GetParameterHistory (Prelude.Maybe Prelude.Natural)
getParameterHistory_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetParameterHistory -> f GetParameterHistory
getParameterHistory_maxResults = (GetParameterHistory -> Maybe Natural)
-> (GetParameterHistory -> Maybe Natural -> GetParameterHistory)
-> Lens
     GetParameterHistory
     GetParameterHistory
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetParameterHistory' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetParameterHistory' :: GetParameterHistory -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetParameterHistory
s@GetParameterHistory' {} Maybe Natural
a -> GetParameterHistory
s {$sel:maxResults:GetParameterHistory' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetParameterHistory)

-- | The name of the parameter for which you want to review history.
getParameterHistory_name :: Lens.Lens' GetParameterHistory Prelude.Text
getParameterHistory_name :: (Text -> f Text) -> GetParameterHistory -> f GetParameterHistory
getParameterHistory_name = (GetParameterHistory -> Text)
-> (GetParameterHistory -> Text -> GetParameterHistory)
-> Lens GetParameterHistory GetParameterHistory Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetParameterHistory' {Text
name :: Text
$sel:name:GetParameterHistory' :: GetParameterHistory -> Text
name} -> Text
name) (\s :: GetParameterHistory
s@GetParameterHistory' {} Text
a -> GetParameterHistory
s {$sel:name:GetParameterHistory' :: Text
name = Text
a} :: GetParameterHistory)

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

instance Prelude.NFData GetParameterHistory

instance Core.ToHeaders GetParameterHistory where
  toHeaders :: GetParameterHistory -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetParameterHistory -> 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.GetParameterHistory" ::
                          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 GetParameterHistory where
  toJSON :: GetParameterHistory -> Value
toJSON GetParameterHistory' {Maybe Bool
Maybe Natural
Maybe Text
Text
name :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
withDecryption :: Maybe Bool
$sel:name:GetParameterHistory' :: GetParameterHistory -> Text
$sel:maxResults:GetParameterHistory' :: GetParameterHistory -> Maybe Natural
$sel:nextToken:GetParameterHistory' :: GetParameterHistory -> Maybe Text
$sel:withDecryption:GetParameterHistory' :: GetParameterHistory -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"WithDecryption" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
withDecryption,
            (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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
          ]
      )

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

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

-- | /See:/ 'newGetParameterHistoryResponse' smart constructor.
data GetParameterHistoryResponse = GetParameterHistoryResponse'
  { -- | The token to use when requesting the next set of items. If there are no
    -- additional items to return, the string is empty.
    GetParameterHistoryResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of parameters returned by the request.
    GetParameterHistoryResponse -> Maybe [ParameterHistory]
parameters :: Prelude.Maybe [ParameterHistory],
    -- | The response's http status code.
    GetParameterHistoryResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetParameterHistoryResponse -> GetParameterHistoryResponse -> Bool
(GetParameterHistoryResponse
 -> GetParameterHistoryResponse -> Bool)
-> (GetParameterHistoryResponse
    -> GetParameterHistoryResponse -> Bool)
-> Eq GetParameterHistoryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetParameterHistoryResponse -> GetParameterHistoryResponse -> Bool
$c/= :: GetParameterHistoryResponse -> GetParameterHistoryResponse -> Bool
== :: GetParameterHistoryResponse -> GetParameterHistoryResponse -> Bool
$c== :: GetParameterHistoryResponse -> GetParameterHistoryResponse -> Bool
Prelude.Eq, Int -> GetParameterHistoryResponse -> ShowS
[GetParameterHistoryResponse] -> ShowS
GetParameterHistoryResponse -> String
(Int -> GetParameterHistoryResponse -> ShowS)
-> (GetParameterHistoryResponse -> String)
-> ([GetParameterHistoryResponse] -> ShowS)
-> Show GetParameterHistoryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetParameterHistoryResponse] -> ShowS
$cshowList :: [GetParameterHistoryResponse] -> ShowS
show :: GetParameterHistoryResponse -> String
$cshow :: GetParameterHistoryResponse -> String
showsPrec :: Int -> GetParameterHistoryResponse -> ShowS
$cshowsPrec :: Int -> GetParameterHistoryResponse -> ShowS
Prelude.Show, (forall x.
 GetParameterHistoryResponse -> Rep GetParameterHistoryResponse x)
-> (forall x.
    Rep GetParameterHistoryResponse x -> GetParameterHistoryResponse)
-> Generic GetParameterHistoryResponse
forall x.
Rep GetParameterHistoryResponse x -> GetParameterHistoryResponse
forall x.
GetParameterHistoryResponse -> Rep GetParameterHistoryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetParameterHistoryResponse x -> GetParameterHistoryResponse
$cfrom :: forall x.
GetParameterHistoryResponse -> Rep GetParameterHistoryResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetParameterHistoryResponse' 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', 'getParameterHistoryResponse_nextToken' - The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
--
-- 'parameters', 'getParameterHistoryResponse_parameters' - A list of parameters returned by the request.
--
-- 'httpStatus', 'getParameterHistoryResponse_httpStatus' - The response's http status code.
newGetParameterHistoryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetParameterHistoryResponse
newGetParameterHistoryResponse :: Int -> GetParameterHistoryResponse
newGetParameterHistoryResponse Int
pHttpStatus_ =
  GetParameterHistoryResponse' :: Maybe Text
-> Maybe [ParameterHistory] -> Int -> GetParameterHistoryResponse
GetParameterHistoryResponse'
    { $sel:nextToken:GetParameterHistoryResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:GetParameterHistoryResponse' :: Maybe [ParameterHistory]
parameters = Maybe [ParameterHistory]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetParameterHistoryResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
getParameterHistoryResponse_nextToken :: Lens.Lens' GetParameterHistoryResponse (Prelude.Maybe Prelude.Text)
getParameterHistoryResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetParameterHistoryResponse -> f GetParameterHistoryResponse
getParameterHistoryResponse_nextToken = (GetParameterHistoryResponse -> Maybe Text)
-> (GetParameterHistoryResponse
    -> Maybe Text -> GetParameterHistoryResponse)
-> Lens' GetParameterHistoryResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetParameterHistoryResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetParameterHistoryResponse' :: GetParameterHistoryResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetParameterHistoryResponse
s@GetParameterHistoryResponse' {} Maybe Text
a -> GetParameterHistoryResponse
s {$sel:nextToken:GetParameterHistoryResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetParameterHistoryResponse)

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

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

instance Prelude.NFData GetParameterHistoryResponse