{-# 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.Braket.SearchDevices
-- 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 devices using the specified filters.
--
-- This operation returns paginated results.
module Amazonka.Braket.SearchDevices
  ( -- * Creating a Request
    SearchDevices (..),
    newSearchDevices,

    -- * Request Lenses
    searchDevices_nextToken,
    searchDevices_maxResults,
    searchDevices_filters,

    -- * Destructuring the Response
    SearchDevicesResponse (..),
    newSearchDevicesResponse,

    -- * Response Lenses
    searchDevicesResponse_nextToken,
    searchDevicesResponse_httpStatus,
    searchDevicesResponse_devices,
  )
where

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

-- | /See:/ 'newSearchDevices' smart constructor.
data SearchDevices = SearchDevices'
  { -- | A token used for pagination of results returned in the response. Use the
    -- token returned from the previous request continue results where the
    -- previous request ended.
    SearchDevices -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return in the response.
    SearchDevices -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The filter values to use to search for a device.
    SearchDevices -> [SearchDevicesFilter]
filters :: [SearchDevicesFilter]
  }
  deriving (SearchDevices -> SearchDevices -> Bool
(SearchDevices -> SearchDevices -> Bool)
-> (SearchDevices -> SearchDevices -> Bool) -> Eq SearchDevices
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchDevices -> SearchDevices -> Bool
$c/= :: SearchDevices -> SearchDevices -> Bool
== :: SearchDevices -> SearchDevices -> Bool
$c== :: SearchDevices -> SearchDevices -> Bool
Prelude.Eq, ReadPrec [SearchDevices]
ReadPrec SearchDevices
Int -> ReadS SearchDevices
ReadS [SearchDevices]
(Int -> ReadS SearchDevices)
-> ReadS [SearchDevices]
-> ReadPrec SearchDevices
-> ReadPrec [SearchDevices]
-> Read SearchDevices
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchDevices]
$creadListPrec :: ReadPrec [SearchDevices]
readPrec :: ReadPrec SearchDevices
$creadPrec :: ReadPrec SearchDevices
readList :: ReadS [SearchDevices]
$creadList :: ReadS [SearchDevices]
readsPrec :: Int -> ReadS SearchDevices
$creadsPrec :: Int -> ReadS SearchDevices
Prelude.Read, Int -> SearchDevices -> ShowS
[SearchDevices] -> ShowS
SearchDevices -> String
(Int -> SearchDevices -> ShowS)
-> (SearchDevices -> String)
-> ([SearchDevices] -> ShowS)
-> Show SearchDevices
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchDevices] -> ShowS
$cshowList :: [SearchDevices] -> ShowS
show :: SearchDevices -> String
$cshow :: SearchDevices -> String
showsPrec :: Int -> SearchDevices -> ShowS
$cshowsPrec :: Int -> SearchDevices -> ShowS
Prelude.Show, (forall x. SearchDevices -> Rep SearchDevices x)
-> (forall x. Rep SearchDevices x -> SearchDevices)
-> Generic SearchDevices
forall x. Rep SearchDevices x -> SearchDevices
forall x. SearchDevices -> Rep SearchDevices x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchDevices x -> SearchDevices
$cfrom :: forall x. SearchDevices -> Rep SearchDevices x
Prelude.Generic)

-- |
-- Create a value of 'SearchDevices' 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', 'searchDevices_nextToken' - A token used for pagination of results returned in the response. Use the
-- token returned from the previous request continue results where the
-- previous request ended.
--
-- 'maxResults', 'searchDevices_maxResults' - The maximum number of results to return in the response.
--
-- 'filters', 'searchDevices_filters' - The filter values to use to search for a device.
newSearchDevices ::
  SearchDevices
newSearchDevices :: SearchDevices
newSearchDevices =
  SearchDevices' :: Maybe Text
