{-# 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.ElasticInference.Types.ElasticInferenceAccelerator
-- 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.ElasticInference.Types.ElasticInferenceAccelerator where

import qualified Amazonka.Core as Core
import Amazonka.ElasticInference.Types.ElasticInferenceAcceleratorHealth
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The details of an Elastic Inference Accelerator.
--
-- /See:/ 'newElasticInferenceAccelerator' smart constructor.
data ElasticInferenceAccelerator = ElasticInferenceAccelerator'
  { -- | The type of the Elastic Inference Accelerator.
    ElasticInferenceAccelerator -> Maybe Text
acceleratorType :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Elastic Inference Accelerator.
    ElasticInferenceAccelerator -> Maybe Text
acceleratorId :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the resource that the Elastic Inference Accelerator is
    -- attached to.
    ElasticInferenceAccelerator -> Maybe Text
attachedResource :: Prelude.Maybe Prelude.Text,
    -- | The health of the Elastic Inference Accelerator.
    ElasticInferenceAccelerator
-> Maybe ElasticInferenceAcceleratorHealth
acceleratorHealth :: Prelude.Maybe ElasticInferenceAcceleratorHealth,
    -- | The availability zone where the Elastic Inference Accelerator is
    -- present.
    ElasticInferenceAccelerator -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text
  }
  deriving (ElasticInferenceAccelerator -> ElasticInferenceAccelerator -> Bool
(ElasticInferenceAccelerator
 -> ElasticInferenceAccelerator -> Bool)
-> (ElasticInferenceAccelerator
    -> ElasticInferenceAccelerator -> Bool)
-> Eq ElasticInferenceAccelerator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ElasticInferenceAccelerator -> ElasticInferenceAccelerator -> Bool
$c/= :: ElasticInferenceAccelerator -> ElasticInferenceAccelerator -> Bool
== :: ElasticInferenceAccelerator -> ElasticInferenceAccelerator -> Bool
$c== :: ElasticInferenceAccelerator -> ElasticInferenceAccelerator -> Bool
Prelude.Eq, ReadPrec [ElasticInferenceAccelerator]
ReadPrec ElasticInferenceAccelerator
Int -> ReadS ElasticInferenceAccelerator
ReadS [ElasticInferenceAccelerator]
(Int -> ReadS ElasticInferenceAccelerator)
-> ReadS [ElasticInferenceAccelerator]
-> ReadPrec ElasticInferenceAccelerator
-> ReadPrec [ElasticInferenceAccelerator]
-> Read ElasticInferenceAccelerator
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ElasticInferenceAccelerator]
$creadListPrec :: ReadPrec [ElasticInferenceAccelerator]
readPrec :: ReadPrec ElasticInferenceAccelerator
$creadPrec :: ReadPrec ElasticInferenceAccelerator
readList :: ReadS [ElasticInferenceAccelerator]
$creadList :: ReadS [ElasticInferenceAccelerator]
readsPrec :: Int -> ReadS ElasticInferenceAccelerator
$creadsPrec :: Int -> ReadS ElasticInferenceAccelerator
Prelude.Read, Int -> ElasticInferenceAccelerator -> ShowS
[ElasticInferenceAccelerator] -> ShowS
ElasticInferenceAccelerator -> String
(Int -> ElasticInferenceAccelerator -> ShowS)
-> (ElasticInferenceAccelerator -> String)
-> ([ElasticInferenceAccelerator] -> ShowS)
-> Show ElasticInferenceAccelerator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ElasticInferenceAccelerator] -> ShowS
$cshowList :: [ElasticInferenceAccelerator] -> ShowS
show :: ElasticInferenceAccelerator -> String
$cshow :: ElasticInferenceAccelerator -> String
showsPrec :: Int -> ElasticInferenceAccelerator -> ShowS
$cshowsPrec :: Int -> ElasticInferenceAccelerator -> ShowS
Prelude.Show, (forall x.
 ElasticInferenceAccelerator -> Rep ElasticInferenceAccelerator x)
-> (forall x.
    Rep ElasticInferenceAccelerator x -> ElasticInferenceAccelerator)
-> Generic ElasticInferenceAccelerator
forall x.
Rep ElasticInferenceAccelerator x -> ElasticInferenceAccelerator
forall x.
ElasticInferenceAccelerator -> Rep ElasticInferenceAccelerator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ElasticInferenceAccelerator x -> ElasticInferenceAccelerator
$cfrom :: forall x.
ElasticInferenceAccelerator -> Rep ElasticInferenceAccelerator x
Prelude.Generic)

-- |
-- Create a value of 'ElasticInferenceAccelerator' 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:
--
-- 'acceleratorType', 'elasticInferenceAccelerator_acceleratorType' - The type of the Elastic Inference Accelerator.
--
-- 'acceleratorId', 'elasticInferenceAccelerator_acceleratorId' - The ID of the Elastic Inference Accelerator.
--
-- 'attachedResource', 'elasticInferenceAccelerator_attachedResource' - The ARN of the resource that the Elastic Inference Accelerator is
-- attached to.
--
-- 'acceleratorHealth', 'elasticInferenceAccelerator_acceleratorHealth' - The health of the Elastic Inference Accelerator.
--
-- 'availabilityZone', 'elasticInferenceAccelerator_availabilityZone' - The availability zone where the Elastic Inference Accelerator is
-- present.
newElasticInferenceAccelerator ::
  ElasticInferenceAccelerator
