{-# 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.FpgaDeviceInfo
-- 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.FpgaDeviceInfo 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.FpgaDeviceMemoryInfo
import qualified Amazonka.Prelude as Prelude

-- | Describes the FPGA accelerator for the instance type.
--
-- /See:/ 'newFpgaDeviceInfo' smart constructor.
data FpgaDeviceInfo = FpgaDeviceInfo'
  { -- | The count of FPGA accelerators for the instance type.
    FpgaDeviceInfo -> Maybe Int
count :: Prelude.Maybe Prelude.Int,
    -- | The manufacturer of the FPGA accelerator.
    FpgaDeviceInfo -> Maybe Text
manufacturer :: Prelude.Maybe Prelude.Text,
    -- | Describes the memory for the FPGA accelerator for the instance type.
    FpgaDeviceInfo -> Maybe FpgaDeviceMemoryInfo
memoryInfo :: Prelude.Maybe FpgaDeviceMemoryInfo,
    -- | The name of the FPGA accelerator.
    FpgaDeviceInfo -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (FpgaDeviceInfo -> FpgaDeviceInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FpgaDeviceInfo -> FpgaDeviceInfo -> Bool
$c/= :: FpgaDeviceInfo -> FpgaDeviceInfo -> Bool
== :: FpgaDeviceInfo -> FpgaDeviceInfo -> Bool
$c== :: FpgaDeviceInfo -> FpgaDeviceInfo -> Bool
Prelude.Eq, ReadPrec [FpgaDeviceInfo]
ReadPrec FpgaDeviceInfo
Int -> ReadS FpgaDeviceInfo
ReadS [FpgaDeviceInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FpgaDeviceInfo]
$creadListPrec :: ReadPrec [FpgaDeviceInfo]
readPrec :: ReadPrec FpgaDeviceInfo
$creadPrec :: ReadPrec FpgaDeviceInfo
readList :: ReadS [FpgaDeviceInfo]
$creadList :: ReadS [FpgaDeviceInfo]
readsPrec :: Int -> ReadS FpgaDeviceInfo
$creadsPrec :: Int -> ReadS FpgaDeviceInfo
Prelude.Read, Int -> FpgaDeviceInfo -> ShowS
[FpgaDeviceInfo] -> ShowS
FpgaDeviceInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FpgaDeviceInfo] -> ShowS
$cshowList :: [FpgaDeviceInfo] -> ShowS
show :: FpgaDeviceInfo -> String
$cshow :: FpgaDeviceInfo -> String
showsPrec :: Int -> FpgaDeviceInfo -> ShowS
$cshowsPrec :: Int -> FpgaDeviceInfo -> ShowS
Prelude.Show, forall x. Rep FpgaDeviceInfo x -> FpgaDeviceInfo
forall x. FpgaDeviceInfo -> Rep FpgaDeviceInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FpgaDeviceInfo x -> FpgaDeviceInfo
$cfrom :: forall x. FpgaDeviceInfo -> Rep FpgaDeviceInfo x
Prelude.Generic)

-- |
-- Create a value of 'FpgaDeviceInfo' 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:
--
-- 'count', 'fpgaDeviceInfo_count' - The count of FPGA accelerators for the instance type.
--
-- 'manufacturer', 'fpgaDeviceInfo_manufacturer' - The manufacturer of the FPGA accelerator.
--
-- 'memoryInfo', 'fpgaDeviceInfo_memoryInfo' - Describes the memory for the FPGA accelerator for the instance type.
--
-- 'name', 'fpgaDeviceInfo_name' - The name of the FPGA accelerator.
newFpgaDeviceInfo ::
  FpgaDeviceInfo
newFpgaDeviceInfo :: FpgaDeviceInfo
newFpgaDeviceInfo =
  FpgaDeviceInfo'
    { $sel:count:FpgaDeviceInfo' :: Maybe Int
count = forall a. Maybe a
Prelude.Nothing,
      $sel:manufacturer:FpgaDeviceInfo' :: Maybe Text
manufacturer = forall a. Maybe a
Prelude.Nothing,
      $sel:memoryInfo:FpgaDeviceInfo' :: Maybe FpgaDeviceMemoryInfo
memoryInfo = forall a. Maybe a
Prelude.Nothing,
      $sel:name:FpgaDeviceInfo' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The count of FPGA accelerators for the instance type.
fpgaDeviceInfo_count :: Lens.Lens' FpgaDeviceInfo (Prelude.Maybe Prelude.Int)
fpgaDeviceInfo_count :: Lens' FpgaDeviceInfo (Maybe Int)
fpgaDeviceInfo_count = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FpgaDeviceInfo' {Maybe Int
count :: Maybe Int
$sel:count:FpgaDeviceInfo' :: FpgaDeviceInfo -> Maybe Int
count} -> Maybe Int
count) (\s :: FpgaDeviceInfo
s@FpgaDeviceInfo' {} Maybe Int
a -> FpgaDeviceInfo
s {$sel:count:FpgaDeviceInfo' :: Maybe Int
count = Maybe Int
a} :: FpgaDeviceInfo)

