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