{-# 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.ElasticBeanstalk.Types.PlatformProgrammingLanguage
-- 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.ElasticBeanstalk.Types.PlatformProgrammingLanguage where

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

-- | A programming language supported by the platform.
--
-- /See:/ 'newPlatformProgrammingLanguage' smart constructor.
data PlatformProgrammingLanguage = PlatformProgrammingLanguage'
  { -- | The name of the programming language.
    PlatformProgrammingLanguage -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The version of the programming language.
    PlatformProgrammingLanguage -> Maybe Text
version :: Prelude.Maybe Prelude.Text
  }
  deriving (PlatformProgrammingLanguage -> PlatformProgrammingLanguage -> Bool
(PlatformProgrammingLanguage
 -> PlatformProgrammingLanguage -> Bool)
-> (PlatformProgrammingLanguage
    -> PlatformProgrammingLanguage -> Bool)
-> Eq PlatformProgrammingLanguage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PlatformProgrammingLanguage -> PlatformProgrammingLanguage -> Bool
$c/= :: PlatformProgrammingLanguage -> PlatformProgrammingLanguage -> Bool
== :: PlatformProgrammingLanguage -> PlatformProgrammingLanguage -> Bool
$c== :: PlatformProgrammingLanguage -> PlatformProgrammingLanguage -> Bool
Prelude.Eq, ReadPrec [PlatformProgrammingLanguage]
ReadPrec PlatformProgrammingLanguage
Int -> ReadS PlatformProgrammingLanguage
ReadS [PlatformProgrammingLanguage]
(Int -> ReadS PlatformProgrammingLanguage)
-> ReadS [PlatformProgrammingLanguage]
-> ReadPrec PlatformProgrammingLanguage
-> ReadPrec [PlatformProgrammingLanguage]
-> Read PlatformProgrammingLanguage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PlatformProgrammingLanguage]
$creadListPrec :: ReadPrec [PlatformProgrammingLanguage]
readPrec :: ReadPrec PlatformProgrammingLanguage
$creadPrec :: ReadPrec PlatformProgrammingLanguage
readList :: ReadS [PlatformProgrammingLanguage]
$creadList :: ReadS [PlatformProgrammingLanguage]
readsPrec :: Int -> ReadS PlatformProgrammingLanguage
$creadsPrec :: Int -> ReadS PlatformProgrammingLanguage
Prelude.Read, Int -> PlatformProgrammingLanguage -> ShowS
[PlatformProgrammingLanguage] -> ShowS
PlatformProgrammingLanguage -> String
(Int -> PlatformProgrammingLanguage -> ShowS)
-> (PlatformProgrammingLanguage -> String)
-> ([PlatformProgrammingLanguage] -> ShowS)
-> Show PlatformProgrammingLanguage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PlatformProgrammingLanguage] -> ShowS
$cshowList :: [PlatformProgrammingLanguage] -> ShowS
show :: PlatformProgrammingLanguage -> String
$cshow :: PlatformProgrammingLanguage -> String
showsPrec :: Int -> PlatformProgrammingLanguage -> ShowS
$cshowsPrec :: Int -> PlatformProgrammingLanguage -> ShowS
Prelude.Show, (forall x.
 PlatformProgrammingLanguage -> Rep PlatformProgrammingLanguage x)
-> (forall x.
    Rep PlatformProgrammingLanguage x -> PlatformProgrammingLanguage)
-> Generic PlatformProgrammingLanguage
forall x.
Rep PlatformProgrammingLanguage x -> PlatformProgrammingLanguage
forall x.
PlatformProgrammingLanguage -> Rep PlatformProgrammingLanguage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PlatformProgrammingLanguage x -> PlatformProgrammingLanguage
$cfrom :: forall x.
PlatformProgrammingLanguage -> Rep PlatformProgrammingLanguage x
Prelude.Generic)

-- |
-- Create a value of 'PlatformProgrammingLanguage' 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', 'platformProgrammingLanguage_name' - The name of the programming language.
--
-- 'version', 'platformProgrammingLanguage_version' - The version of the programming language.
newPlatformProgrammingLanguage ::
  PlatformProgrammingLanguage
newPlatformProgrammingLanguage :: PlatformProgrammingLanguage
newPlatformProgrammingLanguage =
  PlatformProgrammingLanguage' :: Maybe Text -> Maybe Text -> PlatformProgrammingLanguage
PlatformProgrammingLanguage'
    { $sel:name:PlatformProgrammingLanguage' :: Maybe Text
name =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:PlatformProgrammingLanguage' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the programming language.
platformProgrammingLanguage_name :: Lens.Lens' PlatformProgrammingLanguage (Prelude.Maybe Prelude.Text)
platformProgrammingLanguage_name :: (Maybe Text -> f (Maybe Text))
-> PlatformProgrammingLanguage -> f PlatformProgrammingLanguage
platformProgrammingLanguage_name = (PlatformProgrammingLanguage -> Maybe Text)
-> (PlatformProgrammingLanguage
    -> Maybe Text -> PlatformProgrammingLanguage)
-> Lens
     PlatformProgrammingLanguage
     PlatformProgrammingLanguage
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlatformProgrammingLanguage' {Maybe Text
name :: Maybe Text
$sel:name:PlatformProgrammingLanguage' :: PlatformProgrammingLanguage -> Maybe Text
name} -> Maybe Text
name) (\s :: PlatformProgrammingLanguage
s@PlatformProgrammingLanguage' {} Maybe Text
a -> PlatformProgrammingLanguage
s {$sel:name:PlatformProgrammingLanguage' :: Maybe Text
name = Maybe Text
a} :: PlatformProgrammingLanguage)

-- | The version of the programming language.
platformProgrammingLanguage_version :: Lens.Lens' PlatformProgrammingLanguage (Prelude.Maybe Prelude.Text)
platformProgrammingLanguage_version :: (Maybe Text -> f (Maybe Text))
-> PlatformProgrammingLanguage -> f PlatformProgrammingLanguage
platformProgrammingLanguage_version = (PlatformProgrammingLanguage -> Maybe Text)
-> (PlatformProgrammingLanguage
    -> Maybe Text -> PlatformProgrammingLanguage)
-> Lens
     PlatformProgrammingLanguage
     PlatformProgrammingLanguage
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlatformProgrammingLanguage' {Maybe Text
version :: Maybe Text
$sel:version:PlatformProgrammingLanguage' :: PlatformProgrammingLanguage -> Maybe Text
version} -> Maybe Text
version) (\s :: PlatformProgrammingLanguage
s@PlatformProgrammingLanguage' {} Maybe Text
a -> PlatformProgrammingLanguage
s {$sel:version:PlatformProgrammingLanguage' :: Maybe Text
version = Maybe Text
a} :: PlatformProgrammingLanguage)

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

instance Prelude.Hashable PlatformProgrammingLanguage

instance Prelude.NFData PlatformProgrammingLanguage