{-# 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.TerminateEnvironment
(
TerminateEnvironment (..),
newTerminateEnvironment,
terminateEnvironment_forceTerminate,
terminateEnvironment_terminateResources,
terminateEnvironment_environmentName,
terminateEnvironment_environmentId,
EnvironmentDescription (..),
newEnvironmentDescription,
environmentDescription_status,
environmentDescription_cname,
environmentDescription_templateName,
environmentDescription_abortableOperationInProgress,
environmentDescription_endpointURL,
environmentDescription_resources,
environmentDescription_dateUpdated,
environmentDescription_dateCreated,
environmentDescription_health,
environmentDescription_versionLabel,
environmentDescription_operationsRole,
environmentDescription_platformArn,
environmentDescription_tier,
environmentDescription_environmentName,
environmentDescription_applicationName,
environmentDescription_environmentArn,
environmentDescription_solutionStackName,
environmentDescription_environmentId,
environmentDescription_healthStatus,
environmentDescription_environmentLinks,
environmentDescription_description,
)
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 TerminateEnvironment = TerminateEnvironment'
{
TerminateEnvironment -> Maybe Bool
forceTerminate :: Prelude.Maybe Prelude.Bool,
TerminateEnvironment -> Maybe Bool
terminateResources :: Prelude.Maybe Prelude.Bool,
TerminateEnvironment -> Maybe Text
environmentName :: Prelude.Maybe Prelude.Text,
TerminateEnvironment -> Maybe Text
environmentId :: Prelude.Maybe Prelude.Text
}
deriving (TerminateEnvironment -> TerminateEnvironment -> Bool
(TerminateEnvironment -> TerminateEnvironment -> Bool)
-> (TerminateEnvironment -> TerminateEnvironment -> Bool)
-> Eq TerminateEnvironment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TerminateEnvironment -> TerminateEnvironment -> Bool
$c/= :: TerminateEnvironment -> TerminateEnvironment -> Bool
== :: TerminateEnvironment -> TerminateEnvironment -> Bool
$c== :: TerminateEnvironment -> TerminateEnvironment -> Bool
Prelude.Eq, ReadPrec [TerminateEnvironment]
ReadPrec TerminateEnvironment
Int -> ReadS TerminateEnvironment
ReadS [TerminateEnvironment]
(Int -> ReadS TerminateEnvironment)
-> ReadS [TerminateEnvironment]
-> ReadPrec TerminateEnvironment
-> ReadPrec [TerminateEnvironment]
-> Read TerminateEnvironment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TerminateEnvironment]
$creadListPrec :: ReadPrec [TerminateEnvironment]
readPrec :: ReadPrec TerminateEnvironment
$creadPrec :: ReadPrec TerminateEnvironment
readList :: ReadS [TerminateEnvironment]
$creadList :: ReadS [TerminateEnvironment]
readsPrec :: Int -> ReadS TerminateEnvironment
$creadsPrec :: Int -> ReadS TerminateEnvironment
Prelude.Read, Int -> TerminateEnvironment -> ShowS
[TerminateEnvironment] -> ShowS
TerminateEnvironment -> String
(Int -> TerminateEnvironment -> ShowS)
-> (TerminateEnvironment -> String)
-> ([TerminateEnvironment] -> ShowS)
-> Show TerminateEnvironment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TerminateEnvironment] -> ShowS
$cshowList :: [TerminateEnvironment] -> ShowS
show :: TerminateEnvironment -> String
$cshow :: TerminateEnvironment -> String
showsPrec :: Int -> TerminateEnvironment -> ShowS
$cshowsPrec :: Int -> TerminateEnvironment -> ShowS
Prelude.Show, (forall x. TerminateEnvironment -> Rep TerminateEnvironment x)
-> (forall x. Rep TerminateEnvironment x -> TerminateEnvironment)
-> Generic TerminateEnvironment
forall x. Rep TerminateEnvironment x -> TerminateEnvironment
forall x. TerminateEnvironment -> Rep TerminateEnvironment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TerminateEnvironment x -> TerminateEnvironment
$cfrom :: forall x. TerminateEnvironment -> Rep TerminateEnvironment x
Prelude.Generic)
newTerminateEnvironment ::
TerminateEnvironment
newTerminateEnvironment :: TerminateEnvironment
newTerminateEnvironment =
TerminateEnvironment' :: Maybe Bool
-> Maybe Bool -> Maybe Text -> Maybe Text -> TerminateEnvironment
TerminateEnvironment'
{ $sel:forceTerminate:TerminateEnvironment' :: Maybe Bool
forceTerminate =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:terminateResources:TerminateEnvironment' :: Maybe Bool
terminateResources = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:environmentName:TerminateEnvironment' :: Maybe Text
environmentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:environmentId:TerminateEnvironment' :: Maybe Text
environmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
terminateEnvironment_forceTerminate :: Lens.Lens' TerminateEnvironment (Prelude.Maybe Prelude.Bool)
terminateEnvironment_forceTerminate :: (Maybe Bool -> f (Maybe Bool))
-> TerminateEnvironment -> f TerminateEnvironment
terminateEnvironment_forceTerminate = (TerminateEnvironment -> Maybe Bool)
-> (TerminateEnvironment -> Maybe Bool -> TerminateEnvironment)
-> Lens
TerminateEnvironment TerminateEnvironment (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateEnvironment' {Maybe Bool
forceTerminate :: Maybe Bool
$sel:forceTerminate:TerminateEnvironment' :: TerminateEnvironment -> Maybe Bool
forceTerminate} -> Maybe Bool
forceTerminate) (\s :: TerminateEnvironment
s@TerminateEnvironment' {} Maybe Bool
a -> TerminateEnvironment
s {$sel:forceTerminate:TerminateEnvironment' :: Maybe Bool
forceTerminate = Maybe Bool
a} :: TerminateEnvironment)
terminateEnvironment_terminateResources :: Lens.Lens' TerminateEnvironment (Prelude.Maybe Prelude.Bool)
terminateEnvironment_terminateResources :: (Maybe Bool -> f (Maybe Bool))
-> TerminateEnvironment -> f TerminateEnvironment
terminateEnvironment_terminateResources = (TerminateEnvironment -> Maybe Bool)
-> (TerminateEnvironment -> Maybe Bool -> TerminateEnvironment)
-> Lens
TerminateEnvironment TerminateEnvironment (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateEnvironment' {Maybe Bool
terminateResources :: Maybe Bool
$sel:terminateResources:TerminateEnvironment' :: TerminateEnvironment -> Maybe Bool
terminateResources} -> Maybe Bool
terminateResources) (\s :: TerminateEnvironment
s@TerminateEnvironment' {} Maybe Bool
a -> TerminateEnvironment
s {$sel:terminateResources:TerminateEnvironment' :: Maybe Bool
terminateResources = Maybe Bool
a} :: TerminateEnvironment)
terminateEnvironment_environmentName :: Lens.Lens' TerminateEnvironment (Prelude.Maybe Prelude.Text)
terminateEnvironment_environmentName :: (Maybe Text -> f (Maybe Text))
-> TerminateEnvironment -> f TerminateEnvironment
terminateEnvironment_environmentName = (TerminateEnvironment -> Maybe Text)
-> (TerminateEnvironment -> Maybe Text -> TerminateEnvironment)
-> Lens
TerminateEnvironment TerminateEnvironment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateEnvironment' {Maybe Text
environmentName :: Maybe Text
$sel:environmentName:TerminateEnvironment' :: TerminateEnvironment -> Maybe Text
environmentName} -> Maybe Text
environmentName) (\s :: TerminateEnvironment
s@TerminateEnvironment' {} Maybe Text
a -> TerminateEnvironment
s {$sel:environmentName:TerminateEnvironment' :: Maybe Text
environmentName = Maybe Text
a} :: TerminateEnvironment)
terminateEnvironment_environmentId :: Lens.Lens' TerminateEnvironment (Prelude.Maybe Prelude.Text)
terminateEnvironment_environmentId :: (Maybe Text -> f (Maybe Text))
-> TerminateEnvironment -> f TerminateEnvironment
terminateEnvironment_environmentId = (TerminateEnvironment -> Maybe Text)
-> (TerminateEnvironment -> Maybe Text -> TerminateEnvironment)
-> Lens
TerminateEnvironment TerminateEnvironment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateEnvironment' {Maybe Text
environmentId :: Maybe Text
$sel:environmentId:TerminateEnvironment' :: TerminateEnvironment -> Maybe Text
environmentId} -> Maybe Text
environmentId) (\s :: TerminateEnvironment
s@TerminateEnvironment' {} Maybe Text
a -> TerminateEnvironment
s {$sel:environmentId:TerminateEnvironment' :: Maybe Text
environmentId = Maybe Text
a} :: TerminateEnvironment)
instance Core.AWSRequest TerminateEnvironment where
type
AWSResponse TerminateEnvironment =
EnvironmentDescription
request :: TerminateEnvironment -> Request TerminateEnvironment
request = Service -> TerminateEnvironment -> Request TerminateEnvironment
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy TerminateEnvironment
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse TerminateEnvironment)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse TerminateEnvironment))
-> Logger
-> Service
-> Proxy TerminateEnvironment
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse TerminateEnvironment)))
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
"TerminateEnvironmentResult"
(\Int
s ResponseHeaders
h [Node]
x -> [Node] -> Either String EnvironmentDescription
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
instance Prelude.Hashable TerminateEnvironment
instance Prelude.NFData TerminateEnvironment
instance Core.ToHeaders TerminateEnvironment where
toHeaders :: TerminateEnvironment -> ResponseHeaders
toHeaders = ResponseHeaders -> TerminateEnvironment -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath TerminateEnvironment where
toPath :: TerminateEnvironment -> ByteString
toPath = ByteString -> TerminateEnvironment -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery TerminateEnvironment where
toQuery :: TerminateEnvironment -> QueryString
toQuery TerminateEnvironment' {Maybe Bool
Maybe Text
environmentId :: Maybe Text
environmentName :: Maybe Text
terminateResources :: Maybe Bool
forceTerminate :: Maybe Bool
$sel:environmentId:TerminateEnvironment' :: TerminateEnvironment -> Maybe Text
$sel:environmentName:TerminateEnvironment' :: TerminateEnvironment -> Maybe Text
$sel:terminateResources:TerminateEnvironment' :: TerminateEnvironment -> Maybe Bool
$sel:forceTerminate:TerminateEnvironment' :: TerminateEnvironment -> Maybe Bool
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"TerminateEnvironment" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-12-01" :: Prelude.ByteString),
ByteString
"ForceTerminate" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
forceTerminate,
ByteString
"TerminateResources" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
terminateResources,
ByteString
"EnvironmentName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
environmentName,
ByteString
"EnvironmentId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
environmentId
]