{-# 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.EbsInfo
-- 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.EbsInfo 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 Amazonka.EC2.Types.EbsEncryptionSupport
import Amazonka.EC2.Types.EbsNvmeSupport
import Amazonka.EC2.Types.EbsOptimizedInfo
import Amazonka.EC2.Types.EbsOptimizedSupport
import qualified Amazonka.Prelude as Prelude

-- | Describes the Amazon EBS features supported by the instance type.
--
-- /See:/ 'newEbsInfo' smart constructor.
data EbsInfo = EbsInfo'
  { -- | Describes the optimized EBS performance for the instance type.
    EbsInfo -> Maybe EbsOptimizedInfo
ebsOptimizedInfo :: Prelude.Maybe EbsOptimizedInfo,
    -- | Indicates whether the instance type is Amazon EBS-optimized. For more
    -- information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html Amazon EBS-optimized instances>
    -- in /Amazon EC2 User Guide/.
    EbsInfo -> Maybe EbsOptimizedSupport
ebsOptimizedSupport :: Prelude.Maybe EbsOptimizedSupport,
    -- | Indicates whether Amazon EBS encryption is supported.
    EbsInfo -> Maybe EbsEncryptionSupport
encryptionSupport :: Prelude.Maybe EbsEncryptionSupport,
    -- | Indicates whether non-volatile memory express (NVMe) is supported.
    EbsInfo -> Maybe EbsNvmeSupport
nvmeSupport :: Prelude.Maybe EbsNvmeSupport
  }
  deriving (EbsInfo -> EbsInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EbsInfo -> EbsInfo -> Bool
$c/= :: EbsInfo -> EbsInfo -> Bool
== :: EbsInfo -> EbsInfo -> Bool
$c== :: EbsInfo -> EbsInfo -> Bool
Prelude.Eq, ReadPrec [EbsInfo]
ReadPrec EbsInfo
Int -> ReadS EbsInfo
ReadS [EbsInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EbsInfo]
$creadListPrec :: ReadPrec [EbsInfo]
readPrec :: ReadPrec EbsInfo
$creadPrec :: ReadPrec EbsInfo
readList :: ReadS [EbsInfo]
$creadList :: ReadS [EbsInfo]
readsPrec :: Int -> ReadS EbsInfo
$creadsPrec :: Int -> ReadS EbsInfo
Prelude.Read, Int -> EbsInfo -> ShowS
[EbsInfo] -> ShowS
EbsInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EbsInfo] -> ShowS
$cshowList :: [EbsInfo] -> ShowS
show :: EbsInfo -> String
$cshow :: EbsInfo -> String
showsPrec :: Int -> EbsInfo -> ShowS
$cshowsPrec :: Int -> EbsInfo -> ShowS
Prelude.Show, forall x. Rep EbsInfo x -> EbsInfo
forall x. EbsInfo -> Rep EbsInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EbsInfo x -> EbsInfo
$cfrom :: forall x. EbsInfo -> Rep EbsInfo x
Prelude.Generic)

-- |
-- Create a value of 'EbsInfo' 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:
--
-- 'ebsOptimizedInfo', 'ebsInfo_ebsOptimizedInfo' - Describes the optimized EBS performance for the instance type.
--
-- 'ebsOptimizedSupport', 'ebsInfo_ebsOptimizedSupport' - Indicates whether the instance type is Amazon EBS-optimized. For more
-- information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html Amazon EBS-optimized instances>
-- in /Amazon EC2 User Guide/.
--
-- 'encryptionSupport', 'ebsInfo_encryptionSupport' - Indicates whether Amazon EBS encryption is supported.
--
-- 'nvmeSupport', 'ebsInfo_nvmeSupport' - Indicates whether non-volatile memory express (NVMe) is supported.
newEbsInfo ::
  EbsInfo
newEbsInfo :: EbsInfo
newEbsInfo =
  EbsInfo'
    { $sel:ebsOptimizedInfo:EbsInfo' :: Maybe EbsOptimizedInfo
ebsOptimizedInfo = forall a. Maybe a
Prelude.Nothing,
      $sel:ebsOptimizedSupport:EbsInfo' :: Maybe EbsOptimizedSupport
ebsOptimizedSupport = forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionSupport:EbsInfo' :: Maybe EbsEncryptionSupport
encryptionSupport = forall a. Maybe a
Prelude.Nothing,
      $sel:nvmeSupport:EbsInfo' :: Maybe EbsNvmeSupport
nvmeSupport = forall a. Maybe a
Prelude.Nothing
    }

-- | Describes the optimized EBS performance for the instance type.
ebsInfo_ebsOptimizedInfo :: Lens.Lens' EbsInfo (Prelude.Maybe EbsOptimizedInfo)
ebsInfo_ebsOptimizedInfo :: Lens' EbsInfo (Maybe EbsOptimizedInfo)
ebsInfo_ebsOptimizedInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsInfo' {Maybe EbsOptimizedInfo
ebsOptimizedInfo :: Maybe EbsOptimizedInfo
$sel:ebsOptimizedInfo:EbsInfo' :: EbsInfo -> Maybe EbsOptimizedInfo
ebsOptimizedInfo} -> Maybe EbsOptimizedInfo
ebsOptimizedInfo) (\s :: EbsInfo
s@EbsInfo' {} Maybe EbsOptimizedInfo
a -> EbsInfo
s {$sel:ebsOptimizedInfo:EbsInfo' :: Maybe EbsOptimizedInfo
ebsOptimizedInfo = Maybe EbsOptimizedInfo
a} :: EbsInfo)

-- | Indicates whether the instance type is Amazon EBS-optimized. For more
-- information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html Amazon EBS-optimized instances>
-- in /Amazon EC2 User Guide/.
ebsInfo_ebsOptimizedSupport :: Lens.Lens' EbsInfo (Prelude.Maybe EbsOptimizedSupport)
ebsInfo_ebsOptimizedSupport :: Lens' EbsInfo (Maybe EbsOptimizedSupport)
ebsInfo_ebsOptimizedSupport = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsInfo' {Maybe EbsOptimizedSupport
ebsOptimizedSupport :: Maybe EbsOptimizedSupport
$sel:ebsOptimizedSupport:EbsInfo' :: EbsInfo -> Maybe EbsOptimizedSupport
ebsOptimizedSupport} -> Maybe EbsOptimizedSupport
ebsOptimizedSupport) (\s :: EbsInfo
s@EbsInfo' {} Maybe EbsOptimizedSupport
a -> EbsInfo
s {$sel:ebsOptimizedSupport:EbsInfo' :: Maybe EbsOptimizedSupport
ebsOptimizedSupport = Maybe EbsOptimizedSupport
a} :: EbsInfo)

-- | Indicates whether Amazon EBS encryption is supported.
ebsInfo_encryptionSupport :: Lens.Lens' EbsInfo (Prelude.Maybe EbsEncryptionSupport)
ebsInfo_encryptionSupport :: Lens' EbsInfo (Maybe EbsEncryptionSupport)
ebsInfo_encryptionSupport = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsInfo' {Maybe EbsEncryptionSupport
encryptionSupport :: Maybe EbsEncryptionSupport
$sel:encryptionSupport:EbsInfo' :: EbsInfo -> Maybe EbsEncryptionSupport
encryptionSupport} -> Maybe EbsEncryptionSupport
encryptionSupport) (\s :: EbsInfo
s@EbsInfo' {} Maybe EbsEncryptionSupport
a -> EbsInfo
s {$sel:encryptionSupport:EbsInfo' :: Maybe EbsEncryptionSupport
encryptionSupport = Maybe EbsEncryptionSupport
a} :: EbsInfo)

