{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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' {$sel:s3Object:DocumentLocation' :: Maybe S3Object
s3Object = forall a. Maybe a
Prelude.Nothing}
documentLocation_s3Object :: Lens.Lens' DocumentLocation (Prelude.Maybe S3Object)
documentLocation_s3Object :: Lens' DocumentLocation (Maybe S3Object)
documentLocation_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 where
hashWithSalt :: Int -> DocumentLocation -> Int
hashWithSalt Int
_salt DocumentLocation' {Maybe S3Object
s3Object :: Maybe S3Object
$sel:s3Object:DocumentLocation' :: DocumentLocation -> Maybe S3Object
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3Object
s3Object
instance Prelude.NFData DocumentLocation where
rnf :: DocumentLocation -> ()
rnf DocumentLocation' {Maybe S3Object
s3Object :: Maybe S3Object
$sel:s3Object:DocumentLocation' :: DocumentLocation -> Maybe S3Object
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe S3Object
s3Object
instance Data.ToJSON DocumentLocation where
toJSON :: DocumentLocation -> Value
toJSON DocumentLocation' {Maybe S3Object
s3Object :: Maybe S3Object
$sel:s3Object:DocumentLocation' :: DocumentLocation -> Maybe S3Object
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"S3Object" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3Object
s3Object]
)