{-# 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.CloudSearch.Types.DomainEndpointOptions where
import Amazonka.CloudSearch.Types.TLSSecurityPolicy
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DomainEndpointOptions = DomainEndpointOptions'
{
DomainEndpointOptions -> Maybe Bool
enforceHTTPS :: Prelude.Maybe Prelude.Bool,
DomainEndpointOptions -> Maybe TLSSecurityPolicy
tLSSecurityPolicy :: Prelude.Maybe TLSSecurityPolicy
}
deriving (DomainEndpointOptions -> DomainEndpointOptions -> Bool
(DomainEndpointOptions -> DomainEndpointOptions -> Bool)
-> (DomainEndpointOptions -> DomainEndpointOptions -> Bool)
-> Eq DomainEndpointOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainEndpointOptions -> DomainEndpointOptions -> Bool
$c/= :: DomainEndpointOptions -> DomainEndpointOptions -> Bool
== :: DomainEndpointOptions -> DomainEndpointOptions -> Bool
$c== :: DomainEndpointOptions -> DomainEndpointOptions -> Bool
Prelude.Eq, ReadPrec [DomainEndpointOptions]
ReadPrec DomainEndpointOptions
Int -> ReadS DomainEndpointOptions
ReadS [DomainEndpointOptions]
(Int -> ReadS DomainEndpointOptions)
-> ReadS [DomainEndpointOptions]
-> ReadPrec DomainEndpointOptions
-> ReadPrec [DomainEndpointOptions]
-> Read DomainEndpointOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainEndpointOptions]
$creadListPrec :: ReadPrec [DomainEndpointOptions]
readPrec :: ReadPrec DomainEndpointOptions
$creadPrec :: ReadPrec DomainEndpointOptions
readList :: ReadS [DomainEndpointOptions]
$creadList :: ReadS [DomainEndpointOptions]
readsPrec :: Int -> ReadS DomainEndpointOptions
$creadsPrec :: Int -> ReadS DomainEndpointOptions
Prelude.Read, Int -> DomainEndpointOptions -> ShowS
[DomainEndpointOptions] -> ShowS
DomainEndpointOptions -> String
(Int -> DomainEndpointOptions -> ShowS)
-> (DomainEndpointOptions -> String)
-> ([DomainEndpointOptions] -> ShowS)
-> Show DomainEndpointOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainEndpointOptions] -> ShowS
$cshowList :: [DomainEndpointOptions] -> ShowS
show :: DomainEndpointOptions -> String
$cshow :: DomainEndpointOptions -> String
showsPrec :: Int -> DomainEndpointOptions -> ShowS
$cshowsPrec :: Int -> DomainEndpointOptions -> ShowS
Prelude.Show, (forall x. DomainEndpointOptions -> Rep DomainEndpointOptions x)
-> (forall x. Rep DomainEndpointOptions x -> DomainEndpointOptions)
-> Generic DomainEndpointOptions
forall x. Rep DomainEndpointOptions x -> DomainEndpointOptions
forall x. DomainEndpointOptions -> Rep DomainEndpointOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DomainEndpointOptions x -> DomainEndpointOptions
$cfrom :: forall x. DomainEndpointOptions -> Rep DomainEndpointOptions x
Prelude.Generic)
newDomainEndpointOptions ::
DomainEndpointOptions
newDomainEndpointOptions :: DomainEndpointOptions
newDomainEndpointOptions =
DomainEndpointOptions' :: Maybe Bool -> Maybe TLSSecurityPolicy -> DomainEndpointOptions
DomainEndpointOptions'
{ $sel:enforceHTTPS:DomainEndpointOptions' :: Maybe Bool
enforceHTTPS =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:tLSSecurityPolicy:DomainEndpointOptions' :: Maybe TLSSecurityPolicy
tLSSecurityPolicy = Maybe TLSSecurityPolicy
forall a. Maybe a
Prelude.Nothing
}
domainEndpointOptions_enforceHTTPS :: Lens.Lens' DomainEndpointOptions (Prelude.Maybe Prelude.Bool)
domainEndpointOptions_enforceHTTPS :: (Maybe Bool -> f (Maybe Bool))
-> DomainEndpointOptions -> f DomainEndpointOptions
domainEndpointOptions_enforceHTTPS = (DomainEndpointOptions -> Maybe Bool)
-> (DomainEndpointOptions -> Maybe Bool -> DomainEndpointOptions)
-> Lens
DomainEndpointOptions
DomainEndpointOptions
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainEndpointOptions' {Maybe Bool
enforceHTTPS :: Maybe Bool
$sel:enforceHTTPS:DomainEndpointOptions' :: DomainEndpointOptions -> Maybe Bool
enforceHTTPS} -> Maybe Bool
enforceHTTPS) (\s :: DomainEndpointOptions
s@DomainEndpointOptions' {} Maybe Bool
a -> DomainEndpointOptions
s {$sel:enforceHTTPS:DomainEndpointOptions' :: Maybe Bool
enforceHTTPS = Maybe Bool
a} :: DomainEndpointOptions)
domainEndpointOptions_tLSSecurityPolicy :: Lens.Lens' DomainEndpointOptions (Prelude.Maybe TLSSecurityPolicy)
domainEndpointOptions_tLSSecurityPolicy :: (Maybe TLSSecurityPolicy -> f (Maybe TLSSecurityPolicy))
-> DomainEndpointOptions -> f DomainEndpointOptions
domainEndpointOptions_tLSSecurityPolicy = (DomainEndpointOptions -> Maybe TLSSecurityPolicy)
-> (DomainEndpointOptions
-> Maybe TLSSecurityPolicy -> DomainEndpointOptions)
-> Lens
DomainEndpointOptions
DomainEndpointOptions
(Maybe TLSSecurityPolicy)
(Maybe TLSSecurityPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainEndpointOptions' {Maybe TLSSecurityPolicy
tLSSecurityPolicy :: Maybe TLSSecurityPolicy
$sel:tLSSecurityPolicy:DomainEndpointOptions' :: DomainEndpointOptions -> Maybe TLSSecurityPolicy
tLSSecurityPolicy} -> Maybe TLSSecurityPolicy
tLSSecurityPolicy) (\s :: DomainEndpointOptions
s@DomainEndpointOptions' {} Maybe TLSSecurityPolicy
a -> DomainEndpointOptions
s {$sel:tLSSecurityPolicy:DomainEndpointOptions' :: Maybe TLSSecurityPolicy
tLSSecurityPolicy = Maybe TLSSecurityPolicy
a} :: DomainEndpointOptions)
instance Core.FromXML DomainEndpointOptions where
parseXML :: [Node] -> Either String DomainEndpointOptions
parseXML [Node]
x =
Maybe Bool -> Maybe TLSSecurityPolicy -> DomainEndpointOptions
DomainEndpointOptions'
(Maybe Bool -> Maybe TLSSecurityPolicy -> DomainEndpointOptions)
-> Either String (Maybe Bool)
-> Either String (Maybe TLSSecurityPolicy -> DomainEndpointOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EnforceHTTPS")
Either String (Maybe TLSSecurityPolicy -> DomainEndpointOptions)
-> Either String (Maybe TLSSecurityPolicy)
-> Either String DomainEndpointOptions
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe TLSSecurityPolicy)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TLSSecurityPolicy")
instance Prelude.Hashable DomainEndpointOptions
instance Prelude.NFData DomainEndpointOptions
instance Core.ToQuery DomainEndpointOptions where
toQuery :: DomainEndpointOptions -> QueryString
toQuery DomainEndpointOptions' {Maybe Bool
Maybe TLSSecurityPolicy
tLSSecurityPolicy :: Maybe TLSSecurityPolicy
enforceHTTPS :: Maybe Bool
$sel:tLSSecurityPolicy:DomainEndpointOptions' :: DomainEndpointOptions -> Maybe TLSSecurityPolicy
$sel:enforceHTTPS:DomainEndpointOptions' :: DomainEndpointOptions -> Maybe Bool
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"EnforceHTTPS" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
enforceHTTPS,
ByteString
"TLSSecurityPolicy" ByteString -> Maybe TLSSecurityPolicy -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe TLSSecurityPolicy
tLSSecurityPolicy
]