{-# 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.RobOMaker.Types.Robot where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RobOMaker.Types.Architecture
import Amazonka.RobOMaker.Types.RobotStatus
data Robot = Robot'
{
Robot -> Maybe Text
lastDeploymentJob :: Prelude.Maybe Prelude.Text,
Robot -> Maybe RobotStatus
status :: Prelude.Maybe RobotStatus,
Robot -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Robot -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
Robot -> Maybe Text
greenGrassGroupId :: Prelude.Maybe Prelude.Text,
Robot -> Maybe Text
fleetArn :: Prelude.Maybe Prelude.Text,
Robot -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Robot -> Maybe Architecture
architecture :: Prelude.Maybe Architecture,
Robot -> Maybe POSIX
lastDeploymentTime :: Prelude.Maybe Core.POSIX
}
deriving (Robot -> Robot -> Bool
(Robot -> Robot -> Bool) -> (Robot -> Robot -> Bool) -> Eq Robot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Robot -> Robot -> Bool
$c/= :: Robot -> Robot -> Bool
== :: Robot -> Robot -> Bool
$c== :: Robot -> Robot -> Bool
Prelude.Eq, ReadPrec [Robot]
ReadPrec Robot
Int -> ReadS Robot
ReadS [Robot]
(Int -> ReadS Robot)
-> ReadS [Robot]
-> ReadPrec Robot
-> ReadPrec [Robot]
-> Read Robot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Robot]
$creadListPrec :: ReadPrec [Robot]
readPrec :: ReadPrec Robot
$creadPrec :: ReadPrec Robot
readList :: ReadS [Robot]
$creadList :: ReadS [Robot]
readsPrec :: Int -> ReadS Robot
$creadsPrec :: Int -> ReadS Robot
Prelude.Read, Int -> Robot -> ShowS
[Robot] -> ShowS
Robot -> String
(Int -> Robot -> ShowS)
-> (Robot -> String) -> ([Robot] -> ShowS) -> Show Robot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Robot] -> ShowS
$cshowList :: [Robot] -> ShowS
show :: Robot -> String
$cshow :: Robot -> String
showsPrec :: Int -> Robot -> ShowS
$cshowsPrec :: Int -> Robot -> ShowS
Prelude.Show, (forall x. Robot -> Rep Robot x)
-> (forall x. Rep Robot x -> Robot) -> Generic Robot
forall x. Rep Robot x -> Robot
forall x. Robot -> Rep Robot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Robot x -> Robot
$cfrom :: forall x. Robot -> Rep Robot x
Prelude.Generic)
newRobot ::
Robot
newRobot :: Robot
newRobot =
Robot' :: Maybe Text
-> Maybe RobotStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Architecture
-> Maybe POSIX
-> Robot
Robot'
{ $sel:lastDeploymentJob:Robot' :: Maybe Text
lastDeploymentJob = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:Robot' :: Maybe RobotStatus
status = Maybe RobotStatus
forall a. Maybe a
Prelude.Nothing,
$sel:arn:Robot' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:Robot' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:greenGrassGroupId:Robot' :: Maybe Text
greenGrassGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fleetArn:Robot' :: Maybe Text
fleetArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:Robot' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:architecture:Robot' :: Maybe Architecture
architecture = Maybe Architecture
forall a. Maybe a
Prelude.Nothing,
$sel:lastDeploymentTime:Robot' :: Maybe POSIX
lastDeploymentTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
robot_lastDeploymentJob :: Lens.Lens' Robot (Prelude.Maybe Prelude.Text)
robot_lastDeploymentJob :: (Maybe Text -> f (Maybe Text)) -> Robot -> f Robot
robot_lastDeploymentJob = (Robot -> Maybe Text)
-> (Robot -> Maybe Text -> Robot)
-> Lens Robot Robot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Robot' {Maybe Text
lastDeploymentJob :: Maybe Text
$sel:lastDeploymentJob:Robot' :: Robot -> Maybe Text
lastDeploymentJob} -> Maybe Text
lastDeploymentJob) (\s :: Robot
s@Robot' {} Maybe Text
a -> Robot
s {$sel:lastDeploymentJob:Robot' :: Maybe Text
lastDeploymentJob = Maybe Text
a} :: Robot)
robot_status :: Lens.Lens' Robot (Prelude.Maybe RobotStatus)
robot_status :: (Maybe RobotStatus -> f (Maybe RobotStatus)) -> Robot -> f Robot
robot_status = (Robot -> Maybe RobotStatus)
-> (Robot -> Maybe RobotStatus -> Robot)
-> Lens Robot Robot (Maybe RobotStatus) (Maybe RobotStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Robot' {Maybe RobotStatus
status :: Maybe RobotStatus
$sel:status:Robot' :: Robot -> Maybe RobotStatus
status} -> Maybe RobotStatus
status) (\s :: Robot
s@Robot' {} Maybe RobotStatus
a -> Robot
s {$sel:status:Robot' :: Maybe RobotStatus
status = Maybe RobotStatus
a} :: Robot)
robot_arn :: Lens.Lens' Robot (Prelude.Maybe Prelude.Text)
robot_arn :: (Maybe Text -> f (Maybe Text)) -> Robot -> f Robot
robot_arn = (Robot -> Maybe Text)
-> (Robot -> Maybe Text -> Robot)
-> Lens Robot Robot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Robot' {Maybe Text
arn :: Maybe Text
$sel:arn:Robot' :: Robot -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Robot
s@Robot' {} Maybe Text
a -> Robot
s {$sel:arn:Robot' :: Maybe Text
arn = Maybe Text
a} :: Robot)
robot_createdAt :: Lens.Lens' Robot (Prelude.Maybe Prelude.UTCTime)
robot_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Robot -> f Robot
robot_createdAt = (Robot -> Maybe POSIX)
-> (Robot -> Maybe POSIX -> Robot)
-> Lens Robot Robot (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Robot' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Robot' :: Robot -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Robot
s@Robot' {} Maybe POSIX
a -> Robot
s {$sel:createdAt:Robot' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Robot) ((Maybe POSIX -> f (Maybe POSIX)) -> Robot -> f Robot)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Robot
-> f Robot
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
robot_greenGrassGroupId :: Lens.Lens' Robot (Prelude.Maybe Prelude.Text)
robot_greenGrassGroupId :: (Maybe Text -> f (Maybe Text)) -> Robot -> f Robot
robot_greenGrassGroupId = (Robot -> Maybe Text)
-> (Robot -> Maybe Text -> Robot)
-> Lens Robot Robot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Robot' {Maybe Text
greenGrassGroupId :: Maybe Text
$sel:greenGrassGroupId:Robot' :: Robot -> Maybe Text
greenGrassGroupId} -> Maybe Text
greenGrassGroupId) (\s :: Robot
s@Robot' {} Maybe Text
a -> Robot
s {$sel:greenGrassGroupId:Robot' :: Maybe Text
greenGrassGroupId = Maybe Text
a} :: Robot)
robot_fleetArn :: Lens.Lens' Robot (Prelude.Maybe Prelude.Text)
robot_fleetArn :: (Maybe Text -> f (Maybe Text)) -> Robot -> f Robot
robot_fleetArn = (Robot -> Maybe Text)
-> (Robot -> Maybe Text -> Robot)
-> Lens Robot Robot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Robot' {Maybe Text
fleetArn :: Maybe Text
$sel:fleetArn:Robot' :: Robot -> Maybe Text
fleetArn} -> Maybe Text
fleetArn) (\s :: Robot
s@Robot' {} Maybe Text
a -> Robot
s {$sel:fleetArn:Robot' :: Maybe Text
fleetArn = Maybe Text
a} :: Robot)
robot_name :: Lens.Lens' Robot (Prelude.Maybe Prelude.Text)
robot_name :: (Maybe Text -> f (Maybe Text)) -> Robot -> f Robot
robot_name = (Robot -> Maybe Text)
-> (Robot -> Maybe Text -> Robot)
-> Lens Robot Robot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Robot' {Maybe Text
name :: Maybe Text
$sel:name:Robot' :: Robot -> Maybe Text
name} -> Maybe Text
name) (\s :: Robot
s@Robot' {} Maybe Text
a -> Robot
s {$sel:name:Robot' :: Maybe Text
name = Maybe Text
a} :: Robot)
robot_architecture :: Lens.Lens' Robot (Prelude.Maybe Architecture)
robot_architecture :: (Maybe Architecture -> f (Maybe Architecture)) -> Robot -> f Robot
robot_architecture = (Robot -> Maybe Architecture)
-> (Robot -> Maybe Architecture -> Robot)
-> Lens Robot Robot (Maybe Architecture) (Maybe Architecture)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Robot' {Maybe Architecture
architecture :: Maybe Architecture
$sel:architecture:Robot' :: Robot -> Maybe Architecture
architecture} -> Maybe Architecture
architecture) (\s :: Robot
s@Robot' {} Maybe Architecture
a -> Robot
s {$sel:architecture:Robot' :: Maybe Architecture
architecture = Maybe Architecture
a} :: Robot)
robot_lastDeploymentTime :: Lens.Lens' Robot (Prelude.Maybe Prelude.UTCTime)
robot_lastDeploymentTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Robot -> f Robot
robot_lastDeploymentTime = (Robot -> Maybe POSIX)
-> (Robot -> Maybe POSIX -> Robot)
-> Lens Robot Robot (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Robot' {Maybe POSIX
lastDeploymentTime :: Maybe POSIX
$sel:lastDeploymentTime:Robot' :: Robot -> Maybe POSIX
lastDeploymentTime} -> Maybe POSIX
lastDeploymentTime) (\s :: Robot
s@Robot' {} Maybe POSIX
a -> Robot
s {$sel:lastDeploymentTime:Robot' :: Maybe POSIX
lastDeploymentTime = Maybe POSIX
a} :: Robot) ((Maybe POSIX -> f (Maybe POSIX)) -> Robot -> f Robot)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Robot
-> f Robot
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON Robot where
parseJSON :: Value -> Parser Robot
parseJSON =
String -> (Object -> Parser Robot) -> Value -> Parser Robot
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Robot"
( \Object
x ->
Maybe Text
-> Maybe RobotStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Architecture
-> Maybe POSIX
-> Robot
Robot'
(Maybe Text
-> Maybe RobotStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Architecture
-> Maybe POSIX
-> Robot)
-> Parser (Maybe Text)
-> Parser
(Maybe RobotStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Architecture
-> Maybe POSIX
-> Robot)
forall (f :: * -> *) a b. Functor 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
"lastDeploymentJob")
Parser
(Maybe RobotStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Architecture
-> Maybe POSIX
-> Robot)
-> Parser (Maybe RobotStatus)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Architecture
-> Maybe POSIX
-> Robot)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RobotStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Architecture
-> Maybe POSIX
-> Robot)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Architecture
-> Maybe POSIX
-> Robot)
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 POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Architecture
-> Maybe POSIX
-> Robot)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Architecture
-> Maybe POSIX
-> Robot)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Architecture
-> Maybe POSIX
-> Robot)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Architecture -> Maybe POSIX -> Robot)
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
"greenGrassGroupId")
Parser
(Maybe Text
-> Maybe Text -> Maybe Architecture -> Maybe POSIX -> Robot)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Architecture -> Maybe POSIX -> Robot)
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
"fleetArn")
Parser (Maybe Text -> Maybe Architecture -> Maybe POSIX -> Robot)
-> Parser (Maybe Text)
-> Parser (Maybe Architecture -> Maybe POSIX -> Robot)
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
"name")
Parser (Maybe Architecture -> Maybe POSIX -> Robot)
-> Parser (Maybe Architecture) -> Parser (Maybe POSIX -> Robot)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Architecture)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"architecture")
Parser (Maybe POSIX -> Robot)
-> Parser (Maybe POSIX) -> Parser Robot
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastDeploymentTime")
)
instance Prelude.Hashable Robot
instance Prelude.NFData Robot