{-# 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.DeviceInstance 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.InstanceProfile
import Amazonka.DeviceFarm.Types.InstanceStatus
import qualified Amazonka.Prelude as Prelude
data DeviceInstance = DeviceInstance'
{
DeviceInstance -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
DeviceInstance -> Maybe Text
deviceArn :: Prelude.Maybe Prelude.Text,
DeviceInstance -> Maybe InstanceProfile
instanceProfile :: Prelude.Maybe InstanceProfile,
DeviceInstance -> Maybe [Text]
labels :: Prelude.Maybe [Prelude.Text],
DeviceInstance -> Maybe InstanceStatus
status :: Prelude.Maybe InstanceStatus,
DeviceInstance -> Maybe Text
udid :: Prelude.Maybe Prelude.Text
}
deriving (DeviceInstance -> DeviceInstance -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceInstance -> DeviceInstance -> Bool
$c/= :: DeviceInstance -> DeviceInstance -> Bool
== :: DeviceInstance -> DeviceInstance -> Bool
$c== :: DeviceInstance -> DeviceInstance -> Bool
Prelude.Eq, ReadPrec [DeviceInstance]
ReadPrec DeviceInstance
Int -> ReadS DeviceInstance
ReadS [DeviceInstance]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeviceInstance]
$creadListPrec :: ReadPrec [DeviceInstance]
readPrec :: ReadPrec DeviceInstance
$creadPrec :: ReadPrec DeviceInstance
readList :: ReadS [DeviceInstance]
$creadList :: ReadS [DeviceInstance]
readsPrec :: Int -> ReadS DeviceInstance
$creadsPrec :: Int -> ReadS DeviceInstance
Prelude.Read, Int -> DeviceInstance -> ShowS
[DeviceInstance] -> ShowS
DeviceInstance -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeviceInstance] -> ShowS
$cshowList :: [DeviceInstance] -> ShowS
show :: DeviceInstance -> String
$cshow :: DeviceInstance -> String
showsPrec :: Int -> DeviceInstance -> ShowS
$cshowsPrec :: Int -> DeviceInstance -> ShowS
Prelude.Show, forall x. Rep DeviceInstance x -> DeviceInstance
forall x. DeviceInstance -> Rep DeviceInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeviceInstance x -> DeviceInstance
$cfrom :: forall x. DeviceInstance -> Rep DeviceInstance x
Prelude.Generic)
newDeviceInstance ::
DeviceInstance
newDeviceInstance :: DeviceInstance
newDeviceInstance =
DeviceInstance'
{ $sel:arn:DeviceInstance' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:deviceArn:DeviceInstance' :: Maybe Text
deviceArn = forall a. Maybe a
Prelude.Nothing,
$sel:instanceProfile:DeviceInstance' :: Maybe InstanceProfile
instanceProfile = forall a. Maybe a
Prelude.Nothing,
$sel:labels:DeviceInstance' :: Maybe [Text]
labels = forall a. Maybe a
Prelude.Nothing,
$sel:status:DeviceInstance' :: Maybe InstanceStatus
status = forall a. Maybe a
Prelude.Nothing,
$sel:udid:DeviceInstance' :: Maybe Text
udid = forall a. Maybe a
Prelude.Nothing
}
deviceInstance_arn :: Lens.Lens' DeviceInstance (Prelude.Maybe Prelude.Text)
deviceInstance_arn :: Lens' DeviceInstance (Maybe Text)
deviceInstance_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceInstance' {Maybe Text
arn :: Maybe Text
$sel:arn:DeviceInstance' :: DeviceInstance -> Maybe Text
arn} -> Maybe Text
arn) (\s :: DeviceInstance
s@DeviceInstance' {} Maybe Text
a -> DeviceInstance
s {$sel:arn:DeviceInstance' :: Maybe Text
arn = Maybe Text
a} :: DeviceInstance)
deviceInstance_deviceArn :: Lens.Lens' DeviceInstance (Prelude.Maybe Prelude.Text)
deviceInstance_deviceArn :: Lens' DeviceInstance (Maybe Text)
deviceInstance_deviceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceInstance' {Maybe Text
deviceArn :: Maybe Text
$sel:deviceArn:DeviceInstance' :: DeviceInstance -> Maybe Text
deviceArn} -> Maybe Text
deviceArn) (\s :: DeviceInstance
s@DeviceInstance' {} Maybe Text
a -> DeviceInstance
s {$sel:deviceArn:DeviceInstance' :: Maybe Text
deviceArn = Maybe Text
a} :: DeviceInstance)
deviceInstance_instanceProfile :: Lens.Lens' DeviceInstance (Prelude.Maybe InstanceProfile)
deviceInstance_instanceProfile :: Lens' DeviceInstance (Maybe InstanceProfile)
deviceInstance_instanceProfile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceInstance' {Maybe InstanceProfile
instanceProfile :: Maybe InstanceProfile
$sel:instanceProfile:DeviceInstance' :: DeviceInstance -> Maybe InstanceProfile
instanceProfile} -> Maybe InstanceProfile
instanceProfile) (\s :: DeviceInstance
s@DeviceInstance' {} Maybe InstanceProfile
a -> DeviceInstance
s {$sel:instanceProfile:DeviceInstance' :: Maybe InstanceProfile
instanceProfile = Maybe InstanceProfile
a} :: DeviceInstance)
deviceInstance_labels :: Lens.Lens' DeviceInstance (Prelude.Maybe [Prelude.Text])
deviceInstance_labels :: Lens' DeviceInstance (Maybe [Text])
deviceInstance_labels = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceInstance' {Maybe [Text]
labels :: Maybe [Text]
$sel:labels:DeviceInstance' :: DeviceInstance -> Maybe [Text]
labels} -> Maybe [Text]
labels) (\s :: DeviceInstance
s@DeviceInstance' {} Maybe [Text]
a -> DeviceInstance
s {$sel:labels:DeviceInstance' :: Maybe [Text]
labels = Maybe [Text]
a} :: DeviceInstance) 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
deviceInstance_status :: Lens.Lens' DeviceInstance (Prelude.Maybe InstanceStatus)
deviceInstance_status :: Lens' DeviceInstance (Maybe InstanceStatus)
deviceInstance_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceInstance' {Maybe InstanceStatus
status :: Maybe InstanceStatus
$sel:status:DeviceInstance' :: DeviceInstance -> Maybe InstanceStatus
status} -> Maybe InstanceStatus
status) (\s :: DeviceInstance
s@DeviceInstance' {} Maybe InstanceStatus
a -> DeviceInstance
s {$sel:status:DeviceInstance' :: Maybe InstanceStatus
status = Maybe InstanceStatus
a} :: DeviceInstance)
deviceInstance_udid :: Lens.Lens' DeviceInstance (Prelude.Maybe Prelude.Text)
deviceInstance_udid :: Lens' DeviceInstance (Maybe Text)
deviceInstance_udid = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceInstance' {Maybe Text
udid :: Maybe Text
$sel:udid:DeviceInstance' :: DeviceInstance -> Maybe Text
udid} -> Maybe Text
udid) (\s :: DeviceInstance
s@DeviceInstance' {} Maybe Text
a -> DeviceInstance
s {$sel:udid:DeviceInstance' :: Maybe Text
udid = Maybe Text
a} :: DeviceInstance)
instance Data.FromJSON DeviceInstance where
parseJSON :: Value -> Parser DeviceInstance
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DeviceInstance"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe InstanceProfile
-> Maybe [Text]
-> Maybe InstanceStatus
-> Maybe Text
-> DeviceInstance
DeviceInstance'
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
"deviceArn")
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
"instanceProfile")
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
"labels" 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
"status")
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
"udid")
)
instance Prelude.Hashable DeviceInstance where
hashWithSalt :: Int -> DeviceInstance -> Int
hashWithSalt Int
_salt DeviceInstance' {Maybe [Text]
Maybe Text
Maybe InstanceProfile
Maybe InstanceStatus
udid :: Maybe Text
status :: Maybe InstanceStatus
labels :: Maybe [Text]
instanceProfile :: Maybe InstanceProfile
deviceArn :: Maybe Text
arn :: Maybe Text
$sel:udid:DeviceInstance' :: DeviceInstance -> Maybe Text
$sel:status:DeviceInstance' :: DeviceInstance -> Maybe InstanceStatus
$sel:labels:DeviceInstance' :: DeviceInstance -> Maybe [Text]
$sel:instanceProfile:DeviceInstance' :: DeviceInstance -> Maybe InstanceProfile
$sel:deviceArn:DeviceInstance' :: DeviceInstance -> Maybe Text
$sel:arn:DeviceInstance' :: DeviceInstance -> 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
deviceArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceProfile
instanceProfile
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
labels
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceStatus
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
udid
instance Prelude.NFData DeviceInstance where
rnf :: DeviceInstance -> ()
rnf DeviceInstance' {Maybe [Text]
Maybe Text
Maybe InstanceProfile
Maybe InstanceStatus
udid :: Maybe Text
status :: Maybe InstanceStatus
labels :: Maybe [Text]
instanceProfile :: Maybe InstanceProfile
deviceArn :: Maybe Text
arn :: Maybe Text
$sel:udid:DeviceInstance' :: DeviceInstance -> Maybe Text
$sel:status:DeviceInstance' :: DeviceInstance -> Maybe InstanceStatus
$sel:labels:DeviceInstance' :: DeviceInstance -> Maybe [Text]
$sel:instanceProfile:DeviceInstance' :: DeviceInstance -> Maybe InstanceProfile
$sel:deviceArn:DeviceInstance' :: DeviceInstance -> Maybe Text
$sel:arn:DeviceInstance' :: DeviceInstance -> 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
deviceArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceProfile
instanceProfile
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
labels
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceStatus
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
udid