{-# 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.SecurityHub.Types.AwsEcsTaskDefinitionInferenceAcceleratorsDetails
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SecurityHub.Types.AwsEcsTaskDefinitionInferenceAcceleratorsDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An Elastic Inference accelerator to use for the containers in the task.
--
-- /See:/ 'newAwsEcsTaskDefinitionInferenceAcceleratorsDetails' smart constructor.
data AwsEcsTaskDefinitionInferenceAcceleratorsDetails = AwsEcsTaskDefinitionInferenceAcceleratorsDetails'
  { -- | The Elastic Inference accelerator device name.
    AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> Maybe Text
deviceName :: Prelude.Maybe Prelude.Text,
    -- | The Elastic Inference accelerator type to use.
    AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> Maybe Text
deviceType :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsEcsTaskDefinitionInferenceAcceleratorsDetails
-> AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> Bool
(AwsEcsTaskDefinitionInferenceAcceleratorsDetails
 -> AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> Bool)
-> (AwsEcsTaskDefinitionInferenceAcceleratorsDetails
    -> AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> Bool)
-> Eq AwsEcsTaskDefinitionInferenceAcceleratorsDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEcsTaskDefinitionInferenceAcceleratorsDetails
-> AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> Bool
$c/= :: AwsEcsTaskDefinitionInferenceAcceleratorsDetails
-> AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> Bool
== :: AwsEcsTaskDefinitionInferenceAcceleratorsDetails
-> AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> Bool
$c== :: AwsEcsTaskDefinitionInferenceAcceleratorsDetails
-> AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> Bool
Prelude.Eq, ReadPrec [AwsEcsTaskDefinitionInferenceAcceleratorsDetails]
ReadPrec AwsEcsTaskDefinitionInferenceAcceleratorsDetails
Int -> ReadS AwsEcsTaskDefinitionInferenceAcceleratorsDetails
ReadS [AwsEcsTaskDefinitionInferenceAcceleratorsDetails]
(Int -> ReadS AwsEcsTaskDefinitionInferenceAcceleratorsDetails)
-> ReadS [AwsEcsTaskDefinitionInferenceAcceleratorsDetails]
-> ReadPrec AwsEcsTaskDefinitionInferenceAcceleratorsDetails
-> ReadPrec [AwsEcsTaskDefinitionInferenceAcceleratorsDetails]
-> Read AwsEcsTaskDefinitionInferenceAcceleratorsDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsEcsTaskDefinitionInferenceAcceleratorsDetails]
$creadListPrec :: ReadPrec [AwsEcsTaskDefinitionInferenceAcceleratorsDetails]
readPrec :: ReadPrec AwsEcsTaskDefinitionInferenceAcceleratorsDetails
$creadPrec :: ReadPrec AwsEcsTaskDefinitionInferenceAcceleratorsDetails
readList :: ReadS [AwsEcsTaskDefinitionInferenceAcceleratorsDetails]
$creadList :: ReadS [AwsEcsTaskDefinitionInferenceAcceleratorsDetails]
readsPrec :: Int -> ReadS AwsEcsTaskDefinitionInferenceAcceleratorsDetails
$creadsPrec :: Int -> ReadS AwsEcsTaskDefinitionInferenceAcceleratorsDetails
Prelude.Read, Int -> AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> ShowS
[AwsEcsTaskDefinitionInferenceAcceleratorsDetails] -> ShowS
AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> String
(Int -> AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> ShowS)
-> (AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> String)
-> ([AwsEcsTaskDefinitionInferenceAcceleratorsDetails] -> ShowS)
-> Show AwsEcsTaskDefinitionInferenceAcceleratorsDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEcsTaskDefinitionInferenceAcceleratorsDetails] -> ShowS
$cshowList :: [AwsEcsTaskDefinitionInferenceAcceleratorsDetails] -> ShowS
show :: AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> String
$cshow :: AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> String
showsPrec :: Int -> AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> ShowS
$cshowsPrec :: Int -> AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> ShowS
Prelude.Show, (forall x.
 AwsEcsTaskDefinitionInferenceAcceleratorsDetails
 -> Rep AwsEcsTaskDefinitionInferenceAcceleratorsDetails x)
