{-# 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.FIS.Types.ExperimentTemplateCloudWatchLogsLogConfiguration
-- 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.FIS.Types.ExperimentTemplateCloudWatchLogsLogConfiguration 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

-- | Describes the configuration for experiment logging to Amazon CloudWatch
-- Logs.
--
-- /See:/ 'newExperimentTemplateCloudWatchLogsLogConfiguration' smart constructor.
data ExperimentTemplateCloudWatchLogsLogConfiguration = ExperimentTemplateCloudWatchLogsLogConfiguration'
  { -- | The Amazon Resource Name (ARN) of the destination Amazon CloudWatch Logs
    -- log group.
    ExperimentTemplateCloudWatchLogsLogConfiguration -> Maybe Text
logGroupArn :: Prelude.Maybe Prelude.Text
  }
  deriving (ExperimentTemplateCloudWatchLogsLogConfiguration
-> ExperimentTemplateCloudWatchLogsLogConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExperimentTemplateCloudWatchLogsLogConfiguration
-> ExperimentTemplateCloudWatchLogsLogConfiguration -> Bool
$c/= :: ExperimentTemplateCloudWatchLogsLogConfiguration
-> ExperimentTemplateCloudWatchLogsLogConfiguration -> Bool
== :: ExperimentTemplateCloudWatchLogsLogConfiguration
-> ExperimentTemplateCloudWatchLogsLogConfiguration -> Bool
$c== :: ExperimentTemplateCloudWatchLogsLogConfiguration
-> ExperimentTemplateCloudWatchLogsLogConfiguration -> Bool
Prelude.Eq, ReadPrec [ExperimentTemplateCloudWatchLogsLogConfiguration]
ReadPrec ExperimentTemplateCloudWatchLogsLogConfiguration
Int -> ReadS ExperimentTemplateCloudWatchLogsLogConfiguration
ReadS [ExperimentTemplateCloudWatchLogsLogConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExperimentTemplateCloudWatchLogsLogConfiguration]
$creadListPrec :: ReadPrec [ExperimentTemplateCloudWatchLogsLogConfiguration]
readPrec :: ReadPrec ExperimentTemplateCloudWatchLogsLogConfiguration
$creadPrec :: ReadPrec ExperimentTemplateCloudWatchLogsLogConfiguration
readList :: ReadS [ExperimentTemplateCloudWatchLogsLogConfiguration]
$creadList :: ReadS [ExperimentTemplateCloudWatchLogsLogConfiguration]
readsPrec :: Int -> ReadS ExperimentTemplateCloudWatchLogsLogConfiguration
$creadsPrec :: Int -> ReadS ExperimentTemplateCloudWatchLogsLogConfiguration
Prelude.Read, Int -> ExperimentTemplateCloudWatchLogsLogConfiguration -> ShowS
[ExperimentTemplateCloudWatchLogsLogConfiguration] -> ShowS
ExperimentTemplateCloudWatchLogsLogConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExperimentTemplateCloudWatchLogsLogConfiguration] -> ShowS
$cshowList :: [ExperimentTemplateCloudWatchLogsLogConfiguration] -> ShowS
show :: ExperimentTemplateCloudWatchLogsLogConfiguration -> String
$cshow :: ExperimentTemplateCloudWatchLogsLogConfiguration -> String
showsPrec :: Int -> ExperimentTemplateCloudWatchLogsLogConfiguration -> ShowS
$cshowsPrec :: Int -> ExperimentTemplateCloudWatchLogsLogConfiguration -> ShowS
Prelude.Show, forall x.
Rep ExperimentTemplateCloudWatchLogsLogConfiguration x
-> ExperimentTemplateCloudWatchLogsLogConfiguration
forall x.
ExperimentTemplateCloudWatchLogsLogConfiguration
-> Rep ExperimentTemplateCloudWatchLogsLogConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExperimentTemplateCloudWatchLogsLogConfiguration x
-> ExperimentTemplateCloudWatchLogsLogConfiguration
$cfrom :: forall x.
ExperimentTemplateCloudWatchLogsLogConfiguration
-> Rep ExperimentTemplateCloudWatchLogsLogConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'ExperimentTemplateCloudWatchLogsLogConfiguration' 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:
--
-- 'logGroupArn', 'experimentTemplateCloudWatchLogsLogConfiguration_logGroupArn' - The Amazon Resource Name (ARN) of the destination Amazon CloudWatch Logs
-- log group.
newExperimentTemplateCloudWatchLogsLogConfiguration ::
  ExperimentTemplateCloudWatchLogsLogConfiguration
newExperimentTemplateCloudWatchLogsLogConfiguration :: ExperimentTemplateCloudWatchLogsLogConfiguration
newExperimentTemplateCloudWatchLogsLogConfiguration =
  ExperimentTemplateCloudWatchLogsLogConfiguration'
    { $sel:logGroupArn:ExperimentTemplateCloudWatchLogsLogConfiguration' :: Maybe Text
logGroupArn =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the destination Amazon CloudWatch Logs
-- log group.
experimentTemplateCloudWatchLogsLogConfiguration_logGroupArn :: Lens.Lens' ExperimentTemplateCloudWatchLogsLogConfiguration (Prelude.Maybe Prelude.Text)
experimentTemplateCloudWatchLogsLogConfiguration_logGroupArn :: Lens' ExperimentTemplateCloudWatchLogsLogConfiguration (Maybe Text)
experimentTemplateCloudWatchLogsLogConfiguration_logGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTemplateCloudWatchLogsLogConfiguration' {Maybe Text
logGroupArn :: Maybe Text
$sel:logGroupArn:ExperimentTemplateCloudWatchLogsLogConfiguration' :: ExperimentTemplateCloudWatchLogsLogConfiguration -> Maybe Text
logGroupArn} -> Maybe Text
logGroupArn) (\s :: ExperimentTemplateCloudWatchLogsLogConfiguration
s@ExperimentTemplateCloudWatchLogsLogConfiguration' {} Maybe Text
a -> ExperimentTemplateCloudWatchLogsLogConfiguration
s {$sel:logGroupArn:ExperimentTemplateCloudWatchLogsLogConfiguration' :: Maybe Text
logGroupArn = Maybe Text
a} :: ExperimentTemplateCloudWatchLogsLogConfiguration)

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

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

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