{-# 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.GetPatchBaselineForPatchGroup
(
getPatchBaselineForPatchGroup
, GetPatchBaselineForPatchGroup
, gpbfpgOperatingSystem
, gpbfpgPatchGroup
, getPatchBaselineForPatchGroupResponse
, GetPatchBaselineForPatchGroupResponse
, gpbfpgrsOperatingSystem
, gpbfpgrsBaselineId
, gpbfpgrsPatchGroup
, gpbfpgrsResponseStatus
) 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 GetPatchBaselineForPatchGroup = GetPatchBaselineForPatchGroup'
{ _gpbfpgOperatingSystem :: !(Maybe OperatingSystem)
, _gpbfpgPatchGroup :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getPatchBaselineForPatchGroup
:: Text
-> GetPatchBaselineForPatchGroup
getPatchBaselineForPatchGroup pPatchGroup_ =
GetPatchBaselineForPatchGroup'
{_gpbfpgOperatingSystem = Nothing, _gpbfpgPatchGroup = pPatchGroup_}
gpbfpgOperatingSystem :: Lens' GetPatchBaselineForPatchGroup (Maybe OperatingSystem)
gpbfpgOperatingSystem = lens _gpbfpgOperatingSystem (\ s a -> s{_gpbfpgOperatingSystem = a})
gpbfpgPatchGroup :: Lens' GetPatchBaselineForPatchGroup Text
gpbfpgPatchGroup = lens _gpbfpgPatchGroup (\ s a -> s{_gpbfpgPatchGroup = a})
instance AWSRequest GetPatchBaselineForPatchGroup
where
type Rs GetPatchBaselineForPatchGroup =
GetPatchBaselineForPatchGroupResponse
request = postJSON ssm
response
= receiveJSON
(\ s h x ->
GetPatchBaselineForPatchGroupResponse' <$>
(x .?> "OperatingSystem") <*> (x .?> "BaselineId")
<*> (x .?> "PatchGroup")
<*> (pure (fromEnum s)))
instance Hashable GetPatchBaselineForPatchGroup where
instance NFData GetPatchBaselineForPatchGroup where
instance ToHeaders GetPatchBaselineForPatchGroup
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonSSM.GetPatchBaselineForPatchGroup" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetPatchBaselineForPatchGroup where
toJSON GetPatchBaselineForPatchGroup'{..}
= object
(catMaybes
[("OperatingSystem" .=) <$> _gpbfpgOperatingSystem,
Just ("PatchGroup" .= _gpbfpgPatchGroup)])
instance ToPath GetPatchBaselineForPatchGroup where
toPath = const "/"
instance ToQuery GetPatchBaselineForPatchGroup where
toQuery = const mempty
data GetPatchBaselineForPatchGroupResponse = GetPatchBaselineForPatchGroupResponse'
{ _gpbfpgrsOperatingSystem :: !(Maybe OperatingSystem)
, _gpbfpgrsBaselineId :: !(Maybe Text)
, _gpbfpgrsPatchGroup :: !(Maybe Text)
, _gpbfpgrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getPatchBaselineForPatchGroupResponse
:: Int
-> GetPatchBaselineForPatchGroupResponse
getPatchBaselineForPatchGroupResponse pResponseStatus_ =
GetPatchBaselineForPatchGroupResponse'
{ _gpbfpgrsOperatingSystem = Nothing
, _gpbfpgrsBaselineId = Nothing
, _gpbfpgrsPatchGroup = Nothing
, _gpbfpgrsResponseStatus = pResponseStatus_
}
gpbfpgrsOperatingSystem :: Lens' GetPatchBaselineForPatchGroupResponse (Maybe OperatingSystem)
gpbfpgrsOperatingSystem = lens _gpbfpgrsOperatingSystem (\ s a -> s{_gpbfpgrsOperatingSystem = a})
gpbfpgrsBaselineId :: Lens' GetPatchBaselineForPatchGroupResponse (Maybe Text)
gpbfpgrsBaselineId = lens _gpbfpgrsBaselineId (\ s a -> s{_gpbfpgrsBaselineId = a})
gpbfpgrsPatchGroup :: Lens' GetPatchBaselineForPatchGroupResponse (Maybe Text)
gpbfpgrsPatchGroup = lens _gpbfpgrsPatchGroup (\ s a -> s{_gpbfpgrsPatchGroup = a})
gpbfpgrsResponseStatus :: Lens' GetPatchBaselineForPatchGroupResponse Int
gpbfpgrsResponseStatus = lens _gpbfpgrsResponseStatus (\ s a -> s{_gpbfpgrsResponseStatus = a})
instance NFData GetPatchBaselineForPatchGroupResponse
where