{-# 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.Proton.ListServiceTemplates
-- 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)
--
-- List service templates with detail data.
--
-- This operation returns paginated results.
module Amazonka.Proton.ListServiceTemplates
  ( -- * Creating a Request
    ListServiceTemplates (..),
    newListServiceTemplates,

    -- * Request Lenses
    listServiceTemplates_nextToken,
    listServiceTemplates_maxResults,

    -- * Destructuring the Response
    ListServiceTemplatesResponse (..),
    newListServiceTemplatesResponse,

    -- * Response Lenses
    listServiceTemplatesResponse_nextToken,
    listServiceTemplatesResponse_httpStatus,
    listServiceTemplatesResponse_templates,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Proton.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListServiceTemplates' smart constructor.
data ListServiceTemplates = ListServiceTemplates'
  { -- | A token to indicate the location of the next service template in the
    -- array of service templates, after the list of service templates
    -- previously requested.
    ListServiceTemplates -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of service templates to list.
    ListServiceTemplates -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListServiceTemplates -> ListServiceTemplates -> Bool
(ListServiceTemplates -> ListServiceTemplates -> Bool)
-> (ListServiceTemplates -> ListServiceTemplates -> Bool)
-> Eq ListServiceTemplates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListServiceTemplates -> ListServiceTemplates -> Bool
$c/= :: ListServiceTemplates -> ListServiceTemplates -> Bool
== :: ListServiceTemplates -> ListServiceTemplates -> Bool
$c== :: ListServiceTemplates -> ListServiceTemplates -> Bool
Prelude.Eq, ReadPrec [ListServiceTemplates]
ReadPrec ListServiceTemplates
Int -> ReadS ListServiceTemplates
ReadS [ListServiceTemplates]
(Int -> ReadS ListServiceTemplates)
-> ReadS [ListServiceTemplates]
-> ReadPrec ListServiceTemplates
-> ReadPrec [ListServiceTemplates]
-> Read ListServiceTemplates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListServiceTemplates]
$creadListPrec :: ReadPrec [ListServiceTemplates]
readPrec :: ReadPrec ListServiceTemplates
$creadPrec :: ReadPrec ListServiceTemplates
readList :: ReadS [ListServiceTemplates]
$creadList :: ReadS [ListServiceTemplates]
readsPrec :: Int -> ReadS ListServiceTemplates
$creadsPrec :: Int -> ReadS ListServiceTemplates
Prelude.Read, Int -> ListServiceTemplates -> ShowS
[ListServiceTemplates] -> ShowS
ListServiceTemplates -> String
(Int -> ListServiceTemplates -> ShowS)
-> (ListServiceTemplates -> String)
-> ([ListServiceTemplates] -> ShowS)
-> Show ListServiceTemplates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListServiceTemplates] -> ShowS
$cshowList :: [ListServiceTemplates] -> ShowS
show :: ListServiceTemplates -> String
$cshow :: ListServiceTemplates -> String
showsPrec :: Int -> ListServiceTemplates -> ShowS
$cshowsPrec :: Int -> ListServiceTemplates -> ShowS
Prelude.Show, (forall x. ListServiceTemplates -> Rep ListServiceTemplates x)
-> (forall x. Rep ListServiceTemplates x -> ListServiceTemplates)
-> Generic ListServiceTemplates
forall x. Rep ListServiceTemplates x -> ListServiceTemplates
forall x. ListServiceTemplates -> Rep ListServiceTemplates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListServiceTemplates x -> ListServiceTemplates
$cfrom :: forall x. ListServiceTemplates -> Rep ListServiceTemplates x
Prelude.Generic)

-- |
-- Create a value of 'ListServiceTemplates' 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', 'listServiceTemplates_nextToken' - A token to indicate the location of the next service template in the
-- array of service templates, after the list of service templates
-- previously requested.
--
-- 'maxResults', 'listServiceTemplates_maxResults' - The maximum number of service templates to list.
newListServiceTemplates ::
  ListServiceTemplates
newListServiceTemplates :: ListServiceTemplates
newListServiceTemplates =
  ListServiceTemplates' :: Maybe Text -> Maybe Natural -> ListServiceTemplates