newElasticInferenceAccelerator :: ElasticInferenceAccelerator
newElasticInferenceAccelerator =
  ElasticInferenceAccelerator' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ElasticInferenceAcceleratorHealth
-> Maybe Text
-> ElasticInferenceAccelerator
ElasticInferenceAccelerator'
    { $sel:acceleratorType:ElasticInferenceAccelerator' :: Maybe Text
acceleratorType =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:acceleratorId:ElasticInferenceAccelerator' :: Maybe Text
acceleratorId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attachedResource:ElasticInferenceAccelerator' :: Maybe Text
attachedResource = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:acceleratorHealth:ElasticInferenceAccelerator' :: Maybe ElasticInferenceAcceleratorHealth
acceleratorHealth = Maybe ElasticInferenceAcceleratorHealth
forall a. Maybe a
Prelude.Nothing,
      $sel:availabilityZone:ElasticInferenceAccelerator' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The type of the Elastic Inference Accelerator.
elasticInferenceAccelerator_acceleratorType :: Lens.Lens' ElasticInferenceAccelerator (Prelude.Maybe Prelude.Text)
elasticInferenceAccelerator_acceleratorType :: (Maybe Text -> f (Maybe Text))
-> ElasticInferenceAccelerator -> f ElasticInferenceAccelerator
elasticInferenceAccelerator_acceleratorType = (ElasticInferenceAccelerator -> Maybe Text)
-> (ElasticInferenceAccelerator
    -> Maybe Text -> ElasticInferenceAccelerator)
-> Lens
     ElasticInferenceAccelerator
     ElasticInferenceAccelerator
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticInferenceAccelerator' {Maybe Text
acceleratorType :: Maybe Text
$sel:acceleratorType:ElasticInferenceAccelerator' :: ElasticInferenceAccelerator -> Maybe Text
acceleratorType} -> Maybe Text
acceleratorType) (\s :: ElasticInferenceAccelerator
s@ElasticInferenceAccelerator' {} Maybe Text
a -> ElasticInferenceAccelerator
s {$sel:acceleratorType:ElasticInferenceAccelerator' :: Maybe Text
acceleratorType = Maybe Text
a} :: ElasticInferenceAccelerator)

-- | The ID of the Elastic Inference Accelerator.
elasticInferenceAccelerator_acceleratorId :: Lens.Lens' ElasticInferenceAccelerator (Prelude.Maybe Prelude.Text)
elasticInferenceAccelerator_acceleratorId :: (Maybe Text -> f (Maybe Text))
-> ElasticInferenceAccelerator -> f ElasticInferenceAccelerator
elasticInferenceAccelerator_acceleratorId = (ElasticInferenceAccelerator -> Maybe Text)
-> (ElasticInferenceAccelerator
    -> Maybe Text -> ElasticInferenceAccelerator)
-> Lens
     ElasticInferenceAccelerator
     ElasticInferenceAccelerator
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticInferenceAccelerator' {Maybe Text
acceleratorId :: Maybe Text
$sel:acceleratorId:ElasticInferenceAccelerator' :: ElasticInferenceAccelerator -> Maybe Text
acceleratorId} -> Maybe Text
acceleratorId) (\s :: ElasticInferenceAccelerator
s@ElasticInferenceAccelerator' {} Maybe Text
a -> ElasticInferenceAccelerator
s {$sel:acceleratorId:ElasticInferenceAccelerator' :: Maybe Text
acceleratorId = Maybe Text
a} :: ElasticInferenceAccelerator)

-- | The ARN of the resource that the Elastic Inference Accelerator is
-- attached to.
elasticInferenceAccelerator_attachedResource :: Lens.Lens' ElasticInferenceAccelerator (Prelude.Maybe Prelude.Text)
elasticInferenceAccelerator_attachedResource :: (Maybe Text -> f (Maybe Text))
-> ElasticInferenceAccelerator -> f ElasticInferenceAccelerator
elasticInferenceAccelerator_attachedResource = (ElasticInferenceAccelerator -> Maybe Text)
-> (ElasticInferenceAccelerator
    -> Maybe Text -> ElasticInferenceAccelerator)
-> Lens
     ElasticInferenceAccelerator
     ElasticInferenceAccelerator
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticInferenceAccelerator' {Maybe Text
attachedResource :: Maybe Text
$sel:attachedResource:ElasticInferenceAccelerator' :: ElasticInferenceAccelerator -> Maybe Text
attachedResource} -> Maybe Text
attachedResource) (\s :: ElasticInferenceAccelerator
s@ElasticInferenceAccelerator' {} Maybe Text
a -> ElasticInferenceAccelerator
s {$sel:attachedResource:ElasticInferenceAccelerator' :: Maybe Text
attachedResource = Maybe Text
a} :: ElasticInferenceAccelerator)

