{-# 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.DrS.Types.JobLogEventData
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DrS.Types.JobLogEventData where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DrS.Types.ConversionProperties
import qualified Amazonka.Prelude as Prelude

-- | Metadata associated with a Job log.
--
-- /See:/ 'newJobLogEventData' smart constructor.
data JobLogEventData = JobLogEventData'
  { -- | Properties of a conversion job
    JobLogEventData -> Maybe ConversionProperties
conversionProperties :: Prelude.Maybe ConversionProperties,
    -- | The ID of a conversion server.
    JobLogEventData -> Maybe Text
conversionServerID :: Prelude.Maybe Prelude.Text,
    -- | A string representing a job error.
    JobLogEventData -> Maybe Text
rawError :: Prelude.Maybe Prelude.Text,
    -- | The ID of a Source Server.
    JobLogEventData -> Maybe Text
sourceServerID :: Prelude.Maybe Prelude.Text,
    -- | The ID of a Recovery Instance.
    JobLogEventData -> Maybe Text
targetInstanceID :: Prelude.Maybe Prelude.Text
  }
  deriving (JobLogEventData -> JobLogEventData -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JobLogEventData -> JobLogEventData -> Bool
$c/= :: JobLogEventData -> JobLogEventData -> Bool
== :: JobLogEventData -> JobLogEventData -> Bool
$c== :: JobLogEventData -> JobLogEventData -> Bool
Prelude.Eq, ReadPrec [JobLogEventData]
ReadPrec JobLogEventData
Int -> ReadS JobLogEventData
ReadS [JobLogEventData]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JobLogEventData]
$creadListPrec :: ReadPrec [JobLogEventData]
readPrec :: ReadPrec JobLogEventData
$creadPrec :: ReadPrec JobLogEventData
readList :: ReadS [JobLogEventData]
$creadList :: ReadS [JobLogEventData]
readsPrec :: Int -> ReadS JobLogEventData
$creadsPrec :: Int -> ReadS JobLogEventData
Prelude.Read, Int -> JobLogEventData -> ShowS
[JobLogEventData] -> ShowS
JobLogEventData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JobLogEventData] -> ShowS
$cshowList :: [JobLogEventData] -> ShowS
show :: JobLogEventData -> String
$cshow :: JobLogEventData -> String
showsPrec :: Int -> JobLogEventData -> ShowS
$cshowsPrec :: Int -> JobLogEventData -> ShowS
Prelude.Show, forall x. Rep JobLogEventData x -> JobLogEventData
forall x. JobLogEventData -> Rep JobLogEventData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JobLogEventData x -> JobLogEventData
$cfrom :: forall x. JobLogEventData -> Rep JobLogEventData x
Prelude.Generic)

-- |
-- Create a value of 'JobLogEventData' 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:
--
-- 'conversionProperties', 'jobLogEventData_conversionProperties' - Properties of a conversion job
--
-- 'conversionServerID', 'jobLogEventData_conversionServerID' - The ID of a conversion server.
--
-- 'rawError', 'jobLogEventData_rawError' - A string representing a job error.
--
-- 'sourceServerID', 'jobLogEventData_sourceServerID' - The ID of a Source Server.
--
-- 'targetInstanceID', 'jobLogEventData_targetInstanceID' - The ID of a Recovery Instance.
newJobLogEventData ::
  JobLogEventData
newJobLogEventData :: JobLogEventData
newJobLogEventData =
  JobLogEventData'
    { $sel:conversionProperties:JobLogEventData' :: Maybe ConversionProperties
conversionProperties =
        forall a. Maybe a
Prelude.Nothing,
      $sel:conversionServerID:JobLogEventData' :: Maybe Text
conversionServerID = forall a. Maybe a
Prelude.Nothing,
      $sel:rawError:JobLogEventData' :: Maybe Text
rawError = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceServerID:JobLogEventData' :: Maybe Text
sourceServerID = forall a. Maybe a
Prelude.Nothing,
      $sel:targetInstanceID:JobLogEventData' :: Maybe Text
targetInstanceID = forall a. Maybe a
Prelude.Nothing
    }

-- | Properties of a conversion job
jobLogEventData_conversionProperties :: Lens.Lens' JobLogEventData (Prelude.Maybe ConversionProperties)
jobLogEventData_conversionProperties :: Lens' JobLogEventData (Maybe ConversionProperties)
jobLogEventData_conversionProperties = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobLogEventData' {Maybe ConversionProperties
conversionProperties :: Maybe ConversionProperties
$sel:conversionProperties:JobLogEventData' :: JobLogEventData -> Maybe ConversionProperties
conversionProperties} -> Maybe ConversionProperties
conversionProperties) (\s :: JobLogEventData
s@JobLogEventData' {} Maybe ConversionProperties
a -> JobLogEventData
s {$sel:conversionProperties:JobLogEventData' :: Maybe ConversionProperties
conversionProperties = Maybe ConversionProperties
a} :: JobLogEventData)

