{-# 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.DMS.Types.ReplicationInstanceTaskLog
-- 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.DMS.Types.ReplicationInstanceTaskLog where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains metadata for a replication instance task log.
--
-- /See:/ 'newReplicationInstanceTaskLog' smart constructor.
data ReplicationInstanceTaskLog = ReplicationInstanceTaskLog'
  { -- | The name of the replication task.
    ReplicationInstanceTaskLog -> Maybe Text
replicationTaskName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the replication task.
    ReplicationInstanceTaskLog -> Maybe Text
replicationTaskArn :: Prelude.Maybe Prelude.Text,
    -- | The size, in bytes, of the replication task log.
    ReplicationInstanceTaskLog -> Maybe Integer
replicationInstanceTaskLogSize :: Prelude.Maybe Prelude.Integer
  }
  deriving (ReplicationInstanceTaskLog -> ReplicationInstanceTaskLog -> Bool
(ReplicationInstanceTaskLog -> ReplicationInstanceTaskLog -> Bool)
-> (ReplicationInstanceTaskLog
    -> ReplicationInstanceTaskLog -> Bool)
-> Eq ReplicationInstanceTaskLog
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReplicationInstanceTaskLog -> ReplicationInstanceTaskLog -> Bool
$c/= :: ReplicationInstanceTaskLog -> ReplicationInstanceTaskLog -> Bool
== :: ReplicationInstanceTaskLog -> ReplicationInstanceTaskLog -> Bool
$c== :: ReplicationInstanceTaskLog -> ReplicationInstanceTaskLog -> Bool
Prelude.Eq, ReadPrec [ReplicationInstanceTaskLog]
ReadPrec ReplicationInstanceTaskLog
Int -> ReadS ReplicationInstanceTaskLog
ReadS [ReplicationInstanceTaskLog]
(Int -> ReadS ReplicationInstanceTaskLog)
-> ReadS [ReplicationInstanceTaskLog]
-> ReadPrec ReplicationInstanceTaskLog
-> ReadPrec [ReplicationInstanceTaskLog]
-> Read ReplicationInstanceTaskLog
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReplicationInstanceTaskLog]
$creadListPrec :: ReadPrec [ReplicationInstanceTaskLog]
readPrec :: ReadPrec ReplicationInstanceTaskLog
$creadPrec :: ReadPrec ReplicationInstanceTaskLog
readList :: ReadS [ReplicationInstanceTaskLog]
$creadList :: ReadS [ReplicationInstanceTaskLog]
readsPrec :: Int -> ReadS ReplicationInstanceTaskLog
$creadsPrec :: Int -> ReadS ReplicationInstanceTaskLog
Prelude.Read, Int -> ReplicationInstanceTaskLog -> ShowS
[ReplicationInstanceTaskLog] -> ShowS
ReplicationInstanceTaskLog -> String
(Int -> ReplicationInstanceTaskLog -> ShowS)
-> (ReplicationInstanceTaskLog -> String)
-> ([ReplicationInstanceTaskLog] -> ShowS)
-> Show ReplicationInstanceTaskLog
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReplicationInstanceTaskLog] -> ShowS
$cshowList :: [ReplicationInstanceTaskLog] -> ShowS
show :: ReplicationInstanceTaskLog -> String
$cshow :: ReplicationInstanceTaskLog -> String
showsPrec :: Int -> ReplicationInstanceTaskLog -> ShowS
$cshowsPrec :: Int -> ReplicationInstanceTaskLog -> ShowS
Prelude.Show, (forall x.
 ReplicationInstanceTaskLog -> Rep ReplicationInstanceTaskLog x)
-> (forall x.
    Rep ReplicationInstanceTaskLog x -> ReplicationInstanceTaskLog)
-> Generic ReplicationInstanceTaskLog
forall x.
Rep ReplicationInstanceTaskLog x -> ReplicationInstanceTaskLog
forall x.
ReplicationInstanceTaskLog -> Rep ReplicationInstanceTaskLog x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReplicationInstanceTaskLog x -> ReplicationInstanceTaskLog
$cfrom :: forall x.
ReplicationInstanceTaskLog -> Rep ReplicationInstanceTaskLog x
Prelude.Generic)

-- |
-- Create a value of 'ReplicationInstanceTaskLog' 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:
--
-- 'replicationTaskName', 'replicationInstanceTaskLog_replicationTaskName' - The name of the replication task.
--
-- 'replicationTaskArn', 'replicationInstanceTaskLog_replicationTaskArn' - The Amazon Resource Name (ARN) of the replication task.
--
-- 'replicationInstanceTaskLogSize', 'replicationInstanceTaskLog_replicationInstanceTaskLogSize' - The size, in bytes, of the replication task log.
newReplicationInstanceTaskLog ::
  ReplicationInstanceTaskLog
newReplicationInstanceTaskLog :: ReplicationInstanceTaskLog
newReplicationInstanceTaskLog =
  ReplicationInstanceTaskLog' :: Maybe Text
