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