{-# 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.RegisterTaskWithMaintenanceWindow
(
registerTaskWithMaintenanceWindow
, RegisterTaskWithMaintenanceWindow
, rtwmwTaskParameters
, rtwmwPriority
, rtwmwClientToken
, rtwmwTaskInvocationParameters
, rtwmwName
, rtwmwLoggingInfo
, rtwmwDescription
, rtwmwWindowId
, rtwmwTargets
, rtwmwTaskARN
, rtwmwServiceRoleARN
, rtwmwTaskType
, rtwmwMaxConcurrency
, rtwmwMaxErrors
, registerTaskWithMaintenanceWindowResponse
, RegisterTaskWithMaintenanceWindowResponse
, rtwmwrsWindowTaskId
, rtwmwrsResponseStatus
) 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 RegisterTaskWithMaintenanceWindow = RegisterTaskWithMaintenanceWindow'
{ _rtwmwTaskParameters :: !(Maybe (Sensitive (Map Text (Sensitive MaintenanceWindowTaskParameterValueExpression))))
, _rtwmwPriority :: !(Maybe Nat)
, _rtwmwClientToken :: !(Maybe Text)
, _rtwmwTaskInvocationParameters :: !(Maybe MaintenanceWindowTaskInvocationParameters)
, _rtwmwName :: !(Maybe Text)
, _rtwmwLoggingInfo :: !(Maybe LoggingInfo)
, _rtwmwDescription :: !(Maybe (Sensitive Text))
, _rtwmwWindowId :: !Text
, _rtwmwTargets :: ![Target]
, _rtwmwTaskARN :: !Text
, _rtwmwServiceRoleARN :: !Text
, _rtwmwTaskType :: !MaintenanceWindowTaskType
, _rtwmwMaxConcurrency :: !Text
, _rtwmwMaxErrors :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
registerTaskWithMaintenanceWindow
:: Text
-> Text
-> Text
-> MaintenanceWindowTaskType
-> Text
-> Text
-> RegisterTaskWithMaintenanceWindow
registerTaskWithMaintenanceWindow pWindowId_ pTaskARN_ pServiceRoleARN_ pTaskType_ pMaxConcurrency_ pMaxErrors_ =
RegisterTaskWithMaintenanceWindow'
{ _rtwmwTaskParameters = Nothing
, _rtwmwPriority = Nothing
, _rtwmwClientToken = Nothing
, _rtwmwTaskInvocationParameters = Nothing
, _rtwmwName = Nothing
, _rtwmwLoggingInfo = Nothing
, _rtwmwDescription = Nothing
, _rtwmwWindowId = pWindowId_
, _rtwmwTargets = mempty
, _rtwmwTaskARN = pTaskARN_
, _rtwmwServiceRoleARN = pServiceRoleARN_
, _rtwmwTaskType = pTaskType_
, _rtwmwMaxConcurrency = pMaxConcurrency_
, _rtwmwMaxErrors = pMaxErrors_
}
rtwmwTaskParameters :: Lens' RegisterTaskWithMaintenanceWindow (Maybe (HashMap Text MaintenanceWindowTaskParameterValueExpression))
rtwmwTaskParameters = lens _rtwmwTaskParameters (\ s a -> s{_rtwmwTaskParameters = a}) . mapping (_Sensitive . _Map)
rtwmwPriority :: Lens' RegisterTaskWithMaintenanceWindow (Maybe Natural)
rtwmwPriority = lens _rtwmwPriority (\ s a -> s{_rtwmwPriority = a}) . mapping _Nat
rtwmwClientToken :: Lens' RegisterTaskWithMaintenanceWindow (Maybe Text)
rtwmwClientToken = lens _rtwmwClientToken (\ s a -> s{_rtwmwClientToken = a})
rtwmwTaskInvocationParameters :: Lens' RegisterTaskWithMaintenanceWindow (Maybe MaintenanceWindowTaskInvocationParameters)
rtwmwTaskInvocationParameters = lens _rtwmwTaskInvocationParameters (\ s a -> s{_rtwmwTaskInvocationParameters = a})
rtwmwName :: Lens' RegisterTaskWithMaintenanceWindow (Maybe Text)
rtwmwName = lens _rtwmwName (\ s a -> s{_rtwmwName = a})
rtwmwLoggingInfo :: Lens' RegisterTaskWithMaintenanceWindow (Maybe LoggingInfo)
rtwmwLoggingInfo = lens _rtwmwLoggingInfo (\ s a -> s{_rtwmwLoggingInfo = a})
rtwmwDescription :: Lens' RegisterTaskWithMaintenanceWindow (Maybe Text)
rtwmwDescription = lens _rtwmwDescription (\ s a -> s{_rtwmwDescription = a}) . mapping _Sensitive
rtwmwWindowId :: Lens' RegisterTaskWithMaintenanceWindow Text
rtwmwWindowId = lens _rtwmwWindowId (\ s a -> s{_rtwmwWindowId = a})
rtwmwTargets :: Lens' RegisterTaskWithMaintenanceWindow [Target]
rtwmwTargets = lens _rtwmwTargets (\ s a -> s{_rtwmwTargets = a}) . _Coerce
rtwmwTaskARN :: Lens' RegisterTaskWithMaintenanceWindow Text
rtwmwTaskARN = lens _rtwmwTaskARN (\ s a -> s{_rtwmwTaskARN = a})
rtwmwServiceRoleARN :: Lens' RegisterTaskWithMaintenanceWindow Text
rtwmwServiceRoleARN = lens _rtwmwServiceRoleARN (\ s a -> s{_rtwmwServiceRoleARN = a})
rtwmwTaskType :: Lens' RegisterTaskWithMaintenanceWindow MaintenanceWindowTaskType
rtwmwTaskType = lens _rtwmwTaskType (\ s a -> s{_rtwmwTaskType = a})
rtwmwMaxConcurrency :: Lens' RegisterTaskWithMaintenanceWindow Text
rtwmwMaxConcurrency = lens _rtwmwMaxConcurrency (\ s a -> s{_rtwmwMaxConcurrency = a})
rtwmwMaxErrors :: Lens' RegisterTaskWithMaintenanceWindow Text
rtwmwMaxErrors = lens _rtwmwMaxErrors (\ s a -> s{_rtwmwMaxErrors = a})
instance AWSRequest RegisterTaskWithMaintenanceWindow
where
type Rs RegisterTaskWithMaintenanceWindow =
RegisterTaskWithMaintenanceWindowResponse
request = postJSON ssm
response
= receiveJSON
(\ s h x ->
RegisterTaskWithMaintenanceWindowResponse' <$>
(x .?> "WindowTaskId") <*> (pure (fromEnum s)))
instance Hashable RegisterTaskWithMaintenanceWindow
where
instance NFData RegisterTaskWithMaintenanceWindow
where
instance ToHeaders RegisterTaskWithMaintenanceWindow
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonSSM.RegisterTaskWithMaintenanceWindow" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON RegisterTaskWithMaintenanceWindow
where
toJSON RegisterTaskWithMaintenanceWindow'{..}
= object
(catMaybes
[("TaskParameters" .=) <$> _rtwmwTaskParameters,
("Priority" .=) <$> _rtwmwPriority,
("ClientToken" .=) <$> _rtwmwClientToken,
("TaskInvocationParameters" .=) <$>
_rtwmwTaskInvocationParameters,
("Name" .=) <$> _rtwmwName,
("LoggingInfo" .=) <$> _rtwmwLoggingInfo,
("Description" .=) <$> _rtwmwDescription,
Just ("WindowId" .= _rtwmwWindowId),
Just ("Targets" .= _rtwmwTargets),
Just ("TaskArn" .= _rtwmwTaskARN),
Just ("ServiceRoleArn" .= _rtwmwServiceRoleARN),
Just ("TaskType" .= _rtwmwTaskType),
Just ("MaxConcurrency" .= _rtwmwMaxConcurrency),
Just ("MaxErrors" .= _rtwmwMaxErrors)])
instance ToPath RegisterTaskWithMaintenanceWindow
where
toPath = const "/"
instance ToQuery RegisterTaskWithMaintenanceWindow
where
toQuery = const mempty
data RegisterTaskWithMaintenanceWindowResponse = RegisterTaskWithMaintenanceWindowResponse'
{ _rtwmwrsWindowTaskId :: !(Maybe Text)
, _rtwmwrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
registerTaskWithMaintenanceWindowResponse
:: Int
-> RegisterTaskWithMaintenanceWindowResponse
registerTaskWithMaintenanceWindowResponse pResponseStatus_ =
RegisterTaskWithMaintenanceWindowResponse'
{_rtwmwrsWindowTaskId = Nothing, _rtwmwrsResponseStatus = pResponseStatus_}
rtwmwrsWindowTaskId :: Lens' RegisterTaskWithMaintenanceWindowResponse (Maybe Text)
rtwmwrsWindowTaskId = lens _rtwmwrsWindowTaskId (\ s a -> s{_rtwmwrsWindowTaskId = a})
rtwmwrsResponseStatus :: Lens' RegisterTaskWithMaintenanceWindowResponse Int
rtwmwrsResponseStatus = lens _rtwmwrsResponseStatus (\ s a -> s{_rtwmwrsResponseStatus = a})
instance NFData
RegisterTaskWithMaintenanceWindowResponse
where