{-# 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.SES.ListTemplates
-- 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)
--
-- Lists the email templates present in your Amazon SES account in the
-- current AWS Region.
--
-- You can execute this operation no more than once per second.
--
-- This operation returns paginated results.
module Amazonka.SES.ListTemplates
  ( -- * Creating a Request
    ListTemplates (..),
    newListTemplates,

    -- * Request Lenses
    listTemplates_nextToken,
    listTemplates_maxItems,

    -- * Destructuring the Response
    ListTemplatesResponse (..),
    newListTemplatesResponse,

    -- * Response Lenses
    listTemplatesResponse_templatesMetadata,
    listTemplatesResponse_nextToken,
    listTemplatesResponse_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.SES.Types

-- | /See:/ 'newListTemplates' smart constructor.
data ListTemplates = ListTemplates'
  { -- | A token returned from a previous call to @ListTemplates@ to indicate the
    -- position in the list of email templates.
    ListTemplates -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of templates to return. This value must be at least 1
    -- and less than or equal to 10. If you do not specify a value, or if you
    -- specify a value less than 1 or greater than 10, the operation will
    -- return up to 10 results.
    ListTemplates -> Maybe Int
maxItems :: Prelude.Maybe Prelude.Int
  }
  deriving (ListTemplates -> ListTemplates -> Bool
(ListTemplates -> ListTemplates -> Bool)
-> (ListTemplates -> ListTemplates -> Bool) -> Eq ListTemplates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTemplates -> ListTemplates -> Bool
$c/= :: ListTemplates -> ListTemplates -> Bool
== :: ListTemplates -> ListTemplates -> Bool
$c== :: ListTemplates -> ListTemplates -> Bool
Prelude.Eq, ReadPrec [ListTemplates]
ReadPrec ListTemplates
Int -> ReadS ListTemplates
ReadS [ListTemplates]
(Int -> ReadS ListTemplates)
-> ReadS [ListTemplates]
-> ReadPrec ListTemplates
-> ReadPrec [ListTemplates]
-> Read ListTemplates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTemplates]
$creadListPrec :: ReadPrec [ListTemplates]
readPrec :: ReadPrec ListTemplates
$creadPrec :: ReadPrec ListTemplates
readList :: ReadS [ListTemplates]
$creadList :: ReadS [ListTemplates]
readsPrec :: Int -> ReadS ListTemplates
$creadsPrec :: Int -> ReadS ListTemplates
Prelude.Read, Int -> ListTemplates -> ShowS
[ListTemplates] -> ShowS
ListTemplates -> String
(Int -> ListTemplates -> ShowS)
-> (ListTemplates -> String)
-> ([ListTemplates] -> ShowS)
-> Show ListTemplates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTemplates] -> ShowS
$cshowList :: [ListTemplates] -> ShowS
show :: ListTemplates -> String
$cshow :: ListTemplates -> String
showsPrec :: Int -> ListTemplates -> ShowS
$cshowsPrec :: Int -> ListTemplates -> ShowS
Prelude.Show, (forall x. ListTemplates -> Rep ListTemplates x)
-> (forall x. Rep ListTemplates x -> ListTemplates)
-> Generic ListTemplates
forall x. Rep ListTemplates x -> ListTemplates
forall x. ListTemplates -> Rep ListTemplates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTemplates x -> ListTemplates
$cfrom :: forall x. ListTemplates -> Rep ListTemplates x
Prelude.Generic)

-- |
-- Create a value of 'ListTemplates' 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', 'listTemplates_nextToken' - A token returned from a previous call to @ListTemplates@ to indicate the
-- position in the list of email templates.
--
-- 'maxItems', 'listTemplates_maxItems' - The maximum number of templates to return. This value must be at least 1
-- and less than or equal to 10. If you do not specify a value, or if you
-- specify a value less than 1 or greater than 10, the operation will
-- return up to 10 results.
newListTemplates ::
  ListTemplates
newListTemplates :: ListTemplates
newListTemplates =
  ListTemplates' :: Maybe Text -> Maybe Int -> ListTemplates
