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

import qualified Amazonka.Core as Core
import Amazonka.ElasticBeanstalk.Types.LoadBalancerDescription
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes the AWS resources in use by this environment. This data is not
-- live data.
--
-- /See:/ 'newEnvironmentResourcesDescription' smart constructor.
data EnvironmentResourcesDescription = EnvironmentResourcesDescription'
  { -- | Describes the LoadBalancer.
    EnvironmentResourcesDescription -> Maybe LoadBalancerDescription
loadBalancer :: Prelude.Maybe LoadBalancerDescription
  }
  deriving (EnvironmentResourcesDescription
-> EnvironmentResourcesDescription -> Bool
(EnvironmentResourcesDescription
 -> EnvironmentResourcesDescription -> Bool)
-> (EnvironmentResourcesDescription
    -> EnvironmentResourcesDescription -> Bool)
-> Eq EnvironmentResourcesDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnvironmentResourcesDescription
-> EnvironmentResourcesDescription -> Bool
$c/= :: EnvironmentResourcesDescription
-> EnvironmentResourcesDescription -> Bool
== :: EnvironmentResourcesDescription
-> EnvironmentResourcesDescription -> Bool
$c== :: EnvironmentResourcesDescription
-> EnvironmentResourcesDescription -> Bool
Prelude.Eq, ReadPrec [EnvironmentResourcesDescription]
ReadPrec EnvironmentResourcesDescription
Int -> ReadS EnvironmentResourcesDescription
ReadS [EnvironmentResourcesDescription]
(Int -> ReadS EnvironmentResourcesDescription)
-> ReadS [EnvironmentResourcesDescription]
-> ReadPrec EnvironmentResourcesDescription
-> ReadPrec [EnvironmentResourcesDescription]
-> Read EnvironmentResourcesDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnvironmentResourcesDescription]
$creadListPrec :: ReadPrec [EnvironmentResourcesDescription]
readPrec :: ReadPrec EnvironmentResourcesDescription
$creadPrec :: ReadPrec EnvironmentResourcesDescription
readList :: ReadS [EnvironmentResourcesDescription]
$creadList :: ReadS [EnvironmentResourcesDescription]
readsPrec :: Int -> ReadS EnvironmentResourcesDescription
$creadsPrec :: Int -> ReadS EnvironmentResourcesDescription
Prelude.Read, Int -> EnvironmentResourcesDescription -> ShowS
[EnvironmentResourcesDescription] -> ShowS
EnvironmentResourcesDescription -> String
(Int -> EnvironmentResourcesDescription -> ShowS)
-> (EnvironmentResourcesDescription -> String)
-> ([EnvironmentResourcesDescription] -> ShowS)
-> Show EnvironmentResourcesDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnvironmentResourcesDescription] -> ShowS
$cshowList :: [EnvironmentResourcesDescription] -> ShowS
show :: EnvironmentResourcesDescription -> String
$cshow :: EnvironmentResourcesDescription -> String
showsPrec :: Int -> EnvironmentResourcesDescription -> ShowS
$cshowsPrec :: Int -> EnvironmentResourcesDescription -> ShowS
Prelude.Show, (forall x.
 EnvironmentResourcesDescription
 -> Rep EnvironmentResourcesDescription x)
-> (forall x.
    Rep EnvironmentResourcesDescription x
    -> EnvironmentResourcesDescription)
-> Generic EnvironmentResourcesDescription
forall x.
Rep EnvironmentResourcesDescription x
-> EnvironmentResourcesDescription
forall x.
EnvironmentResourcesDescription
-> Rep EnvironmentResourcesDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EnvironmentResourcesDescription x
-> EnvironmentResourcesDescription
$cfrom :: forall x.
EnvironmentResourcesDescription
-> Rep EnvironmentResourcesDescription x
Prelude.Generic)

-- |
-- Create a value of 'EnvironmentResourcesDescription' 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:
--
-- 'loadBalancer', 'environmentResourcesDescription_loadBalancer' - Describes the LoadBalancer.
newEnvironmentResourcesDescription ::
  EnvironmentResourcesDescription
newEnvironmentResourcesDescription :: EnvironmentResourcesDescription
newEnvironmentResourcesDescription =
  EnvironmentResourcesDescription' :: Maybe LoadBalancerDescription -> EnvironmentResourcesDescription
EnvironmentResourcesDescription'
    { $sel:loadBalancer:EnvironmentResourcesDescription' :: Maybe LoadBalancerDescription
loadBalancer =
        Maybe LoadBalancerDescription
forall a. Maybe a
Prelude.Nothing
    }

-- | Describes the LoadBalancer.
environmentResourcesDescription_loadBalancer :: Lens.Lens' EnvironmentResourcesDescription (Prelude.Maybe LoadBalancerDescription)
environmentResourcesDescription_loadBalancer :: (Maybe LoadBalancerDescription
 -> f (Maybe LoadBalancerDescription))
-> EnvironmentResourcesDescription
-> f EnvironmentResourcesDescription
environmentResourcesDescription_loadBalancer = (EnvironmentResourcesDescription -> Maybe LoadBalancerDescription)
-> (EnvironmentResourcesDescription
    -> Maybe LoadBalancerDescription
    -> EnvironmentResourcesDescription)
-> Lens
     EnvironmentResourcesDescription
     EnvironmentResourcesDescription
     (Maybe LoadBalancerDescription)
     (Maybe LoadBalancerDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentResourcesDescription' {Maybe LoadBalancerDescription
loadBalancer :: Maybe LoadBalancerDescription
$sel:loadBalancer:EnvironmentResourcesDescription' :: EnvironmentResourcesDescription -> Maybe LoadBalancerDescription
loadBalancer} -> Maybe LoadBalancerDescription
loadBalancer) (\s :: EnvironmentResourcesDescription
s@EnvironmentResourcesDescription' {} Maybe LoadBalancerDescription
a -> EnvironmentResourcesDescription
s {$sel:loadBalancer:EnvironmentResourcesDescription' :: Maybe LoadBalancerDescription
loadBalancer = Maybe LoadBalancerDescription
a} :: EnvironmentResourcesDescription)

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

instance
  Prelude.Hashable
    EnvironmentResourcesDescription

instance
  Prelude.NFData
    EnvironmentResourcesDescription