{-# 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.MediaConvert.ListJobTemplates
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieve a JSON array of up to twenty of your job templates. This will
-- return the templates themselves, not just a list of them. To retrieve
-- the next twenty templates, use the nextToken string returned with the
-- array
--
-- This operation returns paginated results.
module Amazonka.MediaConvert.ListJobTemplates
  ( -- * Creating a Request
    ListJobTemplates (..),
    newListJobTemplates,

    -- * Request Lenses
    listJobTemplates_category,
    listJobTemplates_listBy,
    listJobTemplates_maxResults,
    listJobTemplates_nextToken,
    listJobTemplates_order,

    -- * Destructuring the Response
    ListJobTemplatesResponse (..),
    newListJobTemplatesResponse,

    -- * Response Lenses
    listJobTemplatesResponse_jobTemplates,
    listJobTemplatesResponse_nextToken,
    listJobTemplatesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConvert.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListJobTemplates' smart constructor.
data ListJobTemplates = ListJobTemplates'
  { -- | Optionally, specify a job template category to limit responses to only
    -- job templates from that category.
    ListJobTemplates -> Maybe Text
category :: Prelude.Maybe Prelude.Text,
    -- | Optional. When you request a list of job templates, you can choose to
    -- list them alphabetically by NAME or chronologically by CREATION_DATE. If
    -- you don\'t specify, the service will list them by name.
    ListJobTemplates -> Maybe JobTemplateListBy
listBy :: Prelude.Maybe JobTemplateListBy,
    -- | Optional. Number of job templates, up to twenty, that will be returned
    -- at one time.
    ListJobTemplates -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | Use this string, provided with the response to a previous request, to
    -- request the next batch of job templates.
    ListJobTemplates -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Optional. When you request lists of resources, you can specify whether
    -- they are sorted in ASCENDING or DESCENDING order. Default varies by
    -- resource.
    ListJobTemplates -> Maybe Order
order :: Prelude.Maybe Order
  }
  deriving (ListJobTemplates -> ListJobTemplates -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListJobTemplates -> ListJobTemplates -> Bool
$c/= :: ListJobTemplates -> ListJobTemplates -> Bool
== :: ListJobTemplates -> ListJobTemplates -> Bool
$c== :: ListJobTemplates -> ListJobTemplates -> Bool
Prelude.Eq, ReadPrec [ListJobTemplates]
ReadPrec ListJobTemplates
Int -> ReadS ListJobTemplates
ReadS [ListJobTemplates]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListJobTemplates]
$creadListPrec :: ReadPrec [ListJobTemplates]
readPrec :: ReadPrec ListJobTemplates
$creadPrec :: ReadPrec ListJobTemplates
readList :: ReadS [ListJobTemplates]
$creadList :: ReadS [ListJobTemplates]
readsPrec :: Int -> ReadS ListJobTemplates
$creadsPrec :: Int -> ReadS ListJobTemplates
Prelude.Read, Int -> ListJobTemplates -> ShowS
[ListJobTemplates] -> ShowS
ListJobTemplates -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListJobTemplates] -> ShowS
$cshowList :: [ListJobTemplates] -> ShowS
show :: ListJobTemplates -> String
$cshow :: ListJobTemplates -> String
showsPrec :: Int -> ListJobTemplates -> ShowS
$cshowsPrec :: Int -> ListJobTemplates -> ShowS
Prelude.Show, forall x. Rep ListJobTemplates x -> ListJobTemplates
forall x. ListJobTemplates -> Rep ListJobTemplates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListJobTemplates x -> ListJobTemplates
$cfrom :: forall x. ListJobTemplates -> Rep ListJobTemplates x
Prelude.Generic)

-- |
-- Create a value of 'ListJobTemplates' 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:
--
-- 'category', 'listJobTemplates_category' - Optionally, specify a job template category to limit responses to only
-- job templates from that category.
--
-- 'listBy', 'listJobTemplates_listBy' - Optional. When you request a list of job templates, you can choose to
-- list them alphabetically by NAME or chronologically by CREATION_DATE. If
-- you don\'t specify, the service will list them by name.
--
-- 'maxResults', 'listJobTemplates_maxResults' - Optional. Number of job templates, up to twenty, that will be returned
-- at one time.
--
-- 'nextToken', 'listJobTemplates_nextToken' - Use this string, provided with the response to a previous request, to
-- request the next batch of job templates.
--
-- 'order', 'listJobTemplates_order' - Optional. When you request lists of resources, you can specify whether
-- they are sorted in ASCENDING or DESCENDING order. Default varies by
-- resource.
newListJobTemplates ::
  ListJobTemplates
