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

-- | Describes the Elastic Fabric Adapters for the instance type.
--
-- /See:/ 'newEfaInfo' smart constructor.
data EfaInfo = EfaInfo'
  { -- | The maximum number of Elastic Fabric Adapters for the instance type.
    EfaInfo -> Maybe Int
maximumEfaInterfaces :: Prelude.Maybe Prelude.Int
  }
  deriving (EfaInfo -> EfaInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EfaInfo -> EfaInfo -> Bool
$c/= :: EfaInfo -> EfaInfo -> Bool
== :: EfaInfo -> EfaInfo -> Bool
$c== :: EfaInfo -> EfaInfo -> Bool
Prelude.Eq, ReadPrec [EfaInfo]
ReadPrec EfaInfo
Int -> ReadS EfaInfo
ReadS [EfaInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EfaInfo]
$creadListPrec :: ReadPrec [EfaInfo]
readPrec :: ReadPrec EfaInfo
$creadPrec :: ReadPrec EfaInfo
readList :: ReadS [EfaInfo]
$creadList :: ReadS [EfaInfo]
readsPrec :: Int -> ReadS EfaInfo
$creadsPrec :: Int -> ReadS EfaInfo
Prelude.Read, Int -> EfaInfo -> ShowS
[EfaInfo] -> ShowS
EfaInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EfaInfo] -> ShowS
$cshowList :: [EfaInfo] -> ShowS
show :: EfaInfo -> String
$cshow :: EfaInfo -> String
showsPrec :: Int -> EfaInfo -> ShowS
$cshowsPrec :: Int -> EfaInfo -> ShowS
Prelude.Show, forall x. Rep EfaInfo x -> EfaInfo
forall x. EfaInfo -> Rep EfaInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EfaInfo x -> EfaInfo
$cfrom :: forall x. EfaInfo -> Rep EfaInfo x
Prelude.Generic)

-- |
-- Create a value of 'EfaInfo' 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:
--
-- 'maximumEfaInterfaces', 'efaInfo_maximumEfaInterfaces' - The maximum number of Elastic Fabric Adapters for the instance type.
newEfaInfo ::
  EfaInfo
newEfaInfo :: EfaInfo
newEfaInfo =
  EfaInfo' {$sel:maximumEfaInterfaces:EfaInfo' :: Maybe Int
maximumEfaInterfaces = forall a. Maybe a
Prelude.Nothing}

-- | The maximum number of Elastic Fabric Adapters for the instance type.
efaInfo_maximumEfaInterfaces :: Lens.Lens' EfaInfo (Prelude.Maybe Prelude.Int)
efaInfo_maximumEfaInterfaces :: Lens' EfaInfo (Maybe Int)
efaInfo_maximumEfaInterfaces = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EfaInfo' {Maybe Int
maximumEfaInterfaces :: Maybe Int
$sel:maximumEfaInterfaces:EfaInfo' :: EfaInfo -> Maybe Int
maximumEfaInterfaces} -> Maybe Int
maximumEfaInterfaces) (\s :: EfaInfo
s@EfaInfo' {} Maybe Int
a -> EfaInfo
s {$sel:maximumEfaInterfaces:EfaInfo' :: Maybe Int
maximumEfaInterfaces = Maybe Int
a} :: EfaInfo)

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

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

instance Prelude.NFData EfaInfo where
  rnf :: EfaInfo -> ()
rnf EfaInfo' {Maybe Int
maximumEfaInterfaces :: Maybe Int
$sel:maximumEfaInterfaces:EfaInfo' :: EfaInfo -> Maybe Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maximumEfaInterfaces