{-# 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.SnowDeviceManagement.ListDevices
-- 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)
--
-- Returns a list of all devices on your Amazon Web Services account that
-- have Amazon Web Services Snow Device Management enabled in the Amazon
-- Web Services Region where the command is run.
--
-- This operation returns paginated results.
module Amazonka.SnowDeviceManagement.ListDevices
  ( -- * Creating a Request
    ListDevices (..),
    newListDevices,

    -- * Request Lenses
    listDevices_jobId,
    listDevices_nextToken,
    listDevices_maxResults,

    -- * Destructuring the Response
    ListDevicesResponse (..),
    newListDevicesResponse,

    -- * Response Lenses
    listDevicesResponse_nextToken,
    listDevicesResponse_devices,
    listDevicesResponse_httpStatus,
  )
where

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
import Amazonka.SnowDeviceManagement.Types

-- | /See:/ 'newListDevices' smart constructor.
data ListDevices = ListDevices'
  { -- | The ID of the job used to order the device.
    ListDevices -> Maybe Text
jobId :: Prelude.Maybe Prelude.Text,
    -- | A pagination token to continue to the next page of results.
    ListDevices -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of devices to list per page.
    ListDevices -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListDevices -> ListDevices -> Bool
(ListDevices -> ListDevices -> Bool)
-> (ListDevices -> ListDevices -> Bool) -> Eq ListDevices
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDevices -> ListDevices -> Bool
$c/= :: ListDevices -> ListDevices -> Bool
== :: ListDevices -> ListDevices -> Bool
$c== :: ListDevices -> ListDevices -> Bool
Prelude.Eq, ReadPrec [ListDevices]
ReadPrec ListDevices
Int -> ReadS ListDevices
ReadS [ListDevices]
(Int -> ReadS ListDevices)
-> ReadS [ListDevices]
-> ReadPrec ListDevices
-> ReadPrec [ListDevices]
-> Read ListDevices
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDevices]
$creadListPrec :: ReadPrec [ListDevices]
readPrec :: ReadPrec ListDevices
$creadPrec :: ReadPrec ListDevices
readList :: ReadS [ListDevices]
$creadList :: ReadS [ListDevices]
readsPrec :: Int -> ReadS ListDevices
$creadsPrec :: Int -> ReadS ListDevices
Prelude.Read, Int -> ListDevices -> ShowS
[ListDevices] -> ShowS
ListDevices -> String
(Int -> ListDevices -> ShowS)
-> (ListDevices -> String)
-> ([ListDevices] -> ShowS)
-> Show ListDevices
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDevices] -> ShowS
$cshowList :: [ListDevices] -> ShowS
show :: ListDevices -> String
$cshow :: ListDevices -> String
showsPrec :: Int -> ListDevices -> ShowS
$cshowsPrec :: Int -> ListDevices -> ShowS
Prelude.Show, (forall x. ListDevices -> Rep ListDevices x)
-> (forall x. Rep ListDevices x -> ListDevices)
-> Generic ListDevices
forall x. Rep ListDevices x -> ListDevices
forall x. ListDevices -> Rep ListDevices x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDevices x -> ListDevices
$cfrom :: forall x. ListDevices -> Rep ListDevices x
Prelude.Generic)

-- |
-- Create a value of 'ListDevices' 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:
--
-- 'jobId', 'listDevices_jobId' - The ID of the job used to order the device.
--
-- 'nextToken', 'listDevices_nextToken' - A pagination token to continue to the next page of results.
--
-- 'maxResults', 'listDevices_maxResults' - The maximum number of devices to list per page.
newListDevices ::
  ListDevices
newListDevices :: ListDevices
newListDevices =
  ListDevices' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListDevices
ListDevices'
    { $sel:jobId:ListDevices' :: Maybe Text
jobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDevices' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDevices' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the job used to order the device.
listDevices_jobId :: Lens.Lens' ListDevices (Prelude.Maybe Prelude.Text)
listDevices_jobId :: (Maybe Text -> f (Maybe Text)) -> ListDevices -> f ListDevices
listDevices_jobId = (ListDevices -> Maybe Text)
-> (ListDevices -> Maybe Text -> ListDevices)
-> Lens ListDevices ListDevices (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevices' {Maybe Text
jobId :: Maybe Text
$sel:jobId:ListDevices' :: ListDevices -> Maybe Text
jobId} -> Maybe Text
jobId) (\s :: ListDevices
s@ListDevices' {} Maybe Text
a -> ListDevices
s {$sel:jobId:ListDevices' :: Maybe Text
jobId = Maybe Text
a} :: ListDevices)

