{-# 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.OpsCenterIntegrationConfig
-- 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.OpsCenterIntegrationConfig 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 whether DevOps Guru is configured to create an OpsItem
-- in Amazon Web Services Systems Manager OpsCenter for each created
-- insight. You can use this to update the configuration.
--
-- /See:/ 'newOpsCenterIntegrationConfig' smart constructor.
data OpsCenterIntegrationConfig = OpsCenterIntegrationConfig'
  { -- | Specifies if DevOps Guru is enabled to create an Amazon Web Services
    -- Systems Manager OpsItem for each created insight.
    OpsCenterIntegrationConfig -> Maybe OptInStatus
optInStatus :: Prelude.Maybe OptInStatus
  }
  deriving (OpsCenterIntegrationConfig -> OpsCenterIntegrationConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OpsCenterIntegrationConfig -> OpsCenterIntegrationConfig -> Bool
$c/= :: OpsCenterIntegrationConfig -> OpsCenterIntegrationConfig -> Bool
== :: OpsCenterIntegrationConfig -> OpsCenterIntegrationConfig -> Bool
$c== :: OpsCenterIntegrationConfig -> OpsCenterIntegrationConfig -> Bool
Prelude.Eq, ReadPrec [OpsCenterIntegrationConfig]
ReadPrec OpsCenterIntegrationConfig
Int -> ReadS OpsCenterIntegrationConfig
ReadS [OpsCenterIntegrationConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OpsCenterIntegrationConfig]
$creadListPrec :: ReadPrec [OpsCenterIntegrationConfig]
readPrec :: ReadPrec OpsCenterIntegrationConfig
$creadPrec :: ReadPrec OpsCenterIntegrationConfig
readList :: ReadS [OpsCenterIntegrationConfig]
$creadList :: ReadS [OpsCenterIntegrationConfig]
readsPrec :: Int -> ReadS OpsCenterIntegrationConfig
$creadsPrec :: Int -> ReadS OpsCenterIntegrationConfig
Prelude.Read, Int -> OpsCenterIntegrationConfig -> ShowS
[OpsCenterIntegrationConfig] -> ShowS
OpsCenterIntegrationConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OpsCenterIntegrationConfig] -> ShowS
$cshowList :: [OpsCenterIntegrationConfig] -> ShowS
show :: OpsCenterIntegrationConfig -> String
$cshow :: OpsCenterIntegrationConfig -> String
showsPrec :: Int -> OpsCenterIntegrationConfig -> ShowS
$cshowsPrec :: Int -> OpsCenterIntegrationConfig -> ShowS
Prelude.Show, forall x.
Rep OpsCenterIntegrationConfig x -> OpsCenterIntegrationConfig
forall x.
OpsCenterIntegrationConfig -> Rep OpsCenterIntegrationConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep OpsCenterIntegrationConfig x -> OpsCenterIntegrationConfig
$cfrom :: forall x.
OpsCenterIntegrationConfig -> Rep OpsCenterIntegrationConfig x
Prelude.Generic)

-- |
-- Create a value of 'OpsCenterIntegrationConfig' 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', 'opsCenterIntegrationConfig_optInStatus' - Specifies if DevOps Guru is enabled to create an Amazon Web Services
-- Systems Manager OpsItem for each created insight.
newOpsCenterIntegrationConfig ::
  OpsCenterIntegrationConfig
newOpsCenterIntegrationConfig :: OpsCenterIntegrationConfig
newOpsCenterIntegrationConfig =
  OpsCenterIntegrationConfig'
    { $sel:optInStatus:OpsCenterIntegrationConfig' :: Maybe OptInStatus
optInStatus =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies if DevOps Guru is enabled to create an Amazon Web Services
-- Systems Manager OpsItem for each created insight.
opsCenterIntegrationConfig_optInStatus :: Lens.Lens' OpsCenterIntegrationConfig (Prelude.Maybe OptInStatus)
opsCenterIntegrationConfig_optInStatus :: Lens' OpsCenterIntegrationConfig (Maybe OptInStatus)
opsCenterIntegrationConfig_optInStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsCenterIntegrationConfig' {Maybe OptInStatus
optInStatus :: Maybe OptInStatus
$sel:optInStatus:OpsCenterIntegrationConfig' :: OpsCenterIntegrationConfig -> Maybe OptInStatus
optInStatus} -> Maybe OptInStatus
optInStatus) (\s :: OpsCenterIntegrationConfig
s@OpsCenterIntegrationConfig' {} Maybe OptInStatus
a -> OpsCenterIntegrationConfig
s {$sel:optInStatus:OpsCenterIntegrationConfig' :: Maybe OptInStatus
optInStatus = Maybe OptInStatus
a} :: OpsCenterIntegrationConfig)

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

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

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