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

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

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

-- |
-- Create a value of 'PlatformFramework' 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', 'platformFramework_name' - The name of the framework.
--
-- 'version', 'platformFramework_version' - The version of the framework.
newPlatformFramework ::
  PlatformFramework
newPlatformFramework :: PlatformFramework
newPlatformFramework =
  PlatformFramework' :: Maybe Text -> Maybe Text -> PlatformFramework
PlatformFramework'
    { $sel:name:PlatformFramework' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:PlatformFramework' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

instance Core.FromXML PlatformFramework where
  parseXML :: [Node] -> Either String PlatformFramework
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> PlatformFramework
PlatformFramework'
      (Maybe Text -> Maybe Text -> PlatformFramework)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> PlatformFramework)
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 -> PlatformFramework)
-> Either String (Maybe Text) -> Either String PlatformFramework
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 PlatformFramework

instance Prelude.NFData PlatformFramework