newListJobTemplates :: ListJobTemplates
newListJobTemplates =
  ListJobTemplates'
    { $sel:category:ListJobTemplates' :: Maybe Text
category = forall a. Maybe a
Prelude.Nothing,
      $sel:listBy:ListJobTemplates' :: Maybe JobTemplateListBy
listBy = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListJobTemplates' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListJobTemplates' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:order:ListJobTemplates' :: Maybe Order
order = forall a. Maybe a
Prelude.Nothing
    }

-- | Optionally, specify a job template category to limit responses to only
-- job templates from that category.
listJobTemplates_category :: Lens.Lens' ListJobTemplates (Prelude.Maybe Prelude.Text)
listJobTemplates_category :: Lens' ListJobTemplates (Maybe Text)
listJobTemplates_category = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJobTemplates' {Maybe Text
category :: Maybe Text
$sel:category:ListJobTemplates' :: ListJobTemplates -> Maybe Text
category} -> Maybe Text
category) (\s :: ListJobTemplates
s@ListJobTemplates' {} Maybe Text
a -> ListJobTemplates
s {$sel:category:ListJobTemplates' :: Maybe Text
category = Maybe Text
a} :: ListJobTemplates)

-- | Optional. When you request a list of job templates, you can choose to
-- list them alphabetically by NAME or chronologically by CREATION_DATE. If
-- you don\'t specify, the service will list them by name.
listJobTemplates_listBy :: Lens.Lens' ListJobTemplates (Prelude.Maybe JobTemplateListBy)
listJobTemplates_listBy :: Lens' ListJobTemplates (Maybe JobTemplateListBy)
listJobTemplates_listBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJobTemplates' {Maybe JobTemplateListBy
listBy :: Maybe JobTemplateListBy
$sel:listBy:ListJobTemplates' :: ListJobTemplates -> Maybe JobTemplateListBy
listBy} -> Maybe JobTemplateListBy
listBy) (\s :: ListJobTemplates
s@ListJobTemplates' {} Maybe JobTemplateListBy
a -> ListJobTemplates
s {$sel:listBy:ListJobTemplates' :: Maybe JobTemplateListBy
listBy = Maybe JobTemplateListBy
a} :: ListJobTemplates)

-- | Optional. Number of job templates, up to twenty, that will be returned
-- at one time.
listJobTemplates_maxResults :: Lens.Lens' ListJobTemplates (Prelude.Maybe Prelude.Natural)
listJobTemplates_maxResults :: Lens' ListJobTemplates (Maybe Natural)
listJobTemplates_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJobTemplates' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListJobTemplates' :: ListJobTemplates -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListJobTemplates
s@ListJobTemplates' {} Maybe Natural
a -> ListJobTemplates
s {$sel:maxResults:ListJobTemplates' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListJobTemplates)

-- | Use this string, provided with the response to a previous request, to
-- request the next batch of job templates.
listJobTemplates_nextToken :: Lens.Lens' ListJobTemplates (Prelude.Maybe Prelude.Text)
listJobTemplates_nextToken :: Lens' ListJobTemplates (Maybe Text)
listJobTemplates_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJobTemplates' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListJobTemplates' :: ListJobTemplates -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListJobTemplates
s@ListJobTemplates' {} Maybe Text
a -> ListJobTemplates
s {$sel:nextToken:ListJobTemplates' :: Maybe Text
nextToken = Maybe Text
a} :: ListJobTemplates)

-- | Optional. When you request lists of resources, you can specify whether
-- they are sorted in ASCENDING or DESCENDING order. Default varies by
-- resource.
listJobTemplates_order :: Lens.Lens' ListJobTemplates (Prelude.Maybe Order)
listJobTemplates_order :: Lens' ListJobTemplates (Maybe Order)
listJobTemplates_order = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJobTemplates' {Maybe Order
order :: Maybe Order
$sel:order:ListJobTemplates' :: ListJobTemplates -> Maybe Order
order} -> Maybe Order
order) (\s :: ListJobTemplates
s@ListJobTemplates' {} Maybe Order
a -> ListJobTemplates
s {$sel:order:ListJobTemplates' :: Maybe Order
order = Maybe Order
a} :: ListJobTemplates)

instance Core.AWSPager ListJobTemplates where
  page :: ListJobTemplates