ListTemplates'
    { $sel:nextToken:ListTemplates' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxItems:ListTemplates' :: Maybe Int
maxItems = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | A token returned from a previous call to @ListTemplates@ to indicate the
-- position in the list of email templates.
listTemplates_nextToken :: Lens.Lens' ListTemplates (Prelude.Maybe Prelude.Text)
listTemplates_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListTemplates -> f ListTemplates
listTemplates_nextToken = (ListTemplates -> Maybe Text)
-> (ListTemplates -> Maybe Text -> ListTemplates)
-> Lens ListTemplates ListTemplates (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplates' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTemplates' :: ListTemplates -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTemplates
s@ListTemplates' {} Maybe Text
a -> ListTemplates
s {$sel:nextToken:ListTemplates' :: Maybe Text
nextToken = Maybe Text
a} :: ListTemplates)

-- | The maximum number of templates to return. This value must be at least 1
-- and less than or equal to 10. If you do not specify a value, or if you
-- specify a value less than 1 or greater than 10, the operation will
-- return up to 10 results.
listTemplates_maxItems :: Lens.Lens' ListTemplates (Prelude.Maybe Prelude.Int)
listTemplates_maxItems :: (Maybe Int -> f (Maybe Int)) -> ListTemplates -> f ListTemplates
listTemplates_maxItems = (ListTemplates -> Maybe Int)
-> (ListTemplates -> Maybe Int -> ListTemplates)
-> Lens ListTemplates ListTemplates (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplates' {Maybe Int
maxItems :: Maybe Int
$sel:maxItems:ListTemplates' :: ListTemplates -> Maybe Int
maxItems} -> Maybe Int
maxItems) (\s :: ListTemplates
s@ListTemplates' {} Maybe Int
a -> ListTemplates
s {$sel:maxItems:ListTemplates' :: Maybe Int
maxItems = Maybe Int
a} :: ListTemplates)

instance Core.AWSPager ListTemplates where
  page :: ListTemplates -> AWSResponse ListTemplates -> Maybe ListTemplates
page ListTemplates
rq AWSResponse ListTemplates
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTemplates
ListTemplatesResponse
rs
            ListTemplatesResponse
-> Getting (First Text) ListTemplatesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTemplatesResponse
-> Const (First Text) ListTemplatesResponse
Lens' ListTemplatesResponse (Maybe Text)
listTemplatesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTemplatesResponse
 -> Const (First Text) ListTemplatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTemplatesResponse 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 ListTemplates
forall a. Maybe a
Prelude.Nothing
    | Maybe [TemplateMetadata] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListTemplates
ListTemplatesResponse
rs
            ListTemplatesResponse
-> Getting
     (First [TemplateMetadata]) ListTemplatesResponse [TemplateMetadata]
-> Maybe [TemplateMetadata]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [TemplateMetadata]
 -> Const (First [TemplateMetadata]) (Maybe [TemplateMetadata]))
-> ListTemplatesResponse
-> Const (First [TemplateMetadata]) ListTemplatesResponse
Lens' ListTemplatesResponse (Maybe [TemplateMetadata])
listTemplatesResponse_templatesMetadata
              ((Maybe [TemplateMetadata]
  -> Const (First [TemplateMetadata]) (Maybe [TemplateMetadata]))
 -> ListTemplatesResponse
 -> Const (First [TemplateMetadata]) ListTemplatesResponse)
-> (([TemplateMetadata]
     -> Const (First [TemplateMetadata]) [TemplateMetadata])
    -> Maybe [TemplateMetadata]
    -> Const (First [TemplateMetadata]) (Maybe [TemplateMetadata]))
-> Getting
     (First [TemplateMetadata]) ListTemplatesResponse [TemplateMetadata]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([TemplateMetadata]
 -> Const (First [TemplateMetadata]) [TemplateMetadata])
-> Maybe [TemplateMetadata]
-> Const (First [TemplateMetadata]) (Maybe [TemplateMetadata])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListTemplates
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListTemplates -> Maybe ListTemplates
forall a. a -> Maybe a
Prelude.Just (ListTemplates -> Maybe ListTemplates)
-> ListTemplates -> Maybe ListTemplates
forall a b. (a -> b) -> a -> b
Prelude.$
        ListTemplates
rq
          ListTemplates -> (ListTemplates -> ListTemplates) -> ListTemplates
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListTemplates -> Identity ListTemplates
Lens ListTemplates ListTemplates (Maybe Text) (Maybe Text)
listTemplates_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListTemplates -> Identity ListTemplates)
-> Maybe Text -> ListTemplates -> ListTemplates
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListTemplates
ListTemplatesResponse
rs
          ListTemplatesResponse
-> Getting (First Text) ListTemplatesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListTemplatesResponse
-> Const (First Text) ListTemplatesResponse
Lens' ListTemplatesResponse (Maybe Text)
listTemplatesResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListTemplatesResponse
 -> Const (First Text) ListTemplatesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListTemplatesResponse 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 ListTemplates where
  type
    AWSResponse ListTemplates =
      ListTemplatesResponse
  request :: ListTemplates -> Request ListTemplates
request = Service -> ListTemplates -> Request ListTemplates
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListTemplates
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListTemplates)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListTemplates))
-> Logger
-> Service
-> Proxy ListTemplates
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListTemplates)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ListTemplatesResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [TemplateMetadata]
-> Maybe Text -> Int -> ListTemplatesResponse
ListTemplatesResponse'
            (Maybe [TemplateMetadata]
 -> Maybe Text -> Int -> ListTemplatesResponse)
-> Either String (Maybe [TemplateMetadata])
-> Either String (Maybe Text -> Int -> ListTemplatesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TemplatesMetadata"
                            Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [TemplateMetadata]))
-> Either String (Maybe [TemplateMetadata])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [TemplateMetadata])
-> [Node] -> Either String (Maybe [TemplateMetadata])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [TemplateMetadata]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Maybe Text -> Int -> ListTemplatesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListTemplatesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextToken")
            Either String (Int -> ListTemplatesResponse)
-> Either String Int -> Either String ListTemplatesResponse
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 ListTemplates

instance Prelude.NFData ListTemplates

instance Core.ToHeaders ListTemplates where
  toHeaders :: ListTemplates -> ResponseHeaders
toHeaders = ResponseHeaders -> ListTemplates -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery ListTemplates where
  toQuery :: ListTemplates -> QueryString
toQuery ListTemplates' {Maybe Int
Maybe Text
maxItems :: Maybe Int
nextToken :: Maybe Text
$sel:maxItems:ListTemplates' :: ListTemplates -> Maybe Int
$sel:nextToken:ListTemplates' :: ListTemplates -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ListTemplates" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"MaxItems" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxItems
      ]

-- | /See:/ 'newListTemplatesResponse' smart constructor.
data ListTemplatesResponse = ListTemplatesResponse'
  { -- | An array the contains the name and creation time stamp for each template
    -- in your Amazon SES account.
    ListTemplatesResponse -> Maybe [TemplateMetadata]
templatesMetadata :: Prelude.Maybe [TemplateMetadata],
    -- | A token indicating that there are additional email templates available
    -- to be listed. Pass this token to a subsequent call to @ListTemplates@ to
    -- retrieve the next 50 email templates.
    ListTemplatesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListTemplatesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListTemplatesResponse -> ListTemplatesResponse -> Bool
(ListTemplatesResponse -> ListTemplatesResponse -> Bool)
-> (ListTemplatesResponse -> ListTemplatesResponse -> Bool)
-> Eq ListTemplatesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTemplatesResponse -> ListTemplatesResponse -> Bool
$c/= :: ListTemplatesResponse -> ListTemplatesResponse -> Bool
== :: ListTemplatesResponse -> ListTemplatesResponse -> Bool
$c== :: ListTemplatesResponse -> ListTemplatesResponse -> Bool
Prelude.Eq, ReadPrec [ListTemplatesResponse]
ReadPrec ListTemplatesResponse
Int -> ReadS ListTemplatesResponse
ReadS [ListTemplatesResponse]
(Int -> ReadS ListTemplatesResponse)
-> ReadS [ListTemplatesResponse]
-> ReadPrec ListTemplatesResponse
-> ReadPrec [ListTemplatesResponse]
-> Read ListTemplatesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTemplatesResponse]
$creadListPrec :: ReadPrec [ListTemplatesResponse]
readPrec :: ReadPrec ListTemplatesResponse
$creadPrec :: ReadPrec ListTemplatesResponse
readList :: ReadS [ListTemplatesResponse]
$creadList :: ReadS [ListTemplatesResponse]
readsPrec :: Int -> ReadS ListTemplatesResponse
$creadsPrec :: Int -> ReadS ListTemplatesResponse
Prelude.Read, Int -> ListTemplatesResponse -> ShowS
[ListTemplatesResponse] -> ShowS
ListTemplatesResponse -> String
(Int -> ListTemplatesResponse -> ShowS)
-> (ListTemplatesResponse -> String)
-> ([ListTemplatesResponse] -> ShowS)
-> Show ListTemplatesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTemplatesResponse] -> ShowS
$cshowList :: [ListTemplatesResponse] -> ShowS
show :: ListTemplatesResponse -> String
$cshow :: ListTemplatesResponse -> String
showsPrec :: Int -> ListTemplatesResponse -> ShowS
$cshowsPrec :: Int -> ListTemplatesResponse -> ShowS
Prelude.Show, (forall x. ListTemplatesResponse -> Rep ListTemplatesResponse x)
-> (forall x. Rep ListTemplatesResponse x -> ListTemplatesResponse)
-> Generic ListTemplatesResponse
forall x. Rep ListTemplatesResponse x -> ListTemplatesResponse
forall x. ListTemplatesResponse -> Rep ListTemplatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTemplatesResponse x -> ListTemplatesResponse
$cfrom :: forall x. ListTemplatesResponse -> Rep ListTemplatesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListTemplatesResponse' 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:
--
-- 'templatesMetadata', 'listTemplatesResponse_templatesMetadata' - An array the contains the name and creation time stamp for each template
-- in your Amazon SES account.
--
-- 'nextToken', 'listTemplatesResponse_nextToken' - A token indicating that there are additional email templates available
-- to be listed. Pass this token to a subsequent call to @ListTemplates@ to
-- retrieve the next 50 email templates.
--
-- 'httpStatus', 'listTemplatesResponse_httpStatus' - The response's http status code.
newListTemplatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListTemplatesResponse
newListTemplatesResponse :: Int -> ListTemplatesResponse
newListTemplatesResponse Int
pHttpStatus_ =
  ListTemplatesResponse' :: Maybe [TemplateMetadata]
