{-# 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.SearchFlowTemplates
-- 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 workflows.
--
-- This operation returns paginated results.
module Amazonka.IoTThingsGraph.SearchFlowTemplates
  ( -- * Creating a Request
    SearchFlowTemplates (..),
    newSearchFlowTemplates,

    -- * Request Lenses
    searchFlowTemplates_filters,
    searchFlowTemplates_nextToken,
    searchFlowTemplates_maxResults,

    -- * Destructuring the Response
    SearchFlowTemplatesResponse (..),
    newSearchFlowTemplatesResponse,

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

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

-- | An array of objects that limit the result set. The only valid filter is
-- @DEVICE_MODEL_ID@.
searchFlowTemplates_filters :: Lens.Lens' SearchFlowTemplates (Prelude.Maybe [FlowTemplateFilter])
searchFlowTemplates_filters :: (Maybe [FlowTemplateFilter] -> f (Maybe [FlowTemplateFilter]))
-> SearchFlowTemplates -> f SearchFlowTemplates
searchFlowTemplates_filters = (SearchFlowTemplates -> Maybe [FlowTemplateFilter])
-> (SearchFlowTemplates
    -> Maybe [FlowTemplateFilter] -> SearchFlowTemplates)
-> Lens
     SearchFlowTemplates
     SearchFlowTemplates
     (Maybe [FlowTemplateFilter])
     (Maybe [FlowTemplateFilter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchFlowTemplates' {Maybe [FlowTemplateFilter]
filters :: Maybe [FlowTemplateFilter]
$sel:filters:SearchFlowTemplates' :: SearchFlowTemplates -> Maybe [FlowTemplateFilter]
filters} -> Maybe [FlowTemplateFilter]
filters) (\s :: SearchFlowTemplates
s@SearchFlowTemplates' {} Maybe [FlowTemplateFilter]
a -> SearchFlowTemplates
s {$sel:filters:SearchFlowTemplates' :: Maybe [FlowTemplateFilter]
filters = Maybe [FlowTemplateFilter]
a} :: SearchFlowTemplates) ((Maybe [FlowTemplateFilter] -> f (Maybe [FlowTemplateFilter]))
 -> SearchFlowTemplates -> f SearchFlowTemplates)
-> ((Maybe [FlowTemplateFilter] -> f (Maybe [FlowTemplateFilter]))
    -> Maybe [FlowTemplateFilter] -> f (Maybe [FlowTemplateFilter]))
-> (Maybe [FlowTemplateFilter] -> f (Maybe [FlowTemplateFilter]))
-> SearchFlowTemplates
-> f SearchFlowTemplates
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FlowTemplateFilter]
  [FlowTemplateFilter]
  [FlowTemplateFilter]
  [FlowTemplateFilter]
-> Iso
     (Maybe [FlowTemplateFilter])
     (Maybe [FlowTemplateFilter])
     (Maybe [FlowTemplateFilter])
     (Maybe [FlowTemplateFilter])
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
  [FlowTemplateFilter]
  [FlowTemplateFilter]
  [FlowTemplateFilter]
  [FlowTemplateFilter]
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.
searchFlowTemplates_nextToken :: Lens.Lens' SearchFlowTemplates (Prelude.Maybe Prelude.Text)
searchFlowTemplates_nextToken :: (Maybe Text -> f (Maybe Text))
-> SearchFlowTemplates -> f SearchFlowTemplates
searchFlowTemplates_nextToken = (SearchFlowTemplates -> Maybe Text)
-> (SearchFlowTemplates -> Maybe Text -> SearchFlowTemplates)
-> Lens
     SearchFlowTemplates SearchFlowTemplates (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchFlowTemplates' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchFlowTemplates' :: SearchFlowTemplates -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchFlowTemplates
s@SearchFlowTemplates' {} Maybe Text
a -> SearchFlowTemplates
s {$sel:nextToken:SearchFlowTemplates' :: Maybe Text
nextToken = Maybe Text
a} :: SearchFlowTemplates)

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

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

instance Prelude.NFData SearchFlowTemplates

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

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

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

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

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

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

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

instance Prelude.NFData SearchFlowTemplatesResponse