-> AWSResponse ListJobTemplates -> Maybe ListJobTemplates
page ListJobTemplates
rq AWSResponse ListJobTemplates
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListJobTemplates
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListJobTemplatesResponse (Maybe Text)
listJobTemplatesResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListJobTemplates
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListJobTemplatesResponse (Maybe [JobTemplate])
listJobTemplatesResponse_jobTemplates
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListJobTemplates
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListJobTemplates (Maybe Text)
listJobTemplates_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListJobTemplates
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListJobTemplatesResponse (Maybe Text)
listJobTemplatesResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListJobTemplates where
  type
    AWSResponse ListJobTemplates =
      ListJobTemplatesResponse
  request :: (Service -> Service)
-> ListJobTemplates -> Request ListJobTemplates
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListJobTemplates
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListJobTemplates)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [JobTemplate]
-> Maybe Text -> Int -> ListJobTemplatesResponse
ListJobTemplatesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"jobTemplates" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListJobTemplates where
  hashWithSalt :: Int -> ListJobTemplates -> Int
hashWithSalt Int
_salt ListJobTemplates' {Maybe Natural
Maybe Text
Maybe JobTemplateListBy
Maybe Order
order :: Maybe Order
nextToken :: Maybe Text
maxResults :: Maybe Natural
listBy :: Maybe JobTemplateListBy
category :: Maybe Text
$sel:order:ListJobTemplates' :: ListJobTemplates -> Maybe Order
$sel:nextToken:ListJobTemplates' :: ListJobTemplates -> Maybe Text
$sel:maxResults:ListJobTemplates' :: ListJobTemplates -> Maybe Natural
$sel:listBy:ListJobTemplates' :: ListJobTemplates -> Maybe JobTemplateListBy
$sel:category:ListJobTemplates' :: ListJobTemplates -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
category
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe JobTemplateListBy
listBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Order
order

instance Prelude.NFData ListJobTemplates where
  rnf :: ListJobTemplates -> ()
rnf ListJobTemplates' {Maybe Natural
Maybe Text
Maybe JobTemplateListBy
Maybe Order
order :: Maybe Order
nextToken :: Maybe Text
maxResults :: Maybe Natural
listBy :: Maybe JobTemplateListBy
category :: Maybe Text
$sel:order:ListJobTemplates' :: ListJobTemplates -> Maybe Order
$sel:nextToken:ListJobTemplates' :: ListJobTemplates -> Maybe Text
$sel:maxResults:ListJobTemplates' :: ListJobTemplates -> Maybe Natural
$sel:listBy:ListJobTemplates' :: ListJobTemplates -> Maybe JobTemplateListBy
$sel:category:ListJobTemplates' :: ListJobTemplates -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
category
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe JobTemplateListBy
listBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Order
order

instance Data.ToHeaders ListJobTemplates where
  toHeaders :: ListJobTemplates -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath ListJobTemplates where
  toPath :: ListJobTemplates -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/2017-08-29/jobTemplates"

instance Data.ToQuery ListJobTemplates where
  toQuery :: ListJobTemplates -> QueryString
toQuery ListJobTemplates' {Maybe Natural
Maybe Text
Maybe JobTemplateListBy
Maybe Order
order :: Maybe Order
nextToken :: Maybe Text
maxResults :: Maybe Natural
listBy :: Maybe JobTemplateListBy
category :: Maybe Text
$sel:order:ListJobTemplates' :: ListJobTemplates -> Maybe Order
$sel:nextToken:ListJobTemplates' :: ListJobTemplates -> Maybe Text
$sel:maxResults:ListJobTemplates' :: ListJobTemplates -> Maybe Natural
$sel:listBy:ListJobTemplates' :: ListJobTemplates -> Maybe JobTemplateListBy
$sel:category:ListJobTemplates' :: ListJobTemplates -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"category" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
category,
        ByteString
"listBy" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe JobTemplateListBy
listBy,
        ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        ByteString
"order" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Order
order
      ]

