{-# 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.DeviceFarm.ListDevices
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets information about unique device types.
--
-- This operation returns paginated results.
module Amazonka.DeviceFarm.ListDevices
  ( -- * Creating a Request
    ListDevices (..),
    newListDevices,

    -- * Request Lenses
    listDevices_arn,
    listDevices_filters,
    listDevices_nextToken,

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

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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DeviceFarm.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Represents the result of a list devices request.
--
-- /See:/ 'newListDevices' smart constructor.
data ListDevices = ListDevices'
  { -- | The Amazon Resource Name (ARN) of the project.
    ListDevices -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | Used to select a set of devices. A filter is made up of an attribute, an
    -- operator, and one or more values.
    --
    -- -   Attribute: The aspect of a device such as platform or model used as
    --     the selection criteria in a device filter.
    --
    --     Allowed values include:
    --
    --     -   ARN: The Amazon Resource Name (ARN) of the device (for example,
    --         @arn:aws:devicefarm:us-west-2::device:12345Example@).
    --
    --     -   PLATFORM: The device platform. Valid values are ANDROID or IOS.
    --
    --     -   OS_VERSION: The operating system version (for example, 10.3.2).
    --
    --     -   MODEL: The device model (for example, iPad 5th Gen).
    --
    --     -   AVAILABILITY: The current availability of the device. Valid
    --         values are AVAILABLE, HIGHLY_AVAILABLE, BUSY, or
    --         TEMPORARY_NOT_AVAILABLE.
    --
    --     -   FORM_FACTOR: The device form factor. Valid values are PHONE or
    --         TABLET.
    --
    --     -   MANUFACTURER: The device manufacturer (for example, Apple).
    --
    --     -   REMOTE_ACCESS_ENABLED: Whether the device is enabled for remote
    --         access. Valid values are TRUE or FALSE.
    --
    --     -   REMOTE_DEBUG_ENABLED: Whether the device is enabled for remote
    --         debugging. Valid values are TRUE or FALSE. Because remote
    --         debugging is
    --         <https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html no longer supported>,
    --         this attribute is ignored.
    --
    --     -   INSTANCE_ARN: The Amazon Resource Name (ARN) of the device
    --         instance.
    --
    --     -   INSTANCE_LABELS: The label of the device instance.
    --
    --     -   FLEET_TYPE: The fleet type. Valid values are PUBLIC or PRIVATE.
    --
    -- -   Operator: The filter operator.
    --
    --     -   The EQUALS operator is available for every attribute except
    --         INSTANCE_LABELS.
    --
    --     -   The CONTAINS operator is available for the INSTANCE_LABELS and
    --         MODEL attributes.
    --
    --     -   The IN and NOT_IN operators are available for the ARN,
    --         OS_VERSION, MODEL, MANUFACTURER, and INSTANCE_ARN attributes.
    --
    --     -   The LESS_THAN, GREATER_THAN, LESS_THAN_OR_EQUALS, and
    --         GREATER_THAN_OR_EQUALS operators are also available for the
    --         OS_VERSION attribute.
    --
    -- -   Values: An array of one or more filter values.
    --
    --     -   The IN and NOT_IN operators take a values array that has one or
    --         more elements.
    --
    --     -   The other operators require an array with a single element.
    --
    --     -   In a request, the AVAILABILITY attribute takes the following
    --         values: AVAILABLE, HIGHLY_AVAILABLE, BUSY, or
    --         TEMPORARY_NOT_AVAILABLE.
    ListDevices -> Maybe [DeviceFilter]
filters :: Prelude.Maybe [DeviceFilter],
    -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    ListDevices -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListDevices -> ListDevices -> Bool
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]
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
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. 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:
--
-- 'arn', 'listDevices_arn' - The Amazon Resource Name (ARN) of the project.
--
-- 'filters', 'listDevices_filters' - Used to select a set of devices. A filter is made up of an attribute, an
-- operator, and one or more values.
--
-- -   Attribute: The aspect of a device such as platform or model used as
--     the selection criteria in a device filter.
--
--     Allowed values include:
--
--     -   ARN: The Amazon Resource Name (ARN) of the device (for example,
--         @arn:aws:devicefarm:us-west-2::device:12345Example@).
--
--     -   PLATFORM: The device platform. Valid values are ANDROID or IOS.
--
--     -   OS_VERSION: The operating system version (for example, 10.3.2).
--
--     -   MODEL: The device model (for example, iPad 5th Gen).
--
--     -   AVAILABILITY: The current availability of the device. Valid
--         values are AVAILABLE, HIGHLY_AVAILABLE, BUSY, or
--         TEMPORARY_NOT_AVAILABLE.
--
--     -   FORM_FACTOR: The device form factor. Valid values are PHONE or
--         TABLET.
--
--     -   MANUFACTURER: The device manufacturer (for example, Apple).
--
--     -   REMOTE_ACCESS_ENABLED: Whether the device is enabled for remote
--         access. Valid values are TRUE or FALSE.
--
--     -   REMOTE_DEBUG_ENABLED: Whether the device is enabled for remote
--         debugging. Valid values are TRUE or FALSE. Because remote
--         debugging is
--         <https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html no longer supported>,
--         this attribute is ignored.
--
--     -   INSTANCE_ARN: The Amazon Resource Name (ARN) of the device
--         instance.
--
--     -   INSTANCE_LABELS: The label of the device instance.
--
--     -   FLEET_TYPE: The fleet type. Valid values are PUBLIC or PRIVATE.
--
-- -   Operator: The filter operator.
--
--     -   The EQUALS operator is available for every attribute except
--         INSTANCE_LABELS.
--
--     -   The CONTAINS operator is available for the INSTANCE_LABELS and
--         MODEL attributes.
--
--     -   The IN and NOT_IN operators are available for the ARN,
--         OS_VERSION, MODEL, MANUFACTURER, and INSTANCE_ARN attributes.
--
--     -   The LESS_THAN, GREATER_THAN, LESS_THAN_OR_EQUALS, and
--         GREATER_THAN_OR_EQUALS operators are also available for the
--         OS_VERSION attribute.
--
-- -   Values: An array of one or more filter values.
--
--     -   The IN and NOT_IN operators take a values array that has one or
--         more elements.
--
--     -   The other operators require an array with a single element.
--
--     -   In a request, the AVAILABILITY attribute takes the following
--         values: AVAILABLE, HIGHLY_AVAILABLE, BUSY, or
--         TEMPORARY_NOT_AVAILABLE.
--
-- 'nextToken', 'listDevices_nextToken' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
newListDevices ::
  ListDevices
newListDevices :: ListDevices
newListDevices =
  ListDevices'
    { $sel:arn:ListDevices' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:ListDevices' :: Maybe [DeviceFilter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDevices' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the project.
listDevices_arn :: Lens.Lens' ListDevices (Prelude.Maybe Prelude.Text)
listDevices_arn :: Lens' ListDevices (Maybe Text)
listDevices_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevices' {Maybe Text
arn :: Maybe Text
$sel:arn:ListDevices' :: ListDevices -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ListDevices
s@ListDevices' {} Maybe Text
a -> ListDevices
s {$sel:arn:ListDevices' :: Maybe Text
arn = Maybe Text
a} :: ListDevices)

-- | Used to select a set of devices. A filter is made up of an attribute, an
-- operator, and one or more values.
--
-- -   Attribute: The aspect of a device such as platform or model used as
--     the selection criteria in a device filter.
--
--     Allowed values include:
--
--     -   ARN: The Amazon Resource Name (ARN) of the device (for example,
--         @arn:aws:devicefarm:us-west-2::device:12345Example@).
--
--     -   PLATFORM: The device platform. Valid values are ANDROID or IOS.
--
--     -   OS_VERSION: The operating system version (for example, 10.3.2).
--
--     -   MODEL: The device model (for example, iPad 5th Gen).
--
--     -   AVAILABILITY: The current availability of the device. Valid
--         values are AVAILABLE, HIGHLY_AVAILABLE, BUSY, or
--         TEMPORARY_NOT_AVAILABLE.
--
--     -   FORM_FACTOR: The device form factor. Valid values are PHONE or
--         TABLET.
--
--     -   MANUFACTURER: The device manufacturer (for example, Apple).
--
--     -   REMOTE_ACCESS_ENABLED: Whether the device is enabled for remote
--         access. Valid values are TRUE or FALSE.
--
--     -   REMOTE_DEBUG_ENABLED: Whether the device is enabled for remote
--         debugging. Valid values are TRUE or FALSE. Because remote
--         debugging is
--         <https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html no longer supported>,
--         this attribute is ignored.
--
--     -   INSTANCE_ARN: The Amazon Resource Name (ARN) of the device
--         instance.
--
--     -   INSTANCE_LABELS: The label of the device instance.
--
--     -   FLEET_TYPE: The fleet type. Valid values are PUBLIC or PRIVATE.
--
-- -   Operator: The filter operator.
--
--     -   The EQUALS operator is available for every attribute except
--         INSTANCE_LABELS.
--
--     -   The CONTAINS operator is available for the INSTANCE_LABELS and
--         MODEL attributes.
--
--     -   The IN and NOT_IN operators are available for the ARN,
--         OS_VERSION, MODEL, MANUFACTURER, and INSTANCE_ARN attributes.
--
--     -   The LESS_THAN, GREATER_THAN, LESS_THAN_OR_EQUALS, and
--         GREATER_THAN_OR_EQUALS operators are also available for the
--         OS_VERSION attribute.
--
-- -   Values: An array of one or more filter values.
--
--     -   The IN and NOT_IN operators take a values array that has one or
--         more elements.
--
--     -   The other operators require an array with a single element.
--
--     -   In a request, the AVAILABILITY attribute takes the following
--         values: AVAILABLE, HIGHLY_AVAILABLE, BUSY, or
--         TEMPORARY_NOT_AVAILABLE.
listDevices_filters :: Lens.Lens' ListDevices (Prelude.Maybe [DeviceFilter])
listDevices_filters :: Lens' ListDevices (Maybe [DeviceFilter])
listDevices_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevices' {Maybe [DeviceFilter]
filters :: Maybe [DeviceFilter]
$sel:filters:ListDevices' :: ListDevices -> Maybe [DeviceFilter]
filters} -> Maybe [DeviceFilter]
filters) (\s :: ListDevices
s@ListDevices' {} Maybe [DeviceFilter]
a -> ListDevices
s {$sel:filters:ListDevices' :: Maybe [DeviceFilter]
filters = Maybe [DeviceFilter]
a} :: ListDevices) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
listDevices_nextToken :: Lens.Lens' ListDevices (Prelude.Maybe Prelude.Text)
listDevices_nextToken :: Lens' ListDevices (Maybe Text)
listDevices_nextToken = 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)

