{-# 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.RobotDeployment where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RobOMaker.Types.DeploymentJobErrorCode
import Amazonka.RobOMaker.Types.ProgressDetail
import Amazonka.RobOMaker.Types.RobotStatus
data RobotDeployment = RobotDeployment'
{
RobotDeployment -> Maybe POSIX
deploymentStartTime :: Prelude.Maybe Core.POSIX,
RobotDeployment -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
RobotDeployment -> Maybe RobotStatus
status :: Prelude.Maybe RobotStatus,
RobotDeployment -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
RobotDeployment -> Maybe DeploymentJobErrorCode
failureCode :: Prelude.Maybe DeploymentJobErrorCode,
RobotDeployment -> Maybe ProgressDetail
progressDetail :: Prelude.Maybe ProgressDetail,
RobotDeployment -> Maybe POSIX
deploymentFinishTime :: Prelude.Maybe Core.POSIX
}
deriving (RobotDeployment -> RobotDeployment -> Bool
(RobotDeployment -> RobotDeployment -> Bool)
-> (RobotDeployment -> RobotDeployment -> Bool)
-> Eq RobotDeployment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RobotDeployment -> RobotDeployment -> Bool
$c/= :: RobotDeployment -> RobotDeployment -> Bool
== :: RobotDeployment -> RobotDeployment -> Bool
$c== :: RobotDeployment -> RobotDeployment -> Bool
Prelude.Eq, ReadPrec [RobotDeployment]
ReadPrec RobotDeployment
Int -> ReadS RobotDeployment
ReadS [RobotDeployment]
(Int -> ReadS RobotDeployment)
-> ReadS [RobotDeployment]
-> ReadPrec RobotDeployment
-> ReadPrec [RobotDeployment]
-> Read RobotDeployment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RobotDeployment]
$creadListPrec :: ReadPrec [RobotDeployment]
readPrec :: ReadPrec RobotDeployment
$creadPrec :: ReadPrec RobotDeployment
readList :: ReadS [RobotDeployment]
$creadList :: ReadS [RobotDeployment]
readsPrec :: Int -> ReadS RobotDeployment
$creadsPrec :: Int -> ReadS RobotDeployment
Prelude.Read, Int -> RobotDeployment -> ShowS
[RobotDeployment] -> ShowS
RobotDeployment -> String
(Int -> RobotDeployment -> ShowS)
-> (RobotDeployment -> String)
-> ([RobotDeployment] -> ShowS)
-> Show RobotDeployment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RobotDeployment] -> ShowS
$cshowList :: [RobotDeployment] -> ShowS
show :: RobotDeployment -> String
$cshow :: RobotDeployment -> String
showsPrec :: Int -> RobotDeployment -> ShowS
$cshowsPrec :: Int -> RobotDeployment -> ShowS
Prelude.Show, (forall x. RobotDeployment -> Rep RobotDeployment x)
-> (forall x. Rep RobotDeployment x -> RobotDeployment)
-> Generic RobotDeployment
forall x. Rep RobotDeployment x -> RobotDeployment
forall x. RobotDeployment -> Rep RobotDeployment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RobotDeployment x -> RobotDeployment
$cfrom :: forall x. RobotDeployment -> Rep RobotDeployment x
Prelude.Generic)
newRobotDeployment ::
RobotDeployment
newRobotDeployment :: RobotDeployment
newRobotDeployment =
RobotDeployment' :: Maybe POSIX
-> Maybe Text
-> Maybe RobotStatus
-> Maybe Text
-> Maybe DeploymentJobErrorCode
-> Maybe ProgressDetail
-> Maybe POSIX
-> RobotDeployment
RobotDeployment'
{ $sel:deploymentStartTime:RobotDeployment' :: Maybe POSIX
deploymentStartTime =
Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:failureReason:RobotDeployment' :: Maybe Text
failureReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:RobotDeployment' :: Maybe RobotStatus
status = Maybe RobotStatus
forall a. Maybe a
Prelude.Nothing,
$sel:arn:RobotDeployment' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:failureCode:RobotDeployment' :: Maybe DeploymentJobErrorCode
failureCode = Maybe DeploymentJobErrorCode
forall a. Maybe a
Prelude.Nothing,
$sel:progressDetail:RobotDeployment' :: Maybe ProgressDetail
progressDetail = Maybe ProgressDetail
forall a. Maybe a
Prelude.Nothing,
$sel:deploymentFinishTime:RobotDeployment' :: Maybe POSIX
deploymentFinishTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
robotDeployment_deploymentStartTime :: Lens.Lens' RobotDeployment (Prelude.Maybe Prelude.UTCTime)
robotDeployment_deploymentStartTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> RobotDeployment -> f RobotDeployment
robotDeployment_deploymentStartTime = (RobotDeployment -> Maybe POSIX)
-> (RobotDeployment -> Maybe POSIX -> RobotDeployment)
-> Lens RobotDeployment RobotDeployment (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RobotDeployment' {Maybe POSIX
deploymentStartTime :: Maybe POSIX
$sel:deploymentStartTime:RobotDeployment' :: RobotDeployment -> Maybe POSIX
deploymentStartTime} -> Maybe POSIX
deploymentStartTime) (\s :: RobotDeployment
s@RobotDeployment' {} Maybe POSIX
a -> RobotDeployment
s {$sel:deploymentStartTime:RobotDeployment' :: Maybe POSIX
deploymentStartTime = Maybe POSIX
a} :: RobotDeployment) ((Maybe POSIX -> f (Maybe POSIX))
-> RobotDeployment -> f RobotDeployment)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> RobotDeployment
-> f RobotDeployment
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
robotDeployment_failureReason :: Lens.Lens' RobotDeployment (Prelude.Maybe Prelude.Text)
robotDeployment_failureReason :: (Maybe Text -> f (Maybe Text))
-> RobotDeployment -> f RobotDeployment
robotDeployment_failureReason = (RobotDeployment -> Maybe Text)
-> (RobotDeployment -> Maybe Text -> RobotDeployment)
-> Lens RobotDeployment RobotDeployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RobotDeployment' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:RobotDeployment' :: RobotDeployment -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: RobotDeployment
s@RobotDeployment' {} Maybe Text
a -> RobotDeployment
s {$sel:failureReason:RobotDeployment' :: Maybe Text
failureReason = Maybe Text
a} :: RobotDeployment)
robotDeployment_status :: Lens.Lens' RobotDeployment (Prelude.Maybe RobotStatus)
robotDeployment_status :: (Maybe RobotStatus -> f (Maybe RobotStatus))
-> RobotDeployment -> f RobotDeployment
robotDeployment_status = (RobotDeployment -> Maybe RobotStatus)
-> (RobotDeployment -> Maybe RobotStatus -> RobotDeployment)
-> Lens
RobotDeployment
RobotDeployment
(Maybe RobotStatus)
(Maybe RobotStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RobotDeployment' {Maybe RobotStatus
status :: Maybe RobotStatus
$sel:status:RobotDeployment' :: RobotDeployment -> Maybe RobotStatus
status} -> Maybe RobotStatus
status) (\s :: RobotDeployment
s@RobotDeployment' {} Maybe RobotStatus
a -> RobotDeployment
s {$sel:status:RobotDeployment' :: Maybe RobotStatus
status = Maybe RobotStatus
a} :: RobotDeployment)
robotDeployment_arn :: Lens.Lens' RobotDeployment (Prelude.Maybe Prelude.Text)
robotDeployment_arn :: (Maybe Text -> f (Maybe Text))
-> RobotDeployment -> f RobotDeployment
robotDeployment_arn = (RobotDeployment -> Maybe Text)
-> (RobotDeployment -> Maybe Text -> RobotDeployment)
-> Lens RobotDeployment RobotDeployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RobotDeployment' {Maybe Text
arn :: Maybe Text
$sel:arn:RobotDeployment' :: RobotDeployment -> Maybe Text
arn} -> Maybe Text
arn) (\s :: RobotDeployment
s@RobotDeployment' {} Maybe Text
a -> RobotDeployment
s {$sel:arn:RobotDeployment' :: Maybe Text
arn = Maybe Text
a} :: RobotDeployment)
robotDeployment_failureCode :: Lens.Lens' RobotDeployment (Prelude.Maybe DeploymentJobErrorCode)
robotDeployment_failureCode :: (Maybe DeploymentJobErrorCode -> f (Maybe DeploymentJobErrorCode))
-> RobotDeployment -> f RobotDeployment
robotDeployment_failureCode = (RobotDeployment -> Maybe DeploymentJobErrorCode)
-> (RobotDeployment
-> Maybe DeploymentJobErrorCode -> RobotDeployment)
-> Lens
RobotDeployment
RobotDeployment
(Maybe DeploymentJobErrorCode)
(Maybe DeploymentJobErrorCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RobotDeployment' {Maybe DeploymentJobErrorCode
failureCode :: Maybe DeploymentJobErrorCode
$sel:failureCode:RobotDeployment' :: RobotDeployment -> Maybe DeploymentJobErrorCode
failureCode} -> Maybe DeploymentJobErrorCode
failureCode) (\s :: RobotDeployment
s@RobotDeployment' {} Maybe DeploymentJobErrorCode
a -> RobotDeployment
s {$sel:failureCode:RobotDeployment' :: Maybe DeploymentJobErrorCode
failureCode = Maybe DeploymentJobErrorCode
a} :: RobotDeployment)
robotDeployment_progressDetail :: Lens.Lens' RobotDeployment (Prelude.Maybe ProgressDetail)
robotDeployment_progressDetail :: (Maybe ProgressDetail -> f (Maybe ProgressDetail))
-> RobotDeployment -> f RobotDeployment
robotDeployment_progressDetail = (RobotDeployment -> Maybe ProgressDetail)
-> (RobotDeployment -> Maybe ProgressDetail -> RobotDeployment)
-> Lens
RobotDeployment
RobotDeployment
(Maybe ProgressDetail)
(Maybe ProgressDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RobotDeployment' {Maybe ProgressDetail
progressDetail :: Maybe ProgressDetail
$sel:progressDetail:RobotDeployment' :: RobotDeployment -> Maybe ProgressDetail
progressDetail} -> Maybe ProgressDetail
progressDetail) (\s :: RobotDeployment
s@RobotDeployment' {} Maybe ProgressDetail
a -> RobotDeployment
s {$sel:progressDetail:RobotDeployment' :: Maybe ProgressDetail
progressDetail = Maybe ProgressDetail
a} :: RobotDeployment)
robotDeployment_deploymentFinishTime :: Lens.Lens' RobotDeployment (Prelude.Maybe Prelude.UTCTime)
robotDeployment_deploymentFinishTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> RobotDeployment -> f RobotDeployment
robotDeployment_deploymentFinishTime = (RobotDeployment -> Maybe POSIX)
-> (RobotDeployment -> Maybe POSIX -> RobotDeployment)
-> Lens RobotDeployment RobotDeployment (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RobotDeployment' {Maybe POSIX
deploymentFinishTime :: Maybe POSIX
$sel:deploymentFinishTime:RobotDeployment' :: RobotDeployment -> Maybe POSIX
deploymentFinishTime} -> Maybe POSIX
deploymentFinishTime) (\s :: RobotDeployment
s@RobotDeployment' {} Maybe POSIX
a -> RobotDeployment
s {$sel:deploymentFinishTime:RobotDeployment' :: Maybe POSIX
deploymentFinishTime = Maybe POSIX
a} :: RobotDeployment) ((Maybe POSIX -> f (Maybe POSIX))
-> RobotDeployment -> f RobotDeployment)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> RobotDeployment
-> f RobotDeployment
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 RobotDeployment where
parseJSON :: Value -> Parser RobotDeployment
parseJSON =
String
-> (Object -> Parser RobotDeployment)
-> Value
-> Parser RobotDeployment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RobotDeployment"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe RobotStatus
-> Maybe Text
-> Maybe DeploymentJobErrorCode
-> Maybe ProgressDetail
-> Maybe POSIX
-> RobotDeployment
RobotDeployment'
(Maybe POSIX
-> Maybe Text
-> Maybe RobotStatus
-> Maybe Text
-> Maybe DeploymentJobErrorCode
-> Maybe ProgressDetail
-> Maybe POSIX
-> RobotDeployment)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe RobotStatus
-> Maybe Text
-> Maybe DeploymentJobErrorCode
-> Maybe ProgressDetail
-> Maybe POSIX
-> RobotDeployment)
forall (f :: * -> *) a b. Functor 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
"deploymentStartTime")
Parser
(Maybe Text
-> Maybe RobotStatus
-> Maybe Text
-> Maybe DeploymentJobErrorCode
-> Maybe ProgressDetail
-> Maybe POSIX
-> RobotDeployment)
-> Parser (Maybe Text)
-> Parser
(Maybe RobotStatus
-> Maybe Text
-> Maybe DeploymentJobErrorCode
-> Maybe ProgressDetail
-> Maybe POSIX
-> RobotDeployment)
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
"failureReason")
Parser
(Maybe RobotStatus
-> Maybe Text
-> Maybe DeploymentJobErrorCode
-> Maybe ProgressDetail
-> Maybe POSIX
-> RobotDeployment)
-> Parser (Maybe RobotStatus)
-> Parser
(Maybe Text
-> Maybe DeploymentJobErrorCode
-> Maybe ProgressDetail
-> Maybe POSIX
-> RobotDeployment)
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 DeploymentJobErrorCode
-> Maybe ProgressDetail
-> Maybe POSIX
-> RobotDeployment)
-> Parser (Maybe Text)
-> Parser
(Maybe DeploymentJobErrorCode
-> Maybe ProgressDetail -> Maybe POSIX -> RobotDeployment)
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 DeploymentJobErrorCode
-> Maybe ProgressDetail -> Maybe POSIX -> RobotDeployment)
-> Parser (Maybe DeploymentJobErrorCode)
-> Parser (Maybe ProgressDetail -> Maybe POSIX -> RobotDeployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DeploymentJobErrorCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"failureCode")
Parser (Maybe ProgressDetail -> Maybe POSIX -> RobotDeployment)
-> Parser (Maybe ProgressDetail)
-> Parser (Maybe POSIX -> RobotDeployment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ProgressDetail)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"progressDetail")
Parser (Maybe POSIX -> RobotDeployment)
-> Parser (Maybe POSIX) -> Parser RobotDeployment
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
"deploymentFinishTime")
)
instance Prelude.Hashable RobotDeployment
instance Prelude.NFData RobotDeployment