-> Maybe Text -> Int -> ListTemplatesResponse
ListTemplatesResponse'
    { $sel:templatesMetadata:ListTemplatesResponse' :: Maybe [TemplateMetadata]
templatesMetadata =
        Maybe [TemplateMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListTemplatesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListTemplatesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array the contains the name and creation time stamp for each template
-- in your Amazon SES account.
listTemplatesResponse_templatesMetadata :: Lens.Lens' ListTemplatesResponse (Prelude.Maybe [TemplateMetadata])
listTemplatesResponse_templatesMetadata :: (Maybe [TemplateMetadata] -> f (Maybe [TemplateMetadata]))
-> ListTemplatesResponse -> f ListTemplatesResponse
listTemplatesResponse_templatesMetadata = (ListTemplatesResponse -> Maybe [TemplateMetadata])
-> (ListTemplatesResponse
    -> Maybe [TemplateMetadata] -> ListTemplatesResponse)
-> Lens' ListTemplatesResponse (Maybe [TemplateMetadata])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplatesResponse' {Maybe [TemplateMetadata]
templatesMetadata :: Maybe [TemplateMetadata]
$sel:templatesMetadata:ListTemplatesResponse' :: ListTemplatesResponse -> Maybe [TemplateMetadata]
templatesMetadata} -> Maybe [TemplateMetadata]
templatesMetadata) (\s :: ListTemplatesResponse
s@ListTemplatesResponse' {} Maybe [TemplateMetadata]
a -> ListTemplatesResponse
s {$sel:templatesMetadata:ListTemplatesResponse' :: Maybe [TemplateMetadata]
templatesMetadata = Maybe [TemplateMetadata]
a} :: ListTemplatesResponse) ((Maybe [TemplateMetadata] -> f (Maybe [TemplateMetadata]))
 -> ListTemplatesResponse -> f ListTemplatesResponse)
-> ((Maybe [TemplateMetadata] -> f (Maybe [TemplateMetadata]))
    -> Maybe [TemplateMetadata] -> f (Maybe [TemplateMetadata]))
-> (Maybe [TemplateMetadata] -> f (Maybe [TemplateMetadata]))
-> ListTemplatesResponse
-> f ListTemplatesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [TemplateMetadata]
  [TemplateMetadata]
  [TemplateMetadata]
  [TemplateMetadata]
-> Iso
     (Maybe [TemplateMetadata])
     (Maybe [TemplateMetadata])
     (Maybe [TemplateMetadata])
     (Maybe [TemplateMetadata])
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
  [TemplateMetadata]
  [TemplateMetadata]
  [TemplateMetadata]
  [TemplateMetadata]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token indicating that there are additional email templates available
-- to be listed. Pass this token to a subsequent call to @ListTemplates@ to
-- retrieve the next 50 email templates.
listTemplatesResponse_nextToken :: Lens.Lens' ListTemplatesResponse (Prelude.Maybe Prelude.Text)
listTemplatesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListTemplatesResponse -> f ListTemplatesResponse
listTemplatesResponse_nextToken = (ListTemplatesResponse -> Maybe Text)
-> (ListTemplatesResponse -> Maybe Text -> ListTemplatesResponse)
-> Lens' ListTemplatesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTemplatesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTemplatesResponse' :: ListTemplatesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTemplatesResponse
s@ListTemplatesResponse' {} Maybe Text
a -> ListTemplatesResponse
s {$sel:nextToken:ListTemplatesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListTemplatesResponse)

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

instance Prelude.NFData ListTemplatesResponse