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