{-# 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.RegisterDefaultPatchBaseline
(
registerDefaultPatchBaseline
, RegisterDefaultPatchBaseline
, rdpbBaselineId
, registerDefaultPatchBaselineResponse
, RegisterDefaultPatchBaselineResponse
, rdpbrsBaselineId
, rdpbrsResponseStatus
) 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 RegisterDefaultPatchBaseline = RegisterDefaultPatchBaseline'
{ _rdpbBaselineId :: Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
registerDefaultPatchBaseline
:: Text
-> RegisterDefaultPatchBaseline
registerDefaultPatchBaseline pBaselineId_ =
RegisterDefaultPatchBaseline' {_rdpbBaselineId = pBaselineId_}
rdpbBaselineId :: Lens' RegisterDefaultPatchBaseline Text
rdpbBaselineId = lens _rdpbBaselineId (\ s a -> s{_rdpbBaselineId = a})
instance AWSRequest RegisterDefaultPatchBaseline
where
type Rs RegisterDefaultPatchBaseline =
RegisterDefaultPatchBaselineResponse
request = postJSON ssm
response
= receiveJSON
(\ s h x ->
RegisterDefaultPatchBaselineResponse' <$>
(x .?> "BaselineId") <*> (pure (fromEnum s)))
instance Hashable RegisterDefaultPatchBaseline where
instance NFData RegisterDefaultPatchBaseline where
instance ToHeaders RegisterDefaultPatchBaseline where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonSSM.RegisterDefaultPatchBaseline" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON RegisterDefaultPatchBaseline where
toJSON RegisterDefaultPatchBaseline'{..}
= object
(catMaybes [Just ("BaselineId" .= _rdpbBaselineId)])
instance ToPath RegisterDefaultPatchBaseline where
toPath = const "/"
instance ToQuery RegisterDefaultPatchBaseline where
toQuery = const mempty
data RegisterDefaultPatchBaselineResponse = RegisterDefaultPatchBaselineResponse'
{ _rdpbrsBaselineId :: !(Maybe Text)
, _rdpbrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
registerDefaultPatchBaselineResponse
:: Int
-> RegisterDefaultPatchBaselineResponse
registerDefaultPatchBaselineResponse pResponseStatus_ =
RegisterDefaultPatchBaselineResponse'
{_rdpbrsBaselineId = Nothing, _rdpbrsResponseStatus = pResponseStatus_}
rdpbrsBaselineId :: Lens' RegisterDefaultPatchBaselineResponse (Maybe Text)
rdpbrsBaselineId = lens _rdpbrsBaselineId (\ s a -> s{_rdpbrsBaselineId = a})
rdpbrsResponseStatus :: Lens' RegisterDefaultPatchBaselineResponse Int
rdpbrsResponseStatus = lens _rdpbrsResponseStatus (\ s a -> s{_rdpbrsResponseStatus = a})
instance NFData RegisterDefaultPatchBaselineResponse
where