instance Core.AWSPager ListDevices where
  page :: ListDevices -> AWSResponse ListDevices -> Maybe ListDevices
page ListDevices
rq AWSResponse ListDevices
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDevices
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDevicesResponse (Maybe Text)
listDevicesResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDevices
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDevicesResponse (Maybe [Device])
listDevicesResponse_devices
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListDevices
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListDevices (Maybe Text)
listDevices_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDevices
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDevicesResponse (Maybe Text)
listDevicesResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListDevices where
  type AWSResponse ListDevices = ListDevicesResponse
  request :: (Service -> Service) -> ListDevices -> Request ListDevices
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListDevices
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListDevices)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [Device] -> Maybe Text -> Int -> ListDevicesResponse
ListDevicesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"devices" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListDevices where
  hashWithSalt :: Int -> ListDevices -> Int
hashWithSalt Int
_salt ListDevices' {Maybe [DeviceFilter]
Maybe Text
nextToken :: Maybe Text
filters :: Maybe [DeviceFilter]
arn :: Maybe Text
$sel:nextToken:ListDevices' :: ListDevices -> Maybe Text
$sel:filters:ListDevices' :: ListDevices -> Maybe [DeviceFilter]
$sel:arn:ListDevices' :: ListDevices -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [DeviceFilter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData ListDevices where
  rnf :: ListDevices -> ()
