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