{-# 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.OpsCenterIntegration
-- 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.OpsCenterIntegration 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:/ 'newOpsCenterIntegration' smart constructor.
data OpsCenterIntegration = OpsCenterIntegration'
  { -- | Specifies if DevOps Guru is enabled to create an AWS Systems Manager
    -- OpsItem for each created insight.
    OpsCenterIntegration -> Maybe OptInStatus
optInStatus :: Prelude.Maybe OptInStatus
  }
  deriving (OpsCenterIntegration -> OpsCenterIntegration -> Bool
(OpsCenterIntegration -> OpsCenterIntegration -> Bool)
-> (OpsCenterIntegration -> OpsCenterIntegration -> Bool)
-> Eq OpsCenterIntegration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OpsCenterIntegration -> OpsCenterIntegration -> Bool
$c/= :: OpsCenterIntegration -> OpsCenterIntegration -> Bool
== :: OpsCenterIntegration -> OpsCenterIntegration -> Bool
$c== :: OpsCenterIntegration -> OpsCenterIntegration -> Bool
Prelude.Eq, ReadPrec [OpsCenterIntegration]
ReadPrec OpsCenterIntegration
Int -> ReadS OpsCenterIntegration
ReadS [OpsCenterIntegration]
(Int -> ReadS OpsCenterIntegration)
-> ReadS [OpsCenterIntegration]
-> ReadPrec OpsCenterIntegration
-> ReadPrec [OpsCenterIntegration]
-> Read OpsCenterIntegration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OpsCenterIntegration]
$creadListPrec :: ReadPrec [OpsCenterIntegration]
readPrec :: ReadPrec OpsCenterIntegration
$creadPrec :: ReadPrec OpsCenterIntegration
readList :: ReadS [OpsCenterIntegration]
$creadList :: ReadS [OpsCenterIntegration]
readsPrec :: Int -> ReadS OpsCenterIntegration
$creadsPrec :: Int -> ReadS OpsCenterIntegration
Prelude.Read, Int -> OpsCenterIntegration -> ShowS
[OpsCenterIntegration] -> ShowS
OpsCenterIntegration -> String
(Int -> OpsCenterIntegration -> ShowS)
-> (OpsCenterIntegration -> String)
-> ([OpsCenterIntegration] -> ShowS)
-> Show OpsCenterIntegration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OpsCenterIntegration] -> ShowS
$cshowList :: [OpsCenterIntegration] -> ShowS
show :: OpsCenterIntegration -> String
$cshow :: OpsCenterIntegration -> String
showsPrec :: Int -> OpsCenterIntegration -> ShowS
$cshowsPrec :: Int -> OpsCenterIntegration -> ShowS
Prelude.Show, (forall x. OpsCenterIntegration -> Rep OpsCenterIntegration x)
-> (forall x. Rep OpsCenterIntegration x -> OpsCenterIntegration)
-> Generic OpsCenterIntegration
forall x. Rep OpsCenterIntegration x -> OpsCenterIntegration
forall x. OpsCenterIntegration -> Rep OpsCenterIntegration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OpsCenterIntegration x -> OpsCenterIntegration
$cfrom :: forall x. OpsCenterIntegration -> Rep OpsCenterIntegration x
Prelude.Generic)

-- |
-- Create a value of 'OpsCenterIntegration' 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', 'opsCenterIntegration_optInStatus' - Specifies if DevOps Guru is enabled to create an AWS Systems Manager
-- OpsItem for each created insight.
newOpsCenterIntegration ::
  OpsCenterIntegration
newOpsCenterIntegration :: OpsCenterIntegration
newOpsCenterIntegration =
  OpsCenterIntegration' :: Maybe OptInStatus -> OpsCenterIntegration
OpsCenterIntegration'
    { $sel:optInStatus:OpsCenterIntegration' :: 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.
opsCenterIntegration_optInStatus :: Lens.Lens' OpsCenterIntegration (Prelude.Maybe OptInStatus)
opsCenterIntegration_optInStatus :: (Maybe OptInStatus -> f (Maybe OptInStatus))
-> OpsCenterIntegration -> f OpsCenterIntegration
opsCenterIntegration_optInStatus = (OpsCenterIntegration -> Maybe OptInStatus)
-> (OpsCenterIntegration
    -> Maybe OptInStatus -> OpsCenterIntegration)
-> Lens
     OpsCenterIntegration
     OpsCenterIntegration
     (Maybe OptInStatus)
     (Maybe OptInStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpsCenterIntegration' {Maybe OptInStatus
optInStatus :: Maybe OptInStatus
$sel:optInStatus:OpsCenterIntegration' :: OpsCenterIntegration -> Maybe OptInStatus
optInStatus} -> Maybe OptInStatus
optInStatus) (\s :: OpsCenterIntegration
s@OpsCenterIntegration' {} Maybe OptInStatus
a -> OpsCenterIntegration
s {$sel:optInStatus:OpsCenterIntegration' :: Maybe OptInStatus
optInStatus = Maybe OptInStatus
a} :: OpsCenterIntegration)

instance Core.FromJSON OpsCenterIntegration where
  parseJSON :: Value -> Parser OpsCenterIntegration
parseJSON =
    String
-> (Object -> Parser OpsCenterIntegration)
-> Value
-> Parser OpsCenterIntegration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OpsCenterIntegration"
      ( \Object
x ->
          Maybe OptInStatus -> OpsCenterIntegration
OpsCenterIntegration'
            (Maybe OptInStatus -> OpsCenterIntegration)
-> Parser (Maybe OptInStatus) -> Parser OpsCenterIntegration
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe OptInStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OptInStatus")
      )

instance Prelude.Hashable OpsCenterIntegration

instance Prelude.NFData OpsCenterIntegration