{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.RobOMaker.Types.Robot
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Information about a robot.
--
-- /See:/ 'newRobot' smart constructor.
data Robot = Robot'
  { -- | The Amazon Resource Name (ARN) of the last deployment job.
    Robot -> Maybe Text
lastDeploymentJob :: Prelude.Maybe Prelude.Text,
    -- | The status of the robot.
    Robot -> Maybe RobotStatus
status :: Prelude.Maybe RobotStatus,
    -- | The Amazon Resource Name (ARN) of the robot.
    Robot -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time, in milliseconds since the epoch, when the robot was created.
    Robot -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The Greengrass group associated with the robot.
    Robot -> Maybe Text
greenGrassGroupId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the fleet.
    Robot -> Maybe Text
fleetArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the robot.
    Robot -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The architecture of the robot.
    Robot -> Maybe Architecture
architecture :: Prelude.Maybe Architecture,
    -- | The time of the last deployment.
    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)

-- |
-- Create a value of 'Robot' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'lastDeploymentJob', 'robot_lastDeploymentJob' - The Amazon Resource Name (ARN) of the last deployment job.
--
-- 'status', 'robot_status' - The status of the robot.
--
-- 'arn', 'robot_arn' - The Amazon Resource Name (ARN) of the robot.
--
-- 'createdAt', 'robot_createdAt' - The time, in milliseconds since the epoch, when the robot was created.
--
-- 'greenGrassGroupId', 'robot_greenGrassGroupId' - The Greengrass group associated with the robot.
--
-- 'fleetArn', 'robot_fleetArn' - The Amazon Resource Name (ARN) of the fleet.
--
-- 'name', 'robot_name' - The name of the robot.
--
-- 'architecture', 'robot_architecture' - The architecture of the robot.
--
-- 'lastDeploymentTime', 'robot_lastDeploymentTime' - The time of the last deployment.
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
    }

-- | The Amazon Resource Name (ARN) of the last deployment job.
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)

-- | The status of the 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)

-- | The Amazon Resource Name (ARN) of the 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)

-- | The time, in milliseconds since the epoch, when the robot was created.
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

-- | The Greengrass group associated with the robot.
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)

-- | The Amazon Resource Name (ARN) of the fleet.
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)

-- | The name of the 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)

-- | The architecture of the 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)

-- | The time of the last deployment.
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