{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data S3FileLocation = S3FileLocation'
{
S3FileLocation -> Maybe Text
versionId :: Prelude.Maybe Prelude.Text,
S3FileLocation -> Maybe Text
etag :: Prelude.Maybe Prelude.Text,
S3FileLocation -> Maybe Text
bucket :: Prelude.Maybe Prelude.Text,
S3FileLocation -> Maybe Text
key :: Prelude.Maybe Prelude.Text
}
deriving (S3FileLocation -> S3FileLocation -> Bool
(S3FileLocation -> S3FileLocation -> Bool)
-> (S3FileLocation -> S3FileLocation -> Bool) -> Eq S3FileLocation
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]
(Int -> ReadS S3FileLocation)
-> ReadS [S3FileLocation]
-> ReadPrec S3FileLocation
-> ReadPrec [S3FileLocation]
-> Read 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
(Int -> S3FileLocation -> ShowS)
-> (S3FileLocation -> String)
-> ([S3FileLocation] -> ShowS)
-> Show S3FileLocation
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. S3FileLocation -> Rep S3FileLocation x)
-> (forall x. Rep S3FileLocation x -> S3FileLocation)
-> Generic S3FileLocation
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' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> S3FileLocation
S3FileLocation'
{ $sel:versionId:S3FileLocation' :: Maybe Text
versionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:etag:S3FileLocation' :: Maybe Text
etag = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:S3FileLocation' :: Maybe Text
bucket = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:key:S3FileLocation' :: Maybe Text
key = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
s3FileLocation_versionId :: Lens.Lens' S3FileLocation (Prelude.Maybe Prelude.Text)
s3FileLocation_versionId :: (Maybe Text -> f (Maybe Text))
-> S3FileLocation -> f S3FileLocation
s3FileLocation_versionId = (S3FileLocation -> Maybe Text)
-> (S3FileLocation -> Maybe Text -> S3FileLocation)
-> Lens S3FileLocation S3FileLocation (Maybe Text) (Maybe Text)
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)
s3FileLocation_etag :: Lens.Lens' S3FileLocation (Prelude.Maybe Prelude.Text)
s3FileLocation_etag :: (Maybe Text -> f (Maybe Text))
-> S3FileLocation -> f S3FileLocation
s3FileLocation_etag = (S3FileLocation -> Maybe Text)
-> (S3FileLocation -> Maybe Text -> S3FileLocation)
-> Lens S3FileLocation S3FileLocation (Maybe Text) (Maybe Text)
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_bucket :: Lens.Lens' S3FileLocation (Prelude.Maybe Prelude.Text)
s3FileLocation_bucket :: (Maybe Text -> f (Maybe Text))
-> S3FileLocation -> f S3FileLocation
s3FileLocation_bucket = (S3FileLocation -> Maybe Text)
-> (S3FileLocation -> Maybe Text -> S3FileLocation)
-> Lens S3FileLocation S3FileLocation (Maybe Text) (Maybe Text)
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_key :: Lens.Lens' S3FileLocation (Prelude.Maybe Prelude.Text)
s3FileLocation_key :: (Maybe Text -> f (Maybe Text))
-> S3FileLocation -> f S3FileLocation
s3FileLocation_key = (S3FileLocation -> Maybe Text)
-> (S3FileLocation -> Maybe Text -> S3FileLocation)
-> Lens S3FileLocation S3FileLocation (Maybe Text) (Maybe Text)
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)
instance Core.FromJSON S3FileLocation where
parseJSON :: Value -> Parser S3FileLocation
parseJSON =
String
-> (Object -> Parser S3FileLocation)
-> Value
-> Parser S3FileLocation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"S3FileLocation"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> S3FileLocation
S3FileLocation'
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> S3FileLocation)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> S3FileLocation)
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
"VersionId")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> S3FileLocation)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> S3FileLocation)
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
"Etag")
Parser (Maybe Text -> Maybe Text -> S3FileLocation)
-> Parser (Maybe Text) -> Parser (Maybe Text -> S3FileLocation)
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
"Bucket")
Parser (Maybe Text -> S3FileLocation)
-> Parser (Maybe Text) -> Parser S3FileLocation
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
"Key")
)
instance Prelude.Hashable S3FileLocation
instance Prelude.NFData S3FileLocation