{-# 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.AcceleratorTypeOffering
-- 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.AcceleratorTypeOffering where

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

-- | The offering for an Elastic Inference Accelerator type.
--
-- /See:/ 'newAcceleratorTypeOffering' smart constructor.
data AcceleratorTypeOffering = AcceleratorTypeOffering'
  { -- | The name of the Elastic Inference Accelerator type.
    AcceleratorTypeOffering -> Maybe Text
acceleratorType :: Prelude.Maybe Prelude.Text,
    -- | The location for the offering. It will return either the region,
    -- availability zone or availability zone id for the offering depending on
    -- the locationType value.
    AcceleratorTypeOffering -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
    -- | The location type for the offering. It can assume the following values:
    -- region: defines that the offering is at the regional level.
    -- availability-zone: defines that the offering is at the availability zone
    -- level. availability-zone-id: defines that the offering is at the
    -- availability zone level, defined by the availability zone id.
    AcceleratorTypeOffering -> Maybe LocationType
locationType :: Prelude.Maybe LocationType
  }
  deriving (AcceleratorTypeOffering -> AcceleratorTypeOffering -> Bool
(AcceleratorTypeOffering -> AcceleratorTypeOffering -> Bool)
-> (AcceleratorTypeOffering -> AcceleratorTypeOffering -> Bool)
-> Eq AcceleratorTypeOffering
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AcceleratorTypeOffering -> AcceleratorTypeOffering -> Bool
$c/= :: AcceleratorTypeOffering -> AcceleratorTypeOffering -> Bool
== :: AcceleratorTypeOffering -> AcceleratorTypeOffering -> Bool
$c== :: AcceleratorTypeOffering -> AcceleratorTypeOffering -> Bool
Prelude.Eq, ReadPrec [AcceleratorTypeOffering]
ReadPrec AcceleratorTypeOffering
Int -> ReadS AcceleratorTypeOffering
ReadS [AcceleratorTypeOffering]
(Int -> ReadS AcceleratorTypeOffering)
-> ReadS [AcceleratorTypeOffering]
-> ReadPrec AcceleratorTypeOffering
-> ReadPrec [AcceleratorTypeOffering]
-> Read AcceleratorTypeOffering
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AcceleratorTypeOffering]
$creadListPrec :: ReadPrec [AcceleratorTypeOffering]
readPrec :: ReadPrec AcceleratorTypeOffering
$creadPrec :: ReadPrec AcceleratorTypeOffering
readList :: ReadS [AcceleratorTypeOffering]
$creadList :: ReadS [AcceleratorTypeOffering]
readsPrec :: Int -> ReadS AcceleratorTypeOffering
$creadsPrec :: Int -> ReadS AcceleratorTypeOffering
Prelude.Read, Int -> AcceleratorTypeOffering -> ShowS
[AcceleratorTypeOffering] -> ShowS
AcceleratorTypeOffering -> String
(Int -> AcceleratorTypeOffering -> ShowS)
-> (AcceleratorTypeOffering -> String)
-> ([AcceleratorTypeOffering] -> ShowS)
-> Show AcceleratorTypeOffering
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AcceleratorTypeOffering] -> ShowS
$cshowList :: [AcceleratorTypeOffering] -> ShowS
show :: AcceleratorTypeOffering -> String
$cshow :: AcceleratorTypeOffering -> String
showsPrec :: Int -> AcceleratorTypeOffering -> ShowS
$cshowsPrec :: Int -> AcceleratorTypeOffering -> ShowS
Prelude.Show, (forall x.
 AcceleratorTypeOffering -> Rep AcceleratorTypeOffering x)
-> (forall x.
    Rep AcceleratorTypeOffering x -> AcceleratorTypeOffering)
-> Generic AcceleratorTypeOffering
forall x. Rep AcceleratorTypeOffering x -> AcceleratorTypeOffering
forall x. AcceleratorTypeOffering -> Rep AcceleratorTypeOffering x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AcceleratorTypeOffering x -> AcceleratorTypeOffering
$cfrom :: forall x. AcceleratorTypeOffering -> Rep AcceleratorTypeOffering x
Prelude.Generic)

-- |
-- Create a value of 'AcceleratorTypeOffering' 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', 'acceleratorTypeOffering_acceleratorType' - The name of the Elastic Inference Accelerator type.
--
-- 'location', 'acceleratorTypeOffering_location' - The location for the offering. It will return either the region,
-- availability zone or availability zone id for the offering depending on
-- the locationType value.
--
-- 'locationType', 'acceleratorTypeOffering_locationType' - The location type for the offering. It can assume the following values:
-- region: defines that the offering is at the regional level.
-- availability-zone: defines that the offering is at the availability zone
-- level. availability-zone-id: defines that the offering is at the
-- availability zone level, defined by the availability zone id.
newAcceleratorTypeOffering ::
  AcceleratorTypeOffering
