{-# 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 #-}
module Amazonka.Route53AutoNaming.Types.HealthCheckCustomConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HealthCheckCustomConfig = HealthCheckCustomConfig'
{
HealthCheckCustomConfig -> Maybe Natural
failureThreshold :: Prelude.Maybe Prelude.Natural
}
deriving (HealthCheckCustomConfig -> HealthCheckCustomConfig -> Bool
(HealthCheckCustomConfig -> HealthCheckCustomConfig -> Bool)
-> (HealthCheckCustomConfig -> HealthCheckCustomConfig -> Bool)
-> Eq HealthCheckCustomConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HealthCheckCustomConfig -> HealthCheckCustomConfig -> Bool
$c/= :: HealthCheckCustomConfig -> HealthCheckCustomConfig -> Bool
== :: HealthCheckCustomConfig -> HealthCheckCustomConfig -> Bool
$c== :: HealthCheckCustomConfig -> HealthCheckCustomConfig -> Bool
Prelude.Eq, ReadPrec [HealthCheckCustomConfig]
ReadPrec HealthCheckCustomConfig
Int -> ReadS HealthCheckCustomConfig
ReadS [HealthCheckCustomConfig]
(Int -> ReadS HealthCheckCustomConfig)
-> ReadS [HealthCheckCustomConfig]
-> ReadPrec HealthCheckCustomConfig
-> ReadPrec [HealthCheckCustomConfig]
-> Read HealthCheckCustomConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HealthCheckCustomConfig]
$creadListPrec :: ReadPrec [HealthCheckCustomConfig]
readPrec :: ReadPrec HealthCheckCustomConfig
$creadPrec :: ReadPrec HealthCheckCustomConfig
readList :: ReadS [HealthCheckCustomConfig]
$creadList :: ReadS [HealthCheckCustomConfig]
readsPrec :: Int -> ReadS HealthCheckCustomConfig
$creadsPrec :: Int -> ReadS HealthCheckCustomConfig
Prelude.Read, Int -> HealthCheckCustomConfig -> ShowS
[HealthCheckCustomConfig] -> ShowS
HealthCheckCustomConfig -> String
(Int -> HealthCheckCustomConfig -> ShowS)
-> (HealthCheckCustomConfig -> String)
-> ([HealthCheckCustomConfig] -> ShowS)
-> Show HealthCheckCustomConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HealthCheckCustomConfig] -> ShowS
$cshowList :: [HealthCheckCustomConfig] -> ShowS
show :: HealthCheckCustomConfig -> String
$cshow :: HealthCheckCustomConfig -> String
showsPrec :: Int -> HealthCheckCustomConfig -> ShowS
$cshowsPrec :: Int -> HealthCheckCustomConfig -> ShowS
Prelude.Show, (forall x.
HealthCheckCustomConfig -> Rep HealthCheckCustomConfig x)
-> (forall x.
Rep HealthCheckCustomConfig x -> HealthCheckCustomConfig)
-> Generic HealthCheckCustomConfig
forall x. Rep HealthCheckCustomConfig x -> HealthCheckCustomConfig
forall x. HealthCheckCustomConfig -> Rep HealthCheckCustomConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HealthCheckCustomConfig x -> HealthCheckCustomConfig
$cfrom :: forall x. HealthCheckCustomConfig -> Rep HealthCheckCustomConfig x
Prelude.Generic)
newHealthCheckCustomConfig ::
HealthCheckCustomConfig
newHealthCheckCustomConfig :: HealthCheckCustomConfig
newHealthCheckCustomConfig =
HealthCheckCustomConfig' :: Maybe Natural -> HealthCheckCustomConfig
HealthCheckCustomConfig'
{ $sel:failureThreshold:HealthCheckCustomConfig' :: Maybe Natural
failureThreshold =
Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
healthCheckCustomConfig_failureThreshold :: Lens.Lens' HealthCheckCustomConfig (Prelude.Maybe Prelude.Natural)
healthCheckCustomConfig_failureThreshold :: (Maybe Natural -> f (Maybe Natural))
-> HealthCheckCustomConfig -> f HealthCheckCustomConfig
healthCheckCustomConfig_failureThreshold = (HealthCheckCustomConfig -> Maybe Natural)
-> (HealthCheckCustomConfig
-> Maybe Natural -> HealthCheckCustomConfig)
-> Lens
HealthCheckCustomConfig
HealthCheckCustomConfig
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckCustomConfig' {Maybe Natural
failureThreshold :: Maybe Natural
$sel:failureThreshold:HealthCheckCustomConfig' :: HealthCheckCustomConfig -> Maybe Natural
failureThreshold} -> Maybe Natural
failureThreshold) (\s :: HealthCheckCustomConfig
s@HealthCheckCustomConfig' {} Maybe Natural
a -> HealthCheckCustomConfig
s {$sel:failureThreshold:HealthCheckCustomConfig' :: Maybe Natural
failureThreshold = Maybe Natural
a} :: HealthCheckCustomConfig)
instance Core.FromJSON HealthCheckCustomConfig where
parseJSON :: Value -> Parser HealthCheckCustomConfig
parseJSON =
String
-> (Object -> Parser HealthCheckCustomConfig)
-> Value
-> Parser HealthCheckCustomConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HealthCheckCustomConfig"
( \Object
x ->
Maybe Natural -> HealthCheckCustomConfig
HealthCheckCustomConfig'
(Maybe Natural -> HealthCheckCustomConfig)
-> Parser (Maybe Natural) -> Parser HealthCheckCustomConfig
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FailureThreshold")
)
instance Prelude.Hashable HealthCheckCustomConfig
instance Prelude.NFData HealthCheckCustomConfig
instance Core.ToJSON HealthCheckCustomConfig where
toJSON :: HealthCheckCustomConfig -> Value
toJSON HealthCheckCustomConfig' {Maybe Natural
failureThreshold :: Maybe Natural
$sel:failureThreshold:HealthCheckCustomConfig' :: HealthCheckCustomConfig -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"FailureThreshold" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
failureThreshold
]
)