{-# 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.GetFlowTemplateRevisions
-- 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 of the specified workflow. Only the last 100 revisions
-- are stored. If the workflow has been deprecated, this action will return
-- revisions that occurred before the deprecation. This action won\'t work
-- for workflows that have been deleted.
--
-- This operation returns paginated results.
module Amazonka.IoTThingsGraph.GetFlowTemplateRevisions
  ( -- * Creating a Request
    GetFlowTemplateRevisions (..),
    newGetFlowTemplateRevisions,

    -- * Request Lenses
    getFlowTemplateRevisions_nextToken,
    getFlowTemplateRevisions_maxResults,
    getFlowTemplateRevisions_id,

    -- * Destructuring the Response
    GetFlowTemplateRevisionsResponse (..),
    newGetFlowTemplateRevisionsResponse,

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

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

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

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

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

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

instance Prelude.NFData GetFlowTemplateRevisions

instance Core.ToHeaders GetFlowTemplateRevisions where
  toHeaders :: GetFlowTemplateRevisions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetFlowTemplateRevisions -> 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.GetFlowTemplateRevisions" ::
                          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 GetFlowTemplateRevisions where
  toJSON :: GetFlowTemplateRevisions -> Value
toJSON GetFlowTemplateRevisions' {Maybe Natural
Maybe Text
Text
id :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:id:GetFlowTemplateRevisions' :: GetFlowTemplateRevisions -> Text
$sel:maxResults:GetFlowTemplateRevisions' :: GetFlowTemplateRevisions -> Maybe Natural
$sel:nextToken:GetFlowTemplateRevisions' :: GetFlowTemplateRevisions -> 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 GetFlowTemplateRevisions where
  toPath :: GetFlowTemplateRevisions -> ByteString
toPath = ByteString -> GetFlowTemplateRevisions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'GetFlowTemplateRevisionsResponse' 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', 'getFlowTemplateRevisionsResponse_nextToken' - The string to specify as @nextToken@ when you request the next page of
-- results.
--
-- 'summaries', 'getFlowTemplateRevisionsResponse_summaries' - An array of objects that provide summary data about each revision.
--
-- 'httpStatus', 'getFlowTemplateRevisionsResponse_httpStatus' - The response's http status code.
newGetFlowTemplateRevisionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetFlowTemplateRevisionsResponse
newGetFlowTemplateRevisionsResponse :: Int -> GetFlowTemplateRevisionsResponse
newGetFlowTemplateRevisionsResponse Int
pHttpStatus_ =
  GetFlowTemplateRevisionsResponse' :: Maybe Text
-> Maybe [FlowTemplateSummary]
-> Int
-> GetFlowTemplateRevisionsResponse
GetFlowTemplateRevisionsResponse'
    { $sel:nextToken:GetFlowTemplateRevisionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:summaries:GetFlowTemplateRevisionsResponse' :: Maybe [FlowTemplateSummary]
summaries = Maybe [FlowTemplateSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetFlowTemplateRevisionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | An array of objects that provide summary data about each revision.
getFlowTemplateRevisionsResponse_summaries :: Lens.Lens' GetFlowTemplateRevisionsResponse (Prelude.Maybe [FlowTemplateSummary])
getFlowTemplateRevisionsResponse_summaries :: (Maybe [FlowTemplateSummary] -> f (Maybe [FlowTemplateSummary]))
-> GetFlowTemplateRevisionsResponse
-> f GetFlowTemplateRevisionsResponse
getFlowTemplateRevisionsResponse_summaries = (GetFlowTemplateRevisionsResponse -> Maybe [FlowTemplateSummary])
-> (GetFlowTemplateRevisionsResponse
    -> Maybe [FlowTemplateSummary] -> GetFlowTemplateRevisionsResponse)
-> Lens'
     GetFlowTemplateRevisionsResponse (Maybe [FlowTemplateSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetFlowTemplateRevisionsResponse' {Maybe [FlowTemplateSummary]
summaries :: Maybe [FlowTemplateSummary]
$sel:summaries:GetFlowTemplateRevisionsResponse' :: GetFlowTemplateRevisionsResponse -> Maybe [FlowTemplateSummary]
summaries} -> Maybe [FlowTemplateSummary]
summaries) (\s :: GetFlowTemplateRevisionsResponse
s@GetFlowTemplateRevisionsResponse' {} Maybe [FlowTemplateSummary]
a -> GetFlowTemplateRevisionsResponse
s {$sel:summaries:GetFlowTemplateRevisionsResponse' :: Maybe [FlowTemplateSummary]
summaries = Maybe [FlowTemplateSummary]
a} :: GetFlowTemplateRevisionsResponse) ((Maybe [FlowTemplateSummary] -> f (Maybe [FlowTemplateSummary]))
 -> GetFlowTemplateRevisionsResponse
 -> f GetFlowTemplateRevisionsResponse)
-> ((Maybe [FlowTemplateSummary]
     -> f (Maybe [FlowTemplateSummary]))
    -> Maybe [FlowTemplateSummary] -> f (Maybe [FlowTemplateSummary]))
-> (Maybe [FlowTemplateSummary] -> f (Maybe [FlowTemplateSummary]))
-> GetFlowTemplateRevisionsResponse
-> f GetFlowTemplateRevisionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FlowTemplateSummary]
  [FlowTemplateSummary]
  [FlowTemplateSummary]
  [FlowTemplateSummary]
-> Iso
     (Maybe [FlowTemplateSummary])
     (Maybe [FlowTemplateSummary])
     (Maybe [FlowTemplateSummary])
     (Maybe [FlowTemplateSummary])
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
  [FlowTemplateSummary]
  [FlowTemplateSummary]
  [FlowTemplateSummary]
  [FlowTemplateSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetFlowTemplateRevisionsResponse