{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.DeviceFarm.Types.DevicePool 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.DevicePoolType
import Amazonka.DeviceFarm.Types.Rule
import qualified Amazonka.Prelude as Prelude
data DevicePool = DevicePool'
{
DevicePool -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
DevicePool -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
DevicePool -> Maybe Int
maxDevices :: Prelude.Maybe Prelude.Int,
DevicePool -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
DevicePool -> Maybe [Rule]
rules :: Prelude.Maybe [Rule],
DevicePool -> Maybe DevicePoolType
type' :: Prelude.Maybe DevicePoolType
}
deriving (DevicePool -> DevicePool -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DevicePool -> DevicePool -> Bool
$c/= :: DevicePool -> DevicePool -> Bool
== :: DevicePool -> DevicePool -> Bool
$c== :: DevicePool -> DevicePool -> Bool
Prelude.Eq, ReadPrec [DevicePool]
ReadPrec DevicePool
Int -> ReadS DevicePool
ReadS [DevicePool]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DevicePool]
$creadListPrec :: ReadPrec [DevicePool]
readPrec :: ReadPrec DevicePool
$creadPrec :: ReadPrec DevicePool
readList :: ReadS [DevicePool]
$creadList :: ReadS [DevicePool]
readsPrec :: Int -> ReadS DevicePool
$creadsPrec :: Int -> ReadS DevicePool
Prelude.Read, Int -> DevicePool -> ShowS
[DevicePool] -> ShowS
DevicePool -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DevicePool] -> ShowS
$cshowList :: [DevicePool] -> ShowS
show :: DevicePool -> String
$cshow :: DevicePool -> String
showsPrec :: Int -> DevicePool -> ShowS
$cshowsPrec :: Int -> DevicePool -> ShowS
Prelude.Show, forall x. Rep DevicePool x -> DevicePool
forall x. DevicePool -> Rep DevicePool x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DevicePool x -> DevicePool
$cfrom :: forall x. DevicePool -> Rep DevicePool x
Prelude.Generic)
newDevicePool ::
DevicePool
newDevicePool :: DevicePool
newDevicePool =
DevicePool'
{ $sel:arn:DevicePool' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:description:DevicePool' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:maxDevices:DevicePool' :: Maybe Int
maxDevices = forall a. Maybe a
Prelude.Nothing,
$sel:name:DevicePool' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:rules:DevicePool' :: Maybe [Rule]
rules = forall a. Maybe a
Prelude.Nothing,
$sel:type':DevicePool' :: Maybe DevicePoolType
type' = forall a. Maybe a
Prelude.Nothing
}
devicePool_arn :: Lens.Lens' DevicePool (Prelude.Maybe Prelude.Text)
devicePool_arn :: Lens' DevicePool (Maybe Text)
devicePool_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DevicePool' {Maybe Text
arn :: Maybe Text
$sel:arn:DevicePool' :: DevicePool -> Maybe Text
arn} -> Maybe Text
arn) (\s :: DevicePool
s@DevicePool' {} Maybe Text
a -> DevicePool
s {$sel:arn:DevicePool' :: Maybe Text
arn = Maybe Text
a} :: DevicePool)
devicePool_description :: Lens.Lens' DevicePool (Prelude.Maybe Prelude.Text)
devicePool_description :: Lens' DevicePool (Maybe Text)
devicePool_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DevicePool' {Maybe Text
description :: Maybe Text
$sel:description:DevicePool' :: DevicePool -> Maybe Text
description} -> Maybe Text
description) (\s :: DevicePool
s@DevicePool' {} Maybe Text
a -> DevicePool
s {$sel:description:DevicePool' :: Maybe Text
description = Maybe Text
a} :: DevicePool)
devicePool_maxDevices :: Lens.Lens' DevicePool (Prelude.Maybe Prelude.Int)
devicePool_maxDevices :: Lens' DevicePool (Maybe Int)
devicePool_maxDevices = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DevicePool' {Maybe Int
maxDevices :: Maybe Int
$sel:maxDevices:DevicePool' :: DevicePool -> Maybe Int
maxDevices} -> Maybe Int
maxDevices) (\s :: DevicePool
s@DevicePool' {} Maybe Int
a -> DevicePool
s {$sel:maxDevices:DevicePool' :: Maybe Int
maxDevices = Maybe Int
a} :: DevicePool)
devicePool_name :: Lens.Lens' DevicePool (Prelude.Maybe Prelude.Text)
devicePool_name :: Lens' DevicePool (Maybe Text)
devicePool_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DevicePool' {Maybe Text
name :: Maybe Text
$sel:name:DevicePool' :: DevicePool -> Maybe Text
name} -> Maybe Text
name) (\s :: DevicePool
s@DevicePool' {} Maybe Text
a -> DevicePool
s {$sel:name:DevicePool' :: Maybe Text
name = Maybe Text
a} :: DevicePool)
devicePool_rules :: Lens.Lens' DevicePool (Prelude.Maybe [Rule])
devicePool_rules :: Lens' DevicePool (Maybe [Rule])
devicePool_rules = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DevicePool' {Maybe [Rule]
rules :: Maybe [Rule]
$sel:rules:DevicePool' :: DevicePool -> Maybe [Rule]
rules} -> Maybe [Rule]
rules) (\s :: DevicePool
s@DevicePool' {} Maybe [Rule]
a -> DevicePool
s {$sel:rules:DevicePool' :: Maybe [Rule]
rules = Maybe [Rule]
a} :: DevicePool) 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
devicePool_type :: Lens.Lens' DevicePool (Prelude.Maybe DevicePoolType)
devicePool_type :: Lens' DevicePool (Maybe DevicePoolType)
devicePool_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DevicePool' {Maybe DevicePoolType
type' :: Maybe DevicePoolType
$sel:type':DevicePool' :: DevicePool -> Maybe DevicePoolType
type'} -> Maybe DevicePoolType
type') (\s :: DevicePool
s@DevicePool' {} Maybe DevicePoolType
a -> DevicePool
s {$sel:type':DevicePool' :: Maybe DevicePoolType
type' = Maybe DevicePoolType
a} :: DevicePool)
instance Data.FromJSON DevicePool where
parseJSON :: Value -> Parser DevicePool
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DevicePool"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe [Rule]
-> Maybe DevicePoolType
-> DevicePool
DevicePool'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"description")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"maxDevices")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"rules" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= 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 -> Parser (Maybe a)
Data..:? Key
"type")
)
instance Prelude.Hashable DevicePool where
hashWithSalt :: Int -> DevicePool -> Int
hashWithSalt Int
_salt DevicePool' {Maybe Int
Maybe [Rule]
Maybe Text
Maybe DevicePoolType
type' :: Maybe DevicePoolType
rules :: Maybe [Rule]
name :: Maybe Text
maxDevices :: Maybe Int
description :: Maybe Text
arn :: Maybe Text
$sel:type':DevicePool' :: DevicePool -> Maybe DevicePoolType
$sel:rules:DevicePool' :: DevicePool -> Maybe [Rule]
$sel:name:DevicePool' :: DevicePool -> Maybe Text
$sel:maxDevices:DevicePool' :: DevicePool -> Maybe Int
$sel:description:DevicePool' :: DevicePool -> Maybe Text
$sel:arn:DevicePool' :: DevicePool -> 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 Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxDevices
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Rule]
rules
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DevicePoolType
type'
instance Prelude.NFData DevicePool where
rnf :: DevicePool -> ()
rnf DevicePool' {Maybe Int
Maybe [Rule]
Maybe Text
Maybe DevicePoolType
type' :: Maybe DevicePoolType
rules :: Maybe [Rule]
name :: Maybe Text
maxDevices :: Maybe Int
description :: Maybe Text
arn :: Maybe Text
$sel:type':DevicePool' :: DevicePool -> Maybe DevicePoolType
$sel:rules:DevicePool' :: DevicePool -> Maybe [Rule]
$sel:name:DevicePool' :: DevicePool -> Maybe Text
$sel:maxDevices:DevicePool' :: DevicePool -> Maybe Int
$sel:description:DevicePool' :: DevicePool -> Maybe Text
$sel:arn:DevicePool' :: DevicePool -> 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 Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxDevices
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Rule]
rules
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DevicePoolType
type'