{-# 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.IoTThingsGraph.GetSystemTemplateRevisions
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets revisions made to the specified system template. Only the previous
-- 100 revisions are stored. If the system has been deprecated, this action
-- will return the revisions that occurred before its deprecation. This
-- action won\'t work with systems that have been deleted.
--
-- This operation returns paginated results.
module Amazonka.IoTThingsGraph.GetSystemTemplateRevisions
  ( -- * Creating a Request
    GetSystemTemplateRevisions (..),
    newGetSystemTemplateRevisions,

    -- * Request Lenses
    getSystemTemplateRevisions_nextToken,
    getSystemTemplateRevisions_maxResults,
    getSystemTemplateRevisions_id,

    -- * Destructuring the Response
    GetSystemTemplateRevisionsResponse (..),
    newGetSystemTemplateRevisionsResponse,

    -- * Response Lenses
    getSystemTemplateRevisionsResponse_nextToken,
    getSystemTemplateRevisionsResponse_summaries,
    getSystemTemplateRevisionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTThingsGraph.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:/ 'newGetSystemTemplateRevisions' smart constructor.
data GetSystemTemplateRevisions = GetSystemTemplateRevisions'
  { -- | The string that specifies the next page of results. Use this when
    -- you\'re paginating results.
    GetSystemTemplateRevisions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return in the response.
    GetSystemTemplateRevisions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the system template.
    --
    -- The ID should be in the following format.
    --
    -- @urn:tdm:REGION\/ACCOUNT ID\/default:system:SYSTEMNAME@
    GetSystemTemplateRevisions -> Text
id :: Prelude.Text
  }
  deriving (GetSystemTemplateRevisions -> GetSystemTemplateRevisions -> Bool
(GetSystemTemplateRevisions -> GetSystemTemplateRevisions -> Bool)
-> (GetSystemTemplateRevisions
    -> GetSystemTemplateRevisions -> Bool)
-> Eq GetSystemTemplateRevisions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSystemTemplateRevisions -> GetSystemTemplateRevisions -> Bool
$c/= :: GetSystemTemplateRevisions -> GetSystemTemplateRevisions -> Bool
== :: GetSystemTemplateRevisions -> GetSystemTemplateRevisions -> Bool
$c== :: GetSystemTemplateRevisions -> GetSystemTemplateRevisions -> Bool
Prelude.Eq, ReadPrec [GetSystemTemplateRevisions]
ReadPrec GetSystemTemplateRevisions
Int -> ReadS GetSystemTemplateRevisions
ReadS [GetSystemTemplateRevisions]
(Int -> ReadS GetSystemTemplateRevisions)
-> ReadS [GetSystemTemplateRevisions]
-> ReadPrec GetSystemTemplateRevisions
-> ReadPrec [GetSystemTemplateRevisions]
-> Read GetSystemTemplateRevisions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSystemTemplateRevisions]
$creadListPrec :: ReadPrec [GetSystemTemplateRevisions]
readPrec :: ReadPrec GetSystemTemplateRevisions
$creadPrec :: ReadPrec GetSystemTemplateRevisions
readList :: ReadS [GetSystemTemplateRevisions]
$creadList :: ReadS [GetSystemTemplateRevisions]
readsPrec :: Int -> ReadS GetSystemTemplateRevisions
$creadsPrec :: Int -> ReadS GetSystemTemplateRevisions
Prelude.Read, Int -> GetSystemTemplateRevisions -> ShowS
[GetSystemTemplateRevisions] -> ShowS
GetSystemTemplateRevisions -> String
(Int -> GetSystemTemplateRevisions -> ShowS)
-> (GetSystemTemplateRevisions -> String)
-> ([GetSystemTemplateRevisions] -> ShowS)
-> Show GetSystemTemplateRevisions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSystemTemplateRevisions] -> ShowS
$cshowList :: [GetSystemTemplateRevisions] -> ShowS
show :: GetSystemTemplateRevisions -> String
$cshow :: GetSystemTemplateRevisions -> String
showsPrec :: Int -> GetSystemTemplateRevisions -> ShowS
$cshowsPrec :: Int -> GetSystemTemplateRevisions -> ShowS
Prelude.Show, (forall x.
 GetSystemTemplateRevisions -> Rep GetSystemTemplateRevisions x)
-> (forall x.
    Rep GetSystemTemplateRevisions x -> GetSystemTemplateRevisions)
-> Generic GetSystemTemplateRevisions
forall x.
Rep GetSystemTemplateRevisions x -> GetSystemTemplateRevisions
forall x.
GetSystemTemplateRevisions -> Rep GetSystemTemplateRevisions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSystemTemplateRevisions x -> GetSystemTemplateRevisions
$cfrom :: forall x.
GetSystemTemplateRevisions -> Rep GetSystemTemplateRevisions x
Prelude.Generic)

-- |
-- Create a value of 'GetSystemTemplateRevisions' 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', 'getSystemTemplateRevisions_nextToken' - The string that specifies the next page of results. Use this when
-- you\'re paginating results.
--
-- 'maxResults', 'getSystemTemplateRevisions_maxResults' - The maximum number of results to return in the response.
--
-- 'id', 'getSystemTemplateRevisions_id' - The ID of the system template.
--
-- The ID should be in the following format.
--
-- @urn:tdm:REGION\/ACCOUNT ID\/default:system:SYSTEMNAME@
newGetSystemTemplateRevisions ::
  -- | 'id'
  Prelude.Text ->
  GetSystemTemplateRevisions
newGetSystemTemplateRevisions :: Text -> GetSystemTemplateRevisions
newGetSystemTemplateRevisions Text
pId_ =
  GetSystemTemplateRevisions' :: Maybe Text -> Maybe Natural -> Text -> GetSystemTemplateRevisions
GetSystemTemplateRevisions'
    { $sel:nextToken:GetSystemTemplateRevisions' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetSystemTemplateRevisions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:id:GetSystemTemplateRevisions' :: Text
id = Text
pId_
    }

-- | The string that specifies the next page of results. Use this when
-- you\'re paginating results.
getSystemTemplateRevisions_nextToken :: Lens.Lens' GetSystemTemplateRevisions (Prelude.Maybe Prelude.Text)
getSystemTemplateRevisions_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetSystemTemplateRevisions -> f GetSystemTemplateRevisions
getSystemTemplateRevisions_nextToken = (GetSystemTemplateRevisions -> Maybe Text)
-> (GetSystemTemplateRevisions
    -> Maybe Text -> GetSystemTemplateRevisions)
-> Lens
     GetSystemTemplateRevisions
     GetSystemTemplateRevisions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSystemTemplateRevisions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetSystemTemplateRevisions' :: GetSystemTemplateRevisions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetSystemTemplateRevisions
s@GetSystemTemplateRevisions' {} Maybe Text
a -> GetSystemTemplateRevisions
s {$sel:nextToken:GetSystemTemplateRevisions' :: Maybe Text
nextToken = Maybe Text
a} :: GetSystemTemplateRevisions)

-- | The maximum number of results to return in the response.
getSystemTemplateRevisions_maxResults :: Lens.Lens' GetSystemTemplateRevisions (Prelude.Maybe Prelude.Natural)
getSystemTemplateRevisions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetSystemTemplateRevisions -> f GetSystemTemplateRevisions
getSystemTemplateRevisions_maxResults = (GetSystemTemplateRevisions -> Maybe Natural)
-> (GetSystemTemplateRevisions
    -> Maybe Natural -> GetSystemTemplateRevisions)
-> Lens
     GetSystemTemplateRevisions
     GetSystemTemplateRevisions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSystemTemplateRevisions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetSystemTemplateRevisions' :: GetSystemTemplateRevisions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetSystemTemplateRevisions
