{-# 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.IoTSiteWise.Types.ImageLocation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ImageLocation = ImageLocation'
{
ImageLocation -> Text
id :: Prelude.Text,
ImageLocation -> Text
url :: Prelude.Text
}
deriving (ImageLocation -> ImageLocation -> Bool
(ImageLocation -> ImageLocation -> Bool)
-> (ImageLocation -> ImageLocation -> Bool) -> Eq ImageLocation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageLocation -> ImageLocation -> Bool
$c/= :: ImageLocation -> ImageLocation -> Bool
== :: ImageLocation -> ImageLocation -> Bool
$c== :: ImageLocation -> ImageLocation -> Bool
Prelude.Eq, ReadPrec [ImageLocation]
ReadPrec ImageLocation
Int -> ReadS ImageLocation
ReadS [ImageLocation]
(Int -> ReadS ImageLocation)
-> ReadS [ImageLocation]
-> ReadPrec ImageLocation
-> ReadPrec [ImageLocation]
-> Read ImageLocation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImageLocation]
$creadListPrec :: ReadPrec [ImageLocation]
readPrec :: ReadPrec ImageLocation
$creadPrec :: ReadPrec ImageLocation
readList :: ReadS [ImageLocation]
$creadList :: ReadS [ImageLocation]
readsPrec :: Int -> ReadS ImageLocation
$creadsPrec :: Int -> ReadS ImageLocation
Prelude.Read, Int -> ImageLocation -> ShowS
[ImageLocation] -> ShowS
ImageLocation -> String
(Int -> ImageLocation -> ShowS)
-> (ImageLocation -> String)
-> ([ImageLocation] -> ShowS)
-> Show ImageLocation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImageLocation] -> ShowS
$cshowList :: [ImageLocation] -> ShowS
show :: ImageLocation -> String
$cshow :: ImageLocation -> String
showsPrec :: Int -> ImageLocation -> ShowS
$cshowsPrec :: Int -> ImageLocation -> ShowS
Prelude.Show, (forall x. ImageLocation -> Rep ImageLocation x)
-> (forall x. Rep ImageLocation x -> ImageLocation)
-> Generic ImageLocation
forall x. Rep ImageLocation x -> ImageLocation
forall x. ImageLocation -> Rep ImageLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImageLocation x -> ImageLocation
$cfrom :: forall x. ImageLocation -> Rep ImageLocation x
Prelude.Generic)
newImageLocation ::
Prelude.Text ->
Prelude.Text ->
ImageLocation
newImageLocation :: Text -> Text -> ImageLocation
newImageLocation Text
pId_ Text
pUrl_ =
ImageLocation' :: Text -> Text -> ImageLocation
ImageLocation' {$sel:id:ImageLocation' :: Text
id = Text
pId_, $sel:url:ImageLocation' :: Text
url = Text
pUrl_}
imageLocation_id :: Lens.Lens' ImageLocation Prelude.Text
imageLocation_id :: (Text -> f Text) -> ImageLocation -> f ImageLocation
imageLocation_id = (ImageLocation -> Text)
-> (ImageLocation -> Text -> ImageLocation)
-> Lens ImageLocation ImageLocation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageLocation' {Text
id :: Text
$sel:id:ImageLocation' :: ImageLocation -> Text
id} -> Text
id) (\s :: ImageLocation
s@ImageLocation' {} Text
a -> ImageLocation
s {$sel:id:ImageLocation' :: Text
id = Text
a} :: ImageLocation)
imageLocation_url :: Lens.Lens' ImageLocation Prelude.Text
imageLocation_url :: (Text -> f Text) -> ImageLocation -> f ImageLocation
imageLocation_url = (ImageLocation -> Text)
-> (ImageLocation -> Text -> ImageLocation)
-> Lens ImageLocation ImageLocation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageLocation' {Text
url :: Text
$sel:url:ImageLocation' :: ImageLocation -> Text
url} -> Text
url) (\s :: ImageLocation
s@ImageLocation' {} Text
a -> ImageLocation
s {$sel:url:ImageLocation' :: Text
url = Text
a} :: ImageLocation)
instance Core.FromJSON ImageLocation where
parseJSON :: Value -> Parser ImageLocation
parseJSON =
String
-> (Object -> Parser ImageLocation)
-> Value
-> Parser ImageLocation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ImageLocation"
( \Object
x ->
Text -> Text -> ImageLocation
ImageLocation'
(Text -> Text -> ImageLocation)
-> Parser Text -> Parser (Text -> ImageLocation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"id") Parser (Text -> ImageLocation)
-> Parser Text -> Parser ImageLocation
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
"url")
)
instance Prelude.Hashable ImageLocation
instance Prelude.NFData ImageLocation