-- | The health of the Elastic Inference Accelerator.
elasticInferenceAccelerator_acceleratorHealth :: Lens.Lens' ElasticInferenceAccelerator (Prelude.Maybe ElasticInferenceAcceleratorHealth)
elasticInferenceAccelerator_acceleratorHealth :: (Maybe ElasticInferenceAcceleratorHealth
 -> f (Maybe ElasticInferenceAcceleratorHealth))
-> ElasticInferenceAccelerator -> f ElasticInferenceAccelerator
elasticInferenceAccelerator_acceleratorHealth = (ElasticInferenceAccelerator
 -> Maybe ElasticInferenceAcceleratorHealth)
-> (ElasticInferenceAccelerator
    -> Maybe ElasticInferenceAcceleratorHealth
    -> ElasticInferenceAccelerator)
-> Lens
     ElasticInferenceAccelerator
     ElasticInferenceAccelerator
     (Maybe ElasticInferenceAcceleratorHealth)
     (Maybe ElasticInferenceAcceleratorHealth)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticInferenceAccelerator' {Maybe ElasticInferenceAcceleratorHealth
acceleratorHealth :: Maybe ElasticInferenceAcceleratorHealth
$sel:acceleratorHealth:ElasticInferenceAccelerator' :: ElasticInferenceAccelerator
-> Maybe ElasticInferenceAcceleratorHealth
acceleratorHealth} -> Maybe ElasticInferenceAcceleratorHealth
acceleratorHealth) (\s :: ElasticInferenceAccelerator
s@ElasticInferenceAccelerator' {} Maybe ElasticInferenceAcceleratorHealth
a -> ElasticInferenceAccelerator
s {$sel:acceleratorHealth:ElasticInferenceAccelerator' :: Maybe ElasticInferenceAcceleratorHealth
acceleratorHealth = Maybe ElasticInferenceAcceleratorHealth
a} :: ElasticInferenceAccelerator)

-- | The availability zone where the Elastic Inference Accelerator is
-- present.
elasticInferenceAccelerator_availabilityZone :: Lens.Lens' ElasticInferenceAccelerator (Prelude.Maybe Prelude.Text)
elasticInferenceAccelerator_availabilityZone :: (Maybe Text -> f (Maybe Text))
-> ElasticInferenceAccelerator -> f ElasticInferenceAccelerator
elasticInferenceAccelerator_availabilityZone = (ElasticInferenceAccelerator -> Maybe Text)
-> (ElasticInferenceAccelerator
    -> Maybe Text -> ElasticInferenceAccelerator)
-> Lens
     ElasticInferenceAccelerator
     ElasticInferenceAccelerator
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticInferenceAccelerator' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:ElasticInferenceAccelerator' :: ElasticInferenceAccelerator -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: ElasticInferenceAccelerator
s@ElasticInferenceAccelerator' {} Maybe Text
a -> ElasticInferenceAccelerator
s {$sel:availabilityZone:ElasticInferenceAccelerator' :: Maybe Text
availabilityZone = Maybe Text
a} :: ElasticInferenceAccelerator)

instance Core.FromJSON ElasticInferenceAccelerator where
  parseJSON :: Value -> Parser ElasticInferenceAccelerator
parseJSON =
    String
-> (Object -> Parser ElasticInferenceAccelerator)
-> Value
-> Parser ElasticInferenceAccelerator
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ElasticInferenceAccelerator"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ElasticInferenceAcceleratorHealth
-> Maybe Text
-> ElasticInferenceAccelerator
ElasticInferenceAccelerator'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ElasticInferenceAcceleratorHealth
 -> Maybe Text
 -> ElasticInferenceAccelerator)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ElasticInferenceAcceleratorHealth
      -> Maybe Text
      -> ElasticInferenceAccelerator)
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
"acceleratorType")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe ElasticInferenceAcceleratorHealth
   -> Maybe Text
   -> ElasticInferenceAccelerator)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ElasticInferenceAcceleratorHealth
      -> Maybe Text
      -> ElasticInferenceAccelerator)
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
"acceleratorId")
            Parser
  (Maybe Text
   -> Maybe ElasticInferenceAcceleratorHealth
   -> Maybe Text
   -> ElasticInferenceAccelerator)
-> Parser (Maybe Text)
-> Parser
     (Maybe ElasticInferenceAcceleratorHealth
      -> Maybe Text -> ElasticInferenceAccelerator)
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
"attachedResource")
            Parser
  (Maybe ElasticInferenceAcceleratorHealth
   -> Maybe Text -> ElasticInferenceAccelerator)
-> Parser (Maybe ElasticInferenceAcceleratorHealth)
-> Parser (Maybe Text -> ElasticInferenceAccelerator)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ElasticInferenceAcceleratorHealth)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"acceleratorHealth")
            Parser (Maybe Text -> ElasticInferenceAccelerator)
-> Parser (Maybe Text) -> Parser ElasticInferenceAccelerator
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
"availabilityZone")
      )

instance Prelude.Hashable ElasticInferenceAccelerator

instance Prelude.NFData ElasticInferenceAccelerator