{-# 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.Redshift.Types.SupportedPlatform
-- 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.Redshift.Types.SupportedPlatform where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Internal

-- | A list of supported platforms for orderable clusters.
--
-- /See:/ 'newSupportedPlatform' smart constructor.
data SupportedPlatform = SupportedPlatform'
  { SupportedPlatform -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (SupportedPlatform -> SupportedPlatform -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SupportedPlatform -> SupportedPlatform -> Bool
$c/= :: SupportedPlatform -> SupportedPlatform -> Bool
== :: SupportedPlatform -> SupportedPlatform -> Bool
$c== :: SupportedPlatform -> SupportedPlatform -> Bool
Prelude.Eq, ReadPrec [SupportedPlatform]
ReadPrec SupportedPlatform
Int -> ReadS SupportedPlatform
ReadS [SupportedPlatform]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SupportedPlatform]
$creadListPrec :: ReadPrec [SupportedPlatform]
readPrec :: ReadPrec SupportedPlatform
$creadPrec :: ReadPrec SupportedPlatform
readList :: ReadS [SupportedPlatform]
$creadList :: ReadS [SupportedPlatform]
readsPrec :: Int -> ReadS SupportedPlatform
$creadsPrec :: Int -> ReadS SupportedPlatform
Prelude.Read, Int -> SupportedPlatform -> ShowS
[SupportedPlatform] -> ShowS
SupportedPlatform -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SupportedPlatform] -> ShowS
$cshowList :: [SupportedPlatform] -> ShowS
show :: SupportedPlatform -> String
$cshow :: SupportedPlatform -> String
showsPrec :: Int -> SupportedPlatform -> ShowS
$cshowsPrec :: Int -> SupportedPlatform -> ShowS
Prelude.Show, forall x. Rep SupportedPlatform x -> SupportedPlatform
forall x. SupportedPlatform -> Rep SupportedPlatform x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SupportedPlatform x -> SupportedPlatform
$cfrom :: forall x. SupportedPlatform -> Rep SupportedPlatform x
Prelude.Generic)

-- |
-- Create a value of 'SupportedPlatform' 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:
--
-- 'name', 'supportedPlatform_name' -
newSupportedPlatform ::
  SupportedPlatform
newSupportedPlatform :: SupportedPlatform
newSupportedPlatform =
  SupportedPlatform' {$sel:name:SupportedPlatform' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing}

supportedPlatform_name :: Lens.Lens' SupportedPlatform (Prelude.Maybe Prelude.Text)
supportedPlatform_name :: Lens' SupportedPlatform (Maybe Text)
supportedPlatform_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SupportedPlatform' {Maybe Text
name :: Maybe Text
$sel:name:SupportedPlatform' :: SupportedPlatform -> Maybe Text
name} -> Maybe Text
name) (\s :: SupportedPlatform
s@SupportedPlatform' {} Maybe Text
a -> SupportedPlatform
s {$sel:name:SupportedPlatform' :: Maybe Text
name = Maybe Text
a} :: SupportedPlatform)

instance Data.FromXML SupportedPlatform where
  parseXML :: [Node] -> Either String SupportedPlatform
parseXML [Node]
x =
    Maybe Text -> SupportedPlatform
SupportedPlatform' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Name")

instance Prelude.Hashable SupportedPlatform where
  hashWithSalt :: Int -> SupportedPlatform -> Int
hashWithSalt Int
_salt SupportedPlatform' {Maybe Text
name :: Maybe Text
$sel:name:SupportedPlatform' :: SupportedPlatform -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData SupportedPlatform where
  rnf :: SupportedPlatform -> ()
rnf SupportedPlatform' {Maybe Text
name :: Maybe Text
$sel:name:SupportedPlatform' :: SupportedPlatform -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name