{-# 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.CodeDeploy.DeleteDeploymentGroup
(
DeleteDeploymentGroup (..),
newDeleteDeploymentGroup,
deleteDeploymentGroup_applicationName,
deleteDeploymentGroup_deploymentGroupName,
DeleteDeploymentGroupResponse (..),
newDeleteDeploymentGroupResponse,
deleteDeploymentGroupResponse_hooksNotCleanedUp,
deleteDeploymentGroupResponse_httpStatus,
)
where
import Amazonka.CodeDeploy.Types
import qualified Amazonka.Core as Core
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 DeleteDeploymentGroup = DeleteDeploymentGroup'
{
DeleteDeploymentGroup -> Text
applicationName :: Prelude.Text,
DeleteDeploymentGroup -> Text
deploymentGroupName :: Prelude.Text
}
deriving (DeleteDeploymentGroup -> DeleteDeploymentGroup -> Bool
(DeleteDeploymentGroup -> DeleteDeploymentGroup -> Bool)
-> (DeleteDeploymentGroup -> DeleteDeploymentGroup -> Bool)
-> Eq DeleteDeploymentGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDeploymentGroup -> DeleteDeploymentGroup -> Bool
$c/= :: DeleteDeploymentGroup -> DeleteDeploymentGroup -> Bool
== :: DeleteDeploymentGroup -> DeleteDeploymentGroup -> Bool
$c== :: DeleteDeploymentGroup -> DeleteDeploymentGroup -> Bool
Prelude.Eq, ReadPrec [DeleteDeploymentGroup]
ReadPrec DeleteDeploymentGroup
Int -> ReadS DeleteDeploymentGroup
ReadS [DeleteDeploymentGroup]
(Int -> ReadS DeleteDeploymentGroup)
-> ReadS [DeleteDeploymentGroup]
-> ReadPrec DeleteDeploymentGroup
-> ReadPrec [DeleteDeploymentGroup]
-> Read DeleteDeploymentGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDeploymentGroup]
$creadListPrec :: ReadPrec [DeleteDeploymentGroup]
readPrec :: ReadPrec DeleteDeploymentGroup
$creadPrec :: ReadPrec DeleteDeploymentGroup
readList :: ReadS [DeleteDeploymentGroup]
$creadList :: ReadS [DeleteDeploymentGroup]
readsPrec :: Int -> ReadS DeleteDeploymentGroup
$creadsPrec :: Int -> ReadS DeleteDeploymentGroup
Prelude.Read, Int -> DeleteDeploymentGroup -> ShowS
[DeleteDeploymentGroup] -> ShowS
DeleteDeploymentGroup -> String
(Int -> DeleteDeploymentGroup -> ShowS)
-> (DeleteDeploymentGroup -> String)
-> ([DeleteDeploymentGroup] -> ShowS)
-> Show DeleteDeploymentGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDeploymentGroup] -> ShowS
$cshowList :: [DeleteDeploymentGroup] -> ShowS
show :: DeleteDeploymentGroup -> String
$cshow :: DeleteDeploymentGroup -> String
showsPrec :: Int -> DeleteDeploymentGroup -> ShowS
$cshowsPrec :: Int -> DeleteDeploymentGroup -> ShowS
Prelude.Show, (forall x. DeleteDeploymentGroup -> Rep DeleteDeploymentGroup x)
-> (forall x. Rep DeleteDeploymentGroup x -> DeleteDeploymentGroup)
-> Generic DeleteDeploymentGroup
forall x. Rep DeleteDeploymentGroup x -> DeleteDeploymentGroup
forall x. DeleteDeploymentGroup -> Rep DeleteDeploymentGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDeploymentGroup x -> DeleteDeploymentGroup
$cfrom :: forall x. DeleteDeploymentGroup -> Rep DeleteDeploymentGroup x
Prelude.Generic)
newDeleteDeploymentGroup ::
Prelude.Text ->
Prelude.Text ->
DeleteDeploymentGroup
newDeleteDeploymentGroup :: Text -> Text -> DeleteDeploymentGroup
newDeleteDeploymentGroup
Text
pApplicationName_
Text
pDeploymentGroupName_ =
DeleteDeploymentGroup' :: Text -> Text -> DeleteDeploymentGroup
DeleteDeploymentGroup'
{ $sel:applicationName:DeleteDeploymentGroup' :: Text
applicationName =
Text
pApplicationName_,
$sel:deploymentGroupName:DeleteDeploymentGroup' :: Text
deploymentGroupName = Text
pDeploymentGroupName_
}
deleteDeploymentGroup_applicationName :: Lens.Lens' DeleteDeploymentGroup Prelude.Text
deleteDeploymentGroup_applicationName :: (Text -> f Text)
-> DeleteDeploymentGroup -> f DeleteDeploymentGroup
deleteDeploymentGroup_applicationName = (DeleteDeploymentGroup -> Text)
-> (DeleteDeploymentGroup -> Text -> DeleteDeploymentGroup)
-> Lens DeleteDeploymentGroup DeleteDeploymentGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDeploymentGroup' {Text
applicationName :: Text
$sel:applicationName:DeleteDeploymentGroup' :: DeleteDeploymentGroup -> Text
applicationName} -> Text
applicationName) (\s :: DeleteDeploymentGroup
s@DeleteDeploymentGroup' {} Text
a -> DeleteDeploymentGroup
s {$sel:applicationName:DeleteDeploymentGroup' :: Text
applicationName = Text
a} :: DeleteDeploymentGroup)
deleteDeploymentGroup_deploymentGroupName :: Lens.Lens' DeleteDeploymentGroup Prelude.Text
deleteDeploymentGroup_deploymentGroupName :: (Text -> f Text)
-> DeleteDeploymentGroup -> f DeleteDeploymentGroup
deleteDeploymentGroup_deploymentGroupName = (DeleteDeploymentGroup -> Text)
-> (DeleteDeploymentGroup -> Text -> DeleteDeploymentGroup)
-> Lens DeleteDeploymentGroup DeleteDeploymentGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDeploymentGroup' {Text
deploymentGroupName :: Text
$sel:deploymentGroupName:DeleteDeploymentGroup' :: DeleteDeploymentGroup -> Text
deploymentGroupName} -> Text
deploymentGroupName) (\s :: DeleteDeploymentGroup
s@DeleteDeploymentGroup' {} Text
a -> DeleteDeploymentGroup
s {$sel:deploymentGroupName:DeleteDeploymentGroup' :: Text
deploymentGroupName = Text
a} :: DeleteDeploymentGroup)
instance Core.AWSRequest DeleteDeploymentGroup where
type
AWSResponse DeleteDeploymentGroup =
DeleteDeploymentGroupResponse
request :: DeleteDeploymentGroup -> Request DeleteDeploymentGroup
request = Service -> DeleteDeploymentGroup -> Request DeleteDeploymentGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteDeploymentGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteDeploymentGroup)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteDeploymentGroup))
-> Logger
-> Service
-> Proxy DeleteDeploymentGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteDeploymentGroup)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [AutoScalingGroup] -> Int -> DeleteDeploymentGroupResponse
DeleteDeploymentGroupResponse'
(Maybe [AutoScalingGroup] -> Int -> DeleteDeploymentGroupResponse)
-> Either String (Maybe [AutoScalingGroup])
-> Either String (Int -> DeleteDeploymentGroupResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [AutoScalingGroup]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"hooksNotCleanedUp"
Either String (Maybe (Maybe [AutoScalingGroup]))
-> Maybe [AutoScalingGroup]
-> Either String (Maybe [AutoScalingGroup])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [AutoScalingGroup]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> DeleteDeploymentGroupResponse)
-> Either String Int -> Either String DeleteDeploymentGroupResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteDeploymentGroup
instance Prelude.NFData DeleteDeploymentGroup
instance Core.ToHeaders DeleteDeploymentGroup where
toHeaders :: DeleteDeploymentGroup -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteDeploymentGroup -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"CodeDeploy_20141006.DeleteDeploymentGroup" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteDeploymentGroup where
toJSON :: DeleteDeploymentGroup -> Value
toJSON DeleteDeploymentGroup' {Text
deploymentGroupName :: Text
applicationName :: Text
$sel:deploymentGroupName:DeleteDeploymentGroup' :: DeleteDeploymentGroup -> Text
$sel:applicationName:DeleteDeploymentGroup' :: DeleteDeploymentGroup -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"applicationName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
applicationName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"deploymentGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deploymentGroupName)
]
)
instance Core.ToPath DeleteDeploymentGroup where
toPath :: DeleteDeploymentGroup -> ByteString
toPath = ByteString -> DeleteDeploymentGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteDeploymentGroup where
toQuery :: DeleteDeploymentGroup -> QueryString
toQuery = QueryString -> DeleteDeploymentGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteDeploymentGroupResponse = DeleteDeploymentGroupResponse'
{
DeleteDeploymentGroupResponse -> Maybe [AutoScalingGroup]
hooksNotCleanedUp :: Prelude.Maybe [AutoScalingGroup],
DeleteDeploymentGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteDeploymentGroupResponse
-> DeleteDeploymentGroupResponse -> Bool
(DeleteDeploymentGroupResponse
-> DeleteDeploymentGroupResponse -> Bool)
-> (DeleteDeploymentGroupResponse
-> DeleteDeploymentGroupResponse -> Bool)
-> Eq DeleteDeploymentGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDeploymentGroupResponse
-> DeleteDeploymentGroupResponse -> Bool
$c/= :: DeleteDeploymentGroupResponse
-> DeleteDeploymentGroupResponse -> Bool
== :: DeleteDeploymentGroupResponse
-> DeleteDeploymentGroupResponse -> Bool
$c== :: DeleteDeploymentGroupResponse
-> DeleteDeploymentGroupResponse -> Bool
Prelude.Eq, ReadPrec [DeleteDeploymentGroupResponse]
ReadPrec DeleteDeploymentGroupResponse
Int -> ReadS DeleteDeploymentGroupResponse
ReadS [DeleteDeploymentGroupResponse]
(Int -> ReadS DeleteDeploymentGroupResponse)
-> ReadS [DeleteDeploymentGroupResponse]
-> ReadPrec DeleteDeploymentGroupResponse
-> ReadPrec [DeleteDeploymentGroupResponse]
-> Read DeleteDeploymentGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDeploymentGroupResponse]
$creadListPrec :: ReadPrec [DeleteDeploymentGroupResponse]
readPrec :: ReadPrec DeleteDeploymentGroupResponse
$creadPrec :: ReadPrec DeleteDeploymentGroupResponse
readList :: ReadS [DeleteDeploymentGroupResponse]
$creadList :: ReadS [DeleteDeploymentGroupResponse]
readsPrec :: Int -> ReadS DeleteDeploymentGroupResponse
$creadsPrec :: Int -> ReadS DeleteDeploymentGroupResponse
Prelude.Read, Int -> DeleteDeploymentGroupResponse -> ShowS
[DeleteDeploymentGroupResponse] -> ShowS
DeleteDeploymentGroupResponse -> String
(Int -> DeleteDeploymentGroupResponse -> ShowS)
-> (DeleteDeploymentGroupResponse -> String)
-> ([DeleteDeploymentGroupResponse] -> ShowS)
-> Show DeleteDeploymentGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDeploymentGroupResponse] -> ShowS
$cshowList :: [DeleteDeploymentGroupResponse] -> ShowS
show :: DeleteDeploymentGroupResponse -> String
$cshow :: DeleteDeploymentGroupResponse -> String
showsPrec :: Int -> DeleteDeploymentGroupResponse -> ShowS
$cshowsPrec :: Int -> DeleteDeploymentGroupResponse -> ShowS
Prelude.Show, (forall x.
DeleteDeploymentGroupResponse
-> Rep DeleteDeploymentGroupResponse x)
-> (forall x.
Rep DeleteDeploymentGroupResponse x
-> DeleteDeploymentGroupResponse)
-> Generic DeleteDeploymentGroupResponse
forall x.
Rep DeleteDeploymentGroupResponse x
-> DeleteDeploymentGroupResponse
forall x.
DeleteDeploymentGroupResponse
-> Rep DeleteDeploymentGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDeploymentGroupResponse x
-> DeleteDeploymentGroupResponse
$cfrom :: forall x.
DeleteDeploymentGroupResponse
-> Rep DeleteDeploymentGroupResponse x
Prelude.Generic)
newDeleteDeploymentGroupResponse ::
Prelude.Int ->
DeleteDeploymentGroupResponse
newDeleteDeploymentGroupResponse :: Int -> DeleteDeploymentGroupResponse
newDeleteDeploymentGroupResponse Int
pHttpStatus_ =
DeleteDeploymentGroupResponse' :: Maybe [AutoScalingGroup] -> Int -> DeleteDeploymentGroupResponse
DeleteDeploymentGroupResponse'
{ $sel:hooksNotCleanedUp:DeleteDeploymentGroupResponse' :: Maybe [AutoScalingGroup]
hooksNotCleanedUp =
Maybe [AutoScalingGroup]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteDeploymentGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteDeploymentGroupResponse_hooksNotCleanedUp :: Lens.Lens' DeleteDeploymentGroupResponse (Prelude.Maybe [AutoScalingGroup])
deleteDeploymentGroupResponse_hooksNotCleanedUp :: (Maybe [AutoScalingGroup] -> f (Maybe [AutoScalingGroup]))
-> DeleteDeploymentGroupResponse -> f DeleteDeploymentGroupResponse
deleteDeploymentGroupResponse_hooksNotCleanedUp = (DeleteDeploymentGroupResponse -> Maybe [AutoScalingGroup])
-> (DeleteDeploymentGroupResponse
-> Maybe [AutoScalingGroup] -> DeleteDeploymentGroupResponse)
-> Lens
DeleteDeploymentGroupResponse
DeleteDeploymentGroupResponse
(Maybe [AutoScalingGroup])
(Maybe [AutoScalingGroup])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDeploymentGroupResponse' {Maybe [AutoScalingGroup]
hooksNotCleanedUp :: Maybe [AutoScalingGroup]
$sel:hooksNotCleanedUp:DeleteDeploymentGroupResponse' :: DeleteDeploymentGroupResponse -> Maybe [AutoScalingGroup]
hooksNotCleanedUp} -> Maybe [AutoScalingGroup]
hooksNotCleanedUp) (\s :: DeleteDeploymentGroupResponse
s@DeleteDeploymentGroupResponse' {} Maybe [AutoScalingGroup]
a -> DeleteDeploymentGroupResponse
s {$sel:hooksNotCleanedUp:DeleteDeploymentGroupResponse' :: Maybe [AutoScalingGroup]
hooksNotCleanedUp = Maybe [AutoScalingGroup]
a} :: DeleteDeploymentGroupResponse) ((Maybe [AutoScalingGroup] -> f (Maybe [AutoScalingGroup]))
-> DeleteDeploymentGroupResponse
-> f DeleteDeploymentGroupResponse)
-> ((Maybe [AutoScalingGroup] -> f (Maybe [AutoScalingGroup]))
-> Maybe [AutoScalingGroup] -> f (Maybe [AutoScalingGroup]))
-> (Maybe [AutoScalingGroup] -> f (Maybe [AutoScalingGroup]))
-> DeleteDeploymentGroupResponse
-> f DeleteDeploymentGroupResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AutoScalingGroup]
[AutoScalingGroup]
[AutoScalingGroup]
[AutoScalingGroup]
-> Iso
(Maybe [AutoScalingGroup])
(Maybe [AutoScalingGroup])
(Maybe [AutoScalingGroup])
(Maybe [AutoScalingGroup])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[AutoScalingGroup]
[AutoScalingGroup]
[AutoScalingGroup]
[AutoScalingGroup]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deleteDeploymentGroupResponse_httpStatus :: Lens.Lens' DeleteDeploymentGroupResponse Prelude.Int
deleteDeploymentGroupResponse_httpStatus :: (Int -> f Int)
-> DeleteDeploymentGroupResponse -> f DeleteDeploymentGroupResponse
deleteDeploymentGroupResponse_httpStatus = (DeleteDeploymentGroupResponse -> Int)
-> (DeleteDeploymentGroupResponse
-> Int -> DeleteDeploymentGroupResponse)
-> Lens
DeleteDeploymentGroupResponse DeleteDeploymentGroupResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDeploymentGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteDeploymentGroupResponse' :: DeleteDeploymentGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteDeploymentGroupResponse
s@DeleteDeploymentGroupResponse' {} Int
a -> DeleteDeploymentGroupResponse
s {$sel:httpStatus:DeleteDeploymentGroupResponse' :: Int
httpStatus = Int
a} :: DeleteDeploymentGroupResponse)
instance Prelude.NFData DeleteDeploymentGroupResponse