{-# 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.APIGateway.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 Bool
insecureSkipVerification :: Prelude.Maybe Prelude.Bool
}
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 Bool -> TlsConfig
TlsConfig'
{ $sel:insecureSkipVerification:TlsConfig' :: Maybe Bool
insecureSkipVerification =
Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
tlsConfig_insecureSkipVerification :: Lens.Lens' TlsConfig (Prelude.Maybe Prelude.Bool)
tlsConfig_insecureSkipVerification :: (Maybe Bool -> f (Maybe Bool)) -> TlsConfig -> f TlsConfig
tlsConfig_insecureSkipVerification = (TlsConfig -> Maybe Bool)
-> (TlsConfig -> Maybe Bool -> TlsConfig)
-> Lens TlsConfig TlsConfig (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TlsConfig' {Maybe Bool
insecureSkipVerification :: Maybe Bool
$sel:insecureSkipVerification:TlsConfig' :: TlsConfig -> Maybe Bool
insecureSkipVerification} -> Maybe Bool
insecureSkipVerification) (\s :: TlsConfig
s@TlsConfig' {} Maybe Bool
a -> TlsConfig
s {$sel:insecureSkipVerification:TlsConfig' :: Maybe Bool
insecureSkipVerification = Maybe Bool
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 Bool -> TlsConfig
TlsConfig'
(Maybe Bool -> TlsConfig)
-> Parser (Maybe Bool) -> Parser TlsConfig
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"insecureSkipVerification")
)
instance Prelude.Hashable TlsConfig
instance Prelude.NFData TlsConfig
instance Core.ToJSON TlsConfig where
toJSON :: TlsConfig -> Value
toJSON TlsConfig' {Maybe Bool
insecureSkipVerification :: Maybe Bool
$sel:insecureSkipVerification:TlsConfig' :: TlsConfig -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"insecureSkipVerification" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
insecureSkipVerification
]
)