{-# 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.ConflictResolution where
import Amazonka.CodeCommit.Types.DeleteFileEntry
import Amazonka.CodeCommit.Types.ReplaceContentEntry
import Amazonka.CodeCommit.Types.SetFileModeEntry
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ConflictResolution = ConflictResolution'
{
ConflictResolution -> Maybe [SetFileModeEntry]
setFileModes :: Prelude.Maybe [SetFileModeEntry],
ConflictResolution -> Maybe [DeleteFileEntry]
deleteFiles :: Prelude.Maybe [DeleteFileEntry],
ConflictResolution -> Maybe [ReplaceContentEntry]
replaceContents :: Prelude.Maybe [ReplaceContentEntry]
}
deriving (ConflictResolution -> ConflictResolution -> Bool
(ConflictResolution -> ConflictResolution -> Bool)
-> (ConflictResolution -> ConflictResolution -> Bool)
-> Eq ConflictResolution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConflictResolution -> ConflictResolution -> Bool
$c/= :: ConflictResolution -> ConflictResolution -> Bool
== :: ConflictResolution -> ConflictResolution -> Bool
$c== :: ConflictResolution -> ConflictResolution -> Bool
Prelude.Eq, ReadPrec [ConflictResolution]
ReadPrec ConflictResolution
Int -> ReadS ConflictResolution
ReadS [ConflictResolution]
(Int -> ReadS ConflictResolution)
-> ReadS [ConflictResolution]
-> ReadPrec ConflictResolution
-> ReadPrec [ConflictResolution]
-> Read ConflictResolution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConflictResolution]
$creadListPrec :: ReadPrec [ConflictResolution]
readPrec :: ReadPrec ConflictResolution
$creadPrec :: ReadPrec ConflictResolution
readList :: ReadS [ConflictResolution]
$creadList :: ReadS [ConflictResolution]
readsPrec :: Int -> ReadS ConflictResolution
$creadsPrec :: Int -> ReadS ConflictResolution
Prelude.Read, Int -> ConflictResolution -> ShowS
[ConflictResolution] -> ShowS
ConflictResolution -> String
(Int -> ConflictResolution -> ShowS)
-> (ConflictResolution -> String)
-> ([ConflictResolution] -> ShowS)
-> Show ConflictResolution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConflictResolution] -> ShowS
$cshowList :: [ConflictResolution] -> ShowS
show :: ConflictResolution -> String
$cshow :: ConflictResolution -> String
showsPrec :: Int -> ConflictResolution -> ShowS
$cshowsPrec :: Int -> ConflictResolution -> ShowS
Prelude.Show, (forall x. ConflictResolution -> Rep ConflictResolution x)
-> (forall x. Rep ConflictResolution x -> ConflictResolution)
-> Generic ConflictResolution
forall x. Rep ConflictResolution x -> ConflictResolution
forall x. ConflictResolution -> Rep ConflictResolution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConflictResolution x -> ConflictResolution
$cfrom :: forall x. ConflictResolution -> Rep ConflictResolution x
Prelude.Generic)
newConflictResolution ::
ConflictResolution
newConflictResolution :: ConflictResolution
newConflictResolution =
ConflictResolution' :: Maybe [SetFileModeEntry]
-> Maybe [DeleteFileEntry]
-> Maybe [ReplaceContentEntry]
-> ConflictResolution
ConflictResolution'
{ $sel:setFileModes:ConflictResolution' :: Maybe [SetFileModeEntry]
setFileModes = Maybe [SetFileModeEntry]
forall a. Maybe a
Prelude.Nothing,
$sel:deleteFiles:ConflictResolution' :: Maybe [DeleteFileEntry]
deleteFiles = Maybe [DeleteFileEntry]
forall a. Maybe a
Prelude.Nothing,
$sel:replaceContents:ConflictResolution' :: Maybe [ReplaceContentEntry]
replaceContents = Maybe [ReplaceContentEntry]
forall a. Maybe a
Prelude.Nothing
}
conflictResolution_setFileModes :: Lens.Lens' ConflictResolution (Prelude.Maybe [SetFileModeEntry])
conflictResolution_setFileModes :: (Maybe [SetFileModeEntry] -> f (Maybe [SetFileModeEntry]))
-> ConflictResolution -> f ConflictResolution
conflictResolution_setFileModes = (ConflictResolution -> Maybe [SetFileModeEntry])
-> (ConflictResolution
-> Maybe [SetFileModeEntry] -> ConflictResolution)
-> Lens
ConflictResolution
ConflictResolution
(Maybe [SetFileModeEntry])
(Maybe [SetFileModeEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConflictResolution' {Maybe [SetFileModeEntry]
setFileModes :: Maybe [SetFileModeEntry]
$sel:setFileModes:ConflictResolution' :: ConflictResolution -> Maybe [SetFileModeEntry]
setFileModes} -> Maybe [SetFileModeEntry]
setFileModes) (\s :: ConflictResolution
s@ConflictResolution' {} Maybe [SetFileModeEntry]
a -> ConflictResolution
s {$sel:setFileModes:ConflictResolution' :: Maybe [SetFileModeEntry]
setFileModes = Maybe [SetFileModeEntry]
a} :: ConflictResolution) ((Maybe [SetFileModeEntry] -> f (Maybe [SetFileModeEntry]))
-> ConflictResolution -> f ConflictResolution)
-> ((Maybe [SetFileModeEntry] -> f (Maybe [SetFileModeEntry]))
-> Maybe [SetFileModeEntry] -> f (Maybe [SetFileModeEntry]))
-> (Maybe [SetFileModeEntry] -> f (Maybe [SetFileModeEntry]))
-> ConflictResolution
-> f ConflictResolution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[SetFileModeEntry]
[SetFileModeEntry]
[SetFileModeEntry]
[SetFileModeEntry]
-> Iso
(Maybe [SetFileModeEntry])
(Maybe [SetFileModeEntry])
(Maybe [SetFileModeEntry])
(Maybe [SetFileModeEntry])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[SetFileModeEntry]
[SetFileModeEntry]
[SetFileModeEntry]
[SetFileModeEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
conflictResolution_deleteFiles :: Lens.Lens' ConflictResolution (Prelude.Maybe [DeleteFileEntry])
conflictResolution_deleteFiles :: (Maybe [DeleteFileEntry] -> f (Maybe [DeleteFileEntry]))
-> ConflictResolution -> f ConflictResolution
conflictResolution_deleteFiles = (ConflictResolution -> Maybe [DeleteFileEntry])
-> (ConflictResolution
-> Maybe [DeleteFileEntry] -> ConflictResolution)
-> Lens
ConflictResolution
ConflictResolution
(Maybe [DeleteFileEntry])
(Maybe [DeleteFileEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConflictResolution' {Maybe [DeleteFileEntry]
deleteFiles :: Maybe [DeleteFileEntry]
$sel:deleteFiles:ConflictResolution' :: ConflictResolution -> Maybe [DeleteFileEntry]
deleteFiles} -> Maybe [DeleteFileEntry]
deleteFiles) (\s :: ConflictResolution
s@ConflictResolution' {} Maybe [DeleteFileEntry]
a -> ConflictResolution
s {$sel:deleteFiles:ConflictResolution' :: Maybe [DeleteFileEntry]
deleteFiles = Maybe [DeleteFileEntry]
a} :: ConflictResolution) ((Maybe [DeleteFileEntry] -> f (Maybe [DeleteFileEntry]))
-> ConflictResolution -> f ConflictResolution)
-> ((Maybe [DeleteFileEntry] -> f (Maybe [DeleteFileEntry]))
-> Maybe [DeleteFileEntry] -> f (Maybe [DeleteFileEntry]))
-> (Maybe [DeleteFileEntry] -> f (Maybe [DeleteFileEntry]))
-> ConflictResolution
-> f ConflictResolution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[DeleteFileEntry]
[DeleteFileEntry]
[DeleteFileEntry]
[DeleteFileEntry]
-> Iso
(Maybe [DeleteFileEntry])
(Maybe [DeleteFileEntry])
(Maybe [DeleteFileEntry])
(Maybe [DeleteFileEntry])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[DeleteFileEntry]
[DeleteFileEntry]
[DeleteFileEntry]
[DeleteFileEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
conflictResolution_replaceContents :: Lens.Lens' ConflictResolution (Prelude.Maybe [ReplaceContentEntry])
conflictResolution_replaceContents :: (Maybe [ReplaceContentEntry] -> f (Maybe [ReplaceContentEntry]))
-> ConflictResolution -> f ConflictResolution
conflictResolution_replaceContents = (ConflictResolution -> Maybe [ReplaceContentEntry])
-> (ConflictResolution
-> Maybe [ReplaceContentEntry] -> ConflictResolution)
-> Lens
ConflictResolution
ConflictResolution
(Maybe [ReplaceContentEntry])
(Maybe [ReplaceContentEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConflictResolution' {Maybe [ReplaceContentEntry]
replaceContents :: Maybe [ReplaceContentEntry]
$sel:replaceContents:ConflictResolution' :: ConflictResolution -> Maybe [ReplaceContentEntry]
replaceContents} -> Maybe [ReplaceContentEntry]
replaceContents) (\s :: ConflictResolution
s@ConflictResolution' {} Maybe [ReplaceContentEntry]
a -> ConflictResolution
s {$sel:replaceContents:ConflictResolution' :: Maybe [ReplaceContentEntry]
replaceContents = Maybe [ReplaceContentEntry]
a} :: ConflictResolution) ((Maybe [ReplaceContentEntry] -> f (Maybe [ReplaceContentEntry]))
-> ConflictResolution -> f ConflictResolution)
-> ((Maybe [ReplaceContentEntry]
-> f (Maybe [ReplaceContentEntry]))
-> Maybe [ReplaceContentEntry] -> f (Maybe [ReplaceContentEntry]))
-> (Maybe [ReplaceContentEntry] -> f (Maybe [ReplaceContentEntry]))
-> ConflictResolution
-> f ConflictResolution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ReplaceContentEntry]
[ReplaceContentEntry]
[ReplaceContentEntry]
[ReplaceContentEntry]
-> Iso
(Maybe [ReplaceContentEntry])
(Maybe [ReplaceContentEntry])
(Maybe [ReplaceContentEntry])
(Maybe [ReplaceContentEntry])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[ReplaceContentEntry]
[ReplaceContentEntry]
[ReplaceContentEntry]
[ReplaceContentEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable ConflictResolution
instance Prelude.NFData ConflictResolution
instance Core.ToJSON ConflictResolution where
toJSON :: ConflictResolution -> Value
toJSON ConflictResolution' {Maybe [DeleteFileEntry]
Maybe [ReplaceContentEntry]
Maybe [SetFileModeEntry]
replaceContents :: Maybe [ReplaceContentEntry]
deleteFiles :: Maybe [DeleteFileEntry]
setFileModes :: Maybe [SetFileModeEntry]
$sel:replaceContents:ConflictResolution' :: ConflictResolution -> Maybe [ReplaceContentEntry]
$sel:deleteFiles:ConflictResolution' :: ConflictResolution -> Maybe [DeleteFileEntry]
$sel:setFileModes:ConflictResolution' :: ConflictResolution -> Maybe [SetFileModeEntry]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"setFileModes" Text -> [SetFileModeEntry] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([SetFileModeEntry] -> Pair)
-> Maybe [SetFileModeEntry] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SetFileModeEntry]
setFileModes,
(Text
"deleteFiles" Text -> [DeleteFileEntry] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([DeleteFileEntry] -> Pair)
-> Maybe [DeleteFileEntry] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DeleteFileEntry]
deleteFiles,
(Text
"replaceContents" Text -> [ReplaceContentEntry] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([ReplaceContentEntry] -> Pair)
-> Maybe [ReplaceContentEntry] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ReplaceContentEntry]
replaceContents
]
)