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