{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:ignoreCoordinates:BaseScreenshot' :: Maybe [Text]
ignoreCoordinates =
forall a. Maybe a
Prelude.Nothing,
$sel:screenshotName:BaseScreenshot' :: Text
screenshotName = Text
pScreenshotName_
}
baseScreenshot_ignoreCoordinates :: Lens.Lens' BaseScreenshot (Prelude.Maybe [Prelude.Text])
baseScreenshot_ignoreCoordinates :: Lens' BaseScreenshot (Maybe [Text])
baseScreenshot_ignoreCoordinates = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' BaseScreenshot Text
baseScreenshot_screenshotName = 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 Data.FromJSON BaseScreenshot where
parseJSON :: Value -> Parser BaseScreenshot
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"BaseScreenshot"
( \Object
x ->
Maybe [Text] -> Text -> BaseScreenshot
BaseScreenshot'
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
"IgnoreCoordinates"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ScreenshotName")
)
instance Prelude.Hashable BaseScreenshot where
hashWithSalt :: Int -> BaseScreenshot -> Int
hashWithSalt Int
_salt BaseScreenshot' {Maybe [Text]
Text
screenshotName :: Text
ignoreCoordinates :: Maybe [Text]
$sel:screenshotName:BaseScreenshot' :: BaseScreenshot -> Text
$sel:ignoreCoordinates:BaseScreenshot' :: BaseScreenshot -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
ignoreCoordinates
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
screenshotName
instance Prelude.NFData BaseScreenshot where
rnf :: BaseScreenshot -> ()
rnf BaseScreenshot' {Maybe [Text]
Text
screenshotName :: Text
ignoreCoordinates :: Maybe [Text]
$sel:screenshotName:BaseScreenshot' :: BaseScreenshot -> Text
$sel:ignoreCoordinates:BaseScreenshot' :: BaseScreenshot -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
ignoreCoordinates
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
screenshotName
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"IgnoreCoordinates" 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 [Text]
ignoreCoordinates,
forall a. a -> Maybe a
Prelude.Just
(Key
"ScreenshotName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
screenshotName)
]
)