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

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

-- | Summary information about a platform branch.
--
-- /See:/ 'newPlatformBranchSummary' smart constructor.
data PlatformBranchSummary = PlatformBranchSummary'
  { -- | The name of the platform branch.
    PlatformBranchSummary -> Maybe Text
branchName :: Prelude.Maybe Prelude.Text,
    -- | An ordinal number that designates the order in which platform branches
    -- have been added to a platform. This can be helpful, for example, if your
    -- code calls the @ListPlatformBranches@ action and then displays a list of
    -- platform branches.
    --
    -- A larger @BranchOrder@ value designates a newer platform branch within
    -- the platform.
    PlatformBranchSummary -> Maybe Int
branchOrder :: Prelude.Maybe Prelude.Int,
    -- | The name of the platform to which this platform branch belongs.
    PlatformBranchSummary -> Maybe Text
platformName :: Prelude.Maybe Prelude.Text,
    -- | The environment tiers that platform versions in this branch support.
    --
    -- Possible values: @WebServer\/Standard@ | @Worker\/SQS\/HTTP@
    PlatformBranchSummary -> Maybe [Text]
supportedTierList :: Prelude.Maybe [Prelude.Text],
    -- | The support life cycle state of the platform branch.
    --
    -- Possible values: @beta@ | @supported@ | @deprecated@ | @retired@
    PlatformBranchSummary -> Maybe Text
lifecycleState :: Prelude.Maybe Prelude.Text
  }
  deriving (PlatformBranchSummary -> PlatformBranchSummary -> Bool
(PlatformBranchSummary -> PlatformBranchSummary -> Bool)
-> (PlatformBranchSummary -> PlatformBranchSummary -> Bool)
-> Eq PlatformBranchSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PlatformBranchSummary -> PlatformBranchSummary -> Bool
$c/= :: PlatformBranchSummary -> PlatformBranchSummary -> Bool
== :: PlatformBranchSummary -> PlatformBranchSummary -> Bool
$c== :: PlatformBranchSummary -> PlatformBranchSummary -> Bool
Prelude.Eq, ReadPrec [PlatformBranchSummary]
ReadPrec PlatformBranchSummary
Int -> ReadS PlatformBranchSummary
ReadS [PlatformBranchSummary]
(Int -> ReadS PlatformBranchSummary)
-> ReadS [PlatformBranchSummary]
-> ReadPrec PlatformBranchSummary
-> ReadPrec [PlatformBranchSummary]
-> Read PlatformBranchSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PlatformBranchSummary]
$creadListPrec :: ReadPrec [PlatformBranchSummary]
readPrec :: ReadPrec PlatformBranchSummary
$creadPrec :: ReadPrec PlatformBranchSummary
readList :: ReadS [PlatformBranchSummary]
$creadList :: ReadS [PlatformBranchSummary]
readsPrec :: Int -> ReadS PlatformBranchSummary
$creadsPrec :: Int -> ReadS PlatformBranchSummary
Prelude.Read, Int -> PlatformBranchSummary -> ShowS
[PlatformBranchSummary] -> ShowS
PlatformBranchSummary -> String
(Int -> PlatformBranchSummary -> ShowS)
-> (PlatformBranchSummary -> String)
-> ([PlatformBranchSummary] -> ShowS)
-> Show PlatformBranchSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PlatformBranchSummary] -> ShowS
$cshowList :: [PlatformBranchSummary] -> ShowS
show :: PlatformBranchSummary -> String
$cshow :: PlatformBranchSummary -> String
showsPrec :: Int -> PlatformBranchSummary -> ShowS
$cshowsPrec :: Int -> PlatformBranchSummary -> ShowS
Prelude.Show, (forall x. PlatformBranchSummary -> Rep PlatformBranchSummary x)
-> (forall x. Rep PlatformBranchSummary x -> PlatformBranchSummary)
-> Generic PlatformBranchSummary
forall x. Rep PlatformBranchSummary x -> PlatformBranchSummary
forall x. PlatformBranchSummary -> Rep PlatformBranchSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PlatformBranchSummary x -> PlatformBranchSummary
$cfrom :: forall x. PlatformBranchSummary -> Rep PlatformBranchSummary x
Prelude.Generic)