-- | The manufacturer of the FPGA accelerator.
fpgaDeviceInfo_manufacturer :: Lens.Lens' FpgaDeviceInfo (Prelude.Maybe Prelude.Text)
fpgaDeviceInfo_manufacturer :: Lens' FpgaDeviceInfo (Maybe Text)
fpgaDeviceInfo_manufacturer = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FpgaDeviceInfo' {Maybe Text
manufacturer :: Maybe Text
$sel:manufacturer:FpgaDeviceInfo' :: FpgaDeviceInfo -> Maybe Text
manufacturer} -> Maybe Text
manufacturer) (\s :: FpgaDeviceInfo
s@FpgaDeviceInfo' {} Maybe Text
a -> FpgaDeviceInfo
s {$sel:manufacturer:FpgaDeviceInfo' :: Maybe Text
manufacturer = Maybe Text
a} :: FpgaDeviceInfo)

-- | Describes the memory for the FPGA accelerator for the instance type.
fpgaDeviceInfo_memoryInfo :: Lens.Lens' FpgaDeviceInfo (Prelude.Maybe FpgaDeviceMemoryInfo)
fpgaDeviceInfo_memoryInfo :: Lens' FpgaDeviceInfo (Maybe FpgaDeviceMemoryInfo)
fpgaDeviceInfo_memoryInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FpgaDeviceInfo' {Maybe FpgaDeviceMemoryInfo
memoryInfo :: Maybe FpgaDeviceMemoryInfo
$sel:memoryInfo:FpgaDeviceInfo' :: FpgaDeviceInfo -> Maybe FpgaDeviceMemoryInfo
memoryInfo} -> Maybe FpgaDeviceMemoryInfo
memoryInfo) (\s :: FpgaDeviceInfo
s@FpgaDeviceInfo' {} Maybe FpgaDeviceMemoryInfo
a -> FpgaDeviceInfo
s {$sel:memoryInfo:FpgaDeviceInfo' :: Maybe FpgaDeviceMemoryInfo
memoryInfo = Maybe FpgaDeviceMemoryInfo
a} :: FpgaDeviceInfo)

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

instance Data.FromXML FpgaDeviceInfo where
  parseXML :: [Node] -> Either String FpgaDeviceInfo
parseXML [Node]
x =
    Maybe Int
-> Maybe Text
-> Maybe FpgaDeviceMemoryInfo
-> Maybe Text
-> FpgaDeviceInfo
FpgaDeviceInfo'
      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
"count")
      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
"manufacturer")
      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
"memoryInfo")
      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")

instance Prelude.Hashable FpgaDeviceInfo where
  hashWithSalt :: Int -> FpgaDeviceInfo -> Int
hashWithSalt Int
_salt FpgaDeviceInfo' {Maybe Int
Maybe Text
Maybe FpgaDeviceMemoryInfo
name :: Maybe Text
memoryInfo :: Maybe FpgaDeviceMemoryInfo
manufacturer :: Maybe Text
count :: Maybe Int
$sel:name:FpgaDeviceInfo' :: FpgaDeviceInfo -> Maybe Text
$sel:memoryInfo:FpgaDeviceInfo' :: FpgaDeviceInfo -> Maybe FpgaDeviceMemoryInfo
$sel:manufacturer:FpgaDeviceInfo' :: FpgaDeviceInfo -> Maybe Text
$sel:count:FpgaDeviceInfo' :: FpgaDeviceInfo -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
count
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
manufacturer
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FpgaDeviceMemoryInfo
memoryInfo
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData FpgaDeviceInfo where
  rnf :: FpgaDeviceInfo -> ()
rnf FpgaDeviceInfo' {Maybe Int
Maybe Text
Maybe FpgaDeviceMemoryInfo
name :: Maybe Text
memoryInfo :: Maybe FpgaDeviceMemoryInfo
manufacturer :: Maybe Text
count :: Maybe Int
$sel:name:FpgaDeviceInfo' :: FpgaDeviceInfo -> Maybe Text
$sel:memoryInfo:FpgaDeviceInfo' :: FpgaDeviceInfo -> Maybe FpgaDeviceMemoryInfo
$sel:manufacturer:FpgaDeviceInfo' :: FpgaDeviceInfo -> Maybe Text
$sel:count:FpgaDeviceInfo' :: FpgaDeviceInfo -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
count
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
manufacturer
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FpgaDeviceMemoryInfo
memoryInfo
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name