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