{-# 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.KafkaConnect.Types.LogDeliveryDescription
-- 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.KafkaConnect.Types.LogDeliveryDescription where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KafkaConnect.Types.WorkerLogDeliveryDescription
import qualified Amazonka.Prelude as Prelude

-- | The description of the log delivery settings.
--
-- /See:/ 'newLogDeliveryDescription' smart constructor.
data LogDeliveryDescription = LogDeliveryDescription'
  { -- | The workers can send worker logs to different destination types. This
    -- configuration specifies the details of these destinations.
    LogDeliveryDescription -> Maybe WorkerLogDeliveryDescription
workerLogDelivery :: Prelude.Maybe WorkerLogDeliveryDescription
  }
  deriving (LogDeliveryDescription -> LogDeliveryDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LogDeliveryDescription -> LogDeliveryDescription -> Bool
$c/= :: LogDeliveryDescription -> LogDeliveryDescription -> Bool
== :: LogDeliveryDescription -> LogDeliveryDescription -> Bool
$c== :: LogDeliveryDescription -> LogDeliveryDescription -> Bool
Prelude.Eq, ReadPrec [LogDeliveryDescription]
ReadPrec LogDeliveryDescription
Int -> ReadS LogDeliveryDescription
ReadS [LogDeliveryDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LogDeliveryDescription]
$creadListPrec :: ReadPrec [LogDeliveryDescription]
readPrec :: ReadPrec LogDeliveryDescription
$creadPrec :: ReadPrec LogDeliveryDescription
readList :: ReadS [LogDeliveryDescription]
$creadList :: ReadS [LogDeliveryDescription]
readsPrec :: Int -> ReadS LogDeliveryDescription
$creadsPrec :: Int -> ReadS LogDeliveryDescription
Prelude.Read, Int -> LogDeliveryDescription -> ShowS
[LogDeliveryDescription] -> ShowS
LogDeliveryDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LogDeliveryDescription] -> ShowS
$cshowList :: [LogDeliveryDescription] -> ShowS
show :: LogDeliveryDescription -> String
$cshow :: LogDeliveryDescription -> String
showsPrec :: Int -> LogDeliveryDescription -> ShowS
$cshowsPrec :: Int -> LogDeliveryDescription -> ShowS
Prelude.Show, forall x. Rep LogDeliveryDescription x -> LogDeliveryDescription
forall x. LogDeliveryDescription -> Rep LogDeliveryDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LogDeliveryDescription x -> LogDeliveryDescription
$cfrom :: forall x. LogDeliveryDescription -> Rep LogDeliveryDescription x
Prelude.Generic)

-- |
-- Create a value of 'LogDeliveryDescription' 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:
--
-- 'workerLogDelivery', 'logDeliveryDescription_workerLogDelivery' - The workers can send worker logs to different destination types. This
-- configuration specifies the details of these destinations.
newLogDeliveryDescription ::
  LogDeliveryDescription
newLogDeliveryDescription :: LogDeliveryDescription
newLogDeliveryDescription =
  LogDeliveryDescription'
    { $sel:workerLogDelivery:LogDeliveryDescription' :: Maybe WorkerLogDeliveryDescription
workerLogDelivery =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The workers can send worker logs to different destination types. This
-- configuration specifies the details of these destinations.
logDeliveryDescription_workerLogDelivery :: Lens.Lens' LogDeliveryDescription (Prelude.Maybe WorkerLogDeliveryDescription)
logDeliveryDescription_workerLogDelivery :: Lens' LogDeliveryDescription (Maybe WorkerLogDeliveryDescription)
logDeliveryDescription_workerLogDelivery = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogDeliveryDescription' {Maybe WorkerLogDeliveryDescription
workerLogDelivery :: Maybe WorkerLogDeliveryDescription
$sel:workerLogDelivery:LogDeliveryDescription' :: LogDeliveryDescription -> Maybe WorkerLogDeliveryDescription
workerLogDelivery} -> Maybe WorkerLogDeliveryDescription
workerLogDelivery) (\s :: LogDeliveryDescription
s@LogDeliveryDescription' {} Maybe WorkerLogDeliveryDescription
a -> LogDeliveryDescription
s {$sel:workerLogDelivery:LogDeliveryDescription' :: Maybe WorkerLogDeliveryDescription
workerLogDelivery = Maybe WorkerLogDeliveryDescription
a} :: LogDeliveryDescription)

instance Data.FromJSON LogDeliveryDescription where
  parseJSON :: Value -> Parser LogDeliveryDescription
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LogDeliveryDescription"
      ( \Object
x ->
          Maybe WorkerLogDeliveryDescription -> LogDeliveryDescription
LogDeliveryDescription'
            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
"workerLogDelivery")
      )

instance Prelude.Hashable LogDeliveryDescription where
  hashWithSalt :: Int -> LogDeliveryDescription -> Int
hashWithSalt Int
_salt LogDeliveryDescription' {Maybe WorkerLogDeliveryDescription
workerLogDelivery :: Maybe WorkerLogDeliveryDescription
$sel:workerLogDelivery:LogDeliveryDescription' :: LogDeliveryDescription -> Maybe WorkerLogDeliveryDescription
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorkerLogDeliveryDescription
workerLogDelivery

instance Prelude.NFData LogDeliveryDescription where
  rnf :: LogDeliveryDescription -> ()
rnf LogDeliveryDescription' {Maybe WorkerLogDeliveryDescription
workerLogDelivery :: Maybe WorkerLogDeliveryDescription
$sel:workerLogDelivery:LogDeliveryDescription' :: LogDeliveryDescription -> Maybe WorkerLogDeliveryDescription
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe WorkerLogDeliveryDescription
workerLogDelivery