-> Maybe Text -> Maybe Integer -> ReplicationInstanceTaskLog
ReplicationInstanceTaskLog'
    { $sel:replicationTaskName:ReplicationInstanceTaskLog' :: Maybe Text
replicationTaskName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:replicationTaskArn:ReplicationInstanceTaskLog' :: Maybe Text
replicationTaskArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:replicationInstanceTaskLogSize:ReplicationInstanceTaskLog' :: Maybe Integer
replicationInstanceTaskLogSize =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the replication task.
replicationInstanceTaskLog_replicationTaskName :: Lens.Lens' ReplicationInstanceTaskLog (Prelude.Maybe Prelude.Text)
replicationInstanceTaskLog_replicationTaskName :: (Maybe Text -> f (Maybe Text))
-> ReplicationInstanceTaskLog -> f ReplicationInstanceTaskLog
replicationInstanceTaskLog_replicationTaskName = (ReplicationInstanceTaskLog -> Maybe Text)
-> (ReplicationInstanceTaskLog
    -> Maybe Text -> ReplicationInstanceTaskLog)
-> Lens
     ReplicationInstanceTaskLog
     ReplicationInstanceTaskLog
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationInstanceTaskLog' {Maybe Text
replicationTaskName :: Maybe Text
$sel:replicationTaskName:ReplicationInstanceTaskLog' :: ReplicationInstanceTaskLog -> Maybe Text
replicationTaskName} -> Maybe Text
replicationTaskName) (\s :: ReplicationInstanceTaskLog
s@ReplicationInstanceTaskLog' {} Maybe Text
a -> ReplicationInstanceTaskLog
s {$sel:replicationTaskName:ReplicationInstanceTaskLog' :: Maybe Text
replicationTaskName = Maybe Text
a} :: ReplicationInstanceTaskLog)

-- | The Amazon Resource Name (ARN) of the replication task.
replicationInstanceTaskLog_replicationTaskArn :: Lens.Lens' ReplicationInstanceTaskLog (Prelude.Maybe Prelude.Text)
replicationInstanceTaskLog_replicationTaskArn :: (Maybe Text -> f (Maybe Text))
-> ReplicationInstanceTaskLog -> f ReplicationInstanceTaskLog
replicationInstanceTaskLog_replicationTaskArn = (ReplicationInstanceTaskLog -> Maybe Text)
-> (ReplicationInstanceTaskLog
    -> Maybe Text -> ReplicationInstanceTaskLog)
-> Lens
     ReplicationInstanceTaskLog
     ReplicationInstanceTaskLog
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationInstanceTaskLog' {Maybe Text
replicationTaskArn :: Maybe Text
$sel:replicationTaskArn:ReplicationInstanceTaskLog' :: ReplicationInstanceTaskLog -> Maybe Text
replicationTaskArn} -> Maybe Text
replicationTaskArn) (\s :: ReplicationInstanceTaskLog
s@ReplicationInstanceTaskLog' {} Maybe Text
a -> ReplicationInstanceTaskLog
s {$sel:replicationTaskArn:ReplicationInstanceTaskLog' :: Maybe Text
replicationTaskArn = Maybe Text
a} :: ReplicationInstanceTaskLog)

-- | The size, in bytes, of the replication task log.
replicationInstanceTaskLog_replicationInstanceTaskLogSize :: Lens.Lens' ReplicationInstanceTaskLog (Prelude.Maybe Prelude.Integer)
replicationInstanceTaskLog_replicationInstanceTaskLogSize :: (Maybe Integer -> f (Maybe Integer))
-> ReplicationInstanceTaskLog -> f ReplicationInstanceTaskLog
replicationInstanceTaskLog_replicationInstanceTaskLogSize = (ReplicationInstanceTaskLog -> Maybe Integer)
-> (ReplicationInstanceTaskLog
    -> Maybe Integer -> ReplicationInstanceTaskLog)
-> Lens
     ReplicationInstanceTaskLog
     ReplicationInstanceTaskLog
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReplicationInstanceTaskLog' {Maybe Integer
replicationInstanceTaskLogSize :: Maybe Integer
$sel:replicationInstanceTaskLogSize:ReplicationInstanceTaskLog' :: ReplicationInstanceTaskLog -> Maybe Integer
replicationInstanceTaskLogSize} -> Maybe Integer
replicationInstanceTaskLogSize) (\s :: ReplicationInstanceTaskLog
s@ReplicationInstanceTaskLog' {} Maybe Integer
a -> ReplicationInstanceTaskLog
s {$sel:replicationInstanceTaskLogSize:ReplicationInstanceTaskLog' :: Maybe Integer
replicationInstanceTaskLogSize = Maybe Integer
a} :: ReplicationInstanceTaskLog)

instance Core.FromJSON ReplicationInstanceTaskLog where
  parseJSON :: Value -> Parser ReplicationInstanceTaskLog
parseJSON =
    String
-> (Object -> Parser ReplicationInstanceTaskLog)
-> Value
-> Parser ReplicationInstanceTaskLog
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ReplicationInstanceTaskLog"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Integer -> ReplicationInstanceTaskLog
ReplicationInstanceTaskLog'
            (Maybe Text
 -> Maybe Text -> Maybe Integer -> ReplicationInstanceTaskLog)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Integer -> ReplicationInstanceTaskLog)
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
"ReplicationTaskName")
            Parser (Maybe Text -> Maybe Integer -> ReplicationInstanceTaskLog)
-> Parser (Maybe Text)
-> Parser (Maybe Integer -> ReplicationInstanceTaskLog)
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
"ReplicationTaskArn")
            Parser (Maybe Integer -> ReplicationInstanceTaskLog)
-> Parser (Maybe Integer) -> Parser ReplicationInstanceTaskLog
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ReplicationInstanceTaskLogSize")
      )

instance Prelude.Hashable ReplicationInstanceTaskLog

instance Prelude.NFData ReplicationInstanceTaskLog