{-# 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.Support.Types.AttachmentDetails 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 AttachmentDetails = AttachmentDetails'
{
AttachmentDetails -> Maybe Text
attachmentId :: Prelude.Maybe Prelude.Text,
AttachmentDetails -> Maybe Text
fileName :: Prelude.Maybe Prelude.Text
}
deriving (AttachmentDetails -> AttachmentDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachmentDetails -> AttachmentDetails -> Bool
$c/= :: AttachmentDetails -> AttachmentDetails -> Bool
== :: AttachmentDetails -> AttachmentDetails -> Bool
$c== :: AttachmentDetails -> AttachmentDetails -> Bool
Prelude.Eq, ReadPrec [AttachmentDetails]
ReadPrec AttachmentDetails
Int -> ReadS AttachmentDetails
ReadS [AttachmentDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttachmentDetails]
$creadListPrec :: ReadPrec [AttachmentDetails]
readPrec :: ReadPrec AttachmentDetails
$creadPrec :: ReadPrec AttachmentDetails
readList :: ReadS [AttachmentDetails]
$creadList :: ReadS [AttachmentDetails]
readsPrec :: Int -> ReadS AttachmentDetails
$creadsPrec :: Int -> ReadS AttachmentDetails
Prelude.Read, Int -> AttachmentDetails -> ShowS
[AttachmentDetails] -> ShowS
AttachmentDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttachmentDetails] -> ShowS
$cshowList :: [AttachmentDetails] -> ShowS
show :: AttachmentDetails -> String
$cshow :: AttachmentDetails -> String
showsPrec :: Int -> AttachmentDetails -> ShowS
$cshowsPrec :: Int -> AttachmentDetails -> ShowS
Prelude.Show, forall x. Rep AttachmentDetails x -> AttachmentDetails
forall x. AttachmentDetails -> Rep AttachmentDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AttachmentDetails x -> AttachmentDetails
$cfrom :: forall x. AttachmentDetails -> Rep AttachmentDetails x
Prelude.Generic)
newAttachmentDetails ::
AttachmentDetails
newAttachmentDetails :: AttachmentDetails
newAttachmentDetails =
AttachmentDetails'
{ $sel:attachmentId:AttachmentDetails' :: Maybe Text
attachmentId = forall a. Maybe a
Prelude.Nothing,
$sel:fileName:AttachmentDetails' :: Maybe Text
fileName = forall a. Maybe a
Prelude.Nothing
}
attachmentDetails_attachmentId :: Lens.Lens' AttachmentDetails (Prelude.Maybe Prelude.Text)
attachmentDetails_attachmentId :: Lens' AttachmentDetails (Maybe Text)
attachmentDetails_attachmentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachmentDetails' {Maybe Text
attachmentId :: Maybe Text
$sel:attachmentId:AttachmentDetails' :: AttachmentDetails -> Maybe Text
attachmentId} -> Maybe Text
attachmentId) (\s :: AttachmentDetails
s@AttachmentDetails' {} Maybe Text
a -> AttachmentDetails
s {$sel:attachmentId:AttachmentDetails' :: Maybe Text
attachmentId = Maybe Text
a} :: AttachmentDetails)
attachmentDetails_fileName :: Lens.Lens' AttachmentDetails (Prelude.Maybe Prelude.Text)
attachmentDetails_fileName :: Lens' AttachmentDetails (Maybe Text)
attachmentDetails_fileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachmentDetails' {Maybe Text
fileName :: Maybe Text
$sel:fileName:AttachmentDetails' :: AttachmentDetails -> Maybe Text
fileName} -> Maybe Text
fileName) (\s :: AttachmentDetails
s@AttachmentDetails' {} Maybe Text
a -> AttachmentDetails
s {$sel:fileName:AttachmentDetails' :: Maybe Text
fileName = Maybe Text
a} :: AttachmentDetails)
instance Data.FromJSON AttachmentDetails where
parseJSON :: Value -> Parser AttachmentDetails
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AttachmentDetails"
( \Object
x ->
Maybe Text -> Maybe Text -> AttachmentDetails
AttachmentDetails'
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
"attachmentId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"fileName")
)
instance Prelude.Hashable AttachmentDetails where
hashWithSalt :: Int -> AttachmentDetails -> Int
hashWithSalt Int
_salt AttachmentDetails' {Maybe Text
fileName :: Maybe Text
attachmentId :: Maybe Text
$sel:fileName:AttachmentDetails' :: AttachmentDetails -> Maybe Text
$sel:attachmentId:AttachmentDetails' :: AttachmentDetails -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
attachmentId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fileName
instance Prelude.NFData AttachmentDetails where
rnf :: AttachmentDetails -> ()
rnf AttachmentDetails' {Maybe Text
fileName :: Maybe Text
attachmentId :: Maybe Text
$sel:fileName:AttachmentDetails' :: AttachmentDetails -> Maybe Text
$sel:attachmentId:AttachmentDetails' :: AttachmentDetails -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
attachmentId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fileName