{-# 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.SetFileModeEntry where
import Amazonka.CodeCommit.Types.FileModeTypeEnum
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SetFileModeEntry = SetFileModeEntry'
{
SetFileModeEntry -> Text
filePath :: Prelude.Text,
SetFileModeEntry -> FileModeTypeEnum
fileMode :: FileModeTypeEnum
}
deriving (SetFileModeEntry -> SetFileModeEntry -> Bool
(SetFileModeEntry -> SetFileModeEntry -> Bool)
-> (SetFileModeEntry -> SetFileModeEntry -> Bool)
-> Eq SetFileModeEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetFileModeEntry -> SetFileModeEntry -> Bool
$c/= :: SetFileModeEntry -> SetFileModeEntry -> Bool
== :: SetFileModeEntry -> SetFileModeEntry -> Bool
$c== :: SetFileModeEntry -> SetFileModeEntry -> Bool
Prelude.Eq, ReadPrec [SetFileModeEntry]
ReadPrec SetFileModeEntry
Int -> ReadS SetFileModeEntry
ReadS [SetFileModeEntry]
(Int -> ReadS SetFileModeEntry)
-> ReadS [SetFileModeEntry]
-> ReadPrec SetFileModeEntry
-> ReadPrec [SetFileModeEntry]
-> Read SetFileModeEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetFileModeEntry]
$creadListPrec :: ReadPrec [SetFileModeEntry]
readPrec :: ReadPrec SetFileModeEntry
$creadPrec :: ReadPrec SetFileModeEntry
readList :: ReadS [SetFileModeEntry]
$creadList :: ReadS [SetFileModeEntry]
readsPrec :: Int -> ReadS SetFileModeEntry
$creadsPrec :: Int -> ReadS SetFileModeEntry
Prelude.Read, Int -> SetFileModeEntry -> ShowS
[SetFileModeEntry] -> ShowS
SetFileModeEntry -> String
(Int -> SetFileModeEntry -> ShowS)
-> (SetFileModeEntry -> String)
-> ([SetFileModeEntry] -> ShowS)
-> Show SetFileModeEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetFileModeEntry] -> ShowS
$cshowList :: [SetFileModeEntry] -> ShowS
show :: SetFileModeEntry -> String
$cshow :: SetFileModeEntry -> String
showsPrec :: Int -> SetFileModeEntry -> ShowS
$cshowsPrec :: Int -> SetFileModeEntry -> ShowS
Prelude.Show, (forall x. SetFileModeEntry -> Rep SetFileModeEntry x)
-> (forall x. Rep SetFileModeEntry x -> SetFileModeEntry)
-> Generic SetFileModeEntry
forall x. Rep SetFileModeEntry x -> SetFileModeEntry
forall x. SetFileModeEntry -> Rep SetFileModeEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetFileModeEntry x -> SetFileModeEntry
$cfrom :: forall x. SetFileModeEntry -> Rep SetFileModeEntry x
Prelude.Generic)
newSetFileModeEntry ::
Prelude.Text ->
FileModeTypeEnum ->
SetFileModeEntry
newSetFileModeEntry :: Text -> FileModeTypeEnum -> SetFileModeEntry
newSetFileModeEntry Text
pFilePath_ FileModeTypeEnum
pFileMode_ =
SetFileModeEntry' :: Text -> FileModeTypeEnum -> SetFileModeEntry
SetFileModeEntry'
{ $sel:filePath:SetFileModeEntry' :: Text
filePath = Text
pFilePath_,
$sel:fileMode:SetFileModeEntry' :: FileModeTypeEnum
fileMode = FileModeTypeEnum
pFileMode_
}
setFileModeEntry_filePath :: Lens.Lens' SetFileModeEntry Prelude.Text
setFileModeEntry_filePath :: (Text -> f Text) -> SetFileModeEntry -> f SetFileModeEntry
setFileModeEntry_filePath = (SetFileModeEntry -> Text)
-> (SetFileModeEntry -> Text -> SetFileModeEntry)
-> Lens SetFileModeEntry SetFileModeEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetFileModeEntry' {Text
filePath :: Text
$sel:filePath:SetFileModeEntry' :: SetFileModeEntry -> Text
filePath} -> Text
filePath) (\s :: SetFileModeEntry
s@SetFileModeEntry' {} Text
a -> SetFileModeEntry
s {$sel:filePath:SetFileModeEntry' :: Text
filePath = Text
a} :: SetFileModeEntry)
setFileModeEntry_fileMode :: Lens.Lens' SetFileModeEntry FileModeTypeEnum
setFileModeEntry_fileMode :: (FileModeTypeEnum -> f FileModeTypeEnum)
-> SetFileModeEntry -> f SetFileModeEntry
setFileModeEntry_fileMode = (SetFileModeEntry -> FileModeTypeEnum)
-> (SetFileModeEntry -> FileModeTypeEnum -> SetFileModeEntry)
-> Lens
SetFileModeEntry SetFileModeEntry FileModeTypeEnum FileModeTypeEnum
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetFileModeEntry' {FileModeTypeEnum
fileMode :: FileModeTypeEnum
$sel:fileMode:SetFileModeEntry' :: SetFileModeEntry -> FileModeTypeEnum
fileMode} -> FileModeTypeEnum
fileMode) (\s :: SetFileModeEntry
s@SetFileModeEntry' {} FileModeTypeEnum
a -> SetFileModeEntry
s {$sel:fileMode:SetFileModeEntry' :: FileModeTypeEnum
fileMode = FileModeTypeEnum
a} :: SetFileModeEntry)
instance Prelude.Hashable SetFileModeEntry
instance Prelude.NFData SetFileModeEntry
instance Core.ToJSON SetFileModeEntry where
toJSON :: SetFileModeEntry -> Value
toJSON SetFileModeEntry' {Text
FileModeTypeEnum
fileMode :: FileModeTypeEnum
filePath :: Text
$sel:fileMode:SetFileModeEntry' :: SetFileModeEntry -> FileModeTypeEnum
$sel:filePath:SetFileModeEntry' :: SetFileModeEntry -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ 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),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"fileMode" Text -> FileModeTypeEnum -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= FileModeTypeEnum
fileMode)
]
)