{-# 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.DescribeEffectivePatchesForPatchBaseline
(
describeEffectivePatchesForPatchBaseline
, DescribeEffectivePatchesForPatchBaseline
, depfpbNextToken
, depfpbMaxResults
, depfpbBaselineId
, describeEffectivePatchesForPatchBaselineResponse
, DescribeEffectivePatchesForPatchBaselineResponse
, depfpbrsEffectivePatches
, depfpbrsNextToken
, depfpbrsResponseStatus
) 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 DescribeEffectivePatchesForPatchBaseline = DescribeEffectivePatchesForPatchBaseline'
{ _depfpbNextToken :: !(Maybe Text)
, _depfpbMaxResults :: !(Maybe Nat)
, _depfpbBaselineId :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeEffectivePatchesForPatchBaseline
:: Text
-> DescribeEffectivePatchesForPatchBaseline
describeEffectivePatchesForPatchBaseline pBaselineId_ =
DescribeEffectivePatchesForPatchBaseline'
{ _depfpbNextToken = Nothing
, _depfpbMaxResults = Nothing
, _depfpbBaselineId = pBaselineId_
}
depfpbNextToken :: Lens' DescribeEffectivePatchesForPatchBaseline (Maybe Text)
depfpbNextToken = lens _depfpbNextToken (\ s a -> s{_depfpbNextToken = a})
depfpbMaxResults :: Lens' DescribeEffectivePatchesForPatchBaseline (Maybe Natural)
depfpbMaxResults = lens _depfpbMaxResults (\ s a -> s{_depfpbMaxResults = a}) . mapping _Nat
depfpbBaselineId :: Lens' DescribeEffectivePatchesForPatchBaseline Text
depfpbBaselineId = lens _depfpbBaselineId (\ s a -> s{_depfpbBaselineId = a})
instance AWSRequest
DescribeEffectivePatchesForPatchBaseline
where
type Rs DescribeEffectivePatchesForPatchBaseline =
DescribeEffectivePatchesForPatchBaselineResponse
request = postJSON ssm
response
= receiveJSON
(\ s h x ->
DescribeEffectivePatchesForPatchBaselineResponse' <$>
(x .?> "EffectivePatches" .!@ mempty) <*>
(x .?> "NextToken")
<*> (pure (fromEnum s)))
instance Hashable
DescribeEffectivePatchesForPatchBaseline
where
instance NFData
DescribeEffectivePatchesForPatchBaseline
where
instance ToHeaders
DescribeEffectivePatchesForPatchBaseline
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonSSM.DescribeEffectivePatchesForPatchBaseline"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON
DescribeEffectivePatchesForPatchBaseline
where
toJSON DescribeEffectivePatchesForPatchBaseline'{..}
= object
(catMaybes
[("NextToken" .=) <$> _depfpbNextToken,
("MaxResults" .=) <$> _depfpbMaxResults,
Just ("BaselineId" .= _depfpbBaselineId)])
instance ToPath
DescribeEffectivePatchesForPatchBaseline
where
toPath = const "/"
instance ToQuery
DescribeEffectivePatchesForPatchBaseline
where
toQuery = const mempty
data DescribeEffectivePatchesForPatchBaselineResponse = DescribeEffectivePatchesForPatchBaselineResponse'
{ _depfpbrsEffectivePatches :: !(Maybe [EffectivePatch])
, _depfpbrsNextToken :: !(Maybe Text)
, _depfpbrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeEffectivePatchesForPatchBaselineResponse
:: Int
-> DescribeEffectivePatchesForPatchBaselineResponse
describeEffectivePatchesForPatchBaselineResponse pResponseStatus_ =
DescribeEffectivePatchesForPatchBaselineResponse'
{ _depfpbrsEffectivePatches = Nothing
, _depfpbrsNextToken = Nothing
, _depfpbrsResponseStatus = pResponseStatus_
}
depfpbrsEffectivePatches :: Lens' DescribeEffectivePatchesForPatchBaselineResponse [EffectivePatch]
depfpbrsEffectivePatches = lens _depfpbrsEffectivePatches (\ s a -> s{_depfpbrsEffectivePatches = a}) . _Default . _Coerce
depfpbrsNextToken :: Lens' DescribeEffectivePatchesForPatchBaselineResponse (Maybe Text)
depfpbrsNextToken = lens _depfpbrsNextToken (\ s a -> s{_depfpbrsNextToken = a})
depfpbrsResponseStatus :: Lens' DescribeEffectivePatchesForPatchBaselineResponse Int
depfpbrsResponseStatus = lens _depfpbrsResponseStatus (\ s a -> s{_depfpbrsResponseStatus = a})
instance NFData
DescribeEffectivePatchesForPatchBaselineResponse
where