{-# 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.UpdateServiceIntegrationConfig
-- 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.UpdateServiceIntegrationConfig 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.LogsAnomalyDetectionIntegrationConfig
import Amazonka.DevOpsGuru.Types.OpsCenterIntegrationConfig
import qualified Amazonka.Prelude as Prelude

-- | Information about updating the integration status of an Amazon Web
-- Services service, such as Amazon Web Services Systems Manager, with
-- DevOps Guru.
--
-- /See:/ 'newUpdateServiceIntegrationConfig' smart constructor.
data UpdateServiceIntegrationConfig = UpdateServiceIntegrationConfig'
  { -- | Information about whether DevOps Guru is configured to perform log
    -- anomaly detection on Amazon CloudWatch log groups.
    UpdateServiceIntegrationConfig
-> Maybe LogsAnomalyDetectionIntegrationConfig
logsAnomalyDetection :: Prelude.Maybe LogsAnomalyDetectionIntegrationConfig,
    UpdateServiceIntegrationConfig -> Maybe OpsCenterIntegrationConfig
opsCenter :: Prelude.Maybe OpsCenterIntegrationConfig
  }
  deriving (UpdateServiceIntegrationConfig
-> UpdateServiceIntegrationConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServiceIntegrationConfig
-> UpdateServiceIntegrationConfig -> Bool
$c/= :: UpdateServiceIntegrationConfig
-> UpdateServiceIntegrationConfig -> Bool
== :: UpdateServiceIntegrationConfig
-> UpdateServiceIntegrationConfig -> Bool
$c== :: UpdateServiceIntegrationConfig
-> UpdateServiceIntegrationConfig -> Bool
Prelude.Eq, ReadPrec [UpdateServiceIntegrationConfig]
ReadPrec UpdateServiceIntegrationConfig
Int -> ReadS UpdateServiceIntegrationConfig
ReadS [UpdateServiceIntegrationConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateServiceIntegrationConfig]
$creadListPrec :: ReadPrec [UpdateServiceIntegrationConfig]
readPrec :: ReadPrec UpdateServiceIntegrationConfig
$creadPrec :: ReadPrec UpdateServiceIntegrationConfig
readList :: ReadS [UpdateServiceIntegrationConfig]
$creadList :: ReadS [UpdateServiceIntegrationConfig]
readsPrec :: Int -> ReadS UpdateServiceIntegrationConfig
$creadsPrec :: Int -> ReadS UpdateServiceIntegrationConfig
Prelude.Read, Int -> UpdateServiceIntegrationConfig -> ShowS
[UpdateServiceIntegrationConfig] -> ShowS
UpdateServiceIntegrationConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServiceIntegrationConfig] -> ShowS
$cshowList :: [UpdateServiceIntegrationConfig] -> ShowS
show :: UpdateServiceIntegrationConfig -> String
$cshow :: UpdateServiceIntegrationConfig -> String
showsPrec :: Int -> UpdateServiceIntegrationConfig -> ShowS
$cshowsPrec :: Int -> UpdateServiceIntegrationConfig -> ShowS
Prelude.Show, forall x.
Rep UpdateServiceIntegrationConfig x
-> UpdateServiceIntegrationConfig
forall x.
UpdateServiceIntegrationConfig
-> Rep UpdateServiceIntegrationConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateServiceIntegrationConfig x
-> UpdateServiceIntegrationConfig
$cfrom :: forall x.
UpdateServiceIntegrationConfig
-> Rep UpdateServiceIntegrationConfig x
Prelude.Generic)

-- |
-- Create a value of 'UpdateServiceIntegrationConfig' 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:
--
-- 'logsAnomalyDetection', 'updateServiceIntegrationConfig_logsAnomalyDetection' - Information about whether DevOps Guru is configured to perform log
-- anomaly detection on Amazon CloudWatch log groups.
--
-- 'opsCenter', 'updateServiceIntegrationConfig_opsCenter' - Undocumented member.
newUpdateServiceIntegrationConfig ::
  UpdateServiceIntegrationConfig
newUpdateServiceIntegrationConfig :: UpdateServiceIntegrationConfig
newUpdateServiceIntegrationConfig =
  UpdateServiceIntegrationConfig'
    { $sel:logsAnomalyDetection:UpdateServiceIntegrationConfig' :: Maybe LogsAnomalyDetectionIntegrationConfig
logsAnomalyDetection =
        forall a. Maybe a
Prelude.Nothing,
      $sel:opsCenter:UpdateServiceIntegrationConfig' :: Maybe OpsCenterIntegrationConfig
opsCenter = forall a. Maybe a
Prelude.Nothing
    }

-- | Information about whether DevOps Guru is configured to perform log
-- anomaly detection on Amazon CloudWatch log groups.
updateServiceIntegrationConfig_logsAnomalyDetection :: Lens.Lens' UpdateServiceIntegrationConfig (Prelude.Maybe LogsAnomalyDetectionIntegrationConfig)
updateServiceIntegrationConfig_logsAnomalyDetection :: Lens'
  UpdateServiceIntegrationConfig
  (Maybe LogsAnomalyDetectionIntegrationConfig)
