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

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

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

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

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

instance Data.ToJSON CloudWatchLogsDestinationConfig where
  toJSON :: CloudWatchLogsDestinationConfig -> Value
toJSON CloudWatchLogsDestinationConfig' {Maybe Text
logGroup :: Maybe Text
$sel:logGroup:CloudWatchLogsDestinationConfig' :: CloudWatchLogsDestinationConfig -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"logGroup" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
logGroup]
      )