{-# 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.OpsWorks.Types.SslConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SslConfiguration = SslConfiguration'
{
SslConfiguration -> Maybe Text
privateKey :: Prelude.Maybe Prelude.Text,
SslConfiguration -> Maybe Text
certificate :: Prelude.Maybe Prelude.Text,
SslConfiguration -> Maybe Text
chain :: Prelude.Maybe Prelude.Text
}
deriving (SslConfiguration -> SslConfiguration -> Bool
(SslConfiguration -> SslConfiguration -> Bool)
-> (SslConfiguration -> SslConfiguration -> Bool)
-> Eq SslConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SslConfiguration -> SslConfiguration -> Bool
$c/= :: SslConfiguration -> SslConfiguration -> Bool
== :: SslConfiguration -> SslConfiguration -> Bool
$c== :: SslConfiguration -> SslConfiguration -> Bool
Prelude.Eq, ReadPrec [SslConfiguration]
ReadPrec SslConfiguration
Int -> ReadS SslConfiguration
ReadS [SslConfiguration]
(Int -> ReadS SslConfiguration)
-> ReadS [SslConfiguration]
-> ReadPrec SslConfiguration
-> ReadPrec [SslConfiguration]
-> Read SslConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SslConfiguration]
$creadListPrec :: ReadPrec [SslConfiguration]
readPrec :: ReadPrec SslConfiguration
$creadPrec :: ReadPrec SslConfiguration
readList :: ReadS [SslConfiguration]
$creadList :: ReadS [SslConfiguration]
readsPrec :: Int -> ReadS SslConfiguration
$creadsPrec :: Int -> ReadS SslConfiguration
Prelude.Read, Int -> SslConfiguration -> ShowS
[SslConfiguration] -> ShowS
SslConfiguration -> String
(Int -> SslConfiguration -> ShowS)
-> (SslConfiguration -> String)
-> ([SslConfiguration] -> ShowS)
-> Show SslConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SslConfiguration] -> ShowS
$cshowList :: [SslConfiguration] -> ShowS
show :: SslConfiguration -> String
$cshow :: SslConfiguration -> String
showsPrec :: Int -> SslConfiguration -> ShowS
$cshowsPrec :: Int -> SslConfiguration -> ShowS
Prelude.Show, (forall x. SslConfiguration -> Rep SslConfiguration x)
-> (forall x. Rep SslConfiguration x -> SslConfiguration)
-> Generic SslConfiguration
forall x. Rep SslConfiguration x -> SslConfiguration
forall x. SslConfiguration -> Rep SslConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SslConfiguration x -> SslConfiguration
$cfrom :: forall x. SslConfiguration -> Rep SslConfiguration x
Prelude.Generic)
newSslConfiguration ::
SslConfiguration
newSslConfiguration :: SslConfiguration
newSslConfiguration =
SslConfiguration' :: Maybe Text -> Maybe Text -> Maybe Text -> SslConfiguration
SslConfiguration'
{ $sel:privateKey:SslConfiguration' :: Maybe Text
privateKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:certificate:SslConfiguration' :: Maybe Text
certificate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:chain:SslConfiguration' :: Maybe Text
chain = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
sslConfiguration_privateKey :: Lens.Lens' SslConfiguration (Prelude.Maybe Prelude.Text)
sslConfiguration_privateKey :: (Maybe Text -> f (Maybe Text))
-> SslConfiguration -> f SslConfiguration
sslConfiguration_privateKey = (SslConfiguration -> Maybe Text)
-> (SslConfiguration -> Maybe Text -> SslConfiguration)
-> Lens SslConfiguration SslConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SslConfiguration' {Maybe Text
privateKey :: Maybe Text
$sel:privateKey:SslConfiguration' :: SslConfiguration -> Maybe Text
privateKey} -> Maybe Text
privateKey) (\s :: SslConfiguration
s@SslConfiguration' {} Maybe Text
a -> SslConfiguration
s {$sel:privateKey:SslConfiguration' :: Maybe Text
privateKey = Maybe Text
a} :: SslConfiguration)
sslConfiguration_certificate :: Lens.Lens' SslConfiguration (Prelude.Maybe Prelude.Text)
sslConfiguration_certificate :: (Maybe Text -> f (Maybe Text))
-> SslConfiguration -> f SslConfiguration
sslConfiguration_certificate = (SslConfiguration -> Maybe Text)
-> (SslConfiguration -> Maybe Text -> SslConfiguration)
-> Lens SslConfiguration SslConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SslConfiguration' {Maybe Text
certificate :: Maybe Text
$sel:certificate:SslConfiguration' :: SslConfiguration -> Maybe Text
certificate} -> Maybe Text
certificate) (\s :: SslConfiguration
s@SslConfiguration' {} Maybe Text
a -> SslConfiguration
s {$sel:certificate:SslConfiguration' :: Maybe Text
certificate = Maybe Text
a} :: SslConfiguration)
sslConfiguration_chain :: Lens.Lens' SslConfiguration (Prelude.Maybe Prelude.Text)
sslConfiguration_chain :: (Maybe Text -> f (Maybe Text))
-> SslConfiguration -> f SslConfiguration
sslConfiguration_chain = (SslConfiguration -> Maybe Text)
-> (SslConfiguration -> Maybe Text -> SslConfiguration)
-> Lens SslConfiguration SslConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SslConfiguration' {Maybe Text
chain :: Maybe Text
$sel:chain:SslConfiguration' :: SslConfiguration -> Maybe Text
chain} -> Maybe Text
chain) (\s :: SslConfiguration
s@SslConfiguration' {} Maybe Text
a -> SslConfiguration
s {$sel:chain:SslConfiguration' :: Maybe Text
chain = Maybe Text
a} :: SslConfiguration)
instance Core.FromJSON SslConfiguration where
parseJSON :: Value -> Parser SslConfiguration
parseJSON =
String
-> (Object -> Parser SslConfiguration)
-> Value
-> Parser SslConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SslConfiguration"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> SslConfiguration
SslConfiguration'
(Maybe Text -> Maybe Text -> Maybe Text -> SslConfiguration)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> SslConfiguration)
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
"PrivateKey")
Parser (Maybe Text -> Maybe Text -> SslConfiguration)
-> Parser (Maybe Text) -> Parser (Maybe Text -> SslConfiguration)
forall (f :: * -> *) a b. Applicative f => 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
"Certificate")
Parser (Maybe Text -> SslConfiguration)
-> Parser (Maybe Text) -> Parser SslConfiguration
forall (f :: * -> *) a b. Applicative f => 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
"Chain")
)
instance Prelude.Hashable SslConfiguration
instance Prelude.NFData SslConfiguration
instance Core.ToJSON SslConfiguration where
toJSON :: SslConfiguration -> Value
toJSON SslConfiguration' {Maybe Text
chain :: Maybe Text
certificate :: Maybe Text
privateKey :: Maybe Text
$sel:chain:SslConfiguration' :: SslConfiguration -> Maybe Text
$sel:certificate:SslConfiguration' :: SslConfiguration -> Maybe Text
$sel:privateKey:SslConfiguration' :: SslConfiguration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"PrivateKey" 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
privateKey,
(Text
"Certificate" 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
certificate,
(Text
"Chain" 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
chain
]
)