s@GetSystemTemplateRevisions' {} Maybe Natural
a -> GetSystemTemplateRevisions
s {$sel:maxResults:GetSystemTemplateRevisions' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetSystemTemplateRevisions)

-- | The ID of the system template.
--
-- The ID should be in the following format.
--
-- @urn:tdm:REGION\/ACCOUNT ID\/default:system:SYSTEMNAME@
getSystemTemplateRevisions_id :: Lens.Lens' GetSystemTemplateRevisions Prelude.Text
getSystemTemplateRevisions_id :: (Text -> f Text)
-> GetSystemTemplateRevisions -> f GetSystemTemplateRevisions
getSystemTemplateRevisions_id = (GetSystemTemplateRevisions -> Text)
-> (GetSystemTemplateRevisions
    -> Text -> GetSystemTemplateRevisions)
-> Lens
     GetSystemTemplateRevisions GetSystemTemplateRevisions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSystemTemplateRevisions' {Text
id :: Text
$sel:id:GetSystemTemplateRevisions' :: GetSystemTemplateRevisions -> Text
id} -> Text
id) (\s :: GetSystemTemplateRevisions
s@GetSystemTemplateRevisions' {} Text
a -> GetSystemTemplateRevisions
s {$sel:id:GetSystemTemplateRevisions' :: Text
id = Text
a} :: GetSystemTemplateRevisions)

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

instance Prelude.NFData GetSystemTemplateRevisions

instance Core.ToHeaders GetSystemTemplateRevisions where
  toHeaders :: GetSystemTemplateRevisions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetSystemTemplateRevisions -> 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
"IotThingsGraphFrontEndService.GetSystemTemplateRevisions" ::
                          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 GetSystemTemplateRevisions where
  toJSON :: GetSystemTemplateRevisions -> Value
toJSON GetSystemTemplateRevisions' {Maybe Natural
Maybe Text
Text
id :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:id:GetSystemTemplateRevisions' :: GetSystemTemplateRevisions -> Text
$sel:maxResults:GetSystemTemplateRevisions' :: GetSystemTemplateRevisions -> Maybe Natural
$sel:nextToken:GetSystemTemplateRevisions' :: GetSystemTemplateRevisions -> 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
"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
"id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
id)
          ]
      )

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

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

