{-# 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.GetDeploymentGroup
(
GetDeploymentGroup (..),
newGetDeploymentGroup,
getDeploymentGroup_applicationName,
getDeploymentGroup_deploymentGroupName,
GetDeploymentGroupResponse (..),
newGetDeploymentGroupResponse,
getDeploymentGroupResponse_deploymentGroupInfo,
getDeploymentGroupResponse_httpStatus,
)
where
import Amazonka.CodeDeploy.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetDeploymentGroup = GetDeploymentGroup'
{
GetDeploymentGroup -> Text
applicationName :: Prelude.Text,
GetDeploymentGroup -> Text
deploymentGroupName :: Prelude.Text
}
deriving (GetDeploymentGroup -> GetDeploymentGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeploymentGroup -> GetDeploymentGroup -> Bool
$c/= :: GetDeploymentGroup -> GetDeploymentGroup -> Bool
== :: GetDeploymentGroup -> GetDeploymentGroup -> Bool
$c== :: GetDeploymentGroup -> GetDeploymentGroup -> Bool
Prelude.Eq, ReadPrec [GetDeploymentGroup]
ReadPrec GetDeploymentGroup
Int -> ReadS GetDeploymentGroup
ReadS [GetDeploymentGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDeploymentGroup]
$creadListPrec :: ReadPrec [GetDeploymentGroup]
readPrec :: ReadPrec GetDeploymentGroup
$creadPrec :: ReadPrec GetDeploymentGroup
readList :: ReadS [GetDeploymentGroup]
$creadList :: ReadS [GetDeploymentGroup]
readsPrec :: Int -> ReadS GetDeploymentGroup
$creadsPrec :: Int -> ReadS GetDeploymentGroup
Prelude.Read, Int -> GetDeploymentGroup -> ShowS
[GetDeploymentGroup] -> ShowS
GetDeploymentGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeploymentGroup] -> ShowS
$cshowList :: [GetDeploymentGroup] -> ShowS
show :: GetDeploymentGroup -> String
$cshow :: GetDeploymentGroup -> String
showsPrec :: Int -> GetDeploymentGroup -> ShowS
$cshowsPrec :: Int -> GetDeploymentGroup -> ShowS
Prelude.Show, forall x. Rep GetDeploymentGroup x -> GetDeploymentGroup
forall x. GetDeploymentGroup -> Rep GetDeploymentGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDeploymentGroup x -> GetDeploymentGroup
$cfrom :: forall x. GetDeploymentGroup -> Rep GetDeploymentGroup x
Prelude.Generic)
newGetDeploymentGroup ::
Prelude.Text ->
Prelude.Text ->
GetDeploymentGroup
newGetDeploymentGroup :: Text -> Text -> GetDeploymentGroup
newGetDeploymentGroup
Text
pApplicationName_
Text
pDeploymentGroupName_ =
GetDeploymentGroup'
{ $sel:applicationName:GetDeploymentGroup' :: Text
applicationName =
Text
pApplicationName_,
$sel:deploymentGroupName:GetDeploymentGroup' :: Text
deploymentGroupName = Text
pDeploymentGroupName_
}
getDeploymentGroup_applicationName :: Lens.Lens' GetDeploymentGroup Prelude.Text
getDeploymentGroup_applicationName :: Lens' GetDeploymentGroup Text
getDeploymentGroup_applicationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentGroup' {Text
applicationName :: Text
$sel:applicationName:GetDeploymentGroup' :: GetDeploymentGroup -> Text
applicationName} -> Text
applicationName) (\s :: GetDeploymentGroup
s@GetDeploymentGroup' {} Text
a -> GetDeploymentGroup
s {$sel:applicationName:GetDeploymentGroup' :: Text
applicationName = Text
a} :: GetDeploymentGroup)
getDeploymentGroup_deploymentGroupName :: Lens.Lens' GetDeploymentGroup Prelude.Text
getDeploymentGroup_deploymentGroupName :: Lens' GetDeploymentGroup Text
getDeploymentGroup_deploymentGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentGroup' {Text
deploymentGroupName :: Text
$sel:deploymentGroupName:GetDeploymentGroup' :: GetDeploymentGroup -> Text
deploymentGroupName} -> Text
deploymentGroupName) (\s :: GetDeploymentGroup
s@GetDeploymentGroup' {} Text
a -> GetDeploymentGroup
s {$sel:deploymentGroupName:GetDeploymentGroup' :: Text
deploymentGroupName = Text
a} :: GetDeploymentGroup)
instance Core.AWSRequest GetDeploymentGroup where
type
AWSResponse GetDeploymentGroup =
GetDeploymentGroupResponse
request :: (Service -> Service)
-> GetDeploymentGroup -> Request GetDeploymentGroup
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetDeploymentGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetDeploymentGroup)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe DeploymentGroupInfo -> Int -> GetDeploymentGroupResponse
GetDeploymentGroupResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"deploymentGroupInfo")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetDeploymentGroup where
hashWithSalt :: Int -> GetDeploymentGroup -> Int
hashWithSalt Int
_salt GetDeploymentGroup' {Text
deploymentGroupName :: Text
applicationName :: Text
$sel:deploymentGroupName:GetDeploymentGroup' :: GetDeploymentGroup -> Text
$sel:applicationName:GetDeploymentGroup' :: GetDeploymentGroup -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
deploymentGroupName
instance Prelude.NFData GetDeploymentGroup where
rnf :: GetDeploymentGroup -> ()
rnf GetDeploymentGroup' {Text
deploymentGroupName :: Text
applicationName :: Text
$sel:deploymentGroupName:GetDeploymentGroup' :: GetDeploymentGroup -> Text
$sel:applicationName:GetDeploymentGroup' :: GetDeploymentGroup -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
applicationName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
deploymentGroupName
instance Data.ToHeaders GetDeploymentGroup where
toHeaders :: GetDeploymentGroup -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"CodeDeploy_20141006.GetDeploymentGroup" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON GetDeploymentGroup where
toJSON :: GetDeploymentGroup -> Value
toJSON GetDeploymentGroup' {Text
deploymentGroupName :: Text
applicationName :: Text
$sel:deploymentGroupName:GetDeploymentGroup' :: GetDeploymentGroup -> Text
$sel:applicationName:GetDeploymentGroup' :: GetDeploymentGroup -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"applicationName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
applicationName),
forall a. a -> Maybe a
Prelude.Just
(Key
"deploymentGroupName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
deploymentGroupName)
]
)
instance Data.ToPath GetDeploymentGroup where
toPath :: GetDeploymentGroup -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetDeploymentGroup where
toQuery :: GetDeploymentGroup -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetDeploymentGroupResponse = GetDeploymentGroupResponse'
{
GetDeploymentGroupResponse -> Maybe DeploymentGroupInfo
deploymentGroupInfo :: Prelude.Maybe DeploymentGroupInfo,
GetDeploymentGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetDeploymentGroupResponse -> GetDeploymentGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeploymentGroupResponse -> GetDeploymentGroupResponse -> Bool
$c/= :: GetDeploymentGroupResponse -> GetDeploymentGroupResponse -> Bool
== :: GetDeploymentGroupResponse -> GetDeploymentGroupResponse -> Bool
$c== :: GetDeploymentGroupResponse -> GetDeploymentGroupResponse -> Bool
Prelude.Eq, ReadPrec [GetDeploymentGroupResponse]
ReadPrec GetDeploymentGroupResponse
Int -> ReadS GetDeploymentGroupResponse
ReadS [GetDeploymentGroupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDeploymentGroupResponse]
$creadListPrec :: ReadPrec [GetDeploymentGroupResponse]
readPrec :: ReadPrec GetDeploymentGroupResponse
$creadPrec :: ReadPrec GetDeploymentGroupResponse
readList :: ReadS [GetDeploymentGroupResponse]
$creadList :: ReadS [GetDeploymentGroupResponse]
readsPrec :: Int -> ReadS GetDeploymentGroupResponse
$creadsPrec :: Int -> ReadS GetDeploymentGroupResponse
Prelude.Read, Int -> GetDeploymentGroupResponse -> ShowS
[GetDeploymentGroupResponse] -> ShowS
GetDeploymentGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeploymentGroupResponse] -> ShowS
$cshowList :: [GetDeploymentGroupResponse] -> ShowS
show :: GetDeploymentGroupResponse -> String
$cshow :: GetDeploymentGroupResponse -> String
showsPrec :: Int -> GetDeploymentGroupResponse -> ShowS
$cshowsPrec :: Int -> GetDeploymentGroupResponse -> ShowS
Prelude.Show, forall x.
Rep GetDeploymentGroupResponse x -> GetDeploymentGroupResponse
forall x.
GetDeploymentGroupResponse -> Rep GetDeploymentGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDeploymentGroupResponse x -> GetDeploymentGroupResponse
$cfrom :: forall x.
GetDeploymentGroupResponse -> Rep GetDeploymentGroupResponse x
Prelude.Generic)
newGetDeploymentGroupResponse ::
Prelude.Int ->
GetDeploymentGroupResponse
newGetDeploymentGroupResponse :: Int -> GetDeploymentGroupResponse
newGetDeploymentGroupResponse Int
pHttpStatus_ =
GetDeploymentGroupResponse'
{ $sel:deploymentGroupInfo:GetDeploymentGroupResponse' :: Maybe DeploymentGroupInfo
deploymentGroupInfo =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetDeploymentGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getDeploymentGroupResponse_deploymentGroupInfo :: Lens.Lens' GetDeploymentGroupResponse (Prelude.Maybe DeploymentGroupInfo)
getDeploymentGroupResponse_deploymentGroupInfo :: Lens' GetDeploymentGroupResponse (Maybe DeploymentGroupInfo)
getDeploymentGroupResponse_deploymentGroupInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentGroupResponse' {Maybe DeploymentGroupInfo
deploymentGroupInfo :: Maybe DeploymentGroupInfo
$sel:deploymentGroupInfo:GetDeploymentGroupResponse' :: GetDeploymentGroupResponse -> Maybe DeploymentGroupInfo
deploymentGroupInfo} -> Maybe DeploymentGroupInfo
deploymentGroupInfo) (\s :: GetDeploymentGroupResponse
s@GetDeploymentGroupResponse' {} Maybe DeploymentGroupInfo
a -> GetDeploymentGroupResponse
s {$sel:deploymentGroupInfo:GetDeploymentGroupResponse' :: Maybe DeploymentGroupInfo
deploymentGroupInfo = Maybe DeploymentGroupInfo
a} :: GetDeploymentGroupResponse)
getDeploymentGroupResponse_httpStatus :: Lens.Lens' GetDeploymentGroupResponse Prelude.Int
getDeploymentGroupResponse_httpStatus :: Lens' GetDeploymentGroupResponse Int
getDeploymentGroupResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeploymentGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetDeploymentGroupResponse' :: GetDeploymentGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetDeploymentGroupResponse
s@GetDeploymentGroupResponse' {} Int
a -> GetDeploymentGroupResponse
s {$sel:httpStatus:GetDeploymentGroupResponse' :: Int
httpStatus = Int
a} :: GetDeploymentGroupResponse)
instance Prelude.NFData GetDeploymentGroupResponse where
rnf :: GetDeploymentGroupResponse -> ()
rnf GetDeploymentGroupResponse' {Int
Maybe DeploymentGroupInfo
httpStatus :: Int
deploymentGroupInfo :: Maybe DeploymentGroupInfo
$sel:httpStatus:GetDeploymentGroupResponse' :: GetDeploymentGroupResponse -> Int
$sel:deploymentGroupInfo:GetDeploymentGroupResponse' :: GetDeploymentGroupResponse -> Maybe DeploymentGroupInfo
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DeploymentGroupInfo
deploymentGroupInfo
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus