{-# 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.SearchSystemTemplates
-- 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)
--
-- Searches for summary information about systems in the user\'s account.
-- You can filter by the ID of a workflow to return only systems that use
-- the specified workflow.
--
-- This operation returns paginated results.
module Amazonka.IoTThingsGraph.SearchSystemTemplates
  ( -- * Creating a Request
    SearchSystemTemplates (..),
    newSearchSystemTemplates,

    -- * Request Lenses
    searchSystemTemplates_filters,
    searchSystemTemplates_nextToken,
    searchSystemTemplates_maxResults,

    -- * Destructuring the Response
    SearchSystemTemplatesResponse (..),
    newSearchSystemTemplatesResponse,

    -- * Response Lenses
    searchSystemTemplatesResponse_nextToken,
    searchSystemTemplatesResponse_summaries,
    searchSystemTemplatesResponse_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:/ 'newSearchSystemTemplates' smart constructor.
data SearchSystemTemplates = SearchSystemTemplates'
  { -- | An array of filters that limit the result set. The only valid filter is
    -- @FLOW_TEMPLATE_ID@.
    SearchSystemTemplates -> Maybe [SystemTemplateFilter]
filters :: Prelude.Maybe [SystemTemplateFilter],
    -- | The string that specifies the next page of results. Use this when
    -- you\'re paginating results.
    SearchSystemTemplates -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return in the response.
    SearchSystemTemplates -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (SearchSystemTemplates -> SearchSystemTemplates -> Bool
(SearchSystemTemplates -> SearchSystemTemplates -> Bool)
-> (SearchSystemTemplates -> SearchSystemTemplates -> Bool)
-> Eq SearchSystemTemplates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchSystemTemplates -> SearchSystemTemplates -> Bool
$c/= :: SearchSystemTemplates -> SearchSystemTemplates -> Bool
== :: SearchSystemTemplates -> SearchSystemTemplates -> Bool
$c== :: SearchSystemTemplates -> SearchSystemTemplates -> Bool
Prelude.Eq, ReadPrec [SearchSystemTemplates]
ReadPrec SearchSystemTemplates
Int -> ReadS SearchSystemTemplates
ReadS [SearchSystemTemplates]
(Int -> ReadS SearchSystemTemplates)
-> ReadS [SearchSystemTemplates]
-> ReadPrec SearchSystemTemplates
-> ReadPrec [SearchSystemTemplates]
-> Read SearchSystemTemplates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchSystemTemplates]
$creadListPrec :: ReadPrec [SearchSystemTemplates]
readPrec :: ReadPrec SearchSystemTemplates
$creadPrec :: ReadPrec SearchSystemTemplates
readList :: ReadS [SearchSystemTemplates]
$creadList :: ReadS [SearchSystemTemplates]
readsPrec :: Int -> ReadS SearchSystemTemplates
$creadsPrec :: Int -> ReadS SearchSystemTemplates
Prelude.Read, Int -> SearchSystemTemplates -> ShowS
[SearchSystemTemplates] -> ShowS
SearchSystemTemplates -> String
(Int -> SearchSystemTemplates -> ShowS)
-> (SearchSystemTemplates -> String)
-> ([SearchSystemTemplates] -> ShowS)
-> Show SearchSystemTemplates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchSystemTemplates] -> ShowS
$cshowList :: [SearchSystemTemplates] -> ShowS
show :: SearchSystemTemplates -> String
$cshow :: SearchSystemTemplates -> String
showsPrec :: Int -> SearchSystemTemplates -> ShowS
$cshowsPrec :: Int -> SearchSystemTemplates -> ShowS
Prelude.Show, (forall x. SearchSystemTemplates -> Rep SearchSystemTemplates x)
-> (forall x. Rep SearchSystemTemplates x -> SearchSystemTemplates)
-> Generic SearchSystemTemplates
forall x. Rep SearchSystemTemplates x -> SearchSystemTemplates
forall x. SearchSystemTemplates -> Rep SearchSystemTemplates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchSystemTemplates x -> SearchSystemTemplates
$cfrom :: forall x. SearchSystemTemplates -> Rep SearchSystemTemplates x
Prelude.Generic)