-- |
-- Create a value of 'PlatformBranchSummary' 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:
--
-- 'branchName', 'platformBranchSummary_branchName' - The name of the platform branch.
--
-- 'branchOrder', 'platformBranchSummary_branchOrder' - An ordinal number that designates the order in which platform branches
-- have been added to a platform. This can be helpful, for example, if your
-- code calls the @ListPlatformBranches@ action and then displays a list of
-- platform branches.
--
-- A larger @BranchOrder@ value designates a newer platform branch within
-- the platform.
--
-- 'platformName', 'platformBranchSummary_platformName' - The name of the platform to which this platform branch belongs.
--
-- 'supportedTierList', 'platformBranchSummary_supportedTierList' - The environment tiers that platform versions in this branch support.
--
-- Possible values: @WebServer\/Standard@ | @Worker\/SQS\/HTTP@
--
-- 'lifecycleState', 'platformBranchSummary_lifecycleState' - The support life cycle state of the platform branch.
--
-- Possible values: @beta@ | @supported@ | @deprecated@ | @retired@
newPlatformBranchSummary ::
  PlatformBranchSummary
newPlatformBranchSummary :: PlatformBranchSummary
newPlatformBranchSummary =
  PlatformBranchSummary' :: Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> PlatformBranchSummary
PlatformBranchSummary'
    { $sel:branchName:PlatformBranchSummary' :: Maybe Text
branchName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:branchOrder:PlatformBranchSummary' :: Maybe Int
branchOrder = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:platformName:PlatformBranchSummary' :: Maybe Text
platformName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:supportedTierList:PlatformBranchSummary' :: Maybe [Text]
supportedTierList = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:lifecycleState:PlatformBranchSummary' :: Maybe Text
lifecycleState = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the platform branch.
platformBranchSummary_branchName :: Lens.Lens' PlatformBranchSummary (Prelude.Maybe Prelude.Text)
platformBranchSummary_branchName :: (Maybe Text -> f (Maybe Text))
-> PlatformBranchSummary -> f PlatformBranchSummary
platformBranchSummary_branchName = (PlatformBranchSummary -> Maybe Text)
-> (PlatformBranchSummary -> Maybe Text -> PlatformBranchSummary)
-> Lens
     PlatformBranchSummary
     PlatformBranchSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlatformBranchSummary' {Maybe Text
branchName :: Maybe Text
$sel:branchName:PlatformBranchSummary' :: PlatformBranchSummary -> Maybe Text
branchName} -> Maybe Text
branchName) (\s :: PlatformBranchSummary
s@PlatformBranchSummary' {} Maybe Text
a -> PlatformBranchSummary
s {$sel:branchName:PlatformBranchSummary' :: Maybe Text
branchName = Maybe Text
a} :: PlatformBranchSummary)

-- | An ordinal number that designates the order in which platform branches
-- have been added to a platform. This can be helpful, for example, if your
-- code calls the @ListPlatformBranches@ action and then displays a list of
-- platform branches.
--
-- A larger @BranchOrder@ value designates a newer platform branch within
-- the platform.
platformBranchSummary_branchOrder :: Lens.Lens' PlatformBranchSummary (Prelude.Maybe Prelude.Int)
platformBranchSummary_branchOrder :: (Maybe Int -> f (Maybe Int))
-> PlatformBranchSummary -> f PlatformBranchSummary
platformBranchSummary_branchOrder = (PlatformBranchSummary -> Maybe Int)
-> (PlatformBranchSummary -> Maybe Int -> PlatformBranchSummary)
-> Lens
     PlatformBranchSummary PlatformBranchSummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlatformBranchSummary' {Maybe Int
branchOrder :: Maybe Int
$sel:branchOrder:PlatformBranchSummary' :: PlatformBranchSummary -> Maybe Int
branchOrder} -> Maybe Int
branchOrder) (\s :: PlatformBranchSummary
s@PlatformBranchSummary' {} Maybe Int
a -> PlatformBranchSummary
s {$sel:branchOrder:PlatformBranchSummary' :: Maybe Int
branchOrder = Maybe Int
a} :: PlatformBranchSummary)

-- | The name of the platform to which this platform branch belongs.
platformBranchSummary_platformName :: Lens.Lens' PlatformBranchSummary (Prelude.Maybe Prelude.Text)
platformBranchSummary_platformName :: (Maybe Text -> f (Maybe Text))
-> PlatformBranchSummary -> f PlatformBranchSummary
platformBranchSummary_platformName = (PlatformBranchSummary -> Maybe Text)
-> (PlatformBranchSummary -> Maybe Text -> PlatformBranchSummary)
-> Lens
     PlatformBranchSummary
     PlatformBranchSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlatformBranchSummary' {Maybe Text
