{-# 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.DevOpsGuru.Types.LogsAnomalyDetectionIntegration
-- 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.DevOpsGuru.Types.LogsAnomalyDetectionIntegration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DevOpsGuru.Types.OptInStatus
import qualified Amazonka.Prelude as Prelude

-- | Information about the integration of DevOps Guru with CloudWatch log
-- groups for log anomaly detection.
--
-- /See:/ 'newLogsAnomalyDetectionIntegration' smart constructor.
data LogsAnomalyDetectionIntegration = LogsAnomalyDetectionIntegration'
  { -- | Specifies if DevOps Guru is configured to perform log anomaly detection
    -- on CloudWatch log groups.
    LogsAnomalyDetectionIntegration -> Maybe OptInStatus
optInStatus :: Prelude.Maybe OptInStatus
  }
  deriving (LogsAnomalyDetectionIntegration
-> LogsAnomalyDetectionIntegration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LogsAnomalyDetectionIntegration
-> LogsAnomalyDetectionIntegration -> Bool
$c/= :: LogsAnomalyDetectionIntegration
-> LogsAnomalyDetectionIntegration -> Bool
== :: LogsAnomalyDetectionIntegration
-> LogsAnomalyDetectionIntegration -> Bool
$c== :: LogsAnomalyDetectionIntegration
-> LogsAnomalyDetectionIntegration -> Bool
Prelude.Eq, ReadPrec [LogsAnomalyDetectionIntegration]
ReadPrec LogsAnomalyDetectionIntegration
Int -> ReadS LogsAnomalyDetectionIntegration
ReadS [LogsAnomalyDetectionIntegration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LogsAnomalyDetectionIntegration]
$creadListPrec :: ReadPrec [LogsAnomalyDetectionIntegration]
readPrec :: ReadPrec LogsAnomalyDetectionIntegration
$creadPrec :: ReadPrec LogsAnomalyDetectionIntegration
readList :: ReadS [LogsAnomalyDetectionIntegration]
$creadList :: ReadS [LogsAnomalyDetectionIntegration]
readsPrec :: Int -> ReadS LogsAnomalyDetectionIntegration
$creadsPrec :: Int -> ReadS LogsAnomalyDetectionIntegration
Prelude.Read, Int -> LogsAnomalyDetectionIntegration -> ShowS
[LogsAnomalyDetectionIntegration] -> ShowS
LogsAnomalyDetectionIntegration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LogsAnomalyDetectionIntegration] -> ShowS
$cshowList :: [LogsAnomalyDetectionIntegration] -> ShowS
show :: LogsAnomalyDetectionIntegration -> String
$cshow :: LogsAnomalyDetectionIntegration -> String
showsPrec :: Int -> LogsAnomalyDetectionIntegration -> ShowS
$cshowsPrec :: Int -> LogsAnomalyDetectionIntegration -> ShowS
Prelude.Show, forall x.
Rep LogsAnomalyDetectionIntegration x
-> LogsAnomalyDetectionIntegration
forall x.
LogsAnomalyDetectionIntegration
-> Rep LogsAnomalyDetectionIntegration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LogsAnomalyDetectionIntegration x
-> LogsAnomalyDetectionIntegration
$cfrom :: forall x.
LogsAnomalyDetectionIntegration
-> Rep LogsAnomalyDetectionIntegration x
Prelude.Generic)

-- |
-- Create a value of 'LogsAnomalyDetectionIntegration' 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:
--
-- 'optInStatus', 'logsAnomalyDetectionIntegration_optInStatus' - Specifies if DevOps Guru is configured to perform log anomaly detection
-- on CloudWatch log groups.
newLogsAnomalyDetectionIntegration ::
  LogsAnomalyDetectionIntegration
newLogsAnomalyDetectionIntegration :: LogsAnomalyDetectionIntegration
newLogsAnomalyDetectionIntegration =
  LogsAnomalyDetectionIntegration'
    { $sel:optInStatus:LogsAnomalyDetectionIntegration' :: Maybe OptInStatus
optInStatus =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies if DevOps Guru is configured to perform log anomaly detection
-- on CloudWatch log groups.
logsAnomalyDetectionIntegration_optInStatus :: Lens.Lens' LogsAnomalyDetectionIntegration (Prelude.Maybe OptInStatus)
logsAnomalyDetectionIntegration_optInStatus :: Lens' LogsAnomalyDetectionIntegration (Maybe OptInStatus)
logsAnomalyDetectionIntegration_optInStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogsAnomalyDetectionIntegration' {Maybe OptInStatus
optInStatus :: Maybe OptInStatus
$sel:optInStatus:LogsAnomalyDetectionIntegration' :: LogsAnomalyDetectionIntegration -> Maybe OptInStatus
optInStatus} -> Maybe OptInStatus
optInStatus) (\s :: LogsAnomalyDetectionIntegration
s@LogsAnomalyDetectionIntegration' {} Maybe OptInStatus
a -> LogsAnomalyDetectionIntegration
s {$sel:optInStatus:LogsAnomalyDetectionIntegration' :: Maybe OptInStatus
optInStatus = Maybe OptInStatus
a} :: LogsAnomalyDetectionIntegration)

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

instance
  Prelude.Hashable
    LogsAnomalyDetectionIntegration
  where
  hashWithSalt :: Int -> LogsAnomalyDetectionIntegration -> Int
hashWithSalt
    Int
_salt
    LogsAnomalyDetectionIntegration' {Maybe OptInStatus
optInStatus :: Maybe OptInStatus
$sel:optInStatus:LogsAnomalyDetectionIntegration' :: LogsAnomalyDetectionIntegration -> Maybe OptInStatus
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OptInStatus
optInStatus

instance
  Prelude.NFData
    LogsAnomalyDetectionIntegration
  where
  rnf :: LogsAnomalyDetectionIntegration -> ()
rnf LogsAnomalyDetectionIntegration' {Maybe OptInStatus
optInStatus :: Maybe OptInStatus
$sel:optInStatus:LogsAnomalyDetectionIntegration' :: LogsAnomalyDetectionIntegration -> Maybe OptInStatus
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe OptInStatus
optInStatus