-> Maybe Natural -> [SearchDevicesFilter] -> SearchDevices
SearchDevices'
    { $sel:nextToken:SearchDevices' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:SearchDevices' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:filters:SearchDevices' :: [SearchDevicesFilter]
filters = [SearchDevicesFilter]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A token used for pagination of results returned in the response. Use the
-- token returned from the previous request continue results where the
-- previous request ended.
searchDevices_nextToken :: Lens.Lens' SearchDevices (Prelude.Maybe Prelude.Text)
searchDevices_nextToken :: (Maybe Text -> f (Maybe Text)) -> SearchDevices -> f SearchDevices
searchDevices_nextToken = (SearchDevices -> Maybe Text)
-> (SearchDevices -> Maybe Text -> SearchDevices)
-> Lens SearchDevices SearchDevices (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchDevices' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchDevices' :: SearchDevices -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchDevices
s@SearchDevices' {} Maybe Text
a -> SearchDevices
s {$sel:nextToken:SearchDevices' :: Maybe Text
nextToken = Maybe Text
a} :: SearchDevices)

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

-- | The filter values to use to search for a device.
searchDevices_filters :: Lens.Lens' SearchDevices [SearchDevicesFilter]
searchDevices_filters :: ([SearchDevicesFilter] -> f [SearchDevicesFilter])
-> SearchDevices -> f SearchDevices
searchDevices_filters = (SearchDevices -> [SearchDevicesFilter])
-> (SearchDevices -> [SearchDevicesFilter] -> SearchDevices)
-> Lens
     SearchDevices
     SearchDevices
     [SearchDevicesFilter]
     [SearchDevicesFilter]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchDevices' {[SearchDevicesFilter]
filters :: [SearchDevicesFilter]
$sel:filters:SearchDevices' :: SearchDevices -> [SearchDevicesFilter]
filters} -> [SearchDevicesFilter]
filters) (\s :: SearchDevices
s@SearchDevices' {} [SearchDevicesFilter]
a -> SearchDevices
s {$sel:filters:SearchDevices' :: [SearchDevicesFilter]
filters = [SearchDevicesFilter]
a} :: SearchDevices) (([SearchDevicesFilter] -> f [SearchDevicesFilter])
 -> SearchDevices -> f SearchDevices)
-> (([SearchDevicesFilter] -> f [SearchDevicesFilter])
    -> [SearchDevicesFilter] -> f [SearchDevicesFilter])
-> ([SearchDevicesFilter] -> f [SearchDevicesFilter])
-> SearchDevices
-> f SearchDevices
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SearchDevicesFilter] -> f [SearchDevicesFilter])
-> [SearchDevicesFilter] -> f [SearchDevicesFilter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable SearchDevices

instance Prelude.NFData SearchDevices

instance Core.ToHeaders SearchDevices where
  toHeaders :: SearchDevices -> ResponseHeaders
toHeaders =
    ResponseHeaders -> SearchDevices -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 SearchDevices where
  toJSON :: SearchDevices -> Value
toJSON SearchDevices' {[SearchDevicesFilter]
Maybe Natural
Maybe Text
filters :: [SearchDevicesFilter]
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:filters:SearchDevices' :: SearchDevices -> [SearchDevicesFilter]
$sel:maxResults:SearchDevices' :: SearchDevices -> Maybe Natural
$sel:nextToken:SearchDevices' :: SearchDevices -> 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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"filters" Text -> [SearchDevicesFilter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [SearchDevicesFilter]
filters)
          ]
      )

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

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

-- | /See:/ 'newSearchDevicesResponse' smart constructor.
data SearchDevicesResponse = SearchDevicesResponse'
  { -- | A token used for pagination of results, or null if there are no
    -- additional results. Use the token value in a subsequent request to
    -- continue results where the previous request ended.
    SearchDevicesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    SearchDevicesResponse -> Int
httpStatus :: Prelude.Int,
    -- | An array of @DeviceSummary@ objects for devices that match the specified
    -- filter values.
    SearchDevicesResponse -> [DeviceSummary]
devices :: [DeviceSummary]
  }
  deriving (SearchDevicesResponse -> SearchDevicesResponse -> Bool
(SearchDevicesResponse -> SearchDevicesResponse -> Bool)
-> (SearchDevicesResponse -> SearchDevicesResponse -> Bool)
-> Eq SearchDevicesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchDevicesResponse -> SearchDevicesResponse -> Bool
$c/= :: SearchDevicesResponse -> SearchDevicesResponse -> Bool
== :: SearchDevicesResponse -> SearchDevicesResponse -> Bool
$c== :: SearchDevicesResponse -> SearchDevicesResponse -> Bool
Prelude.Eq, ReadPrec [SearchDevicesResponse]
ReadPrec SearchDevicesResponse
Int -> ReadS SearchDevicesResponse
ReadS [SearchDevicesResponse]
(Int -> ReadS SearchDevicesResponse)
-> ReadS [SearchDevicesResponse]
-> ReadPrec SearchDevicesResponse
-> ReadPrec [SearchDevicesResponse]
-> Read SearchDevicesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchDevicesResponse]
$creadListPrec :: ReadPrec [SearchDevicesResponse]
readPrec :: ReadPrec SearchDevicesResponse
$creadPrec :: ReadPrec SearchDevicesResponse
readList :: ReadS [SearchDevicesResponse]
$creadList :: ReadS [SearchDevicesResponse]
readsPrec :: Int -> ReadS SearchDevicesResponse
$creadsPrec :: Int -> ReadS SearchDevicesResponse
Prelude.Read, Int -> SearchDevicesResponse -> ShowS
[SearchDevicesResponse] -> ShowS
SearchDevicesResponse -> String
(Int -> SearchDevicesResponse -> ShowS)
-> (SearchDevicesResponse -> String)
-> ([SearchDevicesResponse] -> ShowS)
-> Show SearchDevicesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchDevicesResponse] -> ShowS
$cshowList :: [SearchDevicesResponse] -> ShowS
show :: SearchDevicesResponse -> String
$cshow :: SearchDevicesResponse -> String
showsPrec :: Int -> SearchDevicesResponse -> ShowS
$cshowsPrec :: Int -> SearchDevicesResponse -> ShowS
Prelude.Show, (forall x. SearchDevicesResponse -> Rep SearchDevicesResponse x)
-> (forall x. Rep SearchDevicesResponse x -> SearchDevicesResponse)
-> Generic SearchDevicesResponse
forall x. Rep SearchDevicesResponse x -> SearchDevicesResponse
forall x. SearchDevicesResponse -> Rep SearchDevicesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchDevicesResponse x -> SearchDevicesResponse
$cfrom :: forall x. SearchDevicesResponse -> Rep SearchDevicesResponse x
Prelude.Generic)

