{-# 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.SSM.GetMaintenanceWindowExecution
(
getMaintenanceWindowExecution
, GetMaintenanceWindowExecution
, gmweWindowExecutionId
, getMaintenanceWindowExecutionResponse
, GetMaintenanceWindowExecutionResponse
, gmwersStatus
, gmwersStartTime
, gmwersWindowExecutionId
, gmwersStatusDetails
, gmwersEndTime
, gmwersTaskIds
, gmwersResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.SSM.Types
import Network.AWS.SSM.Types.Product
newtype GetMaintenanceWindowExecution = GetMaintenanceWindowExecution'
{ _gmweWindowExecutionId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getMaintenanceWindowExecution
:: Text
-> GetMaintenanceWindowExecution
getMaintenanceWindowExecution pWindowExecutionId_ =
GetMaintenanceWindowExecution' {_gmweWindowExecutionId = pWindowExecutionId_}
gmweWindowExecutionId :: Lens' GetMaintenanceWindowExecution Text
gmweWindowExecutionId = lens _gmweWindowExecutionId (\ s a -> s{_gmweWindowExecutionId = a})
instance AWSRequest GetMaintenanceWindowExecution
where
type Rs GetMaintenanceWindowExecution =
GetMaintenanceWindowExecutionResponse
request = postJSON ssm
response
= receiveJSON
(\ s h x ->
GetMaintenanceWindowExecutionResponse' <$>
(x .?> "Status") <*> (x .?> "StartTime") <*>
(x .?> "WindowExecutionId")
<*> (x .?> "StatusDetails")
<*> (x .?> "EndTime")
<*> (x .?> "TaskIds" .!@ mempty)
<*> (pure (fromEnum s)))
instance Hashable GetMaintenanceWindowExecution where
instance NFData GetMaintenanceWindowExecution where
instance ToHeaders GetMaintenanceWindowExecution
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonSSM.GetMaintenanceWindowExecution" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetMaintenanceWindowExecution where
toJSON GetMaintenanceWindowExecution'{..}
= object
(catMaybes
[Just
("WindowExecutionId" .= _gmweWindowExecutionId)])
instance ToPath GetMaintenanceWindowExecution where
toPath = const "/"
instance ToQuery GetMaintenanceWindowExecution where
toQuery = const mempty
data GetMaintenanceWindowExecutionResponse = GetMaintenanceWindowExecutionResponse'
{ _gmwersStatus :: !(Maybe MaintenanceWindowExecutionStatus)
, _gmwersStartTime :: !(Maybe POSIX)
, _gmwersWindowExecutionId :: !(Maybe Text)
, _gmwersStatusDetails :: !(Maybe Text)
, _gmwersEndTime :: !(Maybe POSIX)
, _gmwersTaskIds :: !(Maybe [Text])
, _gmwersResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getMaintenanceWindowExecutionResponse
:: Int
-> GetMaintenanceWindowExecutionResponse
getMaintenanceWindowExecutionResponse pResponseStatus_ =
GetMaintenanceWindowExecutionResponse'
{ _gmwersStatus = Nothing
, _gmwersStartTime = Nothing
, _gmwersWindowExecutionId = Nothing
, _gmwersStatusDetails = Nothing
, _gmwersEndTime = Nothing
, _gmwersTaskIds = Nothing
, _gmwersResponseStatus = pResponseStatus_
}
gmwersStatus :: Lens' GetMaintenanceWindowExecutionResponse (Maybe MaintenanceWindowExecutionStatus)
gmwersStatus = lens _gmwersStatus (\ s a -> s{_gmwersStatus = a})
gmwersStartTime :: Lens' GetMaintenanceWindowExecutionResponse (Maybe UTCTime)
gmwersStartTime = lens _gmwersStartTime (\ s a -> s{_gmwersStartTime = a}) . mapping _Time
gmwersWindowExecutionId :: Lens' GetMaintenanceWindowExecutionResponse (Maybe Text)
gmwersWindowExecutionId = lens _gmwersWindowExecutionId (\ s a -> s{_gmwersWindowExecutionId = a})
gmwersStatusDetails :: Lens' GetMaintenanceWindowExecutionResponse (Maybe Text)
gmwersStatusDetails = lens _gmwersStatusDetails (\ s a -> s{_gmwersStatusDetails = a})
gmwersEndTime :: Lens' GetMaintenanceWindowExecutionResponse (Maybe UTCTime)
gmwersEndTime = lens _gmwersEndTime (\ s a -> s{_gmwersEndTime = a}) . mapping _Time
gmwersTaskIds :: Lens' GetMaintenanceWindowExecutionResponse [Text]
gmwersTaskIds = lens _gmwersTaskIds (\ s a -> s{_gmwersTaskIds = a}) . _Default . _Coerce
gmwersResponseStatus :: Lens' GetMaintenanceWindowExecutionResponse Int
gmwersResponseStatus = lens _gmwersResponseStatus (\ s a -> s{_gmwersResponseStatus = a})
instance NFData GetMaintenanceWindowExecutionResponse
where