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

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

-- | Result message containing a single description of an application.
--
-- /See:/ 'newApplicationDescriptionMessage' smart constructor.
data ApplicationDescriptionMessage = ApplicationDescriptionMessage'
  { -- | The ApplicationDescription of the application.
    ApplicationDescriptionMessage -> Maybe ApplicationDescription
application :: Prelude.Maybe ApplicationDescription
  }
  deriving (ApplicationDescriptionMessage
-> ApplicationDescriptionMessage -> Bool
(ApplicationDescriptionMessage
 -> ApplicationDescriptionMessage -> Bool)
-> (ApplicationDescriptionMessage
    -> ApplicationDescriptionMessage -> Bool)
-> Eq ApplicationDescriptionMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplicationDescriptionMessage
-> ApplicationDescriptionMessage -> Bool
$c/= :: ApplicationDescriptionMessage
-> ApplicationDescriptionMessage -> Bool
== :: ApplicationDescriptionMessage
-> ApplicationDescriptionMessage -> Bool
$c== :: ApplicationDescriptionMessage
-> ApplicationDescriptionMessage -> Bool
Prelude.Eq, ReadPrec [ApplicationDescriptionMessage]
ReadPrec ApplicationDescriptionMessage
Int -> ReadS ApplicationDescriptionMessage
ReadS [ApplicationDescriptionMessage]
(Int -> ReadS ApplicationDescriptionMessage)
-> ReadS [ApplicationDescriptionMessage]
-> ReadPrec ApplicationDescriptionMessage
-> ReadPrec [ApplicationDescriptionMessage]
-> Read ApplicationDescriptionMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplicationDescriptionMessage]
$creadListPrec :: ReadPrec [ApplicationDescriptionMessage]
readPrec :: ReadPrec ApplicationDescriptionMessage
$creadPrec :: ReadPrec ApplicationDescriptionMessage
readList :: ReadS [ApplicationDescriptionMessage]
$creadList :: ReadS [ApplicationDescriptionMessage]
readsPrec :: Int -> ReadS ApplicationDescriptionMessage
$creadsPrec :: Int -> ReadS ApplicationDescriptionMessage
Prelude.Read, Int -> ApplicationDescriptionMessage -> ShowS
[ApplicationDescriptionMessage] -> ShowS
ApplicationDescriptionMessage -> String
(Int -> ApplicationDescriptionMessage -> ShowS)
-> (ApplicationDescriptionMessage -> String)
-> ([ApplicationDescriptionMessage] -> ShowS)
-> Show ApplicationDescriptionMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplicationDescriptionMessage] -> ShowS
$cshowList :: [ApplicationDescriptionMessage] -> ShowS
show :: ApplicationDescriptionMessage -> String
$cshow :: ApplicationDescriptionMessage -> String
showsPrec :: Int -> ApplicationDescriptionMessage -> ShowS
$cshowsPrec :: Int -> ApplicationDescriptionMessage -> ShowS
Prelude.Show, (forall x.
 ApplicationDescriptionMessage
 -> Rep ApplicationDescriptionMessage x)
-> (forall x.
    Rep ApplicationDescriptionMessage x
    -> ApplicationDescriptionMessage)
-> Generic ApplicationDescriptionMessage
forall x.
Rep ApplicationDescriptionMessage x
-> ApplicationDescriptionMessage
forall x.
ApplicationDescriptionMessage
-> Rep ApplicationDescriptionMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplicationDescriptionMessage x
-> ApplicationDescriptionMessage
$cfrom :: forall x.
ApplicationDescriptionMessage
-> Rep ApplicationDescriptionMessage x
Prelude.Generic)

-- |
-- Create a value of 'ApplicationDescriptionMessage' 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:
--
-- 'application', 'applicationDescriptionMessage_application' - The ApplicationDescription of the application.
newApplicationDescriptionMessage ::
  ApplicationDescriptionMessage
newApplicationDescriptionMessage :: ApplicationDescriptionMessage
newApplicationDescriptionMessage =
  ApplicationDescriptionMessage' :: Maybe ApplicationDescription -> ApplicationDescriptionMessage
ApplicationDescriptionMessage'
    { $sel:application:ApplicationDescriptionMessage' :: Maybe ApplicationDescription
application =
        Maybe ApplicationDescription
forall a. Maybe a
Prelude.Nothing
    }

-- | The ApplicationDescription of the application.
applicationDescriptionMessage_application :: Lens.Lens' ApplicationDescriptionMessage (Prelude.Maybe ApplicationDescription)
applicationDescriptionMessage_application :: (Maybe ApplicationDescription -> f (Maybe ApplicationDescription))
-> ApplicationDescriptionMessage -> f ApplicationDescriptionMessage
applicationDescriptionMessage_application = (ApplicationDescriptionMessage -> Maybe ApplicationDescription)
-> (ApplicationDescriptionMessage
    -> Maybe ApplicationDescription -> ApplicationDescriptionMessage)
-> Lens
     ApplicationDescriptionMessage
     ApplicationDescriptionMessage
     (Maybe ApplicationDescription)
     (Maybe ApplicationDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplicationDescriptionMessage' {Maybe ApplicationDescription
application :: Maybe ApplicationDescription
$sel:application:ApplicationDescriptionMessage' :: ApplicationDescriptionMessage -> Maybe ApplicationDescription
application} -> Maybe ApplicationDescription
application) (\s :: ApplicationDescriptionMessage
s@ApplicationDescriptionMessage' {} Maybe ApplicationDescription
a -> ApplicationDescriptionMessage
s {$sel:application:ApplicationDescriptionMessage' :: Maybe ApplicationDescription
application = Maybe ApplicationDescription
a} :: ApplicationDescriptionMessage)

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

instance
  Prelude.Hashable
    ApplicationDescriptionMessage

instance Prelude.NFData ApplicationDescriptionMessage