{-# 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.SESV2.Types.TlsPolicy
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SESV2.Types.TlsPolicy
  ( TlsPolicy
      ( ..,
        TlsPolicy_OPTIONAL,
        TlsPolicy_REQUIRE
      ),
  )
where

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

-- | Specifies whether messages that use the configuration set are required
-- to use Transport Layer Security (TLS). If the value is @Require@,
-- messages are only delivered if a TLS connection can be established. If
-- the value is @Optional@, messages can be delivered in plain text if a
-- TLS connection can\'t be established.
newtype TlsPolicy = TlsPolicy'
  { TlsPolicy -> Text
fromTlsPolicy ::
      Core.Text
  }
  deriving stock
    ( Int -> TlsPolicy -> ShowS
[TlsPolicy] -> ShowS
TlsPolicy -> String
(Int -> TlsPolicy -> ShowS)
-> (TlsPolicy -> String)
-> ([TlsPolicy] -> ShowS)
-> Show TlsPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TlsPolicy] -> ShowS
$cshowList :: [TlsPolicy] -> ShowS
show :: TlsPolicy -> String
$cshow :: TlsPolicy -> String
showsPrec :: Int -> TlsPolicy -> ShowS
$cshowsPrec :: Int -> TlsPolicy -> ShowS
Prelude.Show,
      ReadPrec [TlsPolicy]
ReadPrec TlsPolicy
Int -> ReadS TlsPolicy
ReadS [TlsPolicy]
(Int -> ReadS TlsPolicy)
-> ReadS [TlsPolicy]
-> ReadPrec TlsPolicy
-> ReadPrec [TlsPolicy]
-> Read TlsPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TlsPolicy]
$creadListPrec :: ReadPrec [TlsPolicy]
readPrec :: ReadPrec TlsPolicy
$creadPrec :: ReadPrec TlsPolicy
readList :: ReadS [TlsPolicy]
$creadList :: ReadS [TlsPolicy]
readsPrec :: Int -> ReadS TlsPolicy
$creadsPrec :: Int -> ReadS TlsPolicy
Prelude.Read,
      TlsPolicy -> TlsPolicy -> Bool
(TlsPolicy -> TlsPolicy -> Bool)
-> (TlsPolicy -> TlsPolicy -> Bool) -> Eq TlsPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TlsPolicy -> TlsPolicy -> Bool
$c/= :: TlsPolicy -> TlsPolicy -> Bool
== :: TlsPolicy -> TlsPolicy -> Bool
$c== :: TlsPolicy -> TlsPolicy -> Bool
Prelude.Eq,
      Eq TlsPolicy
Eq TlsPolicy
-> (TlsPolicy -> TlsPolicy -> Ordering)
-> (TlsPolicy -> TlsPolicy -> Bool)
-> (TlsPolicy -> TlsPolicy -> Bool)
-> (TlsPolicy -> TlsPolicy -> Bool)
-> (TlsPolicy -> TlsPolicy -> Bool)
-> (TlsPolicy -> TlsPolicy -> TlsPolicy)
-> (TlsPolicy -> TlsPolicy -> TlsPolicy)
-> Ord TlsPolicy
TlsPolicy -> TlsPolicy -> Bool
TlsPolicy -> TlsPolicy -> Ordering
TlsPolicy -> TlsPolicy -> TlsPolicy
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 :: TlsPolicy -> TlsPolicy -> TlsPolicy
$cmin :: TlsPolicy -> TlsPolicy -> TlsPolicy
max :: TlsPolicy -> TlsPolicy -> TlsPolicy
$cmax :: TlsPolicy -> TlsPolicy -> TlsPolicy
>= :: TlsPolicy -> TlsPolicy -> Bool
$c>= :: TlsPolicy -> TlsPolicy -> Bool
> :: TlsPolicy -> TlsPolicy -> Bool
$c> :: TlsPolicy -> TlsPolicy -> Bool
<= :: TlsPolicy -> TlsPolicy -> Bool
$c<= :: TlsPolicy -> TlsPolicy -> Bool
< :: TlsPolicy -> TlsPolicy -> Bool
$c< :: TlsPolicy -> TlsPolicy -> Bool
compare :: TlsPolicy -> TlsPolicy -> Ordering
$ccompare :: TlsPolicy -> TlsPolicy -> Ordering
$cp1Ord :: Eq TlsPolicy
Prelude.Ord,
      (forall x. TlsPolicy -> Rep TlsPolicy x)
-> (forall x. Rep TlsPolicy x -> TlsPolicy) -> Generic TlsPolicy
forall x. Rep TlsPolicy x -> TlsPolicy
forall x. TlsPolicy -> Rep TlsPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TlsPolicy x -> TlsPolicy
$cfrom :: forall x. TlsPolicy -> Rep TlsPolicy x
Prelude.Generic
    )
  deriving newtype
    ( Int -> TlsPolicy -> Int
TlsPolicy -> Int
(Int -> TlsPolicy -> Int)
-> (TlsPolicy -> Int) -> Hashable TlsPolicy
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: TlsPolicy -> Int
$chash :: TlsPolicy -> Int
hashWithSalt :: Int -> TlsPolicy -> Int
$chashWithSalt :: Int -> TlsPolicy -> Int
Prelude.Hashable,
      TlsPolicy -> ()
(TlsPolicy -> ()) -> NFData TlsPolicy
forall a. (a -> ()) -> NFData a
rnf :: TlsPolicy -> ()
$crnf :: TlsPolicy -> ()
Prelude.NFData,
      Text -> Either String TlsPolicy
(Text -> Either String TlsPolicy) -> FromText TlsPolicy
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String TlsPolicy
$cfromText :: Text -> Either String TlsPolicy
Core.FromText,
      TlsPolicy -> Text
(TlsPolicy -> Text) -> ToText TlsPolicy
forall a. (a -> Text) -> ToText a
toText :: TlsPolicy -> Text
$ctoText :: TlsPolicy -> Text
Core.ToText,
      TlsPolicy -> ByteString
(TlsPolicy -> ByteString) -> ToByteString TlsPolicy
forall a. (a -> ByteString) -> ToByteString a
toBS :: TlsPolicy -> ByteString
$ctoBS :: TlsPolicy -> ByteString
Core.ToByteString,
      TlsPolicy -> ByteStringBuilder
(TlsPolicy -> ByteStringBuilder) -> ToLog TlsPolicy
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: TlsPolicy -> ByteStringBuilder
$cbuild :: TlsPolicy -> ByteStringBuilder
Core.ToLog,
      HeaderName -> TlsPolicy -> [Header]
(HeaderName -> TlsPolicy -> [Header]) -> ToHeader TlsPolicy
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> TlsPolicy -> [Header]
$ctoHeader :: HeaderName -> TlsPolicy -> [Header]
Core.ToHeader,
      TlsPolicy -> QueryString
(TlsPolicy -> QueryString) -> ToQuery TlsPolicy
forall a. (a -> QueryString) -> ToQuery a
toQuery :: TlsPolicy -> QueryString
$ctoQuery :: TlsPolicy -> QueryString
Core.ToQuery,
      Value -> Parser [TlsPolicy]
Value -> Parser TlsPolicy
(Value -> Parser TlsPolicy)
-> (Value -> Parser [TlsPolicy]) -> FromJSON TlsPolicy
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [TlsPolicy]
$cparseJSONList :: Value -> Parser [TlsPolicy]
parseJSON :: Value -> Parser TlsPolicy
$cparseJSON :: Value -> Parser TlsPolicy
Core.FromJSON,
      FromJSONKeyFunction [TlsPolicy]
FromJSONKeyFunction TlsPolicy
FromJSONKeyFunction TlsPolicy
-> FromJSONKeyFunction [TlsPolicy] -> FromJSONKey TlsPolicy
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [TlsPolicy]
$cfromJSONKeyList :: FromJSONKeyFunction [TlsPolicy]
fromJSONKey :: FromJSONKeyFunction TlsPolicy
$cfromJSONKey :: FromJSONKeyFunction TlsPolicy
Core.FromJSONKey,
      [TlsPolicy] -> Encoding
[TlsPolicy] -> Value
TlsPolicy -> Encoding
TlsPolicy -> Value
(TlsPolicy -> Value)
-> (TlsPolicy -> Encoding)
-> ([TlsPolicy] -> Value)
-> ([TlsPolicy] -> Encoding)
-> ToJSON TlsPolicy
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [TlsPolicy] -> Encoding
$ctoEncodingList :: [TlsPolicy] -> Encoding
toJSONList :: [TlsPolicy] -> Value
$ctoJSONList :: [TlsPolicy] -> Value
toEncoding :: TlsPolicy -> Encoding
$ctoEncoding :: TlsPolicy -> Encoding
toJSON :: TlsPolicy -> Value
$ctoJSON :: TlsPolicy -> Value
Core.ToJSON,
      ToJSONKeyFunction [TlsPolicy]
ToJSONKeyFunction TlsPolicy
ToJSONKeyFunction TlsPolicy
-> ToJSONKeyFunction [TlsPolicy] -> ToJSONKey TlsPolicy
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [TlsPolicy]
$ctoJSONKeyList :: ToJSONKeyFunction [TlsPolicy]
toJSONKey :: ToJSONKeyFunction TlsPolicy
$ctoJSONKey :: ToJSONKeyFunction TlsPolicy
Core.ToJSONKey,
      [Node] -> Either String TlsPolicy
([Node] -> Either String TlsPolicy) -> FromXML TlsPolicy
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String TlsPolicy
$cparseXML :: [Node] -> Either String TlsPolicy
Core.FromXML,
      TlsPolicy -> XML
(TlsPolicy -> XML) -> ToXML TlsPolicy
forall a. (a -> XML) -> ToXML a
toXML :: TlsPolicy -> XML
$ctoXML :: TlsPolicy -> XML
Core.ToXML
    )

pattern TlsPolicy_OPTIONAL :: TlsPolicy
pattern $bTlsPolicy_OPTIONAL :: TlsPolicy
$mTlsPolicy_OPTIONAL :: forall r. TlsPolicy -> (Void# -> r) -> (Void# -> r) -> r
TlsPolicy_OPTIONAL = TlsPolicy' "OPTIONAL"

pattern TlsPolicy_REQUIRE :: TlsPolicy
pattern $bTlsPolicy_REQUIRE :: TlsPolicy
$mTlsPolicy_REQUIRE :: forall r. TlsPolicy -> (Void# -> r) -> (Void# -> r) -> r
TlsPolicy_REQUIRE = TlsPolicy' "REQUIRE"

{-# COMPLETE
  TlsPolicy_OPTIONAL,
  TlsPolicy_REQUIRE,
  TlsPolicy'
  #-}