-- | /See:/ 'newGetSystemTemplateRevisionsResponse' smart constructor.
data GetSystemTemplateRevisionsResponse = GetSystemTemplateRevisionsResponse'
  { -- | The string to specify as @nextToken@ when you request the next page of
    -- results.
    GetSystemTemplateRevisionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of objects that contain summary data about the system template
    -- revisions.
    GetSystemTemplateRevisionsResponse -> Maybe [SystemTemplateSummary]
summaries :: Prelude.Maybe [SystemTemplateSummary],
    -- | The response's http status code.
    GetSystemTemplateRevisionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetSystemTemplateRevisionsResponse
-> GetSystemTemplateRevisionsResponse -> Bool
(GetSystemTemplateRevisionsResponse
 -> GetSystemTemplateRevisionsResponse -> Bool)
-> (GetSystemTemplateRevisionsResponse
    -> GetSystemTemplateRevisionsResponse -> Bool)
-> Eq GetSystemTemplateRevisionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSystemTemplateRevisionsResponse
-> GetSystemTemplateRevisionsResponse -> Bool
$c/= :: GetSystemTemplateRevisionsResponse
-> GetSystemTemplateRevisionsResponse -> Bool
== :: GetSystemTemplateRevisionsResponse
-> GetSystemTemplateRevisionsResponse -> Bool
$c== :: GetSystemTemplateRevisionsResponse
-> GetSystemTemplateRevisionsResponse -> Bool
Prelude.Eq, ReadPrec [GetSystemTemplateRevisionsResponse]
ReadPrec GetSystemTemplateRevisionsResponse
Int -> ReadS GetSystemTemplateRevisionsResponse
ReadS [GetSystemTemplateRevisionsResponse]
(Int -> ReadS GetSystemTemplateRevisionsResponse)
-> ReadS [GetSystemTemplateRevisionsResponse]
-> ReadPrec GetSystemTemplateRevisionsResponse
-> ReadPrec [GetSystemTemplateRevisionsResponse]
-> Read GetSystemTemplateRevisionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSystemTemplateRevisionsResponse]
$creadListPrec :: ReadPrec [GetSystemTemplateRevisionsResponse]
readPrec :: ReadPrec GetSystemTemplateRevisionsResponse
$creadPrec :: ReadPrec GetSystemTemplateRevisionsResponse
readList :: ReadS [GetSystemTemplateRevisionsResponse]
$creadList :: ReadS [GetSystemTemplateRevisionsResponse]
readsPrec :: Int -> ReadS GetSystemTemplateRevisionsResponse
$creadsPrec :: Int -> ReadS GetSystemTemplateRevisionsResponse
Prelude.Read, Int -> GetSystemTemplateRevisionsResponse -> ShowS
[GetSystemTemplateRevisionsResponse] -> ShowS
GetSystemTemplateRevisionsResponse -> String
(Int -> GetSystemTemplateRevisionsResponse -> ShowS)
-> (GetSystemTemplateRevisionsResponse -> String)
-> ([GetSystemTemplateRevisionsResponse] -> ShowS)
-> Show GetSystemTemplateRevisionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSystemTemplateRevisionsResponse] -> ShowS
$cshowList :: [GetSystemTemplateRevisionsResponse] -> ShowS
show :: GetSystemTemplateRevisionsResponse -> String
$cshow :: GetSystemTemplateRevisionsResponse -> String
showsPrec :: Int -> GetSystemTemplateRevisionsResponse -> ShowS
$cshowsPrec :: Int -> GetSystemTemplateRevisionsResponse -> ShowS
Prelude.Show, (forall x.
 GetSystemTemplateRevisionsResponse
 -> Rep GetSystemTemplateRevisionsResponse x)
-> (forall x.
    Rep GetSystemTemplateRevisionsResponse x
    -> GetSystemTemplateRevisionsResponse)
-> Generic GetSystemTemplateRevisionsResponse
forall x.
Rep GetSystemTemplateRevisionsResponse x
-> GetSystemTemplateRevisionsResponse
forall x.
GetSystemTemplateRevisionsResponse
-> Rep GetSystemTemplateRevisionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSystemTemplateRevisionsResponse x
-> GetSystemTemplateRevisionsResponse
$cfrom :: forall x.
GetSystemTemplateRevisionsResponse
-> Rep GetSystemTemplateRevisionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetSystemTemplateRevisionsResponse' 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', 'getSystemTemplateRevisionsResponse_nextToken' - The string to specify as @nextToken@ when you request the next page of
-- results.
--
-- 'summaries', 'getSystemTemplateRevisionsResponse_summaries' - An array of objects that contain summary data about the system template
-- revisions.
--
-- 'httpStatus', 'getSystemTemplateRevisionsResponse_httpStatus' - The response's http status code.
newGetSystemTemplateRevisionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetSystemTemplateRevisionsResponse
newGetSystemTemplateRevisionsResponse :: Int -> GetSystemTemplateRevisionsResponse
newGetSystemTemplateRevisionsResponse Int
pHttpStatus_ =
  GetSystemTemplateRevisionsResponse' :: Maybe Text
