{-# 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.Transfer.Types.S3FileLocation 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 S3FileLocation = S3FileLocation'
{
S3FileLocation -> Maybe Text
bucket :: Prelude.Maybe Prelude.Text,
S3FileLocation -> Maybe Text
etag :: Prelude.Maybe Prelude.Text,
S3FileLocation -> Maybe Text
key :: Prelude.Maybe Prelude.Text,
S3FileLocation -> Maybe Text
versionId :: Prelude.Maybe Prelude.Text
}
deriving (S3FileLocation -> S3FileLocation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3FileLocation -> S3FileLocation -> Bool
$c/= :: S3FileLocation -> S3FileLocation -> Bool
== :: S3FileLocation -> S3FileLocation -> Bool
$c== :: S3FileLocation -> S3FileLocation -> Bool
Prelude.Eq, ReadPrec [S3FileLocation]
ReadPrec S3FileLocation
Int -> ReadS S3FileLocation
ReadS [S3FileLocation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3FileLocation]
$creadListPrec :: ReadPrec [S3FileLocation]
readPrec :: ReadPrec S3FileLocation
$creadPrec :: ReadPrec S3FileLocation
readList :: ReadS [S3FileLocation]
$creadList :: ReadS [S3FileLocation]
readsPrec :: Int -> ReadS S3FileLocation
$creadsPrec :: Int -> ReadS S3FileLocation
Prelude.Read, Int -> S3FileLocation -> ShowS
[S3FileLocation] -> ShowS
S3FileLocation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3FileLocation] -> ShowS
$cshowList :: [S3FileLocation] -> ShowS
show :: S3FileLocation -> String
$cshow :: S3FileLocation -> String
showsPrec :: Int -> S3FileLocation -> ShowS
$cshowsPrec :: Int -> S3FileLocation -> ShowS
Prelude.Show, forall x. Rep S3FileLocation x -> S3FileLocation
forall x. S3FileLocation -> Rep S3FileLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3FileLocation x -> S3FileLocation
$cfrom :: forall x. S3FileLocation -> Rep S3FileLocation x
Prelude.Generic)
newS3FileLocation ::
S3FileLocation
newS3FileLocation :: S3FileLocation
newS3FileLocation =
S3FileLocation'
{ $sel:bucket:S3FileLocation' :: Maybe Text
bucket = forall a. Maybe a
Prelude.Nothing,
$sel:etag:S3FileLocation' :: Maybe Text
etag = forall a. Maybe a
Prelude.Nothing,
$sel:key:S3FileLocation' :: Maybe Text
key = forall a. Maybe a
Prelude.Nothing,
$sel:versionId:S3FileLocation' :: Maybe Text
versionId = forall a. Maybe a
Prelude.Nothing
}
s3FileLocation_bucket :: Lens.Lens' S3FileLocation (Prelude.Maybe Prelude.Text)
s3FileLocation_bucket :: Lens' S3FileLocation (Maybe Text)
s3FileLocation_bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3FileLocation' {Maybe Text
bucket :: Maybe Text
$sel:bucket:S3FileLocation' :: S3FileLocation -> Maybe Text
bucket} -> Maybe Text
bucket) (\s :: S3FileLocation
s@S3FileLocation' {} Maybe Text
a -> S3FileLocation
s {$sel:bucket:S3FileLocation' :: Maybe Text
bucket = Maybe Text
a} :: S3FileLocation)
s3FileLocation_etag :: Lens.Lens' S3FileLocation (Prelude.Maybe Prelude.Text)
s3FileLocation_etag :: Lens' S3FileLocation (Maybe Text)
s3FileLocation_etag = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3FileLocation' {Maybe Text
etag :: Maybe Text
$sel:etag:S3FileLocation' :: S3FileLocation -> Maybe Text
etag} -> Maybe Text
etag) (\s :: S3FileLocation
s@S3FileLocation' {} Maybe Text
a -> S3FileLocation
s {$sel:etag:S3FileLocation' :: Maybe Text
etag = Maybe Text
a} :: S3FileLocation)
s3FileLocation_key :: Lens.Lens' S3FileLocation (Prelude.Maybe Prelude.Text)
s3FileLocation_key :: Lens' S3FileLocation (Maybe Text)
s3FileLocation_key = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3FileLocation' {Maybe Text
key :: Maybe Text
$sel:key:S3FileLocation' :: S3FileLocation -> Maybe Text
key} -> Maybe Text
key) (\s :: S3FileLocation
s@S3FileLocation' {} Maybe Text
a -> S3FileLocation
s {$sel:key:S3FileLocation' :: Maybe Text
key = Maybe Text
a} :: S3FileLocation)
s3FileLocation_versionId :: Lens.Lens' S3FileLocation (Prelude.Maybe Prelude.Text)
s3FileLocation_versionId :: Lens' S3FileLocation (Maybe Text)
s3FileLocation_versionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3FileLocation' {Maybe Text
versionId :: Maybe Text
$sel:versionId:S3FileLocation' :: S3FileLocation -> Maybe Text
versionId} -> Maybe Text
versionId) (\s :: S3FileLocation
s@S3FileLocation' {} Maybe Text
a -> S3FileLocation
s {$sel:versionId:S3FileLocation' :: Maybe Text
versionId = Maybe Text
a} :: S3FileLocation)
instance Data.FromJSON S3FileLocation where
parseJSON :: Value -> Parser S3FileLocation
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"S3FileLocation"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> S3FileLocation
S3FileLocation'
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
"Bucket")
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
"Etag")
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
"Key")
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
"VersionId")
)
instance Prelude.Hashable S3FileLocation where
hashWithSalt :: Int -> S3FileLocation -> Int
hashWithSalt Int
_salt S3FileLocation' {Maybe Text
versionId :: Maybe Text
key :: Maybe Text
etag :: Maybe Text
bucket :: Maybe Text
$sel:versionId:S3FileLocation' :: S3FileLocation -> Maybe Text
$sel:key:S3FileLocation' :: S3FileLocation -> Maybe Text
$sel:etag:S3FileLocation' :: S3FileLocation -> Maybe Text
$sel:bucket:S3FileLocation' :: S3FileLocation -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bucket
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
etag
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
key
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
versionId
instance Prelude.NFData S3FileLocation where
rnf :: S3FileLocation -> ()
rnf S3FileLocation' {Maybe Text
versionId :: Maybe Text
key :: Maybe Text
etag :: Maybe Text
bucket :: Maybe Text
$sel:versionId:S3FileLocation' :: S3FileLocation -> Maybe Text
$sel:key:S3FileLocation' :: S3FileLocation -> Maybe Text
$sel:etag:S3FileLocation' :: S3FileLocation -> Maybe Text
$sel:bucket:S3FileLocation' :: S3FileLocation -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bucket
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
etag
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
key
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
versionId