{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.ElasticBeanstalk.UpdateApplication
(
UpdateApplication (..),
newUpdateApplication,
updateApplication_description,
updateApplication_applicationName,
ApplicationDescriptionMessage (..),
newApplicationDescriptionMessage,
applicationDescriptionMessage_application,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ElasticBeanstalk.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateApplication = UpdateApplication'
{
UpdateApplication -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateApplication -> Text
applicationName :: Prelude.Text
}
deriving (UpdateApplication -> UpdateApplication -> Bool
(UpdateApplication -> UpdateApplication -> Bool)
-> (UpdateApplication -> UpdateApplication -> Bool)
-> Eq UpdateApplication
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateApplication -> UpdateApplication -> Bool
$c/= :: UpdateApplication -> UpdateApplication -> Bool
== :: UpdateApplication -> UpdateApplication -> Bool
$c== :: UpdateApplication -> UpdateApplication -> Bool
Prelude.Eq, ReadPrec [UpdateApplication]
ReadPrec UpdateApplication
Int -> ReadS UpdateApplication
ReadS [UpdateApplication]
(Int -> ReadS UpdateApplication)
-> ReadS [UpdateApplication]
-> ReadPrec UpdateApplication
-> ReadPrec [UpdateApplication]
-> Read UpdateApplication
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateApplication]
$creadListPrec :: ReadPrec [UpdateApplication]
readPrec :: ReadPrec UpdateApplication
$creadPrec :: ReadPrec UpdateApplication
readList :: ReadS [UpdateApplication]
$creadList :: ReadS [UpdateApplication]
readsPrec :: Int -> ReadS UpdateApplication
$creadsPrec :: Int -> ReadS UpdateApplication
Prelude.Read, Int -> UpdateApplication -> ShowS
[UpdateApplication] -> ShowS
UpdateApplication -> String
(Int -> UpdateApplication -> ShowS)
-> (UpdateApplication -> String)
-> ([UpdateApplication] -> ShowS)
-> Show UpdateApplication
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateApplication] -> ShowS
$cshowList :: [UpdateApplication] -> ShowS
show :: UpdateApplication -> String
$cshow :: UpdateApplication -> String
showsPrec :: Int -> UpdateApplication -> ShowS
$cshowsPrec :: Int -> UpdateApplication -> ShowS
Prelude.Show, (forall x. UpdateApplication -> Rep UpdateApplication x)
-> (forall x. Rep UpdateApplication x -> UpdateApplication)
-> Generic UpdateApplication
forall x. Rep UpdateApplication x -> UpdateApplication
forall x. UpdateApplication -> Rep UpdateApplication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateApplication x -> UpdateApplication
$cfrom :: forall x. UpdateApplication -> Rep UpdateApplication x
Prelude.Generic)
newUpdateApplication ::
Prelude.Text ->
UpdateApplication
newUpdateApplication :: Text -> UpdateApplication
newUpdateApplication Text
pApplicationName_ =
UpdateApplication' :: Maybe Text -> Text -> UpdateApplication
UpdateApplication'
{ $sel:description:UpdateApplication' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:applicationName:UpdateApplication' :: Text
applicationName = Text
pApplicationName_
}
updateApplication_description :: Lens.Lens' UpdateApplication (Prelude.Maybe Prelude.Text)
updateApplication_description :: (Maybe Text -> f (Maybe Text))
-> UpdateApplication -> f UpdateApplication
updateApplication_description = (UpdateApplication -> Maybe Text)
-> (UpdateApplication -> Maybe Text -> UpdateApplication)
-> Lens
UpdateApplication UpdateApplication (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApplication' {Maybe Text
description :: Maybe Text
$sel:description:UpdateApplication' :: UpdateApplication -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateApplication
s@UpdateApplication' {} Maybe Text
a -> UpdateApplication
s {$sel:description:UpdateApplication' :: Maybe Text
description = Maybe Text
a} :: UpdateApplication)
updateApplication_applicationName :: Lens.Lens' UpdateApplication Prelude.Text
updateApplication_applicationName :: (Text -> f Text) -> UpdateApplication -> f UpdateApplication
updateApplication_applicationName = (UpdateApplication -> Text)
-> (UpdateApplication -> Text -> UpdateApplication)
-> Lens UpdateApplication UpdateApplication Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApplication' {Text
applicationName :: Text
$sel:applicationName:UpdateApplication' :: UpdateApplication -> Text
applicationName} -> Text
applicationName) (\s :: UpdateApplication
s@UpdateApplication' {} Text
a -> UpdateApplication
s {$sel:applicationName:UpdateApplication' :: Text
applicationName = Text
a} :: UpdateApplication)
instance Core.AWSRequest UpdateApplication where
type
AWSResponse UpdateApplication =
ApplicationDescriptionMessage
request :: UpdateApplication -> Request UpdateApplication
request = Service -> UpdateApplication -> Request UpdateApplication
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateApplication
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateApplication)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse UpdateApplication))
-> Logger
-> Service
-> Proxy UpdateApplication
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateApplication)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"UpdateApplicationResult"
(\Int
s ResponseHeaders
h [Node]
x -> [Node] -> Either String ApplicationDescriptionMessage
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
instance Prelude.Hashable UpdateApplication
instance Prelude.NFData UpdateApplication
instance Core.ToHeaders UpdateApplication where
toHeaders :: UpdateApplication -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdateApplication -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath UpdateApplication where
toPath :: UpdateApplication -> ByteString
toPath = ByteString -> UpdateApplication -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateApplication where
toQuery :: UpdateApplication -> QueryString
toQuery UpdateApplication' {Maybe Text
Text
applicationName :: Text
description :: Maybe Text
$sel:applicationName:UpdateApplication' :: UpdateApplication -> Text
$sel:description:UpdateApplication' :: UpdateApplication -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"UpdateApplication" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"Description" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
description,
ByteString
"ApplicationName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
applicationName
]