{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DevOpsGuru.Types.OpsCenterIntegrationConfig where

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

-- | Information about whether DevOps Guru is configured to create an OpsItem
-- in AWS Systems Manager OpsCenter for each created insight.
--
-- /See:/ 'newOpsCenterIntegrationConfig' smart constructor.
data OpsCenterIntegrationConfig = OpsCenterIntegrationConfig'
  { -- | Specifies if DevOps Guru is enabled to create an AWS Systems Manager
    -- OpsItem for each created insight.
    OpsCenterIntegrationConfig -> Maybe OptInStatus
optInStatus :: Prelude.Maybe OptInStatus
  }
  deriving (OpsCenterIntegrationConfig -> OpsCenterIntegrationConfig -> Bool
(OpsCenterIntegrationConfig -> OpsCenterIntegrationConfig -> Bool)
-> (OpsCenterIntegrationConfig
    -> OpsCenterIntegrationConfig -> Bool)
-> Eq OpsCenterIntegrationConfig
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]
(Int -> ReadS OpsCenterIntegrationConfig)
-> ReadS [OpsCenterIntegrationConfig]
-> ReadPrec OpsCenterIntegrationConfig
-> ReadPrec [OpsCenterIntegrationConfig]
-> Read 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
(Int -> OpsCenterIntegrationConfig -> ShowS)
-> (OpsCenterIntegrationConfig -> String)
-> ([OpsCenterIntegrationConfig] -> ShowS)
-> Show OpsCenterIntegrationConfig
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.
 OpsCenterIntegrationConfig -> Rep OpsCenterIntegrationConfig x)
-> (forall x.
    Rep OpsCenterIntegrationConfig x -> OpsCenterIntegrationConfig)
-> Generic OpsCenterIntegrationConfig
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 AWS Systems Manager
-- OpsItem for each created insight.
newOpsCenterIntegrationConfig ::
  OpsCenterIntegrationConfig
newOpsCenterIntegrationConfig :: OpsCenterIntegrationConfig
newOpsCenterIntegrationConfig =
  OpsCenterIntegrationConfig' :: Maybe OptInStatus -> OpsCenterIntegrationConfig
OpsCenterIntegrationConfig'
    { $sel:optInStatus:OpsCenterIntegrationConfig' :: Maybe OptInStatus
optInStatus =
        Maybe OptInStatus
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies if DevOps Guru is enabled to create an AWS Systems Manager
-- OpsItem for each created insight.
opsCenterIntegrationConfig_optInStatus :: Lens.Lens' OpsCenterIntegrationConfig (Prelude.Maybe OptInStatus)
opsCenterIntegrationConfig_optInStatus :: (Maybe OptInStatus -> f (Maybe OptInStatus))
-> OpsCenterIntegrationConfig -> f OpsCenterIntegrationConfig
opsCenterIntegrationConfig_optInStatus = (OpsCenterIntegrationConfig -> Maybe OptInStatus)
-> (OpsCenterIntegrationConfig
    -> Maybe OptInStatus -> OpsCenterIntegrationConfig)
-> Lens
     OpsCenterIntegrationConfig
     OpsCenterIntegrationConfig
     (Maybe OptInStatus)
     (Maybe 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

instance Prelude.NFData OpsCenterIntegrationConfig

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