{-# 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.GetDefaultPatchBaseline
(
getDefaultPatchBaseline
, GetDefaultPatchBaseline
, gdpbOperatingSystem
, getDefaultPatchBaselineResponse
, GetDefaultPatchBaselineResponse
, gdpbrsOperatingSystem
, gdpbrsBaselineId
, gdpbrsResponseStatus
) 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 GetDefaultPatchBaseline = GetDefaultPatchBaseline'
{ _gdpbOperatingSystem :: Maybe OperatingSystem
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDefaultPatchBaseline
:: GetDefaultPatchBaseline
getDefaultPatchBaseline =
GetDefaultPatchBaseline' {_gdpbOperatingSystem = Nothing}
gdpbOperatingSystem :: Lens' GetDefaultPatchBaseline (Maybe OperatingSystem)
gdpbOperatingSystem = lens _gdpbOperatingSystem (\ s a -> s{_gdpbOperatingSystem = a})
instance AWSRequest GetDefaultPatchBaseline where
type Rs GetDefaultPatchBaseline =
GetDefaultPatchBaselineResponse
request = postJSON ssm
response
= receiveJSON
(\ s h x ->
GetDefaultPatchBaselineResponse' <$>
(x .?> "OperatingSystem") <*> (x .?> "BaselineId")
<*> (pure (fromEnum s)))
instance Hashable GetDefaultPatchBaseline where
instance NFData GetDefaultPatchBaseline where
instance ToHeaders GetDefaultPatchBaseline where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonSSM.GetDefaultPatchBaseline" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON GetDefaultPatchBaseline where
toJSON GetDefaultPatchBaseline'{..}
= object
(catMaybes
[("OperatingSystem" .=) <$> _gdpbOperatingSystem])
instance ToPath GetDefaultPatchBaseline where
toPath = const "/"
instance ToQuery GetDefaultPatchBaseline where
toQuery = const mempty
data GetDefaultPatchBaselineResponse = GetDefaultPatchBaselineResponse'
{ _gdpbrsOperatingSystem :: !(Maybe OperatingSystem)
, _gdpbrsBaselineId :: !(Maybe Text)
, _gdpbrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
getDefaultPatchBaselineResponse
:: Int
-> GetDefaultPatchBaselineResponse
getDefaultPatchBaselineResponse pResponseStatus_ =
GetDefaultPatchBaselineResponse'
{ _gdpbrsOperatingSystem = Nothing
, _gdpbrsBaselineId = Nothing
, _gdpbrsResponseStatus = pResponseStatus_
}
gdpbrsOperatingSystem :: Lens' GetDefaultPatchBaselineResponse (Maybe OperatingSystem)
gdpbrsOperatingSystem = lens _gdpbrsOperatingSystem (\ s a -> s{_gdpbrsOperatingSystem = a})
gdpbrsBaselineId :: Lens' GetDefaultPatchBaselineResponse (Maybe Text)
gdpbrsBaselineId = lens _gdpbrsBaselineId (\ s a -> s{_gdpbrsBaselineId = a})
gdpbrsResponseStatus :: Lens' GetDefaultPatchBaselineResponse Int
gdpbrsResponseStatus = lens _gdpbrsResponseStatus (\ s a -> s{_gdpbrsResponseStatus = a})
instance NFData GetDefaultPatchBaselineResponse where