{-# 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.ListDevicePools
-- 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)
--
-- Gets information about device pools.
--
-- This operation returns paginated results.
module Amazonka.DeviceFarm.ListDevicePools
  ( -- * Creating a Request
    ListDevicePools (..),
    newListDevicePools,

    -- * Request Lenses
    listDevicePools_nextToken,
    listDevicePools_type,
    listDevicePools_arn,

    -- * Destructuring the Response
    ListDevicePoolsResponse (..),
    newListDevicePoolsResponse,

    -- * Response Lenses
    listDevicePoolsResponse_devicePools,
    listDevicePoolsResponse_nextToken,
    listDevicePoolsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DeviceFarm.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

-- | Represents the result of a list device pools request.
--
-- /See:/ 'newListDevicePools' smart constructor.
data ListDevicePools = ListDevicePools'
  { -- | 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.
    ListDevicePools -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The device pools\' type.
    --
    -- Allowed values include:
    --
    -- -   CURATED: A device pool that is created and managed by AWS Device
    --     Farm.
    --
    -- -   PRIVATE: A device pool that is created and managed by the device
    --     pool developer.
    ListDevicePools -> Maybe DevicePoolType
type' :: Prelude.Maybe DevicePoolType,
    -- | The project ARN.
    ListDevicePools -> Text
arn :: Prelude.Text
  }
  deriving (ListDevicePools -> ListDevicePools -> Bool
(ListDevicePools -> ListDevicePools -> Bool)
-> (ListDevicePools -> ListDevicePools -> Bool)
-> Eq ListDevicePools
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDevicePools -> ListDevicePools -> Bool
$c/= :: ListDevicePools -> ListDevicePools -> Bool
== :: ListDevicePools -> ListDevicePools -> Bool
$c== :: ListDevicePools -> ListDevicePools -> Bool
Prelude.Eq, ReadPrec [ListDevicePools]
ReadPrec ListDevicePools
Int -> ReadS ListDevicePools
ReadS [ListDevicePools]
(Int -> ReadS ListDevicePools)
-> ReadS [ListDevicePools]
-> ReadPrec ListDevicePools
-> ReadPrec [ListDevicePools]
-> Read ListDevicePools
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDevicePools]
$creadListPrec :: ReadPrec [ListDevicePools]
readPrec :: ReadPrec ListDevicePools
$creadPrec :: ReadPrec ListDevicePools
readList :: ReadS [ListDevicePools]
$creadList :: ReadS [ListDevicePools]
readsPrec :: Int -> ReadS ListDevicePools
$creadsPrec :: Int -> ReadS ListDevicePools
Prelude.Read, Int -> ListDevicePools -> ShowS
[ListDevicePools] -> ShowS
ListDevicePools -> String
(Int -> ListDevicePools -> ShowS)
-> (ListDevicePools -> String)
-> ([ListDevicePools] -> ShowS)
-> Show ListDevicePools
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDevicePools] -> ShowS
$cshowList :: [ListDevicePools] -> ShowS
show :: ListDevicePools -> String
$cshow :: ListDevicePools -> String
showsPrec :: Int -> ListDevicePools -> ShowS
$cshowsPrec :: Int -> ListDevicePools -> ShowS
Prelude.Show, (forall x. ListDevicePools -> Rep ListDevicePools x)
-> (forall x. Rep ListDevicePools x -> ListDevicePools)
-> Generic ListDevicePools
forall x. Rep ListDevicePools x -> ListDevicePools
forall x. ListDevicePools -> Rep ListDevicePools x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDevicePools x -> ListDevicePools
$cfrom :: forall x. ListDevicePools -> Rep ListDevicePools x
Prelude.Generic)

-- |
-- Create a value of 'ListDevicePools' 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', 'listDevicePools_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.
--
-- 'type'', 'listDevicePools_type' - The device pools\' type.
--
-- Allowed values include:
--
-- -   CURATED: A device pool that is created and managed by AWS Device
--     Farm.
--
-- -   PRIVATE: A device pool that is created and managed by the device
--     pool developer.
--
-- 'arn', 'listDevicePools_arn' - The project ARN.
newListDevicePools ::
  -- | 'arn'
  Prelude.Text ->
  ListDevicePools
newListDevicePools :: Text -> ListDevicePools
newListDevicePools Text
pArn_ =
  ListDevicePools' :: Maybe Text -> Maybe DevicePoolType -> Text -> ListDevicePools
ListDevicePools'
    { $sel:nextToken:ListDevicePools' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':ListDevicePools' :: Maybe DevicePoolType
type' = Maybe DevicePoolType
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ListDevicePools' :: Text
arn = Text
pArn_
    }

-- | 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.
listDevicePools_nextToken :: Lens.Lens' ListDevicePools (Prelude.Maybe Prelude.Text)
listDevicePools_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDevicePools -> f ListDevicePools
listDevicePools_nextToken = (ListDevicePools -> Maybe Text)
-> (ListDevicePools -> Maybe Text -> ListDevicePools)
-> Lens ListDevicePools ListDevicePools (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevicePools' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDevicePools' :: ListDevicePools -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDevicePools
s@ListDevicePools' {} Maybe Text
a -> ListDevicePools
s {$sel:nextToken:ListDevicePools' :: Maybe Text
nextToken = Maybe Text
a} :: ListDevicePools)

