{-# 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.CloudWatchLogs.Types.ExportTask where
import Amazonka.CloudWatchLogs.Types.ExportTaskExecutionInfo
import Amazonka.CloudWatchLogs.Types.ExportTaskStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ExportTask = ExportTask'
{
ExportTask -> Maybe Text
destinationPrefix :: Prelude.Maybe Prelude.Text,
ExportTask -> Maybe Text
destination :: Prelude.Maybe Prelude.Text,
ExportTask -> Maybe ExportTaskStatus
status :: Prelude.Maybe ExportTaskStatus,
ExportTask -> Maybe Text
taskName :: Prelude.Maybe Prelude.Text,
ExportTask -> Maybe Text
taskId :: Prelude.Maybe Prelude.Text,
ExportTask -> Maybe Natural
to :: Prelude.Maybe Prelude.Natural,
ExportTask -> Maybe Natural
from :: Prelude.Maybe Prelude.Natural,
ExportTask -> Maybe Text
logGroupName :: Prelude.Maybe Prelude.Text,
ExportTask -> Maybe ExportTaskExecutionInfo
executionInfo :: Prelude.Maybe ExportTaskExecutionInfo
}
deriving (ExportTask -> ExportTask -> Bool
(ExportTask -> ExportTask -> Bool)
-> (ExportTask -> ExportTask -> Bool) -> Eq ExportTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportTask -> ExportTask -> Bool
$c/= :: ExportTask -> ExportTask -> Bool
== :: ExportTask -> ExportTask -> Bool
$c== :: ExportTask -> ExportTask -> Bool
Prelude.Eq, ReadPrec [ExportTask]
ReadPrec ExportTask
Int -> ReadS ExportTask
ReadS [ExportTask]
(Int -> ReadS ExportTask)
-> ReadS [ExportTask]
-> ReadPrec ExportTask
-> ReadPrec [ExportTask]
-> Read ExportTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportTask]
$creadListPrec :: ReadPrec [ExportTask]
readPrec :: ReadPrec ExportTask
$creadPrec :: ReadPrec ExportTask
readList :: ReadS [ExportTask]
$creadList :: ReadS [ExportTask]
readsPrec :: Int -> ReadS ExportTask
$creadsPrec :: Int -> ReadS ExportTask
Prelude.Read, Int -> ExportTask -> ShowS
[ExportTask] -> ShowS
ExportTask -> String
(Int -> ExportTask -> ShowS)
-> (ExportTask -> String)
-> ([ExportTask] -> ShowS)
-> Show ExportTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportTask] -> ShowS
$cshowList :: [ExportTask] -> ShowS
show :: ExportTask -> String
$cshow :: ExportTask -> String
showsPrec :: Int -> ExportTask -> ShowS
$cshowsPrec :: Int -> ExportTask -> ShowS
Prelude.Show, (forall x. ExportTask -> Rep ExportTask x)
-> (forall x. Rep ExportTask x -> ExportTask) -> Generic ExportTask
forall x. Rep ExportTask x -> ExportTask
forall x. ExportTask -> Rep ExportTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExportTask x -> ExportTask
$cfrom :: forall x. ExportTask -> Rep ExportTask x
Prelude.Generic)
newExportTask ::
ExportTask
newExportTask :: ExportTask
newExportTask =
ExportTask' :: Maybe Text
-> Maybe Text
-> Maybe ExportTaskStatus
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe ExportTaskExecutionInfo
-> ExportTask
ExportTask'
{ $sel:destinationPrefix:ExportTask' :: Maybe Text
destinationPrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:destination:ExportTask' :: Maybe Text
destination = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:ExportTask' :: Maybe ExportTaskStatus
status = Maybe ExportTaskStatus
forall a. Maybe a
Prelude.Nothing,
$sel:taskName:ExportTask' :: Maybe Text
taskName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:taskId:ExportTask' :: Maybe Text
taskId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:to:ExportTask' :: Maybe Natural
to = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:from:ExportTask' :: Maybe Natural
from = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:logGroupName:ExportTask' :: Maybe Text
logGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:executionInfo:ExportTask' :: Maybe ExportTaskExecutionInfo
executionInfo = Maybe ExportTaskExecutionInfo
forall a. Maybe a
Prelude.Nothing
}
exportTask_destinationPrefix :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Text)
exportTask_destinationPrefix :: (Maybe Text -> f (Maybe Text)) -> ExportTask -> f ExportTask
exportTask_destinationPrefix = (ExportTask -> Maybe Text)
-> (ExportTask -> Maybe Text -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Text
destinationPrefix :: Maybe Text
$sel:destinationPrefix:ExportTask' :: ExportTask -> Maybe Text
destinationPrefix} -> Maybe Text
destinationPrefix) (\s :: ExportTask
s@ExportTask' {} Maybe Text
a -> ExportTask
s {$sel:destinationPrefix:ExportTask' :: Maybe Text
destinationPrefix = Maybe Text
a} :: ExportTask)
exportTask_destination :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Text)
exportTask_destination :: (Maybe Text -> f (Maybe Text)) -> ExportTask -> f ExportTask
exportTask_destination = (ExportTask -> Maybe Text)
-> (ExportTask -> Maybe Text -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Text
destination :: Maybe Text
$sel:destination:ExportTask' :: ExportTask -> Maybe Text
destination} -> Maybe Text
destination) (\s :: ExportTask
s@ExportTask' {} Maybe Text
a -> ExportTask
s {$sel:destination:ExportTask' :: Maybe Text
destination = Maybe Text
a} :: ExportTask)
exportTask_status :: Lens.Lens' ExportTask (Prelude.Maybe ExportTaskStatus)
exportTask_status :: (Maybe ExportTaskStatus -> f (Maybe ExportTaskStatus))
-> ExportTask -> f ExportTask
exportTask_status = (ExportTask -> Maybe ExportTaskStatus)
-> (ExportTask -> Maybe ExportTaskStatus -> ExportTask)
-> Lens
ExportTask
ExportTask
(Maybe ExportTaskStatus)
(Maybe ExportTaskStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe ExportTaskStatus
status :: Maybe ExportTaskStatus
$sel:status:ExportTask' :: ExportTask -> Maybe ExportTaskStatus
status} -> Maybe ExportTaskStatus
status) (\s :: ExportTask
s@ExportTask' {} Maybe ExportTaskStatus
a -> ExportTask
s {$sel:status:ExportTask' :: Maybe ExportTaskStatus
status = Maybe ExportTaskStatus
a} :: ExportTask)
exportTask_taskName :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Text)
exportTask_taskName :: (Maybe Text -> f (Maybe Text)) -> ExportTask -> f ExportTask
exportTask_taskName = (ExportTask -> Maybe Text)
-> (ExportTask -> Maybe Text -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Text
taskName :: Maybe Text
$sel:taskName:ExportTask' :: ExportTask -> Maybe Text
taskName} -> Maybe Text
taskName) (\s :: ExportTask
s@ExportTask' {} Maybe Text
a -> ExportTask
s {$sel:taskName:ExportTask' :: Maybe Text
taskName = Maybe Text
a} :: ExportTask)
exportTask_taskId :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Text)
exportTask_taskId :: (Maybe Text -> f (Maybe Text)) -> ExportTask -> f ExportTask
exportTask_taskId = (ExportTask -> Maybe Text)
-> (ExportTask -> Maybe Text -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Text
taskId :: Maybe Text
$sel:taskId:ExportTask' :: ExportTask -> Maybe Text
taskId} -> Maybe Text
taskId) (\s :: ExportTask
s@ExportTask' {} Maybe Text
a -> ExportTask
s {$sel:taskId:ExportTask' :: Maybe Text
taskId = Maybe Text
a} :: ExportTask)
exportTask_to :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Natural)
exportTask_to :: (Maybe Natural -> f (Maybe Natural)) -> ExportTask -> f ExportTask
exportTask_to = (ExportTask -> Maybe Natural)
-> (ExportTask -> Maybe Natural -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Natural
to :: Maybe Natural
$sel:to:ExportTask' :: ExportTask -> Maybe Natural
to} -> Maybe Natural
to) (\s :: ExportTask
s@ExportTask' {} Maybe Natural
a -> ExportTask
s {$sel:to:ExportTask' :: Maybe Natural
to = Maybe Natural
a} :: ExportTask)
exportTask_from :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Natural)
exportTask_from :: (Maybe Natural -> f (Maybe Natural)) -> ExportTask -> f ExportTask
exportTask_from = (ExportTask -> Maybe Natural)
-> (ExportTask -> Maybe Natural -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Natural
from :: Maybe Natural
$sel:from:ExportTask' :: ExportTask -> Maybe Natural
from} -> Maybe Natural
from) (\s :: ExportTask
s@ExportTask' {} Maybe Natural
a -> ExportTask
s {$sel:from:ExportTask' :: Maybe Natural
from = Maybe Natural
a} :: ExportTask)
exportTask_logGroupName :: Lens.Lens' ExportTask (Prelude.Maybe Prelude.Text)
exportTask_logGroupName :: (Maybe Text -> f (Maybe Text)) -> ExportTask -> f ExportTask
exportTask_logGroupName = (ExportTask -> Maybe Text)
-> (ExportTask -> Maybe Text -> ExportTask)
-> Lens ExportTask ExportTask (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe Text
logGroupName :: Maybe Text
$sel:logGroupName:ExportTask' :: ExportTask -> Maybe Text
logGroupName} -> Maybe Text
logGroupName) (\s :: ExportTask
s@ExportTask' {} Maybe Text
a -> ExportTask
s {$sel:logGroupName:ExportTask' :: Maybe Text
logGroupName = Maybe Text
a} :: ExportTask)
exportTask_executionInfo :: Lens.Lens' ExportTask (Prelude.Maybe ExportTaskExecutionInfo)
exportTask_executionInfo :: (Maybe ExportTaskExecutionInfo
-> f (Maybe ExportTaskExecutionInfo))
-> ExportTask -> f ExportTask
exportTask_executionInfo = (ExportTask -> Maybe ExportTaskExecutionInfo)
-> (ExportTask -> Maybe ExportTaskExecutionInfo -> ExportTask)
-> Lens
ExportTask
ExportTask
(Maybe ExportTaskExecutionInfo)
(Maybe ExportTaskExecutionInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportTask' {Maybe ExportTaskExecutionInfo
executionInfo :: Maybe ExportTaskExecutionInfo
$sel:executionInfo:ExportTask' :: ExportTask -> Maybe ExportTaskExecutionInfo
executionInfo} -> Maybe ExportTaskExecutionInfo
executionInfo) (\s :: ExportTask
s@ExportTask' {} Maybe ExportTaskExecutionInfo
a -> ExportTask
s {$sel:executionInfo:ExportTask' :: Maybe ExportTaskExecutionInfo
executionInfo = Maybe ExportTaskExecutionInfo
a} :: ExportTask)
instance Core.FromJSON ExportTask where
parseJSON :: Value -> Parser ExportTask
parseJSON =
String
-> (Object -> Parser ExportTask) -> Value -> Parser ExportTask
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ExportTask"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe ExportTaskStatus
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe ExportTaskExecutionInfo
-> ExportTask
ExportTask'
(Maybe Text
-> Maybe Text
-> Maybe ExportTaskStatus
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe ExportTaskExecutionInfo
-> ExportTask)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe ExportTaskStatus
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe ExportTaskExecutionInfo
-> ExportTask)
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
"destinationPrefix")
Parser
(Maybe Text
-> Maybe ExportTaskStatus
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe ExportTaskExecutionInfo
-> ExportTask)
-> Parser (Maybe Text)
-> Parser
(Maybe ExportTaskStatus
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe ExportTaskExecutionInfo
-> ExportTask)
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
"destination")
Parser
(Maybe ExportTaskStatus
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe ExportTaskExecutionInfo
-> ExportTask)
-> Parser (Maybe ExportTaskStatus)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe ExportTaskExecutionInfo
-> ExportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ExportTaskStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe ExportTaskExecutionInfo
-> ExportTask)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe ExportTaskExecutionInfo
-> ExportTask)
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
"taskName")
Parser
(Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe ExportTaskExecutionInfo
-> ExportTask)
-> Parser (Maybe Text)
-> Parser
(Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe ExportTaskExecutionInfo
-> ExportTask)
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
"taskId")
Parser
(Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe ExportTaskExecutionInfo
-> ExportTask)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural
-> Maybe Text -> Maybe ExportTaskExecutionInfo -> ExportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"to")
Parser
(Maybe Natural
-> Maybe Text -> Maybe ExportTaskExecutionInfo -> ExportTask)
-> Parser (Maybe Natural)
-> Parser
(Maybe Text -> Maybe ExportTaskExecutionInfo -> ExportTask)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"from")
Parser (Maybe Text -> Maybe ExportTaskExecutionInfo -> ExportTask)
-> Parser (Maybe Text)
-> Parser (Maybe ExportTaskExecutionInfo -> ExportTask)
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
"logGroupName")
Parser (Maybe ExportTaskExecutionInfo -> ExportTask)
-> Parser (Maybe ExportTaskExecutionInfo) -> Parser ExportTask
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ExportTaskExecutionInfo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"executionInfo")
)
instance Prelude.Hashable ExportTask
instance Prelude.NFData ExportTask