-> (forall x.
    Rep AwsEcsTaskDefinitionInferenceAcceleratorsDetails x
    -> AwsEcsTaskDefinitionInferenceAcceleratorsDetails)
-> Generic AwsEcsTaskDefinitionInferenceAcceleratorsDetails
forall x.
Rep AwsEcsTaskDefinitionInferenceAcceleratorsDetails x
-> AwsEcsTaskDefinitionInferenceAcceleratorsDetails
forall x.
AwsEcsTaskDefinitionInferenceAcceleratorsDetails
-> Rep AwsEcsTaskDefinitionInferenceAcceleratorsDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsEcsTaskDefinitionInferenceAcceleratorsDetails x
-> AwsEcsTaskDefinitionInferenceAcceleratorsDetails
$cfrom :: forall x.
AwsEcsTaskDefinitionInferenceAcceleratorsDetails
-> Rep AwsEcsTaskDefinitionInferenceAcceleratorsDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsEcsTaskDefinitionInferenceAcceleratorsDetails' 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:
--
-- 'deviceName', 'awsEcsTaskDefinitionInferenceAcceleratorsDetails_deviceName' - The Elastic Inference accelerator device name.
--
-- 'deviceType', 'awsEcsTaskDefinitionInferenceAcceleratorsDetails_deviceType' - The Elastic Inference accelerator type to use.
newAwsEcsTaskDefinitionInferenceAcceleratorsDetails ::
  AwsEcsTaskDefinitionInferenceAcceleratorsDetails
newAwsEcsTaskDefinitionInferenceAcceleratorsDetails :: AwsEcsTaskDefinitionInferenceAcceleratorsDetails
newAwsEcsTaskDefinitionInferenceAcceleratorsDetails =
  AwsEcsTaskDefinitionInferenceAcceleratorsDetails' :: Maybe Text
-> Maybe Text -> AwsEcsTaskDefinitionInferenceAcceleratorsDetails
AwsEcsTaskDefinitionInferenceAcceleratorsDetails'
    { $sel:deviceName:AwsEcsTaskDefinitionInferenceAcceleratorsDetails' :: Maybe Text
deviceName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceType:AwsEcsTaskDefinitionInferenceAcceleratorsDetails' :: Maybe Text
deviceType =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Elastic Inference accelerator device name.
awsEcsTaskDefinitionInferenceAcceleratorsDetails_deviceName :: Lens.Lens' AwsEcsTaskDefinitionInferenceAcceleratorsDetails (Prelude.Maybe Prelude.Text)
awsEcsTaskDefinitionInferenceAcceleratorsDetails_deviceName :: (Maybe Text -> f (Maybe Text))
-> AwsEcsTaskDefinitionInferenceAcceleratorsDetails
-> f AwsEcsTaskDefinitionInferenceAcceleratorsDetails
awsEcsTaskDefinitionInferenceAcceleratorsDetails_deviceName = (AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> Maybe Text)
-> (AwsEcsTaskDefinitionInferenceAcceleratorsDetails
    -> Maybe Text -> AwsEcsTaskDefinitionInferenceAcceleratorsDetails)
-> Lens
     AwsEcsTaskDefinitionInferenceAcceleratorsDetails
     AwsEcsTaskDefinitionInferenceAcceleratorsDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionInferenceAcceleratorsDetails' {Maybe Text
deviceName :: Maybe Text
$sel:deviceName:AwsEcsTaskDefinitionInferenceAcceleratorsDetails' :: AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> Maybe Text
deviceName} -> Maybe Text
deviceName) (\s :: AwsEcsTaskDefinitionInferenceAcceleratorsDetails
s@AwsEcsTaskDefinitionInferenceAcceleratorsDetails' {} Maybe Text
a -> AwsEcsTaskDefinitionInferenceAcceleratorsDetails
s {$sel:deviceName:AwsEcsTaskDefinitionInferenceAcceleratorsDetails' :: Maybe Text
deviceName = Maybe Text
a} :: AwsEcsTaskDefinitionInferenceAcceleratorsDetails)