-- | The device pools\' type.
--
-- Allowed values include:
--
-- -   CURATED: A device pool that is created and managed by AWS Device
--     Farm.
--
-- -   PRIVATE: A device pool that is created and managed by the device
--     pool developer.
listDevicePools_type :: Lens.Lens' ListDevicePools (Prelude.Maybe DevicePoolType)
listDevicePools_type :: (Maybe DevicePoolType -> f (Maybe DevicePoolType))
-> ListDevicePools -> f ListDevicePools
listDevicePools_type = (ListDevicePools -> Maybe DevicePoolType)
-> (ListDevicePools -> Maybe DevicePoolType -> ListDevicePools)
-> Lens
     ListDevicePools
     ListDevicePools
     (Maybe DevicePoolType)
     (Maybe DevicePoolType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevicePools' {Maybe DevicePoolType
type' :: Maybe DevicePoolType
$sel:type':ListDevicePools' :: ListDevicePools -> Maybe DevicePoolType
type'} -> Maybe DevicePoolType
type') (\s :: ListDevicePools
s@ListDevicePools' {} Maybe DevicePoolType
a -> ListDevicePools
s {$sel:type':ListDevicePools' :: Maybe DevicePoolType
type' = Maybe DevicePoolType
a} :: ListDevicePools)

-- | The project ARN.
listDevicePools_arn :: Lens.Lens' ListDevicePools Prelude.Text
listDevicePools_arn :: (Text -> f Text) -> ListDevicePools -> f ListDevicePools
listDevicePools_arn = (ListDevicePools -> Text)
-> (ListDevicePools -> Text -> ListDevicePools)
-> Lens ListDevicePools ListDevicePools Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevicePools' {Text
arn :: Text
$sel:arn:ListDevicePools' :: ListDevicePools -> Text
arn} -> Text
arn) (\s :: ListDevicePools
s@ListDevicePools' {} Text
a -> ListDevicePools
s {$sel:arn:ListDevicePools' :: Text
arn = Text
a} :: ListDevicePools)

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

instance Prelude.NFData ListDevicePools

instance Core.ToHeaders ListDevicePools where
  toHeaders :: ListDevicePools -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListDevicePools -> 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
"DeviceFarm_20150623.ListDevicePools" ::
                          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 ListDevicePools where
  toJSON :: ListDevicePools -> Value
toJSON ListDevicePools' {Maybe Text
Maybe DevicePoolType
Text
arn :: Text
type' :: Maybe DevicePoolType
nextToken :: Maybe Text
$sel:arn:ListDevicePools' :: ListDevicePools -> Text
$sel:type':ListDevicePools' :: ListDevicePools -> Maybe DevicePoolType
$sel:nextToken:ListDevicePools' :: ListDevicePools -> 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
"type" Text -> DevicePoolType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DevicePoolType -> Pair) -> Maybe DevicePoolType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DevicePoolType
type',
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn)
          ]
      )

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

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

-- | Represents the result of a list device pools request.
--
-- /See:/ 'newListDevicePoolsResponse' smart constructor.
data ListDevicePoolsResponse = ListDevicePoolsResponse'
  { -- | Information about the device pools.
    ListDevicePoolsResponse -> Maybe [DevicePool]
devicePools :: Prelude.Maybe [DevicePool],
    -- | 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.
    ListDevicePoolsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDevicePoolsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDevicePoolsResponse -> ListDevicePoolsResponse -> Bool
(ListDevicePoolsResponse -> ListDevicePoolsResponse -> Bool)
-> (ListDevicePoolsResponse -> ListDevicePoolsResponse -> Bool)
-> Eq ListDevicePoolsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDevicePoolsResponse -> ListDevicePoolsResponse -> Bool
$c/= :: ListDevicePoolsResponse -> ListDevicePoolsResponse -> Bool
== :: ListDevicePoolsResponse -> ListDevicePoolsResponse -> Bool
$c== :: ListDevicePoolsResponse -> ListDevicePoolsResponse -> Bool
Prelude.Eq, ReadPrec [ListDevicePoolsResponse]
ReadPrec ListDevicePoolsResponse
Int -> ReadS ListDevicePoolsResponse
ReadS [ListDevicePoolsResponse]
(Int -> ReadS ListDevicePoolsResponse)
-> ReadS [ListDevicePoolsResponse]
-> ReadPrec ListDevicePoolsResponse
-> ReadPrec [ListDevicePoolsResponse]
-> Read ListDevicePoolsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDevicePoolsResponse]
$creadListPrec :: ReadPrec [ListDevicePoolsResponse]
readPrec :: ReadPrec ListDevicePoolsResponse
$creadPrec :: ReadPrec ListDevicePoolsResponse
readList :: ReadS [ListDevicePoolsResponse]
$creadList :: ReadS [ListDevicePoolsResponse]
readsPrec :: Int -> ReadS ListDevicePoolsResponse
$creadsPrec :: Int -> ReadS ListDevicePoolsResponse
Prelude.Read, Int -> ListDevicePoolsResponse -> ShowS
[ListDevicePoolsResponse] -> ShowS
ListDevicePoolsResponse -> String
(Int -> ListDevicePoolsResponse -> ShowS)
-> (ListDevicePoolsResponse -> String)
-> ([ListDevicePoolsResponse] -> ShowS)
-> Show ListDevicePoolsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDevicePoolsResponse] -> ShowS
$cshowList :: [ListDevicePoolsResponse] -> ShowS
show :: ListDevicePoolsResponse -> String
$cshow :: ListDevicePoolsResponse -> String
showsPrec :: Int -> ListDevicePoolsResponse -> ShowS
$cshowsPrec :: Int -> ListDevicePoolsResponse -> ShowS
Prelude.Show, (forall x.
 ListDevicePoolsResponse -> Rep ListDevicePoolsResponse x)
