{-# 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.Textract.Types.DocumentLocation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Textract.Types.S3Object
data DocumentLocation = DocumentLocation'
{
DocumentLocation -> Maybe S3Object
s3Object :: Prelude.Maybe S3Object
}
deriving (DocumentLocation -> DocumentLocation -> Bool
(DocumentLocation -> DocumentLocation -> Bool)
-> (DocumentLocation -> DocumentLocation -> Bool)
-> Eq DocumentLocation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentLocation -> DocumentLocation -> Bool
$c/= :: DocumentLocation -> DocumentLocation -> Bool
== :: DocumentLocation -> DocumentLocation -> Bool
$c== :: DocumentLocation -> DocumentLocation -> Bool
Prelude.Eq, ReadPrec [DocumentLocation]
ReadPrec DocumentLocation
Int -> ReadS DocumentLocation
ReadS [DocumentLocation]
(Int -> ReadS DocumentLocation)
-> ReadS [DocumentLocation]
-> ReadPrec DocumentLocation
-> ReadPrec [DocumentLocation]
-> Read DocumentLocation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DocumentLocation]
$creadListPrec :: ReadPrec [DocumentLocation]
readPrec :: ReadPrec DocumentLocation
$creadPrec :: ReadPrec DocumentLocation
readList :: ReadS [DocumentLocation]
$creadList :: ReadS [DocumentLocation]
readsPrec :: Int -> ReadS DocumentLocation
$creadsPrec :: Int -> ReadS DocumentLocation
Prelude.Read, Int -> DocumentLocation -> ShowS
[DocumentLocation] -> ShowS
DocumentLocation -> String
(Int -> DocumentLocation -> ShowS)
-> (DocumentLocation -> String)
-> ([DocumentLocation] -> ShowS)
-> Show DocumentLocation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentLocation] -> ShowS
$cshowList :: [DocumentLocation] -> ShowS
show :: DocumentLocation -> String
$cshow :: DocumentLocation -> String
showsPrec :: Int -> DocumentLocation -> ShowS
$cshowsPrec :: Int -> DocumentLocation -> ShowS
Prelude.Show, (forall x. DocumentLocation -> Rep DocumentLocation x)
-> (forall x. Rep DocumentLocation x -> DocumentLocation)
-> Generic DocumentLocation
forall x. Rep DocumentLocation x -> DocumentLocation
forall x. DocumentLocation -> Rep DocumentLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DocumentLocation x -> DocumentLocation
$cfrom :: forall x. DocumentLocation -> Rep DocumentLocation x
Prelude.Generic)
newDocumentLocation ::
DocumentLocation
newDocumentLocation :: DocumentLocation
newDocumentLocation =
DocumentLocation' :: Maybe S3Object -> DocumentLocation
DocumentLocation' {$sel:s3Object:DocumentLocation' :: Maybe S3Object
s3Object = Maybe S3Object
forall a. Maybe a
Prelude.Nothing}
documentLocation_s3Object :: Lens.Lens' DocumentLocation (Prelude.Maybe S3Object)
documentLocation_s3Object :: (Maybe S3Object -> f (Maybe S3Object))
-> DocumentLocation -> f DocumentLocation
documentLocation_s3Object = (DocumentLocation -> Maybe S3Object)
-> (DocumentLocation -> Maybe S3Object -> DocumentLocation)
-> Lens
DocumentLocation DocumentLocation (Maybe S3Object) (Maybe S3Object)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentLocation' {Maybe S3Object
s3Object :: Maybe S3Object
$sel:s3Object:DocumentLocation' :: DocumentLocation -> Maybe S3Object
s3Object} -> Maybe S3Object
s3Object) (\s :: DocumentLocation
s@DocumentLocation' {} Maybe S3Object
a -> DocumentLocation
s {$sel:s3Object:DocumentLocation' :: Maybe S3Object
s3Object = Maybe S3Object
a} :: DocumentLocation)
instance Prelude.Hashable DocumentLocation
instance Prelude.NFData DocumentLocation
instance Core.ToJSON DocumentLocation where
toJSON :: DocumentLocation -> Value
toJSON DocumentLocation' {Maybe S3Object
s3Object :: Maybe S3Object
$sel:s3Object:DocumentLocation' :: DocumentLocation -> Maybe S3Object
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"S3Object" Text -> S3Object -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (S3Object -> Pair) -> Maybe S3Object -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3Object
s3Object]
)