-- | The ID of a conversion server.
jobLogEventData_conversionServerID :: Lens.Lens' JobLogEventData (Prelude.Maybe Prelude.Text)
jobLogEventData_conversionServerID :: Lens' JobLogEventData (Maybe Text)
jobLogEventData_conversionServerID = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobLogEventData' {Maybe Text
conversionServerID :: Maybe Text
$sel:conversionServerID:JobLogEventData' :: JobLogEventData -> Maybe Text
conversionServerID} -> Maybe Text
conversionServerID) (\s :: JobLogEventData
s@JobLogEventData' {} Maybe Text
a -> JobLogEventData
s {$sel:conversionServerID:JobLogEventData' :: Maybe Text
conversionServerID = Maybe Text
a} :: JobLogEventData)

-- | A string representing a job error.
jobLogEventData_rawError :: Lens.Lens' JobLogEventData (Prelude.Maybe Prelude.Text)
jobLogEventData_rawError :: Lens' JobLogEventData (Maybe Text)
jobLogEventData_rawError = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobLogEventData' {Maybe Text
rawError :: Maybe Text
$sel:rawError:JobLogEventData' :: JobLogEventData -> Maybe Text
rawError} -> Maybe Text
rawError) (\s :: JobLogEventData
s@JobLogEventData' {} Maybe Text
a -> JobLogEventData
s {$sel:rawError:JobLogEventData' :: Maybe Text
rawError = Maybe Text
a} :: JobLogEventData)

-- | The ID of a Source Server.
jobLogEventData_sourceServerID :: Lens.Lens' JobLogEventData (Prelude.Maybe Prelude.Text)
jobLogEventData_sourceServerID :: Lens' JobLogEventData (Maybe Text)
jobLogEventData_sourceServerID = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobLogEventData' {Maybe Text
sourceServerID :: Maybe Text
$sel:sourceServerID:JobLogEventData' :: JobLogEventData -> Maybe Text
sourceServerID} -> Maybe Text
sourceServerID) (\s :: JobLogEventData
s@JobLogEventData' {} Maybe Text
a -> JobLogEventData
s {$sel:sourceServerID:JobLogEventData' :: Maybe Text
sourceServerID = Maybe Text
a} :: JobLogEventData)

-- | The ID of a Recovery Instance.
jobLogEventData_targetInstanceID :: Lens.Lens' JobLogEventData (Prelude.Maybe Prelude.Text)
jobLogEventData_targetInstanceID :: Lens' JobLogEventData (Maybe Text)
jobLogEventData_targetInstanceID = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JobLogEventData' {Maybe Text
targetInstanceID :: Maybe Text
$sel:targetInstanceID:JobLogEventData' :: JobLogEventData -> Maybe Text
targetInstanceID} -> Maybe Text
targetInstanceID) (\s :: JobLogEventData
s@JobLogEventData' {} Maybe Text
a -> JobLogEventData
s {$sel:targetInstanceID:JobLogEventData' :: Maybe Text
targetInstanceID = Maybe Text
a} :: JobLogEventData)

instance Data.FromJSON JobLogEventData where
  parseJSON :: Value -> Parser JobLogEventData
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"JobLogEventData"
      ( \Object
x ->
          Maybe ConversionProperties
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> JobLogEventData
JobLogEventData'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"conversionProperties")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"conversionServerID")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"rawError")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"sourceServerID")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"targetInstanceID")
      )

instance Prelude.Hashable JobLogEventData where
  hashWithSalt :: Int -> JobLogEventData -> Int
hashWithSalt Int
_salt JobLogEventData' {Maybe Text
Maybe ConversionProperties
targetInstanceID :: Maybe Text
sourceServerID :: Maybe Text
rawError :: Maybe Text
conversionServerID :: Maybe Text
conversionProperties :: Maybe ConversionProperties
$sel:targetInstanceID:JobLogEventData' :: JobLogEventData -> Maybe Text
$sel:sourceServerID:JobLogEventData' :: JobLogEventData -> Maybe Text
$sel:rawError:JobLogEventData' :: JobLogEventData -> Maybe Text
$sel:conversionServerID:JobLogEventData' :: JobLogEventData -> Maybe Text
$sel:conversionProperties:JobLogEventData' :: JobLogEventData -> Maybe ConversionProperties
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConversionProperties
conversionProperties
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
conversionServerID
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
rawError
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceServerID
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
targetInstanceID

instance Prelude.NFData JobLogEventData where
  rnf :: JobLogEventData -> ()
rnf JobLogEventData' {Maybe Text
Maybe ConversionProperties
targetInstanceID :: Maybe Text
sourceServerID :: Maybe Text
rawError :: Maybe Text
conversionServerID :: Maybe Text
conversionProperties :: Maybe ConversionProperties
$sel:targetInstanceID:JobLogEventData' :: JobLogEventData -> Maybe Text
$sel:sourceServerID:JobLogEventData' :: JobLogEventData -> Maybe Text
$sel:rawError:JobLogEventData' :: JobLogEventData -> Maybe Text
$sel:conversionServerID:JobLogEventData' :: JobLogEventData -> Maybe Text
$sel:conversionProperties:JobLogEventData' :: JobLogEventData -> Maybe ConversionProperties
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ConversionProperties
conversionProperties
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
conversionServerID
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
rawError
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceServerID
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
targetInstanceID