{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.Greengrass.GetDeploymentStatus
(
getDeploymentStatus
, GetDeploymentStatus
, gdsGroupId
, gdsDeploymentId
, getDeploymentStatusResponse
, GetDeploymentStatusResponse
, gdsrsDeploymentType
, gdsrsErrorDetails
, gdsrsDeploymentStatus
, gdsrsUpdatedAt
, gdsrsErrorMessage
, gdsrsResponseStatus
) where
import Network.AWS.Greengrass.Types
import Network.AWS.Greengrass.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data GetDeploymentStatus = GetDeploymentStatus'
{ _gdsGroupId :: !Text
, _gdsDeploymentId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDeploymentStatus
:: Text
-> Text
-> GetDeploymentStatus
getDeploymentStatus pGroupId_ pDeploymentId_ =
GetDeploymentStatus'
{_gdsGroupId = pGroupId_, _gdsDeploymentId = pDeploymentId_}
gdsGroupId :: Lens' GetDeploymentStatus Text
gdsGroupId = lens _gdsGroupId (\ s a -> s{_gdsGroupId = a})
gdsDeploymentId :: Lens' GetDeploymentStatus Text
gdsDeploymentId = lens _gdsDeploymentId (\ s a -> s{_gdsDeploymentId = a})
instance AWSRequest GetDeploymentStatus where
type Rs GetDeploymentStatus =
GetDeploymentStatusResponse
request = get greengrass
response
= receiveJSON
(\ s h x ->
GetDeploymentStatusResponse' <$>
(x .?> "DeploymentType") <*>
(x .?> "ErrorDetails" .!@ mempty)
<*> (x .?> "DeploymentStatus")
<*> (x .?> "UpdatedAt")
<*> (x .?> "ErrorMessage")
<*> (pure (fromEnum s)))
instance Hashable GetDeploymentStatus where
instance NFData GetDeploymentStatus where
instance ToHeaders GetDeploymentStatus where
toHeaders
= const
(mconcat
["Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToPath GetDeploymentStatus where
toPath GetDeploymentStatus'{..}
= mconcat
["/greengrass/groups/", toBS _gdsGroupId,
"/deployments/", toBS _gdsDeploymentId, "/status"]
instance ToQuery GetDeploymentStatus where
toQuery = const mempty
data GetDeploymentStatusResponse = GetDeploymentStatusResponse'
{ _gdsrsDeploymentType :: !(Maybe DeploymentType)
, _gdsrsErrorDetails :: !(Maybe [ErrorDetail])
, _gdsrsDeploymentStatus :: !(Maybe Text)
, _gdsrsUpdatedAt :: !(Maybe Text)
, _gdsrsErrorMessage :: !(Maybe Text)
, _gdsrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDeploymentStatusResponse
:: Int
-> GetDeploymentStatusResponse
getDeploymentStatusResponse pResponseStatus_ =
GetDeploymentStatusResponse'
{ _gdsrsDeploymentType = Nothing
, _gdsrsErrorDetails = Nothing
, _gdsrsDeploymentStatus = Nothing
, _gdsrsUpdatedAt = Nothing
, _gdsrsErrorMessage = Nothing
, _gdsrsResponseStatus = pResponseStatus_
}
gdsrsDeploymentType :: Lens' GetDeploymentStatusResponse (Maybe DeploymentType)
gdsrsDeploymentType = lens _gdsrsDeploymentType (\ s a -> s{_gdsrsDeploymentType = a})
gdsrsErrorDetails :: Lens' GetDeploymentStatusResponse [ErrorDetail]
gdsrsErrorDetails = lens _gdsrsErrorDetails (\ s a -> s{_gdsrsErrorDetails = a}) . _Default . _Coerce
gdsrsDeploymentStatus :: Lens' GetDeploymentStatusResponse (Maybe Text)
gdsrsDeploymentStatus = lens _gdsrsDeploymentStatus (\ s a -> s{_gdsrsDeploymentStatus = a})
gdsrsUpdatedAt :: Lens' GetDeploymentStatusResponse (Maybe Text)
gdsrsUpdatedAt = lens _gdsrsUpdatedAt (\ s a -> s{_gdsrsUpdatedAt = a})
gdsrsErrorMessage :: Lens' GetDeploymentStatusResponse (Maybe Text)
gdsrsErrorMessage = lens _gdsrsErrorMessage (\ s a -> s{_gdsrsErrorMessage = a})
gdsrsResponseStatus :: Lens' GetDeploymentStatusResponse Int
gdsrsResponseStatus = lens _gdsrsResponseStatus (\ s a -> s{_gdsrsResponseStatus = a})
instance NFData GetDeploymentStatusResponse where