{-# 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.SourceFileSpecifier where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SourceFileSpecifier = SourceFileSpecifier'
{
SourceFileSpecifier -> Maybe Bool
isMove :: Prelude.Maybe Prelude.Bool,
SourceFileSpecifier -> Text
filePath :: Prelude.Text
}
deriving (SourceFileSpecifier -> SourceFileSpecifier -> Bool
(SourceFileSpecifier -> SourceFileSpecifier -> Bool)
-> (SourceFileSpecifier -> SourceFileSpecifier -> Bool)
-> Eq SourceFileSpecifier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceFileSpecifier -> SourceFileSpecifier -> Bool
$c/= :: SourceFileSpecifier -> SourceFileSpecifier -> Bool
== :: SourceFileSpecifier -> SourceFileSpecifier -> Bool
$c== :: SourceFileSpecifier -> SourceFileSpecifier -> Bool
Prelude.Eq, ReadPrec [SourceFileSpecifier]
ReadPrec SourceFileSpecifier
Int -> ReadS SourceFileSpecifier
ReadS [SourceFileSpecifier]
(Int -> ReadS SourceFileSpecifier)
-> ReadS [SourceFileSpecifier]
-> ReadPrec SourceFileSpecifier
-> ReadPrec [SourceFileSpecifier]
-> Read SourceFileSpecifier
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SourceFileSpecifier]
$creadListPrec :: ReadPrec [SourceFileSpecifier]
readPrec :: ReadPrec SourceFileSpecifier
$creadPrec :: ReadPrec SourceFileSpecifier
readList :: ReadS [SourceFileSpecifier]
$creadList :: ReadS [SourceFileSpecifier]
readsPrec :: Int -> ReadS SourceFileSpecifier
$creadsPrec :: Int -> ReadS SourceFileSpecifier
Prelude.Read, Int -> SourceFileSpecifier -> ShowS
[SourceFileSpecifier] -> ShowS
SourceFileSpecifier -> String
(Int -> SourceFileSpecifier -> ShowS)
-> (SourceFileSpecifier -> String)
-> ([SourceFileSpecifier] -> ShowS)
-> Show SourceFileSpecifier
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceFileSpecifier] -> ShowS
$cshowList :: [SourceFileSpecifier] -> ShowS
show :: SourceFileSpecifier -> String
$cshow :: SourceFileSpecifier -> String
showsPrec :: Int -> SourceFileSpecifier -> ShowS
$cshowsPrec :: Int -> SourceFileSpecifier -> ShowS
Prelude.Show, (forall x. SourceFileSpecifier -> Rep SourceFileSpecifier x)
-> (forall x. Rep SourceFileSpecifier x -> SourceFileSpecifier)
-> Generic SourceFileSpecifier
forall x. Rep SourceFileSpecifier x -> SourceFileSpecifier
forall x. SourceFileSpecifier -> Rep SourceFileSpecifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourceFileSpecifier x -> SourceFileSpecifier
$cfrom :: forall x. SourceFileSpecifier -> Rep SourceFileSpecifier x
Prelude.Generic)
newSourceFileSpecifier ::
Prelude.Text ->
SourceFileSpecifier
newSourceFileSpecifier :: Text -> SourceFileSpecifier
newSourceFileSpecifier Text
pFilePath_ =
SourceFileSpecifier' :: Maybe Bool -> Text -> SourceFileSpecifier
SourceFileSpecifier'
{ $sel:isMove:SourceFileSpecifier' :: Maybe Bool
isMove = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:filePath:SourceFileSpecifier' :: Text
filePath = Text
pFilePath_
}
sourceFileSpecifier_isMove :: Lens.Lens' SourceFileSpecifier (Prelude.Maybe Prelude.Bool)
sourceFileSpecifier_isMove :: (Maybe Bool -> f (Maybe Bool))
-> SourceFileSpecifier -> f SourceFileSpecifier
sourceFileSpecifier_isMove = (SourceFileSpecifier -> Maybe Bool)
-> (SourceFileSpecifier -> Maybe Bool -> SourceFileSpecifier)
-> Lens
SourceFileSpecifier SourceFileSpecifier (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceFileSpecifier' {Maybe Bool
isMove :: Maybe Bool
$sel:isMove:SourceFileSpecifier' :: SourceFileSpecifier -> Maybe Bool
isMove} -> Maybe Bool
isMove) (\s :: SourceFileSpecifier
s@SourceFileSpecifier' {} Maybe Bool
a -> SourceFileSpecifier
s {$sel:isMove:SourceFileSpecifier' :: Maybe Bool
isMove = Maybe Bool
a} :: SourceFileSpecifier)
sourceFileSpecifier_filePath :: Lens.Lens' SourceFileSpecifier Prelude.Text
sourceFileSpecifier_filePath :: (Text -> f Text) -> SourceFileSpecifier -> f SourceFileSpecifier
sourceFileSpecifier_filePath = (SourceFileSpecifier -> Text)
-> (SourceFileSpecifier -> Text -> SourceFileSpecifier)
-> Lens SourceFileSpecifier SourceFileSpecifier Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceFileSpecifier' {Text
filePath :: Text
$sel:filePath:SourceFileSpecifier' :: SourceFileSpecifier -> Text
filePath} -> Text
filePath) (\s :: SourceFileSpecifier
s@SourceFileSpecifier' {} Text
a -> SourceFileSpecifier
s {$sel:filePath:SourceFileSpecifier' :: Text
filePath = Text
a} :: SourceFileSpecifier)
instance Prelude.Hashable SourceFileSpecifier
instance Prelude.NFData SourceFileSpecifier
instance Core.ToJSON SourceFileSpecifier where
toJSON :: SourceFileSpecifier -> Value
toJSON SourceFileSpecifier' {Maybe Bool
Text
filePath :: Text
isMove :: Maybe Bool
$sel:filePath:SourceFileSpecifier' :: SourceFileSpecifier -> Text
$sel:isMove:SourceFileSpecifier' :: SourceFileSpecifier -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"isMove" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
isMove,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"filePath" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
filePath)
]
)