{-# 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.UpdateApplicationVersion
(
UpdateApplicationVersion (..),
newUpdateApplicationVersion,
updateApplicationVersion_description,
updateApplicationVersion_applicationName,
updateApplicationVersion_versionLabel,
ApplicationVersionDescriptionMessage (..),
newApplicationVersionDescriptionMessage,
applicationVersionDescriptionMessage_applicationVersion,
)
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 UpdateApplicationVersion = UpdateApplicationVersion'
{
UpdateApplicationVersion -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateApplicationVersion -> Text
applicationName :: Prelude.Text,
UpdateApplicationVersion -> Text
versionLabel :: Prelude.Text
}
deriving (UpdateApplicationVersion -> UpdateApplicationVersion -> Bool
(UpdateApplicationVersion -> UpdateApplicationVersion -> Bool)
-> (UpdateApplicationVersion -> UpdateApplicationVersion -> Bool)
-> Eq UpdateApplicationVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateApplicationVersion -> UpdateApplicationVersion -> Bool
$c/= :: UpdateApplicationVersion -> UpdateApplicationVersion -> Bool
== :: UpdateApplicationVersion -> UpdateApplicationVersion -> Bool
$c== :: UpdateApplicationVersion -> UpdateApplicationVersion -> Bool
Prelude.Eq, ReadPrec [UpdateApplicationVersion]
ReadPrec UpdateApplicationVersion
Int -> ReadS UpdateApplicationVersion
ReadS [UpdateApplicationVersion]
(Int -> ReadS UpdateApplicationVersion)
-> ReadS [UpdateApplicationVersion]
-> ReadPrec UpdateApplicationVersion
-> ReadPrec [UpdateApplicationVersion]
-> Read UpdateApplicationVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateApplicationVersion]
$creadListPrec :: ReadPrec [UpdateApplicationVersion]
readPrec :: ReadPrec UpdateApplicationVersion
$creadPrec :: ReadPrec UpdateApplicationVersion
readList :: ReadS [UpdateApplicationVersion]
$creadList :: ReadS [UpdateApplicationVersion]
readsPrec :: Int -> ReadS UpdateApplicationVersion
$creadsPrec :: Int -> ReadS UpdateApplicationVersion
Prelude.Read, Int -> UpdateApplicationVersion -> ShowS
[UpdateApplicationVersion] -> ShowS
UpdateApplicationVersion -> String
(Int -> UpdateApplicationVersion -> ShowS)
-> (UpdateApplicationVersion -> String)
-> ([UpdateApplicationVersion] -> ShowS)
-> Show UpdateApplicationVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateApplicationVersion] -> ShowS
$cshowList :: [UpdateApplicationVersion] -> ShowS
show :: UpdateApplicationVersion -> String
$cshow :: UpdateApplicationVersion -> String
showsPrec :: Int -> UpdateApplicationVersion -> ShowS
$cshowsPrec :: Int -> UpdateApplicationVersion -> ShowS
Prelude.Show, (forall x.
UpdateApplicationVersion -> Rep UpdateApplicationVersion x)
-> (forall x.
Rep UpdateApplicationVersion x -> UpdateApplicationVersion)
-> Generic UpdateApplicationVersion
forall x.
Rep UpdateApplicationVersion x -> UpdateApplicationVersion
forall x.
UpdateApplicationVersion -> Rep UpdateApplicationVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateApplicationVersion x -> UpdateApplicationVersion
$cfrom :: forall x.
UpdateApplicationVersion -> Rep UpdateApplicationVersion x
Prelude.Generic)
newUpdateApplicationVersion ::
Prelude.Text ->
Prelude.Text ->
UpdateApplicationVersion
newUpdateApplicationVersion :: Text -> Text -> UpdateApplicationVersion
newUpdateApplicationVersion
Text
pApplicationName_
Text
pVersionLabel_ =
UpdateApplicationVersion' :: Maybe Text -> Text -> Text -> UpdateApplicationVersion
UpdateApplicationVersion'
{ $sel:description:UpdateApplicationVersion' :: Maybe Text
description =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:applicationName:UpdateApplicationVersion' :: Text
applicationName = Text
pApplicationName_,
$sel:versionLabel:UpdateApplicationVersion' :: Text
versionLabel = Text
pVersionLabel_
}
updateApplicationVersion_description :: Lens.Lens' UpdateApplicationVersion (Prelude.Maybe Prelude.Text)
updateApplicationVersion_description :: (Maybe Text -> f (Maybe Text))
-> UpdateApplicationVersion -> f UpdateApplicationVersion
updateApplicationVersion_description = (UpdateApplicationVersion -> Maybe Text)
-> (UpdateApplicationVersion
-> Maybe Text -> UpdateApplicationVersion)
-> Lens
UpdateApplicationVersion
UpdateApplicationVersion
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApplicationVersion' {Maybe Text
description :: Maybe Text
$sel:description:UpdateApplicationVersion' :: UpdateApplicationVersion -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateApplicationVersion
s@UpdateApplicationVersion' {} Maybe Text
a -> UpdateApplicationVersion
s {$sel:description:UpdateApplicationVersion' :: Maybe Text
description = Maybe Text
a} :: UpdateApplicationVersion)
updateApplicationVersion_applicationName :: Lens.Lens' UpdateApplicationVersion Prelude.Text
updateApplicationVersion_applicationName :: (Text -> f Text)
-> UpdateApplicationVersion -> f UpdateApplicationVersion
updateApplicationVersion_applicationName = (UpdateApplicationVersion -> Text)
-> (UpdateApplicationVersion -> Text -> UpdateApplicationVersion)
-> Lens UpdateApplicationVersion UpdateApplicationVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApplicationVersion' {Text
applicationName :: Text
$sel:applicationName:UpdateApplicationVersion' :: UpdateApplicationVersion -> Text
applicationName} -> Text
applicationName) (\s :: UpdateApplicationVersion
s@UpdateApplicationVersion' {} Text
a -> UpdateApplicationVersion
s {$sel:applicationName:UpdateApplicationVersion' :: Text
applicationName = Text
a} :: UpdateApplicationVersion)
updateApplicationVersion_versionLabel :: Lens.Lens' UpdateApplicationVersion Prelude.Text
updateApplicationVersion_versionLabel :: (Text -> f Text)
-> UpdateApplicationVersion -> f UpdateApplicationVersion
updateApplicationVersion_versionLabel = (UpdateApplicationVersion -> Text)
-> (UpdateApplicationVersion -> Text -> UpdateApplicationVersion)
-> Lens UpdateApplicationVersion UpdateApplicationVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApplicationVersion' {Text
versionLabel :: Text
$sel:versionLabel:UpdateApplicationVersion' :: UpdateApplicationVersion -> Text
versionLabel} -> Text
versionLabel) (\s :: UpdateApplicationVersion
s@UpdateApplicationVersion' {} Text
a -> UpdateApplicationVersion
s {$sel:versionLabel:UpdateApplicationVersion' :: Text
versionLabel = Text
a} :: UpdateApplicationVersion)
instance Core.AWSRequest UpdateApplicationVersion where
type
AWSResponse UpdateApplicationVersion =
ApplicationVersionDescriptionMessage
request :: UpdateApplicationVersion -> Request UpdateApplicationVersion
request = Service
-> UpdateApplicationVersion -> Request UpdateApplicationVersion
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateApplicationVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateApplicationVersion)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse UpdateApplicationVersion))
-> Logger
-> Service
-> Proxy UpdateApplicationVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateApplicationVersion)))
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
"UpdateApplicationVersionResult"
(\Int
s ResponseHeaders
h [Node]
x -> [Node] -> Either String ApplicationVersionDescriptionMessage
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
instance Prelude.Hashable UpdateApplicationVersion
instance Prelude.NFData UpdateApplicationVersion
instance Core.ToHeaders UpdateApplicationVersion where
toHeaders :: UpdateApplicationVersion -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdateApplicationVersion -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath UpdateApplicationVersion where
toPath :: UpdateApplicationVersion -> ByteString
toPath = ByteString -> UpdateApplicationVersion -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateApplicationVersion where
toQuery :: UpdateApplicationVersion -> QueryString
toQuery UpdateApplicationVersion' {Maybe Text
Text
versionLabel :: Text
applicationName :: Text
description :: Maybe Text
$sel:versionLabel:UpdateApplicationVersion' :: UpdateApplicationVersion -> Text
$sel:applicationName:UpdateApplicationVersion' :: UpdateApplicationVersion -> Text
$sel:description:UpdateApplicationVersion' :: UpdateApplicationVersion -> 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
"UpdateApplicationVersion" :: 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,
ByteString
"VersionLabel" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
versionLabel
]