{-# 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.Lens as Lens
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
(AttachmentDetails -> AttachmentDetails -> Bool)
-> (AttachmentDetails -> AttachmentDetails -> Bool)
-> Eq AttachmentDetails
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]
(Int -> ReadS AttachmentDetails)
-> ReadS [AttachmentDetails]
-> ReadPrec AttachmentDetails
-> ReadPrec [AttachmentDetails]
-> Read 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
(Int -> AttachmentDetails -> ShowS)
-> (AttachmentDetails -> String)
-> ([AttachmentDetails] -> ShowS)
-> Show AttachmentDetails
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. AttachmentDetails -> Rep AttachmentDetails x)
-> (forall x. Rep AttachmentDetails x -> AttachmentDetails)
-> Generic AttachmentDetails
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' :: Maybe Text -> Maybe Text -> AttachmentDetails
AttachmentDetails'
{ $sel:attachmentId:AttachmentDetails' :: Maybe Text
attachmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fileName:AttachmentDetails' :: Maybe Text
fileName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
attachmentDetails_attachmentId :: Lens.Lens' AttachmentDetails (Prelude.Maybe Prelude.Text)
attachmentDetails_attachmentId :: (Maybe Text -> f (Maybe Text))
-> AttachmentDetails -> f AttachmentDetails
attachmentDetails_attachmentId = (AttachmentDetails -> Maybe Text)
-> (AttachmentDetails -> Maybe Text -> AttachmentDetails)
-> Lens
AttachmentDetails AttachmentDetails (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> AttachmentDetails -> f AttachmentDetails
attachmentDetails_fileName = (AttachmentDetails -> Maybe Text)
-> (AttachmentDetails -> Maybe Text -> AttachmentDetails)
-> Lens
AttachmentDetails AttachmentDetails (Maybe Text) (Maybe Text)
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 Core.FromJSON AttachmentDetails where
parseJSON :: Value -> Parser AttachmentDetails
parseJSON =
String
-> (Object -> Parser AttachmentDetails)
-> Value
-> Parser AttachmentDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AttachmentDetails"
( \Object
x ->
Maybe Text -> Maybe Text -> AttachmentDetails
AttachmentDetails'
(Maybe Text -> Maybe Text -> AttachmentDetails)
-> Parser (Maybe Text) -> Parser (Maybe Text -> AttachmentDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"attachmentId")
Parser (Maybe Text -> AttachmentDetails)
-> Parser (Maybe Text) -> Parser AttachmentDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"fileName")
)
instance Prelude.Hashable AttachmentDetails
instance Prelude.NFData AttachmentDetails