{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data MinimumHealthyHosts = MinimumHealthyHosts'
{
MinimumHealthyHosts -> Maybe MinimumHealthyHostsType
type' :: Prelude.Maybe MinimumHealthyHostsType,
MinimumHealthyHosts -> Maybe Int
value :: Prelude.Maybe Prelude.Int
}
deriving (MinimumHealthyHosts -> MinimumHealthyHosts -> Bool
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]
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
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. 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'
{ $sel:type':MinimumHealthyHosts' :: Maybe MinimumHealthyHostsType
type' = forall a. Maybe a
Prelude.Nothing,
$sel:value:MinimumHealthyHosts' :: Maybe Int
value = forall a. Maybe a
Prelude.Nothing
}
minimumHealthyHosts_type :: Lens.Lens' MinimumHealthyHosts (Prelude.Maybe MinimumHealthyHostsType)
minimumHealthyHosts_type :: Lens' MinimumHealthyHosts (Maybe MinimumHealthyHostsType)
minimumHealthyHosts_type = 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)
minimumHealthyHosts_value :: Lens.Lens' MinimumHealthyHosts (Prelude.Maybe Prelude.Int)
minimumHealthyHosts_value :: Lens' MinimumHealthyHosts (Maybe Int)
minimumHealthyHosts_value = 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)
instance Data.FromJSON MinimumHealthyHosts where
parseJSON :: Value -> Parser MinimumHealthyHosts
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"MinimumHealthyHosts"
( \Object
x ->
Maybe MinimumHealthyHostsType -> Maybe Int -> MinimumHealthyHosts
MinimumHealthyHosts'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"type")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"value")
)
instance Prelude.Hashable MinimumHealthyHosts where
hashWithSalt :: Int -> MinimumHealthyHosts -> Int
hashWithSalt Int
_salt MinimumHealthyHosts' {Maybe Int
Maybe MinimumHealthyHostsType
value :: Maybe Int
type' :: Maybe MinimumHealthyHostsType
$sel:value:MinimumHealthyHosts' :: MinimumHealthyHosts -> Maybe Int
$sel:type':MinimumHealthyHosts' :: MinimumHealthyHosts -> Maybe MinimumHealthyHostsType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MinimumHealthyHostsType
type'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
value
instance Prelude.NFData MinimumHealthyHosts where
rnf :: MinimumHealthyHosts -> ()
rnf MinimumHealthyHosts' {Maybe Int
Maybe MinimumHealthyHostsType
value :: Maybe Int
type' :: Maybe MinimumHealthyHostsType
$sel:value:MinimumHealthyHosts' :: MinimumHealthyHosts -> Maybe Int
$sel:type':MinimumHealthyHosts' :: MinimumHealthyHosts -> Maybe MinimumHealthyHostsType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe MinimumHealthyHostsType
type' seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
value
instance Data.ToJSON MinimumHealthyHosts where
toJSON :: MinimumHealthyHosts -> Value
toJSON MinimumHealthyHosts' {Maybe Int
Maybe MinimumHealthyHostsType
value :: Maybe Int
type' :: Maybe MinimumHealthyHostsType
$sel:value:MinimumHealthyHosts' :: MinimumHealthyHosts -> Maybe Int
$sel:type':MinimumHealthyHosts' :: MinimumHealthyHosts -> Maybe MinimumHealthyHostsType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MinimumHealthyHostsType
type',
(Key
"value" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
value
]
)