-- |
-- Create a value of 'SearchDevicesResponse' 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', 'searchDevicesResponse_nextToken' - A token used for pagination of results, or null if there are no
-- additional results. Use the token value in a subsequent request to
-- continue results where the previous request ended.
--
-- 'httpStatus', 'searchDevicesResponse_httpStatus' - The response's http status code.
--
-- 'devices', 'searchDevicesResponse_devices' - An array of @DeviceSummary@ objects for devices that match the specified
-- filter values.
newSearchDevicesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SearchDevicesResponse
newSearchDevicesResponse :: Int -> SearchDevicesResponse
newSearchDevicesResponse Int
pHttpStatus_ =
  SearchDevicesResponse' :: Maybe Text -> Int -> [DeviceSummary] -> SearchDevicesResponse
SearchDevicesResponse'
    { $sel:nextToken:SearchDevicesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SearchDevicesResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:devices:SearchDevicesResponse' :: [DeviceSummary]
devices = [DeviceSummary]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A token used for pagination of results, or null if there are no
-- additional results. Use the token value in a subsequent request to
-- continue results where the previous request ended.
searchDevicesResponse_nextToken :: Lens.Lens' SearchDevicesResponse (Prelude.Maybe Prelude.Text)
searchDevicesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> SearchDevicesResponse -> f SearchDevicesResponse
searchDevicesResponse_nextToken = (SearchDevicesResponse -> Maybe Text)
-> (SearchDevicesResponse -> Maybe Text -> SearchDevicesResponse)
-> Lens' SearchDevicesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchDevicesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchDevicesResponse' :: SearchDevicesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchDevicesResponse
s@SearchDevicesResponse' {} Maybe Text
a -> SearchDevicesResponse
s {$sel:nextToken:SearchDevicesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: SearchDevicesResponse)

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

-- | An array of @DeviceSummary@ objects for devices that match the specified
-- filter values.
searchDevicesResponse_devices :: Lens.Lens' SearchDevicesResponse [DeviceSummary]
searchDevicesResponse_devices :: ([DeviceSummary] -> f [DeviceSummary])
-> SearchDevicesResponse -> f SearchDevicesResponse
searchDevicesResponse_devices = (SearchDevicesResponse -> [DeviceSummary])
-> (SearchDevicesResponse
    -> [DeviceSummary] -> SearchDevicesResponse)
-> Lens' SearchDevicesResponse [DeviceSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchDevicesResponse' {[DeviceSummary]
devices :: [DeviceSummary]
$sel:devices:SearchDevicesResponse' :: SearchDevicesResponse -> [DeviceSummary]
devices} -> [DeviceSummary]
devices) (\s :: SearchDevicesResponse
s@SearchDevicesResponse' {} [DeviceSummary]
a -> SearchDevicesResponse
s {$sel:devices:SearchDevicesResponse' :: [DeviceSummary]
devices = [DeviceSummary]
a} :: SearchDevicesResponse) (([DeviceSummary] -> f [DeviceSummary])
 -> SearchDevicesResponse -> f SearchDevicesResponse)
-> (([DeviceSummary] -> f [DeviceSummary])
    -> [DeviceSummary] -> f [DeviceSummary])
-> ([DeviceSummary] -> f [DeviceSummary])
-> SearchDevicesResponse
-> f SearchDevicesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DeviceSummary] -> f [DeviceSummary])
-> [DeviceSummary] -> f [DeviceSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData SearchDevicesResponse