{-# 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.CodeCommit.Types.PutFileEntry where
import Amazonka.CodeCommit.Types.FileModeTypeEnum
import Amazonka.CodeCommit.Types.SourceFileSpecifier
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PutFileEntry = PutFileEntry'
{
PutFileEntry -> Maybe Base64
fileContent :: Prelude.Maybe Core.Base64,
PutFileEntry -> Maybe FileModeTypeEnum
fileMode :: Prelude.Maybe FileModeTypeEnum,
PutFileEntry -> Maybe SourceFileSpecifier
sourceFile :: Prelude.Maybe SourceFileSpecifier,
PutFileEntry -> Text
filePath :: Prelude.Text
}
deriving (PutFileEntry -> PutFileEntry -> Bool
(PutFileEntry -> PutFileEntry -> Bool)
-> (PutFileEntry -> PutFileEntry -> Bool) -> Eq PutFileEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutFileEntry -> PutFileEntry -> Bool
$c/= :: PutFileEntry -> PutFileEntry -> Bool
== :: PutFileEntry -> PutFileEntry -> Bool
$c== :: PutFileEntry -> PutFileEntry -> Bool
Prelude.Eq, ReadPrec [PutFileEntry]
ReadPrec PutFileEntry
Int -> ReadS PutFileEntry
ReadS [PutFileEntry]
(Int -> ReadS PutFileEntry)
-> ReadS [PutFileEntry]
-> ReadPrec PutFileEntry
-> ReadPrec [PutFileEntry]
-> Read PutFileEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutFileEntry]
$creadListPrec :: ReadPrec [PutFileEntry]
readPrec :: ReadPrec PutFileEntry
$creadPrec :: ReadPrec PutFileEntry
readList :: ReadS [PutFileEntry]
$creadList :: ReadS [PutFileEntry]
readsPrec :: Int -> ReadS PutFileEntry
$creadsPrec :: Int -> ReadS PutFileEntry
Prelude.Read, Int -> PutFileEntry -> ShowS
[PutFileEntry] -> ShowS
PutFileEntry -> String
(Int -> PutFileEntry -> ShowS)
-> (PutFileEntry -> String)
-> ([PutFileEntry] -> ShowS)
-> Show PutFileEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutFileEntry] -> ShowS
$cshowList :: [PutFileEntry] -> ShowS
show :: PutFileEntry -> String
$cshow :: PutFileEntry -> String
showsPrec :: Int -> PutFileEntry -> ShowS
$cshowsPrec :: Int -> PutFileEntry -> ShowS
Prelude.Show, (forall x. PutFileEntry -> Rep PutFileEntry x)
-> (forall x. Rep PutFileEntry x -> PutFileEntry)
-> Generic PutFileEntry
forall x. Rep PutFileEntry x -> PutFileEntry
forall x. PutFileEntry -> Rep PutFileEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutFileEntry x -> PutFileEntry
$cfrom :: forall x. PutFileEntry -> Rep PutFileEntry x
Prelude.Generic)
newPutFileEntry ::
Prelude.Text ->
PutFileEntry
newPutFileEntry :: Text -> PutFileEntry
newPutFileEntry Text
pFilePath_ =
PutFileEntry' :: Maybe Base64
-> Maybe FileModeTypeEnum
-> Maybe SourceFileSpecifier
-> Text
-> PutFileEntry
PutFileEntry'
{ $sel:fileContent:PutFileEntry' :: Maybe Base64
fileContent = Maybe Base64
forall a. Maybe a
Prelude.Nothing,
$sel:fileMode:PutFileEntry' :: Maybe FileModeTypeEnum
fileMode = Maybe FileModeTypeEnum
forall a. Maybe a
Prelude.Nothing,
$sel:sourceFile:PutFileEntry' :: Maybe SourceFileSpecifier
sourceFile = Maybe SourceFileSpecifier
forall a. Maybe a
Prelude.Nothing,
$sel:filePath:PutFileEntry' :: Text
filePath = Text
pFilePath_
}
putFileEntry_fileContent :: Lens.Lens' PutFileEntry (Prelude.Maybe Prelude.ByteString)
putFileEntry_fileContent :: (Maybe ByteString -> f (Maybe ByteString))
-> PutFileEntry -> f PutFileEntry
putFileEntry_fileContent = (PutFileEntry -> Maybe Base64)
-> (PutFileEntry -> Maybe Base64 -> PutFileEntry)
-> Lens PutFileEntry PutFileEntry (Maybe Base64) (Maybe Base64)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFileEntry' {Maybe Base64
fileContent :: Maybe Base64
$sel:fileContent:PutFileEntry' :: PutFileEntry -> Maybe Base64
fileContent} -> Maybe Base64
fileContent) (\s :: PutFileEntry
s@PutFileEntry' {} Maybe Base64
a -> PutFileEntry
s {$sel:fileContent:PutFileEntry' :: Maybe Base64
fileContent = Maybe Base64
a} :: PutFileEntry) ((Maybe Base64 -> f (Maybe Base64))
-> PutFileEntry -> f PutFileEntry)
-> ((Maybe ByteString -> f (Maybe ByteString))
-> Maybe Base64 -> f (Maybe Base64))
-> (Maybe ByteString -> f (Maybe ByteString))
-> PutFileEntry
-> f PutFileEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso Base64 Base64 ByteString ByteString
-> Iso
(Maybe Base64) (Maybe Base64) (Maybe ByteString) (Maybe ByteString)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso Base64 Base64 ByteString ByteString
Iso' Base64 ByteString
Core._Base64
putFileEntry_fileMode :: Lens.Lens' PutFileEntry (Prelude.Maybe FileModeTypeEnum)
putFileEntry_fileMode :: (Maybe FileModeTypeEnum -> f (Maybe FileModeTypeEnum))
-> PutFileEntry -> f PutFileEntry
putFileEntry_fileMode = (PutFileEntry -> Maybe FileModeTypeEnum)
-> (PutFileEntry -> Maybe FileModeTypeEnum -> PutFileEntry)
-> Lens
PutFileEntry
PutFileEntry
(Maybe FileModeTypeEnum)
(Maybe FileModeTypeEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFileEntry' {Maybe FileModeTypeEnum
fileMode :: Maybe FileModeTypeEnum
$sel:fileMode:PutFileEntry' :: PutFileEntry -> Maybe FileModeTypeEnum
fileMode} -> Maybe FileModeTypeEnum
fileMode) (\s :: PutFileEntry
s@PutFileEntry' {} Maybe FileModeTypeEnum
a -> PutFileEntry
s {$sel:fileMode:PutFileEntry' :: Maybe FileModeTypeEnum
fileMode = Maybe FileModeTypeEnum
a} :: PutFileEntry)
putFileEntry_sourceFile :: Lens.Lens' PutFileEntry (Prelude.Maybe SourceFileSpecifier)
putFileEntry_sourceFile :: (Maybe SourceFileSpecifier -> f (Maybe SourceFileSpecifier))
-> PutFileEntry -> f PutFileEntry
putFileEntry_sourceFile = (PutFileEntry -> Maybe SourceFileSpecifier)
-> (PutFileEntry -> Maybe SourceFileSpecifier -> PutFileEntry)
-> Lens
PutFileEntry
PutFileEntry
(Maybe SourceFileSpecifier)
(Maybe SourceFileSpecifier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFileEntry' {Maybe SourceFileSpecifier
sourceFile :: Maybe SourceFileSpecifier
$sel:sourceFile:PutFileEntry' :: PutFileEntry -> Maybe SourceFileSpecifier
sourceFile} -> Maybe SourceFileSpecifier
sourceFile) (\s :: PutFileEntry
s@PutFileEntry' {} Maybe SourceFileSpecifier
a -> PutFileEntry
s {$sel:sourceFile:PutFileEntry' :: Maybe SourceFileSpecifier
sourceFile = Maybe SourceFileSpecifier
a} :: PutFileEntry)
putFileEntry_filePath :: Lens.Lens' PutFileEntry Prelude.Text
putFileEntry_filePath :: (Text -> f Text) -> PutFileEntry -> f PutFileEntry
putFileEntry_filePath = (PutFileEntry -> Text)
-> (PutFileEntry -> Text -> PutFileEntry)
-> Lens PutFileEntry PutFileEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFileEntry' {Text
filePath :: Text
$sel:filePath:PutFileEntry' :: PutFileEntry -> Text
filePath} -> Text
filePath) (\s :: PutFileEntry
s@PutFileEntry' {} Text
a -> PutFileEntry
s {$sel:filePath:PutFileEntry' :: Text
filePath = Text
a} :: PutFileEntry)
instance Prelude.Hashable PutFileEntry
instance Prelude.NFData PutFileEntry
instance Core.ToJSON PutFileEntry where
toJSON :: PutFileEntry -> Value
toJSON PutFileEntry' {Maybe Base64
Maybe FileModeTypeEnum
Maybe SourceFileSpecifier
Text
filePath :: Text
sourceFile :: Maybe SourceFileSpecifier
fileMode :: Maybe FileModeTypeEnum
fileContent :: Maybe Base64
$sel:filePath:PutFileEntry' :: PutFileEntry -> Text
$sel:sourceFile:PutFileEntry' :: PutFileEntry -> Maybe SourceFileSpecifier
$sel:fileMode:PutFileEntry' :: PutFileEntry -> Maybe FileModeTypeEnum
$sel:fileContent:PutFileEntry' :: PutFileEntry -> Maybe Base64
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"fileContent" Text -> Base64 -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Base64 -> Pair) -> Maybe Base64 -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Base64
fileContent,
(Text
"fileMode" Text -> FileModeTypeEnum -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (FileModeTypeEnum -> Pair) -> Maybe FileModeTypeEnum -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FileModeTypeEnum
fileMode,
(Text
"sourceFile" Text -> SourceFileSpecifier -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SourceFileSpecifier -> Pair)
-> Maybe SourceFileSpecifier -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SourceFileSpecifier
sourceFile,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"filePath" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
filePath)
]
)