{-# 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.GetMaintenanceWindow
(
getMaintenanceWindow
, GetMaintenanceWindow
, gmwWindowId
, getMaintenanceWindowResponse
, GetMaintenanceWindowResponse
, gmwrsEnabled
, gmwrsSchedule
, gmwrsCreatedDate
, gmwrsName
, gmwrsModifiedDate
, gmwrsCutoff
, gmwrsAllowUnassociatedTargets
, gmwrsDescription
, gmwrsDuration
, gmwrsWindowId
, gmwrsResponseStatus
) 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 GetMaintenanceWindow = GetMaintenanceWindow'
{ _gmwWindowId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getMaintenanceWindow
:: Text
-> GetMaintenanceWindow
getMaintenanceWindow pWindowId_ =
GetMaintenanceWindow' {_gmwWindowId = pWindowId_}
gmwWindowId :: Lens' GetMaintenanceWindow Text
gmwWindowId = lens _gmwWindowId (\ s a -> s{_gmwWindowId = a})
instance AWSRequest GetMaintenanceWindow where
type Rs GetMaintenanceWindow =
GetMaintenanceWindowResponse
request = postJSON ssm
response
= receiveJSON
(\ s h x ->
GetMaintenanceWindowResponse' <$>
(x .?> "Enabled") <*> (x .?> "Schedule") <*>
(x .?> "CreatedDate")
<*> (x .?> "Name")
<*> (x .?> "ModifiedDate")
<*> (x .?> "Cutoff")
<*> (x .?> "AllowUnassociatedTargets")
<*> (x .?> "Description")
<*> (x .?> "Duration")
<*> (x .?> "WindowId")
<*> (pure (fromEnum s)))
instance Hashable GetMaintenanceWindow where
instance NFData GetMaintenanceWindow where
instance ToHeaders GetMaintenanceWindow where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonSSM.GetMaintenanceWindow" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetMaintenanceWindow where
toJSON GetMaintenanceWindow'{..}
= object
(catMaybes [Just ("WindowId" .= _gmwWindowId)])
instance ToPath GetMaintenanceWindow where
toPath = const "/"
instance ToQuery GetMaintenanceWindow where
toQuery = const mempty
data GetMaintenanceWindowResponse = GetMaintenanceWindowResponse'
{ _gmwrsEnabled :: !(Maybe Bool)
, _gmwrsSchedule :: !(Maybe Text)
, _gmwrsCreatedDate :: !(Maybe POSIX)
, _gmwrsName :: !(Maybe Text)
, _gmwrsModifiedDate :: !(Maybe POSIX)
, _gmwrsCutoff :: !(Maybe Nat)
, _gmwrsAllowUnassociatedTargets :: !(Maybe Bool)
, _gmwrsDescription :: !(Maybe (Sensitive Text))
, _gmwrsDuration :: !(Maybe Nat)
, _gmwrsWindowId :: !(Maybe Text)
, _gmwrsResponseStatus :: !Int
} deriving (Eq, Show, Data, Typeable, Generic)
getMaintenanceWindowResponse
:: Int
-> GetMaintenanceWindowResponse
getMaintenanceWindowResponse pResponseStatus_ =
GetMaintenanceWindowResponse'
{ _gmwrsEnabled = Nothing
, _gmwrsSchedule = Nothing
, _gmwrsCreatedDate = Nothing
, _gmwrsName = Nothing
, _gmwrsModifiedDate = Nothing
, _gmwrsCutoff = Nothing
, _gmwrsAllowUnassociatedTargets = Nothing
, _gmwrsDescription = Nothing
, _gmwrsDuration = Nothing
, _gmwrsWindowId = Nothing
, _gmwrsResponseStatus = pResponseStatus_
}
gmwrsEnabled :: Lens' GetMaintenanceWindowResponse (Maybe Bool)
gmwrsEnabled = lens _gmwrsEnabled (\ s a -> s{_gmwrsEnabled = a})
gmwrsSchedule :: Lens' GetMaintenanceWindowResponse (Maybe Text)
gmwrsSchedule = lens _gmwrsSchedule (\ s a -> s{_gmwrsSchedule = a})
gmwrsCreatedDate :: Lens' GetMaintenanceWindowResponse (Maybe UTCTime)
gmwrsCreatedDate = lens _gmwrsCreatedDate (\ s a -> s{_gmwrsCreatedDate = a}) . mapping _Time
gmwrsName :: Lens' GetMaintenanceWindowResponse (Maybe Text)
gmwrsName = lens _gmwrsName (\ s a -> s{_gmwrsName = a})
gmwrsModifiedDate :: Lens' GetMaintenanceWindowResponse (Maybe UTCTime)
gmwrsModifiedDate = lens _gmwrsModifiedDate (\ s a -> s{_gmwrsModifiedDate = a}) . mapping _Time
gmwrsCutoff :: Lens' GetMaintenanceWindowResponse (Maybe Natural)
gmwrsCutoff = lens _gmwrsCutoff (\ s a -> s{_gmwrsCutoff = a}) . mapping _Nat
gmwrsAllowUnassociatedTargets :: Lens' GetMaintenanceWindowResponse (Maybe Bool)
gmwrsAllowUnassociatedTargets = lens _gmwrsAllowUnassociatedTargets (\ s a -> s{_gmwrsAllowUnassociatedTargets = a})
gmwrsDescription :: Lens' GetMaintenanceWindowResponse (Maybe Text)
gmwrsDescription = lens _gmwrsDescription (\ s a -> s{_gmwrsDescription = a}) . mapping _Sensitive
gmwrsDuration :: Lens' GetMaintenanceWindowResponse (Maybe Natural)
gmwrsDuration = lens _gmwrsDuration (\ s a -> s{_gmwrsDuration = a}) . mapping _Nat
gmwrsWindowId :: Lens' GetMaintenanceWindowResponse (Maybe Text)
gmwrsWindowId = lens _gmwrsWindowId (\ s a -> s{_gmwrsWindowId = a})
gmwrsResponseStatus :: Lens' GetMaintenanceWindowResponse Int
gmwrsResponseStatus = lens _gmwrsResponseStatus (\ s a -> s{_gmwrsResponseStatus = a})
instance NFData GetMaintenanceWindowResponse where