updateServiceIntegrationConfig_logsAnomalyDetection = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceIntegrationConfig' {Maybe LogsAnomalyDetectionIntegrationConfig
logsAnomalyDetection :: Maybe LogsAnomalyDetectionIntegrationConfig
$sel:logsAnomalyDetection:UpdateServiceIntegrationConfig' :: UpdateServiceIntegrationConfig
-> Maybe LogsAnomalyDetectionIntegrationConfig
logsAnomalyDetection} -> Maybe LogsAnomalyDetectionIntegrationConfig
logsAnomalyDetection) (\s :: UpdateServiceIntegrationConfig
s@UpdateServiceIntegrationConfig' {} Maybe LogsAnomalyDetectionIntegrationConfig
a -> UpdateServiceIntegrationConfig
s {$sel:logsAnomalyDetection:UpdateServiceIntegrationConfig' :: Maybe LogsAnomalyDetectionIntegrationConfig
logsAnomalyDetection = Maybe LogsAnomalyDetectionIntegrationConfig
a} :: UpdateServiceIntegrationConfig)

-- | Undocumented member.
updateServiceIntegrationConfig_opsCenter :: Lens.Lens' UpdateServiceIntegrationConfig (Prelude.Maybe OpsCenterIntegrationConfig)
updateServiceIntegrationConfig_opsCenter :: Lens'
  UpdateServiceIntegrationConfig (Maybe OpsCenterIntegrationConfig)
updateServiceIntegrationConfig_opsCenter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceIntegrationConfig' {Maybe OpsCenterIntegrationConfig
opsCenter :: Maybe OpsCenterIntegrationConfig
$sel:opsCenter:UpdateServiceIntegrationConfig' :: UpdateServiceIntegrationConfig -> Maybe OpsCenterIntegrationConfig
opsCenter} -> Maybe OpsCenterIntegrationConfig
opsCenter) (\s :: UpdateServiceIntegrationConfig
s@UpdateServiceIntegrationConfig' {} Maybe OpsCenterIntegrationConfig
a -> UpdateServiceIntegrationConfig
s {$sel:opsCenter:UpdateServiceIntegrationConfig' :: Maybe OpsCenterIntegrationConfig
opsCenter = Maybe OpsCenterIntegrationConfig
a} :: UpdateServiceIntegrationConfig)

instance
  Prelude.Hashable
    UpdateServiceIntegrationConfig
  where
  hashWithSalt :: Int -> UpdateServiceIntegrationConfig -> Int
hashWithSalt
    Int
_salt
    UpdateServiceIntegrationConfig' {Maybe OpsCenterIntegrationConfig
Maybe LogsAnomalyDetectionIntegrationConfig
opsCenter :: Maybe OpsCenterIntegrationConfig
logsAnomalyDetection :: Maybe LogsAnomalyDetectionIntegrationConfig
$sel:opsCenter:UpdateServiceIntegrationConfig' :: UpdateServiceIntegrationConfig -> Maybe OpsCenterIntegrationConfig
$sel:logsAnomalyDetection:UpdateServiceIntegrationConfig' :: UpdateServiceIntegrationConfig
-> Maybe LogsAnomalyDetectionIntegrationConfig
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LogsAnomalyDetectionIntegrationConfig
logsAnomalyDetection
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OpsCenterIntegrationConfig
opsCenter

instance
  Prelude.NFData
    UpdateServiceIntegrationConfig
  where
  rnf :: UpdateServiceIntegrationConfig -> ()
rnf UpdateServiceIntegrationConfig' {Maybe OpsCenterIntegrationConfig
Maybe LogsAnomalyDetectionIntegrationConfig
opsCenter :: Maybe OpsCenterIntegrationConfig
logsAnomalyDetection :: Maybe LogsAnomalyDetectionIntegrationConfig
$sel:opsCenter:UpdateServiceIntegrationConfig' :: UpdateServiceIntegrationConfig -> Maybe OpsCenterIntegrationConfig
$sel:logsAnomalyDetection:UpdateServiceIntegrationConfig' :: UpdateServiceIntegrationConfig
-> Maybe LogsAnomalyDetectionIntegrationConfig
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe LogsAnomalyDetectionIntegrationConfig
logsAnomalyDetection
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OpsCenterIntegrationConfig
opsCenter

instance Data.ToJSON UpdateServiceIntegrationConfig where
  toJSON :: UpdateServiceIntegrationConfig -> Value
toJSON UpdateServiceIntegrationConfig' {Maybe OpsCenterIntegrationConfig
Maybe LogsAnomalyDetectionIntegrationConfig
opsCenter :: Maybe OpsCenterIntegrationConfig
logsAnomalyDetection :: Maybe LogsAnomalyDetectionIntegrationConfig
$sel:opsCenter:UpdateServiceIntegrationConfig' :: UpdateServiceIntegrationConfig -> Maybe OpsCenterIntegrationConfig
$sel:logsAnomalyDetection:UpdateServiceIntegrationConfig' :: UpdateServiceIntegrationConfig
-> Maybe LogsAnomalyDetectionIntegrationConfig
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"LogsAnomalyDetection" 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 LogsAnomalyDetectionIntegrationConfig
logsAnomalyDetection,
            (Key
"OpsCenter" 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 OpsCenterIntegrationConfig
opsCenter
          ]
      )