-- |
-- Create a value of 'SearchSystemTemplates' 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:
--
-- 'filters', 'searchSystemTemplates_filters' - An array of filters that limit the result set. The only valid filter is
-- @FLOW_TEMPLATE_ID@.
--
-- 'nextToken', 'searchSystemTemplates_nextToken' - The string that specifies the next page of results. Use this when
-- you\'re paginating results.
--
-- 'maxResults', 'searchSystemTemplates_maxResults' - The maximum number of results to return in the response.
newSearchSystemTemplates ::
  SearchSystemTemplates
newSearchSystemTemplates :: SearchSystemTemplates
newSearchSystemTemplates =
  SearchSystemTemplates' :: Maybe [SystemTemplateFilter]
-> Maybe Text -> Maybe Natural -> SearchSystemTemplates
SearchSystemTemplates'
    { $sel:filters:SearchSystemTemplates' :: Maybe [SystemTemplateFilter]
filters = Maybe [SystemTemplateFilter]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchSystemTemplates' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:SearchSystemTemplates' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | An array of filters that limit the result set. The only valid filter is
-- @FLOW_TEMPLATE_ID@.
searchSystemTemplates_filters :: Lens.Lens' SearchSystemTemplates (Prelude.Maybe [SystemTemplateFilter])
searchSystemTemplates_filters :: (Maybe [SystemTemplateFilter] -> f (Maybe [SystemTemplateFilter]))
-> SearchSystemTemplates -> f SearchSystemTemplates
searchSystemTemplates_filters = (SearchSystemTemplates -> Maybe [SystemTemplateFilter])
-> (SearchSystemTemplates
    -> Maybe [SystemTemplateFilter] -> SearchSystemTemplates)
-> Lens
     SearchSystemTemplates
     SearchSystemTemplates
     (Maybe [SystemTemplateFilter])
     (Maybe [SystemTemplateFilter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSystemTemplates' {Maybe [SystemTemplateFilter]
filters :: Maybe [SystemTemplateFilter]
$sel:filters:SearchSystemTemplates' :: SearchSystemTemplates -> Maybe [SystemTemplateFilter]
filters} -> Maybe [SystemTemplateFilter]
filters) (\s :: SearchSystemTemplates
s@SearchSystemTemplates' {} Maybe [SystemTemplateFilter]
a -> SearchSystemTemplates
s {$sel:filters:SearchSystemTemplates' :: Maybe [SystemTemplateFilter]
filters = Maybe [SystemTemplateFilter]
a} :: SearchSystemTemplates) ((Maybe [SystemTemplateFilter] -> f (Maybe [SystemTemplateFilter]))
 -> SearchSystemTemplates -> f SearchSystemTemplates)
-> ((Maybe [SystemTemplateFilter]
     -> f (Maybe [SystemTemplateFilter]))
    -> Maybe [SystemTemplateFilter]
    -> f (Maybe [SystemTemplateFilter]))
-> (Maybe [SystemTemplateFilter]
    -> f (Maybe [SystemTemplateFilter]))
-> SearchSystemTemplates
-> f SearchSystemTemplates
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SystemTemplateFilter]
  [SystemTemplateFilter]
  [SystemTemplateFilter]
  [SystemTemplateFilter]
