{-# 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.CostExplorer.Types.RedshiftInstanceDetails
-- 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.CostExplorer.Types.RedshiftInstanceDetails where

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

-- | Details about the Amazon Redshift instances that Amazon Web Services
-- recommends that you purchase.
--
-- /See:/ 'newRedshiftInstanceDetails' smart constructor.
data RedshiftInstanceDetails = RedshiftInstanceDetails'
  { -- | Determines whether the recommendation is for a current-generation
    -- instance.
    RedshiftInstanceDetails -> Maybe Bool
currentGeneration :: Prelude.Maybe Prelude.Bool,
    -- | The instance family of the recommended reservation.
    RedshiftInstanceDetails -> Maybe Text
family :: Prelude.Maybe Prelude.Text,
    -- | Determines whether the recommended reservation is size flexible.
    RedshiftInstanceDetails -> Maybe Bool
sizeFlexEligible :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Web Services Region of the recommended reservation.
    RedshiftInstanceDetails -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | The type of node that Amazon Web Services recommends.
    RedshiftInstanceDetails -> Maybe Text
nodeType :: Prelude.Maybe Prelude.Text
  }
  deriving (RedshiftInstanceDetails -> RedshiftInstanceDetails -> Bool
(RedshiftInstanceDetails -> RedshiftInstanceDetails -> Bool)
-> (RedshiftInstanceDetails -> RedshiftInstanceDetails -> Bool)
-> Eq RedshiftInstanceDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RedshiftInstanceDetails -> RedshiftInstanceDetails -> Bool
$c/= :: RedshiftInstanceDetails -> RedshiftInstanceDetails -> Bool
== :: RedshiftInstanceDetails -> RedshiftInstanceDetails -> Bool
$c== :: RedshiftInstanceDetails -> RedshiftInstanceDetails -> Bool
Prelude.Eq, ReadPrec [RedshiftInstanceDetails]
ReadPrec RedshiftInstanceDetails
Int -> ReadS RedshiftInstanceDetails
ReadS [RedshiftInstanceDetails]
(Int -> ReadS RedshiftInstanceDetails)
-> ReadS [RedshiftInstanceDetails]
-> ReadPrec RedshiftInstanceDetails
-> ReadPrec [RedshiftInstanceDetails]
-> Read RedshiftInstanceDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RedshiftInstanceDetails]
$creadListPrec :: ReadPrec [RedshiftInstanceDetails]
readPrec :: ReadPrec RedshiftInstanceDetails
$creadPrec :: ReadPrec RedshiftInstanceDetails
readList :: ReadS [RedshiftInstanceDetails]
$creadList :: ReadS [RedshiftInstanceDetails]
readsPrec :: Int -> ReadS RedshiftInstanceDetails
$creadsPrec :: Int -> ReadS RedshiftInstanceDetails
Prelude.Read, Int -> RedshiftInstanceDetails -> ShowS
[RedshiftInstanceDetails] -> ShowS
RedshiftInstanceDetails -> String
(Int -> RedshiftInstanceDetails -> ShowS)
-> (RedshiftInstanceDetails -> String)
-> ([RedshiftInstanceDetails] -> ShowS)
-> Show RedshiftInstanceDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RedshiftInstanceDetails] -> ShowS
$cshowList :: [RedshiftInstanceDetails] -> ShowS
show :: RedshiftInstanceDetails -> String
$cshow :: RedshiftInstanceDetails -> String
showsPrec :: Int -> RedshiftInstanceDetails -> ShowS
$cshowsPrec :: Int -> RedshiftInstanceDetails -> ShowS
Prelude.Show, (forall x.
 RedshiftInstanceDetails -> Rep RedshiftInstanceDetails x)
-> (forall x.
    Rep RedshiftInstanceDetails x -> RedshiftInstanceDetails)
-> Generic RedshiftInstanceDetails
forall x. Rep RedshiftInstanceDetails x -> RedshiftInstanceDetails
forall x. RedshiftInstanceDetails -> Rep RedshiftInstanceDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RedshiftInstanceDetails x -> RedshiftInstanceDetails
$cfrom :: forall x. RedshiftInstanceDetails -> Rep RedshiftInstanceDetails x
Prelude.Generic)

