{-# 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.ImageFile where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTSiteWise.Types.ImageFileType
import qualified Amazonka.Prelude as Prelude
data ImageFile = ImageFile'
{
ImageFile -> Base64
data' :: Data.Base64,
ImageFile -> ImageFileType
type' :: ImageFileType
}
deriving (ImageFile -> ImageFile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageFile -> ImageFile -> Bool
$c/= :: ImageFile -> ImageFile -> Bool
== :: ImageFile -> ImageFile -> Bool
$c== :: ImageFile -> ImageFile -> Bool
Prelude.Eq, ReadPrec [ImageFile]
ReadPrec ImageFile
Int -> ReadS ImageFile
ReadS [ImageFile]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImageFile]
$creadListPrec :: ReadPrec [ImageFile]
readPrec :: ReadPrec ImageFile
$creadPrec :: ReadPrec ImageFile
readList :: ReadS [ImageFile]
$creadList :: ReadS [ImageFile]
readsPrec :: Int -> ReadS ImageFile
$creadsPrec :: Int -> ReadS ImageFile
Prelude.Read, Int -> ImageFile -> ShowS
[ImageFile] -> ShowS
ImageFile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImageFile] -> ShowS
$cshowList :: [ImageFile] -> ShowS
show :: ImageFile -> String
$cshow :: ImageFile -> String
showsPrec :: Int -> ImageFile -> ShowS
$cshowsPrec :: Int -> ImageFile -> ShowS
Prelude.Show, forall x. Rep ImageFile x -> ImageFile
forall x. ImageFile -> Rep ImageFile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImageFile x -> ImageFile
$cfrom :: forall x. ImageFile -> Rep ImageFile x
Prelude.Generic)
newImageFile ::
Prelude.ByteString ->
ImageFileType ->
ImageFile
newImageFile :: ByteString -> ImageFileType -> ImageFile
newImageFile ByteString
pData_ ImageFileType
pType_ =
ImageFile'
{ $sel:data':ImageFile' :: Base64
data' = Iso' Base64 ByteString
Data._Base64 forall t b. AReview t b -> b -> t
Lens.# ByteString
pData_,
$sel:type':ImageFile' :: ImageFileType
type' = ImageFileType
pType_
}
imageFile_data :: Lens.Lens' ImageFile Prelude.ByteString
imageFile_data :: Lens' ImageFile ByteString
imageFile_data = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageFile' {Base64
data' :: Base64
$sel:data':ImageFile' :: ImageFile -> Base64
data'} -> Base64
data') (\s :: ImageFile
s@ImageFile' {} Base64
a -> ImageFile
s {$sel:data':ImageFile' :: Base64
data' = Base64
a} :: ImageFile) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Iso' Base64 ByteString
Data._Base64
imageFile_type :: Lens.Lens' ImageFile ImageFileType
imageFile_type :: Lens' ImageFile ImageFileType
imageFile_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImageFile' {ImageFileType
type' :: ImageFileType
$sel:type':ImageFile' :: ImageFile -> ImageFileType
type'} -> ImageFileType
type') (\s :: ImageFile
s@ImageFile' {} ImageFileType
a -> ImageFile
s {$sel:type':ImageFile' :: ImageFileType
type' = ImageFileType
a} :: ImageFile)
instance Prelude.Hashable ImageFile where
hashWithSalt :: Int -> ImageFile -> Int
hashWithSalt Int
_salt ImageFile' {Base64
ImageFileType
type' :: ImageFileType
data' :: Base64
$sel:type':ImageFile' :: ImageFile -> ImageFileType
$sel:data':ImageFile' :: ImageFile -> Base64
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Base64
data'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ImageFileType
type'
instance Prelude.NFData ImageFile where
rnf :: ImageFile -> ()
rnf ImageFile' {Base64
ImageFileType
type' :: ImageFileType
data' :: Base64
$sel:type':ImageFile' :: ImageFile -> ImageFileType
$sel:data':ImageFile' :: ImageFile -> Base64
..} =
forall a. NFData a => a -> ()
Prelude.rnf Base64
data' seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ImageFileType
type'
instance Data.ToJSON ImageFile where
toJSON :: ImageFile -> Value
toJSON ImageFile' {Base64
ImageFileType
type' :: ImageFileType
data' :: Base64
$sel:type':ImageFile' :: ImageFile -> ImageFileType
$sel:data':ImageFile' :: ImageFile -> Base64
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"data" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Base64
data'),
forall a. a -> Maybe a
Prelude.Just (Key
"type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ImageFileType
type')
]
)