platformName :: Maybe Text
$sel:platformName:PlatformBranchSummary' :: PlatformBranchSummary -> Maybe Text
platformName} -> Maybe Text
platformName) (\s :: PlatformBranchSummary
s@PlatformBranchSummary' {} Maybe Text
a -> PlatformBranchSummary
s {$sel:platformName:PlatformBranchSummary' :: Maybe Text
platformName = Maybe Text
a} :: PlatformBranchSummary)

-- | The environment tiers that platform versions in this branch support.
--
-- Possible values: @WebServer\/Standard@ | @Worker\/SQS\/HTTP@
platformBranchSummary_supportedTierList :: Lens.Lens' PlatformBranchSummary (Prelude.Maybe [Prelude.Text])
platformBranchSummary_supportedTierList :: (Maybe [Text] -> f (Maybe [Text]))
-> PlatformBranchSummary -> f PlatformBranchSummary
platformBranchSummary_supportedTierList = (PlatformBranchSummary -> Maybe [Text])
-> (PlatformBranchSummary -> Maybe [Text] -> PlatformBranchSummary)
-> Lens
     PlatformBranchSummary
     PlatformBranchSummary
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlatformBranchSummary' {Maybe [Text]
supportedTierList :: Maybe [Text]
$sel:supportedTierList:PlatformBranchSummary' :: PlatformBranchSummary -> Maybe [Text]
supportedTierList} -> Maybe [Text]
supportedTierList) (\s :: PlatformBranchSummary
s@PlatformBranchSummary' {} Maybe [Text]
a -> PlatformBranchSummary
s {$sel:supportedTierList:PlatformBranchSummary' :: Maybe [Text]
supportedTierList = Maybe [Text]
a} :: PlatformBranchSummary) ((Maybe [Text] -> f (Maybe [Text]))
 -> PlatformBranchSummary -> f PlatformBranchSummary)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> PlatformBranchSummary
-> f PlatformBranchSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The support life cycle state of the platform branch.
--
-- Possible values: @beta@ | @supported@ | @deprecated@ | @retired@
platformBranchSummary_lifecycleState :: Lens.Lens' PlatformBranchSummary (Prelude.Maybe Prelude.Text)
platformBranchSummary_lifecycleState :: (Maybe Text -> f (Maybe Text))
-> PlatformBranchSummary -> f PlatformBranchSummary
platformBranchSummary_lifecycleState = (PlatformBranchSummary -> Maybe Text)
-> (PlatformBranchSummary -> Maybe Text -> PlatformBranchSummary)
-> Lens
     PlatformBranchSummary
     PlatformBranchSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PlatformBranchSummary' {Maybe Text
lifecycleState :: Maybe Text
$sel:lifecycleState:PlatformBranchSummary' :: PlatformBranchSummary -> Maybe Text
lifecycleState} -> Maybe Text
lifecycleState) (\s :: PlatformBranchSummary
s@PlatformBranchSummary' {} Maybe Text
a -> PlatformBranchSummary
s {$sel:lifecycleState:PlatformBranchSummary' :: Maybe Text
lifecycleState = Maybe Text
a} :: PlatformBranchSummary)

instance Core.FromXML PlatformBranchSummary where
  parseXML :: [Node] -> Either String PlatformBranchSummary
parseXML [Node]
x =
    Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> PlatformBranchSummary
PlatformBranchSummary'
      (Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> PlatformBranchSummary)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Int
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> PlatformBranchSummary)
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
"BranchName")
      Either
  String
  (Maybe Int
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> PlatformBranchSummary)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe Text -> Maybe [Text] -> Maybe Text -> PlatformBranchSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"BranchOrder")
      Either
  String
  (Maybe Text -> Maybe [Text] -> Maybe Text -> PlatformBranchSummary)
-> Either String (Maybe Text)
-> Either
     String (Maybe [Text] -> Maybe Text -> PlatformBranchSummary)
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
"PlatformName")
      Either String (Maybe [Text] -> Maybe Text -> PlatformBranchSummary)
-> Either String (Maybe [Text])
-> Either String (Maybe Text -> PlatformBranchSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SupportedTierList"
                      Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either String (Maybe Text -> PlatformBranchSummary)
-> Either String (Maybe Text)
-> Either String PlatformBranchSummary
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
"LifecycleState")

instance Prelude.Hashable PlatformBranchSummary

instance Prelude.NFData PlatformBranchSummary