newAcceleratorTypeOffering :: AcceleratorTypeOffering
newAcceleratorTypeOffering =
  AcceleratorTypeOffering' :: Maybe Text
-> Maybe Text -> Maybe LocationType -> AcceleratorTypeOffering
AcceleratorTypeOffering'
    { $sel:acceleratorType:AcceleratorTypeOffering' :: Maybe Text
acceleratorType =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:location:AcceleratorTypeOffering' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:locationType:AcceleratorTypeOffering' :: Maybe LocationType
locationType = Maybe LocationType
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The location for the offering. It will return either the region,
-- availability zone or availability zone id for the offering depending on
-- the locationType value.
acceleratorTypeOffering_location :: Lens.Lens' AcceleratorTypeOffering (Prelude.Maybe Prelude.Text)
acceleratorTypeOffering_location :: (Maybe Text -> f (Maybe Text))
-> AcceleratorTypeOffering -> f AcceleratorTypeOffering
acceleratorTypeOffering_location = (AcceleratorTypeOffering -> Maybe Text)
-> (AcceleratorTypeOffering
    -> Maybe Text -> AcceleratorTypeOffering)
-> Lens
     AcceleratorTypeOffering
     AcceleratorTypeOffering
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcceleratorTypeOffering' {Maybe Text
location :: Maybe Text
$sel:location:AcceleratorTypeOffering' :: AcceleratorTypeOffering -> Maybe Text
location} -> Maybe Text
location) (\s :: AcceleratorTypeOffering
s@AcceleratorTypeOffering' {} Maybe Text
a -> AcceleratorTypeOffering
s {$sel:location:AcceleratorTypeOffering' :: Maybe Text
location = Maybe Text
a} :: AcceleratorTypeOffering)

-- | The location type for the offering. It can assume the following values:
-- region: defines that the offering is at the regional level.
-- availability-zone: defines that the offering is at the availability zone
-- level. availability-zone-id: defines that the offering is at the
-- availability zone level, defined by the availability zone id.
acceleratorTypeOffering_locationType :: Lens.Lens' AcceleratorTypeOffering (Prelude.Maybe LocationType)
acceleratorTypeOffering_locationType :: (Maybe LocationType -> f (Maybe LocationType))
-> AcceleratorTypeOffering -> f AcceleratorTypeOffering
acceleratorTypeOffering_locationType = (AcceleratorTypeOffering -> Maybe LocationType)
-> (AcceleratorTypeOffering
    -> Maybe LocationType -> AcceleratorTypeOffering)
-> Lens
     AcceleratorTypeOffering
     AcceleratorTypeOffering
     (Maybe LocationType)
     (Maybe LocationType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcceleratorTypeOffering' {Maybe LocationType
locationType :: Maybe LocationType
$sel:locationType:AcceleratorTypeOffering' :: AcceleratorTypeOffering -> Maybe LocationType
locationType} -> Maybe LocationType
locationType) (\s :: AcceleratorTypeOffering
s@AcceleratorTypeOffering' {} Maybe LocationType
a -> AcceleratorTypeOffering
s {$sel:locationType:AcceleratorTypeOffering' :: Maybe LocationType
locationType = Maybe LocationType
a} :: AcceleratorTypeOffering)

instance Core.FromJSON AcceleratorTypeOffering where
  parseJSON :: Value -> Parser AcceleratorTypeOffering
parseJSON =
    String
-> (Object -> Parser AcceleratorTypeOffering)
-> Value
-> Parser AcceleratorTypeOffering
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AcceleratorTypeOffering"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe LocationType -> AcceleratorTypeOffering
AcceleratorTypeOffering'
            (Maybe Text
 -> Maybe Text -> Maybe LocationType -> AcceleratorTypeOffering)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe LocationType -> AcceleratorTypeOffering)
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 LocationType -> AcceleratorTypeOffering)
-> Parser (Maybe Text)
-> Parser (Maybe LocationType -> AcceleratorTypeOffering)
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
"location")
            Parser (Maybe LocationType -> AcceleratorTypeOffering)
-> Parser (Maybe LocationType) -> Parser AcceleratorTypeOffering
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe LocationType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"locationType")
      )

instance Prelude.Hashable AcceleratorTypeOffering

instance Prelude.NFData AcceleratorTypeOffering