{-# 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.IoT.Types.TlsContext where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TlsContext = TlsContext'
{
TlsContext -> Maybe Text
serverName :: Prelude.Maybe Prelude.Text
}
deriving (TlsContext -> TlsContext -> Bool
(TlsContext -> TlsContext -> Bool)
-> (TlsContext -> TlsContext -> Bool) -> Eq TlsContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TlsContext -> TlsContext -> Bool
$c/= :: TlsContext -> TlsContext -> Bool
== :: TlsContext -> TlsContext -> Bool
$c== :: TlsContext -> TlsContext -> Bool
Prelude.Eq, ReadPrec [TlsContext]
ReadPrec TlsContext
Int -> ReadS TlsContext
ReadS [TlsContext]
(Int -> ReadS TlsContext)
-> ReadS [TlsContext]
-> ReadPrec TlsContext
-> ReadPrec [TlsContext]
-> Read TlsContext
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TlsContext]
$creadListPrec :: ReadPrec [TlsContext]
readPrec :: ReadPrec TlsContext
$creadPrec :: ReadPrec TlsContext
readList :: ReadS [TlsContext]
$creadList :: ReadS [TlsContext]
readsPrec :: Int -> ReadS TlsContext
$creadsPrec :: Int -> ReadS TlsContext
Prelude.Read, Int -> TlsContext -> ShowS
[TlsContext] -> ShowS
TlsContext -> String
(Int -> TlsContext -> ShowS)
-> (TlsContext -> String)
-> ([TlsContext] -> ShowS)
-> Show TlsContext
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TlsContext] -> ShowS
$cshowList :: [TlsContext] -> ShowS
show :: TlsContext -> String
$cshow :: TlsContext -> String
showsPrec :: Int -> TlsContext -> ShowS
$cshowsPrec :: Int -> TlsContext -> ShowS
Prelude.Show, (forall x. TlsContext -> Rep TlsContext x)
-> (forall x. Rep TlsContext x -> TlsContext) -> Generic TlsContext
forall x. Rep TlsContext x -> TlsContext
forall x. TlsContext -> Rep TlsContext x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TlsContext x -> TlsContext
$cfrom :: forall x. TlsContext -> Rep TlsContext x
Prelude.Generic)
newTlsContext ::
TlsContext
newTlsContext :: TlsContext
newTlsContext =
TlsContext' :: Maybe Text -> TlsContext
TlsContext' {$sel:serverName:TlsContext' :: Maybe Text
serverName = Maybe Text
forall a. Maybe a
Prelude.Nothing}
tlsContext_serverName :: Lens.Lens' TlsContext (Prelude.Maybe Prelude.Text)
tlsContext_serverName :: (Maybe Text -> f (Maybe Text)) -> TlsContext -> f TlsContext
tlsContext_serverName = (TlsContext -> Maybe Text)
-> (TlsContext -> Maybe Text -> TlsContext)
-> Lens TlsContext TlsContext (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TlsContext' {Maybe Text
serverName :: Maybe Text
$sel:serverName:TlsContext' :: TlsContext -> Maybe Text
serverName} -> Maybe Text
serverName) (\s :: TlsContext
s@TlsContext' {} Maybe Text
a -> TlsContext
s {$sel:serverName:TlsContext' :: Maybe Text
serverName = Maybe Text
a} :: TlsContext)
instance Prelude.Hashable TlsContext
instance Prelude.NFData TlsContext
instance Core.ToJSON TlsContext where
toJSON :: TlsContext -> Value
toJSON TlsContext' {Maybe Text
serverName :: Maybe Text
$sel:serverName:TlsContext' :: TlsContext -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"serverName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
serverName]
)