{-# 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.EC2.Types.Phase1EncryptionAlgorithmsListValue
-- 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.EC2.Types.Phase1EncryptionAlgorithmsListValue where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude

-- | The encryption algorithm for phase 1 IKE negotiations.
--
-- /See:/ 'newPhase1EncryptionAlgorithmsListValue' smart constructor.
data Phase1EncryptionAlgorithmsListValue = Phase1EncryptionAlgorithmsListValue'
  { -- | The value for the encryption algorithm.
    Phase1EncryptionAlgorithmsListValue -> Maybe Text
value :: Prelude.Maybe Prelude.Text
  }
  deriving (Phase1EncryptionAlgorithmsListValue
-> Phase1EncryptionAlgorithmsListValue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Phase1EncryptionAlgorithmsListValue
-> Phase1EncryptionAlgorithmsListValue -> Bool
$c/= :: Phase1EncryptionAlgorithmsListValue
-> Phase1EncryptionAlgorithmsListValue -> Bool
== :: Phase1EncryptionAlgorithmsListValue
-> Phase1EncryptionAlgorithmsListValue -> Bool
$c== :: Phase1EncryptionAlgorithmsListValue
-> Phase1EncryptionAlgorithmsListValue -> Bool
Prelude.Eq, ReadPrec [Phase1EncryptionAlgorithmsListValue]
ReadPrec Phase1EncryptionAlgorithmsListValue
Int -> ReadS Phase1EncryptionAlgorithmsListValue
ReadS [Phase1EncryptionAlgorithmsListValue]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Phase1EncryptionAlgorithmsListValue]
$creadListPrec :: ReadPrec [Phase1EncryptionAlgorithmsListValue]
readPrec :: ReadPrec Phase1EncryptionAlgorithmsListValue
$creadPrec :: ReadPrec Phase1EncryptionAlgorithmsListValue
readList :: ReadS [Phase1EncryptionAlgorithmsListValue]
$creadList :: ReadS [Phase1EncryptionAlgorithmsListValue]
readsPrec :: Int -> ReadS Phase1EncryptionAlgorithmsListValue
$creadsPrec :: Int -> ReadS Phase1EncryptionAlgorithmsListValue
Prelude.Read, Int -> Phase1EncryptionAlgorithmsListValue -> ShowS
[Phase1EncryptionAlgorithmsListValue] -> ShowS
Phase1EncryptionAlgorithmsListValue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Phase1EncryptionAlgorithmsListValue] -> ShowS
$cshowList :: [Phase1EncryptionAlgorithmsListValue] -> ShowS
show :: Phase1EncryptionAlgorithmsListValue -> String
$cshow :: Phase1EncryptionAlgorithmsListValue -> String
showsPrec :: Int -> Phase1EncryptionAlgorithmsListValue -> ShowS
$cshowsPrec :: Int -> Phase1EncryptionAlgorithmsListValue -> ShowS
Prelude.Show, forall x.
Rep Phase1EncryptionAlgorithmsListValue x
-> Phase1EncryptionAlgorithmsListValue
forall x.
Phase1EncryptionAlgorithmsListValue
-> Rep Phase1EncryptionAlgorithmsListValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep Phase1EncryptionAlgorithmsListValue x
-> Phase1EncryptionAlgorithmsListValue
$cfrom :: forall x.
Phase1EncryptionAlgorithmsListValue
-> Rep Phase1EncryptionAlgorithmsListValue x
Prelude.Generic)

-- |
-- Create a value of 'Phase1EncryptionAlgorithmsListValue' 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:
--
-- 'value', 'phase1EncryptionAlgorithmsListValue_value' - The value for the encryption algorithm.
newPhase1EncryptionAlgorithmsListValue ::
  Phase1EncryptionAlgorithmsListValue
newPhase1EncryptionAlgorithmsListValue :: Phase1EncryptionAlgorithmsListValue
newPhase1EncryptionAlgorithmsListValue =
  Phase1EncryptionAlgorithmsListValue'
    { $sel:value:Phase1EncryptionAlgorithmsListValue' :: Maybe Text
value =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The value for the encryption algorithm.
phase1EncryptionAlgorithmsListValue_value :: Lens.Lens' Phase1EncryptionAlgorithmsListValue (Prelude.Maybe Prelude.Text)
phase1EncryptionAlgorithmsListValue_value :: Lens' Phase1EncryptionAlgorithmsListValue (Maybe Text)
phase1EncryptionAlgorithmsListValue_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Phase1EncryptionAlgorithmsListValue' {Maybe Text
value :: Maybe Text
$sel:value:Phase1EncryptionAlgorithmsListValue' :: Phase1EncryptionAlgorithmsListValue -> Maybe Text
value} -> Maybe Text
value) (\s :: Phase1EncryptionAlgorithmsListValue
s@Phase1EncryptionAlgorithmsListValue' {} Maybe Text
a -> Phase1EncryptionAlgorithmsListValue
s {$sel:value:Phase1EncryptionAlgorithmsListValue' :: Maybe Text
value = Maybe Text
a} :: Phase1EncryptionAlgorithmsListValue)

instance
  Data.FromXML
    Phase1EncryptionAlgorithmsListValue
  where
  parseXML :: [Node] -> Either String Phase1EncryptionAlgorithmsListValue
parseXML [Node]
x =
    Maybe Text -> Phase1EncryptionAlgorithmsListValue
Phase1EncryptionAlgorithmsListValue'
      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
"value")

instance
  Prelude.Hashable
    Phase1EncryptionAlgorithmsListValue
  where
  hashWithSalt :: Int -> Phase1EncryptionAlgorithmsListValue -> Int
hashWithSalt
    Int
_salt
    Phase1EncryptionAlgorithmsListValue' {Maybe Text
value :: Maybe Text
$sel:value:Phase1EncryptionAlgorithmsListValue' :: Phase1EncryptionAlgorithmsListValue -> Maybe Text
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
value

instance
  Prelude.NFData
    Phase1EncryptionAlgorithmsListValue
  where
  rnf :: Phase1EncryptionAlgorithmsListValue -> ()
rnf Phase1EncryptionAlgorithmsListValue' {Maybe Text
value :: Maybe Text
$sel:value:Phase1EncryptionAlgorithmsListValue' :: Phase1EncryptionAlgorithmsListValue -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
value