-- | The Elastic Inference accelerator type to use.
awsEcsTaskDefinitionInferenceAcceleratorsDetails_deviceType :: Lens.Lens' AwsEcsTaskDefinitionInferenceAcceleratorsDetails (Prelude.Maybe Prelude.Text)
awsEcsTaskDefinitionInferenceAcceleratorsDetails_deviceType :: (Maybe Text -> f (Maybe Text))
-> AwsEcsTaskDefinitionInferenceAcceleratorsDetails
-> f AwsEcsTaskDefinitionInferenceAcceleratorsDetails
awsEcsTaskDefinitionInferenceAcceleratorsDetails_deviceType = (AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> Maybe Text)
-> (AwsEcsTaskDefinitionInferenceAcceleratorsDetails
    -> Maybe Text -> AwsEcsTaskDefinitionInferenceAcceleratorsDetails)
-> Lens
     AwsEcsTaskDefinitionInferenceAcceleratorsDetails
     AwsEcsTaskDefinitionInferenceAcceleratorsDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionInferenceAcceleratorsDetails' {Maybe Text
deviceType :: Maybe Text
$sel:deviceType:AwsEcsTaskDefinitionInferenceAcceleratorsDetails' :: AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> Maybe Text
deviceType} -> Maybe Text
deviceType) (\s :: AwsEcsTaskDefinitionInferenceAcceleratorsDetails
s@AwsEcsTaskDefinitionInferenceAcceleratorsDetails' {} Maybe Text
a -> AwsEcsTaskDefinitionInferenceAcceleratorsDetails
s {$sel:deviceType:AwsEcsTaskDefinitionInferenceAcceleratorsDetails' :: Maybe Text
deviceType = Maybe Text
a} :: AwsEcsTaskDefinitionInferenceAcceleratorsDetails)

instance
  Core.FromJSON
    AwsEcsTaskDefinitionInferenceAcceleratorsDetails
  where
  parseJSON :: Value -> Parser AwsEcsTaskDefinitionInferenceAcceleratorsDetails
parseJSON =
    String
-> (Object
    -> Parser AwsEcsTaskDefinitionInferenceAcceleratorsDetails)
-> Value
-> Parser AwsEcsTaskDefinitionInferenceAcceleratorsDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsEcsTaskDefinitionInferenceAcceleratorsDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> AwsEcsTaskDefinitionInferenceAcceleratorsDetails
AwsEcsTaskDefinitionInferenceAcceleratorsDetails'
            (Maybe Text
 -> Maybe Text -> AwsEcsTaskDefinitionInferenceAcceleratorsDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> AwsEcsTaskDefinitionInferenceAcceleratorsDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DeviceName")
              Parser
  (Maybe Text -> AwsEcsTaskDefinitionInferenceAcceleratorsDetails)
-> Parser (Maybe Text)
-> Parser AwsEcsTaskDefinitionInferenceAcceleratorsDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DeviceType")
      )

instance
  Prelude.Hashable
    AwsEcsTaskDefinitionInferenceAcceleratorsDetails

instance
  Prelude.NFData
    AwsEcsTaskDefinitionInferenceAcceleratorsDetails

instance
  Core.ToJSON
    AwsEcsTaskDefinitionInferenceAcceleratorsDetails
  where
  toJSON :: AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> Value
toJSON
    AwsEcsTaskDefinitionInferenceAcceleratorsDetails' {Maybe Text
deviceType :: Maybe Text
deviceName :: Maybe Text
$sel:deviceType:AwsEcsTaskDefinitionInferenceAcceleratorsDetails' :: AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> Maybe Text
$sel:deviceName:AwsEcsTaskDefinitionInferenceAcceleratorsDetails' :: AwsEcsTaskDefinitionInferenceAcceleratorsDetails -> Maybe Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"DeviceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deviceName,
              (Text
"DeviceType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deviceType
            ]
        )