{-# 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.MwAA.Types.LoggingConfigurationInput
-- 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.MwAA.Types.LoggingConfigurationInput where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MwAA.Types.ModuleLoggingConfigurationInput
import qualified Amazonka.Prelude as Prelude

-- | Defines the Apache Airflow logs to send to CloudWatch Logs:
-- @DagProcessingLogs@, @SchedulerLogs@, @TaskLogs@, @WebserverLogs@,
-- @WorkerLogs@.
--
-- /See:/ 'newLoggingConfigurationInput' smart constructor.
data LoggingConfigurationInput = LoggingConfigurationInput'
  { LoggingConfigurationInput -> Maybe ModuleLoggingConfigurationInput
taskLogs :: Prelude.Maybe ModuleLoggingConfigurationInput,
    LoggingConfigurationInput -> Maybe ModuleLoggingConfigurationInput
webserverLogs :: Prelude.Maybe ModuleLoggingConfigurationInput,
    LoggingConfigurationInput -> Maybe ModuleLoggingConfigurationInput
schedulerLogs :: Prelude.Maybe ModuleLoggingConfigurationInput,
    LoggingConfigurationInput -> Maybe ModuleLoggingConfigurationInput
dagProcessingLogs :: Prelude.Maybe ModuleLoggingConfigurationInput,
    LoggingConfigurationInput -> Maybe ModuleLoggingConfigurationInput
workerLogs :: Prelude.Maybe ModuleLoggingConfigurationInput
  }
  deriving (LoggingConfigurationInput -> LoggingConfigurationInput -> Bool
(LoggingConfigurationInput -> LoggingConfigurationInput -> Bool)
-> (LoggingConfigurationInput -> LoggingConfigurationInput -> Bool)
-> Eq LoggingConfigurationInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LoggingConfigurationInput -> LoggingConfigurationInput -> Bool
$c/= :: LoggingConfigurationInput -> LoggingConfigurationInput -> Bool
== :: LoggingConfigurationInput -> LoggingConfigurationInput -> Bool
$c== :: LoggingConfigurationInput -> LoggingConfigurationInput -> Bool
Prelude.Eq, ReadPrec [LoggingConfigurationInput]
ReadPrec LoggingConfigurationInput
Int -> ReadS LoggingConfigurationInput
ReadS [LoggingConfigurationInput]
(Int -> ReadS LoggingConfigurationInput)
-> ReadS [LoggingConfigurationInput]
-> ReadPrec LoggingConfigurationInput
-> ReadPrec [LoggingConfigurationInput]
-> Read LoggingConfigurationInput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LoggingConfigurationInput]
$creadListPrec :: ReadPrec [LoggingConfigurationInput]
readPrec :: ReadPrec LoggingConfigurationInput
$creadPrec :: ReadPrec LoggingConfigurationInput
readList :: ReadS [LoggingConfigurationInput]
$creadList :: ReadS [LoggingConfigurationInput]
readsPrec :: Int -> ReadS LoggingConfigurationInput
$creadsPrec :: Int -> ReadS LoggingConfigurationInput
Prelude.Read, Int -> LoggingConfigurationInput -> ShowS
[LoggingConfigurationInput] -> ShowS
LoggingConfigurationInput -> String
(Int -> LoggingConfigurationInput -> ShowS)
-> (LoggingConfigurationInput -> String)
-> ([LoggingConfigurationInput] -> ShowS)
-> Show LoggingConfigurationInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LoggingConfigurationInput] -> ShowS
$cshowList :: [LoggingConfigurationInput] -> ShowS
show :: LoggingConfigurationInput -> String
$cshow :: LoggingConfigurationInput -> String
showsPrec :: Int -> LoggingConfigurationInput -> ShowS
$cshowsPrec :: Int -> LoggingConfigurationInput -> ShowS
Prelude.Show, (forall x.
 LoggingConfigurationInput -> Rep LoggingConfigurationInput x)
-> (forall x.
    Rep LoggingConfigurationInput x -> LoggingConfigurationInput)
-> Generic LoggingConfigurationInput
forall x.
Rep LoggingConfigurationInput x -> LoggingConfigurationInput
forall x.
LoggingConfigurationInput -> Rep LoggingConfigurationInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LoggingConfigurationInput x -> LoggingConfigurationInput
$cfrom :: forall x.
LoggingConfigurationInput -> Rep LoggingConfigurationInput x
Prelude.Generic)

