{-# 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.Evidently.Types.CloudWatchLogsDestination
-- 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.Evidently.Types.CloudWatchLogsDestination 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

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

-- |
-- Create a value of 'CloudWatchLogsDestination' 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', 'cloudWatchLogsDestination_logGroup' - The name of the log group where the project stores evaluation events.
newCloudWatchLogsDestination ::
  CloudWatchLogsDestination
newCloudWatchLogsDestination :: CloudWatchLogsDestination
newCloudWatchLogsDestination =
  CloudWatchLogsDestination'
    { $sel:logGroup:CloudWatchLogsDestination' :: Maybe Text
logGroup =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the log group where the project stores evaluation events.
cloudWatchLogsDestination_logGroup :: Lens.Lens' CloudWatchLogsDestination (Prelude.Maybe Prelude.Text)
cloudWatchLogsDestination_logGroup :: Lens' CloudWatchLogsDestination (Maybe Text)
cloudWatchLogsDestination_logGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchLogsDestination' {Maybe Text
logGroup :: Maybe Text
$sel:logGroup:CloudWatchLogsDestination' :: CloudWatchLogsDestination -> Maybe Text
logGroup} -> Maybe Text
logGroup) (\s :: CloudWatchLogsDestination
s@CloudWatchLogsDestination' {} Maybe Text
a -> CloudWatchLogsDestination
s {$sel:logGroup:CloudWatchLogsDestination' :: Maybe Text
logGroup = Maybe Text
a} :: CloudWatchLogsDestination)

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

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

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