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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElasticBeanstalk.Types.LoadBalancerDescription
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
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]
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
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.
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'
    { $sel:loadBalancer:EnvironmentResourcesDescription' :: Maybe LoadBalancerDescription
loadBalancer =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Describes the LoadBalancer.
environmentResourcesDescription_loadBalancer :: Lens.Lens' EnvironmentResourcesDescription (Prelude.Maybe LoadBalancerDescription)
environmentResourcesDescription_loadBalancer :: Lens'
  EnvironmentResourcesDescription (Maybe LoadBalancerDescription)
environmentResourcesDescription_loadBalancer = 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 Data.FromXML EnvironmentResourcesDescription where
  parseXML :: [Node] -> Either String EnvironmentResourcesDescription
parseXML [Node]
x =
    Maybe LoadBalancerDescription -> EnvironmentResourcesDescription
EnvironmentResourcesDescription'
      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
"LoadBalancer")

instance
  Prelude.Hashable
    EnvironmentResourcesDescription
  where
  hashWithSalt :: Int -> EnvironmentResourcesDescription -> Int
hashWithSalt
    Int
_salt
    EnvironmentResourcesDescription' {Maybe LoadBalancerDescription
loadBalancer :: Maybe LoadBalancerDescription
$sel:loadBalancer:EnvironmentResourcesDescription' :: EnvironmentResourcesDescription -> Maybe LoadBalancerDescription
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LoadBalancerDescription
loadBalancer

instance
  Prelude.NFData
    EnvironmentResourcesDescription
  where
  rnf :: EnvironmentResourcesDescription -> ()
rnf EnvironmentResourcesDescription' {Maybe LoadBalancerDescription
loadBalancer :: Maybe LoadBalancerDescription
$sel:loadBalancer:EnvironmentResourcesDescription' :: EnvironmentResourcesDescription -> Maybe LoadBalancerDescription
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe LoadBalancerDescription
loadBalancer