ListServiceTemplates'
    { $sel:nextToken:ListServiceTemplates' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListServiceTemplates' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A token to indicate the location of the next service template in the
-- array of service templates, after the list of service templates
-- previously requested.
listServiceTemplates_nextToken :: Lens.Lens' ListServiceTemplates (Prelude.Maybe Prelude.Text)
listServiceTemplates_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListServiceTemplates -> f ListServiceTemplates
listServiceTemplates_nextToken = (ListServiceTemplates -> Maybe Text)
-> (ListServiceTemplates -> Maybe Text -> ListServiceTemplates)
-> Lens
     ListServiceTemplates ListServiceTemplates (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServiceTemplates' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListServiceTemplates' :: ListServiceTemplates -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListServiceTemplates
s@ListServiceTemplates' {} Maybe Text
a -> ListServiceTemplates
s {$sel:nextToken:ListServiceTemplates' :: Maybe Text
nextToken = Maybe Text
a} :: ListServiceTemplates)

-- | The maximum number of service templates to list.
listServiceTemplates_maxResults :: Lens.Lens' ListServiceTemplates (Prelude.Maybe Prelude.Natural)
listServiceTemplates_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListServiceTemplates -> f ListServiceTemplates
listServiceTemplates_maxResults = (ListServiceTemplates -> Maybe Natural)
-> (ListServiceTemplates -> Maybe Natural -> ListServiceTemplates)
-> Lens
     ListServiceTemplates
     ListServiceTemplates
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServiceTemplates' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListServiceTemplates' :: ListServiceTemplates -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListServiceTemplates
s@ListServiceTemplates' {} Maybe Natural
a -> ListServiceTemplates
s {$sel:maxResults:ListServiceTemplates' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListServiceTemplates)

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

instance Prelude.Hashable ListServiceTemplates

instance Prelude.NFData ListServiceTemplates

instance Core.ToHeaders ListServiceTemplates where
  toHeaders :: ListServiceTemplates -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListServiceTemplates -> 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
"AwsProton20200720.ListServiceTemplates" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ListServiceTemplates where
  toJSON :: ListServiceTemplates -> Value
toJSON ListServiceTemplates' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListServiceTemplates' :: ListServiceTemplates -> Maybe Natural
$sel:nextToken:ListServiceTemplates' :: ListServiceTemplates -> 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
          ]
      )

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

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

-- | /See:/ 'newListServiceTemplatesResponse' smart constructor.
data ListServiceTemplatesResponse = ListServiceTemplatesResponse'
  { -- | A token to indicate the location of the next service template in the
    -- array of service templates, after the current requested list of service
    -- templates.
    ListServiceTemplatesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListServiceTemplatesResponse -> Int
httpStatus :: Prelude.Int,
    -- | An array of service templates with detail data.
    ListServiceTemplatesResponse -> [ServiceTemplateSummary]
templates :: [ServiceTemplateSummary]
  }
  deriving (ListServiceTemplatesResponse
-> ListServiceTemplatesResponse -> Bool
(ListServiceTemplatesResponse
 -> ListServiceTemplatesResponse -> Bool)
-> (ListServiceTemplatesResponse
    -> ListServiceTemplatesResponse -> Bool)
-> Eq ListServiceTemplatesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListServiceTemplatesResponse
-> ListServiceTemplatesResponse -> Bool
$c/= :: ListServiceTemplatesResponse
-> ListServiceTemplatesResponse -> Bool
== :: ListServiceTemplatesResponse
-> ListServiceTemplatesResponse -> Bool
$c== :: ListServiceTemplatesResponse
-> ListServiceTemplatesResponse -> Bool
Prelude.Eq, Int -> ListServiceTemplatesResponse -> ShowS
[ListServiceTemplatesResponse] -> ShowS
ListServiceTemplatesResponse -> String
(Int -> ListServiceTemplatesResponse -> ShowS)
-> (ListServiceTemplatesResponse -> String)
-> ([ListServiceTemplatesResponse] -> ShowS)
-> Show ListServiceTemplatesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListServiceTemplatesResponse] -> ShowS
$cshowList :: [ListServiceTemplatesResponse] -> ShowS
show :: ListServiceTemplatesResponse -> String
$cshow :: ListServiceTemplatesResponse -> String
showsPrec :: Int -> ListServiceTemplatesResponse -> ShowS
$cshowsPrec :: Int -> ListServiceTemplatesResponse -> ShowS
Prelude.Show, (forall x.
 ListServiceTemplatesResponse -> Rep ListServiceTemplatesResponse x)
