{-# 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.EnclaveOptions
-- 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.EnclaveOptions 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

-- | Indicates whether the instance is enabled for Amazon Web Services Nitro
-- Enclaves.
--
-- /See:/ 'newEnclaveOptions' smart constructor.
data EnclaveOptions = EnclaveOptions'
  { -- | If this parameter is set to @true@, the instance is enabled for Amazon
    -- Web Services Nitro Enclaves; otherwise, it is not enabled for Amazon Web
    -- Services Nitro Enclaves.
    EnclaveOptions -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (EnclaveOptions -> EnclaveOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnclaveOptions -> EnclaveOptions -> Bool
$c/= :: EnclaveOptions -> EnclaveOptions -> Bool
== :: EnclaveOptions -> EnclaveOptions -> Bool
$c== :: EnclaveOptions -> EnclaveOptions -> Bool
Prelude.Eq, ReadPrec [EnclaveOptions]
ReadPrec EnclaveOptions
Int -> ReadS EnclaveOptions
ReadS [EnclaveOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnclaveOptions]
$creadListPrec :: ReadPrec [EnclaveOptions]
readPrec :: ReadPrec EnclaveOptions
$creadPrec :: ReadPrec EnclaveOptions
readList :: ReadS [EnclaveOptions]
$creadList :: ReadS [EnclaveOptions]
readsPrec :: Int -> ReadS EnclaveOptions
$creadsPrec :: Int -> ReadS EnclaveOptions
Prelude.Read, Int -> EnclaveOptions -> ShowS
[EnclaveOptions] -> ShowS
EnclaveOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnclaveOptions] -> ShowS
$cshowList :: [EnclaveOptions] -> ShowS
show :: EnclaveOptions -> String
$cshow :: EnclaveOptions -> String
showsPrec :: Int -> EnclaveOptions -> ShowS
$cshowsPrec :: Int -> EnclaveOptions -> ShowS
Prelude.Show, forall x. Rep EnclaveOptions x -> EnclaveOptions
forall x. EnclaveOptions -> Rep EnclaveOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnclaveOptions x -> EnclaveOptions
$cfrom :: forall x. EnclaveOptions -> Rep EnclaveOptions x
Prelude.Generic)

-- |
-- Create a value of 'EnclaveOptions' 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:
--
-- 'enabled', 'enclaveOptions_enabled' - If this parameter is set to @true@, the instance is enabled for Amazon
-- Web Services Nitro Enclaves; otherwise, it is not enabled for Amazon Web
-- Services Nitro Enclaves.
newEnclaveOptions ::
  EnclaveOptions
newEnclaveOptions :: EnclaveOptions
newEnclaveOptions =
  EnclaveOptions' {$sel:enabled:EnclaveOptions' :: Maybe Bool
enabled = forall a. Maybe a
Prelude.Nothing}

-- | If this parameter is set to @true@, the instance is enabled for Amazon
-- Web Services Nitro Enclaves; otherwise, it is not enabled for Amazon Web
-- Services Nitro Enclaves.
enclaveOptions_enabled :: Lens.Lens' EnclaveOptions (Prelude.Maybe Prelude.Bool)
enclaveOptions_enabled :: Lens' EnclaveOptions (Maybe Bool)
enclaveOptions_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnclaveOptions' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:EnclaveOptions' :: EnclaveOptions -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: EnclaveOptions
s@EnclaveOptions' {} Maybe Bool
a -> EnclaveOptions
s {$sel:enabled:EnclaveOptions' :: Maybe Bool
enabled = Maybe Bool
a} :: EnclaveOptions)

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

instance Prelude.Hashable EnclaveOptions where
  hashWithSalt :: Int -> EnclaveOptions -> Int
hashWithSalt Int
_salt EnclaveOptions' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:EnclaveOptions' :: EnclaveOptions -> Maybe Bool
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enabled

instance Prelude.NFData EnclaveOptions where
  rnf :: EnclaveOptions -> ()
rnf EnclaveOptions' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:EnclaveOptions' :: EnclaveOptions -> Maybe Bool
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled