{-# 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.FailedCreateSimulationJobRequest
-- 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.FailedCreateSimulationJobRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RobOMaker.Types.SimulationJobErrorCode
import Amazonka.RobOMaker.Types.SimulationJobRequest

-- | Information about a failed create simulation job request.
--
-- /See:/ 'newFailedCreateSimulationJobRequest' smart constructor.
data FailedCreateSimulationJobRequest = FailedCreateSimulationJobRequest'
  { -- | The failure reason of the simulation job request.
    FailedCreateSimulationJobRequest -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | The failure code.
    FailedCreateSimulationJobRequest -> Maybe SimulationJobErrorCode
failureCode :: Prelude.Maybe SimulationJobErrorCode,
    -- | The time, in milliseconds since the epoch, when the simulation job batch
    -- failed.
    FailedCreateSimulationJobRequest -> Maybe POSIX
failedAt :: Prelude.Maybe Core.POSIX,
    -- | The simulation job request.
    FailedCreateSimulationJobRequest -> Maybe SimulationJobRequest
request :: Prelude.Maybe SimulationJobRequest
  }
  deriving (FailedCreateSimulationJobRequest
-> FailedCreateSimulationJobRequest -> Bool
(FailedCreateSimulationJobRequest
 -> FailedCreateSimulationJobRequest -> Bool)
-> (FailedCreateSimulationJobRequest
    -> FailedCreateSimulationJobRequest -> Bool)
-> Eq FailedCreateSimulationJobRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FailedCreateSimulationJobRequest
-> FailedCreateSimulationJobRequest -> Bool
$c/= :: FailedCreateSimulationJobRequest
-> FailedCreateSimulationJobRequest -> Bool
== :: FailedCreateSimulationJobRequest
-> FailedCreateSimulationJobRequest -> Bool
$c== :: FailedCreateSimulationJobRequest
-> FailedCreateSimulationJobRequest -> Bool
Prelude.Eq, ReadPrec [FailedCreateSimulationJobRequest]
ReadPrec FailedCreateSimulationJobRequest
Int -> ReadS FailedCreateSimulationJobRequest
ReadS [FailedCreateSimulationJobRequest]
(Int -> ReadS FailedCreateSimulationJobRequest)
-> ReadS [FailedCreateSimulationJobRequest]
-> ReadPrec FailedCreateSimulationJobRequest
-> ReadPrec [FailedCreateSimulationJobRequest]
-> Read FailedCreateSimulationJobRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FailedCreateSimulationJobRequest]
$creadListPrec :: ReadPrec [FailedCreateSimulationJobRequest]
readPrec :: ReadPrec FailedCreateSimulationJobRequest
$creadPrec :: ReadPrec FailedCreateSimulationJobRequest
readList :: ReadS [FailedCreateSimulationJobRequest]
$creadList :: ReadS [FailedCreateSimulationJobRequest]
readsPrec :: Int -> ReadS FailedCreateSimulationJobRequest
$creadsPrec :: Int -> ReadS FailedCreateSimulationJobRequest
Prelude.Read, Int -> FailedCreateSimulationJobRequest -> ShowS
[FailedCreateSimulationJobRequest] -> ShowS
FailedCreateSimulationJobRequest -> String
(Int -> FailedCreateSimulationJobRequest -> ShowS)
-> (FailedCreateSimulationJobRequest -> String)
-> ([FailedCreateSimulationJobRequest] -> ShowS)
-> Show FailedCreateSimulationJobRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FailedCreateSimulationJobRequest] -> ShowS
$cshowList :: [FailedCreateSimulationJobRequest] -> ShowS
show :: FailedCreateSimulationJobRequest -> String
$cshow :: FailedCreateSimulationJobRequest -> String
showsPrec :: Int -> FailedCreateSimulationJobRequest -> ShowS
$cshowsPrec :: Int -> FailedCreateSimulationJobRequest -> ShowS
Prelude.Show, (forall x.
 FailedCreateSimulationJobRequest
 -> Rep FailedCreateSimulationJobRequest x)
-> (forall x.
    Rep FailedCreateSimulationJobRequest x
    -> FailedCreateSimulationJobRequest)
-> Generic FailedCreateSimulationJobRequest
forall x.
Rep FailedCreateSimulationJobRequest x
-> FailedCreateSimulationJobRequest
forall x.
FailedCreateSimulationJobRequest
-> Rep FailedCreateSimulationJobRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FailedCreateSimulationJobRequest x
-> FailedCreateSimulationJobRequest
$cfrom :: forall x.
FailedCreateSimulationJobRequest
-> Rep FailedCreateSimulationJobRequest x
Prelude.Generic)

