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