-> (forall x.
    Rep ListServiceTemplatesResponse x -> ListServiceTemplatesResponse)
-> Generic ListServiceTemplatesResponse
forall x.
Rep ListServiceTemplatesResponse x -> ListServiceTemplatesResponse
forall x.
ListServiceTemplatesResponse -> Rep ListServiceTemplatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListServiceTemplatesResponse x -> ListServiceTemplatesResponse
$cfrom :: forall x.
ListServiceTemplatesResponse -> Rep ListServiceTemplatesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListServiceTemplatesResponse' 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', 'listServiceTemplatesResponse_nextToken' - A token to indicate the location of the next service template in the
-- array of service templates, after the current requested list of service
-- templates.
--
-- 'httpStatus', 'listServiceTemplatesResponse_httpStatus' - The response's http status code.
--
-- 'templates', 'listServiceTemplatesResponse_templates' - An array of service templates with detail data.
newListServiceTemplatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListServiceTemplatesResponse
newListServiceTemplatesResponse :: Int -> ListServiceTemplatesResponse
newListServiceTemplatesResponse Int
pHttpStatus_ =
  ListServiceTemplatesResponse' :: Maybe Text
-> Int -> [ServiceTemplateSummary] -> ListServiceTemplatesResponse
ListServiceTemplatesResponse'
    { $sel:nextToken:ListServiceTemplatesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListServiceTemplatesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:templates:ListServiceTemplatesResponse' :: [ServiceTemplateSummary]
templates = [ServiceTemplateSummary]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A token to indicate the location of the next service template in the
-- array of service templates, after the current requested list of service
-- templates.
listServiceTemplatesResponse_nextToken :: Lens.Lens' ListServiceTemplatesResponse (Prelude.Maybe Prelude.Text)
listServiceTemplatesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListServiceTemplatesResponse -> f ListServiceTemplatesResponse
listServiceTemplatesResponse_nextToken = (ListServiceTemplatesResponse -> Maybe Text)
-> (ListServiceTemplatesResponse
    -> Maybe Text -> ListServiceTemplatesResponse)
-> Lens' ListServiceTemplatesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServiceTemplatesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListServiceTemplatesResponse' :: ListServiceTemplatesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListServiceTemplatesResponse
s@ListServiceTemplatesResponse' {} Maybe Text
a -> ListServiceTemplatesResponse
s {$sel:nextToken:ListServiceTemplatesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListServiceTemplatesResponse)

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

-- | An array of service templates with detail data.
listServiceTemplatesResponse_templates :: Lens.Lens' ListServiceTemplatesResponse [ServiceTemplateSummary]
listServiceTemplatesResponse_templates :: ([ServiceTemplateSummary] -> f [ServiceTemplateSummary])
-> ListServiceTemplatesResponse -> f ListServiceTemplatesResponse
listServiceTemplatesResponse_templates = (ListServiceTemplatesResponse -> [ServiceTemplateSummary])
-> (ListServiceTemplatesResponse
    -> [ServiceTemplateSummary] -> ListServiceTemplatesResponse)
-> Lens' ListServiceTemplatesResponse [ServiceTemplateSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServiceTemplatesResponse' {[ServiceTemplateSummary]
templates :: [ServiceTemplateSummary]
$sel:templates:ListServiceTemplatesResponse' :: ListServiceTemplatesResponse -> [ServiceTemplateSummary]
templates} -> [ServiceTemplateSummary]
templates) (\s :: ListServiceTemplatesResponse
s@ListServiceTemplatesResponse' {} [ServiceTemplateSummary]
a -> ListServiceTemplatesResponse
s {$sel:templates:ListServiceTemplatesResponse' :: [ServiceTemplateSummary]
templates = [ServiceTemplateSummary]
a} :: ListServiceTemplatesResponse) (([ServiceTemplateSummary] -> f [ServiceTemplateSummary])
 -> ListServiceTemplatesResponse -> f ListServiceTemplatesResponse)
-> (([ServiceTemplateSummary] -> f [ServiceTemplateSummary])
    -> [ServiceTemplateSummary] -> f [ServiceTemplateSummary])
-> ([ServiceTemplateSummary] -> f [ServiceTemplateSummary])
-> ListServiceTemplatesResponse
-> f ListServiceTemplatesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ServiceTemplateSummary] -> f [ServiceTemplateSummary])
-> [ServiceTemplateSummary] -> f [ServiceTemplateSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListServiceTemplatesResponse