{-# 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.GetMaintenanceWindowTask
(
getMaintenanceWindowTask
, GetMaintenanceWindowTask
, gmwtWindowId
, gmwtWindowTaskId
, getMaintenanceWindowTaskResponse
, GetMaintenanceWindowTaskResponse
, gmwtrsServiceRoleARN
, gmwtrsWindowTaskId
, gmwtrsTaskParameters
, gmwtrsPriority
, gmwtrsTaskType
, gmwtrsTaskARN
, gmwtrsMaxErrors
, gmwtrsTaskInvocationParameters
, gmwtrsName
, gmwtrsTargets
, gmwtrsLoggingInfo
, gmwtrsDescription
, gmwtrsMaxConcurrency
, gmwtrsWindowId
, gmwtrsResponseStatus
) 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
data GetMaintenanceWindowTask = GetMaintenanceWindowTask'
{ _gmwtWindowId :: !Text
, _gmwtWindowTaskId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getMaintenanceWindowTask
:: Text
-> Text
-> GetMaintenanceWindowTask
getMaintenanceWindowTask pWindowId_ pWindowTaskId_ =
GetMaintenanceWindowTask'
{_gmwtWindowId = pWindowId_, _gmwtWindowTaskId = pWindowTaskId_}
gmwtWindowId :: Lens' GetMaintenanceWindowTask Text
gmwtWindowId = lens _gmwtWindowId (\ s a -> s{_gmwtWindowId = a})
gmwtWindowTaskId :: Lens' GetMaintenanceWindowTask Text
gmwtWindowTaskId = lens _gmwtWindowTaskId (\ s a -> s{_gmwtWindowTaskId = a})
instance AWSRequest GetMaintenanceWindowTask where
type Rs GetMaintenanceWindowTask =
GetMaintenanceWindowTaskResponse
request = postJSON ssm
response
= receiveJSON
(\ s h x ->
GetMaintenanceWindowTaskResponse' <$>
(x .?> "ServiceRoleArn") <*> (x .?> "WindowTaskId")
<*> (x .?> "TaskParameters" .!@ mempty)
<*> (x .?> "Priority")
<*> (x .?> "TaskType")
<*> (x .?> "TaskArn")
<*> (x .?> "MaxErrors")
<*> (x .?> "TaskInvocationParameters")
<*> (x .?> "Name")
<*> (x .?> "Targets" .!@ mempty)
<*> (x .?> "LoggingInfo")
<*> (x .?> "Description")
<*> (x .?> "MaxConcurrency")
<*> (x .?> "WindowId")
<*> (pure (fromEnum s)))
instance Hashable GetMaintenanceWindowTask where
instance NFData GetMaintenanceWindowTask where
instance ToHeaders GetMaintenanceWindowTask where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonSSM.GetMaintenanceWindowTask" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetMaintenanceWindowTask where
toJSON GetMaintenanceWindowTask'{..}
= object
(catMaybes
[Just ("WindowId" .= _gmwtWindowId),
Just ("WindowTaskId" .= _gmwtWindowTaskId)])
instance ToPath GetMaintenanceWindowTask where
toPath = const "/"
instance ToQuery GetMaintenanceWindowTask where
toQuery = const mempty
data GetMaintenanceWindowTaskResponse = GetMaintenanceWindowTaskResponse'
{ _gmwtrsServiceRoleARN :: !(Maybe Text)
, _gmwtrsWindowTaskId :: !(Maybe Text)
, _gmwtrsTaskParameters :: !(Maybe (Sensitive (Map Text (Sensitive MaintenanceWindowTaskParameterValueExpression))))
, _gmwtrsPriority :: !(Maybe Nat)
, _gmwtrsTaskType :: !(Maybe MaintenanceWindowTaskType)
, _gmwtrsTaskARN :: !(Maybe Text)
, _gmwtrsMaxErrors :: !(Maybe Text)
, _gmwtrsTaskInvocationParameters :: !(Maybe MaintenanceWindowTaskInvocationParameters)
, _gmwtrsName :: !(Maybe Text)
, _gmwtrsTargets :: !(Maybe [Target])
, _gmwtrsLoggingInfo :: !(Maybe LoggingInfo)
, _gmwtrsDescription :: !(Maybe (Sensitive Text))
, _gmwtrsMaxConcurrency :: !(Maybe Text)
, _gmwtrsWindowId :: !(Maybe Text)
, _gmwtrsResponseStatus :: !Int
} deriving (Eq, Show, Data, Typeable, Generic)
getMaintenanceWindowTaskResponse
:: Int
-> GetMaintenanceWindowTaskResponse
getMaintenanceWindowTaskResponse pResponseStatus_ =
GetMaintenanceWindowTaskResponse'
{ _gmwtrsServiceRoleARN = Nothing
, _gmwtrsWindowTaskId = Nothing
, _gmwtrsTaskParameters = Nothing
, _gmwtrsPriority = Nothing
, _gmwtrsTaskType = Nothing
, _gmwtrsTaskARN = Nothing
, _gmwtrsMaxErrors = Nothing
, _gmwtrsTaskInvocationParameters = Nothing
, _gmwtrsName = Nothing
, _gmwtrsTargets = Nothing
, _gmwtrsLoggingInfo = Nothing
, _gmwtrsDescription = Nothing
, _gmwtrsMaxConcurrency = Nothing
, _gmwtrsWindowId = Nothing
, _gmwtrsResponseStatus = pResponseStatus_
}
gmwtrsServiceRoleARN :: Lens' GetMaintenanceWindowTaskResponse (Maybe Text)
gmwtrsServiceRoleARN = lens _gmwtrsServiceRoleARN (\ s a -> s{_gmwtrsServiceRoleARN = a})
gmwtrsWindowTaskId :: Lens' GetMaintenanceWindowTaskResponse (Maybe Text)
gmwtrsWindowTaskId = lens _gmwtrsWindowTaskId (\ s a -> s{_gmwtrsWindowTaskId = a})
gmwtrsTaskParameters :: Lens' GetMaintenanceWindowTaskResponse (Maybe (HashMap Text MaintenanceWindowTaskParameterValueExpression))
gmwtrsTaskParameters = lens _gmwtrsTaskParameters (\ s a -> s{_gmwtrsTaskParameters = a}) . mapping (_Sensitive . _Map)
gmwtrsPriority :: Lens' GetMaintenanceWindowTaskResponse (Maybe Natural)
gmwtrsPriority = lens _gmwtrsPriority (\ s a -> s{_gmwtrsPriority = a}) . mapping _Nat
gmwtrsTaskType :: Lens' GetMaintenanceWindowTaskResponse (Maybe MaintenanceWindowTaskType)
gmwtrsTaskType = lens _gmwtrsTaskType (\ s a -> s{_gmwtrsTaskType = a})
gmwtrsTaskARN :: Lens' GetMaintenanceWindowTaskResponse (Maybe Text)
gmwtrsTaskARN = lens _gmwtrsTaskARN (\ s a -> s{_gmwtrsTaskARN = a})
gmwtrsMaxErrors :: Lens' GetMaintenanceWindowTaskResponse (Maybe Text)
gmwtrsMaxErrors = lens _gmwtrsMaxErrors (\ s a -> s{_gmwtrsMaxErrors = a})
gmwtrsTaskInvocationParameters :: Lens' GetMaintenanceWindowTaskResponse (Maybe MaintenanceWindowTaskInvocationParameters)
gmwtrsTaskInvocationParameters = lens _gmwtrsTaskInvocationParameters (\ s a -> s{_gmwtrsTaskInvocationParameters = a})
gmwtrsName :: Lens' GetMaintenanceWindowTaskResponse (Maybe Text)
gmwtrsName = lens _gmwtrsName (\ s a -> s{_gmwtrsName = a})
gmwtrsTargets :: Lens' GetMaintenanceWindowTaskResponse [Target]
gmwtrsTargets = lens _gmwtrsTargets (\ s a -> s{_gmwtrsTargets = a}) . _Default . _Coerce
gmwtrsLoggingInfo :: Lens' GetMaintenanceWindowTaskResponse (Maybe LoggingInfo)
gmwtrsLoggingInfo = lens _gmwtrsLoggingInfo (\ s a -> s{_gmwtrsLoggingInfo = a})
gmwtrsDescription :: Lens' GetMaintenanceWindowTaskResponse (Maybe Text)
gmwtrsDescription = lens _gmwtrsDescription (\ s a -> s{_gmwtrsDescription = a}) . mapping _Sensitive
gmwtrsMaxConcurrency :: Lens' GetMaintenanceWindowTaskResponse (Maybe Text)
gmwtrsMaxConcurrency = lens _gmwtrsMaxConcurrency (\ s a -> s{_gmwtrsMaxConcurrency = a})
gmwtrsWindowId :: Lens' GetMaintenanceWindowTaskResponse (Maybe Text)
gmwtrsWindowId = lens _gmwtrsWindowId (\ s a -> s{_gmwtrsWindowId = a})
gmwtrsResponseStatus :: Lens' GetMaintenanceWindowTaskResponse Int
gmwtrsResponseStatus = lens _gmwtrsResponseStatus (\ s a -> s{_gmwtrsResponseStatus = a})
instance NFData GetMaintenanceWindowTaskResponse
where