-- | A pagination token to continue to the next page of results.
listDevices_nextToken :: Lens.Lens' ListDevices (Prelude.Maybe Prelude.Text)
listDevices_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListDevices -> f ListDevices
listDevices_nextToken = (ListDevices -> Maybe Text)
-> (ListDevices -> Maybe Text -> ListDevices)
-> Lens ListDevices ListDevices (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevices' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDevices' :: ListDevices -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDevices
s@ListDevices' {} Maybe Text
a -> ListDevices
s {$sel:nextToken:ListDevices' :: Maybe Text
nextToken = Maybe Text
a} :: ListDevices)

-- | The maximum number of devices to list per page.
listDevices_maxResults :: Lens.Lens' ListDevices (Prelude.Maybe Prelude.Natural)
listDevices_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDevices -> f ListDevices
listDevices_maxResults = (ListDevices -> Maybe Natural)
-> (ListDevices -> Maybe Natural -> ListDevices)
-> Lens ListDevices ListDevices (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevices' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDevices' :: ListDevices -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDevices
s@ListDevices' {} Maybe Natural
a -> ListDevices
s {$sel:maxResults:ListDevices' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDevices)

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

instance Prelude.NFData ListDevices

instance Core.ToHeaders ListDevices where
  toHeaders :: ListDevices -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListDevices -> 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.ToPath ListDevices where
  toPath :: ListDevices -> ByteString
toPath = ByteString -> ListDevices -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/managed-devices"

instance Core.ToQuery ListDevices where
  toQuery :: ListDevices -> QueryString
toQuery ListDevices' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
jobId :: Maybe Text
$sel:maxResults:ListDevices' :: ListDevices -> Maybe Natural
$sel:nextToken:ListDevices' :: ListDevices -> Maybe Text
$sel:jobId:ListDevices' :: ListDevices -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"jobId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
jobId,
        ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListDevicesResponse' smart constructor.
data ListDevicesResponse = ListDevicesResponse'
  { -- | A pagination token to continue to the next page of devices.
    ListDevicesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of device structures that contain information about the device.
    ListDevicesResponse -> Maybe [DeviceSummary]
devices :: Prelude.Maybe [DeviceSummary],
    -- | The response's http status code.
    ListDevicesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDevicesResponse -> ListDevicesResponse -> Bool
(ListDevicesResponse -> ListDevicesResponse -> Bool)
-> (ListDevicesResponse -> ListDevicesResponse -> Bool)
-> Eq ListDevicesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDevicesResponse -> ListDevicesResponse -> Bool
$c/= :: ListDevicesResponse -> ListDevicesResponse -> Bool
== :: ListDevicesResponse -> ListDevicesResponse -> Bool
$c== :: ListDevicesResponse -> ListDevicesResponse -> Bool
Prelude.Eq, ReadPrec [ListDevicesResponse]
ReadPrec ListDevicesResponse
Int -> ReadS ListDevicesResponse
ReadS [ListDevicesResponse]
(Int -> ReadS ListDevicesResponse)
-> ReadS [ListDevicesResponse]
-> ReadPrec ListDevicesResponse
-> ReadPrec [ListDevicesResponse]
-> Read ListDevicesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDevicesResponse]
$creadListPrec :: ReadPrec [ListDevicesResponse]
readPrec :: ReadPrec ListDevicesResponse
$creadPrec :: ReadPrec ListDevicesResponse
readList :: ReadS [ListDevicesResponse]
$creadList :: ReadS [ListDevicesResponse]
readsPrec :: Int -> ReadS ListDevicesResponse
$creadsPrec :: Int -> ReadS ListDevicesResponse
Prelude.Read, Int -> ListDevicesResponse -> ShowS
[ListDevicesResponse] -> ShowS
ListDevicesResponse -> String
(Int -> ListDevicesResponse -> ShowS)
-> (ListDevicesResponse -> String)
-> ([ListDevicesResponse] -> ShowS)
-> Show ListDevicesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDevicesResponse] -> ShowS
$cshowList :: [ListDevicesResponse] -> ShowS
show :: ListDevicesResponse -> String
$cshow :: ListDevicesResponse -> String
showsPrec :: Int -> ListDevicesResponse -> ShowS
$cshowsPrec :: Int -> ListDevicesResponse -> ShowS
Prelude.Show, (forall x. ListDevicesResponse -> Rep ListDevicesResponse x)
-> (forall x. Rep ListDevicesResponse x -> ListDevicesResponse)
-> Generic ListDevicesResponse
forall x. Rep ListDevicesResponse x -> ListDevicesResponse
forall x. ListDevicesResponse -> Rep ListDevicesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDevicesResponse x -> ListDevicesResponse
$cfrom :: forall x. ListDevicesResponse -> Rep ListDevicesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDevicesResponse' 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', 'listDevicesResponse_nextToken' - A pagination token to continue to the next page of devices.
--
-- 'devices', 'listDevicesResponse_devices' - A list of device structures that contain information about the device.
--
-- 'httpStatus', 'listDevicesResponse_httpStatus' - The response's http status code.
newListDevicesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDevicesResponse
newListDevicesResponse :: Int -> ListDevicesResponse
newListDevicesResponse Int
pHttpStatus_ =
  ListDevicesResponse' :: Maybe Text -> Maybe [DeviceSummary] -> Int -> ListDevicesResponse
ListDevicesResponse'
    { $sel:nextToken:ListDevicesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:devices:ListDevicesResponse' :: Maybe [DeviceSummary]
devices = Maybe [DeviceSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDevicesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A pagination token to continue to the next page of devices.
listDevicesResponse_nextToken :: Lens.Lens' ListDevicesResponse (Prelude.Maybe Prelude.Text)
listDevicesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDevicesResponse -> f ListDevicesResponse
listDevicesResponse_nextToken = (ListDevicesResponse -> Maybe Text)
-> (ListDevicesResponse -> Maybe Text -> ListDevicesResponse)
-> Lens' ListDevicesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevicesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDevicesResponse' :: ListDevicesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDevicesResponse
s@ListDevicesResponse' {} Maybe Text
a -> ListDevicesResponse
s {$sel:nextToken:ListDevicesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDevicesResponse)

-- | A list of device structures that contain information about the device.
listDevicesResponse_devices :: Lens.Lens' ListDevicesResponse (Prelude.Maybe [DeviceSummary])
listDevicesResponse_devices :: (Maybe [DeviceSummary] -> f (Maybe [DeviceSummary]))
-> ListDevicesResponse -> f ListDevicesResponse
listDevicesResponse_devices = (ListDevicesResponse -> Maybe [DeviceSummary])
-> (ListDevicesResponse
    -> Maybe [DeviceSummary] -> ListDevicesResponse)
-> Lens' ListDevicesResponse (Maybe [DeviceSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevicesResponse' {Maybe [DeviceSummary]
devices :: Maybe [DeviceSummary]
$sel:devices:ListDevicesResponse' :: ListDevicesResponse -> Maybe [DeviceSummary]
devices} -> Maybe [DeviceSummary]
devices) (\s :: ListDevicesResponse
s@ListDevicesResponse' {} Maybe [DeviceSummary]
a -> ListDevicesResponse
s {$sel:devices:ListDevicesResponse' :: Maybe [DeviceSummary]
devices = Maybe [DeviceSummary]
a} :: ListDevicesResponse) ((Maybe [DeviceSummary] -> f (Maybe [DeviceSummary]))
 -> ListDevicesResponse -> f ListDevicesResponse)
-> ((Maybe [DeviceSummary] -> f (Maybe [DeviceSummary]))
    -> Maybe [DeviceSummary] -> f (Maybe [DeviceSummary]))
-> (Maybe [DeviceSummary] -> f (Maybe [DeviceSummary]))
-> ListDevicesResponse
-> f ListDevicesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DeviceSummary] [DeviceSummary] [DeviceSummary] [DeviceSummary]
-> Iso
     (Maybe [DeviceSummary])
     (Maybe [DeviceSummary])
     (Maybe [DeviceSummary])
     (Maybe [DeviceSummary])
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
  [DeviceSummary] [DeviceSummary] [DeviceSummary] [DeviceSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListDevicesResponse