{-# 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 Amazonka.DeviceFarm.Types.InstanceProfile
import Amazonka.DeviceFarm.Types.InstanceStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DeviceInstance = DeviceInstance'
{
DeviceInstance -> Maybe InstanceStatus
status :: Prelude.Maybe InstanceStatus,
DeviceInstance -> Maybe Text
udid :: Prelude.Maybe Prelude.Text,
DeviceInstance -> Maybe InstanceProfile
instanceProfile :: Prelude.Maybe InstanceProfile,
DeviceInstance -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
DeviceInstance -> Maybe Text
deviceArn :: Prelude.Maybe Prelude.Text,
DeviceInstance -> Maybe [Text]
labels :: Prelude.Maybe [Prelude.Text]
}
deriving (DeviceInstance -> DeviceInstance -> Bool
(DeviceInstance -> DeviceInstance -> Bool)
-> (DeviceInstance -> DeviceInstance -> Bool) -> Eq DeviceInstance
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]
(Int -> ReadS DeviceInstance)
-> ReadS [DeviceInstance]
-> ReadPrec DeviceInstance
-> ReadPrec [DeviceInstance]
-> Read 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
(Int -> DeviceInstance -> ShowS)
-> (DeviceInstance -> String)
-> ([DeviceInstance] -> ShowS)
-> Show DeviceInstance
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. DeviceInstance -> Rep DeviceInstance x)
-> (forall x. Rep DeviceInstance x -> DeviceInstance)
-> Generic DeviceInstance
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' :: Maybe InstanceStatus
-> Maybe Text
-> Maybe InstanceProfile
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> DeviceInstance
DeviceInstance'
{ $sel:status:DeviceInstance' :: Maybe InstanceStatus
status = Maybe InstanceStatus
forall a. Maybe a
Prelude.Nothing,
$sel:udid:DeviceInstance' :: Maybe Text
udid = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceProfile:DeviceInstance' :: Maybe InstanceProfile
instanceProfile = Maybe InstanceProfile
forall a. Maybe a
Prelude.Nothing,
$sel:arn:DeviceInstance' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deviceArn:DeviceInstance' :: Maybe Text
deviceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:labels:DeviceInstance' :: Maybe [Text]
labels = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
}
deviceInstance_status :: Lens.Lens' DeviceInstance (Prelude.Maybe InstanceStatus)
deviceInstance_status :: (Maybe InstanceStatus -> f (Maybe InstanceStatus))
-> DeviceInstance -> f DeviceInstance
deviceInstance_status = (DeviceInstance -> Maybe InstanceStatus)
-> (DeviceInstance -> Maybe InstanceStatus -> DeviceInstance)
-> Lens
DeviceInstance
DeviceInstance
(Maybe InstanceStatus)
(Maybe InstanceStatus)
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 :: (Maybe Text -> f (Maybe Text))
-> DeviceInstance -> f DeviceInstance
deviceInstance_udid = (DeviceInstance -> Maybe Text)
-> (DeviceInstance -> Maybe Text -> DeviceInstance)
-> Lens DeviceInstance DeviceInstance (Maybe Text) (Maybe Text)
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)
deviceInstance_instanceProfile :: Lens.Lens' DeviceInstance (Prelude.Maybe InstanceProfile)
deviceInstance_instanceProfile :: (Maybe InstanceProfile -> f (Maybe InstanceProfile))
-> DeviceInstance -> f DeviceInstance
deviceInstance_instanceProfile = (DeviceInstance -> Maybe InstanceProfile)
-> (DeviceInstance -> Maybe InstanceProfile -> DeviceInstance)
-> Lens
DeviceInstance
DeviceInstance
(Maybe InstanceProfile)
(Maybe 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_arn :: Lens.Lens' DeviceInstance (Prelude.Maybe Prelude.Text)
deviceInstance_arn :: (Maybe Text -> f (Maybe Text))
-> DeviceInstance -> f DeviceInstance
deviceInstance_arn = (DeviceInstance -> Maybe Text)
-> (DeviceInstance -> Maybe Text -> DeviceInstance)
-> Lens DeviceInstance DeviceInstance (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> DeviceInstance -> f DeviceInstance
deviceInstance_deviceArn = (DeviceInstance -> Maybe Text)
-> (DeviceInstance -> Maybe Text -> DeviceInstance)
-> Lens DeviceInstance DeviceInstance (Maybe Text) (Maybe Text)
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_labels :: Lens.Lens' DeviceInstance (Prelude.Maybe [Prelude.Text])
deviceInstance_labels :: (Maybe [Text] -> f (Maybe [Text]))
-> DeviceInstance -> f DeviceInstance
deviceInstance_labels = (DeviceInstance -> Maybe [Text])
-> (DeviceInstance -> Maybe [Text] -> DeviceInstance)
-> Lens DeviceInstance DeviceInstance (Maybe [Text]) (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
-> DeviceInstance -> f DeviceInstance)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DeviceInstance
-> f DeviceInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON DeviceInstance where
parseJSON :: Value -> Parser DeviceInstance
parseJSON =
String
-> (Object -> Parser DeviceInstance)
-> Value
-> Parser DeviceInstance
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DeviceInstance"
( \Object
x ->
Maybe InstanceStatus
-> Maybe Text
-> Maybe InstanceProfile
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> DeviceInstance
DeviceInstance'
(Maybe InstanceStatus
-> Maybe Text
-> Maybe InstanceProfile
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> DeviceInstance)
-> Parser (Maybe InstanceStatus)
-> Parser
(Maybe Text
-> Maybe InstanceProfile
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> DeviceInstance)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe InstanceStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser
(Maybe Text
-> Maybe InstanceProfile
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> DeviceInstance)
-> Parser (Maybe Text)
-> Parser
(Maybe InstanceProfile
-> Maybe Text -> Maybe Text -> Maybe [Text] -> DeviceInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"udid")
Parser
(Maybe InstanceProfile
-> Maybe Text -> Maybe Text -> Maybe [Text] -> DeviceInstance)
-> Parser (Maybe InstanceProfile)
-> Parser
(Maybe Text -> Maybe Text -> Maybe [Text] -> DeviceInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InstanceProfile)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"instanceProfile")
Parser (Maybe Text -> Maybe Text -> Maybe [Text] -> DeviceInstance)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [Text] -> DeviceInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"arn")
Parser (Maybe Text -> Maybe [Text] -> DeviceInstance)
-> Parser (Maybe Text) -> Parser (Maybe [Text] -> DeviceInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"deviceArn")
Parser (Maybe [Text] -> DeviceInstance)
-> Parser (Maybe [Text]) -> Parser DeviceInstance
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"labels" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable DeviceInstance
instance Prelude.NFData DeviceInstance