{-# 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.UpdateMaintenanceWindowTarget
(
updateMaintenanceWindowTarget
, UpdateMaintenanceWindowTarget
, uReplace
, uOwnerInformation
, uName
, uTargets
, uDescription
, uWindowId
, uWindowTargetId
, updateMaintenanceWindowTargetResponse
, UpdateMaintenanceWindowTargetResponse
, ursOwnerInformation
, ursWindowTargetId
, ursName
, ursTargets
, ursDescription
, ursWindowId
, ursResponseStatus
) 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 UpdateMaintenanceWindowTarget = UpdateMaintenanceWindowTarget'
{ _uReplace :: !(Maybe Bool)
, _uOwnerInformation :: !(Maybe (Sensitive Text))
, _uName :: !(Maybe Text)
, _uTargets :: !(Maybe [Target])
, _uDescription :: !(Maybe (Sensitive Text))
, _uWindowId :: !Text
, _uWindowTargetId :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
updateMaintenanceWindowTarget
:: Text
-> Text
-> UpdateMaintenanceWindowTarget
updateMaintenanceWindowTarget pWindowId_ pWindowTargetId_ =
UpdateMaintenanceWindowTarget'
{ _uReplace = Nothing
, _uOwnerInformation = Nothing
, _uName = Nothing
, _uTargets = Nothing
, _uDescription = Nothing
, _uWindowId = pWindowId_
, _uWindowTargetId = pWindowTargetId_
}
uReplace :: Lens' UpdateMaintenanceWindowTarget (Maybe Bool)
uReplace = lens _uReplace (\ s a -> s{_uReplace = a})
uOwnerInformation :: Lens' UpdateMaintenanceWindowTarget (Maybe Text)
uOwnerInformation = lens _uOwnerInformation (\ s a -> s{_uOwnerInformation = a}) . mapping _Sensitive
uName :: Lens' UpdateMaintenanceWindowTarget (Maybe Text)
uName = lens _uName (\ s a -> s{_uName = a})
uTargets :: Lens' UpdateMaintenanceWindowTarget [Target]
uTargets = lens _uTargets (\ s a -> s{_uTargets = a}) . _Default . _Coerce
uDescription :: Lens' UpdateMaintenanceWindowTarget (Maybe Text)
uDescription = lens _uDescription (\ s a -> s{_uDescription = a}) . mapping _Sensitive
uWindowId :: Lens' UpdateMaintenanceWindowTarget Text
uWindowId = lens _uWindowId (\ s a -> s{_uWindowId = a})
uWindowTargetId :: Lens' UpdateMaintenanceWindowTarget Text
uWindowTargetId = lens _uWindowTargetId (\ s a -> s{_uWindowTargetId = a})
instance AWSRequest UpdateMaintenanceWindowTarget
where
type Rs UpdateMaintenanceWindowTarget =
UpdateMaintenanceWindowTargetResponse
request = postJSON ssm
response
= receiveJSON
(\ s h x ->
UpdateMaintenanceWindowTargetResponse' <$>
(x .?> "OwnerInformation") <*>
(x .?> "WindowTargetId")
<*> (x .?> "Name")
<*> (x .?> "Targets" .!@ mempty)
<*> (x .?> "Description")
<*> (x .?> "WindowId")
<*> (pure (fromEnum s)))
instance Hashable UpdateMaintenanceWindowTarget where
instance NFData UpdateMaintenanceWindowTarget where
instance ToHeaders UpdateMaintenanceWindowTarget
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonSSM.UpdateMaintenanceWindowTarget" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateMaintenanceWindowTarget where
toJSON UpdateMaintenanceWindowTarget'{..}
= object
(catMaybes
[("Replace" .=) <$> _uReplace,
("OwnerInformation" .=) <$> _uOwnerInformation,
("Name" .=) <$> _uName, ("Targets" .=) <$> _uTargets,
("Description" .=) <$> _uDescription,
Just ("WindowId" .= _uWindowId),
Just ("WindowTargetId" .= _uWindowTargetId)])
instance ToPath UpdateMaintenanceWindowTarget where
toPath = const "/"
instance ToQuery UpdateMaintenanceWindowTarget where
toQuery = const mempty
data UpdateMaintenanceWindowTargetResponse = UpdateMaintenanceWindowTargetResponse'
{ _ursOwnerInformation :: !(Maybe (Sensitive Text))
, _ursWindowTargetId :: !(Maybe Text)
, _ursName :: !(Maybe Text)
, _ursTargets :: !(Maybe [Target])
, _ursDescription :: !(Maybe (Sensitive Text))
, _ursWindowId :: !(Maybe Text)
, _ursResponseStatus :: !Int
} deriving (Eq, Show, Data, Typeable, Generic)
updateMaintenanceWindowTargetResponse
:: Int
-> UpdateMaintenanceWindowTargetResponse
updateMaintenanceWindowTargetResponse pResponseStatus_ =
UpdateMaintenanceWindowTargetResponse'
{ _ursOwnerInformation = Nothing
, _ursWindowTargetId = Nothing
, _ursName = Nothing
, _ursTargets = Nothing
, _ursDescription = Nothing
, _ursWindowId = Nothing
, _ursResponseStatus = pResponseStatus_
}
ursOwnerInformation :: Lens' UpdateMaintenanceWindowTargetResponse (Maybe Text)
ursOwnerInformation = lens _ursOwnerInformation (\ s a -> s{_ursOwnerInformation = a}) . mapping _Sensitive
ursWindowTargetId :: Lens' UpdateMaintenanceWindowTargetResponse (Maybe Text)
ursWindowTargetId = lens _ursWindowTargetId (\ s a -> s{_ursWindowTargetId = a})
ursName :: Lens' UpdateMaintenanceWindowTargetResponse (Maybe Text)
ursName = lens _ursName (\ s a -> s{_ursName = a})
ursTargets :: Lens' UpdateMaintenanceWindowTargetResponse [Target]
ursTargets = lens _ursTargets (\ s a -> s{_ursTargets = a}) . _Default . _Coerce
ursDescription :: Lens' UpdateMaintenanceWindowTargetResponse (Maybe Text)
ursDescription = lens _ursDescription (\ s a -> s{_ursDescription = a}) . mapping _Sensitive
ursWindowId :: Lens' UpdateMaintenanceWindowTargetResponse (Maybe Text)
ursWindowId = lens _ursWindowId (\ s a -> s{_ursWindowId = a})
ursResponseStatus :: Lens' UpdateMaintenanceWindowTargetResponse Int
ursResponseStatus = lens _ursResponseStatus (\ s a -> s{_ursResponseStatus = a})
instance NFData UpdateMaintenanceWindowTargetResponse
where