{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data BackendAPIConflictResolution = BackendAPIConflictResolution'
{
BackendAPIConflictResolution -> Maybe ResolutionStrategy
resolutionStrategy :: Prelude.Maybe ResolutionStrategy
}
deriving (BackendAPIConflictResolution
-> BackendAPIConflictResolution -> Bool
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]
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
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.
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'
{ $sel:resolutionStrategy:BackendAPIConflictResolution' :: Maybe ResolutionStrategy
resolutionStrategy =
forall a. Maybe a
Prelude.Nothing
}
backendAPIConflictResolution_resolutionStrategy :: Lens.Lens' BackendAPIConflictResolution (Prelude.Maybe ResolutionStrategy)
backendAPIConflictResolution_resolutionStrategy :: Lens' BackendAPIConflictResolution (Maybe ResolutionStrategy)
backendAPIConflictResolution_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 Data.FromJSON BackendAPIConflictResolution where
parseJSON :: Value -> Parser BackendAPIConflictResolution
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"BackendAPIConflictResolution"
( \Object
x ->
Maybe ResolutionStrategy -> BackendAPIConflictResolution
BackendAPIConflictResolution'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"resolutionStrategy")
)
instance
Prelude.Hashable
BackendAPIConflictResolution
where
hashWithSalt :: Int -> BackendAPIConflictResolution -> Int
hashWithSalt Int
_salt BackendAPIConflictResolution' {Maybe ResolutionStrategy
resolutionStrategy :: Maybe ResolutionStrategy
$sel:resolutionStrategy:BackendAPIConflictResolution' :: BackendAPIConflictResolution -> Maybe ResolutionStrategy
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResolutionStrategy
resolutionStrategy
instance Prelude.NFData BackendAPIConflictResolution where
rnf :: BackendAPIConflictResolution -> ()
rnf BackendAPIConflictResolution' {Maybe ResolutionStrategy
resolutionStrategy :: Maybe ResolutionStrategy
$sel:resolutionStrategy:BackendAPIConflictResolution' :: BackendAPIConflictResolution -> Maybe ResolutionStrategy
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ResolutionStrategy
resolutionStrategy
instance Data.ToJSON BackendAPIConflictResolution where
toJSON :: BackendAPIConflictResolution -> Value
toJSON BackendAPIConflictResolution' {Maybe ResolutionStrategy
resolutionStrategy :: Maybe ResolutionStrategy
$sel:resolutionStrategy:BackendAPIConflictResolution' :: BackendAPIConflictResolution -> Maybe ResolutionStrategy
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"resolutionStrategy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResolutionStrategy
resolutionStrategy
]
)