rnf ListDevices' {Maybe [DeviceFilter]
Maybe Text
nextToken :: Maybe Text
filters :: Maybe [DeviceFilter]
arn :: Maybe Text
$sel:nextToken:ListDevices' :: ListDevices -> Maybe Text
$sel:filters:ListDevices' :: ListDevices -> Maybe [DeviceFilter]
$sel:arn:ListDevices' :: ListDevices -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [DeviceFilter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

instance Data.ToHeaders ListDevices where
  toHeaders :: ListDevices -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"DeviceFarm_20150623.ListDevices" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListDevices where
  toJSON :: ListDevices -> Value
toJSON ListDevices' {Maybe [DeviceFilter]
Maybe Text
nextToken :: Maybe Text
filters :: Maybe [DeviceFilter]
arn :: Maybe Text
$sel:nextToken:ListDevices' :: ListDevices -> Maybe Text
$sel:filters:ListDevices' :: ListDevices -> Maybe [DeviceFilter]
$sel:arn:ListDevices' :: ListDevices -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"arn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
arn,
            (Key
"filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DeviceFilter]
filters,
            (Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
          ]
      )

instance Data.ToPath ListDevices where
  toPath :: ListDevices -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | Represents the result of a list devices operation.
--
-- /See:/ 'newListDevicesResponse' smart constructor.
data ListDevicesResponse = ListDevicesResponse'
  { -- | Information about the devices.
    ListDevicesResponse -> Maybe [Device]
devices :: Prelude.Maybe [Device],
    -- | If the number of items that are returned is significantly large, this is
    -- an identifier that is also returned. It can be used in a subsequent call
    -- to this operation to return the next set of items in the list.
    ListDevicesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDevicesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDevicesResponse -> ListDevicesResponse -> Bool
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]
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
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. 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:
--
-- 'devices', 'listDevicesResponse_devices' - Information about the devices.
--
-- 'nextToken', 'listDevicesResponse_nextToken' - If the number of items that are returned is significantly large, this is
-- an identifier that is also returned. It can be used in a subsequent call
-- to this operation to return the next set of items in the list.
--
-- 'httpStatus', 'listDevicesResponse_httpStatus' - The response's http status code.
newListDevicesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDevicesResponse
newListDevicesResponse :: Int -> ListDevicesResponse
newListDevicesResponse Int
pHttpStatus_ =
  ListDevicesResponse'
    { $sel:devices:ListDevicesResponse' :: Maybe [Device]
devices = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDevicesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDevicesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the devices.
listDevicesResponse_devices :: Lens.Lens' ListDevicesResponse (Prelude.Maybe [Device])
listDevicesResponse_devices :: Lens' ListDevicesResponse (Maybe [Device])
listDevicesResponse_devices = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevicesResponse' {Maybe [Device]
devices :: Maybe [Device]
$sel:devices:ListDevicesResponse' :: ListDevicesResponse -> Maybe [Device]
devices} -> Maybe [Device]
devices) (\s :: ListDevicesResponse
s@ListDevicesResponse' {} Maybe [Device]
a -> ListDevicesResponse
s {$sel:devices:ListDevicesResponse' :: Maybe [Device]
devices = Maybe [Device]
a} :: ListDevicesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the number of items that are returned is significantly large, this is
-- an identifier that is also returned. It can be used in a subsequent call
-- to this operation to return the next set of items in the list.
listDevicesResponse_nextToken :: Lens.Lens' ListDevicesResponse (Prelude.Maybe Prelude.Text)
listDevicesResponse_nextToken :: Lens' ListDevicesResponse (Maybe Text)
listDevicesResponse_nextToken = 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)

-- | The response's http status code.
listDevicesResponse_httpStatus :: Lens.Lens' ListDevicesResponse Prelude.Int
listDevicesResponse_httpStatus :: Lens' ListDevicesResponse Int
listDevicesResponse_httpStatus = 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 where
  rnf :: ListDevicesResponse -> ()
rnf ListDevicesResponse' {Int
Maybe [Device]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
devices :: Maybe [Device]
$sel:httpStatus:ListDevicesResponse' :: ListDevicesResponse -> Int
$sel:nextToken:ListDevicesResponse' :: ListDevicesResponse -> Maybe Text
$sel:devices:ListDevicesResponse' :: ListDevicesResponse -> Maybe [Device]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Device]
devices
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus