{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ELBV2.Types.SslPolicy
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ELBV2.Types.SslPolicy where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ELBV2.Types.Cipher
import qualified Amazonka.Prelude as Prelude

-- | Information about a policy used for SSL negotiation.
--
-- /See:/ 'newSslPolicy' smart constructor.
data SslPolicy = SslPolicy'
  { -- | The ciphers.
    SslPolicy -> Maybe [Cipher]
ciphers :: Prelude.Maybe [Cipher],
    -- | The name of the policy.
    SslPolicy -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The protocols.
    SslPolicy -> Maybe [Text]
sslProtocols :: Prelude.Maybe [Prelude.Text],
    -- | The supported load balancers.
    SslPolicy -> Maybe [Text]
supportedLoadBalancerTypes :: Prelude.Maybe [Prelude.Text]
  }
  deriving (SslPolicy -> SslPolicy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SslPolicy -> SslPolicy -> Bool
$c/= :: SslPolicy -> SslPolicy -> Bool
== :: SslPolicy -> SslPolicy -> Bool
$c== :: SslPolicy -> SslPolicy -> Bool
Prelude.Eq, ReadPrec [SslPolicy]
ReadPrec SslPolicy
Int -> ReadS SslPolicy
ReadS [SslPolicy]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SslPolicy]
$creadListPrec :: ReadPrec [SslPolicy]
readPrec :: ReadPrec SslPolicy
$creadPrec :: ReadPrec SslPolicy
readList :: ReadS [SslPolicy]
$creadList :: ReadS [SslPolicy]
readsPrec :: Int -> ReadS SslPolicy
$creadsPrec :: Int -> ReadS SslPolicy
Prelude.Read, Int -> SslPolicy -> ShowS
[SslPolicy] -> ShowS
SslPolicy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SslPolicy] -> ShowS
$cshowList :: [SslPolicy] -> ShowS
show :: SslPolicy -> String
$cshow :: SslPolicy -> String
showsPrec :: Int -> SslPolicy -> ShowS
$cshowsPrec :: Int -> SslPolicy -> ShowS
Prelude.Show, forall x. Rep SslPolicy x -> SslPolicy
forall x. SslPolicy -> Rep SslPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SslPolicy x -> SslPolicy
$cfrom :: forall x. SslPolicy -> Rep SslPolicy x
Prelude.Generic)

-- |
-- Create a value of 'SslPolicy' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'ciphers', 'sslPolicy_ciphers' - The ciphers.
--
-- 'name', 'sslPolicy_name' - The name of the policy.
--
-- 'sslProtocols', 'sslPolicy_sslProtocols' - The protocols.
--
-- 'supportedLoadBalancerTypes', 'sslPolicy_supportedLoadBalancerTypes' - The supported load balancers.
newSslPolicy ::
  SslPolicy
newSslPolicy :: SslPolicy
newSslPolicy =
  SslPolicy'
    { $sel:ciphers:SslPolicy' :: Maybe [Cipher]
ciphers = forall a. Maybe a
Prelude.Nothing,
      $sel:name:SslPolicy' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:sslProtocols:SslPolicy' :: Maybe [Text]
sslProtocols = forall a. Maybe a
Prelude.Nothing,
      $sel:supportedLoadBalancerTypes:SslPolicy' :: Maybe [Text]
supportedLoadBalancerTypes = forall a. Maybe a
Prelude.Nothing
    }

-- | The ciphers.
sslPolicy_ciphers :: Lens.Lens' SslPolicy (Prelude.Maybe [Cipher])
sslPolicy_ciphers :: Lens' SslPolicy (Maybe [Cipher])
sslPolicy_ciphers = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SslPolicy' {Maybe [Cipher]
ciphers :: Maybe [Cipher]
$sel:ciphers:SslPolicy' :: SslPolicy -> Maybe [Cipher]
ciphers} -> Maybe [Cipher]
ciphers) (\s :: SslPolicy
s@SslPolicy' {} Maybe [Cipher]
a -> SslPolicy
s {$sel:ciphers:SslPolicy' :: Maybe [Cipher]
ciphers = Maybe [Cipher]
a} :: SslPolicy) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the policy.
sslPolicy_name :: Lens.Lens' SslPolicy (Prelude.Maybe Prelude.Text)
sslPolicy_name :: Lens' SslPolicy (Maybe Text)
sslPolicy_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SslPolicy' {Maybe Text
name :: Maybe Text
$sel:name:SslPolicy' :: SslPolicy -> Maybe Text
name} -> Maybe Text
name) (\s :: SslPolicy
s@SslPolicy' {} Maybe Text
a -> SslPolicy
s {$sel:name:SslPolicy' :: Maybe Text
name = Maybe Text
a} :: SslPolicy)

-- | The protocols.
sslPolicy_sslProtocols :: Lens.Lens' SslPolicy (Prelude.Maybe [Prelude.Text])
sslPolicy_sslProtocols :: Lens' SslPolicy (Maybe [Text])
sslPolicy_sslProtocols = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SslPolicy' {Maybe [Text]
sslProtocols :: Maybe [Text]
$sel:sslProtocols:SslPolicy' :: SslPolicy -> Maybe [Text]
sslProtocols} -> Maybe [Text]
sslProtocols) (\s :: SslPolicy
s@SslPolicy' {} Maybe [Text]
a -> SslPolicy
s {$sel:sslProtocols:SslPolicy' :: Maybe [Text]
sslProtocols = Maybe [Text]
a} :: SslPolicy) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The supported load balancers.
sslPolicy_supportedLoadBalancerTypes :: Lens.Lens' SslPolicy (Prelude.Maybe [Prelude.Text])
sslPolicy_supportedLoadBalancerTypes :: Lens' SslPolicy (Maybe [Text])
sslPolicy_supportedLoadBalancerTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SslPolicy' {Maybe [Text]
supportedLoadBalancerTypes :: Maybe [Text]
$sel:supportedLoadBalancerTypes:SslPolicy' :: SslPolicy -> Maybe [Text]
supportedLoadBalancerTypes} -> Maybe [Text]
supportedLoadBalancerTypes) (\s :: SslPolicy
s@SslPolicy' {} Maybe [Text]
a -> SslPolicy
s {$sel:supportedLoadBalancerTypes:SslPolicy' :: Maybe [Text]
supportedLoadBalancerTypes = Maybe [Text]
a} :: SslPolicy) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromXML SslPolicy where
  parseXML :: [Node] -> Either String SslPolicy
parseXML [Node]
x =
    Maybe [Cipher]
-> Maybe Text -> Maybe [Text] -> Maybe [Text] -> SslPolicy
SslPolicy'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Ciphers"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Name")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"SslProtocols"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"SupportedLoadBalancerTypes"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
                  )

instance Prelude.Hashable SslPolicy where
  hashWithSalt :: Int -> SslPolicy -> Int
hashWithSalt Int
_salt SslPolicy' {Maybe [Text]
Maybe [Cipher]
Maybe Text
supportedLoadBalancerTypes :: Maybe [Text]
sslProtocols :: Maybe [Text]
name :: Maybe Text
ciphers :: Maybe [Cipher]
$sel:supportedLoadBalancerTypes:SslPolicy' :: SslPolicy -> Maybe [Text]
$sel:sslProtocols:SslPolicy' :: SslPolicy -> Maybe [Text]
$sel:name:SslPolicy' :: SslPolicy -> Maybe Text
$sel:ciphers:SslPolicy' :: SslPolicy -> Maybe [Cipher]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Cipher]
ciphers
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
sslProtocols
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
supportedLoadBalancerTypes

instance Prelude.NFData SslPolicy where
  rnf :: SslPolicy -> ()
rnf SslPolicy' {Maybe [Text]
Maybe [Cipher]
Maybe Text
supportedLoadBalancerTypes :: Maybe [Text]
sslProtocols :: Maybe [Text]
name :: Maybe Text
ciphers :: Maybe [Cipher]
$sel:supportedLoadBalancerTypes:SslPolicy' :: SslPolicy -> Maybe [Text]
$sel:sslProtocols:SslPolicy' :: SslPolicy -> Maybe [Text]
$sel:name:SslPolicy' :: SslPolicy -> Maybe Text
$sel:ciphers:SslPolicy' :: SslPolicy -> Maybe [Cipher]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Cipher]
ciphers
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
sslProtocols
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
supportedLoadBalancerTypes