-> Iso
     (Maybe [SystemTemplateFilter])
     (Maybe [SystemTemplateFilter])
     (Maybe [SystemTemplateFilter])
     (Maybe [SystemTemplateFilter])
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
  [SystemTemplateFilter]
  [SystemTemplateFilter]
  [SystemTemplateFilter]
  [SystemTemplateFilter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

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

instance Prelude.NFData SearchSystemTemplates

instance Core.ToHeaders SearchSystemTemplates where
  toHeaders :: SearchSystemTemplates -> ResponseHeaders
toHeaders =
    ResponseHeaders -> SearchSystemTemplates -> 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.SearchSystemTemplates" ::
                          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 SearchSystemTemplates where
  toJSON :: SearchSystemTemplates -> Value
toJSON SearchSystemTemplates' {Maybe Natural
Maybe [SystemTemplateFilter]
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
filters :: Maybe [SystemTemplateFilter]
$sel:maxResults:SearchSystemTemplates' :: SearchSystemTemplates -> Maybe Natural
$sel:nextToken:SearchSystemTemplates' :: SearchSystemTemplates -> Maybe Text
$sel:filters:SearchSystemTemplates' :: SearchSystemTemplates -> Maybe [SystemTemplateFilter]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"filters" Text -> [SystemTemplateFilter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([SystemTemplateFilter] -> Pair)
-> Maybe [SystemTemplateFilter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SystemTemplateFilter]
filters,
            (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 SearchSystemTemplates where
  toPath :: SearchSystemTemplates -> ByteString
toPath = ByteString -> SearchSystemTemplates -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'SearchSystemTemplatesResponse' 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', 'searchSystemTemplatesResponse_nextToken' - The string to specify as @nextToken@ when you request the next page of
-- results.
--
-- 'summaries', 'searchSystemTemplatesResponse_summaries' - An array of objects that contain summary information about each system
-- deployment in the result set.
--
-- 'httpStatus', 'searchSystemTemplatesResponse_httpStatus' - The response's http status code.
newSearchSystemTemplatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SearchSystemTemplatesResponse
newSearchSystemTemplatesResponse :: Int -> SearchSystemTemplatesResponse
newSearchSystemTemplatesResponse Int
pHttpStatus_ =
  SearchSystemTemplatesResponse' :: Maybe Text
-> Maybe [SystemTemplateSummary]
-> Int
-> SearchSystemTemplatesResponse
SearchSystemTemplatesResponse'
    { $sel:nextToken:SearchSystemTemplatesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:summaries:SearchSystemTemplatesResponse' :: Maybe [SystemTemplateSummary]
summaries = Maybe [SystemTemplateSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SearchSystemTemplatesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | An array of objects that contain summary information about each system
-- deployment in the result set.
searchSystemTemplatesResponse_summaries :: Lens.Lens' SearchSystemTemplatesResponse (Prelude.Maybe [SystemTemplateSummary])
searchSystemTemplatesResponse_summaries :: (Maybe [SystemTemplateSummary]
 -> f (Maybe [SystemTemplateSummary]))
-> SearchSystemTemplatesResponse -> f SearchSystemTemplatesResponse
searchSystemTemplatesResponse_summaries = (SearchSystemTemplatesResponse -> Maybe [SystemTemplateSummary])
-> (SearchSystemTemplatesResponse
    -> Maybe [SystemTemplateSummary] -> SearchSystemTemplatesResponse)
-> Lens'
     SearchSystemTemplatesResponse (Maybe [SystemTemplateSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSystemTemplatesResponse' {Maybe [SystemTemplateSummary]
summaries :: Maybe [SystemTemplateSummary]
$sel:summaries:SearchSystemTemplatesResponse' :: SearchSystemTemplatesResponse -> Maybe [SystemTemplateSummary]
summaries} -> Maybe [SystemTemplateSummary]
summaries) (\s :: SearchSystemTemplatesResponse
s@SearchSystemTemplatesResponse' {} Maybe [SystemTemplateSummary]
a -> SearchSystemTemplatesResponse
s {$sel:summaries:SearchSystemTemplatesResponse' :: Maybe [SystemTemplateSummary]
summaries = Maybe [SystemTemplateSummary]
a} :: SearchSystemTemplatesResponse) ((Maybe [SystemTemplateSummary]
  -> f (Maybe [SystemTemplateSummary]))
 -> SearchSystemTemplatesResponse
 -> f SearchSystemTemplatesResponse)
-> ((Maybe [SystemTemplateSummary]
     -> f (Maybe [SystemTemplateSummary]))
    -> Maybe [SystemTemplateSummary]
    -> f (Maybe [SystemTemplateSummary]))
-> (Maybe [SystemTemplateSummary]
    -> f (Maybe [SystemTemplateSummary]))
-> SearchSystemTemplatesResponse
-> f SearchSystemTemplatesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SystemTemplateSummary]
  [SystemTemplateSummary]
  [SystemTemplateSummary]
  [SystemTemplateSummary]
-> Iso
     (Maybe [SystemTemplateSummary])
     (Maybe [SystemTemplateSummary])
     (Maybe [SystemTemplateSummary])
     (Maybe [SystemTemplateSummary])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [SystemTemplateSummary]
  [SystemTemplateSummary]
  [SystemTemplateSummary]
  [SystemTemplateSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData SearchSystemTemplatesResponse