-> (forall x.
    Rep ListDevicePoolsResponse x -> ListDevicePoolsResponse)
-> Generic ListDevicePoolsResponse
forall x. Rep ListDevicePoolsResponse x -> ListDevicePoolsResponse
forall x. ListDevicePoolsResponse -> Rep ListDevicePoolsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDevicePoolsResponse x -> ListDevicePoolsResponse
$cfrom :: forall x. ListDevicePoolsResponse -> Rep ListDevicePoolsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDevicePoolsResponse' 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:
--
-- 'devicePools', 'listDevicePoolsResponse_devicePools' - Information about the device pools.
--
-- 'nextToken', 'listDevicePoolsResponse_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', 'listDevicePoolsResponse_httpStatus' - The response's http status code.
newListDevicePoolsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDevicePoolsResponse
newListDevicePoolsResponse :: Int -> ListDevicePoolsResponse
newListDevicePoolsResponse Int
pHttpStatus_ =
  ListDevicePoolsResponse' :: Maybe [DevicePool] -> Maybe Text -> Int -> ListDevicePoolsResponse
ListDevicePoolsResponse'
    { $sel:devicePools:ListDevicePoolsResponse' :: Maybe [DevicePool]
devicePools =
        Maybe [DevicePool]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDevicePoolsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDevicePoolsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the device pools.
listDevicePoolsResponse_devicePools :: Lens.Lens' ListDevicePoolsResponse (Prelude.Maybe [DevicePool])
listDevicePoolsResponse_devicePools :: (Maybe [DevicePool] -> f (Maybe [DevicePool]))
-> ListDevicePoolsResponse -> f ListDevicePoolsResponse
listDevicePoolsResponse_devicePools = (ListDevicePoolsResponse -> Maybe [DevicePool])
-> (ListDevicePoolsResponse
    -> Maybe [DevicePool] -> ListDevicePoolsResponse)
-> Lens' ListDevicePoolsResponse (Maybe [DevicePool])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevicePoolsResponse' {Maybe [DevicePool]
devicePools :: Maybe [DevicePool]
$sel:devicePools:ListDevicePoolsResponse' :: ListDevicePoolsResponse -> Maybe [DevicePool]
devicePools} -> Maybe [DevicePool]
devicePools) (\s :: ListDevicePoolsResponse
s@ListDevicePoolsResponse' {} Maybe [DevicePool]
a -> ListDevicePoolsResponse
s {$sel:devicePools:ListDevicePoolsResponse' :: Maybe [DevicePool]
devicePools = Maybe [DevicePool]
a} :: ListDevicePoolsResponse) ((Maybe [DevicePool] -> f (Maybe [DevicePool]))
 -> ListDevicePoolsResponse -> f ListDevicePoolsResponse)
-> ((Maybe [DevicePool] -> f (Maybe [DevicePool]))
    -> Maybe [DevicePool] -> f (Maybe [DevicePool]))
-> (Maybe [DevicePool] -> f (Maybe [DevicePool]))
-> ListDevicePoolsResponse
-> f ListDevicePoolsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [DevicePool] [DevicePool] [DevicePool] [DevicePool]
-> Iso
     (Maybe [DevicePool])
     (Maybe [DevicePool])
     (Maybe [DevicePool])
     (Maybe [DevicePool])
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 [DevicePool] [DevicePool] [DevicePool] [DevicePool]
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.
listDevicePoolsResponse_nextToken :: Lens.Lens' ListDevicePoolsResponse (Prelude.Maybe Prelude.Text)
listDevicePoolsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDevicePoolsResponse -> f ListDevicePoolsResponse
listDevicePoolsResponse_nextToken = (ListDevicePoolsResponse -> Maybe Text)
-> (ListDevicePoolsResponse
    -> Maybe Text -> ListDevicePoolsResponse)
-> Lens' ListDevicePoolsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevicePoolsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDevicePoolsResponse' :: ListDevicePoolsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDevicePoolsResponse
s@ListDevicePoolsResponse' {} Maybe Text
a -> ListDevicePoolsResponse
s {$sel:nextToken:ListDevicePoolsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDevicePoolsResponse)

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

instance Prelude.NFData ListDevicePoolsResponse