{-# 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.SearchSystemInstances
-- 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 system instances in the user\'s account.
--
-- This operation returns paginated results.
module Amazonka.IoTThingsGraph.SearchSystemInstances
  ( -- * Creating a Request
    SearchSystemInstances (..),
    newSearchSystemInstances,

    -- * Request Lenses
    searchSystemInstances_filters,
    searchSystemInstances_nextToken,
    searchSystemInstances_maxResults,

    -- * Destructuring the Response
    SearchSystemInstancesResponse (..),
    newSearchSystemInstancesResponse,

    -- * Response Lenses
    searchSystemInstancesResponse_nextToken,
    searchSystemInstancesResponse_summaries,
    searchSystemInstancesResponse_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:/ 'newSearchSystemInstances' smart constructor.
data SearchSystemInstances = SearchSystemInstances'
  { -- | Optional filter to apply to the search. Valid filters are
    -- @SYSTEM_TEMPLATE_ID@, @STATUS@, and @GREENGRASS_GROUP_NAME@.
    --
    -- Multiple filters function as OR criteria in the query. Multiple values
    -- passed inside the filter function as AND criteria.
    SearchSystemInstances -> Maybe [SystemInstanceFilter]
filters :: Prelude.Maybe [SystemInstanceFilter],
    -- | The string that specifies the next page of results. Use this when
    -- you\'re paginating results.
    SearchSystemInstances -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return in the response.
    SearchSystemInstances -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (SearchSystemInstances -> SearchSystemInstances -> Bool
(SearchSystemInstances -> SearchSystemInstances -> Bool)
-> (SearchSystemInstances -> SearchSystemInstances -> Bool)
-> Eq SearchSystemInstances
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchSystemInstances -> SearchSystemInstances -> Bool
$c/= :: SearchSystemInstances -> SearchSystemInstances -> Bool
== :: SearchSystemInstances -> SearchSystemInstances -> Bool
$c== :: SearchSystemInstances -> SearchSystemInstances -> Bool
Prelude.Eq, ReadPrec [SearchSystemInstances]
ReadPrec SearchSystemInstances
Int -> ReadS SearchSystemInstances
ReadS [SearchSystemInstances]
(Int -> ReadS SearchSystemInstances)
-> ReadS [SearchSystemInstances]
-> ReadPrec SearchSystemInstances
-> ReadPrec [SearchSystemInstances]
-> Read SearchSystemInstances
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchSystemInstances]
$creadListPrec :: ReadPrec [SearchSystemInstances]
readPrec :: ReadPrec SearchSystemInstances
$creadPrec :: ReadPrec SearchSystemInstances
readList :: ReadS [SearchSystemInstances]
$creadList :: ReadS [SearchSystemInstances]
readsPrec :: Int -> ReadS SearchSystemInstances
$creadsPrec :: Int -> ReadS SearchSystemInstances
Prelude.Read, Int -> SearchSystemInstances -> ShowS
[SearchSystemInstances] -> ShowS
SearchSystemInstances -> String
(Int -> SearchSystemInstances -> ShowS)
-> (SearchSystemInstances -> String)
-> ([SearchSystemInstances] -> ShowS)
-> Show SearchSystemInstances
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchSystemInstances] -> ShowS
$cshowList :: [SearchSystemInstances] -> ShowS
show :: SearchSystemInstances -> String
$cshow :: SearchSystemInstances -> String
showsPrec :: Int -> SearchSystemInstances -> ShowS
$cshowsPrec :: Int -> SearchSystemInstances -> ShowS
Prelude.Show, (forall x. SearchSystemInstances -> Rep SearchSystemInstances x)
-> (forall x. Rep SearchSystemInstances x -> SearchSystemInstances)
-> Generic SearchSystemInstances
forall x. Rep SearchSystemInstances x -> SearchSystemInstances
forall x. SearchSystemInstances -> Rep SearchSystemInstances x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchSystemInstances x -> SearchSystemInstances
$cfrom :: forall x. SearchSystemInstances -> Rep SearchSystemInstances x
Prelude.Generic)

-- |
-- Create a value of 'SearchSystemInstances' 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', 'searchSystemInstances_filters' - Optional filter to apply to the search. Valid filters are
-- @SYSTEM_TEMPLATE_ID@, @STATUS@, and @GREENGRASS_GROUP_NAME@.
--
-- Multiple filters function as OR criteria in the query. Multiple values
-- passed inside the filter function as AND criteria.
--
-- 'nextToken', 'searchSystemInstances_nextToken' - The string that specifies the next page of results. Use this when
-- you\'re paginating results.
--
-- 'maxResults', 'searchSystemInstances_maxResults' - The maximum number of results to return in the response.
newSearchSystemInstances ::
  SearchSystemInstances
newSearchSystemInstances :: SearchSystemInstances
newSearchSystemInstances =
  SearchSystemInstances' :: Maybe [SystemInstanceFilter]
-> Maybe Text -> Maybe Natural -> SearchSystemInstances
SearchSystemInstances'
    { $sel:filters:SearchSystemInstances' :: Maybe [SystemInstanceFilter]
filters = Maybe [SystemInstanceFilter]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchSystemInstances' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:SearchSystemInstances' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Optional filter to apply to the search. Valid filters are
-- @SYSTEM_TEMPLATE_ID@, @STATUS@, and @GREENGRASS_GROUP_NAME@.
--
-- Multiple filters function as OR criteria in the query. Multiple values
-- passed inside the filter function as AND criteria.
searchSystemInstances_filters :: Lens.Lens' SearchSystemInstances (Prelude.Maybe [SystemInstanceFilter])
searchSystemInstances_filters :: (Maybe [SystemInstanceFilter] -> f (Maybe [SystemInstanceFilter]))
-> SearchSystemInstances -> f SearchSystemInstances
searchSystemInstances_filters = (SearchSystemInstances -> Maybe [SystemInstanceFilter])
-> (SearchSystemInstances
    -> Maybe [SystemInstanceFilter] -> SearchSystemInstances)
-> Lens
     SearchSystemInstances
     SearchSystemInstances
     (Maybe [SystemInstanceFilter])
     (Maybe [SystemInstanceFilter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSystemInstances' {Maybe [SystemInstanceFilter]
filters :: Maybe [SystemInstanceFilter]
$sel:filters:SearchSystemInstances' :: SearchSystemInstances -> Maybe [SystemInstanceFilter]
filters} -> Maybe [SystemInstanceFilter]
filters) (\s :: SearchSystemInstances
s@SearchSystemInstances' {} Maybe [SystemInstanceFilter]
a -> SearchSystemInstances
s {$sel:filters:SearchSystemInstances' :: Maybe [SystemInstanceFilter]
filters = Maybe [SystemInstanceFilter]
a} :: SearchSystemInstances) ((Maybe [SystemInstanceFilter] -> f (Maybe [SystemInstanceFilter]))
 -> SearchSystemInstances -> f SearchSystemInstances)
-> ((Maybe [SystemInstanceFilter]
     -> f (Maybe [SystemInstanceFilter]))
    -> Maybe [SystemInstanceFilter]
    -> f (Maybe [SystemInstanceFilter]))
-> (Maybe [SystemInstanceFilter]
    -> f (Maybe [SystemInstanceFilter]))
-> SearchSystemInstances
-> f SearchSystemInstances
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SystemInstanceFilter]
  [SystemInstanceFilter]
  [SystemInstanceFilter]
  [SystemInstanceFilter]
-> Iso
     (Maybe [SystemInstanceFilter])
     (Maybe [SystemInstanceFilter])
     (Maybe [SystemInstanceFilter])
     (Maybe [SystemInstanceFilter])
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
  [SystemInstanceFilter]
  [SystemInstanceFilter]
  [SystemInstanceFilter]
  [SystemInstanceFilter]
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.
searchSystemInstances_nextToken :: Lens.Lens' SearchSystemInstances (Prelude.Maybe Prelude.Text)
searchSystemInstances_nextToken :: (Maybe Text -> f (Maybe Text))
-> SearchSystemInstances -> f SearchSystemInstances
searchSystemInstances_nextToken = (SearchSystemInstances -> Maybe Text)
-> (SearchSystemInstances -> Maybe Text -> SearchSystemInstances)
-> Lens
     SearchSystemInstances
     SearchSystemInstances
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSystemInstances' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchSystemInstances' :: SearchSystemInstances -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchSystemInstances
s@SearchSystemInstances' {} Maybe Text
a -> SearchSystemInstances
s {$sel:nextToken:SearchSystemInstances' :: Maybe Text
nextToken = Maybe Text
a} :: SearchSystemInstances)

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

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

instance Prelude.NFData SearchSystemInstances

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

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

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

-- |
-- Create a value of 'SearchSystemInstancesResponse' 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', 'searchSystemInstancesResponse_nextToken' - The string to specify as @nextToken@ when you request the next page of
-- results.
--
-- 'summaries', 'searchSystemInstancesResponse_summaries' - An array of objects that contain summary data abour the system instances
-- in the result set.
--
-- 'httpStatus', 'searchSystemInstancesResponse_httpStatus' - The response's http status code.
newSearchSystemInstancesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SearchSystemInstancesResponse
newSearchSystemInstancesResponse :: Int -> SearchSystemInstancesResponse
newSearchSystemInstancesResponse Int
pHttpStatus_ =
  SearchSystemInstancesResponse' :: Maybe Text
-> Maybe [SystemInstanceSummary]
-> Int
-> SearchSystemInstancesResponse
SearchSystemInstancesResponse'
    { $sel:nextToken:SearchSystemInstancesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:summaries:SearchSystemInstancesResponse' :: Maybe [SystemInstanceSummary]
summaries = Maybe [SystemInstanceSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SearchSystemInstancesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | An array of objects that contain summary data abour the system instances
-- in the result set.
searchSystemInstancesResponse_summaries :: Lens.Lens' SearchSystemInstancesResponse (Prelude.Maybe [SystemInstanceSummary])
searchSystemInstancesResponse_summaries :: (Maybe [SystemInstanceSummary]
 -> f (Maybe [SystemInstanceSummary]))
-> SearchSystemInstancesResponse -> f SearchSystemInstancesResponse
searchSystemInstancesResponse_summaries = (SearchSystemInstancesResponse -> Maybe [SystemInstanceSummary])
-> (SearchSystemInstancesResponse
    -> Maybe [SystemInstanceSummary] -> SearchSystemInstancesResponse)
-> Lens'
     SearchSystemInstancesResponse (Maybe [SystemInstanceSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSystemInstancesResponse' {Maybe [SystemInstanceSummary]
summaries :: Maybe [SystemInstanceSummary]
$sel:summaries:SearchSystemInstancesResponse' :: SearchSystemInstancesResponse -> Maybe [SystemInstanceSummary]
summaries} -> Maybe [SystemInstanceSummary]
summaries) (\s :: SearchSystemInstancesResponse
s@SearchSystemInstancesResponse' {} Maybe [SystemInstanceSummary]
a -> SearchSystemInstancesResponse
s {$sel:summaries:SearchSystemInstancesResponse' :: Maybe [SystemInstanceSummary]
summaries = Maybe [SystemInstanceSummary]
a} :: SearchSystemInstancesResponse) ((Maybe [SystemInstanceSummary]
  -> f (Maybe [SystemInstanceSummary]))
 -> SearchSystemInstancesResponse
 -> f SearchSystemInstancesResponse)
-> ((Maybe [SystemInstanceSummary]
     -> f (Maybe [SystemInstanceSummary]))
    -> Maybe [SystemInstanceSummary]
    -> f (Maybe [SystemInstanceSummary]))
-> (Maybe [SystemInstanceSummary]
    -> f (Maybe [SystemInstanceSummary]))
-> SearchSystemInstancesResponse
-> f SearchSystemInstancesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SystemInstanceSummary]
  [SystemInstanceSummary]
  [SystemInstanceSummary]
  [SystemInstanceSummary]
-> Iso
     (Maybe [SystemInstanceSummary])
     (Maybe [SystemInstanceSummary])
     (Maybe [SystemInstanceSummary])
     (Maybe [SystemInstanceSummary])
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
  [SystemInstanceSummary]
  [SystemInstanceSummary]
  [SystemInstanceSummary]
  [SystemInstanceSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData SearchSystemInstancesResponse