-- | /See:/ 'newListJobTemplatesResponse' smart constructor.
data ListJobTemplatesResponse = ListJobTemplatesResponse'
  { -- | List of Job templates.
    ListJobTemplatesResponse -> Maybe [JobTemplate]
jobTemplates :: Prelude.Maybe [JobTemplate],
    -- | Use this string to request the next batch of job templates.
    ListJobTemplatesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListJobTemplatesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListJobTemplatesResponse -> ListJobTemplatesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListJobTemplatesResponse -> ListJobTemplatesResponse -> Bool
$c/= :: ListJobTemplatesResponse -> ListJobTemplatesResponse -> Bool
== :: ListJobTemplatesResponse -> ListJobTemplatesResponse -> Bool
$c== :: ListJobTemplatesResponse -> ListJobTemplatesResponse -> Bool
Prelude.Eq, ReadPrec [ListJobTemplatesResponse]
ReadPrec ListJobTemplatesResponse
Int -> ReadS ListJobTemplatesResponse
ReadS [ListJobTemplatesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListJobTemplatesResponse]
$creadListPrec :: ReadPrec [ListJobTemplatesResponse]
readPrec :: ReadPrec ListJobTemplatesResponse
$creadPrec :: ReadPrec ListJobTemplatesResponse
readList :: ReadS [ListJobTemplatesResponse]
$creadList :: ReadS [ListJobTemplatesResponse]
readsPrec :: Int -> ReadS ListJobTemplatesResponse
$creadsPrec :: Int -> ReadS ListJobTemplatesResponse
Prelude.Read, Int -> ListJobTemplatesResponse -> ShowS
[ListJobTemplatesResponse] -> ShowS
ListJobTemplatesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListJobTemplatesResponse] -> ShowS
$cshowList :: [ListJobTemplatesResponse] -> ShowS
show :: ListJobTemplatesResponse -> String
$cshow :: ListJobTemplatesResponse -> String
showsPrec :: Int -> ListJobTemplatesResponse -> ShowS
$cshowsPrec :: Int -> ListJobTemplatesResponse -> ShowS
Prelude.Show, forall x.
Rep ListJobTemplatesResponse x -> ListJobTemplatesResponse
forall x.
ListJobTemplatesResponse -> Rep ListJobTemplatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListJobTemplatesResponse x -> ListJobTemplatesResponse
$cfrom :: forall x.
ListJobTemplatesResponse -> Rep ListJobTemplatesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListJobTemplatesResponse' 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:
--
-- 'jobTemplates', 'listJobTemplatesResponse_jobTemplates' - List of Job templates.
--
-- 'nextToken', 'listJobTemplatesResponse_nextToken' - Use this string to request the next batch of job templates.
--
-- 'httpStatus', 'listJobTemplatesResponse_httpStatus' - The response's http status code.
newListJobTemplatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListJobTemplatesResponse
newListJobTemplatesResponse :: Int -> ListJobTemplatesResponse
newListJobTemplatesResponse Int
pHttpStatus_ =
  ListJobTemplatesResponse'
    { $sel:jobTemplates:ListJobTemplatesResponse' :: Maybe [JobTemplate]
jobTemplates =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListJobTemplatesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListJobTemplatesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | List of Job templates.
listJobTemplatesResponse_jobTemplates :: Lens.Lens' ListJobTemplatesResponse (Prelude.Maybe [JobTemplate])
listJobTemplatesResponse_jobTemplates :: Lens' ListJobTemplatesResponse (Maybe [JobTemplate])
listJobTemplatesResponse_jobTemplates = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJobTemplatesResponse' {Maybe [JobTemplate]
jobTemplates :: Maybe [JobTemplate]
$sel:jobTemplates:ListJobTemplatesResponse' :: ListJobTemplatesResponse -> Maybe [JobTemplate]
jobTemplates} -> Maybe [JobTemplate]
jobTemplates) (\s :: ListJobTemplatesResponse
s@ListJobTemplatesResponse' {} Maybe [JobTemplate]
a -> ListJobTemplatesResponse
s {$sel:jobTemplates:ListJobTemplatesResponse' :: Maybe [JobTemplate]
jobTemplates = Maybe [JobTemplate]
a} :: ListJobTemplatesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Use this string to request the next batch of job templates.
listJobTemplatesResponse_nextToken :: Lens.Lens' ListJobTemplatesResponse (Prelude.Maybe Prelude.Text)
listJobTemplatesResponse_nextToken :: Lens' ListJobTemplatesResponse (Maybe Text)
listJobTemplatesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListJobTemplatesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListJobTemplatesResponse' :: ListJobTemplatesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListJobTemplatesResponse
s@ListJobTemplatesResponse' {} Maybe Text
a -> ListJobTemplatesResponse
s {$sel:nextToken:ListJobTemplatesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListJobTemplatesResponse)

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

instance Prelude.NFData ListJobTemplatesResponse where
  rnf :: ListJobTemplatesResponse -> ()
rnf ListJobTemplatesResponse' {Int
Maybe [JobTemplate]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
jobTemplates :: Maybe [JobTemplate]
$sel:httpStatus:ListJobTemplatesResponse' :: ListJobTemplatesResponse -> Int
$sel:nextToken:ListJobTemplatesResponse' :: ListJobTemplatesResponse -> Maybe Text
$sel:jobTemplates:ListJobTemplatesResponse' :: ListJobTemplatesResponse -> Maybe [JobTemplate]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [JobTemplate]
jobTemplates
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus