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

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

-- | A description of the log delivery settings.
--
-- /See:/ 'newCloudWatchLogsLogDeliveryDescription' smart constructor.
data CloudWatchLogsLogDeliveryDescription = CloudWatchLogsLogDeliveryDescription'
  { -- | Whether log delivery to Amazon CloudWatch Logs is enabled.
    CloudWatchLogsLogDeliveryDescription -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The name of the CloudWatch log group that is the destination for log
    -- delivery.
    CloudWatchLogsLogDeliveryDescription -> Maybe Text
logGroup :: Prelude.Maybe Prelude.Text
  }
  deriving (CloudWatchLogsLogDeliveryDescription
-> CloudWatchLogsLogDeliveryDescription -> Bool
(CloudWatchLogsLogDeliveryDescription
 -> CloudWatchLogsLogDeliveryDescription -> Bool)
-> (CloudWatchLogsLogDeliveryDescription
    -> CloudWatchLogsLogDeliveryDescription -> Bool)
-> Eq CloudWatchLogsLogDeliveryDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloudWatchLogsLogDeliveryDescription
-> CloudWatchLogsLogDeliveryDescription -> Bool
$c/= :: CloudWatchLogsLogDeliveryDescription
-> CloudWatchLogsLogDeliveryDescription -> Bool
== :: CloudWatchLogsLogDeliveryDescription
-> CloudWatchLogsLogDeliveryDescription -> Bool
$c== :: CloudWatchLogsLogDeliveryDescription
-> CloudWatchLogsLogDeliveryDescription -> Bool
Prelude.Eq, ReadPrec [CloudWatchLogsLogDeliveryDescription]
ReadPrec CloudWatchLogsLogDeliveryDescription
Int -> ReadS CloudWatchLogsLogDeliveryDescription
ReadS [CloudWatchLogsLogDeliveryDescription]
(Int -> ReadS CloudWatchLogsLogDeliveryDescription)
-> ReadS [CloudWatchLogsLogDeliveryDescription]
-> ReadPrec CloudWatchLogsLogDeliveryDescription
-> ReadPrec [CloudWatchLogsLogDeliveryDescription]
-> Read CloudWatchLogsLogDeliveryDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloudWatchLogsLogDeliveryDescription]
$creadListPrec :: ReadPrec [CloudWatchLogsLogDeliveryDescription]
readPrec :: ReadPrec CloudWatchLogsLogDeliveryDescription
$creadPrec :: ReadPrec CloudWatchLogsLogDeliveryDescription
readList :: ReadS [CloudWatchLogsLogDeliveryDescription]
$creadList :: ReadS [CloudWatchLogsLogDeliveryDescription]
readsPrec :: Int -> ReadS CloudWatchLogsLogDeliveryDescription
$creadsPrec :: Int -> ReadS CloudWatchLogsLogDeliveryDescription
Prelude.Read, Int -> CloudWatchLogsLogDeliveryDescription -> ShowS
[CloudWatchLogsLogDeliveryDescription] -> ShowS
CloudWatchLogsLogDeliveryDescription -> String
(Int -> CloudWatchLogsLogDeliveryDescription -> ShowS)
-> (CloudWatchLogsLogDeliveryDescription -> String)
-> ([CloudWatchLogsLogDeliveryDescription] -> ShowS)
-> Show CloudWatchLogsLogDeliveryDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloudWatchLogsLogDeliveryDescription] -> ShowS
$cshowList :: [CloudWatchLogsLogDeliveryDescription] -> ShowS
show :: CloudWatchLogsLogDeliveryDescription -> String
$cshow :: CloudWatchLogsLogDeliveryDescription -> String
showsPrec :: Int -> CloudWatchLogsLogDeliveryDescription -> ShowS
$cshowsPrec :: Int -> CloudWatchLogsLogDeliveryDescription -> ShowS
Prelude.Show, (forall x.
 CloudWatchLogsLogDeliveryDescription
 -> Rep CloudWatchLogsLogDeliveryDescription x)
-> (forall x.
    Rep CloudWatchLogsLogDeliveryDescription x
    -> CloudWatchLogsLogDeliveryDescription)
-> Generic CloudWatchLogsLogDeliveryDescription
forall x.
Rep CloudWatchLogsLogDeliveryDescription x
-> CloudWatchLogsLogDeliveryDescription
forall x.
CloudWatchLogsLogDeliveryDescription
-> Rep CloudWatchLogsLogDeliveryDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CloudWatchLogsLogDeliveryDescription x
-> CloudWatchLogsLogDeliveryDescription
$cfrom :: forall x.
CloudWatchLogsLogDeliveryDescription
-> Rep CloudWatchLogsLogDeliveryDescription x
Prelude.Generic)

-- |
-- Create a value of 'CloudWatchLogsLogDeliveryDescription' 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:
--
-- 'enabled', 'cloudWatchLogsLogDeliveryDescription_enabled' - Whether log delivery to Amazon CloudWatch Logs is enabled.
--
-- 'logGroup', 'cloudWatchLogsLogDeliveryDescription_logGroup' - The name of the CloudWatch log group that is the destination for log
-- delivery.
newCloudWatchLogsLogDeliveryDescription ::
  CloudWatchLogsLogDeliveryDescription
newCloudWatchLogsLogDeliveryDescription :: CloudWatchLogsLogDeliveryDescription
newCloudWatchLogsLogDeliveryDescription =
  CloudWatchLogsLogDeliveryDescription' :: Maybe Bool -> Maybe Text -> CloudWatchLogsLogDeliveryDescription
CloudWatchLogsLogDeliveryDescription'
    { $sel:enabled:CloudWatchLogsLogDeliveryDescription' :: Maybe Bool
enabled =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:logGroup:CloudWatchLogsLogDeliveryDescription' :: Maybe Text
logGroup = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Whether log delivery to Amazon CloudWatch Logs is enabled.
cloudWatchLogsLogDeliveryDescription_enabled :: Lens.Lens' CloudWatchLogsLogDeliveryDescription (Prelude.Maybe Prelude.Bool)
cloudWatchLogsLogDeliveryDescription_enabled :: (Maybe Bool -> f (Maybe Bool))
-> CloudWatchLogsLogDeliveryDescription
-> f CloudWatchLogsLogDeliveryDescription
cloudWatchLogsLogDeliveryDescription_enabled = (CloudWatchLogsLogDeliveryDescription -> Maybe Bool)
-> (CloudWatchLogsLogDeliveryDescription
    -> Maybe Bool -> CloudWatchLogsLogDeliveryDescription)
-> Lens
     CloudWatchLogsLogDeliveryDescription
     CloudWatchLogsLogDeliveryDescription
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogsLogDeliveryDescription' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:CloudWatchLogsLogDeliveryDescription' :: CloudWatchLogsLogDeliveryDescription -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: CloudWatchLogsLogDeliveryDescription
s@CloudWatchLogsLogDeliveryDescription' {} Maybe Bool
a -> CloudWatchLogsLogDeliveryDescription
s {$sel:enabled:CloudWatchLogsLogDeliveryDescription' :: Maybe Bool
enabled = Maybe Bool
a} :: CloudWatchLogsLogDeliveryDescription)

-- | The name of the CloudWatch log group that is the destination for log
-- delivery.
cloudWatchLogsLogDeliveryDescription_logGroup :: Lens.Lens' CloudWatchLogsLogDeliveryDescription (Prelude.Maybe Prelude.Text)
cloudWatchLogsLogDeliveryDescription_logGroup :: (Maybe Text -> f (Maybe Text))
-> CloudWatchLogsLogDeliveryDescription
-> f CloudWatchLogsLogDeliveryDescription
cloudWatchLogsLogDeliveryDescription_logGroup = (CloudWatchLogsLogDeliveryDescription -> Maybe Text)
-> (CloudWatchLogsLogDeliveryDescription
    -> Maybe Text -> CloudWatchLogsLogDeliveryDescription)
-> Lens
     CloudWatchLogsLogDeliveryDescription
     CloudWatchLogsLogDeliveryDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogsLogDeliveryDescription' {Maybe Text
logGroup :: Maybe Text
$sel:logGroup:CloudWatchLogsLogDeliveryDescription' :: CloudWatchLogsLogDeliveryDescription -> Maybe Text
logGroup} -> Maybe Text
logGroup) (\s :: CloudWatchLogsLogDeliveryDescription
s@CloudWatchLogsLogDeliveryDescription' {} Maybe Text
a -> CloudWatchLogsLogDeliveryDescription
s {$sel:logGroup:CloudWatchLogsLogDeliveryDescription' :: Maybe Text
logGroup = Maybe Text
a} :: CloudWatchLogsLogDeliveryDescription)

instance
  Core.FromJSON
    CloudWatchLogsLogDeliveryDescription
  where
  parseJSON :: Value -> Parser CloudWatchLogsLogDeliveryDescription
parseJSON =
    String
-> (Object -> Parser CloudWatchLogsLogDeliveryDescription)
-> Value
-> Parser CloudWatchLogsLogDeliveryDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CloudWatchLogsLogDeliveryDescription"
      ( \Object
x ->
          Maybe Bool -> Maybe Text -> CloudWatchLogsLogDeliveryDescription
CloudWatchLogsLogDeliveryDescription'
            (Maybe Bool -> Maybe Text -> CloudWatchLogsLogDeliveryDescription)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> CloudWatchLogsLogDeliveryDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"enabled")
            Parser (Maybe Text -> CloudWatchLogsLogDeliveryDescription)
-> Parser (Maybe Text)
-> Parser CloudWatchLogsLogDeliveryDescription
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
"logGroup")
      )

instance
  Prelude.Hashable
    CloudWatchLogsLogDeliveryDescription

instance
  Prelude.NFData
    CloudWatchLogsLogDeliveryDescription