{-# 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.GetPatchBaseline
(
getPatchBaseline
, GetPatchBaseline
, gpbBaselineId
, getPatchBaselineResponse
, GetPatchBaselineResponse
, gpbrsApprovalRules
, gpbrsOperatingSystem
, gpbrsGlobalFilters
, gpbrsApprovedPatchesComplianceLevel
, gpbrsApprovedPatches
, gpbrsApprovedPatchesEnableNonSecurity
, gpbrsRejectedPatches
, gpbrsSources
, gpbrsCreatedDate
, gpbrsName
, gpbrsPatchGroups
, gpbrsModifiedDate
, gpbrsDescription
, gpbrsBaselineId
, gpbrsResponseStatus
) 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 GetPatchBaseline = GetPatchBaseline'
{ _gpbBaselineId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getPatchBaseline
:: Text
-> GetPatchBaseline
getPatchBaseline pBaselineId_ =
GetPatchBaseline' {_gpbBaselineId = pBaselineId_}
gpbBaselineId :: Lens' GetPatchBaseline Text
gpbBaselineId = lens _gpbBaselineId (\ s a -> s{_gpbBaselineId = a})
instance AWSRequest GetPatchBaseline where
type Rs GetPatchBaseline = GetPatchBaselineResponse
request = postJSON ssm
response
= receiveJSON
(\ s h x ->
GetPatchBaselineResponse' <$>
(x .?> "ApprovalRules") <*> (x .?> "OperatingSystem")
<*> (x .?> "GlobalFilters")
<*> (x .?> "ApprovedPatchesComplianceLevel")
<*> (x .?> "ApprovedPatches" .!@ mempty)
<*> (x .?> "ApprovedPatchesEnableNonSecurity")
<*> (x .?> "RejectedPatches" .!@ mempty)
<*> (x .?> "Sources" .!@ mempty)
<*> (x .?> "CreatedDate")
<*> (x .?> "Name")
<*> (x .?> "PatchGroups" .!@ mempty)
<*> (x .?> "ModifiedDate")
<*> (x .?> "Description")
<*> (x .?> "BaselineId")
<*> (pure (fromEnum s)))
instance Hashable GetPatchBaseline where
instance NFData GetPatchBaseline where
instance ToHeaders GetPatchBaseline where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonSSM.GetPatchBaseline" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetPatchBaseline where
toJSON GetPatchBaseline'{..}
= object
(catMaybes [Just ("BaselineId" .= _gpbBaselineId)])
instance ToPath GetPatchBaseline where
toPath = const "/"
instance ToQuery GetPatchBaseline where
toQuery = const mempty
data GetPatchBaselineResponse = GetPatchBaselineResponse'
{ _gpbrsApprovalRules :: !(Maybe PatchRuleGroup)
, _gpbrsOperatingSystem :: !(Maybe OperatingSystem)
, _gpbrsGlobalFilters :: !(Maybe PatchFilterGroup)
, _gpbrsApprovedPatchesComplianceLevel :: !(Maybe PatchComplianceLevel)
, _gpbrsApprovedPatches :: !(Maybe [Text])
, _gpbrsApprovedPatchesEnableNonSecurity :: !(Maybe Bool)
, _gpbrsRejectedPatches :: !(Maybe [Text])
, _gpbrsSources :: !(Maybe [PatchSource])
, _gpbrsCreatedDate :: !(Maybe POSIX)
, _gpbrsName :: !(Maybe Text)
, _gpbrsPatchGroups :: !(Maybe [Text])
, _gpbrsModifiedDate :: !(Maybe POSIX)
, _gpbrsDescription :: !(Maybe Text)
, _gpbrsBaselineId :: !(Maybe Text)
, _gpbrsResponseStatus :: !Int
} deriving (Eq, Show, Data, Typeable, Generic)
getPatchBaselineResponse
:: Int
-> GetPatchBaselineResponse
getPatchBaselineResponse pResponseStatus_ =
GetPatchBaselineResponse'
{ _gpbrsApprovalRules = Nothing
, _gpbrsOperatingSystem = Nothing
, _gpbrsGlobalFilters = Nothing
, _gpbrsApprovedPatchesComplianceLevel = Nothing
, _gpbrsApprovedPatches = Nothing
, _gpbrsApprovedPatchesEnableNonSecurity = Nothing
, _gpbrsRejectedPatches = Nothing
, _gpbrsSources = Nothing
, _gpbrsCreatedDate = Nothing
, _gpbrsName = Nothing
, _gpbrsPatchGroups = Nothing
, _gpbrsModifiedDate = Nothing
, _gpbrsDescription = Nothing
, _gpbrsBaselineId = Nothing
, _gpbrsResponseStatus = pResponseStatus_
}
gpbrsApprovalRules :: Lens' GetPatchBaselineResponse (Maybe PatchRuleGroup)
gpbrsApprovalRules = lens _gpbrsApprovalRules (\ s a -> s{_gpbrsApprovalRules = a})
gpbrsOperatingSystem :: Lens' GetPatchBaselineResponse (Maybe OperatingSystem)
gpbrsOperatingSystem = lens _gpbrsOperatingSystem (\ s a -> s{_gpbrsOperatingSystem = a})
gpbrsGlobalFilters :: Lens' GetPatchBaselineResponse (Maybe PatchFilterGroup)
gpbrsGlobalFilters = lens _gpbrsGlobalFilters (\ s a -> s{_gpbrsGlobalFilters = a})
gpbrsApprovedPatchesComplianceLevel :: Lens' GetPatchBaselineResponse (Maybe PatchComplianceLevel)
gpbrsApprovedPatchesComplianceLevel = lens _gpbrsApprovedPatchesComplianceLevel (\ s a -> s{_gpbrsApprovedPatchesComplianceLevel = a})
gpbrsApprovedPatches :: Lens' GetPatchBaselineResponse [Text]
gpbrsApprovedPatches = lens _gpbrsApprovedPatches (\ s a -> s{_gpbrsApprovedPatches = a}) . _Default . _Coerce
gpbrsApprovedPatchesEnableNonSecurity :: Lens' GetPatchBaselineResponse (Maybe Bool)
gpbrsApprovedPatchesEnableNonSecurity = lens _gpbrsApprovedPatchesEnableNonSecurity (\ s a -> s{_gpbrsApprovedPatchesEnableNonSecurity = a})
gpbrsRejectedPatches :: Lens' GetPatchBaselineResponse [Text]
gpbrsRejectedPatches = lens _gpbrsRejectedPatches (\ s a -> s{_gpbrsRejectedPatches = a}) . _Default . _Coerce
gpbrsSources :: Lens' GetPatchBaselineResponse [PatchSource]
gpbrsSources = lens _gpbrsSources (\ s a -> s{_gpbrsSources = a}) . _Default . _Coerce
gpbrsCreatedDate :: Lens' GetPatchBaselineResponse (Maybe UTCTime)
gpbrsCreatedDate = lens _gpbrsCreatedDate (\ s a -> s{_gpbrsCreatedDate = a}) . mapping _Time
gpbrsName :: Lens' GetPatchBaselineResponse (Maybe Text)
gpbrsName = lens _gpbrsName (\ s a -> s{_gpbrsName = a})
gpbrsPatchGroups :: Lens' GetPatchBaselineResponse [Text]
gpbrsPatchGroups = lens _gpbrsPatchGroups (\ s a -> s{_gpbrsPatchGroups = a}) . _Default . _Coerce
gpbrsModifiedDate :: Lens' GetPatchBaselineResponse (Maybe UTCTime)
gpbrsModifiedDate = lens _gpbrsModifiedDate (\ s a -> s{_gpbrsModifiedDate = a}) . mapping _Time
gpbrsDescription :: Lens' GetPatchBaselineResponse (Maybe Text)
gpbrsDescription = lens _gpbrsDescription (\ s a -> s{_gpbrsDescription = a})
gpbrsBaselineId :: Lens' GetPatchBaselineResponse (Maybe Text)
gpbrsBaselineId = lens _gpbrsBaselineId (\ s a -> s{_gpbrsBaselineId = a})
gpbrsResponseStatus :: Lens' GetPatchBaselineResponse Int
gpbrsResponseStatus = lens _gpbrsResponseStatus (\ s a -> s{_gpbrsResponseStatus = a})
instance NFData GetPatchBaselineResponse where