{-# 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.DescribeInstancePatchStatesForPatchGroup
(
describeInstancePatchStatesForPatchGroup
, DescribeInstancePatchStatesForPatchGroup
, dipsfpgFilters
, dipsfpgNextToken
, dipsfpgMaxResults
, dipsfpgPatchGroup
, describeInstancePatchStatesForPatchGroupResponse
, DescribeInstancePatchStatesForPatchGroupResponse
, dipsfpgrsNextToken
, dipsfpgrsInstancePatchStates
, dipsfpgrsResponseStatus
) 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 DescribeInstancePatchStatesForPatchGroup = DescribeInstancePatchStatesForPatchGroup'
{ _dipsfpgFilters :: !(Maybe [InstancePatchStateFilter])
, _dipsfpgNextToken :: !(Maybe Text)
, _dipsfpgMaxResults :: !(Maybe Nat)
, _dipsfpgPatchGroup :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
describeInstancePatchStatesForPatchGroup
:: Text
-> DescribeInstancePatchStatesForPatchGroup
describeInstancePatchStatesForPatchGroup pPatchGroup_ =
DescribeInstancePatchStatesForPatchGroup'
{ _dipsfpgFilters = Nothing
, _dipsfpgNextToken = Nothing
, _dipsfpgMaxResults = Nothing
, _dipsfpgPatchGroup = pPatchGroup_
}
dipsfpgFilters :: Lens' DescribeInstancePatchStatesForPatchGroup [InstancePatchStateFilter]
dipsfpgFilters = lens _dipsfpgFilters (\ s a -> s{_dipsfpgFilters = a}) . _Default . _Coerce
dipsfpgNextToken :: Lens' DescribeInstancePatchStatesForPatchGroup (Maybe Text)
dipsfpgNextToken = lens _dipsfpgNextToken (\ s a -> s{_dipsfpgNextToken = a})
dipsfpgMaxResults :: Lens' DescribeInstancePatchStatesForPatchGroup (Maybe Natural)
dipsfpgMaxResults = lens _dipsfpgMaxResults (\ s a -> s{_dipsfpgMaxResults = a}) . mapping _Nat
dipsfpgPatchGroup :: Lens' DescribeInstancePatchStatesForPatchGroup Text
dipsfpgPatchGroup = lens _dipsfpgPatchGroup (\ s a -> s{_dipsfpgPatchGroup = a})
instance AWSRequest
DescribeInstancePatchStatesForPatchGroup
where
type Rs DescribeInstancePatchStatesForPatchGroup =
DescribeInstancePatchStatesForPatchGroupResponse
request = postJSON ssm
response
= receiveJSON
(\ s h x ->
DescribeInstancePatchStatesForPatchGroupResponse' <$>
(x .?> "NextToken") <*> (x .?> "InstancePatchStates")
<*> (pure (fromEnum s)))
instance Hashable
DescribeInstancePatchStatesForPatchGroup
where
instance NFData
DescribeInstancePatchStatesForPatchGroup
where
instance ToHeaders
DescribeInstancePatchStatesForPatchGroup
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AmazonSSM.DescribeInstancePatchStatesForPatchGroup"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON
DescribeInstancePatchStatesForPatchGroup
where
toJSON DescribeInstancePatchStatesForPatchGroup'{..}
= object
(catMaybes
[("Filters" .=) <$> _dipsfpgFilters,
("NextToken" .=) <$> _dipsfpgNextToken,
("MaxResults" .=) <$> _dipsfpgMaxResults,
Just ("PatchGroup" .= _dipsfpgPatchGroup)])
instance ToPath
DescribeInstancePatchStatesForPatchGroup
where
toPath = const "/"
instance ToQuery
DescribeInstancePatchStatesForPatchGroup
where
toQuery = const mempty
data DescribeInstancePatchStatesForPatchGroupResponse = DescribeInstancePatchStatesForPatchGroupResponse'
{ _dipsfpgrsNextToken :: !(Maybe Text)
, _dipsfpgrsInstancePatchStates :: !(Maybe (List1 InstancePatchState))
, _dipsfpgrsResponseStatus :: !Int
} deriving (Eq, Show, Data, Typeable, Generic)
describeInstancePatchStatesForPatchGroupResponse
:: Int
-> DescribeInstancePatchStatesForPatchGroupResponse
describeInstancePatchStatesForPatchGroupResponse pResponseStatus_ =
DescribeInstancePatchStatesForPatchGroupResponse'
{ _dipsfpgrsNextToken = Nothing
, _dipsfpgrsInstancePatchStates = Nothing
, _dipsfpgrsResponseStatus = pResponseStatus_
}
dipsfpgrsNextToken :: Lens' DescribeInstancePatchStatesForPatchGroupResponse (Maybe Text)
dipsfpgrsNextToken = lens _dipsfpgrsNextToken (\ s a -> s{_dipsfpgrsNextToken = a})
dipsfpgrsInstancePatchStates :: Lens' DescribeInstancePatchStatesForPatchGroupResponse (Maybe (NonEmpty InstancePatchState))
dipsfpgrsInstancePatchStates = lens _dipsfpgrsInstancePatchStates (\ s a -> s{_dipsfpgrsInstancePatchStates = a}) . mapping _List1
dipsfpgrsResponseStatus :: Lens' DescribeInstancePatchStatesForPatchGroupResponse Int
dipsfpgrsResponseStatus = lens _dipsfpgrsResponseStatus (\ s a -> s{_dipsfpgrsResponseStatus = a})
instance NFData
DescribeInstancePatchStatesForPatchGroupResponse
where