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