-- |
-- Create a value of 'FailedCreateSimulationJobRequest' 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:
--
-- 'failureReason', 'failedCreateSimulationJobRequest_failureReason' - The failure reason of the simulation job request.
--
-- 'failureCode', 'failedCreateSimulationJobRequest_failureCode' - The failure code.
--
-- 'failedAt', 'failedCreateSimulationJobRequest_failedAt' - The time, in milliseconds since the epoch, when the simulation job batch
-- failed.
--
-- 'request', 'failedCreateSimulationJobRequest_request' - The simulation job request.
newFailedCreateSimulationJobRequest ::
  FailedCreateSimulationJobRequest
newFailedCreateSimulationJobRequest :: FailedCreateSimulationJobRequest
newFailedCreateSimulationJobRequest =
  FailedCreateSimulationJobRequest' :: Maybe Text
-> Maybe SimulationJobErrorCode
-> Maybe POSIX
-> Maybe SimulationJobRequest
-> FailedCreateSimulationJobRequest
FailedCreateSimulationJobRequest'
    { $sel:failureReason:FailedCreateSimulationJobRequest' :: Maybe Text
failureReason =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:failureCode:FailedCreateSimulationJobRequest' :: Maybe SimulationJobErrorCode
failureCode = Maybe SimulationJobErrorCode
forall a. Maybe a
Prelude.Nothing,
      $sel:failedAt:FailedCreateSimulationJobRequest' :: Maybe POSIX
failedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:request:FailedCreateSimulationJobRequest' :: Maybe SimulationJobRequest
request = Maybe SimulationJobRequest
forall a. Maybe a
Prelude.Nothing
    }

-- | The failure reason of the simulation job request.
failedCreateSimulationJobRequest_failureReason :: Lens.Lens' FailedCreateSimulationJobRequest (Prelude.Maybe Prelude.Text)
failedCreateSimulationJobRequest_failureReason :: (Maybe Text -> f (Maybe Text))
-> FailedCreateSimulationJobRequest
-> f FailedCreateSimulationJobRequest
failedCreateSimulationJobRequest_failureReason = (FailedCreateSimulationJobRequest -> Maybe Text)
-> (FailedCreateSimulationJobRequest
    -> Maybe Text -> FailedCreateSimulationJobRequest)
-> Lens
     FailedCreateSimulationJobRequest
     FailedCreateSimulationJobRequest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedCreateSimulationJobRequest' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:FailedCreateSimulationJobRequest' :: FailedCreateSimulationJobRequest -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: FailedCreateSimulationJobRequest
s@FailedCreateSimulationJobRequest' {} Maybe Text
a -> FailedCreateSimulationJobRequest
s {$sel:failureReason:FailedCreateSimulationJobRequest' :: Maybe Text
failureReason = Maybe Text
a} :: FailedCreateSimulationJobRequest)

-- | The failure code.
failedCreateSimulationJobRequest_failureCode :: Lens.Lens' FailedCreateSimulationJobRequest (Prelude.Maybe SimulationJobErrorCode)
failedCreateSimulationJobRequest_failureCode :: (Maybe SimulationJobErrorCode -> f (Maybe SimulationJobErrorCode))
-> FailedCreateSimulationJobRequest
-> f FailedCreateSimulationJobRequest
failedCreateSimulationJobRequest_failureCode = (FailedCreateSimulationJobRequest -> Maybe SimulationJobErrorCode)
-> (FailedCreateSimulationJobRequest
    -> Maybe SimulationJobErrorCode
    -> FailedCreateSimulationJobRequest)
-> Lens
     FailedCreateSimulationJobRequest
     FailedCreateSimulationJobRequest
     (Maybe SimulationJobErrorCode)
     (Maybe SimulationJobErrorCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedCreateSimulationJobRequest' {Maybe SimulationJobErrorCode
failureCode :: Maybe SimulationJobErrorCode
$sel:failureCode:FailedCreateSimulationJobRequest' :: FailedCreateSimulationJobRequest -> Maybe SimulationJobErrorCode
failureCode} -> Maybe SimulationJobErrorCode
failureCode) (\s :: FailedCreateSimulationJobRequest
s@FailedCreateSimulationJobRequest' {} Maybe SimulationJobErrorCode
a -> FailedCreateSimulationJobRequest
s {$sel:failureCode:FailedCreateSimulationJobRequest' :: Maybe SimulationJobErrorCode
failureCode = Maybe SimulationJobErrorCode
a} :: FailedCreateSimulationJobRequest)

-- | The time, in milliseconds since the epoch, when the simulation job batch
-- failed.
failedCreateSimulationJobRequest_failedAt :: Lens.Lens' FailedCreateSimulationJobRequest (Prelude.Maybe Prelude.UTCTime)
failedCreateSimulationJobRequest_failedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> FailedCreateSimulationJobRequest
-> f FailedCreateSimulationJobRequest
failedCreateSimulationJobRequest_failedAt = (FailedCreateSimulationJobRequest -> Maybe POSIX)
-> (FailedCreateSimulationJobRequest
    -> Maybe POSIX -> FailedCreateSimulationJobRequest)
