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