-- | Indicates whether non-volatile memory express (NVMe) is supported.
ebsInfo_nvmeSupport :: Lens.Lens' EbsInfo (Prelude.Maybe EbsNvmeSupport)
ebsInfo_nvmeSupport :: Lens' EbsInfo (Maybe EbsNvmeSupport)
ebsInfo_nvmeSupport = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EbsInfo' {Maybe EbsNvmeSupport
nvmeSupport :: Maybe EbsNvmeSupport
$sel:nvmeSupport:EbsInfo' :: EbsInfo -> Maybe EbsNvmeSupport
nvmeSupport} -> Maybe EbsNvmeSupport
nvmeSupport) (\s :: EbsInfo
s@EbsInfo' {} Maybe EbsNvmeSupport
a -> EbsInfo
s {$sel:nvmeSupport:EbsInfo' :: Maybe EbsNvmeSupport
nvmeSupport = Maybe EbsNvmeSupport
a} :: EbsInfo)

instance Data.FromXML EbsInfo where
  parseXML :: [Node] -> Either String EbsInfo
parseXML [Node]
x =
    Maybe EbsOptimizedInfo
-> Maybe EbsOptimizedSupport
-> Maybe EbsEncryptionSupport
-> Maybe EbsNvmeSupport
-> EbsInfo
EbsInfo'
      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
"ebsOptimizedInfo")
      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
"ebsOptimizedSupport")
      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
"encryptionSupport")
      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
"nvmeSupport")

instance Prelude.Hashable EbsInfo where
  hashWithSalt :: Int -> EbsInfo -> Int
hashWithSalt Int
_salt EbsInfo' {Maybe EbsEncryptionSupport
Maybe EbsNvmeSupport
Maybe EbsOptimizedInfo
Maybe EbsOptimizedSupport
nvmeSupport :: Maybe EbsNvmeSupport
encryptionSupport :: Maybe EbsEncryptionSupport
ebsOptimizedSupport :: Maybe EbsOptimizedSupport
ebsOptimizedInfo :: Maybe EbsOptimizedInfo
$sel:nvmeSupport:EbsInfo' :: EbsInfo -> Maybe EbsNvmeSupport
$sel:encryptionSupport:EbsInfo' :: EbsInfo -> Maybe EbsEncryptionSupport
$sel:ebsOptimizedSupport:EbsInfo' :: EbsInfo -> Maybe EbsOptimizedSupport
$sel:ebsOptimizedInfo:EbsInfo' :: EbsInfo -> Maybe EbsOptimizedInfo
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EbsOptimizedInfo
ebsOptimizedInfo
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EbsOptimizedSupport
ebsOptimizedSupport
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EbsEncryptionSupport
encryptionSupport
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EbsNvmeSupport
nvmeSupport

instance Prelude.NFData EbsInfo where
  rnf :: EbsInfo -> ()
rnf EbsInfo' {Maybe EbsEncryptionSupport
Maybe EbsNvmeSupport
Maybe EbsOptimizedInfo
Maybe EbsOptimizedSupport
nvmeSupport :: Maybe EbsNvmeSupport
encryptionSupport :: Maybe EbsEncryptionSupport
ebsOptimizedSupport :: Maybe EbsOptimizedSupport
ebsOptimizedInfo :: Maybe EbsOptimizedInfo
$sel:nvmeSupport:EbsInfo' :: EbsInfo -> Maybe EbsNvmeSupport
$sel:encryptionSupport:EbsInfo' :: EbsInfo -> Maybe EbsEncryptionSupport
$sel:ebsOptimizedSupport:EbsInfo' :: EbsInfo -> Maybe EbsOptimizedSupport
$sel:ebsOptimizedInfo:EbsInfo' :: EbsInfo -> Maybe EbsOptimizedInfo
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe EbsOptimizedInfo
ebsOptimizedInfo
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EbsOptimizedSupport
ebsOptimizedSupport
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EbsEncryptionSupport
encryptionSupport
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EbsNvmeSupport
nvmeSupport