{-# 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.BlobMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BlobMetadata = BlobMetadata'
{
BlobMetadata -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
BlobMetadata -> Maybe Text
mode :: Prelude.Maybe Prelude.Text,
BlobMetadata -> Maybe Text
blobId :: Prelude.Maybe Prelude.Text
}
deriving (BlobMetadata -> BlobMetadata -> Bool
(BlobMetadata -> BlobMetadata -> Bool)
-> (BlobMetadata -> BlobMetadata -> Bool) -> Eq BlobMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BlobMetadata -> BlobMetadata -> Bool
$c/= :: BlobMetadata -> BlobMetadata -> Bool
== :: BlobMetadata -> BlobMetadata -> Bool
$c== :: BlobMetadata -> BlobMetadata -> Bool
Prelude.Eq, ReadPrec [BlobMetadata]
ReadPrec BlobMetadata
Int -> ReadS BlobMetadata
ReadS [BlobMetadata]
(Int -> ReadS BlobMetadata)
-> ReadS [BlobMetadata]
-> ReadPrec BlobMetadata
-> ReadPrec [BlobMetadata]
-> Read BlobMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BlobMetadata]
$creadListPrec :: ReadPrec [BlobMetadata]
readPrec :: ReadPrec BlobMetadata
$creadPrec :: ReadPrec BlobMetadata
readList :: ReadS [BlobMetadata]
$creadList :: ReadS [BlobMetadata]
readsPrec :: Int -> ReadS BlobMetadata
$creadsPrec :: Int -> ReadS BlobMetadata
Prelude.Read, Int -> BlobMetadata -> ShowS
[BlobMetadata] -> ShowS
BlobMetadata -> String
(Int -> BlobMetadata -> ShowS)
-> (BlobMetadata -> String)
-> ([BlobMetadata] -> ShowS)
-> Show BlobMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BlobMetadata] -> ShowS
$cshowList :: [BlobMetadata] -> ShowS
show :: BlobMetadata -> String
$cshow :: BlobMetadata -> String
showsPrec :: Int -> BlobMetadata -> ShowS
$cshowsPrec :: Int -> BlobMetadata -> ShowS
Prelude.Show, (forall x. BlobMetadata -> Rep BlobMetadata x)
-> (forall x. Rep BlobMetadata x -> BlobMetadata)
-> Generic BlobMetadata
forall x. Rep BlobMetadata x -> BlobMetadata
forall x. BlobMetadata -> Rep BlobMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BlobMetadata x -> BlobMetadata
$cfrom :: forall x. BlobMetadata -> Rep BlobMetadata x
Prelude.Generic)
newBlobMetadata ::
BlobMetadata
newBlobMetadata :: BlobMetadata
newBlobMetadata =
BlobMetadata' :: Maybe Text -> Maybe Text -> Maybe Text -> BlobMetadata
BlobMetadata'
{ $sel:path:BlobMetadata' :: Maybe Text
path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:mode:BlobMetadata' :: Maybe Text
mode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:blobId:BlobMetadata' :: Maybe Text
blobId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
blobMetadata_path :: Lens.Lens' BlobMetadata (Prelude.Maybe Prelude.Text)
blobMetadata_path :: (Maybe Text -> f (Maybe Text)) -> BlobMetadata -> f BlobMetadata
blobMetadata_path = (BlobMetadata -> Maybe Text)
-> (BlobMetadata -> Maybe Text -> BlobMetadata)
-> Lens BlobMetadata BlobMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BlobMetadata' {Maybe Text
path :: Maybe Text
$sel:path:BlobMetadata' :: BlobMetadata -> Maybe Text
path} -> Maybe Text
path) (\s :: BlobMetadata
s@BlobMetadata' {} Maybe Text
a -> BlobMetadata
s {$sel:path:BlobMetadata' :: Maybe Text
path = Maybe Text
a} :: BlobMetadata)
blobMetadata_mode :: Lens.Lens' BlobMetadata (Prelude.Maybe Prelude.Text)
blobMetadata_mode :: (Maybe Text -> f (Maybe Text)) -> BlobMetadata -> f BlobMetadata
blobMetadata_mode = (BlobMetadata -> Maybe Text)
-> (BlobMetadata -> Maybe Text -> BlobMetadata)
-> Lens BlobMetadata BlobMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BlobMetadata' {Maybe Text
mode :: Maybe Text
$sel:mode:BlobMetadata' :: BlobMetadata -> Maybe Text
mode} -> Maybe Text
mode) (\s :: BlobMetadata
s@BlobMetadata' {} Maybe Text
a -> BlobMetadata
s {$sel:mode:BlobMetadata' :: Maybe Text
mode = Maybe Text
a} :: BlobMetadata)
blobMetadata_blobId :: Lens.Lens' BlobMetadata (Prelude.Maybe Prelude.Text)
blobMetadata_blobId :: (Maybe Text -> f (Maybe Text)) -> BlobMetadata -> f BlobMetadata
blobMetadata_blobId = (BlobMetadata -> Maybe Text)
-> (BlobMetadata -> Maybe Text -> BlobMetadata)
-> Lens BlobMetadata BlobMetadata (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BlobMetadata' {Maybe Text
blobId :: Maybe Text
$sel:blobId:BlobMetadata' :: BlobMetadata -> Maybe Text
blobId} -> Maybe Text
blobId) (\s :: BlobMetadata
s@BlobMetadata' {} Maybe Text
a -> BlobMetadata
s {$sel:blobId:BlobMetadata' :: Maybe Text
blobId = Maybe Text
a} :: BlobMetadata)
instance Core.FromJSON BlobMetadata where
parseJSON :: Value -> Parser BlobMetadata
parseJSON =
String
-> (Object -> Parser BlobMetadata) -> Value -> Parser BlobMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BlobMetadata"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> BlobMetadata
BlobMetadata'
(Maybe Text -> Maybe Text -> Maybe Text -> BlobMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> BlobMetadata)
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
"path")
Parser (Maybe Text -> Maybe Text -> BlobMetadata)
-> Parser (Maybe Text) -> Parser (Maybe Text -> BlobMetadata)
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
"mode")
Parser (Maybe Text -> BlobMetadata)
-> Parser (Maybe Text) -> Parser BlobMetadata
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 BlobMetadata
instance Prelude.NFData BlobMetadata