-> Maybe [SystemTemplateSummary]
-> Int
-> GetSystemTemplateRevisionsResponse
GetSystemTemplateRevisionsResponse'
    { $sel:nextToken:GetSystemTemplateRevisionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:summaries:GetSystemTemplateRevisionsResponse' :: Maybe [SystemTemplateSummary]
summaries = Maybe [SystemTemplateSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetSystemTemplateRevisionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The string to specify as @nextToken@ when you request the next page of
-- results.
getSystemTemplateRevisionsResponse_nextToken :: Lens.Lens' GetSystemTemplateRevisionsResponse (Prelude.Maybe Prelude.Text)
getSystemTemplateRevisionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetSystemTemplateRevisionsResponse
-> f GetSystemTemplateRevisionsResponse
getSystemTemplateRevisionsResponse_nextToken = (GetSystemTemplateRevisionsResponse -> Maybe Text)
-> (GetSystemTemplateRevisionsResponse
    -> Maybe Text -> GetSystemTemplateRevisionsResponse)
-> Lens' GetSystemTemplateRevisionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSystemTemplateRevisionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetSystemTemplateRevisionsResponse' :: GetSystemTemplateRevisionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetSystemTemplateRevisionsResponse
s@GetSystemTemplateRevisionsResponse' {} Maybe Text
a -> GetSystemTemplateRevisionsResponse
s {$sel:nextToken:GetSystemTemplateRevisionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetSystemTemplateRevisionsResponse)

-- | An array of objects that contain summary data about the system template
-- revisions.
getSystemTemplateRevisionsResponse_summaries :: Lens.Lens' GetSystemTemplateRevisionsResponse (Prelude.Maybe [SystemTemplateSummary])
getSystemTemplateRevisionsResponse_summaries :: (Maybe [SystemTemplateSummary]
 -> f (Maybe [SystemTemplateSummary]))
-> GetSystemTemplateRevisionsResponse
-> f GetSystemTemplateRevisionsResponse
getSystemTemplateRevisionsResponse_summaries = (GetSystemTemplateRevisionsResponse
 -> Maybe [SystemTemplateSummary])
-> (GetSystemTemplateRevisionsResponse
    -> Maybe [SystemTemplateSummary]
    -> GetSystemTemplateRevisionsResponse)
-> Lens'
     GetSystemTemplateRevisionsResponse (Maybe [SystemTemplateSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSystemTemplateRevisionsResponse' {Maybe [SystemTemplateSummary]
summaries :: Maybe [SystemTemplateSummary]
$sel:summaries:GetSystemTemplateRevisionsResponse' :: GetSystemTemplateRevisionsResponse -> Maybe [SystemTemplateSummary]
summaries} -> Maybe [SystemTemplateSummary]
summaries) (\s :: GetSystemTemplateRevisionsResponse
s@GetSystemTemplateRevisionsResponse' {} Maybe [SystemTemplateSummary]
a -> GetSystemTemplateRevisionsResponse
s {$sel:summaries:GetSystemTemplateRevisionsResponse' :: Maybe [SystemTemplateSummary]
summaries = Maybe [SystemTemplateSummary]
a} :: GetSystemTemplateRevisionsResponse) ((Maybe [SystemTemplateSummary]
  -> f (Maybe [SystemTemplateSummary]))
 -> GetSystemTemplateRevisionsResponse
 -> f GetSystemTemplateRevisionsResponse)
-> ((Maybe [SystemTemplateSummary]
     -> f (Maybe [SystemTemplateSummary]))
    -> Maybe [SystemTemplateSummary]
    -> f (Maybe [SystemTemplateSummary]))
-> (Maybe [SystemTemplateSummary]
    -> f (Maybe [SystemTemplateSummary]))
-> GetSystemTemplateRevisionsResponse
-> f GetSystemTemplateRevisionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SystemTemplateSummary]
  [SystemTemplateSummary]
  [SystemTemplateSummary]
  [SystemTemplateSummary]
-> Iso
     (Maybe [SystemTemplateSummary])
     (Maybe [SystemTemplateSummary])
     (Maybe [SystemTemplateSummary])
     (Maybe [SystemTemplateSummary])
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
  [SystemTemplateSummary]
  [SystemTemplateSummary]
  [SystemTemplateSummary]
  [SystemTemplateSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetSystemTemplateRevisionsResponse