{-# 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.ElastiCache.Types.CloudWatchLogsDestinationDetails
-- 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.ElastiCache.Types.CloudWatchLogsDestinationDetails where

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

-- | The configuration details of the CloudWatch Logs destination.
--
-- /See:/ 'newCloudWatchLogsDestinationDetails' smart constructor.
data CloudWatchLogsDestinationDetails = CloudWatchLogsDestinationDetails'
  { -- | The name of the CloudWatch Logs log group.
    CloudWatchLogsDestinationDetails -> Maybe Text
logGroup :: Prelude.Maybe Prelude.Text
  }
  deriving (CloudWatchLogsDestinationDetails
-> CloudWatchLogsDestinationDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloudWatchLogsDestinationDetails
-> CloudWatchLogsDestinationDetails -> Bool
$c/= :: CloudWatchLogsDestinationDetails
-> CloudWatchLogsDestinationDetails -> Bool
== :: CloudWatchLogsDestinationDetails
-> CloudWatchLogsDestinationDetails -> Bool
$c== :: CloudWatchLogsDestinationDetails
-> CloudWatchLogsDestinationDetails -> Bool
Prelude.Eq, ReadPrec [CloudWatchLogsDestinationDetails]
ReadPrec CloudWatchLogsDestinationDetails
Int -> ReadS CloudWatchLogsDestinationDetails
ReadS [CloudWatchLogsDestinationDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloudWatchLogsDestinationDetails]
$creadListPrec :: ReadPrec [CloudWatchLogsDestinationDetails]
readPrec :: ReadPrec CloudWatchLogsDestinationDetails
$creadPrec :: ReadPrec CloudWatchLogsDestinationDetails
readList :: ReadS [CloudWatchLogsDestinationDetails]
$creadList :: ReadS [CloudWatchLogsDestinationDetails]
readsPrec :: Int -> ReadS CloudWatchLogsDestinationDetails
$creadsPrec :: Int -> ReadS CloudWatchLogsDestinationDetails
Prelude.Read, Int -> CloudWatchLogsDestinationDetails -> ShowS
[CloudWatchLogsDestinationDetails] -> ShowS
CloudWatchLogsDestinationDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloudWatchLogsDestinationDetails] -> ShowS
$cshowList :: [CloudWatchLogsDestinationDetails] -> ShowS
show :: CloudWatchLogsDestinationDetails -> String
$cshow :: CloudWatchLogsDestinationDetails -> String
showsPrec :: Int -> CloudWatchLogsDestinationDetails -> ShowS
$cshowsPrec :: Int -> CloudWatchLogsDestinationDetails -> ShowS
Prelude.Show, forall x.
Rep CloudWatchLogsDestinationDetails x
-> CloudWatchLogsDestinationDetails
forall x.
CloudWatchLogsDestinationDetails
-> Rep CloudWatchLogsDestinationDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CloudWatchLogsDestinationDetails x
-> CloudWatchLogsDestinationDetails
$cfrom :: forall x.
CloudWatchLogsDestinationDetails
-> Rep CloudWatchLogsDestinationDetails x
Prelude.Generic)

-- |
-- Create a value of 'CloudWatchLogsDestinationDetails' 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:
--
-- 'logGroup', 'cloudWatchLogsDestinationDetails_logGroup' - The name of the CloudWatch Logs log group.
newCloudWatchLogsDestinationDetails ::
  CloudWatchLogsDestinationDetails
newCloudWatchLogsDestinationDetails :: CloudWatchLogsDestinationDetails
newCloudWatchLogsDestinationDetails =
  CloudWatchLogsDestinationDetails'
    { $sel:logGroup:CloudWatchLogsDestinationDetails' :: Maybe Text
logGroup =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the CloudWatch Logs log group.
cloudWatchLogsDestinationDetails_logGroup :: Lens.Lens' CloudWatchLogsDestinationDetails (Prelude.Maybe Prelude.Text)
cloudWatchLogsDestinationDetails_logGroup :: Lens' CloudWatchLogsDestinationDetails (Maybe Text)
cloudWatchLogsDestinationDetails_logGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogsDestinationDetails' {Maybe Text
logGroup :: Maybe Text
$sel:logGroup:CloudWatchLogsDestinationDetails' :: CloudWatchLogsDestinationDetails -> Maybe Text
logGroup} -> Maybe Text
logGroup) (\s :: CloudWatchLogsDestinationDetails
s@CloudWatchLogsDestinationDetails' {} Maybe Text
a -> CloudWatchLogsDestinationDetails
s {$sel:logGroup:CloudWatchLogsDestinationDetails' :: Maybe Text
logGroup = Maybe Text
a} :: CloudWatchLogsDestinationDetails)

instance
  Data.FromXML
    CloudWatchLogsDestinationDetails
  where
  parseXML :: [Node] -> Either String CloudWatchLogsDestinationDetails
parseXML [Node]
x =
    Maybe Text -> CloudWatchLogsDestinationDetails
CloudWatchLogsDestinationDetails'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"LogGroup")

instance
  Prelude.Hashable
    CloudWatchLogsDestinationDetails
  where
  hashWithSalt :: Int -> CloudWatchLogsDestinationDetails -> Int
hashWithSalt
    Int
_salt
    CloudWatchLogsDestinationDetails' {Maybe Text
logGroup :: Maybe Text
$sel:logGroup:CloudWatchLogsDestinationDetails' :: CloudWatchLogsDestinationDetails -> Maybe Text
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
logGroup

instance
  Prelude.NFData
    CloudWatchLogsDestinationDetails
  where
  rnf :: CloudWatchLogsDestinationDetails -> ()
rnf CloudWatchLogsDestinationDetails' {Maybe Text
logGroup :: Maybe Text
$sel:logGroup:CloudWatchLogsDestinationDetails' :: CloudWatchLogsDestinationDetails -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
logGroup

instance
  Data.ToQuery
    CloudWatchLogsDestinationDetails
  where
  toQuery :: CloudWatchLogsDestinationDetails -> QueryString
toQuery CloudWatchLogsDestinationDetails' {Maybe Text
logGroup :: Maybe Text
$sel:logGroup:CloudWatchLogsDestinationDetails' :: CloudWatchLogsDestinationDetails -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"LogGroup" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
logGroup]