-> Lens
     FailedCreateSimulationJobRequest
     FailedCreateSimulationJobRequest
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedCreateSimulationJobRequest' {Maybe POSIX
failedAt :: Maybe POSIX
$sel:failedAt:FailedCreateSimulationJobRequest' :: FailedCreateSimulationJobRequest -> Maybe POSIX
failedAt} -> Maybe POSIX
failedAt) (\s :: FailedCreateSimulationJobRequest
s@FailedCreateSimulationJobRequest' {} Maybe POSIX
a -> FailedCreateSimulationJobRequest
s {$sel:failedAt:FailedCreateSimulationJobRequest' :: Maybe POSIX
failedAt = Maybe POSIX
a} :: FailedCreateSimulationJobRequest) ((Maybe POSIX -> f (Maybe POSIX))
 -> FailedCreateSimulationJobRequest
 -> f FailedCreateSimulationJobRequest)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> FailedCreateSimulationJobRequest
-> f FailedCreateSimulationJobRequest
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 simulation job request.
failedCreateSimulationJobRequest_request :: Lens.Lens' FailedCreateSimulationJobRequest (Prelude.Maybe SimulationJobRequest)
failedCreateSimulationJobRequest_request :: (Maybe SimulationJobRequest -> f (Maybe SimulationJobRequest))
-> FailedCreateSimulationJobRequest
-> f FailedCreateSimulationJobRequest
failedCreateSimulationJobRequest_request = (FailedCreateSimulationJobRequest -> Maybe SimulationJobRequest)
-> (FailedCreateSimulationJobRequest
    -> Maybe SimulationJobRequest -> FailedCreateSimulationJobRequest)
-> Lens
     FailedCreateSimulationJobRequest
     FailedCreateSimulationJobRequest
     (Maybe SimulationJobRequest)
     (Maybe SimulationJobRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedCreateSimulationJobRequest' {Maybe SimulationJobRequest
request :: Maybe SimulationJobRequest
$sel:request:FailedCreateSimulationJobRequest' :: FailedCreateSimulationJobRequest -> Maybe SimulationJobRequest
request} -> Maybe SimulationJobRequest
request) (\s :: FailedCreateSimulationJobRequest
s@FailedCreateSimulationJobRequest' {} Maybe SimulationJobRequest
a -> FailedCreateSimulationJobRequest
s {$sel:request:FailedCreateSimulationJobRequest' :: Maybe SimulationJobRequest
request = Maybe SimulationJobRequest
a} :: FailedCreateSimulationJobRequest)

instance
  Core.FromJSON
    FailedCreateSimulationJobRequest
  where
  parseJSON :: Value -> Parser FailedCreateSimulationJobRequest
parseJSON =
    String
-> (Object -> Parser FailedCreateSimulationJobRequest)
-> Value
-> Parser FailedCreateSimulationJobRequest
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FailedCreateSimulationJobRequest"
      ( \Object
x ->
          Maybe Text
-> Maybe SimulationJobErrorCode
-> Maybe POSIX
-> Maybe SimulationJobRequest
-> FailedCreateSimulationJobRequest
FailedCreateSimulationJobRequest'
            (Maybe Text
 -> Maybe SimulationJobErrorCode
 -> Maybe POSIX
 -> Maybe SimulationJobRequest
 -> FailedCreateSimulationJobRequest)
-> Parser (Maybe Text)
-> Parser
     (Maybe SimulationJobErrorCode
      -> Maybe POSIX
      -> Maybe SimulationJobRequest
      -> FailedCreateSimulationJobRequest)
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
"failureReason")
            Parser
  (Maybe SimulationJobErrorCode
   -> Maybe POSIX
   -> Maybe SimulationJobRequest
   -> FailedCreateSimulationJobRequest)
-> Parser (Maybe SimulationJobErrorCode)
-> Parser
     (Maybe POSIX
      -> Maybe SimulationJobRequest -> FailedCreateSimulationJobRequest)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SimulationJobErrorCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"failureCode")
            Parser
  (Maybe POSIX
   -> Maybe SimulationJobRequest -> FailedCreateSimulationJobRequest)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe SimulationJobRequest -> FailedCreateSimulationJobRequest)
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
"failedAt")
            Parser
  (Maybe SimulationJobRequest -> FailedCreateSimulationJobRequest)
-> Parser (Maybe SimulationJobRequest)
-> Parser FailedCreateSimulationJobRequest
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SimulationJobRequest)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"request")
      )

instance
  Prelude.Hashable
    FailedCreateSimulationJobRequest

instance
  Prelude.NFData
    FailedCreateSimulationJobRequest