{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ElasticInference.Types.AcceleratorTypeOffering where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElasticInference.Types.LocationType
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
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]
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
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. 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'
    { $sel:acceleratorType:AcceleratorTypeOffering' :: Maybe Text
acceleratorType =
        forall a. Maybe a
Prelude.Nothing,
      $sel:location:AcceleratorTypeOffering' :: Maybe Text
location = forall a. Maybe a
Prelude.Nothing,
      $sel:locationType:AcceleratorTypeOffering' :: Maybe LocationType
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 :: Lens' AcceleratorTypeOffering (Maybe Text)
acceleratorTypeOffering_acceleratorType = 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 :: Lens' AcceleratorTypeOffering (Maybe Text)
acceleratorTypeOffering_location = 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 :: Lens' AcceleratorTypeOffering (Maybe LocationType)
acceleratorTypeOffering_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 Data.FromJSON AcceleratorTypeOffering where
  parseJSON :: Value -> Parser AcceleratorTypeOffering
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AcceleratorTypeOffering"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe LocationType -> AcceleratorTypeOffering
AcceleratorTypeOffering'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"acceleratorType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"location")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"locationType")
      )

instance Prelude.Hashable AcceleratorTypeOffering where
  hashWithSalt :: Int -> AcceleratorTypeOffering -> Int
hashWithSalt Int
_salt AcceleratorTypeOffering' {Maybe Text
Maybe LocationType
locationType :: Maybe LocationType
location :: Maybe Text
acceleratorType :: Maybe Text
$sel:locationType:AcceleratorTypeOffering' :: AcceleratorTypeOffering -> Maybe LocationType
$sel:location:AcceleratorTypeOffering' :: AcceleratorTypeOffering -> Maybe Text
$sel:acceleratorType:AcceleratorTypeOffering' :: AcceleratorTypeOffering -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
acceleratorType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
location
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LocationType
locationType

instance Prelude.NFData AcceleratorTypeOffering where
  rnf :: AcceleratorTypeOffering -> ()
rnf AcceleratorTypeOffering' {Maybe Text
Maybe LocationType
locationType :: Maybe LocationType
location :: Maybe Text
acceleratorType :: Maybe Text
$sel:locationType:AcceleratorTypeOffering' :: AcceleratorTypeOffering -> Maybe LocationType
$sel:location:AcceleratorTypeOffering' :: AcceleratorTypeOffering -> Maybe Text
$sel:acceleratorType:AcceleratorTypeOffering' :: AcceleratorTypeOffering -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
acceleratorType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
location
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LocationType
locationType