-- |
-- Create a value of 'RedshiftInstanceDetails' 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:
--
-- 'currentGeneration', 'redshiftInstanceDetails_currentGeneration' - Determines whether the recommendation is for a current-generation
-- instance.
--
-- 'family', 'redshiftInstanceDetails_family' - The instance family of the recommended reservation.
--
-- 'sizeFlexEligible', 'redshiftInstanceDetails_sizeFlexEligible' - Determines whether the recommended reservation is size flexible.
--
-- 'region', 'redshiftInstanceDetails_region' - The Amazon Web Services Region of the recommended reservation.
--
-- 'nodeType', 'redshiftInstanceDetails_nodeType' - The type of node that Amazon Web Services recommends.
newRedshiftInstanceDetails ::
  RedshiftInstanceDetails
newRedshiftInstanceDetails :: RedshiftInstanceDetails
newRedshiftInstanceDetails =
  RedshiftInstanceDetails' :: Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> RedshiftInstanceDetails
RedshiftInstanceDetails'
    { $sel:currentGeneration:RedshiftInstanceDetails' :: Maybe Bool
currentGeneration =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:family:RedshiftInstanceDetails' :: Maybe Text
family = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sizeFlexEligible:RedshiftInstanceDetails' :: Maybe Bool
sizeFlexEligible = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:region:RedshiftInstanceDetails' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nodeType:RedshiftInstanceDetails' :: Maybe Text
nodeType = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Determines whether the recommendation is for a current-generation
-- instance.
redshiftInstanceDetails_currentGeneration :: Lens.Lens' RedshiftInstanceDetails (Prelude.Maybe Prelude.Bool)
redshiftInstanceDetails_currentGeneration :: (Maybe Bool -> f (Maybe Bool))
-> RedshiftInstanceDetails -> f RedshiftInstanceDetails
redshiftInstanceDetails_currentGeneration = (RedshiftInstanceDetails -> Maybe Bool)
-> (RedshiftInstanceDetails
    -> Maybe Bool -> RedshiftInstanceDetails)
-> Lens
     RedshiftInstanceDetails
     RedshiftInstanceDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftInstanceDetails' {Maybe Bool
currentGeneration :: Maybe Bool
$sel:currentGeneration:RedshiftInstanceDetails' :: RedshiftInstanceDetails -> Maybe Bool
currentGeneration} -> Maybe Bool
currentGeneration) (\s :: RedshiftInstanceDetails
s@RedshiftInstanceDetails' {} Maybe Bool
a -> RedshiftInstanceDetails
s {$sel:currentGeneration:RedshiftInstanceDetails' :: Maybe Bool
currentGeneration = Maybe Bool
a} :: RedshiftInstanceDetails)

-- | The instance family of the recommended reservation.
redshiftInstanceDetails_family :: Lens.Lens' RedshiftInstanceDetails (Prelude.Maybe Prelude.Text)
redshiftInstanceDetails_family :: (Maybe Text -> f (Maybe Text))
-> RedshiftInstanceDetails -> f RedshiftInstanceDetails
redshiftInstanceDetails_family = (RedshiftInstanceDetails -> Maybe Text)
-> (RedshiftInstanceDetails
    -> Maybe Text -> RedshiftInstanceDetails)
-> Lens
     RedshiftInstanceDetails
     RedshiftInstanceDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftInstanceDetails' {Maybe Text
family :: Maybe Text
$sel:family:RedshiftInstanceDetails' :: RedshiftInstanceDetails -> Maybe Text
family} -> Maybe Text
family) (\s :: RedshiftInstanceDetails
s@RedshiftInstanceDetails' {} Maybe Text
a -> RedshiftInstanceDetails
s {$sel:family:RedshiftInstanceDetails' :: Maybe Text
family = Maybe Text
a} :: RedshiftInstanceDetails)

-- | Determines whether the recommended reservation is size flexible.
redshiftInstanceDetails_sizeFlexEligible :: Lens.Lens' RedshiftInstanceDetails (Prelude.Maybe Prelude.Bool)
redshiftInstanceDetails_sizeFlexEligible :: (Maybe Bool -> f (Maybe Bool))
-> RedshiftInstanceDetails -> f RedshiftInstanceDetails
redshiftInstanceDetails_sizeFlexEligible = (RedshiftInstanceDetails -> Maybe Bool)
-> (RedshiftInstanceDetails
    -> Maybe Bool -> RedshiftInstanceDetails)
-> Lens
     RedshiftInstanceDetails
     RedshiftInstanceDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftInstanceDetails' {Maybe Bool
sizeFlexEligible :: Maybe Bool
$sel:sizeFlexEligible:RedshiftInstanceDetails' :: RedshiftInstanceDetails -> Maybe Bool
sizeFlexEligible} -> Maybe Bool
sizeFlexEligible) (\s :: RedshiftInstanceDetails
s@RedshiftInstanceDetails' {} Maybe Bool
a -> RedshiftInstanceDetails
s {$sel:sizeFlexEligible:RedshiftInstanceDetails' :: Maybe Bool
sizeFlexEligible = Maybe Bool
a} :: RedshiftInstanceDetails)

-- | The Amazon Web Services Region of the recommended reservation.
redshiftInstanceDetails_region :: Lens.Lens' RedshiftInstanceDetails (Prelude.Maybe Prelude.Text)
redshiftInstanceDetails_region :: (Maybe Text -> f (Maybe Text))
-> RedshiftInstanceDetails -> f RedshiftInstanceDetails
redshiftInstanceDetails_region = (RedshiftInstanceDetails -> Maybe Text)
-> (RedshiftInstanceDetails
    -> Maybe Text -> RedshiftInstanceDetails)
-> Lens
     RedshiftInstanceDetails
     RedshiftInstanceDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftInstanceDetails' {Maybe Text
region :: Maybe Text
$sel:region:RedshiftInstanceDetails' :: RedshiftInstanceDetails -> Maybe Text
region} -> Maybe Text
region) (\s :: RedshiftInstanceDetails
s@RedshiftInstanceDetails' {} Maybe Text
a -> RedshiftInstanceDetails
s {$sel:region:RedshiftInstanceDetails' :: Maybe Text
region = Maybe Text
a} :: RedshiftInstanceDetails)

-- | The type of node that Amazon Web Services recommends.
redshiftInstanceDetails_nodeType :: Lens.Lens' RedshiftInstanceDetails (Prelude.Maybe Prelude.Text)
redshiftInstanceDetails_nodeType :: (Maybe Text -> f (Maybe Text))
-> RedshiftInstanceDetails -> f RedshiftInstanceDetails
redshiftInstanceDetails_nodeType = (RedshiftInstanceDetails -> Maybe Text)
-> (RedshiftInstanceDetails
    -> Maybe Text -> RedshiftInstanceDetails)
-> Lens
     RedshiftInstanceDetails
     RedshiftInstanceDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RedshiftInstanceDetails' {Maybe Text
nodeType :: Maybe Text
$sel:nodeType:RedshiftInstanceDetails' :: RedshiftInstanceDetails -> Maybe Text
nodeType} -> Maybe Text
nodeType) (\s :: RedshiftInstanceDetails
s@RedshiftInstanceDetails' {} Maybe Text
a -> RedshiftInstanceDetails
s {$sel:nodeType:RedshiftInstanceDetails' :: Maybe Text
nodeType = Maybe Text
a} :: RedshiftInstanceDetails)

instance Core.FromJSON RedshiftInstanceDetails where
  parseJSON :: Value -> Parser RedshiftInstanceDetails
parseJSON =
    String
-> (Object -> Parser RedshiftInstanceDetails)
-> Value
-> Parser RedshiftInstanceDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RedshiftInstanceDetails"
      ( \Object
x ->
          Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> RedshiftInstanceDetails
RedshiftInstanceDetails'
            (Maybe Bool
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> RedshiftInstanceDetails)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> RedshiftInstanceDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CurrentGeneration")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> RedshiftInstanceDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool -> Maybe Text -> Maybe Text -> RedshiftInstanceDetails)
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
"Family")
            Parser
  (Maybe Bool -> Maybe Text -> Maybe Text -> RedshiftInstanceDetails)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Maybe Text -> RedshiftInstanceDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SizeFlexEligible")
            Parser (Maybe Text -> Maybe Text -> RedshiftInstanceDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> RedshiftInstanceDetails)
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
"Region")
            Parser (Maybe Text -> RedshiftInstanceDetails)
-> Parser (Maybe Text) -> Parser RedshiftInstanceDetails
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
"NodeType")
      )

instance Prelude.Hashable RedshiftInstanceDetails

instance Prelude.NFData RedshiftInstanceDetails