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

-- | 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
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]
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
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. 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'
    { $sel:name:PlatformFramework' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:version:PlatformFramework' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the framework.
platformFramework_name :: Lens.Lens' PlatformFramework (Prelude.Maybe Prelude.Text)
platformFramework_name :: Lens' PlatformFramework (Maybe Text)
platformFramework_name = 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 :: Lens' PlatformFramework (Maybe Text)
platformFramework_version = 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 Data.FromXML PlatformFramework where
  parseXML :: [Node] -> Either String PlatformFramework
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> PlatformFramework
PlatformFramework'
      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")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Version")

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

instance Prelude.NFData PlatformFramework where
  rnf :: PlatformFramework -> ()
rnf PlatformFramework' {Maybe Text
version :: Maybe Text
name :: Maybe Text
$sel:version:PlatformFramework' :: PlatformFramework -> Maybe Text
$sel:name:PlatformFramework' :: PlatformFramework -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version