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