-- |
-- Create a value of 'LoggingConfigurationInput' 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:
--
-- 'taskLogs', 'loggingConfigurationInput_taskLogs' - Undocumented member.
--
-- 'webserverLogs', 'loggingConfigurationInput_webserverLogs' - Undocumented member.
--
-- 'schedulerLogs', 'loggingConfigurationInput_schedulerLogs' - Undocumented member.
--
-- 'dagProcessingLogs', 'loggingConfigurationInput_dagProcessingLogs' - Undocumented member.
--
-- 'workerLogs', 'loggingConfigurationInput_workerLogs' - Undocumented member.
newLoggingConfigurationInput ::
  LoggingConfigurationInput
newLoggingConfigurationInput :: LoggingConfigurationInput
newLoggingConfigurationInput =
  LoggingConfigurationInput' :: Maybe ModuleLoggingConfigurationInput
-> Maybe ModuleLoggingConfigurationInput
-> Maybe ModuleLoggingConfigurationInput
-> Maybe ModuleLoggingConfigurationInput
-> Maybe ModuleLoggingConfigurationInput
-> LoggingConfigurationInput
LoggingConfigurationInput'
    { $sel:taskLogs:LoggingConfigurationInput' :: Maybe ModuleLoggingConfigurationInput
taskLogs =
        Maybe ModuleLoggingConfigurationInput
forall a. Maybe a
Prelude.Nothing,
      $sel:webserverLogs:LoggingConfigurationInput' :: Maybe ModuleLoggingConfigurationInput
webserverLogs = Maybe ModuleLoggingConfigurationInput
forall a. Maybe a
Prelude.Nothing,
      $sel:schedulerLogs:LoggingConfigurationInput' :: Maybe ModuleLoggingConfigurationInput
schedulerLogs = Maybe ModuleLoggingConfigurationInput
forall a. Maybe a
Prelude.Nothing,
      $sel:dagProcessingLogs:LoggingConfigurationInput' :: Maybe ModuleLoggingConfigurationInput
dagProcessingLogs = Maybe ModuleLoggingConfigurationInput
forall a. Maybe a
Prelude.Nothing,
      $sel:workerLogs:LoggingConfigurationInput' :: Maybe ModuleLoggingConfigurationInput
workerLogs = Maybe ModuleLoggingConfigurationInput
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
loggingConfigurationInput_taskLogs :: Lens.Lens' LoggingConfigurationInput (Prelude.Maybe ModuleLoggingConfigurationInput)
loggingConfigurationInput_taskLogs :: (Maybe ModuleLoggingConfigurationInput
 -> f (Maybe ModuleLoggingConfigurationInput))
-> LoggingConfigurationInput -> f LoggingConfigurationInput
loggingConfigurationInput_taskLogs = (LoggingConfigurationInput
 -> Maybe ModuleLoggingConfigurationInput)
-> (LoggingConfigurationInput
    -> Maybe ModuleLoggingConfigurationInput
    -> LoggingConfigurationInput)
-> Lens
     LoggingConfigurationInput
     LoggingConfigurationInput
     (Maybe ModuleLoggingConfigurationInput)
     (Maybe ModuleLoggingConfigurationInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoggingConfigurationInput' {Maybe ModuleLoggingConfigurationInput
taskLogs :: Maybe ModuleLoggingConfigurationInput
$sel:taskLogs:LoggingConfigurationInput' :: LoggingConfigurationInput -> Maybe ModuleLoggingConfigurationInput
taskLogs} -> Maybe ModuleLoggingConfigurationInput
taskLogs) (\s :: LoggingConfigurationInput
s@LoggingConfigurationInput' {} Maybe ModuleLoggingConfigurationInput
a -> LoggingConfigurationInput
s {$sel:taskLogs:LoggingConfigurationInput' :: Maybe ModuleLoggingConfigurationInput
taskLogs = Maybe ModuleLoggingConfigurationInput
a} :: LoggingConfigurationInput)

-- | Undocumented member.
loggingConfigurationInput_webserverLogs :: Lens.Lens' LoggingConfigurationInput (Prelude.Maybe ModuleLoggingConfigurationInput)
loggingConfigurationInput_webserverLogs :: (Maybe ModuleLoggingConfigurationInput
 -> f (Maybe ModuleLoggingConfigurationInput))
-> LoggingConfigurationInput -> f LoggingConfigurationInput
loggingConfigurationInput_webserverLogs = (LoggingConfigurationInput
 -> Maybe ModuleLoggingConfigurationInput)
-> (LoggingConfigurationInput
    -> Maybe ModuleLoggingConfigurationInput
    -> LoggingConfigurationInput)
-> Lens
     LoggingConfigurationInput
     LoggingConfigurationInput
     (Maybe ModuleLoggingConfigurationInput)
     (Maybe ModuleLoggingConfigurationInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoggingConfigurationInput' {Maybe ModuleLoggingConfigurationInput
webserverLogs :: Maybe ModuleLoggingConfigurationInput
$sel:webserverLogs:LoggingConfigurationInput' :: LoggingConfigurationInput -> Maybe ModuleLoggingConfigurationInput
webserverLogs} -> Maybe ModuleLoggingConfigurationInput
webserverLogs) (\s :: LoggingConfigurationInput
s@LoggingConfigurationInput' {} Maybe ModuleLoggingConfigurationInput
a -> LoggingConfigurationInput
s {$sel:webserverLogs:LoggingConfigurationInput' :: Maybe ModuleLoggingConfigurationInput
webserverLogs = Maybe ModuleLoggingConfigurationInput
a} :: LoggingConfigurationInput)

-- | Undocumented member.
loggingConfigurationInput_schedulerLogs :: Lens.Lens' LoggingConfigurationInput (Prelude.Maybe ModuleLoggingConfigurationInput)
loggingConfigurationInput_schedulerLogs :: (Maybe ModuleLoggingConfigurationInput
 -> f (Maybe ModuleLoggingConfigurationInput))
-> LoggingConfigurationInput -> f LoggingConfigurationInput
loggingConfigurationInput_schedulerLogs = (LoggingConfigurationInput
 -> Maybe ModuleLoggingConfigurationInput)
-> (LoggingConfigurationInput
    -> Maybe ModuleLoggingConfigurationInput
    -> LoggingConfigurationInput)
-> Lens
     LoggingConfigurationInput
     LoggingConfigurationInput
     (Maybe ModuleLoggingConfigurationInput)
     (Maybe ModuleLoggingConfigurationInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoggingConfigurationInput' {Maybe ModuleLoggingConfigurationInput
schedulerLogs :: Maybe ModuleLoggingConfigurationInput
$sel:schedulerLogs:LoggingConfigurationInput' :: LoggingConfigurationInput -> Maybe ModuleLoggingConfigurationInput
schedulerLogs} -> Maybe ModuleLoggingConfigurationInput
schedulerLogs) (\s :: LoggingConfigurationInput
s@LoggingConfigurationInput' {} Maybe ModuleLoggingConfigurationInput
a -> LoggingConfigurationInput
s {$sel:schedulerLogs:LoggingConfigurationInput' :: Maybe ModuleLoggingConfigurationInput
schedulerLogs = Maybe ModuleLoggingConfigurationInput
a} :: LoggingConfigurationInput)

-- | Undocumented member.
loggingConfigurationInput_dagProcessingLogs :: Lens.Lens' LoggingConfigurationInput (Prelude.Maybe ModuleLoggingConfigurationInput)
loggingConfigurationInput_dagProcessingLogs :: (Maybe ModuleLoggingConfigurationInput
 -> f (Maybe ModuleLoggingConfigurationInput))
-> LoggingConfigurationInput -> f LoggingConfigurationInput
loggingConfigurationInput_dagProcessingLogs = (LoggingConfigurationInput
 -> Maybe ModuleLoggingConfigurationInput)
-> (LoggingConfigurationInput
    -> Maybe ModuleLoggingConfigurationInput
    -> LoggingConfigurationInput)
-> Lens
     LoggingConfigurationInput
     LoggingConfigurationInput
     (Maybe ModuleLoggingConfigurationInput)
     (Maybe ModuleLoggingConfigurationInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoggingConfigurationInput' {Maybe ModuleLoggingConfigurationInput
dagProcessingLogs :: Maybe ModuleLoggingConfigurationInput
$sel:dagProcessingLogs:LoggingConfigurationInput' :: LoggingConfigurationInput -> Maybe ModuleLoggingConfigurationInput
dagProcessingLogs} -> Maybe ModuleLoggingConfigurationInput
dagProcessingLogs) (\s :: LoggingConfigurationInput
s@LoggingConfigurationInput' {} Maybe ModuleLoggingConfigurationInput
a -> LoggingConfigurationInput
s {$sel:dagProcessingLogs:LoggingConfigurationInput' :: Maybe ModuleLoggingConfigurationInput
dagProcessingLogs = Maybe ModuleLoggingConfigurationInput
a} :: LoggingConfigurationInput)

-- | Undocumented member.
loggingConfigurationInput_workerLogs :: Lens.Lens' LoggingConfigurationInput (Prelude.Maybe ModuleLoggingConfigurationInput)
loggingConfigurationInput_workerLogs :: (Maybe ModuleLoggingConfigurationInput
 -> f (Maybe ModuleLoggingConfigurationInput))
-> LoggingConfigurationInput -> f LoggingConfigurationInput
loggingConfigurationInput_workerLogs = (LoggingConfigurationInput
 -> Maybe ModuleLoggingConfigurationInput)
-> (LoggingConfigurationInput
    -> Maybe ModuleLoggingConfigurationInput
    -> LoggingConfigurationInput)
-> Lens
     LoggingConfigurationInput
     LoggingConfigurationInput
     (Maybe ModuleLoggingConfigurationInput)
     (Maybe ModuleLoggingConfigurationInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LoggingConfigurationInput' {Maybe ModuleLoggingConfigurationInput
workerLogs :: Maybe ModuleLoggingConfigurationInput
$sel:workerLogs:LoggingConfigurationInput' :: LoggingConfigurationInput -> Maybe ModuleLoggingConfigurationInput
workerLogs} -> Maybe ModuleLoggingConfigurationInput
workerLogs) (\s :: LoggingConfigurationInput
s@LoggingConfigurationInput' {} Maybe ModuleLoggingConfigurationInput
a -> LoggingConfigurationInput
s {$sel:workerLogs:LoggingConfigurationInput' :: Maybe ModuleLoggingConfigurationInput
workerLogs = Maybe ModuleLoggingConfigurationInput
a} :: LoggingConfigurationInput)

instance Prelude.Hashable LoggingConfigurationInput

instance Prelude.NFData LoggingConfigurationInput

instance Core.ToJSON LoggingConfigurationInput where
  toJSON :: LoggingConfigurationInput -> Value
toJSON LoggingConfigurationInput' {Maybe ModuleLoggingConfigurationInput
workerLogs :: Maybe ModuleLoggingConfigurationInput
dagProcessingLogs :: Maybe ModuleLoggingConfigurationInput
schedulerLogs :: Maybe ModuleLoggingConfigurationInput
webserverLogs :: Maybe ModuleLoggingConfigurationInput
taskLogs :: Maybe ModuleLoggingConfigurationInput
$sel:workerLogs:LoggingConfigurationInput' :: LoggingConfigurationInput -> Maybe ModuleLoggingConfigurationInput
$sel:dagProcessingLogs:LoggingConfigurationInput' :: LoggingConfigurationInput -> Maybe ModuleLoggingConfigurationInput
$sel:schedulerLogs:LoggingConfigurationInput' :: LoggingConfigurationInput -> Maybe ModuleLoggingConfigurationInput
$sel:webserverLogs:LoggingConfigurationInput' :: LoggingConfigurationInput -> Maybe ModuleLoggingConfigurationInput
$sel:taskLogs:LoggingConfigurationInput' :: LoggingConfigurationInput -> Maybe ModuleLoggingConfigurationInput
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"TaskLogs" Text -> ModuleLoggingConfigurationInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ModuleLoggingConfigurationInput -> Pair)
-> Maybe ModuleLoggingConfigurationInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ModuleLoggingConfigurationInput
taskLogs,
            (Text
"WebserverLogs" Text -> ModuleLoggingConfigurationInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ModuleLoggingConfigurationInput -> Pair)
-> Maybe ModuleLoggingConfigurationInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ModuleLoggingConfigurationInput
webserverLogs,
            (Text
"SchedulerLogs" Text -> ModuleLoggingConfigurationInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ModuleLoggingConfigurationInput -> Pair)
-> Maybe ModuleLoggingConfigurationInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ModuleLoggingConfigurationInput
schedulerLogs,
            (Text
"DagProcessingLogs" Text -> ModuleLoggingConfigurationInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ModuleLoggingConfigurationInput -> Pair)
-> Maybe ModuleLoggingConfigurationInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ModuleLoggingConfigurationInput
dagProcessingLogs,
            (Text
"WorkerLogs" Text -> ModuleLoggingConfigurationInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ModuleLoggingConfigurationInput -> Pair)
-> Maybe ModuleLoggingConfigurationInput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ModuleLoggingConfigurationInput
workerLogs
          ]
      )