{-# 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.FIS.Types.ExperimentTarget where
import qualified Amazonka.Core as Core
import Amazonka.FIS.Types.ExperimentTargetFilter
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ExperimentTarget = ExperimentTarget'
{
ExperimentTarget -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text,
ExperimentTarget -> Maybe (HashMap Text Text)
resourceTags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
ExperimentTarget -> Maybe [ExperimentTargetFilter]
filters :: Prelude.Maybe [ExperimentTargetFilter],
ExperimentTarget -> Maybe [Text]
resourceArns :: Prelude.Maybe [Prelude.Text],
ExperimentTarget -> Maybe Text
selectionMode :: Prelude.Maybe Prelude.Text
}
deriving (ExperimentTarget -> ExperimentTarget -> Bool
(ExperimentTarget -> ExperimentTarget -> Bool)
-> (ExperimentTarget -> ExperimentTarget -> Bool)
-> Eq ExperimentTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExperimentTarget -> ExperimentTarget -> Bool
$c/= :: ExperimentTarget -> ExperimentTarget -> Bool
== :: ExperimentTarget -> ExperimentTarget -> Bool
$c== :: ExperimentTarget -> ExperimentTarget -> Bool
Prelude.Eq, ReadPrec [ExperimentTarget]
ReadPrec ExperimentTarget
Int -> ReadS ExperimentTarget
ReadS [ExperimentTarget]
(Int -> ReadS ExperimentTarget)
-> ReadS [ExperimentTarget]
-> ReadPrec ExperimentTarget
-> ReadPrec [ExperimentTarget]
-> Read ExperimentTarget
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExperimentTarget]
$creadListPrec :: ReadPrec [ExperimentTarget]
readPrec :: ReadPrec ExperimentTarget
$creadPrec :: ReadPrec ExperimentTarget
readList :: ReadS [ExperimentTarget]
$creadList :: ReadS [ExperimentTarget]
readsPrec :: Int -> ReadS ExperimentTarget
$creadsPrec :: Int -> ReadS ExperimentTarget
Prelude.Read, Int -> ExperimentTarget -> ShowS
[ExperimentTarget] -> ShowS
ExperimentTarget -> String
(Int -> ExperimentTarget -> ShowS)
-> (ExperimentTarget -> String)
-> ([ExperimentTarget] -> ShowS)
-> Show ExperimentTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExperimentTarget] -> ShowS
$cshowList :: [ExperimentTarget] -> ShowS
show :: ExperimentTarget -> String
$cshow :: ExperimentTarget -> String
showsPrec :: Int -> ExperimentTarget -> ShowS
$cshowsPrec :: Int -> ExperimentTarget -> ShowS
Prelude.Show, (forall x. ExperimentTarget -> Rep ExperimentTarget x)
-> (forall x. Rep ExperimentTarget x -> ExperimentTarget)
-> Generic ExperimentTarget
forall x. Rep ExperimentTarget x -> ExperimentTarget
forall x. ExperimentTarget -> Rep ExperimentTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExperimentTarget x -> ExperimentTarget
$cfrom :: forall x. ExperimentTarget -> Rep ExperimentTarget x
Prelude.Generic)
newExperimentTarget ::
ExperimentTarget
newExperimentTarget :: ExperimentTarget
newExperimentTarget =
ExperimentTarget' :: Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe [ExperimentTargetFilter]
-> Maybe [Text]
-> Maybe Text
-> ExperimentTarget
ExperimentTarget'
{ $sel:resourceType:ExperimentTarget' :: Maybe Text
resourceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resourceTags:ExperimentTarget' :: Maybe (HashMap Text Text)
resourceTags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:filters:ExperimentTarget' :: Maybe [ExperimentTargetFilter]
filters = Maybe [ExperimentTargetFilter]
forall a. Maybe a
Prelude.Nothing,
$sel:resourceArns:ExperimentTarget' :: Maybe [Text]
resourceArns = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:selectionMode:ExperimentTarget' :: Maybe Text
selectionMode = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
experimentTarget_resourceType :: Lens.Lens' ExperimentTarget (Prelude.Maybe Prelude.Text)
experimentTarget_resourceType :: (Maybe Text -> f (Maybe Text))
-> ExperimentTarget -> f ExperimentTarget
experimentTarget_resourceType = (ExperimentTarget -> Maybe Text)
-> (ExperimentTarget -> Maybe Text -> ExperimentTarget)
-> Lens ExperimentTarget ExperimentTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTarget' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:ExperimentTarget' :: ExperimentTarget -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: ExperimentTarget
s@ExperimentTarget' {} Maybe Text
a -> ExperimentTarget
s {$sel:resourceType:ExperimentTarget' :: Maybe Text
resourceType = Maybe Text
a} :: ExperimentTarget)
experimentTarget_resourceTags :: Lens.Lens' ExperimentTarget (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
experimentTarget_resourceTags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ExperimentTarget -> f ExperimentTarget
experimentTarget_resourceTags = (ExperimentTarget -> Maybe (HashMap Text Text))
-> (ExperimentTarget
-> Maybe (HashMap Text Text) -> ExperimentTarget)
-> Lens
ExperimentTarget
ExperimentTarget
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTarget' {Maybe (HashMap Text Text)
resourceTags :: Maybe (HashMap Text Text)
$sel:resourceTags:ExperimentTarget' :: ExperimentTarget -> Maybe (HashMap Text Text)
resourceTags} -> Maybe (HashMap Text Text)
resourceTags) (\s :: ExperimentTarget
s@ExperimentTarget' {} Maybe (HashMap Text Text)
a -> ExperimentTarget
s {$sel:resourceTags:ExperimentTarget' :: Maybe (HashMap Text Text)
resourceTags = Maybe (HashMap Text Text)
a} :: ExperimentTarget) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ExperimentTarget -> f ExperimentTarget)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ExperimentTarget
-> f ExperimentTarget
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
experimentTarget_filters :: Lens.Lens' ExperimentTarget (Prelude.Maybe [ExperimentTargetFilter])
experimentTarget_filters :: (Maybe [ExperimentTargetFilter]
-> f (Maybe [ExperimentTargetFilter]))
-> ExperimentTarget -> f ExperimentTarget
experimentTarget_filters = (ExperimentTarget -> Maybe [ExperimentTargetFilter])
-> (ExperimentTarget
-> Maybe [ExperimentTargetFilter] -> ExperimentTarget)
-> Lens
ExperimentTarget
ExperimentTarget
(Maybe [ExperimentTargetFilter])
(Maybe [ExperimentTargetFilter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTarget' {Maybe [ExperimentTargetFilter]
filters :: Maybe [ExperimentTargetFilter]
$sel:filters:ExperimentTarget' :: ExperimentTarget -> Maybe [ExperimentTargetFilter]
filters} -> Maybe [ExperimentTargetFilter]
filters) (\s :: ExperimentTarget
s@ExperimentTarget' {} Maybe [ExperimentTargetFilter]
a -> ExperimentTarget
s {$sel:filters:ExperimentTarget' :: Maybe [ExperimentTargetFilter]
filters = Maybe [ExperimentTargetFilter]
a} :: ExperimentTarget) ((Maybe [ExperimentTargetFilter]
-> f (Maybe [ExperimentTargetFilter]))
-> ExperimentTarget -> f ExperimentTarget)
-> ((Maybe [ExperimentTargetFilter]
-> f (Maybe [ExperimentTargetFilter]))
-> Maybe [ExperimentTargetFilter]
-> f (Maybe [ExperimentTargetFilter]))
-> (Maybe [ExperimentTargetFilter]
-> f (Maybe [ExperimentTargetFilter]))
-> ExperimentTarget
-> f ExperimentTarget
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ExperimentTargetFilter]
[ExperimentTargetFilter]
[ExperimentTargetFilter]
[ExperimentTargetFilter]
-> Iso
(Maybe [ExperimentTargetFilter])
(Maybe [ExperimentTargetFilter])
(Maybe [ExperimentTargetFilter])
(Maybe [ExperimentTargetFilter])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[ExperimentTargetFilter]
[ExperimentTargetFilter]
[ExperimentTargetFilter]
[ExperimentTargetFilter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
experimentTarget_resourceArns :: Lens.Lens' ExperimentTarget (Prelude.Maybe [Prelude.Text])
experimentTarget_resourceArns :: (Maybe [Text] -> f (Maybe [Text]))
-> ExperimentTarget -> f ExperimentTarget
experimentTarget_resourceArns = (ExperimentTarget -> Maybe [Text])
-> (ExperimentTarget -> Maybe [Text] -> ExperimentTarget)
-> Lens
ExperimentTarget ExperimentTarget (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTarget' {Maybe [Text]
resourceArns :: Maybe [Text]
$sel:resourceArns:ExperimentTarget' :: ExperimentTarget -> Maybe [Text]
resourceArns} -> Maybe [Text]
resourceArns) (\s :: ExperimentTarget
s@ExperimentTarget' {} Maybe [Text]
a -> ExperimentTarget
s {$sel:resourceArns:ExperimentTarget' :: Maybe [Text]
resourceArns = Maybe [Text]
a} :: ExperimentTarget) ((Maybe [Text] -> f (Maybe [Text]))
-> ExperimentTarget -> f ExperimentTarget)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ExperimentTarget
-> f ExperimentTarget
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
experimentTarget_selectionMode :: Lens.Lens' ExperimentTarget (Prelude.Maybe Prelude.Text)
experimentTarget_selectionMode :: (Maybe Text -> f (Maybe Text))
-> ExperimentTarget -> f ExperimentTarget
experimentTarget_selectionMode = (ExperimentTarget -> Maybe Text)
-> (ExperimentTarget -> Maybe Text -> ExperimentTarget)
-> Lens ExperimentTarget ExperimentTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExperimentTarget' {Maybe Text
selectionMode :: Maybe Text
$sel:selectionMode:ExperimentTarget' :: ExperimentTarget -> Maybe Text
selectionMode} -> Maybe Text
selectionMode) (\s :: ExperimentTarget
s@ExperimentTarget' {} Maybe Text
a -> ExperimentTarget
s {$sel:selectionMode:ExperimentTarget' :: Maybe Text
selectionMode = Maybe Text
a} :: ExperimentTarget)
instance Core.FromJSON ExperimentTarget where
parseJSON :: Value -> Parser ExperimentTarget
parseJSON =
String
-> (Object -> Parser ExperimentTarget)
-> Value
-> Parser ExperimentTarget
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ExperimentTarget"
( \Object
x ->
Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe [ExperimentTargetFilter]
-> Maybe [Text]
-> Maybe Text
-> ExperimentTarget
ExperimentTarget'
(Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe [ExperimentTargetFilter]
-> Maybe [Text]
-> Maybe Text
-> ExperimentTarget)
-> Parser (Maybe Text)
-> Parser
(Maybe (HashMap Text Text)
-> Maybe [ExperimentTargetFilter]
-> Maybe [Text]
-> Maybe Text
-> ExperimentTarget)
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
"resourceType")
Parser
(Maybe (HashMap Text Text)
-> Maybe [ExperimentTargetFilter]
-> Maybe [Text]
-> Maybe Text
-> ExperimentTarget)
-> Parser (Maybe (HashMap Text Text))
-> Parser
(Maybe [ExperimentTargetFilter]
-> Maybe [Text] -> Maybe Text -> ExperimentTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceTags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe [ExperimentTargetFilter]
-> Maybe [Text] -> Maybe Text -> ExperimentTarget)
-> Parser (Maybe [ExperimentTargetFilter])
-> Parser (Maybe [Text] -> Maybe Text -> ExperimentTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [ExperimentTargetFilter]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"filters" Parser (Maybe (Maybe [ExperimentTargetFilter]))
-> Maybe [ExperimentTargetFilter]
-> Parser (Maybe [ExperimentTargetFilter])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ExperimentTargetFilter]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe [Text] -> Maybe Text -> ExperimentTarget)
-> Parser (Maybe [Text]) -> Parser (Maybe Text -> ExperimentTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceArns" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> ExperimentTarget)
-> Parser (Maybe Text) -> Parser ExperimentTarget
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
"selectionMode")
)
instance Prelude.Hashable ExperimentTarget
instance Prelude.NFData ExperimentTarget