{-# 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.SecurityHub.Types.AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-- 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.SecurityHub.Types.AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about the type of monitoring for instances in the group.
--
-- /See:/ 'newAwsAutoScalingLaunchConfigurationInstanceMonitoringDetails' smart constructor.
data AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails = AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails'
  { -- | If set to @true@, then instances in the group launch with detailed
    -- monitoring.
    --
    -- If set to @false@, then instances in the group launch with basic
    -- monitoring.
    AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> Bool
(AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
 -> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
 -> Bool)
-> (AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
    -> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
    -> Bool)
-> Eq AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> Bool
$c/= :: AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> Bool
== :: AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> Bool
$c== :: AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> Bool
Prelude.Eq, ReadPrec
  [AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails]
ReadPrec AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
Int
-> ReadS AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
ReadS [AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails]
(Int
 -> ReadS
      AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails)
-> ReadS
     [AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails]
-> ReadPrec
     AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> ReadPrec
     [AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails]
-> Read AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec
  [AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails]
$creadListPrec :: ReadPrec
  [AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails]
readPrec :: ReadPrec AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
$creadPrec :: ReadPrec AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
readList :: ReadS [AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails]
$creadList :: ReadS [AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails]
readsPrec :: Int
-> ReadS AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
$creadsPrec :: Int
-> ReadS AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
Prelude.Read, Int
-> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> ShowS
[AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails]
-> ShowS
AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> String
(Int
 -> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
 -> ShowS)
-> (AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
    -> String)
-> ([AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails]
    -> ShowS)
-> Show AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails]
-> ShowS
$cshowList :: [AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails]
-> ShowS
show :: AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> String
$cshow :: AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> String
showsPrec :: Int
-> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> ShowS
$cshowsPrec :: Int
-> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> ShowS
Prelude.Show, (forall x.
 AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
 -> Rep
      AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails x)
-> (forall x.
    Rep AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails x
    -> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails)
-> Generic
     AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
forall x.
Rep AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails x
-> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
forall x.
AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> Rep AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails x
-> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
$cfrom :: forall x.
AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> Rep AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails' 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:
--
-- 'enabled', 'awsAutoScalingLaunchConfigurationInstanceMonitoringDetails_enabled' - If set to @true@, then instances in the group launch with detailed
-- monitoring.
--
-- If set to @false@, then instances in the group launch with basic
-- monitoring.
newAwsAutoScalingLaunchConfigurationInstanceMonitoringDetails ::
  AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
newAwsAutoScalingLaunchConfigurationInstanceMonitoringDetails :: AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
newAwsAutoScalingLaunchConfigurationInstanceMonitoringDetails =
  AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails' :: Maybe Bool
-> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails'
    { $sel:enabled:AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails' :: Maybe Bool
enabled =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | If set to @true@, then instances in the group launch with detailed
-- monitoring.
--
-- If set to @false@, then instances in the group launch with basic
-- monitoring.
awsAutoScalingLaunchConfigurationInstanceMonitoringDetails_enabled :: Lens.Lens' AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails (Prelude.Maybe Prelude.Bool)
awsAutoScalingLaunchConfigurationInstanceMonitoringDetails_enabled :: (Maybe Bool -> f (Maybe Bool))
-> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> f AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
awsAutoScalingLaunchConfigurationInstanceMonitoringDetails_enabled = (AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
 -> Maybe Bool)
-> (AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
    -> Maybe Bool
    -> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails)
-> Lens
     AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
     AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails' :: AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
-> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
s@AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails' {} Maybe Bool
a -> AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails
s {$sel:enabled:AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails' :: Maybe Bool
enabled = Maybe Bool
a} :: AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails)

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

instance
  Prelude.Hashable
    AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails

instance
  Prelude.NFData
    AwsAutoScalingLaunchConfigurationInstanceMonitoringDetails

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