{-# 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.File 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 File = File'
{
File -> Maybe Text
absolutePath :: Prelude.Maybe Prelude.Text,
File -> Maybe FileModeTypeEnum
fileMode :: Prelude.Maybe FileModeTypeEnum,
File -> Maybe Text
blobId :: Prelude.Maybe Prelude.Text,
File -> Maybe Text
relativePath :: Prelude.Maybe Prelude.Text
}
deriving (File -> File -> Bool
(File -> File -> Bool) -> (File -> File -> Bool) -> Eq File
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: File -> File -> Bool
$c/= :: File -> File -> Bool
== :: File -> File -> Bool
$c== :: File -> File -> Bool
Prelude.Eq, ReadPrec [File]
ReadPrec File
Int -> ReadS File
ReadS [File]
(Int -> ReadS File)
-> ReadS [File] -> ReadPrec File -> ReadPrec [File] -> Read File
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [File]
$creadListPrec :: ReadPrec [File]
readPrec :: ReadPrec File
$creadPrec :: ReadPrec File
readList :: ReadS [File]
$creadList :: ReadS [File]
readsPrec :: Int -> ReadS File
$creadsPrec :: Int -> ReadS File
Prelude.Read, Int -> File -> ShowS
[File] -> ShowS
File -> String
(Int -> File -> ShowS)
-> (File -> String) -> ([File] -> ShowS) -> Show File
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [File] -> ShowS
$cshowList :: [File] -> ShowS
show :: File -> String
$cshow :: File -> String
showsPrec :: Int -> File -> ShowS
$cshowsPrec :: Int -> File -> ShowS
Prelude.Show, (forall x. File -> Rep File x)
-> (forall x. Rep File x -> File) -> Generic File
forall x. Rep File x -> File
forall x. File -> Rep File x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep File x -> File
$cfrom :: forall x. File -> Rep File x
Prelude.Generic)
newFile ::
File
newFile :: File
newFile =
File' :: Maybe Text
-> Maybe FileModeTypeEnum -> Maybe Text -> Maybe Text -> File
File'
{ $sel:absolutePath:File' :: Maybe Text
absolutePath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:fileMode:File' :: Maybe FileModeTypeEnum
fileMode = Maybe FileModeTypeEnum
forall a. Maybe a
Prelude.Nothing,
$sel:blobId:File' :: Maybe Text
blobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:relativePath:File' :: Maybe Text
relativePath = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
file_absolutePath :: Lens.Lens' File (Prelude.Maybe Prelude.Text)
file_absolutePath :: (Maybe Text -> f (Maybe Text)) -> File -> f File
file_absolutePath = (File -> Maybe Text)
-> (File -> Maybe Text -> File)
-> Lens File File (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\File' {Maybe Text
absolutePath :: Maybe Text
$sel:absolutePath:File' :: File -> Maybe Text
absolutePath} -> Maybe Text
absolutePath) (\s :: File
s@File' {} Maybe Text
a -> File
s {$sel:absolutePath:File' :: Maybe Text
absolutePath = Maybe Text
a} :: File)
file_fileMode :: Lens.Lens' File (Prelude.Maybe FileModeTypeEnum)
file_fileMode :: (Maybe FileModeTypeEnum -> f (Maybe FileModeTypeEnum))
-> File -> f File
file_fileMode = (File -> Maybe FileModeTypeEnum)
-> (File -> Maybe FileModeTypeEnum -> File)
-> Lens File File (Maybe FileModeTypeEnum) (Maybe FileModeTypeEnum)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\File' {Maybe FileModeTypeEnum
fileMode :: Maybe FileModeTypeEnum
$sel:fileMode:File' :: File -> Maybe FileModeTypeEnum
fileMode} -> Maybe FileModeTypeEnum
fileMode) (\s :: File
s@File' {} Maybe FileModeTypeEnum
a -> File
s {$sel:fileMode:File' :: Maybe FileModeTypeEnum
fileMode = Maybe FileModeTypeEnum
a} :: File)
file_blobId :: Lens.Lens' File (Prelude.Maybe Prelude.Text)
file_blobId :: (Maybe Text -> f (Maybe Text)) -> File -> f File
file_blobId = (File -> Maybe Text)
-> (File -> Maybe Text -> File)
-> Lens File File (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\File' {Maybe Text
blobId :: Maybe Text
$sel:blobId:File' :: File -> Maybe Text
blobId} -> Maybe Text
blobId) (\s :: File
s@File' {} Maybe Text
a -> File
s {$sel:blobId:File' :: Maybe Text
blobId = Maybe Text
a} :: File)
file_relativePath :: Lens.Lens' File (Prelude.Maybe Prelude.Text)
file_relativePath :: (Maybe Text -> f (Maybe Text)) -> File -> f File
file_relativePath = (File -> Maybe Text)
-> (File -> Maybe Text -> File)
-> Lens File File (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\File' {Maybe Text
relativePath :: Maybe Text
$sel:relativePath:File' :: File -> Maybe Text
relativePath} -> Maybe Text
relativePath) (\s :: File
s@File' {} Maybe Text
a -> File
s {$sel:relativePath:File' :: Maybe Text
relativePath = Maybe Text
a} :: File)
instance Core.FromJSON File where
parseJSON :: Value -> Parser File
parseJSON =
String -> (Object -> Parser File) -> Value -> Parser File
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"File"
( \Object
x ->
Maybe Text
-> Maybe FileModeTypeEnum -> Maybe Text -> Maybe Text -> File
File'
(Maybe Text
-> Maybe FileModeTypeEnum -> Maybe Text -> Maybe Text -> File)
-> Parser (Maybe Text)
-> Parser
(Maybe FileModeTypeEnum -> Maybe Text -> Maybe Text -> File)
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
"absolutePath")
Parser (Maybe FileModeTypeEnum -> Maybe Text -> Maybe Text -> File)
-> Parser (Maybe FileModeTypeEnum)
-> Parser (Maybe Text -> Maybe Text -> File)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FileModeTypeEnum)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"fileMode")
Parser (Maybe Text -> Maybe Text -> File)
-> Parser (Maybe Text) -> Parser (Maybe Text -> File)
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
"blobId")
Parser (Maybe Text -> File) -> Parser (Maybe Text) -> Parser File
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
"relativePath")
)
instance Prelude.Hashable File
instance Prelude.NFData File