{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.DrS.Types.ReplicationDirection
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DrS.Types.ReplicationDirection
  ( ReplicationDirection
      ( ..,
        ReplicationDirection_FAILBACK,
        ReplicationDirection_FAILOVER
      ),
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Replication direction designates if this is a failover replication, or a
-- failback replication. When a DRS agent is installed on an instance, the
-- replication direction is failover. In cases where a recovery launch was
-- made in the recovery location and a new recovery instance was created,
-- and then a failback replication was initiated from that recovery
-- instance back to the origin location, then the replication direction
-- will be failback.
newtype ReplicationDirection = ReplicationDirection'
  { ReplicationDirection -> Text
fromReplicationDirection ::
      Data.Text
  }
  deriving stock
    ( Int -> ReplicationDirection -> ShowS
[ReplicationDirection] -> ShowS
ReplicationDirection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReplicationDirection] -> ShowS
$cshowList :: [ReplicationDirection] -> ShowS
show :: ReplicationDirection -> String
$cshow :: ReplicationDirection -> String
showsPrec :: Int -> ReplicationDirection -> ShowS
$cshowsPrec :: Int -> ReplicationDirection -> ShowS
Prelude.Show,
      ReadPrec [ReplicationDirection]
ReadPrec ReplicationDirection
Int -> ReadS ReplicationDirection
ReadS [ReplicationDirection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReplicationDirection]
$creadListPrec :: ReadPrec [ReplicationDirection]
readPrec :: ReadPrec ReplicationDirection
$creadPrec :: ReadPrec ReplicationDirection
readList :: ReadS [ReplicationDirection]
$creadList :: ReadS [ReplicationDirection]
readsPrec :: Int -> ReadS ReplicationDirection
$creadsPrec :: Int -> ReadS ReplicationDirection
Prelude.Read,
      ReplicationDirection -> ReplicationDirection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReplicationDirection -> ReplicationDirection -> Bool
$c/= :: ReplicationDirection -> ReplicationDirection -> Bool
== :: ReplicationDirection -> ReplicationDirection -> Bool
$c== :: ReplicationDirection -> ReplicationDirection -> Bool
Prelude.Eq,
      Eq ReplicationDirection
ReplicationDirection -> ReplicationDirection -> Bool
ReplicationDirection -> ReplicationDirection -> Ordering
ReplicationDirection
-> ReplicationDirection -> ReplicationDirection
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ReplicationDirection
-> ReplicationDirection -> ReplicationDirection
$cmin :: ReplicationDirection
-> ReplicationDirection -> ReplicationDirection
max :: ReplicationDirection
-> ReplicationDirection -> ReplicationDirection
$cmax :: ReplicationDirection
-> ReplicationDirection -> ReplicationDirection
>= :: ReplicationDirection -> ReplicationDirection -> Bool
$c>= :: ReplicationDirection -> ReplicationDirection -> Bool
> :: ReplicationDirection -> ReplicationDirection -> Bool
$c> :: ReplicationDirection -> ReplicationDirection -> Bool
<= :: ReplicationDirection -> ReplicationDirection -> Bool
$c<= :: ReplicationDirection -> ReplicationDirection -> Bool
< :: ReplicationDirection -> ReplicationDirection -> Bool
$c< :: ReplicationDirection -> ReplicationDirection -> Bool
compare :: ReplicationDirection -> ReplicationDirection -> Ordering
$ccompare :: ReplicationDirection -> ReplicationDirection -> Ordering
Prelude.Ord,
      forall x. Rep ReplicationDirection x -> ReplicationDirection
forall x. ReplicationDirection -> Rep ReplicationDirection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReplicationDirection x -> ReplicationDirection
$cfrom :: forall x. ReplicationDirection -> Rep ReplicationDirection x
Prelude.Generic
    )
  deriving newtype
    ( Eq ReplicationDirection
Int -> ReplicationDirection -> Int
ReplicationDirection -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ReplicationDirection -> Int
$chash :: ReplicationDirection -> Int
hashWithSalt :: Int -> ReplicationDirection -> Int
$chashWithSalt :: Int -> ReplicationDirection -> Int
Prelude.Hashable,
      ReplicationDirection -> ()
forall a. (a -> ()) -> NFData a
rnf :: ReplicationDirection -> ()
$crnf :: ReplicationDirection -> ()
Prelude.NFData,
      Text -> Either String ReplicationDirection
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String ReplicationDirection
$cfromText :: Text -> Either String ReplicationDirection
Data.FromText,
      ReplicationDirection -> Text
forall a. (a -> Text) -> ToText a
toText :: ReplicationDirection -> Text
$ctoText :: ReplicationDirection -> Text
Data.ToText,
      ReplicationDirection -> ByteString
forall a. (a -> ByteString) -> ToByteString a
toBS :: ReplicationDirection -> ByteString
$ctoBS :: ReplicationDirection -> ByteString
Data.ToByteString,
      ReplicationDirection -> ByteStringBuilder
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: ReplicationDirection -> ByteStringBuilder
$cbuild :: ReplicationDirection -> ByteStringBuilder
Data.ToLog,
      HeaderName -> ReplicationDirection -> [Header]
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> ReplicationDirection -> [Header]
$ctoHeader :: HeaderName -> ReplicationDirection -> [Header]
Data.ToHeader,
      ReplicationDirection -> QueryString
forall a. (a -> QueryString) -> ToQuery a
toQuery :: ReplicationDirection -> QueryString
$ctoQuery :: ReplicationDirection -> QueryString
Data.ToQuery,
      Value -> Parser [ReplicationDirection]
Value -> Parser ReplicationDirection
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [ReplicationDirection]
$cparseJSONList :: Value -> Parser [ReplicationDirection]
parseJSON :: Value -> Parser ReplicationDirection
$cparseJSON :: Value -> Parser ReplicationDirection
Data.FromJSON,
      FromJSONKeyFunction [ReplicationDirection]
FromJSONKeyFunction ReplicationDirection
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [ReplicationDirection]
$cfromJSONKeyList :: FromJSONKeyFunction [ReplicationDirection]
fromJSONKey :: FromJSONKeyFunction ReplicationDirection
$cfromJSONKey :: FromJSONKeyFunction ReplicationDirection
Data.FromJSONKey,
      [ReplicationDirection] -> Encoding
[ReplicationDirection] -> Value
ReplicationDirection -> Encoding
ReplicationDirection -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [ReplicationDirection] -> Encoding
$ctoEncodingList :: [ReplicationDirection] -> Encoding
toJSONList :: [ReplicationDirection] -> Value
$ctoJSONList :: [ReplicationDirection] -> Value
toEncoding :: ReplicationDirection -> Encoding
$ctoEncoding :: ReplicationDirection -> Encoding
toJSON :: ReplicationDirection -> Value
$ctoJSON :: ReplicationDirection -> Value
Data.ToJSON,
      ToJSONKeyFunction [ReplicationDirection]
ToJSONKeyFunction ReplicationDirection
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [ReplicationDirection]
$ctoJSONKeyList :: ToJSONKeyFunction [ReplicationDirection]
toJSONKey :: ToJSONKeyFunction ReplicationDirection
$ctoJSONKey :: ToJSONKeyFunction ReplicationDirection
Data.ToJSONKey,
      [Node] -> Either String ReplicationDirection
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String ReplicationDirection
$cparseXML :: [Node] -> Either String ReplicationDirection
Data.FromXML,
      ReplicationDirection -> XML
forall a. (a -> XML) -> ToXML a
toXML :: ReplicationDirection -> XML
$ctoXML :: ReplicationDirection -> XML
Data.ToXML
    )

pattern ReplicationDirection_FAILBACK :: ReplicationDirection
pattern $bReplicationDirection_FAILBACK :: ReplicationDirection
$mReplicationDirection_FAILBACK :: forall {r}.
ReplicationDirection -> ((# #) -> r) -> ((# #) -> r) -> r
ReplicationDirection_FAILBACK = ReplicationDirection' "FAILBACK"

pattern ReplicationDirection_FAILOVER :: ReplicationDirection
pattern $bReplicationDirection_FAILOVER :: ReplicationDirection
$mReplicationDirection_FAILOVER :: forall {r}.
ReplicationDirection -> ((# #) -> r) -> ((# #) -> r) -> r
ReplicationDirection_FAILOVER = ReplicationDirection' "FAILOVER"

{-# COMPLETE
  ReplicationDirection_FAILBACK,
  ReplicationDirection_FAILOVER,
  ReplicationDirection'
  #-}